screenshotone-api-sdk 1.1.12 → 1.1.13

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.
@@ -82,7 +82,7 @@ export declare class TakeOptions {
82
82
  /**
83
83
  * Available response types:
84
84
  * 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;
85
- * 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.
85
+ * 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.
86
86
  * The default value is by_format.
87
87
  */
88
88
  responseType(responseType: string): this;
@@ -109,7 +109,7 @@ export declare class TakeOptions {
109
109
  /**
110
110
  * Set `true` to request site rendering, if supported, in the dark mode.
111
111
  * Set `false` to request site rendering in the light mode if supported.
112
- * If you don’t set the parameter. The site is rendered in the default mode.
112
+ * If you don't set the parameter. The site is rendered in the default mode.
113
113
  */
114
114
  darkMode(darkMode: boolean): TakeOptions;
115
115
  /**
@@ -299,7 +299,7 @@ export declare class TakeOptions {
299
299
  */
300
300
  scrollIntoView(selector: string): TakeOptions;
301
301
  /**
302
- * After the given element appears in the viewport and its top coordinate is aligned with the viewport’s top,
302
+ * After the given element appears in the viewport and its top coordinate is aligned with the viewport's top,
303
303
  * you can adjust the position a bit before taking a screenshot.
304
304
  */
305
305
  scrollIntoViewAdjustTop(adjustTop: number): TakeOptions;
@@ -345,9 +345,9 @@ export declare class TakeOptions {
345
345
  store(store: boolean): TakeOptions;
346
346
  /**
347
347
  * The parameter is required if you set store=true.
348
- * You must specify the key for the file, but don’t specify an extension,
348
+ * You must specify the key for the file, but don't specify an extension,
349
349
  * it will be added automatically based on the format you specified.
350
- * You can also specify “subdirectories” in the path part.
350
+ * You can also specify "subdirectories" in the path part.
351
351
  */
352
352
  storagePath(path: string): TakeOptions;
353
353
  storageACL(acl: string): TakeOptions;
@@ -391,7 +391,7 @@ export declare class AnimateOptions {
391
391
  /**
392
392
  * Available response types:
393
393
  * 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;
394
- * 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.
394
+ * 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.
395
395
  * The default value is by_format.
396
396
  */
397
397
  responseType(responseType: string): this;
@@ -410,7 +410,7 @@ export declare class AnimateOptions {
410
410
  /**
411
411
  * Set `true` to request site rendering, if supported, in the dark mode.
412
412
  * Set `false` to request site rendering in the light mode if supported.
413
- * If you don’t set the parameter. The site is rendered in the default mode.
413
+ * If you don't set the parameter. The site is rendered in the default mode.
414
414
  */
415
415
  darkMode(darkMode: boolean): AnimateOptions;
416
416
  /**
@@ -590,9 +590,9 @@ export declare class AnimateOptions {
590
590
  storageSecretAccessKey(secretAccessKey: string): AnimateOptions;
591
591
  /**
592
592
  * The parameter is required if you set store=true.
593
- * You must specify the key for the file, but don’t specify an extension,
593
+ * You must specify the key for the file, but don't specify an extension,
594
594
  * it will be added automatically based on the format you specified.
595
- * You can also specify “subdirectories” in the path part.
595
+ * You can also specify "subdirectories" in the path part.
596
596
  */
597
597
  storagePath(path: string): AnimateOptions;
598
598
  /**
@@ -620,5 +620,15 @@ export declare class AnimateOptions {
620
620
  scrollStartDelay(delay: number): AnimateOptions;
621
621
  scrollComplete(complete: boolean): AnimateOptions;
622
622
  scrollBy(pixels: number): AnimateOptions;
623
+ /**
624
+ * When the site responds out of the range of 200-299 status code,
625
+ * you can ignore errors and take a screenshot of the error page anyway.
626
+ * To do that, set the option "ignore_host_errors" to true.
627
+ * It is false by default.
628
+ *
629
+ * It is helpful when you want to create a gallery of error pages or,
630
+ * for some reason, you need to render error pages.
631
+ */
632
+ ignoreHostErrors(ignore: boolean): AnimateOptions;
623
633
  toQuery(): URLSearchParams;
624
634
  }
package/dist/main.js CHANGED
@@ -196,7 +196,7 @@ class TakeOptions {
196
196
  /**
197
197
  * Available response types:
198
198
  * 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;
199
- * 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.
199
+ * 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.
200
200
  * The default value is by_format.
201
201
  */
202
202
  responseType(responseType) {
@@ -238,7 +238,7 @@ class TakeOptions {
238
238
  /**
239
239
  * Set `true` to request site rendering, if supported, in the dark mode.
240
240
  * Set `false` to request site rendering in the light mode if supported.
241
- * If you don’t set the parameter. The site is rendered in the default mode.
241
+ * If you don't set the parameter. The site is rendered in the default mode.
242
242
  */
243
243
  darkMode(darkMode) {
244
244
  this.put("dark_mode", darkMode ? "true" : "false");
@@ -548,7 +548,7 @@ class TakeOptions {
548
548
  return this;
549
549
  }
550
550
  /**
551
- * After the given element appears in the viewport and its top coordinate is aligned with the viewport’s top,
551
+ * After the given element appears in the viewport and its top coordinate is aligned with the viewport's top,
552
552
  * you can adjust the position a bit before taking a screenshot.
553
553
  */
554
554
  scrollIntoViewAdjustTop(adjustTop) {
@@ -621,9 +621,9 @@ class TakeOptions {
621
621
  }
622
622
  /**
623
623
  * The parameter is required if you set store=true.
624
- * You must specify the key for the file, but don’t specify an extension,
624
+ * You must specify the key for the file, but don't specify an extension,
625
625
  * it will be added automatically based on the format you specified.
626
- * You can also specify “subdirectories” in the path part.
626
+ * You can also specify "subdirectories" in the path part.
627
627
  */
628
628
  storagePath(path) {
629
629
  this.put("storage_path", path);
@@ -711,7 +711,7 @@ class AnimateOptions {
711
711
  /**
712
712
  * Available response types:
713
713
  * 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;
714
- * 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.
714
+ * 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.
715
715
  * The default value is by_format.
716
716
  */
717
717
  responseType(responseType) {
@@ -739,7 +739,7 @@ class AnimateOptions {
739
739
  /**
740
740
  * Set `true` to request site rendering, if supported, in the dark mode.
741
741
  * Set `false` to request site rendering in the light mode if supported.
742
- * If you don’t set the parameter. The site is rendered in the default mode.
742
+ * If you don't set the parameter. The site is rendered in the default mode.
743
743
  */
744
744
  darkMode(darkMode) {
745
745
  this.put("dark_mode", darkMode ? "true" : "false");
@@ -1036,9 +1036,9 @@ class AnimateOptions {
1036
1036
  }
1037
1037
  /**
1038
1038
  * The parameter is required if you set store=true.
1039
- * You must specify the key for the file, but don’t specify an extension,
1039
+ * You must specify the key for the file, but don't specify an extension,
1040
1040
  * it will be added automatically based on the format you specified.
1041
- * You can also specify “subdirectories” in the path part.
1041
+ * You can also specify "subdirectories" in the path part.
1042
1042
  */
1043
1043
  storagePath(path) {
1044
1044
  this.put("storage_path", path);
@@ -1108,6 +1108,19 @@ class AnimateOptions {
1108
1108
  this.put("scroll_by", pixels.toString());
1109
1109
  return this;
1110
1110
  }
1111
+ /**
1112
+ * When the site responds out of the range of 200-299 status code,
1113
+ * you can ignore errors and take a screenshot of the error page anyway.
1114
+ * To do that, set the option "ignore_host_errors" to true.
1115
+ * It is false by default.
1116
+ *
1117
+ * It is helpful when you want to create a gallery of error pages or,
1118
+ * for some reason, you need to render error pages.
1119
+ */
1120
+ ignoreHostErrors(ignore) {
1121
+ this.put("ignore_host_errors", ignore ? "true" : "false");
1122
+ return this;
1123
+ }
1111
1124
  toQuery() {
1112
1125
  return new URLSearchParams(this.query.toString());
1113
1126
  }
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.12",
4
+ "version": "1.1.13",
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
@@ -248,7 +248,7 @@ export class TakeOptions {
248
248
  /**
249
249
  * Available response types:
250
250
  * 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;
251
- * 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.
251
+ * 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.
252
252
  * The default value is by_format.
253
253
  */
254
254
  responseType(responseType: string) {
@@ -300,7 +300,7 @@ export class TakeOptions {
300
300
  /**
301
301
  * Set `true` to request site rendering, if supported, in the dark mode.
302
302
  * Set `false` to request site rendering in the light mode if supported.
303
- * If you don’t set the parameter. The site is rendered in the default mode.
303
+ * If you don't set the parameter. The site is rendered in the default mode.
304
304
  */
305
305
  darkMode(darkMode: boolean): TakeOptions {
306
306
  this.put("dark_mode", darkMode ? "true" : "false");
@@ -696,7 +696,7 @@ export class TakeOptions {
696
696
  }
697
697
 
698
698
  /**
699
- * After the given element appears in the viewport and its top coordinate is aligned with the viewport’s top,
699
+ * After the given element appears in the viewport and its top coordinate is aligned with the viewport's top,
700
700
  * you can adjust the position a bit before taking a screenshot.
701
701
  */
702
702
  scrollIntoViewAdjustTop(adjustTop: number): TakeOptions {
@@ -787,9 +787,9 @@ export class TakeOptions {
787
787
 
788
788
  /**
789
789
  * The parameter is required if you set store=true.
790
- * You must specify the key for the file, but don’t specify an extension,
790
+ * You must specify the key for the file, but don't specify an extension,
791
791
  * it will be added automatically based on the format you specified.
792
- * You can also specify “subdirectories” in the path part.
792
+ * You can also specify "subdirectories" in the path part.
793
793
  */
794
794
  storagePath(path: string): TakeOptions {
795
795
  this.put("storage_path", path);
@@ -899,7 +899,7 @@ export class AnimateOptions {
899
899
  /**
900
900
  * Available response types:
901
901
  * 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;
902
- * 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.
902
+ * 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.
903
903
  * The default value is by_format.
904
904
  */
905
905
  responseType(responseType: string) {
@@ -933,7 +933,7 @@ export class AnimateOptions {
933
933
  /**
934
934
  * Set `true` to request site rendering, if supported, in the dark mode.
935
935
  * Set `false` to request site rendering in the light mode if supported.
936
- * If you don’t set the parameter. The site is rendered in the default mode.
936
+ * If you don't set the parameter. The site is rendered in the default mode.
937
937
  */
938
938
  darkMode(darkMode: boolean): AnimateOptions {
939
939
  this.put("dark_mode", darkMode ? "true" : "false");
@@ -1314,9 +1314,9 @@ export class AnimateOptions {
1314
1314
 
1315
1315
  /**
1316
1316
  * The parameter is required if you set store=true.
1317
- * You must specify the key for the file, but don’t specify an extension,
1317
+ * You must specify the key for the file, but don't specify an extension,
1318
1318
  * it will be added automatically based on the format you specified.
1319
- * You can also specify “subdirectories” in the path part.
1319
+ * You can also specify "subdirectories" in the path part.
1320
1320
  */
1321
1321
  storagePath(path: string): AnimateOptions {
1322
1322
  this.put("storage_path", path);
@@ -1415,6 +1415,21 @@ export class AnimateOptions {
1415
1415
  return this;
1416
1416
  }
1417
1417
 
1418
+ /**
1419
+ * When the site responds out of the range of 200-299 status code,
1420
+ * you can ignore errors and take a screenshot of the error page anyway.
1421
+ * To do that, set the option "ignore_host_errors" to true.
1422
+ * It is false by default.
1423
+ *
1424
+ * It is helpful when you want to create a gallery of error pages or,
1425
+ * for some reason, you need to render error pages.
1426
+ */
1427
+ ignoreHostErrors(ignore: boolean): AnimateOptions {
1428
+ this.put("ignore_host_errors", ignore ? "true" : "false");
1429
+
1430
+ return this;
1431
+ }
1432
+
1418
1433
  toQuery(): URLSearchParams {
1419
1434
  return new URLSearchParams(this.query.toString());
1420
1435
  }