screenshotone-api-sdk 1.0.10 → 1.0.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/main.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -43,9 +44,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
43
44
  }
44
45
  return to.concat(ar || Array.prototype.slice.call(from));
45
46
  };
46
- import * as crypto from 'crypto';
47
- import Big from 'big.js';
48
- import fetch from 'node-fetch';
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.TakeOptions = exports.Client = void 0;
49
+ var crypto = require("crypto");
50
+ var big_js_1 = require("big.js");
51
+ var cross_fetch_1 = require("cross-fetch");
49
52
  /**
50
53
  * Represents an API client for the screenshotone.com API.
51
54
  */
@@ -73,7 +76,7 @@ var Client = /** @class */ (function () {
73
76
  switch (_a.label) {
74
77
  case 0:
75
78
  url = this.generateTakeURL(options);
76
- return [4 /*yield*/, fetch(url)];
79
+ return [4 /*yield*/, (0, cross_fetch_1.default)(url)];
77
80
  case 1:
78
81
  response = _a.sent();
79
82
  if (!response.ok) return [3 /*break*/, 3];
@@ -86,7 +89,7 @@ var Client = /** @class */ (function () {
86
89
  };
87
90
  return Client;
88
91
  }());
89
- export { Client };
92
+ exports.Client = Client;
90
93
  /**
91
94
  * Represents options for taking screenshots.
92
95
  */
@@ -168,14 +171,14 @@ var TakeOptions = /** @class */ (function () {
168
171
  * Both latitude and longitude are required if one of them is set.
169
172
  */
170
173
  TakeOptions.prototype.geolocationLatitude = function (latitude) {
171
- this.put("geolocation_latitude", new Big(latitude).toFixed(20).replace(/0+$/, ""));
174
+ this.put("geolocation_latitude", new big_js_1.default(latitude).toFixed(20).replace(/0+$/, ""));
172
175
  return this;
173
176
  };
174
177
  /**
175
178
  * Sets geolocation longitude for the request. Both latitude and longitude are required if one of them is set.
176
179
  */
177
180
  TakeOptions.prototype.geolocationLongitude = function (longitude) {
178
- this.put("geolocation_longitude", new Big(longitude).toFixed(20).replace(/0+$/, ""));
181
+ this.put("geolocation_longitude", new big_js_1.default(longitude).toFixed(20).replace(/0+$/, ""));
179
182
  return this;
180
183
  };
181
184
  /**
@@ -308,5 +311,5 @@ var TakeOptions = /** @class */ (function () {
308
311
  };
309
312
  return TakeOptions;
310
313
  }());
311
- export { TakeOptions };
314
+ exports.TakeOptions = TakeOptions;
312
315
  //# sourceMappingURL=main.js.map
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.10",
4
+ "version": "1.0.13",
5
5
  "description": "Use ScreenshotOne.com API to generate screenshots of any website.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -22,27 +22,25 @@
22
22
  "render"
23
23
  ],
24
24
  "author": "Dmytro Krasun",
25
- "license": "MIT",
25
+ "license": "MIT",
26
26
  "bugs": {
27
27
  "email": "support@screenshotone.com",
28
28
  "url": "https://github.com/screenshotone/tssdk/issues"
29
29
  },
30
30
  "main": "dist/main.js",
31
- "type": "module",
32
31
  "types": "dist/@types/main.d.ts",
33
32
  "typings": "dist/@types/main.d.ts",
34
33
  "devDependencies": {
35
- "typescript": "^4.7.3",
34
+ "@types/big.js": "^6.1.3",
36
35
  "@types/node": "^17.0.40",
37
- "@types/big.js": "^6.1.3"
36
+ "typescript": "^4.7.3"
38
37
  },
39
38
  "dependencies": {
40
39
  "big.js": "^6.2.0",
41
- "node-fetch": "^3.2.5"
40
+ "cross-fetch": "^3.1.5"
42
41
  },
43
42
  "scripts": {
44
- "prepublish": "npm run build",
45
- "prepare" : "npm run build",
46
- "build": "tsc --build"
43
+ "build": "tsc",
44
+ "prepare": "npm run build"
47
45
  }
48
- }
46
+ }
package/src/main.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as crypto from 'crypto';
2
2
  import Big from 'big.js';
3
- import fetch from 'node-fetch';
3
+ import fetch from 'cross-fetch';
4
4
 
5
5
  /**
6
6
  * Represents an API client for the screenshotone.com API.
package/tsconfig.json CHANGED
@@ -1,17 +1,23 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "module": "es2015",
4
- "moduleResolution": "node",
5
- "esModuleInterop": true,
6
- "outDir": "./dist",
7
- "strict": true,
8
- "noImplicitAny": true,
9
- "removeComments": false,
10
- "preserveConstEnums": true,
11
- "sourceMap": true,
12
- "declaration": true,
13
- "declarationDir": "dist/@types",
3
+ "declaration": true,
4
+ "strictNullChecks": true,
5
+ "target": "es5",
6
+ "outDir": "dist",
7
+ "module": "commonjs",
8
+ "moduleResolution": "node",
9
+ "sourceMap": true,
10
+ "lib": [
11
+ "es2015",
12
+ "dom"
13
+ ],
14
+ "rootDir": "src"
14
15
  },
15
- "include": ["src/**/*"],
16
- "exclude": ["node_modules"]
17
- }
16
+ "include": [
17
+ "src/**/*"
18
+ ],
19
+ "exclude": [
20
+ "node_modules",
21
+ "dist"
22
+ ]
23
+ }