@decodo/sdk-ts 2.0.0 → 2.1.0
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/build/cjs/api/web-scraping-api.d.ts +3 -1
- package/build/cjs/api/web-scraping-api.js +5 -3
- package/build/cjs/client.d.ts +2 -0
- package/build/cjs/client.js +3 -1
- package/build/cjs/generated/parameters.js +3 -6
- package/build/cjs/generated/request-schemas.d.ts +0 -172
- package/build/cjs/generated/request-schemas.js +0 -190
- package/build/cjs/generated/targets.d.ts +2 -62
- package/build/cjs/generated/targets.js +1 -25
- package/build/cjs/http.js +1 -0
- package/build/cjs/index.d.ts +3 -0
- package/build/cjs/index.js +5 -1
- package/build/cjs/schema/build-request-schemas.d.ts +4 -0
- package/build/cjs/schema/build-request-schemas.js +56 -0
- package/build/cjs/schema/build-target-meta.d.ts +3 -0
- package/build/cjs/schema/build-target-meta.js +19 -0
- package/build/cjs/schema/bundled-provider.d.ts +2 -0
- package/build/cjs/schema/bundled-provider.js +9 -0
- package/build/cjs/schema/bundled-schema.d.ts +10 -0
- package/build/cjs/schema/bundled-schema.js +24 -0
- package/build/cjs/schema/constants.d.ts +5 -0
- package/build/cjs/schema/constants.js +8 -0
- package/build/cjs/schema/expand-path.d.ts +1 -0
- package/build/cjs/schema/expand-path.js +15 -0
- package/build/cjs/schema/remote-provider.d.ts +8 -0
- package/build/cjs/schema/remote-provider.js +120 -0
- package/build/cjs/schema/remote-schema.d.ts +19 -0
- package/build/cjs/schema/remote-schema.js +149 -0
- package/build/cjs/schema/resolve-latest-ir.d.ts +2 -0
- package/build/cjs/schema/resolve-latest-ir.js +55 -0
- package/build/cjs/schema/resolve-provider.d.ts +3 -0
- package/build/cjs/schema/resolve-provider.js +27 -0
- package/build/cjs/schema/types.d.ts +44 -0
- package/build/cjs/schema/types.js +2 -0
- package/build/esm/api/web-scraping-api.d.ts +3 -1
- package/build/esm/api/web-scraping-api.js +5 -3
- package/build/esm/client.d.ts +2 -0
- package/build/esm/client.js +3 -1
- package/build/esm/generated/parameters.js +3 -6
- package/build/esm/generated/request-schemas.d.ts +0 -172
- package/build/esm/generated/request-schemas.js +0 -190
- package/build/esm/generated/targets.d.ts +2 -62
- package/build/esm/generated/targets.js +1 -25
- package/build/esm/http.js +1 -0
- package/build/esm/index.d.ts +3 -0
- package/build/esm/index.js +2 -0
- package/build/esm/schema/build-request-schemas.d.ts +4 -0
- package/build/esm/schema/build-request-schemas.js +18 -0
- package/build/esm/schema/build-target-meta.d.ts +3 -0
- package/build/esm/schema/build-target-meta.js +15 -0
- package/build/esm/schema/bundled-provider.d.ts +2 -0
- package/build/esm/schema/bundled-provider.js +6 -0
- package/build/esm/schema/bundled-schema.d.ts +10 -0
- package/build/esm/schema/bundled-schema.js +20 -0
- package/build/esm/schema/constants.d.ts +5 -0
- package/build/esm/schema/constants.js +5 -0
- package/build/esm/schema/expand-path.d.ts +1 -0
- package/build/esm/schema/expand-path.js +11 -0
- package/build/esm/schema/remote-provider.d.ts +8 -0
- package/build/esm/schema/remote-provider.js +83 -0
- package/build/esm/schema/remote-schema.d.ts +19 -0
- package/build/esm/schema/remote-schema.js +112 -0
- package/build/esm/schema/resolve-latest-ir.d.ts +2 -0
- package/build/esm/schema/resolve-latest-ir.js +51 -0
- package/build/esm/schema/resolve-provider.d.ts +3 -0
- package/build/esm/schema/resolve-provider.js +22 -0
- package/build/esm/schema/types.d.ts +44 -0
- package/build/esm/schema/types.js +1 -0
- package/package.json +6 -3
package/build/esm/client.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HttpClient } from './http.js';
|
|
2
2
|
import { WebScrapingApi } from './api/web-scraping-api.js';
|
|
3
|
+
import { BundledSchema } from './schema/bundled-schema.js';
|
|
3
4
|
const WEB_API_BASE_URL = 'https://scraper-api.decodo.com';
|
|
4
5
|
const DEFAULT_TIMEOUT_MS = 180_000;
|
|
5
6
|
const notConfigured = (namespace, hint) => {
|
|
@@ -9,6 +10,7 @@ export class DecodoClient {
|
|
|
9
10
|
webScrapingApi;
|
|
10
11
|
constructor(config) {
|
|
11
12
|
const timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
13
|
+
const schema = config.schema ?? BundledSchema.shared;
|
|
12
14
|
if (config.webScrapingApi) {
|
|
13
15
|
this.webScrapingApi = new WebScrapingApi(new HttpClient({
|
|
14
16
|
baseUrl: WEB_API_BASE_URL,
|
|
@@ -17,7 +19,7 @@ export class DecodoClient {
|
|
|
17
19
|
token: config.webScrapingApi.token,
|
|
18
20
|
},
|
|
19
21
|
timeoutMs,
|
|
20
|
-
}));
|
|
22
|
+
}), schema);
|
|
21
23
|
}
|
|
22
24
|
else {
|
|
23
25
|
this.webScrapingApi = new Proxy({}, {
|
|
@@ -36,9 +36,6 @@ export const parameterMeta = {
|
|
|
36
36
|
merchant: { type: "string" },
|
|
37
37
|
sort_by: { type: "string" },
|
|
38
38
|
parser_type: { type: "string" },
|
|
39
|
-
payload: { type: "string" },
|
|
40
|
-
http_method: { type: "string" },
|
|
41
|
-
successful_status_codes: { type: "array", items: { type: "number" } },
|
|
42
39
|
product_id: { type: "string" },
|
|
43
40
|
fulfillment_type: { type: "string" },
|
|
44
41
|
walmart_store_id: { type: "string" },
|
|
@@ -51,7 +48,10 @@ export const parameterMeta = {
|
|
|
51
48
|
free_delivery: { type: "boolean" },
|
|
52
49
|
pickup_today: { type: "boolean" },
|
|
53
50
|
delivery_today_tomorrow: { type: "boolean" },
|
|
51
|
+
payload: { type: "string" },
|
|
54
52
|
proxy_pool: { type: "string", enum: ["standard", "premium"] },
|
|
53
|
+
http_method: { type: "string" },
|
|
54
|
+
successful_status_codes: { type: "array", items: { type: "number" } },
|
|
55
55
|
headers: { type: "object" },
|
|
56
56
|
cookies: { type: "object" },
|
|
57
57
|
force_headers: { type: "boolean" },
|
|
@@ -76,7 +76,4 @@ export const parameterMeta = {
|
|
|
76
76
|
subtitles: { type: "boolean" },
|
|
77
77
|
subtitle_origin: { type: "string" },
|
|
78
78
|
limit: { type: "number", minimum: 0, maximum: 100 },
|
|
79
|
-
customStatusCode: { type: "string" },
|
|
80
|
-
requestBody: { type: "string" },
|
|
81
|
-
customCookies: { type: "string" },
|
|
82
79
|
};
|
|
@@ -970,38 +970,6 @@ export declare const requestJsonSchemas: {
|
|
|
970
970
|
readonly required: readonly ["target"];
|
|
971
971
|
readonly additionalProperties: false;
|
|
972
972
|
};
|
|
973
|
-
readonly ecommerce_core: {
|
|
974
|
-
readonly type: "object";
|
|
975
|
-
readonly properties: {
|
|
976
|
-
readonly target: {
|
|
977
|
-
readonly const: "ecommerce_core";
|
|
978
|
-
};
|
|
979
|
-
readonly url: {
|
|
980
|
-
readonly type: "string";
|
|
981
|
-
readonly maxLength: 2056;
|
|
982
|
-
};
|
|
983
|
-
readonly payload: {
|
|
984
|
-
readonly type: "string";
|
|
985
|
-
};
|
|
986
|
-
readonly geo: {
|
|
987
|
-
readonly type: "string";
|
|
988
|
-
};
|
|
989
|
-
readonly http_method: {
|
|
990
|
-
readonly type: "string";
|
|
991
|
-
};
|
|
992
|
-
readonly successful_status_codes: {
|
|
993
|
-
readonly type: "array";
|
|
994
|
-
readonly items: {
|
|
995
|
-
readonly type: "number";
|
|
996
|
-
};
|
|
997
|
-
};
|
|
998
|
-
readonly callback_url: {
|
|
999
|
-
readonly type: "string";
|
|
1000
|
-
};
|
|
1001
|
-
};
|
|
1002
|
-
readonly required: readonly ["target"];
|
|
1003
|
-
readonly additionalProperties: false;
|
|
1004
|
-
};
|
|
1005
973
|
readonly walmart_product: {
|
|
1006
974
|
readonly type: "object";
|
|
1007
975
|
readonly properties: {
|
|
@@ -1337,38 +1305,6 @@ export declare const requestJsonSchemas: {
|
|
|
1337
1305
|
readonly required: readonly ["target"];
|
|
1338
1306
|
readonly additionalProperties: false;
|
|
1339
1307
|
};
|
|
1340
|
-
readonly universal_core: {
|
|
1341
|
-
readonly type: "object";
|
|
1342
|
-
readonly properties: {
|
|
1343
|
-
readonly target: {
|
|
1344
|
-
readonly const: "universal_core";
|
|
1345
|
-
};
|
|
1346
|
-
readonly url: {
|
|
1347
|
-
readonly type: "string";
|
|
1348
|
-
readonly maxLength: 2056;
|
|
1349
|
-
};
|
|
1350
|
-
readonly payload: {
|
|
1351
|
-
readonly type: "string";
|
|
1352
|
-
};
|
|
1353
|
-
readonly geo: {
|
|
1354
|
-
readonly type: "string";
|
|
1355
|
-
};
|
|
1356
|
-
readonly http_method: {
|
|
1357
|
-
readonly type: "string";
|
|
1358
|
-
};
|
|
1359
|
-
readonly successful_status_codes: {
|
|
1360
|
-
readonly type: "array";
|
|
1361
|
-
readonly items: {
|
|
1362
|
-
readonly type: "number";
|
|
1363
|
-
};
|
|
1364
|
-
};
|
|
1365
|
-
readonly callback_url: {
|
|
1366
|
-
readonly type: "string";
|
|
1367
|
-
};
|
|
1368
|
-
};
|
|
1369
|
-
readonly required: readonly ["target"];
|
|
1370
|
-
readonly additionalProperties: false;
|
|
1371
|
-
};
|
|
1372
1308
|
readonly chatgpt: {
|
|
1373
1309
|
readonly type: "object";
|
|
1374
1310
|
readonly properties: {
|
|
@@ -2011,113 +1947,5 @@ export declare const requestJsonSchemas: {
|
|
|
2011
1947
|
readonly required: readonly ["target"];
|
|
2012
1948
|
readonly additionalProperties: false;
|
|
2013
1949
|
};
|
|
2014
|
-
readonly site_unblocker: {
|
|
2015
|
-
readonly type: "object";
|
|
2016
|
-
readonly properties: {
|
|
2017
|
-
readonly target: {
|
|
2018
|
-
readonly const: "site_unblocker";
|
|
2019
|
-
};
|
|
2020
|
-
readonly url: {
|
|
2021
|
-
readonly type: "string";
|
|
2022
|
-
readonly maxLength: 2056;
|
|
2023
|
-
};
|
|
2024
|
-
readonly geo: {
|
|
2025
|
-
readonly type: "string";
|
|
2026
|
-
};
|
|
2027
|
-
readonly locale: {
|
|
2028
|
-
readonly type: "string";
|
|
2029
|
-
};
|
|
2030
|
-
readonly session_id: {
|
|
2031
|
-
readonly type: "string";
|
|
2032
|
-
};
|
|
2033
|
-
readonly http_method: {
|
|
2034
|
-
readonly type: "string";
|
|
2035
|
-
};
|
|
2036
|
-
readonly customStatusCode: {
|
|
2037
|
-
readonly type: "string";
|
|
2038
|
-
};
|
|
2039
|
-
readonly requestBody: {
|
|
2040
|
-
readonly type: "string";
|
|
2041
|
-
};
|
|
2042
|
-
readonly headless: {
|
|
2043
|
-
readonly type: "string";
|
|
2044
|
-
readonly enum: readonly ["html", "png"];
|
|
2045
|
-
};
|
|
2046
|
-
readonly headers: {
|
|
2047
|
-
readonly type: "object";
|
|
2048
|
-
};
|
|
2049
|
-
readonly force_headers: {
|
|
2050
|
-
readonly type: "boolean";
|
|
2051
|
-
};
|
|
2052
|
-
readonly force_cookies: {
|
|
2053
|
-
readonly type: "boolean";
|
|
2054
|
-
};
|
|
2055
|
-
readonly customCookies: {
|
|
2056
|
-
readonly type: "string";
|
|
2057
|
-
};
|
|
2058
|
-
readonly markdown: {
|
|
2059
|
-
readonly type: "boolean";
|
|
2060
|
-
};
|
|
2061
|
-
readonly callback_url: {
|
|
2062
|
-
readonly type: "string";
|
|
2063
|
-
};
|
|
2064
|
-
};
|
|
2065
|
-
readonly required: readonly ["target"];
|
|
2066
|
-
readonly additionalProperties: false;
|
|
2067
|
-
};
|
|
2068
|
-
readonly site_unblocker_req: {
|
|
2069
|
-
readonly type: "object";
|
|
2070
|
-
readonly properties: {
|
|
2071
|
-
readonly target: {
|
|
2072
|
-
readonly const: "site_unblocker_req";
|
|
2073
|
-
};
|
|
2074
|
-
readonly url: {
|
|
2075
|
-
readonly type: "string";
|
|
2076
|
-
readonly maxLength: 2056;
|
|
2077
|
-
};
|
|
2078
|
-
readonly geo: {
|
|
2079
|
-
readonly type: "string";
|
|
2080
|
-
};
|
|
2081
|
-
readonly locale: {
|
|
2082
|
-
readonly type: "string";
|
|
2083
|
-
};
|
|
2084
|
-
readonly session_id: {
|
|
2085
|
-
readonly type: "string";
|
|
2086
|
-
};
|
|
2087
|
-
readonly http_method: {
|
|
2088
|
-
readonly type: "string";
|
|
2089
|
-
};
|
|
2090
|
-
readonly customStatusCode: {
|
|
2091
|
-
readonly type: "string";
|
|
2092
|
-
};
|
|
2093
|
-
readonly requestBody: {
|
|
2094
|
-
readonly type: "string";
|
|
2095
|
-
};
|
|
2096
|
-
readonly headless: {
|
|
2097
|
-
readonly type: "string";
|
|
2098
|
-
readonly enum: readonly ["html", "png"];
|
|
2099
|
-
};
|
|
2100
|
-
readonly headers: {
|
|
2101
|
-
readonly type: "object";
|
|
2102
|
-
};
|
|
2103
|
-
readonly force_headers: {
|
|
2104
|
-
readonly type: "boolean";
|
|
2105
|
-
};
|
|
2106
|
-
readonly force_cookies: {
|
|
2107
|
-
readonly type: "boolean";
|
|
2108
|
-
};
|
|
2109
|
-
readonly customCookies: {
|
|
2110
|
-
readonly type: "string";
|
|
2111
|
-
};
|
|
2112
|
-
readonly markdown: {
|
|
2113
|
-
readonly type: "boolean";
|
|
2114
|
-
};
|
|
2115
|
-
readonly callback_url: {
|
|
2116
|
-
readonly type: "string";
|
|
2117
|
-
};
|
|
2118
|
-
};
|
|
2119
|
-
readonly required: readonly ["target"];
|
|
2120
|
-
readonly additionalProperties: false;
|
|
2121
|
-
};
|
|
2122
1950
|
};
|
|
2123
1951
|
export declare const requestSchemas: Record<Target, z.ZodType>;
|
|
@@ -1063,40 +1063,6 @@ export const requestJsonSchemas = {
|
|
|
1063
1063
|
],
|
|
1064
1064
|
"additionalProperties": false
|
|
1065
1065
|
},
|
|
1066
|
-
[Target.EcommerceCore]: {
|
|
1067
|
-
"type": "object",
|
|
1068
|
-
"properties": {
|
|
1069
|
-
"target": {
|
|
1070
|
-
"const": "ecommerce_core"
|
|
1071
|
-
},
|
|
1072
|
-
"url": {
|
|
1073
|
-
"type": "string",
|
|
1074
|
-
"maxLength": 2056
|
|
1075
|
-
},
|
|
1076
|
-
"payload": {
|
|
1077
|
-
"type": "string"
|
|
1078
|
-
},
|
|
1079
|
-
"geo": {
|
|
1080
|
-
"type": "string"
|
|
1081
|
-
},
|
|
1082
|
-
"http_method": {
|
|
1083
|
-
"type": "string"
|
|
1084
|
-
},
|
|
1085
|
-
"successful_status_codes": {
|
|
1086
|
-
"type": "array",
|
|
1087
|
-
"items": {
|
|
1088
|
-
"type": "number"
|
|
1089
|
-
}
|
|
1090
|
-
},
|
|
1091
|
-
"callback_url": {
|
|
1092
|
-
"type": "string"
|
|
1093
|
-
}
|
|
1094
|
-
},
|
|
1095
|
-
"required": [
|
|
1096
|
-
"target"
|
|
1097
|
-
],
|
|
1098
|
-
"additionalProperties": false
|
|
1099
|
-
},
|
|
1100
1066
|
[Target.WalmartProduct]: {
|
|
1101
1067
|
"type": "object",
|
|
1102
1068
|
"properties": {
|
|
@@ -1475,40 +1441,6 @@ export const requestJsonSchemas = {
|
|
|
1475
1441
|
],
|
|
1476
1442
|
"additionalProperties": false
|
|
1477
1443
|
},
|
|
1478
|
-
[Target.UniversalCore]: {
|
|
1479
|
-
"type": "object",
|
|
1480
|
-
"properties": {
|
|
1481
|
-
"target": {
|
|
1482
|
-
"const": "universal_core"
|
|
1483
|
-
},
|
|
1484
|
-
"url": {
|
|
1485
|
-
"type": "string",
|
|
1486
|
-
"maxLength": 2056
|
|
1487
|
-
},
|
|
1488
|
-
"payload": {
|
|
1489
|
-
"type": "string"
|
|
1490
|
-
},
|
|
1491
|
-
"geo": {
|
|
1492
|
-
"type": "string"
|
|
1493
|
-
},
|
|
1494
|
-
"http_method": {
|
|
1495
|
-
"type": "string"
|
|
1496
|
-
},
|
|
1497
|
-
"successful_status_codes": {
|
|
1498
|
-
"type": "array",
|
|
1499
|
-
"items": {
|
|
1500
|
-
"type": "number"
|
|
1501
|
-
}
|
|
1502
|
-
},
|
|
1503
|
-
"callback_url": {
|
|
1504
|
-
"type": "string"
|
|
1505
|
-
}
|
|
1506
|
-
},
|
|
1507
|
-
"required": [
|
|
1508
|
-
"target"
|
|
1509
|
-
],
|
|
1510
|
-
"additionalProperties": false
|
|
1511
|
-
},
|
|
1512
1444
|
[Target.Chatgpt]: {
|
|
1513
1445
|
"type": "object",
|
|
1514
1446
|
"properties": {
|
|
@@ -2217,124 +2149,6 @@ export const requestJsonSchemas = {
|
|
|
2217
2149
|
],
|
|
2218
2150
|
"additionalProperties": false
|
|
2219
2151
|
},
|
|
2220
|
-
[Target.SiteUnblocker]: {
|
|
2221
|
-
"type": "object",
|
|
2222
|
-
"properties": {
|
|
2223
|
-
"target": {
|
|
2224
|
-
"const": "site_unblocker"
|
|
2225
|
-
},
|
|
2226
|
-
"url": {
|
|
2227
|
-
"type": "string",
|
|
2228
|
-
"maxLength": 2056
|
|
2229
|
-
},
|
|
2230
|
-
"geo": {
|
|
2231
|
-
"type": "string"
|
|
2232
|
-
},
|
|
2233
|
-
"locale": {
|
|
2234
|
-
"type": "string"
|
|
2235
|
-
},
|
|
2236
|
-
"session_id": {
|
|
2237
|
-
"type": "string"
|
|
2238
|
-
},
|
|
2239
|
-
"http_method": {
|
|
2240
|
-
"type": "string"
|
|
2241
|
-
},
|
|
2242
|
-
"customStatusCode": {
|
|
2243
|
-
"type": "string"
|
|
2244
|
-
},
|
|
2245
|
-
"requestBody": {
|
|
2246
|
-
"type": "string"
|
|
2247
|
-
},
|
|
2248
|
-
"headless": {
|
|
2249
|
-
"type": "string",
|
|
2250
|
-
"enum": [
|
|
2251
|
-
"html",
|
|
2252
|
-
"png"
|
|
2253
|
-
]
|
|
2254
|
-
},
|
|
2255
|
-
"headers": {
|
|
2256
|
-
"type": "object"
|
|
2257
|
-
},
|
|
2258
|
-
"force_headers": {
|
|
2259
|
-
"type": "boolean"
|
|
2260
|
-
},
|
|
2261
|
-
"force_cookies": {
|
|
2262
|
-
"type": "boolean"
|
|
2263
|
-
},
|
|
2264
|
-
"customCookies": {
|
|
2265
|
-
"type": "string"
|
|
2266
|
-
},
|
|
2267
|
-
"markdown": {
|
|
2268
|
-
"type": "boolean"
|
|
2269
|
-
},
|
|
2270
|
-
"callback_url": {
|
|
2271
|
-
"type": "string"
|
|
2272
|
-
}
|
|
2273
|
-
},
|
|
2274
|
-
"required": [
|
|
2275
|
-
"target"
|
|
2276
|
-
],
|
|
2277
|
-
"additionalProperties": false
|
|
2278
|
-
},
|
|
2279
|
-
[Target.SiteUnblockerReq]: {
|
|
2280
|
-
"type": "object",
|
|
2281
|
-
"properties": {
|
|
2282
|
-
"target": {
|
|
2283
|
-
"const": "site_unblocker_req"
|
|
2284
|
-
},
|
|
2285
|
-
"url": {
|
|
2286
|
-
"type": "string",
|
|
2287
|
-
"maxLength": 2056
|
|
2288
|
-
},
|
|
2289
|
-
"geo": {
|
|
2290
|
-
"type": "string"
|
|
2291
|
-
},
|
|
2292
|
-
"locale": {
|
|
2293
|
-
"type": "string"
|
|
2294
|
-
},
|
|
2295
|
-
"session_id": {
|
|
2296
|
-
"type": "string"
|
|
2297
|
-
},
|
|
2298
|
-
"http_method": {
|
|
2299
|
-
"type": "string"
|
|
2300
|
-
},
|
|
2301
|
-
"customStatusCode": {
|
|
2302
|
-
"type": "string"
|
|
2303
|
-
},
|
|
2304
|
-
"requestBody": {
|
|
2305
|
-
"type": "string"
|
|
2306
|
-
},
|
|
2307
|
-
"headless": {
|
|
2308
|
-
"type": "string",
|
|
2309
|
-
"enum": [
|
|
2310
|
-
"html",
|
|
2311
|
-
"png"
|
|
2312
|
-
]
|
|
2313
|
-
},
|
|
2314
|
-
"headers": {
|
|
2315
|
-
"type": "object"
|
|
2316
|
-
},
|
|
2317
|
-
"force_headers": {
|
|
2318
|
-
"type": "boolean"
|
|
2319
|
-
},
|
|
2320
|
-
"force_cookies": {
|
|
2321
|
-
"type": "boolean"
|
|
2322
|
-
},
|
|
2323
|
-
"customCookies": {
|
|
2324
|
-
"type": "string"
|
|
2325
|
-
},
|
|
2326
|
-
"markdown": {
|
|
2327
|
-
"type": "boolean"
|
|
2328
|
-
},
|
|
2329
|
-
"callback_url": {
|
|
2330
|
-
"type": "string"
|
|
2331
|
-
}
|
|
2332
|
-
},
|
|
2333
|
-
"required": [
|
|
2334
|
-
"target"
|
|
2335
|
-
],
|
|
2336
|
-
"additionalProperties": false
|
|
2337
|
-
},
|
|
2338
2152
|
};
|
|
2339
2153
|
export const requestSchemas = {
|
|
2340
2154
|
[Target.UniversalEcommerce]: z.fromJSONSchema(requestJsonSchemas[Target.UniversalEcommerce]),
|
|
@@ -2359,7 +2173,6 @@ export const requestSchemas = {
|
|
|
2359
2173
|
[Target.AmazonBestsellers]: z.fromJSONSchema(requestJsonSchemas[Target.AmazonBestsellers]),
|
|
2360
2174
|
[Target.Amazon]: z.fromJSONSchema(requestJsonSchemas[Target.Amazon]),
|
|
2361
2175
|
[Target.Ecommerce]: z.fromJSONSchema(requestJsonSchemas[Target.Ecommerce]),
|
|
2362
|
-
[Target.EcommerceCore]: z.fromJSONSchema(requestJsonSchemas[Target.EcommerceCore]),
|
|
2363
2176
|
[Target.WalmartProduct]: z.fromJSONSchema(requestJsonSchemas[Target.WalmartProduct]),
|
|
2364
2177
|
[Target.WalmartSearch]: z.fromJSONSchema(requestJsonSchemas[Target.WalmartSearch]),
|
|
2365
2178
|
[Target.Walmart]: z.fromJSONSchema(requestJsonSchemas[Target.Walmart]),
|
|
@@ -2368,7 +2181,6 @@ export const requestSchemas = {
|
|
|
2368
2181
|
[Target.Target]: z.fromJSONSchema(requestJsonSchemas[Target.Target]),
|
|
2369
2182
|
[Target.LowesSearch]: z.fromJSONSchema(requestJsonSchemas[Target.LowesSearch]),
|
|
2370
2183
|
[Target.Universal]: z.fromJSONSchema(requestJsonSchemas[Target.Universal]),
|
|
2371
|
-
[Target.UniversalCore]: z.fromJSONSchema(requestJsonSchemas[Target.UniversalCore]),
|
|
2372
2184
|
[Target.Chatgpt]: z.fromJSONSchema(requestJsonSchemas[Target.Chatgpt]),
|
|
2373
2185
|
[Target.Perplexity]: z.fromJSONSchema(requestJsonSchemas[Target.Perplexity]),
|
|
2374
2186
|
[Target.Bbb]: z.fromJSONSchema(requestJsonSchemas[Target.Bbb]),
|
|
@@ -2390,6 +2202,4 @@ export const requestSchemas = {
|
|
|
2390
2202
|
[Target.YoutubeSearchMax]: z.fromJSONSchema(requestJsonSchemas[Target.YoutubeSearchMax]),
|
|
2391
2203
|
[Target.YoutubeSubtitles]: z.fromJSONSchema(requestJsonSchemas[Target.YoutubeSubtitles]),
|
|
2392
2204
|
[Target.YoutubeChannel]: z.fromJSONSchema(requestJsonSchemas[Target.YoutubeChannel]),
|
|
2393
|
-
[Target.SiteUnblocker]: z.fromJSONSchema(requestJsonSchemas[Target.SiteUnblocker]),
|
|
2394
|
-
[Target.SiteUnblockerReq]: z.fromJSONSchema(requestJsonSchemas[Target.SiteUnblockerReq]),
|
|
2395
2205
|
};
|
|
@@ -24,7 +24,6 @@ export declare enum Target {
|
|
|
24
24
|
AmazonBestsellers = "amazon_bestsellers",
|
|
25
25
|
Amazon = "amazon",
|
|
26
26
|
Ecommerce = "ecommerce",
|
|
27
|
-
EcommerceCore = "ecommerce_core",
|
|
28
27
|
WalmartProduct = "walmart_product",
|
|
29
28
|
WalmartSearch = "walmart_search",
|
|
30
29
|
Walmart = "walmart",
|
|
@@ -33,7 +32,6 @@ export declare enum Target {
|
|
|
33
32
|
Target = "target",
|
|
34
33
|
LowesSearch = "lowes_search",
|
|
35
34
|
Universal = "universal",
|
|
36
|
-
UniversalCore = "universal_core",
|
|
37
35
|
Chatgpt = "chatgpt",
|
|
38
36
|
Perplexity = "perplexity",
|
|
39
37
|
Bbb = "bbb",
|
|
@@ -54,13 +52,11 @@ export declare enum Target {
|
|
|
54
52
|
YoutubeSearch = "youtube_search",
|
|
55
53
|
YoutubeSearchMax = "youtube_search_max",
|
|
56
54
|
YoutubeSubtitles = "youtube_subtitles",
|
|
57
|
-
YoutubeChannel = "youtube_channel"
|
|
58
|
-
SiteUnblocker = "site_unblocker",
|
|
59
|
-
SiteUnblockerReq = "site_unblocker_req"
|
|
55
|
+
YoutubeChannel = "youtube_channel"
|
|
60
56
|
}
|
|
61
57
|
/** API discriminator string literals (same values as {@link Target}). */
|
|
62
58
|
export type TargetString = (typeof Target)[keyof typeof Target];
|
|
63
|
-
export declare const targets: readonly [Target.UniversalEcommerce, Target.GoogleSearch, Target.GoogleTravelHotels, Target.GoogleTrendsExplore, Target.GoogleShoppingSearch, Target.GoogleShoppingProduct, Target.Google, Target.GoogleSuggest, Target.GoogleMaps, Target.GoogleAiMode, Target.GoogleAds, Target.GoogleLens, Target.BingSearch, Target.Bing, Target.YoutubeTranscript, Target.AmazonProduct, Target.AmazonPricing, Target.AmazonSearch, Target.AmazonSellers, Target.AmazonBestsellers, Target.Amazon, Target.Ecommerce, Target.
|
|
59
|
+
export declare const targets: readonly [Target.UniversalEcommerce, Target.GoogleSearch, Target.GoogleTravelHotels, Target.GoogleTrendsExplore, Target.GoogleShoppingSearch, Target.GoogleShoppingProduct, Target.Google, Target.GoogleSuggest, Target.GoogleMaps, Target.GoogleAiMode, Target.GoogleAds, Target.GoogleLens, Target.BingSearch, Target.Bing, Target.YoutubeTranscript, Target.AmazonProduct, Target.AmazonPricing, Target.AmazonSearch, Target.AmazonSellers, Target.AmazonBestsellers, Target.Amazon, Target.Ecommerce, Target.WalmartProduct, Target.WalmartSearch, Target.Walmart, Target.TargetProduct, Target.TargetSearch, Target.Target, Target.LowesSearch, Target.Universal, Target.Chatgpt, Target.Perplexity, Target.Bbb, Target.Autotrader, Target.Mobile, Target.Airbnb, Target.AppleAppStore, Target.InstagramGraphqlProfile, Target.TiktokPost, Target.TiktokShopSearch, Target.TiktokShopProduct, Target.Tiktok, Target.RedditPost, Target.RedditSubreddit, Target.RedditUser, Target.YoutubeVideo, Target.YoutubeMetadata, Target.YoutubeSearch, Target.YoutubeSearchMax, Target.YoutubeSubtitles, Target.YoutubeChannel];
|
|
64
60
|
export interface UniversalEcommerceParams {
|
|
65
61
|
callback_url?: string;
|
|
66
62
|
}
|
|
@@ -331,14 +327,6 @@ export interface EcommerceParams {
|
|
|
331
327
|
parser_type?: string;
|
|
332
328
|
callback_url?: string;
|
|
333
329
|
}
|
|
334
|
-
export interface EcommerceCoreParams {
|
|
335
|
-
url?: string;
|
|
336
|
-
payload?: string;
|
|
337
|
-
geo?: string;
|
|
338
|
-
http_method?: string;
|
|
339
|
-
successful_status_codes?: number[];
|
|
340
|
-
callback_url?: string;
|
|
341
|
-
}
|
|
342
330
|
export interface WalmartProductParams {
|
|
343
331
|
product_id?: string;
|
|
344
332
|
headless?: 'html' | 'png';
|
|
@@ -438,14 +426,6 @@ export interface UniversalParams {
|
|
|
438
426
|
markdown?: boolean;
|
|
439
427
|
callback_url?: string;
|
|
440
428
|
}
|
|
441
|
-
export interface UniversalCoreParams {
|
|
442
|
-
url?: string;
|
|
443
|
-
payload?: string;
|
|
444
|
-
geo?: string;
|
|
445
|
-
http_method?: string;
|
|
446
|
-
successful_status_codes?: number[];
|
|
447
|
-
callback_url?: string;
|
|
448
|
-
}
|
|
449
429
|
export interface ChatgptParams {
|
|
450
430
|
prompt?: string;
|
|
451
431
|
search?: boolean;
|
|
@@ -622,42 +602,6 @@ export interface YoutubeChannelParams {
|
|
|
622
602
|
markdown?: boolean;
|
|
623
603
|
callback_url?: string;
|
|
624
604
|
}
|
|
625
|
-
export interface SiteUnblockerParams {
|
|
626
|
-
url?: string;
|
|
627
|
-
geo?: string;
|
|
628
|
-
locale?: string;
|
|
629
|
-
session_id?: string;
|
|
630
|
-
http_method?: string;
|
|
631
|
-
customStatusCode?: string;
|
|
632
|
-
requestBody?: string;
|
|
633
|
-
headless?: 'html' | 'png';
|
|
634
|
-
headers?: {
|
|
635
|
-
[k: string]: unknown;
|
|
636
|
-
};
|
|
637
|
-
force_headers?: boolean;
|
|
638
|
-
force_cookies?: boolean;
|
|
639
|
-
customCookies?: string;
|
|
640
|
-
markdown?: boolean;
|
|
641
|
-
callback_url?: string;
|
|
642
|
-
}
|
|
643
|
-
export interface SiteUnblockerReqParams {
|
|
644
|
-
url?: string;
|
|
645
|
-
geo?: string;
|
|
646
|
-
locale?: string;
|
|
647
|
-
session_id?: string;
|
|
648
|
-
http_method?: string;
|
|
649
|
-
customStatusCode?: string;
|
|
650
|
-
requestBody?: string;
|
|
651
|
-
headless?: 'html' | 'png';
|
|
652
|
-
headers?: {
|
|
653
|
-
[k: string]: unknown;
|
|
654
|
-
};
|
|
655
|
-
force_headers?: boolean;
|
|
656
|
-
force_cookies?: boolean;
|
|
657
|
-
customCookies?: string;
|
|
658
|
-
markdown?: boolean;
|
|
659
|
-
callback_url?: string;
|
|
660
|
-
}
|
|
661
605
|
export type TargetParamsMap = {
|
|
662
606
|
[Target.UniversalEcommerce]: UniversalEcommerceParams;
|
|
663
607
|
[Target.GoogleSearch]: GoogleSearchParams;
|
|
@@ -681,7 +625,6 @@ export type TargetParamsMap = {
|
|
|
681
625
|
[Target.AmazonBestsellers]: AmazonBestsellersParams;
|
|
682
626
|
[Target.Amazon]: AmazonParams;
|
|
683
627
|
[Target.Ecommerce]: EcommerceParams;
|
|
684
|
-
[Target.EcommerceCore]: EcommerceCoreParams;
|
|
685
628
|
[Target.WalmartProduct]: WalmartProductParams;
|
|
686
629
|
[Target.WalmartSearch]: WalmartSearchParams;
|
|
687
630
|
[Target.Walmart]: WalmartParams;
|
|
@@ -690,7 +633,6 @@ export type TargetParamsMap = {
|
|
|
690
633
|
[Target.Target]: TargetParams;
|
|
691
634
|
[Target.LowesSearch]: LowesSearchParams;
|
|
692
635
|
[Target.Universal]: UniversalParams;
|
|
693
|
-
[Target.UniversalCore]: UniversalCoreParams;
|
|
694
636
|
[Target.Chatgpt]: ChatgptParams;
|
|
695
637
|
[Target.Perplexity]: PerplexityParams;
|
|
696
638
|
[Target.Bbb]: BbbParams;
|
|
@@ -712,8 +654,6 @@ export type TargetParamsMap = {
|
|
|
712
654
|
[Target.YoutubeSearchMax]: YoutubeSearchMaxParams;
|
|
713
655
|
[Target.YoutubeSubtitles]: YoutubeSubtitlesParams;
|
|
714
656
|
[Target.YoutubeChannel]: YoutubeChannelParams;
|
|
715
|
-
[Target.SiteUnblocker]: SiteUnblockerParams;
|
|
716
|
-
[Target.SiteUnblockerReq]: SiteUnblockerReqParams;
|
|
717
657
|
};
|
|
718
658
|
export type ScrapeRequest = {
|
|
719
659
|
[T in TargetString]: {
|
|
@@ -26,7 +26,6 @@ export var Target;
|
|
|
26
26
|
Target["AmazonBestsellers"] = "amazon_bestsellers";
|
|
27
27
|
Target["Amazon"] = "amazon";
|
|
28
28
|
Target["Ecommerce"] = "ecommerce";
|
|
29
|
-
Target["EcommerceCore"] = "ecommerce_core";
|
|
30
29
|
Target["WalmartProduct"] = "walmart_product";
|
|
31
30
|
Target["WalmartSearch"] = "walmart_search";
|
|
32
31
|
Target["Walmart"] = "walmart";
|
|
@@ -35,7 +34,6 @@ export var Target;
|
|
|
35
34
|
Target["Target"] = "target";
|
|
36
35
|
Target["LowesSearch"] = "lowes_search";
|
|
37
36
|
Target["Universal"] = "universal";
|
|
38
|
-
Target["UniversalCore"] = "universal_core";
|
|
39
37
|
Target["Chatgpt"] = "chatgpt";
|
|
40
38
|
Target["Perplexity"] = "perplexity";
|
|
41
39
|
Target["Bbb"] = "bbb";
|
|
@@ -57,10 +55,8 @@ export var Target;
|
|
|
57
55
|
Target["YoutubeSearchMax"] = "youtube_search_max";
|
|
58
56
|
Target["YoutubeSubtitles"] = "youtube_subtitles";
|
|
59
57
|
Target["YoutubeChannel"] = "youtube_channel";
|
|
60
|
-
Target["SiteUnblocker"] = "site_unblocker";
|
|
61
|
-
Target["SiteUnblockerReq"] = "site_unblocker_req";
|
|
62
58
|
})(Target || (Target = {}));
|
|
63
|
-
export const targets = [Target.UniversalEcommerce, Target.GoogleSearch, Target.GoogleTravelHotels, Target.GoogleTrendsExplore, Target.GoogleShoppingSearch, Target.GoogleShoppingProduct, Target.Google, Target.GoogleSuggest, Target.GoogleMaps, Target.GoogleAiMode, Target.GoogleAds, Target.GoogleLens, Target.BingSearch, Target.Bing, Target.YoutubeTranscript, Target.AmazonProduct, Target.AmazonPricing, Target.AmazonSearch, Target.AmazonSellers, Target.AmazonBestsellers, Target.Amazon, Target.Ecommerce, Target.
|
|
59
|
+
export const targets = [Target.UniversalEcommerce, Target.GoogleSearch, Target.GoogleTravelHotels, Target.GoogleTrendsExplore, Target.GoogleShoppingSearch, Target.GoogleShoppingProduct, Target.Google, Target.GoogleSuggest, Target.GoogleMaps, Target.GoogleAiMode, Target.GoogleAds, Target.GoogleLens, Target.BingSearch, Target.Bing, Target.YoutubeTranscript, Target.AmazonProduct, Target.AmazonPricing, Target.AmazonSearch, Target.AmazonSellers, Target.AmazonBestsellers, Target.Amazon, Target.Ecommerce, Target.WalmartProduct, Target.WalmartSearch, Target.Walmart, Target.TargetProduct, Target.TargetSearch, Target.Target, Target.LowesSearch, Target.Universal, Target.Chatgpt, Target.Perplexity, Target.Bbb, Target.Autotrader, Target.Mobile, Target.Airbnb, Target.AppleAppStore, Target.InstagramGraphqlProfile, Target.TiktokPost, Target.TiktokShopSearch, Target.TiktokShopProduct, Target.Tiktok, Target.RedditPost, Target.RedditSubreddit, Target.RedditUser, Target.YoutubeVideo, Target.YoutubeMetadata, Target.YoutubeSearch, Target.YoutubeSearchMax, Target.YoutubeSubtitles, Target.YoutubeChannel];
|
|
64
60
|
export const targetMeta = {
|
|
65
61
|
[Target.UniversalEcommerce]: {
|
|
66
62
|
group: "None",
|
|
@@ -172,11 +168,6 @@ export const targetMeta = {
|
|
|
172
168
|
response_format: "json",
|
|
173
169
|
parameters: ["url", "headless", "locale", "geo", "device_type", "parse", "parser_type", "callback_url"],
|
|
174
170
|
},
|
|
175
|
-
[Target.EcommerceCore]: {
|
|
176
|
-
group: "None",
|
|
177
|
-
response_format: "html",
|
|
178
|
-
parameters: ["url", "payload", "geo", "http_method", "successful_status_codes", "callback_url"],
|
|
179
|
-
},
|
|
180
171
|
[Target.WalmartProduct]: {
|
|
181
172
|
group: "Walmart",
|
|
182
173
|
response_format: "html",
|
|
@@ -217,11 +208,6 @@ export const targetMeta = {
|
|
|
217
208
|
response_format: "html",
|
|
218
209
|
parameters: ["url", "payload", "proxy_pool", "http_method", "headless", "geo", "locale", "device_type", "session_id", "successful_status_codes", "headers", "cookies", "force_headers", "force_cookies", "xhr", "markdown", "callback_url"],
|
|
219
210
|
},
|
|
220
|
-
[Target.UniversalCore]: {
|
|
221
|
-
group: "None",
|
|
222
|
-
response_format: "html",
|
|
223
|
-
parameters: ["url", "payload", "geo", "http_method", "successful_status_codes", "callback_url"],
|
|
224
|
-
},
|
|
225
211
|
[Target.Chatgpt]: {
|
|
226
212
|
group: "AI Tools",
|
|
227
213
|
response_format: "json",
|
|
@@ -327,14 +313,4 @@ export const targetMeta = {
|
|
|
327
313
|
response_format: "json",
|
|
328
314
|
parameters: ["query", "parse", "limit", "markdown", "callback_url"],
|
|
329
315
|
},
|
|
330
|
-
[Target.SiteUnblocker]: {
|
|
331
|
-
group: "None",
|
|
332
|
-
response_format: "html",
|
|
333
|
-
parameters: ["url", "geo", "locale", "session_id", "http_method", "customStatusCode", "requestBody", "headless", "headers", "force_headers", "force_cookies", "customCookies", "markdown", "callback_url"],
|
|
334
|
-
},
|
|
335
|
-
[Target.SiteUnblockerReq]: {
|
|
336
|
-
group: "None",
|
|
337
|
-
response_format: "html",
|
|
338
|
-
parameters: ["url", "geo", "locale", "session_id", "http_method", "customStatusCode", "requestBody", "headless", "headers", "force_headers", "force_cookies", "customCookies", "markdown", "callback_url"],
|
|
339
|
-
},
|
|
340
316
|
};
|