@types/ali-oss 6.0.11 → 6.16.3

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 +100 -5
  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: Sat, 18 Sep 2021 08:01:23 GMT
11
+ * Last updated: Fri, 18 Feb 2022 14:31:33 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
  /**
@@ -149,6 +149,8 @@ declare namespace OSS {
149
149
  interface ObjectMeta {
150
150
  /** object name on oss */
151
151
  name: string;
152
+ /** object url */
153
+ url: string;
152
154
  /** object last modified GMT date, e.g.: 2015-02-19T08:39:44.000Z */
153
155
  lastModified: string;
154
156
  /** object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" */
@@ -158,7 +160,17 @@ declare namespace OSS {
158
160
  /** object size, e.g.: 344606 */
159
161
  size: number;
160
162
  storageClass: StorageType;
161
- 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
+ }>;
162
174
  }
163
175
 
164
176
  interface NormalSuccessResponse {
@@ -173,7 +185,11 @@ declare namespace OSS {
173
185
  rt: number;
174
186
  }
175
187
 
176
- interface UserMeta {
188
+ /**
189
+ * @see x-oss-meta-* in https://help.aliyun.com/document_detail/31978.html for Aliyun user
190
+ * @see x-oss-meta-* in https://www.alibabacloud.com/help/en/doc-detail/31978.html for AlibabaCloud user
191
+ */
192
+ interface UserMeta extends Record<string, string | number> {
177
193
  uid: number;
178
194
  pid: number;
179
195
  }
@@ -239,6 +255,7 @@ declare namespace OSS {
239
255
  /** the remote addr */
240
256
  RemoteAddr: string;
241
257
  }
258
+
242
259
  // parameters type
243
260
  interface ListBucketsQueryType {
244
261
  /** search buckets using prefix key */
@@ -272,6 +289,28 @@ declare namespace OSS {
272
289
  delimiter?: string | undefined; // delimiter search scope e.g.
273
290
  /** max objects, default is 100, limit to 1000 */
274
291
  'max-keys': string | number;
292
+ /** Specifies that the object names in the response are URL-encoded. */
293
+ 'encoding-type'?: 'url' | '';
294
+ }
295
+
296
+ interface ListV2ObjectsQuery {
297
+ /** search object using prefix key */
298
+ prefix?: string;
299
+ /** search start from token, including token key */
300
+ 'continuation-token'?: string;
301
+ /** only search current dir, not including subdir */
302
+ delimiter?: string | number;
303
+ /** max objects, default is 100, limit to 1000 */
304
+ 'max-keys'?: string;
305
+ /**
306
+ * The name of the object from which the list operation begins.
307
+ * If this parameter is specified, objects whose names are alphabetically greater than the start-after parameter value are returned.
308
+ */
309
+ 'start-after'?: string;
310
+ /** Specifies whether to include the information about object owners in the response. */
311
+ 'fetch-owner'?: boolean;
312
+ /** Specifies that the object names in the response are URL-encoded. */
313
+ 'encoding-type'?: 'url' | '';
275
314
  }
276
315
 
277
316
  interface ListObjectResult {
@@ -591,6 +630,18 @@ declare namespace OSS {
591
630
  /** the operation timeout */
592
631
  timeout?: number | undefined;
593
632
  }
633
+
634
+ interface GetBucketPolicyResult {
635
+ policy: BucketPolicy | null;
636
+ status: number;
637
+ res: NormalSuccessResponse;
638
+ }
639
+
640
+ interface PostObjectParams {
641
+ policy: string;
642
+ OSSAccessKeyId: string;
643
+ Signature: string;
644
+ }
594
645
  }
595
646
 
596
647
  // cluster
@@ -606,11 +657,16 @@ declare namespace OSS {
606
657
  schedule?: string | undefined;
607
658
  }
608
659
 
609
- class Cluster {
660
+ class ClusterClient {
610
661
  constructor(options: ClusterOptions);
611
662
 
612
663
  list(query: ListObjectsQuery | null, options: RequestOptions): Promise<ListObjectResult>;
613
664
 
665
+ /**
666
+ * @since 6.12.0
667
+ */
668
+ listV2(query: ListV2ObjectsQuery | null, options: RequestOptions): Promise<ListObjectResult>;
669
+
614
670
  put(name: string, file: any, options?: PutObjectOptions): Promise<PutObjectResult>;
615
671
 
616
672
  putStream(
@@ -886,6 +942,35 @@ declare class OSS {
886
942
  */
887
943
  deleteBucketCORS(name: string): Promise<OSS.NormalSuccessResponse>;
888
944
 
945
+ // policy operations
946
+ /**
947
+ * Adds or modify policy for a bucket.
948
+ */
949
+ putBucketPolicy(
950
+ name: string,
951
+ policy: OSS.BucketPolicy,
952
+ options?: OSS.RequestOptions
953
+ ): Promise<{
954
+ status: number,
955
+ res: OSS.NormalSuccessResponse,
956
+ }>;
957
+
958
+ /**
959
+ * Obtains the policy for a bucket.
960
+ */
961
+ getBucketPolicy(name: string, options?: OSS.RequestOptions): Promise<OSS.GetBucketPolicyResult>;
962
+
963
+ /**
964
+ * Deletes the policy added for a bucket.
965
+ */
966
+ deleteBucketPolicy(
967
+ name: string,
968
+ options?: OSS.RequestOptions
969
+ ): Promise<{
970
+ status: number,
971
+ res: OSS.NormalSuccessResponse,
972
+ }>;
973
+
889
974
  /********************************************************** Object operations ********************************************/
890
975
  /**
891
976
  * List objects in the bucket.
@@ -1057,6 +1142,16 @@ declare class OSS {
1057
1142
  options?: OSS.RequestOptions,
1058
1143
  ): Promise<OSS.NormalSuccessResponse>;
1059
1144
 
1145
+ /**
1146
+ * get postObject params.
1147
+ */
1148
+ calculatePostSignature(
1149
+ /**
1150
+ * policy config object or JSON string
1151
+ */
1152
+ policy: object | string
1153
+ ): OSS.PostObjectParams;
1154
+
1060
1155
  /************************************************ RTMP Operations *************************************************************/
1061
1156
  /**
1062
1157
  * 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.11",
3
+ "version": "6.16.3",
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": "bd38560fcac2b30b10f7d686a37a7d677519fb8f3d36e1c4899de9df5ff73a3a",
24
- "typeScriptVersion": "3.7"
23
+ "typesPublisherContentHash": "4433b0f3e5b2ce255a06937c0fb9e830d816e3a808d9f053a3521cfb9718e790",
24
+ "typeScriptVersion": "3.8"
25
25
  }