Skip to content

Commit 5aaf576

Browse files
WanGe2000周翔
andauthored
🤖 Merge PR DefinitelyTyped#74364 [@types/ali-oss] Add putSymlink and getSymlink definition by @WanGe2000
Co-authored-by: 周翔 <zhouxiang@wanjiadongli.com>
1 parent ba18559 commit 5aaf576

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

‎types/ali-oss/ali-oss-tests.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ const ossOptions: OSS.Options = {
1010

1111
const client = new OSS(ossOptions);
1212

13+
client.putSymlink("newfile.png", "sourcefile.png");
14+
client.putSymlink("newfile.png", "sourcefile.png", {
15+
storageClass: "IA",
16+
meta: {
17+
uid: 1,
18+
pid: 0,
19+
},
20+
});
21+
22+
client.getSymlink("newfile.png");
23+
client.getSymlink("newfile.png", { versionId: "123" });
24+
1325
client.listV2({ "max-keys": 1000 });
1426
client.copy("newfile.png", "sourcefile.png");
1527
client.copy("newfile.png", "sourcefile.png", { timeout: 1000 });

‎types/ali-oss/index.d.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,15 @@ declare namespace OSS {
581581
uploads: Upload[];
582582
}
583583

584+
interface PutSymlinkOptions {
585+
/** the storage type include (Standard,IA,Archive) */
586+
storageClass?: string | undefined;
587+
/** user meta, will send with x-oss-meta- prefix string */
588+
meta?: UserMeta | undefined;
589+
/** extra headers */
590+
headers?: object | undefined;
591+
}
592+
584593
interface PutChannelConf {
585594
Description?: string | undefined;
586595
Status?: string | undefined;
@@ -1210,6 +1219,23 @@ declare class OSS {
12101219
policy: object | string,
12111220
): OSS.PostObjectParams;
12121221

1222+
/**
1223+
* put symlink
1224+
*/
1225+
putSymlink(
1226+
name: string,
1227+
targetName: string,
1228+
options?: OSS.PutSymlinkOptions,
1229+
): Promise<{ res: OSS.NormalSuccessResponse }>;
1230+
1231+
/**
1232+
* get symlink
1233+
*/
1234+
getSymlink(
1235+
name: string,
1236+
options?: { versionId?: string | undefined; timeout?: number | undefined; headers?: object | undefined },
1237+
): Promise<{ targetName: string; res: OSS.NormalSuccessResponse }>;
1238+
12131239
/************************************************ RTMP Operations *************************************************************/
12141240
/**
12151241
* Create a live channel.

0 commit comments

Comments
 (0)