screenshotone-api-sdk 1.1.11 → 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.
- package/dist/@types/main.d.ts +23 -9
- package/dist/main.js +38 -9
- package/package.json +1 -1
- package/src/main.ts +49 -10
package/dist/@types/main.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
595
|
+
* You can also specify "subdirectories" in the path part.
|
|
596
596
|
*/
|
|
597
597
|
storagePath(path: string): AnimateOptions;
|
|
598
598
|
/**
|
|
@@ -616,5 +616,19 @@ export declare class AnimateOptions {
|
|
|
616
616
|
scrollDuration(duration: number): AnimateOptions;
|
|
617
617
|
scrollStartImmediately(startImmediately: boolean): AnimateOptions;
|
|
618
618
|
scrollBack(scrollBack: boolean): AnimateOptions;
|
|
619
|
+
scrollBackAfterDuration(duration: number): AnimateOptions;
|
|
620
|
+
scrollStartDelay(delay: number): AnimateOptions;
|
|
621
|
+
scrollComplete(complete: boolean): AnimateOptions;
|
|
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;
|
|
619
633
|
toQuery(): URLSearchParams;
|
|
620
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1041
|
+
* You can also specify "subdirectories" in the path part.
|
|
1042
1042
|
*/
|
|
1043
1043
|
storagePath(path) {
|
|
1044
1044
|
this.put("storage_path", path);
|
|
@@ -1092,6 +1092,35 @@ class AnimateOptions {
|
|
|
1092
1092
|
this.put("scroll_back", scrollBack ? "true" : "false");
|
|
1093
1093
|
return this;
|
|
1094
1094
|
}
|
|
1095
|
+
scrollBackAfterDuration(duration) {
|
|
1096
|
+
this.put("scroll_back_after_duration", duration.toString());
|
|
1097
|
+
return this;
|
|
1098
|
+
}
|
|
1099
|
+
scrollStartDelay(delay) {
|
|
1100
|
+
this.put("scroll_start_delay", delay.toString());
|
|
1101
|
+
return this;
|
|
1102
|
+
}
|
|
1103
|
+
scrollComplete(complete) {
|
|
1104
|
+
this.put("scroll_complete", complete ? "true" : "false");
|
|
1105
|
+
return this;
|
|
1106
|
+
}
|
|
1107
|
+
scrollBy(pixels) {
|
|
1108
|
+
this.put("scroll_by", pixels.toString());
|
|
1109
|
+
return this;
|
|
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
|
+
}
|
|
1095
1124
|
toQuery() {
|
|
1096
1125
|
return new URLSearchParams(this.query.toString());
|
|
1097
1126
|
}
|
package/package.json
CHANGED
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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);
|
|
@@ -1377,7 +1377,6 @@ export class AnimateOptions {
|
|
|
1377
1377
|
|
|
1378
1378
|
return this;
|
|
1379
1379
|
}
|
|
1380
|
-
|
|
1381
1380
|
scrollStartImmediately(startImmediately: boolean): AnimateOptions {
|
|
1382
1381
|
this.put(
|
|
1383
1382
|
"scroll_start_immediately",
|
|
@@ -1388,6 +1387,46 @@ export class AnimateOptions {
|
|
|
1388
1387
|
|
|
1389
1388
|
scrollBack(scrollBack: boolean): AnimateOptions {
|
|
1390
1389
|
this.put("scroll_back", scrollBack ? "true" : "false");
|
|
1390
|
+
|
|
1391
|
+
return this;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
scrollBackAfterDuration(duration: number): AnimateOptions {
|
|
1395
|
+
this.put("scroll_back_after_duration", duration.toString());
|
|
1396
|
+
|
|
1397
|
+
return this;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
scrollStartDelay(delay: number): AnimateOptions {
|
|
1401
|
+
this.put("scroll_start_delay", delay.toString());
|
|
1402
|
+
|
|
1403
|
+
return this;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
scrollComplete(complete: boolean): AnimateOptions {
|
|
1407
|
+
this.put("scroll_complete", complete ? "true" : "false");
|
|
1408
|
+
|
|
1409
|
+
return this;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
scrollBy(pixels: number): AnimateOptions {
|
|
1413
|
+
this.put("scroll_by", pixels.toString());
|
|
1414
|
+
|
|
1415
|
+
return this;
|
|
1416
|
+
}
|
|
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
|
+
|
|
1391
1430
|
return this;
|
|
1392
1431
|
}
|
|
1393
1432
|
|