@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.
Files changed (70) hide show
  1. package/README.md +415 -17
  2. package/build/cjs/api/web-scraping-api.d.ts +3 -1
  3. package/build/cjs/api/web-scraping-api.js +5 -3
  4. package/build/cjs/client.d.ts +2 -0
  5. package/build/cjs/client.js +3 -1
  6. package/build/cjs/generated/parameters.js +3 -6
  7. package/build/cjs/generated/request-schemas.d.ts +0 -172
  8. package/build/cjs/generated/request-schemas.js +0 -190
  9. package/build/cjs/generated/targets.d.ts +2 -62
  10. package/build/cjs/generated/targets.js +1 -25
  11. package/build/cjs/http.js +1 -0
  12. package/build/cjs/index.d.ts +3 -0
  13. package/build/cjs/index.js +5 -1
  14. package/build/cjs/schema/build-request-schemas.d.ts +4 -0
  15. package/build/cjs/schema/build-request-schemas.js +56 -0
  16. package/build/cjs/schema/build-target-meta.d.ts +3 -0
  17. package/build/cjs/schema/build-target-meta.js +19 -0
  18. package/build/cjs/schema/bundled-provider.d.ts +2 -0
  19. package/build/cjs/schema/bundled-provider.js +9 -0
  20. package/build/cjs/schema/bundled-schema.d.ts +10 -0
  21. package/build/cjs/schema/bundled-schema.js +24 -0
  22. package/build/cjs/schema/constants.d.ts +5 -0
  23. package/build/cjs/schema/constants.js +8 -0
  24. package/build/cjs/schema/expand-path.d.ts +1 -0
  25. package/build/cjs/schema/expand-path.js +15 -0
  26. package/build/cjs/schema/remote-provider.d.ts +8 -0
  27. package/build/cjs/schema/remote-provider.js +120 -0
  28. package/build/cjs/schema/remote-schema.d.ts +19 -0
  29. package/build/cjs/schema/remote-schema.js +149 -0
  30. package/build/cjs/schema/resolve-latest-ir.d.ts +2 -0
  31. package/build/cjs/schema/resolve-latest-ir.js +55 -0
  32. package/build/cjs/schema/resolve-provider.d.ts +3 -0
  33. package/build/cjs/schema/resolve-provider.js +27 -0
  34. package/build/cjs/schema/types.d.ts +44 -0
  35. package/build/cjs/schema/types.js +2 -0
  36. package/build/esm/api/web-scraping-api.d.ts +3 -1
  37. package/build/esm/api/web-scraping-api.js +5 -3
  38. package/build/esm/client.d.ts +2 -0
  39. package/build/esm/client.js +3 -1
  40. package/build/esm/generated/parameters.js +3 -6
  41. package/build/esm/generated/request-schemas.d.ts +0 -172
  42. package/build/esm/generated/request-schemas.js +0 -190
  43. package/build/esm/generated/targets.d.ts +2 -62
  44. package/build/esm/generated/targets.js +1 -25
  45. package/build/esm/http.js +1 -0
  46. package/build/esm/index.d.ts +3 -0
  47. package/build/esm/index.js +2 -0
  48. package/build/esm/schema/build-request-schemas.d.ts +4 -0
  49. package/build/esm/schema/build-request-schemas.js +18 -0
  50. package/build/esm/schema/build-target-meta.d.ts +3 -0
  51. package/build/esm/schema/build-target-meta.js +15 -0
  52. package/build/esm/schema/bundled-provider.d.ts +2 -0
  53. package/build/esm/schema/bundled-provider.js +6 -0
  54. package/build/esm/schema/bundled-schema.d.ts +10 -0
  55. package/build/esm/schema/bundled-schema.js +20 -0
  56. package/build/esm/schema/constants.d.ts +5 -0
  57. package/build/esm/schema/constants.js +5 -0
  58. package/build/esm/schema/expand-path.d.ts +1 -0
  59. package/build/esm/schema/expand-path.js +11 -0
  60. package/build/esm/schema/remote-provider.d.ts +8 -0
  61. package/build/esm/schema/remote-provider.js +83 -0
  62. package/build/esm/schema/remote-schema.d.ts +19 -0
  63. package/build/esm/schema/remote-schema.js +112 -0
  64. package/build/esm/schema/resolve-latest-ir.d.ts +2 -0
  65. package/build/esm/schema/resolve-latest-ir.js +51 -0
  66. package/build/esm/schema/resolve-provider.d.ts +3 -0
  67. package/build/esm/schema/resolve-provider.js +22 -0
  68. package/build/esm/schema/types.d.ts +44 -0
  69. package/build/esm/schema/types.js +1 -0
  70. package/package.json +6 -3
