screenshotone-api-sdk 1.0.15 → 1.0.16
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/main.js +3 -3
- package/package.json +1 -2
- package/src/main.ts +4 -4
package/dist/main.js
CHANGED
|
@@ -30,13 +30,13 @@ exports.TakeOptions = exports.Client = void 0;
|
|
|
30
30
|
const crypto = __importStar(require("crypto"));
|
|
31
31
|
const big_js_1 = __importDefault(require("big.js"));
|
|
32
32
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
33
|
+
const API_BASE_URL = "https://api.screenshotone.com";
|
|
34
|
+
const API_TAKE_PATH = "/take";
|
|
33
35
|
/**
|
|
34
36
|
* Represents an API client for the screenshotone.com API.
|
|
35
37
|
*/
|
|
36
38
|
class Client {
|
|
37
39
|
constructor(accessKey, secretKey) {
|
|
38
|
-
this.API_BASE_URL = "https://api.screenshotone.com";
|
|
39
|
-
this.API_TAKE_PATH = "/take";
|
|
40
40
|
this.accessKey = accessKey;
|
|
41
41
|
this.secretKey = secretKey;
|
|
42
42
|
}
|
|
@@ -48,7 +48,7 @@ class Client {
|
|
|
48
48
|
.update(queryString, 'utf-8')
|
|
49
49
|
.digest('hex');
|
|
50
50
|
queryString += '&signature=' + signature;
|
|
51
|
-
return `${
|
|
51
|
+
return `${API_BASE_URL}${API_TAKE_PATH}?${queryString}`;
|
|
52
52
|
}
|
|
53
53
|
async take(options) {
|
|
54
54
|
const url = this.generateTakeURL(options);
|
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.
|
|
4
|
+
"version": "1.0.16",
|
|
5
5
|
"description": "Use ScreenshotOne.com API to generate screenshots of any website.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
},
|
|
30
30
|
"main": "dist/main.js",
|
|
31
31
|
"types": "dist/@types/main.d.ts",
|
|
32
|
-
"type": "module",
|
|
33
32
|
"devDependencies": {
|
|
34
33
|
"@types/big.js": "^6.1.3",
|
|
35
34
|
"@types/node": "^17.0.40",
|
package/src/main.ts
CHANGED
|
@@ -2,13 +2,13 @@ import * as crypto from 'crypto';
|
|
|
2
2
|
import Big from 'big.js';
|
|
3
3
|
import fetch from 'cross-fetch';
|
|
4
4
|
|
|
5
|
+
const API_BASE_URL = "https://api.screenshotone.com";
|
|
6
|
+
const API_TAKE_PATH = "/take";
|
|
7
|
+
|
|
5
8
|
/**
|
|
6
9
|
* Represents an API client for the screenshotone.com API.
|
|
7
10
|
*/
|
|
8
11
|
export class Client {
|
|
9
|
-
private readonly API_BASE_URL = "https://api.screenshotone.com";
|
|
10
|
-
private readonly API_TAKE_PATH = "/take";
|
|
11
|
-
|
|
12
12
|
private readonly accessKey: string;
|
|
13
13
|
private readonly secretKey: string;
|
|
14
14
|
|
|
@@ -27,7 +27,7 @@ export class Client {
|
|
|
27
27
|
.digest('hex');
|
|
28
28
|
queryString += '&signature=' + signature;
|
|
29
29
|
|
|
30
|
-
return `${
|
|
30
|
+
return `${API_BASE_URL}${API_TAKE_PATH}?${queryString}`;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
async take(options: TakeOptions): Promise<Blob> {
|