screenshotone-api-sdk 1.1.5 → 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.
@@ -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
  */
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
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "screenshotone-api-sdk",
3
3
  "homepage": "https://screenshotone.com",
4
- "version": "1.1.5",
4
+ "version": "1.1.6",
5
5
  "description": "Use ScreenshotOne.com API to generate screenshots of any website.",
6
6
  "repository": {
7
7
  "type": "git",
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
  */
@@ -1194,7 +1220,7 @@ export class AnimateOptions {
1194
1220
  storageAccessKeyId(accessKeyId: string): AnimateOptions {
1195
1221
  this.put("storage_access_key_id", accessKeyId);
1196
1222
 
1197
- return this
1223
+ return this;
1198
1224
  }
1199
1225
 
1200
1226
  /**
@@ -1203,7 +1229,7 @@ export class AnimateOptions {
1203
1229
  storageSecretAccessKey(secretAccessKey: string): AnimateOptions {
1204
1230
  this.put("storage_secret_access_key", secretAccessKey);
1205
1231
 
1206
- return this
1232
+ return this;
1207
1233
  }
1208
1234
 
1209
1235
  /**