@@ -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>;
@@ -1099,40 +1099,6 @@ exports.requestJsonSchemas = {
1099
1099
  ],
1100
1100
  "additionalProperties": false
1101
1101
  },
1102
- [targets_js_1.Target.EcommerceCore]: {
1103
- "type": "object",
1104
- "properties": {
1105
- "target": {
1106
- "const": "ecommerce_core"
1107
- },
1108
- "url": {
1109
- "type": "string",
1110
- "maxLength": 2056
1111
- },
1112
- "payload": {
1113
- "type": "string"
1114
- },
1115
- "geo": {
1116
- "type": "string"
1117
- },
1118
- "http_method": {
1119
- "type": "string"
1120
- },
1121
- "successful_status_codes": {
1122
- "type": "array",
1123
- "items": {
1124
- "type": "number"
1125
- }
1126
- },
1127
- "callback_url": {
1128
- "type": "string"
1129
- }
1130
- },
1131
- "required": [
1132
- "target"
1133
- ],
1134
- "additionalProperties": false
1135
- },
1136
1102
  [targets_js_1.Target.WalmartProduct]: {
1137
1103
  "type": "object",
1138
1104
  "properties": {
@@ -1511,40 +1477,6 @@ exports.requestJsonSchemas = {
1511
1477
  ],
1512
1478
  "additionalProperties": false
1513
1479
  },
1514
- [targets_js_1.Target.UniversalCore]: {
1515
- "type": "object",
1516
- "properties": {
1517
- "target": {
1518
- "const": "universal_core"
1519
- },
1520
- "url": {
1521
- "type": "string",
1522
- "maxLength": 2056
1523
- },
1524
- "payload": {
1525
- "type": "string"
1526
- },
1527
- "geo": {
1528
- "type": "string"
1529
- },
1530
- "http_method": {
1531
- "type": "string"
1532
- },
1533
- "successful_status_codes": {
1534
- "type": "array",
1535
- "items": {
1536
- "type": "number"
1537
- }
1538
- },
1539
- "callback_url": {
1540
- "type": "string"
1541
- }
1542
- },
1543
- "required": [
1544
- "target"
1545
- ],
1546
- "additionalProperties": false
1547
- },
1548
1480
  [targets_js_1.Target.Chatgpt]: {
1549
1481
  "type": "object",
1550
1482
  "properties": {
@@ -2253,124 +2185,6 @@ exports.requestJsonSchemas = {
2253
2185
  ],
2254
2186
  "additionalProperties": false
2255
2187
  },
2256
- [targets_js_1.Target.SiteUnblocker]: {
2257
- "type": "object",
2258
- "properties": {
2259
- "target": {
2260
- "const": "site_unblocker"
2261
- },
2262
- "url": {
2263
- "type": "string",
2264
- "maxLength": 2056
2265
- },
2266
- "geo": {
2267
- "type": "string"
2268
- },
2269
- "locale": {
2270
- "type": "string"
2271
- },
2272
- "session_id": {
2273
- "type": "string"
2274
- },
2275
- "http_method": {
2276
- "type": "string"
2277
- },
2278
- "customStatusCode": {
2279
- "type": "string"
2280
- },
2281
- "requestBody": {
2282
- "type": "string"
2283
- },
2284
- "headless": {
2285
- "type": "string",
2286
- "enum": [
2287
- "html",
2288
- "png"
2289
- ]
2290
- },
2291
- "headers": {
2292
- "type": "object"
2293
- },
2294
- "force_headers": {
2295
- "type": "boolean"
2296
- },
2297
- "force_cookies": {
2298
- "type": "boolean"
2299
- },
2300
- "customCookies": {
2301
- "type": "string"
2302
- },
2303
- "markdown": {
2304
- "type": "boolean"
2305
- },
2306
- "callback_url": {
2307
- "type": "string"
2308
- }
2309
- },
2310
- "required": [
2311
- "target"
2312
- ],
2313
- "additionalProperties": false
2314
- },
2315
- [targets_js_1.Target.SiteUnblockerReq]: {
2316
- "type": "object",
2317
- "properties": {
2318
- "target": {
2319
- "const": "site_unblocker_req"
2320
- },
2321
- "url": {
2322
- "type": "string",
2323
- "maxLength": 2056
2324
- },
2325
- "geo": {
2326
- "type": "string"
2327
- },
2328
- "locale": {
2329
- "type": "string"
2330
- },
2331
- "session_id": {
2332
- "type": "string"
2333
- },
2334
- "http_method": {
2335
- "type": "string"
2336
- },
2337
- "customStatusCode": {
2338
- "type": "string"
2339
- },
2340
- "requestBody": {
2341
- "type": "string"
2342
- },
2343
- "headless": {
2344
- "type": "string",
2345
- "enum": [
2346
- "html",
2347
- "png"
2348
- ]
2349
- },
2350
- "headers": {
2351
- "type": "object"
2352
- },
2353
- "force_headers": {
2354
- "type": "boolean"
2355
- },
2356
- "force_cookies": {
2357
- "type": "boolean"
2358
- },
2359
- "customCookies": {
2360
- "type": "string"
2361
- },
2362
- "markdown": {
2363
- "type": "boolean"
2364
- },
2365
- "callback_url": {
2366
- "type": "string"
2367
- }
2368
- },
2369
- "required": [
2370
- "target"
2371
- ],
2372
- "additionalProperties": false
2373
- },
2374
2188
  };
2375
2189
  exports.requestSchemas = {
2376
2190
  [targets_js_1.Target.UniversalEcommerce]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.UniversalEcommerce]),
