@decodo/sdk-ts 2.0.0 → 2.0.1
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/README.md +415 -17
- package/package.json +1 -1
- package/build/cjs/api/web-scraping-api.d.ts +0 -13
- package/build/cjs/api/web-scraping-api.js +0 -41
- package/build/cjs/client.d.ts +0 -11
- package/build/cjs/client.js +0 -34
- package/build/cjs/errors.d.ts +0 -18
- package/build/cjs/errors.js +0 -44
- package/build/cjs/generated/parameters.d.ts +0 -11
- package/build/cjs/generated/parameters.js +0 -85
- package/build/cjs/generated/request-schemas.d.ts +0 -2123
- package/build/cjs/generated/request-schemas.js +0 -2431
- package/build/cjs/generated/targets.d.ts +0 -735
- package/build/cjs/generated/targets.js +0 -343
- package/build/cjs/http.d.ts +0 -22
- package/build/cjs/http.js +0 -94
- package/build/cjs/index.d.ts +0 -9
- package/build/cjs/index.js +0 -19
- package/build/cjs/types/requests.d.ts +0 -1
- package/build/cjs/types/requests.js +0 -2
- package/build/cjs/types/responses.d.ts +0 -62
- package/build/cjs/types/responses.js +0 -2
- package/build/esm/api/web-scraping-api.d.ts +0 -13
- package/build/esm/api/web-scraping-api.js +0 -37
- package/build/esm/client.d.ts +0 -11
- package/build/esm/client.js +0 -30
- package/build/esm/errors.d.ts +0 -18
- package/build/esm/errors.js +0 -36
- package/build/esm/generated/parameters.d.ts +0 -11
- package/build/esm/generated/parameters.js +0 -82
- package/build/esm/generated/request-schemas.d.ts +0 -2123
- package/build/esm/generated/request-schemas.js +0 -2395
- package/build/esm/generated/targets.d.ts +0 -735
- package/build/esm/generated/targets.js +0 -340
- package/build/esm/http.d.ts +0 -22
- package/build/esm/http.js +0 -90
- package/build/esm/index.d.ts +0 -9
- package/build/esm/index.js +0 -5
- package/build/esm/types/requests.d.ts +0 -1
- package/build/esm/types/requests.js +0 -1
- package/build/esm/types/responses.d.ts +0 -62
- package/build/esm/types/responses.js +0 -1
package/build/cjs/errors.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TimeoutError = exports.ValidationError = exports.RateLimitError = exports.AuthenticationError = exports.DecodoError = void 0;
|
|
4
|
-
class DecodoError extends Error {
|
|
5
|
-
statusCode;
|
|
6
|
-
apiStatus;
|
|
7
|
-
constructor(message, statusCode, apiStatus) {
|
|
8
|
-
super(message);
|
|
9
|
-
this.name = 'DecodoError';
|
|
10
|
-
this.statusCode = statusCode;
|
|
11
|
-
this.apiStatus = apiStatus;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.DecodoError = DecodoError;
|
|
15
|
-
class AuthenticationError extends DecodoError {
|
|
16
|
-
constructor(message = 'Authentication failed. Check your credentials.') {
|
|
17
|
-
super(message, 401, 'failed');
|
|
18
|
-
this.name = 'AuthenticationError';
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.AuthenticationError = AuthenticationError;
|
|
22
|
-
class RateLimitError extends DecodoError {
|
|
23
|
-
constructor(message = 'Rate limit exceeded. Slow down your request rate.') {
|
|
24
|
-
super(message, 429, 'failed');
|
|
25
|
-
this.name = 'RateLimitError';
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.RateLimitError = RateLimitError;
|
|
29
|
-
class ValidationError extends DecodoError {
|
|
30
|
-
errors;
|
|
31
|
-
constructor(message, errors) {
|
|
32
|
-
super(message, 422, 'failed');
|
|
33
|
-
this.name = 'ValidationError';
|
|
34
|
-
this.errors = errors;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.ValidationError = ValidationError;
|
|
38
|
-
class TimeoutError extends Error {
|
|
39
|
-
constructor(message = 'The request timed out.') {
|
|
40
|
-
super(message);
|
|
41
|
-
this.name = 'TimeoutError';
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.TimeoutError = TimeoutError;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Auto-generated by src/codegen/web-scraping-api/generate-parameters.ts — do not edit
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.parameterMeta = void 0;
|
|
5
|
-
exports.parameterMeta = {
|
|
6
|
-
"360": { type: "boolean" },
|
|
7
|
-
callback_url: { type: "string" },
|
|
8
|
-
query: { type: "string", maxLength: 2048 },
|
|
9
|
-
headless: { type: "string", enum: ["html", "png"] },
|
|
10
|
-
locale: { type: "string" },
|
|
11
|
-
geo: { type: "string" },
|
|
12
|
-
device_type: { type: "string" },
|
|
13
|
-
page_from: { type: "number", minimum: 0, maximum: 100 },
|
|
14
|
-
google_results_language: { type: "string" },
|
|
15
|
-
google_tbm: { type: "string" },
|
|
16
|
-
google_tbs: { type: "string" },
|
|
17
|
-
parse: { type: "boolean" },
|
|
18
|
-
google_nfpr: { type: "boolean" },
|
|
19
|
-
google_safe_search: { type: "boolean" },
|
|
20
|
-
session_id: { type: "string" },
|
|
21
|
-
xhr: { type: "boolean" },
|
|
22
|
-
markdown: { type: "boolean" },
|
|
23
|
-
page_count: { type: "number", minimum: 1, maximum: 10 },
|
|
24
|
-
date_range: { type: "string" },
|
|
25
|
-
stars: { type: "number" },
|
|
26
|
-
adults: { type: "number", minimum: 1, maximum: 3 },
|
|
27
|
-
children: { type: "number", minimum: 1, maximum: 3 },
|
|
28
|
-
search_type: { type: "string" },
|
|
29
|
-
date_start: { type: "string" },
|
|
30
|
-
date_end: { type: "string" },
|
|
31
|
-
url: { type: "string", maxLength: 2056 },
|
|
32
|
-
hotel_occupancy: { type: "string" },
|
|
33
|
-
domain: { type: "string" },
|
|
34
|
-
language_code: { type: "string" },
|
|
35
|
-
transcript_origin: { type: "string" },
|
|
36
|
-
autoselect_variant: { type: "boolean" },
|
|
37
|
-
currency: { type: "string" },
|
|
38
|
-
category: { type: "string" },
|
|
39
|
-
merchant: { type: "string" },
|
|
40
|
-
sort_by: { type: "string" },
|
|
41
|
-
parser_type: { type: "string" },
|
|
42
|
-
payload: { type: "string" },
|
|
43
|
-
http_method: { type: "string" },
|
|
44
|
-
successful_status_codes: { type: "array", items: { type: "number" } },
|
|
45
|
-
product_id: { type: "string" },
|
|
46
|
-
fulfillment_type: { type: "string" },
|
|
47
|
-
walmart_store_id: { type: "string" },
|
|
48
|
-
delivery_zip: { type: "string" },
|
|
49
|
-
store_id: { type: "string" },
|
|
50
|
-
delivery_type: { type: "string" },
|
|
51
|
-
target_store_id: { type: "string" },
|
|
52
|
-
lowes_store_id: { type: "string" },
|
|
53
|
-
user_agent_type: { type: "string" },
|
|
54
|
-
free_delivery: { type: "boolean" },
|
|
55
|
-
pickup_today: { type: "boolean" },
|
|
56
|
-
delivery_today_tomorrow: { type: "boolean" },
|
|
57
|
-
proxy_pool: { type: "string", enum: ["standard", "premium"] },
|
|
58
|
-
headers: { type: "object" },
|
|
59
|
-
cookies: { type: "object" },
|
|
60
|
-
force_headers: { type: "boolean" },
|
|
61
|
-
force_cookies: { type: "boolean" },
|
|
62
|
-
prompt: { type: "string", maxLength: 8192 },
|
|
63
|
-
search: { type: "boolean" },
|
|
64
|
-
country: { type: "string" },
|
|
65
|
-
sort: { type: "string" },
|
|
66
|
-
upload_date: { type: "string" },
|
|
67
|
-
type: { type: "string" },
|
|
68
|
-
duration: { type: "string" },
|
|
69
|
-
video_sort_by: { type: "string" },
|
|
70
|
-
"3d": { type: "boolean" },
|
|
71
|
-
"4k": { type: "boolean" },
|
|
72
|
-
creative_commons: { type: "boolean" },
|
|
73
|
-
hd: { type: "boolean" },
|
|
74
|
-
hdr: { type: "boolean" },
|
|
75
|
-
vr180: { type: "boolean" },
|
|
76
|
-
live: { type: "boolean" },
|
|
77
|
-
location: { type: "boolean" },
|
|
78
|
-
purchased: { type: "boolean" },
|
|
79
|
-
subtitles: { type: "boolean" },
|
|
80
|
-
subtitle_origin: { type: "string" },
|
|
81
|
-
limit: { type: "number", minimum: 0, maximum: 100 },
|
|
82
|
-
customStatusCode: { type: "string" },
|
|
83
|
-
requestBody: { type: "string" },
|
|
84
|
-
customCookies: { type: "string" },
|
|
85
|
-
};
|