screenshotone-api-sdk 1.1.10 → 1.1.12
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 +4 -0
- package/dist/main.js +18 -2
- package/package.json +1 -1
- package/src/main.ts +27 -3
package/dist/@types/main.d.ts
CHANGED
|
@@ -616,5 +616,9 @@ 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;
|
|
619
623
|
toQuery(): URLSearchParams;
|
|
620
624
|
}
|
package/dist/main.js
CHANGED
|
@@ -80,7 +80,7 @@ class Client {
|
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
82
|
const data = await response.json();
|
|
83
|
-
throw new Error(`failed to take screenshot, response returned ${response.status} ${response.statusText}: ${data?.
|
|
83
|
+
throw new Error(`failed to take screenshot, response returned ${response.status} ${response.statusText}: ${data?.error_message}`);
|
|
84
84
|
}
|
|
85
85
|
catch (e) {
|
|
86
86
|
throw new Error(`failed to take screenshot, response returned ${response.status} ${response.statusText}`);
|
|
@@ -100,7 +100,7 @@ class Client {
|
|
|
100
100
|
}
|
|
101
101
|
try {
|
|
102
102
|
const data = await response.json();
|
|
103
|
-
throw new Error(`failed to generate animation, response returned ${response.status} ${response.statusText}: ${data?.
|
|
103
|
+
throw new Error(`failed to generate animation, response returned ${response.status} ${response.statusText}: ${data?.error_message}`);
|
|
104
104
|
}
|
|
105
105
|
catch (e) {
|
|
106
106
|
throw new Error(`failed to generate animation, response returned ${response.status} ${response.statusText}`);
|
|
@@ -1092,6 +1092,22 @@ 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
|
+
}
|
|
1095
1111
|
toQuery() {
|
|
1096
1112
|
return new URLSearchParams(this.query.toString());
|
|
1097
1113
|
}
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -95,7 +95,7 @@ export class Client {
|
|
|
95
95
|
const data = await response.json();
|
|
96
96
|
|
|
97
97
|
throw new Error(
|
|
98
|
-
`failed to take screenshot, response returned ${response.status} ${response.statusText}: ${data?.
|
|
98
|
+
`failed to take screenshot, response returned ${response.status} ${response.statusText}: ${data?.error_message}`
|
|
99
99
|
);
|
|
100
100
|
} catch (e) {
|
|
101
101
|
throw new Error(
|
|
@@ -121,7 +121,7 @@ export class Client {
|
|
|
121
121
|
const data = await response.json();
|
|
122
122
|
|
|
123
123
|
throw new Error(
|
|
124
|
-
`failed to generate animation, response returned ${response.status} ${response.statusText}: ${data?.
|
|
124
|
+
`failed to generate animation, response returned ${response.status} ${response.statusText}: ${data?.error_message}`
|
|
125
125
|
);
|
|
126
126
|
} catch (e) {
|
|
127
127
|
throw new Error(
|
|
@@ -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,31 @@ 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
|
+
|
|
1391
1415
|
return this;
|
|
1392
1416
|
}
|
|
1393
1417
|
|