@@ -2395,7 +2209,6 @@ exports.requestSchemas = {
2395
2209
  [targets_js_1.Target.AmazonBestsellers]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.AmazonBestsellers]),
2396
2210
  [targets_js_1.Target.Amazon]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.Amazon]),
2397
2211
  [targets_js_1.Target.Ecommerce]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.Ecommerce]),
2398
- [targets_js_1.Target.EcommerceCore]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.EcommerceCore]),
2399
2212
  [targets_js_1.Target.WalmartProduct]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.WalmartProduct]),
2400
2213
  [targets_js_1.Target.WalmartSearch]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.WalmartSearch]),
2401
2214
  [targets_js_1.Target.Walmart]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.Walmart]),
@@ -2404,7 +2217,6 @@ exports.requestSchemas = {
2404
2217
  [targets_js_1.Target.Target]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.Target]),
2405
2218
  [targets_js_1.Target.LowesSearch]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.LowesSearch]),
2406
2219
  [targets_js_1.Target.Universal]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.Universal]),
2407
- [targets_js_1.Target.UniversalCore]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.UniversalCore]),
2408
2220
  [targets_js_1.Target.Chatgpt]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.Chatgpt]),
2409
2221
  [targets_js_1.Target.Perplexity]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.Perplexity]),
2410
2222
  [targets_js_1.Target.Bbb]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.Bbb]),
@@ -2426,6 +2238,4 @@ exports.requestSchemas = {
2426
2238
  [targets_js_1.Target.YoutubeSearchMax]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.YoutubeSearchMax]),
