screenshotone-api-sdk 1.0.22 → 1.0.24

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.
@@ -28,9 +28,16 @@ export declare class TakeOptions {
28
28
  static markdown(markdown: string): TakeOptions;
29
29
  private put;
30
30
  /**
31
- * Selector is a CSS-like selector of the element to take a screenshot of.
32
- */
31
+ * Selector is a CSS-like selector of the element to take a screenshot of.
32
+ */
33
33
  selector(selector: string): this;
34
+ /**
35
+ * Available response types:
36
+ * by_format — return exactly the response defined in the format option. If format=png, the response will be the binary representation of the png with the content type header image/png;
37
+ * empty — return only status or error. It is suitable when you want to upload the screenshot to storage and don’t care about the results. It also speeds up the response since there are no networking costs involved.
38
+ * The default value is by_format.
39
+ */
40
+ responseType(responseType: string): this;
34
41
  /**
35
42
  * It determines the behavior of what to do when selector is not found.
36
43
  */
@@ -207,5 +214,26 @@ export declare class TakeOptions {
207
214
  * Sets timeout.
208
215
  */
209
216
  timeout(timeout: number): TakeOptions;
217
+ /**
218
+ * Default value is false. Use store=true to trigger upload of the taken screenshot,
219
+ * rendered HTML or PDF to the configured S3 bucket.
220
+ * Make sure you configured access to S3.
221
+ */
222
+ store(store: boolean): TakeOptions;
223
+ /**
224
+ * The parameter is required if you set store=true.
225
+ * You must specify the key for the file, but don’t specify an extension,
226
+ * it will be added automatically based on the format you specified.
227
+ * You can also specify “subdirectories” in the path part.
228
+ */
229
+ storagePath(path: string): TakeOptions;
230
+ /**
231
+ * You can override the default bucket you configured with storage_bucket=<bucket name>.
232
+ */
233
+ storageBucket(bucket: string): TakeOptions;
234
+ /**
235
+ * Storage class allows you to specify the object storage class.
236
+ */
237
+ storageClass(storageClass: string): TakeOptions;
210
238
  toQuery(): URLSearchParams;
211
239
  }
package/dist/main.js CHANGED
@@ -100,12 +100,22 @@ class TakeOptions {
100
100
  }
101
101
  ;
102
102
  /**
103
- * Selector is a CSS-like selector of the element to take a screenshot of.
104
- */
103
+ * Selector is a CSS-like selector of the element to take a screenshot of.
104
+ */
105
105
  selector(selector) {
106
106
  this.put("selector", selector);
107
107
  return this;
108
108
  }
109
+ /**
110
+ * Available response types:
111
+ * by_format — return exactly the response defined in the format option. If format=png, the response will be the binary representation of the png with the content type header image/png;
112
+ * empty — return only status or error. It is suitable when you want to upload the screenshot to storage and don’t care about the results. It also speeds up the response since there are no networking costs involved.
113
+ * The default value is by_format.
114
+ */
115
+ responseType(responseType) {
116
+ this.put("response_type", responseType);
117
+ return this;
118
+ }
109
119
  /**
110
120
  * It determines the behavior of what to do when selector is not found.
111
121
  */
@@ -396,6 +406,39 @@ class TakeOptions {
396
406
  this.put("timeout", timeout.toString());
397
407
  return this;
398
408
  }
409
+ /**
410
+ * Default value is false. Use store=true to trigger upload of the taken screenshot,
411
+ * rendered HTML or PDF to the configured S3 bucket.
412
+ * Make sure you configured access to S3.
413
+ */
414
+ store(store) {
415
+ this.put("store", store ? "true" : "false");
416
+ return this;
417
+ }
418
+ /**
419
+ * The parameter is required if you set store=true.
420
+ * You must specify the key for the file, but don’t specify an extension,
421
+ * it will be added automatically based on the format you specified.
422
+ * You can also specify “subdirectories” in the path part.
423
+ */
424
+ storagePath(path) {
425
+ this.put("storage_path", path);
426
+ return this;
427
+ }
428
+ /**
429
+ * You can override the default bucket you configured with storage_bucket=<bucket name>.
430
+ */
431
+ storageBucket(bucket) {
432
+ this.put("storage_bucket", bucket);
433
+ return this;
434
+ }
435
+ /**
436
+ * Storage class allows you to specify the object storage class.
437
+ */
438
+ storageClass(storageClass) {
439
+ this.put("storage_class", storageClass);
440
+ return this;
441
+ }
399
442
  toQuery() {
400
443
  return new URLSearchParams(this.query.toString());
401
444
  }
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.0.22",
4
+ "version": "1.0.24",
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
@@ -92,14 +92,26 @@ export class TakeOptions {
92
92
  };
93
93
 
94
94
  /**
95
- * Selector is a CSS-like selector of the element to take a screenshot of.
96
- */
95
+ * Selector is a CSS-like selector of the element to take a screenshot of.
96
+ */
97
97
  selector(selector: string) {
98
98
  this.put("selector", selector);
99
99
 
100
100
  return this;
101
101
  }
102
102
 
103
+ /**
104
+ * Available response types:
105
+ * by_format — return exactly the response defined in the format option. If format=png, the response will be the binary representation of the png with the content type header image/png;
106
+ * empty — return only status or error. It is suitable when you want to upload the screenshot to storage and don’t care about the results. It also speeds up the response since there are no networking costs involved.
107
+ * The default value is by_format.
108
+ */
109
+ responseType(responseType: string) {
110
+ this.put("response_type", responseType);
111
+
112
+ return this;
113
+ }
114
+
103
115
  /**
104
116
  * It determines the behavior of what to do when selector is not found.
105
117
  */
@@ -467,6 +479,47 @@ export class TakeOptions {
467
479
  return this;
468
480
  }
469
481
 
482
+ /**
483
+ * Default value is false. Use store=true to trigger upload of the taken screenshot,
484
+ * rendered HTML or PDF to the configured S3 bucket.
485
+ * Make sure you configured access to S3.
486
+ */
487
+ store(store: boolean): TakeOptions {
488
+ this.put("store", store ? "true" : "false");
489
+
490
+ return this;
491
+ }
492
+
493
+ /**
494
+ * The parameter is required if you set store=true.
495
+ * You must specify the key for the file, but don’t specify an extension,
496
+ * it will be added automatically based on the format you specified.
497
+ * You can also specify “subdirectories” in the path part.
498
+ */
499
+ storagePath(path: string): TakeOptions {
500
+ this.put("storage_path", path);
501
+
502
+ return this;
503
+ }
504
+
505
+ /**
506
+ * You can override the default bucket you configured with storage_bucket=<bucket name>.
507
+ */
508
+ storageBucket(bucket: string): TakeOptions {
509
+ this.put("storage_bucket", bucket);
510
+
511
+ return this;
512
+ }
513
+
514
+ /**
515
+ * Storage class allows you to specify the object storage class.
516
+ */
517
+ storageClass(storageClass: string): TakeOptions {
518
+ this.put("storage_class", storageClass);
519
+
520
+ return this;
521
+ }
522
+
470
523
  toQuery(): URLSearchParams {
471
524
  return new URLSearchParams(this.query.toString());
472
525
  }