@types/ali-oss 6.0.10 → 6.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. ali-oss/README.md +1 -1
  2. ali-oss/index.d.ts +98 -4
  3. ali-oss/package.json +3 -3
ali-oss/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for ali-oss (https://github.com/aliyun/os
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ali-oss.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 13 Jul 2021 13:31:23 GMT
11
+ * Last updated: Tue, 16 Nov 2021 04:01:22 GMT
12
12
  * Dependencies: none
13
13
  * Global values: none
14
14
 
ali-oss/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for ali-oss 6.0
1
+ // Type definitions for ali-oss 6.16
2
2
  // Project: https://github.com/aliyun/oss-nodejs-sdk
3
3
  // Definitions by: Ptrdu <https://github.com/ptrdu>
4
4
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -32,7 +32,7 @@ declare namespace OSS {
32
32
  /** use time (ms) of refresh STSToken interval it should be less than sts info expire interval, default is 300000ms(5min) when sts info expires. */
33
33
  refreshSTSTokenInterval?: number;
34
34
  /** used by auto set stsToken、accessKeyId、accessKeySecret when sts info expires. return value must be object contains stsToken、accessKeyId、accessKeySecret */
35
- refreshSTSToken?: () => Promise<{accessKeyId: string, accessKeySecret: string, stsToken: string}>;
35
+ refreshSTSToken?: () => Promise<{ accessKeyId: string, accessKeySecret: string, stsToken: string }>;
36
36
  }
37
37
 
38
38
  /**
@@ -106,6 +106,8 @@ declare namespace OSS {
106
106
 
107
107
  type HTTPMethods = 'GET' | 'POST' | 'DELETE' | 'PUT';
108
108
 
109
+ type RedundancyType = 'LRS' | 'ZRS';
110
+
109
111
  interface RequestOptions {
110
112
  // the operation timeout
111
113
  timeout?: number | undefined;
@@ -147,6 +149,8 @@ declare namespace OSS {
147
149
  interface ObjectMeta {
148
150
  /** object name on oss */
149
151
  name: string;
152
+ /** object url */
153
+ url: string;
150
154
  /** object last modified GMT date, e.g.: 2015-02-19T08:39:44.000Z */
151
155
  lastModified: string;
152
156
  /** object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" */
@@ -156,7 +160,17 @@ declare namespace OSS {
156
160
  /** object size, e.g.: 344606 */
157
161
  size: number;
158
162
  storageClass: StorageType;
159
- owner: OwnerType;
163
+ owner?: OwnerType;
164
+ }
165
+
166
+ interface BucketPolicy {
167
+ Version: string;
168
+ Statement: Array<{
169
+ Action: string[];
170
+ Effect: 'Allow' | 'Deny';
171
+ Principal: string[];
172
+ Resource: string[];
173
+ }>;
160
174
  }
161
175
 
162
176
  interface NormalSuccessResponse {
@@ -248,6 +262,8 @@ declare namespace OSS {
248
262
  }
249
263
 
250
264
  interface PutBucketOptions {
265
+ acl: ACLType;
266
+ dataRedundancyType: RedundancyType;
251
267
  timeout: number;
252
268
  storageClass: StorageType;
253
269
  }
@@ -268,6 +284,28 @@ declare namespace OSS {
268
284
  delimiter?: string | undefined; // delimiter search scope e.g.
269
285
  /** max objects, default is 100, limit to 1000 */
270
286
  'max-keys': string | number;
287
+ /** Specifies that the object names in the response are URL-encoded. */
288
+ 'encoding-type'?: 'url' | '';
289
+ }
290
+
291
+ interface ListV2ObjectsQuery {
292
+ /** search object using prefix key */
293
+ prefix?: string;
294
+ /** search start from token, including token key */
295
+ 'continuation-token'?: string;
296
+ /** only search current dir, not including subdir */
297
+ delimiter?: string | number;
298
+ /** max objects, default is 100, limit to 1000 */
299
+ 'max-keys'?: string;
300
+ /**
301
+ * The name of the object from which the list operation begins.
302
+ * If this parameter is specified, objects whose names are alphabetically greater than the start-after parameter value are returned.
303
+ */
304
+ 'start-after'?: string;
305
+ /** Specifies whether to include the information about object owners in the response. */
306
+ 'fetch-owner'?: boolean;
307
+ /** Specifies that the object names in the response are URL-encoded. */
308
+ 'encoding-type'?: 'url' | '';
271
309
  }
272
310
 
273
311
  interface ListObjectResult {
@@ -587,6 +625,18 @@ declare namespace OSS {
587
625
  /** the operation timeout */
588
626
  timeout?: number | undefined;
589
627
  }
628
+
629
+ interface GetBucketPolicyResult {
630
+ policy: BucketPolicy | null;
631
+ status: number;
632
+ res: NormalSuccessResponse;
633
+ }
634
+
635
+ interface PostObjectParams {
636
+ policy: string;
637
+ OSSAccessKeyId: string;
638
+ Signature: string;
639
+ }
590
640
  }
591
641
 
592
642
  // cluster
@@ -602,11 +652,16 @@ declare namespace OSS {
602
652
  schedule?: string | undefined;
603
653
  }
604
654
 
605
- class Cluster {
655
+ class ClusterClient {
606
656
  constructor(options: ClusterOptions);
607
657
 
608
658
  list(query: ListObjectsQuery | null, options: RequestOptions): Promise<ListObjectResult>;
609
659
 
660
+ /**
661
+ * @since 6.12.0
662
+ */
663
+ listV2(query: ListV2ObjectsQuery | null, options: RequestOptions): Promise<ListObjectResult>;
664
+
610
665
  put(name: string, file: any, options?: PutObjectOptions): Promise<PutObjectResult>;
611
666
 
612
667
  putStream(
@@ -882,6 +937,35 @@ declare class OSS {
882
937
  */
883
938
  deleteBucketCORS(name: string): Promise<OSS.NormalSuccessResponse>;
884
939
 
940
+ // policy operations
941
+ /**
942
+ * Adds or modify policy for a bucket.
943
+ */
944
+ putBucketPolicy(
945
+ name: string,
946
+ policy: OSS.BucketPolicy,
947
+ options?: OSS.RequestOptions
948
+ ): Promise<{
949
+ status: number,
950
+ res: OSS.NormalSuccessResponse,
951
+ }>;
952
+
953
+ /**
954
+ * Obtains the policy for a bucket.
955
+ */
956
+ getBucketPolicy(name: string, options?: OSS.RequestOptions): Promise<OSS.GetBucketPolicyResult>;
957
+
958
+ /**
959
+ * Deletes the policy added for a bucket.
960
+ */
961
+ deleteBucketPolicy(
962
+ name: string,
963
+ options?: OSS.RequestOptions
964
+ ): Promise<{
965
+ status: number,
966
+ res: OSS.NormalSuccessResponse,
967
+ }>;
968
+
885
969
  /********************************************************** Object operations ********************************************/
886
970
  /**
887
971
  * List objects in the bucket.
@@ -1053,6 +1137,16 @@ declare class OSS {
1053
1137
  options?: OSS.RequestOptions,
1054
1138
  ): Promise<OSS.NormalSuccessResponse>;
1055
1139
 
1140
+ /**
1141
+ * get postObject params.
1142
+ */
1143
+ calculatePostSignature(
1144
+ /**
1145
+ * policy config object or JSON string
1146
+ */
1147
+ policy: object | string
1148
+ ): OSS.PostObjectParams;
1149
+
1056
1150
  /************************************************ RTMP Operations *************************************************************/
1057
1151
  /**
1058
1152
  * Create a live channel.
ali-oss/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/ali-oss",
3
- "version": "6.0.10",
3
+ "version": "6.16.2",
4
4
  "description": "TypeScript definitions for ali-oss",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ali-oss",
6
6
  "license": "MIT",
@@ -20,6 +20,6 @@
20
20
  },
21
21
  "scripts": {},
22
22
  "dependencies": {},
23
- "typesPublisherContentHash": "4e71b1b1973ee9a48f6c9409f6f307a4f8bf2e40595974f0ab0481d2c2e3f9ec",
24
- "typeScriptVersion": "3.6"
23
+ "typesPublisherContentHash": "9418e79c8ab9a56aeb8a9b25184bf67eb7e0a03868f2fab55f0dc57bcc46b5aa",
24
+ "typeScriptVersion": "3.7"
25
25
  }