2427
2239
  [targets_js_1.Target.YoutubeSubtitles]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.YoutubeSubtitles]),
2428
2240
  [targets_js_1.Target.YoutubeChannel]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.YoutubeChannel]),
2429
- [targets_js_1.Target.SiteUnblocker]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.SiteUnblocker]),
2430
- [targets_js_1.Target.SiteUnblockerReq]: z.fromJSONSchema(exports.requestJsonSchemas[targets_js_1.Target.SiteUnblockerReq]),
2431
2241
  };
@@ -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.EcommerceCore, Target.WalmartProduct, Target.WalmartSearch, Target.Walmart, Target.TargetProduct, Target.TargetSearch, Target.Target, Target.LowesSearch, Target.Universal, Target.UniversalCore, 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, Target.SiteUnblocker, Target.SiteUnblockerReq];
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]: {
@@ -29,7 +29,6 @@ var Target;
29
29
  Target["AmazonBestsellers"] = "amazon_bestsellers";
30
30
  Target["Amazon"] = "amazon";
31
31
  Target["Ecommerce"] = "ecommerce";
32
- Target["EcommerceCore"] = "ecommerce_core";
33
32
  Target["WalmartProduct"] = "walmart_product";
34
33
  Target["WalmartSearch"] = "walmart_search";
35
34
  Target["Walmart"] = "walmart";
@@ -38,7 +37,6 @@ var Target;
38
37
  Target["Target"] = "target";
39
38
  Target["LowesSearch"] = "lowes_search";
40
39
  Target["Universal"] = "universal";
41
- Target["UniversalCore"] = "universal_core";
42
40
  Target["Chatgpt"] = "chatgpt";
43
41
  Target["Perplexity"] = "perplexity";
44
42
  Target["Bbb"] = "bbb";
@@ -60,10 +58,8 @@ var Target;
60
58
  Target["YoutubeSearchMax"] = "youtube_search_max";
61
59
  Target["YoutubeSubtitles"] = "youtube_subtitles";
62
60
  Target["YoutubeChannel"] = "youtube_channel";
63
- Target["SiteUnblocker"] = "site_unblocker";
64
- Target["SiteUnblockerReq"] = "site_unblocker_req";
65
61
  })(Target || (exports.Target = Target = {}));
