screenshotone-api-sdk 1.1.4 → 1.1.6
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.
- package/dist/@types/main.d.ts +17 -1
- package/dist/main.js +35 -1
- package/package.json +1 -1
- package/src/main.ts +45 -1
package/dist/@types/main.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare class Client {
|
|
|
50
50
|
* @param options
|
|
51
51
|
* @returns
|
|
52
52
|
*/
|
|
53
|
-
store(options: AnimateOptions | TakeOptions, path: string, bucket?: string, acl?: "public-read" | "", storageClass?: string): Promise<{
|
|
53
|
+
store(options: AnimateOptions | TakeOptions, path: string, bucket?: string, acl?: "public-read" | "", storageClass?: string, accessKeyId?: string, secretAccessKey?: string): Promise<{
|
|
54
54
|
bucket: string | null;
|
|
55
55
|
key: string | null;
|
|
56
56
|
}>;
|
|
@@ -311,6 +311,14 @@ export declare class TakeOptions {
|
|
|
311
311
|
* You can override the default bucket you configured with storage_bucket=<bucket name>.
|
|
312
312
|
*/
|
|
313
313
|
storageBucket(bucket: string): TakeOptions;
|
|
314
|
+
/**
|
|
315
|
+
* Access key ID. It overrides the one specified in the dashboard configuration.
|
|
316
|
+
*/
|
|
317
|
+
storageAccessKeyId(accessKeyId: string): TakeOptions;
|
|
318
|
+
/**
|
|
319
|
+
* Secret access key. It overrides the one specified in the dashboard configuration.
|
|
320
|
+
*/
|
|
321
|
+
storageSecretAccessKey(secretAccessKey: string): TakeOptions;
|
|
314
322
|
/**
|
|
315
323
|
* Storage class allows you to specify the object storage class.
|
|
316
324
|
*/
|
|
@@ -528,6 +536,14 @@ export declare class AnimateOptions {
|
|
|
528
536
|
* Make sure you configured access to S3.
|
|
529
537
|
*/
|
|
530
538
|
store(store: boolean): AnimateOptions;
|
|
539
|
+
/**
|
|
540
|
+
* Access key ID. It overrides the one specified in the dashboard configuration.
|
|
541
|
+
*/
|
|
542
|
+
storageAccessKeyId(accessKeyId: string): AnimateOptions;
|
|
543
|
+
/**
|
|
544
|
+
* Secret access key. It overrides the one specified in the dashboard configuration.
|
|
545
|
+
*/
|
|
546
|
+
storageSecretAccessKey(secretAccessKey: string): AnimateOptions;
|
|
531
547
|
/**
|
|
532
548
|
* The parameter is required if you set store=true.
|
|
533
549
|
* You must specify the key for the file, but don’t specify an extension,
|
package/dist/main.js
CHANGED
|
@@ -111,7 +111,7 @@ class Client {
|
|
|
111
111
|
* @param options
|
|
112
112
|
* @returns
|
|
113
113
|
*/
|
|
114
|
-
async store(options, path, bucket, acl, storageClass) {
|
|
114
|
+
async store(options, path, bucket, acl, storageClass, accessKeyId, secretAccessKey) {
|
|
115
115
|
options.store(true).storagePath(path).responseType("empty");
|
|
116
116
|
if (bucket) {
|
|
117
117
|
options.storageBucket(bucket);
|
|
@@ -122,6 +122,12 @@ class Client {
|
|
|
122
122
|
if (storageClass) {
|
|
123
123
|
options.storageClass(storageClass);
|
|
124
124
|
}
|
|
125
|
+
if (accessKeyId) {
|
|
126
|
+
options.storageAccessKeyId(accessKeyId);
|
|
127
|
+
}
|
|
128
|
+
if (secretAccessKey) {
|
|
129
|
+
options.storageSecretAccessKey(secretAccessKey);
|
|
130
|
+
}
|
|
125
131
|
const url = options instanceof TakeOptions
|
|
126
132
|
? await this.generateSignedTakeURL(options)
|
|
127
133
|
: await this.generateSignedAnimateURL(options);
|
|
@@ -569,6 +575,20 @@ class TakeOptions {
|
|
|
569
575
|
this.put("storage_bucket", bucket);
|
|
570
576
|
return this;
|
|
571
577
|
}
|
|
578
|
+
/**
|
|
579
|
+
* Access key ID. It overrides the one specified in the dashboard configuration.
|
|
580
|
+
*/
|
|
581
|
+
storageAccessKeyId(accessKeyId) {
|
|
582
|
+
this.put("storage_access_key_id", accessKeyId);
|
|
583
|
+
return this;
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Secret access key. It overrides the one specified in the dashboard configuration.
|
|
587
|
+
*/
|
|
588
|
+
storageSecretAccessKey(secretAccessKey) {
|
|
589
|
+
this.put("storage_secret_access_key", secretAccessKey);
|
|
590
|
+
return this;
|
|
591
|
+
}
|
|
572
592
|
/**
|
|
573
593
|
* Storage class allows you to specify the object storage class.
|
|
574
594
|
*/
|
|
@@ -935,6 +955,20 @@ class AnimateOptions {
|
|
|
935
955
|
this.put("store", store ? "true" : "false");
|
|
936
956
|
return this;
|
|
937
957
|
}
|
|
958
|
+
/**
|
|
959
|
+
* Access key ID. It overrides the one specified in the dashboard configuration.
|
|
960
|
+
*/
|
|
961
|
+
storageAccessKeyId(accessKeyId) {
|
|
962
|
+
this.put("storage_access_key_id", accessKeyId);
|
|
963
|
+
return this;
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Secret access key. It overrides the one specified in the dashboard configuration.
|
|
967
|
+
*/
|
|
968
|
+
storageSecretAccessKey(secretAccessKey) {
|
|
969
|
+
this.put("storage_secret_access_key", secretAccessKey);
|
|
970
|
+
return this;
|
|
971
|
+
}
|
|
938
972
|
/**
|
|
939
973
|
* The parameter is required if you set store=true.
|
|
940
974
|
* You must specify the key for the file, but don’t specify an extension,
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -139,7 +139,9 @@ export class Client {
|
|
|
139
139
|
path: string,
|
|
140
140
|
bucket?: string,
|
|
141
141
|
acl?: "public-read" | "",
|
|
142
|
-
storageClass?: string
|
|
142
|
+
storageClass?: string,
|
|
143
|
+
accessKeyId?: string,
|
|
144
|
+
secretAccessKey?: string,
|
|
143
145
|
): Promise<{ bucket: string | null; key: string | null }> {
|
|
144
146
|
options.store(true).storagePath(path).responseType("empty");
|
|
145
147
|
|
|
@@ -152,6 +154,12 @@ export class Client {
|
|
|
152
154
|
if (storageClass) {
|
|
153
155
|
options.storageClass(storageClass);
|
|
154
156
|
}
|
|
157
|
+
if (accessKeyId) {
|
|
158
|
+
options.storageAccessKeyId(accessKeyId)
|
|
159
|
+
}
|
|
160
|
+
if (secretAccessKey) {
|
|
161
|
+
options.storageSecretAccessKey(secretAccessKey)
|
|
162
|
+
}
|
|
155
163
|
|
|
156
164
|
const url =
|
|
157
165
|
options instanceof TakeOptions
|
|
@@ -724,6 +732,24 @@ export class TakeOptions {
|
|
|
724
732
|
return this;
|
|
725
733
|
}
|
|
726
734
|
|
|
735
|
+
/**
|
|
736
|
+
* Access key ID. It overrides the one specified in the dashboard configuration.
|
|
737
|
+
*/
|
|
738
|
+
storageAccessKeyId(accessKeyId: string): TakeOptions {
|
|
739
|
+
this.put("storage_access_key_id", accessKeyId);
|
|
740
|
+
|
|
741
|
+
return this;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Secret access key. It overrides the one specified in the dashboard configuration.
|
|
746
|
+
*/
|
|
747
|
+
storageSecretAccessKey(secretAccessKey: string): TakeOptions {
|
|
748
|
+
this.put("storage_secret_access_key", secretAccessKey);
|
|
749
|
+
|
|
750
|
+
return this;
|
|
751
|
+
}
|
|
752
|
+
|
|
727
753
|
/**
|
|
728
754
|
* Storage class allows you to specify the object storage class.
|
|
729
755
|
*/
|
|
@@ -1188,6 +1214,24 @@ export class AnimateOptions {
|
|
|
1188
1214
|
return this;
|
|
1189
1215
|
}
|
|
1190
1216
|
|
|
1217
|
+
/**
|
|
1218
|
+
* Access key ID. It overrides the one specified in the dashboard configuration.
|
|
1219
|
+
*/
|
|
1220
|
+
storageAccessKeyId(accessKeyId: string): AnimateOptions {
|
|
1221
|
+
this.put("storage_access_key_id", accessKeyId);
|
|
1222
|
+
|
|
1223
|
+
return this;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
/**
|
|
1227
|
+
* Secret access key. It overrides the one specified in the dashboard configuration.
|
|
1228
|
+
*/
|
|
1229
|
+
storageSecretAccessKey(secretAccessKey: string): AnimateOptions {
|
|
1230
|
+
this.put("storage_secret_access_key", secretAccessKey);
|
|
1231
|
+
|
|
1232
|
+
return this;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1191
1235
|
/**
|
|
1192
1236
|
* The parameter is required if you set store=true.
|
|
1193
1237
|
* You must specify the key for the file, but don’t specify an extension,
|