66
- exports.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.EcommerceCore, Target.WalmartProduct, Target.WalmartSearch, Target.Walmart, Target.TargetProduct, Target.TargetSearch, Target.Target, Target.LowesSearch, Target.Universal, Target.UniversalCore, 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, Target.SiteUnblocker, Target.SiteUnblockerReq];
62
+ exports.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];
67
63
  exports.targetMeta = {
68
64
  [Target.UniversalEcommerce]: {
69
65
  group: "None",
@@ -175,11 +171,6 @@ exports.targetMeta = {
175
171
  response_format: "json",
176
172
  parameters: ["url", "headless", "locale", "geo", "device_type", "parse", "parser_type", "callback_url"],
177
173
  },
178
- [Target.EcommerceCore]: {
179
- group: "None",
180
- response_format: "html",
181
- parameters: ["url", "payload", "geo", "http_method", "successful_status_codes", "callback_url"],
182
- },
183
174
  [Target.WalmartProduct]: {
184
175
  group: "Walmart",
185
176
  response_format: "html",
@@ -220,11 +211,6 @@ exports.targetMeta = {
220
211
  response_format: "html",
221
212
  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"],
222
213
  },
223
- [Target.UniversalCore]: {
224
- group: "None",
225
- response_format: "html",
226
- parameters: ["url", "payload", "geo", "http_method", "successful_status_codes", "callback_url"],
227
- },
228
214
  [Target.Chatgpt]: {
229
215
  group: "AI Tools",
230
216
  response_format: "json",
@@ -330,14 +316,4 @@ exports.targetMeta = {
330
316
  response_format: "json",
331
317
  parameters: ["query", "parse", "limit", "markdown", "callback_url"],
332
318
  },
333
- [Target.SiteUnblocker]: {
334
- group: "None",
335
- response_format: "html",
336
- parameters: ["url", "geo", "locale", "session_id", "http_method", "customStatusCode", "requestBody", "headless", "headers", "force_headers", "force_cookies", "customCookies", "markdown", "callback_url"],
337
- },
338
- [Target.SiteUnblockerReq]: {
339
- group: "None",
340
- response_format: "html",
341
- parameters: ["url", "geo", "locale", "session_id", "http_method", "customStatusCode", "requestBody", "headless", "headers", "force_headers", "force_cookies", "customCookies", "markdown", "callback_url"],
342
- },
343
319
  };
package/build/cjs/http.js CHANGED
@@ -27,6 +27,7 @@ class HttpClient {
27
27
  Authorization: this.authHeader,
28
28
  'Content-Type': 'application/json',
29
29
  Accept: 'application/json',
30
+ 'x-integration': 'sdk-ts',
30
31
  },
31
32
  signal: controller.signal,
32
33
  };
@@ -1,6 +1,9 @@
1
1
  export { DecodoClient } from './client.js';
2
2
  export type { DecodoConfig } from './client.js';
3
3
  export { WebScrapingApi } from './api/web-scraping-api.js';
4
+ export { BundledSchema } from './schema/bundled-schema.js';
5
+ export { RemoteSchema } from './schema/remote-schema.js';
6
+ export type { DecodoSchema, RemoteSchemaLoadOptions } from './schema/types.js';
4
7
  export type { TargetString, TargetParamsMap, TargetMeta, ScrapeRequest, BatchRequest, } from './generated/targets.js';
5
8
  export { targets, targetMeta, Target, } from './generated/targets.js';
6
9
  export { parameterMeta } from './generated/parameters.js';
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TimeoutError = exports.ValidationError = exports.RateLimitError = exports.AuthenticationError = exports.DecodoError = exports.parameterMeta = exports.Target = exports.targetMeta = exports.targets = exports.WebScrapingApi = exports.DecodoClient = void 0;
3
+ exports.TimeoutError = exports.ValidationError = exports.RateLimitError = exports.AuthenticationError = exports.DecodoError = exports.parameterMeta = exports.Target = exports.targetMeta = exports.targets = exports.RemoteSchema = exports.BundledSchema = exports.WebScrapingApi = exports.DecodoClient = void 0;
4
4
  var client_js_1 = require("./client.js");
5
5
  Object.defineProperty(exports, "DecodoClient", { enumerable: true, get: function () { return client_js_1.DecodoClient; } });
6
6
  var web_scraping_api_js_1 = require("./api/web-scraping-api.js");
7
7
  Object.defineProperty(exports, "WebScrapingApi", { enumerable: true, get: function () { return web_scraping_api_js_1.WebScrapingApi; } });
8
+ var bundled_schema_js_1 = require("./schema/bundled-schema.js");
9
+ Object.defineProperty(exports, "BundledSchema", { enumerable: true, get: function () { return bundled_schema_js_1.BundledSchema; } });
10
+ var remote_schema_js_1 = require("./schema/remote-schema.js");
11
+ Object.defineProperty(exports, "RemoteSchema", { enumerable: true, get: function () { return remote_schema_js_1.RemoteSchema; } });
8
12
  var targets_js_1 = require("./generated/targets.js");
9
13
  Object.defineProperty(exports, "targets", { enumerable: true, get: function () { return targets_js_1.targets; } });
10
14
  Object.defineProperty(exports, "targetMeta", { enumerable: true, get: function () { return targets_js_1.targetMeta; } });
@@ -0,0 +1,4 @@
1
+ import * as z from 'zod';
2
+ import type { WebScrapingApiIR } from './types.js';
3
+ export declare const buildRequestSchemas: (api: WebScrapingApiIR) => Map<string, z.ZodType>;
4
+ export declare const validateRequestSchemas: (api: WebScrapingApiIR) => void;