@decodo/sdk-ts 2.1.0 → 2.1.2

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 (57) hide show
  1. package/build/cjs/index.cjs +3107 -0
  2. package/build/cjs/index.d.cts +903 -0
  3. package/build/esm/client.d.ts +1 -0
  4. package/build/esm/client.js +1 -0
  5. package/build/esm/http.d.ts +2 -0
  6. package/build/esm/http.js +3 -1
  7. package/package.json +9 -5
  8. package/build/cjs/api/web-scraping-api.d.ts +0 -15
  9. package/build/cjs/api/web-scraping-api.js +0 -43
  10. package/build/cjs/client.d.ts +0 -13
  11. package/build/cjs/client.js +0 -36
  12. package/build/cjs/errors.d.ts +0 -18
  13. package/build/cjs/errors.js +0 -44
  14. package/build/cjs/generated/parameters.d.ts +0 -11
  15. package/build/cjs/generated/parameters.js +0 -82
  16. package/build/cjs/generated/request-schemas.d.ts +0 -1951
  17. package/build/cjs/generated/request-schemas.js +0 -2241
  18. package/build/cjs/generated/targets.d.ts +0 -675
  19. package/build/cjs/generated/targets.js +0 -319
  20. package/build/cjs/http.d.ts +0 -22
  21. package/build/cjs/http.js +0 -95
  22. package/build/cjs/index.d.ts +0 -12
  23. package/build/cjs/index.js +0 -23
  24. package/build/cjs/schema/build-request-schemas.d.ts +0 -4
  25. package/build/cjs/schema/build-request-schemas.js +0 -56
  26. package/build/cjs/schema/build-target-meta.d.ts +0 -3
  27. package/build/cjs/schema/build-target-meta.js +0 -19
  28. package/build/cjs/schema/bundled-provider.d.ts +0 -2
  29. package/build/cjs/schema/bundled-provider.js +0 -9
  30. package/build/cjs/schema/bundled-schema.d.ts +0 -10
  31. package/build/cjs/schema/bundled-schema.js +0 -24
  32. package/build/cjs/schema/constants.d.ts +0 -5
  33. package/build/cjs/schema/constants.js +0 -8
  34. package/build/cjs/schema/expand-path.d.ts +0 -1
  35. package/build/cjs/schema/expand-path.js +0 -15
  36. package/build/cjs/schema/remote-provider.d.ts +0 -8
  37. package/build/cjs/schema/remote-provider.js +0 -120
  38. package/build/cjs/schema/remote-schema.d.ts +0 -19
  39. package/build/cjs/schema/remote-schema.js +0 -149
  40. package/build/cjs/schema/resolve-latest-ir.d.ts +0 -2
  41. package/build/cjs/schema/resolve-latest-ir.js +0 -55
  42. package/build/cjs/schema/resolve-provider.d.ts +0 -3
  43. package/build/cjs/schema/resolve-provider.js +0 -27
  44. package/build/cjs/schema/types.d.ts +0 -44
  45. package/build/cjs/schema/types.js +0 -2
  46. package/build/cjs/types/requests.d.ts +0 -1
  47. package/build/cjs/types/requests.js +0 -2
  48. package/build/cjs/types/responses.d.ts +0 -62
  49. package/build/cjs/types/responses.js +0 -2
  50. package/build/esm/schema/build-request-schemas.d.ts +0 -4
  51. package/build/esm/schema/build-request-schemas.js +0 -18
  52. package/build/esm/schema/bundled-provider.d.ts +0 -2
  53. package/build/esm/schema/bundled-provider.js +0 -6
  54. package/build/esm/schema/remote-provider.d.ts +0 -8
  55. package/build/esm/schema/remote-provider.js +0 -83
  56. package/build/esm/schema/resolve-provider.d.ts +0 -3
  57. package/build/esm/schema/resolve-provider.js +0 -22
@@ -0,0 +1,3107 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ AuthenticationError: () => AuthenticationError,
34
+ BundledSchema: () => BundledSchema,
35
+ DecodoClient: () => DecodoClient,
36
+ DecodoError: () => DecodoError,
37
+ RateLimitError: () => RateLimitError,
38
+ RemoteSchema: () => RemoteSchema,
39
+ Target: () => Target,
40
+ TimeoutError: () => TimeoutError,
41
+ ValidationError: () => ValidationError,
42
+ WebScrapingApi: () => WebScrapingApi,
43
+ parameterMeta: () => parameterMeta,
44
+ targetMeta: () => targetMeta,
45
+ targets: () => targets
46
+ });
47
+ module.exports = __toCommonJS(index_exports);
48
+
49
+ // src/errors.ts
50
+ var DecodoError = class extends Error {
51
+ statusCode;
52
+ apiStatus;
53
+ constructor(message, statusCode, apiStatus) {
54
+ super(message);
55
+ this.name = "DecodoError";
56
+ this.statusCode = statusCode;
57
+ this.apiStatus = apiStatus;
58
+ }
59
+ };
60
+ var AuthenticationError = class extends DecodoError {
61
+ constructor(message = "Authentication failed. Check your credentials.") {
62
+ super(message, 401, "failed");
63
+ this.name = "AuthenticationError";
64
+ }
65
+ };
66
+ var RateLimitError = class extends DecodoError {
67
+ constructor(message = "Rate limit exceeded. Slow down your request rate.") {
68
+ super(message, 429, "failed");
69
+ this.name = "RateLimitError";
70
+ }
71
+ };
72
+ var ValidationError = class extends DecodoError {
73
+ errors;
74
+ constructor(message, errors) {
75
+ super(message, 422, "failed");
76
+ this.name = "ValidationError";
77
+ this.errors = errors;
78
+ }
79
+ };
80
+ var TimeoutError = class extends Error {
81
+ constructor(message = "The request timed out.") {
82
+ super(message);
83
+ this.name = "TimeoutError";
84
+ }
85
+ };
86
+
87
+ // src/http.ts
88
+ var HttpClient = class {
89
+ baseUrl;
90
+ authHeader;
91
+ timeoutMs;
92
+ integrationHeader;
93
+ constructor(config) {
94
+ this.baseUrl = config.baseUrl.replace(/\/+$/, "");
95
+ this.timeoutMs = config.timeoutMs;
96
+ this.integrationHeader = config.integrationHeader ?? "sdk-ts";
97
+ if (config.auth.type === "basic") {
98
+ this.authHeader = `Basic ${config.auth.token}`;
99
+ } else {
100
+ this.authHeader = config.auth.apiKey;
101
+ }
102
+ }
103
+ async request(method, path, body) {
104
+ const url = `${this.baseUrl}${path}`;
105
+ const controller = new AbortController();
106
+ const timer = setTimeout(() => controller.abort(), this.timeoutMs);
107
+ try {
108
+ const init = {
109
+ method,
110
+ headers: {
111
+ Authorization: this.authHeader,
112
+ "Content-Type": "application/json",
113
+ Accept: "application/json",
114
+ "x-integration": this.integrationHeader
115
+ },
116
+ signal: controller.signal
117
+ };
118
+ if (body !== void 0) {
119
+ init.body = JSON.stringify(body);
120
+ }
121
+ const res = await fetch(url, init);
122
+ if (res.ok) {
123
+ if (res.status === 204) {
124
+ return void 0;
125
+ }
126
+ return await res.json();
127
+ }
128
+ let errorBody;
129
+ try {
130
+ errorBody = await res.json();
131
+ } catch {
132
+ }
133
+ const message = errorBody?.message ?? `HTTP ${res.status}`;
134
+ if (res.status === 401 || res.status === 403) {
135
+ throw new AuthenticationError(message);
136
+ }
137
+ if (res.status === 429) {
138
+ throw new RateLimitError(message);
139
+ }
140
+ if (res.status === 422 || res.status === 400 && errorBody?.errors) {
141
+ throw new ValidationError(message, errorBody?.errors);
142
+ }
143
+ throw new DecodoError(message, res.status, errorBody?.status);
144
+ } catch (err) {
145
+ if (err instanceof DecodoError) {
146
+ throw err;
147
+ }
148
+ if (err instanceof TypeError && err.cause?.code === "ABORT_ERR") {
149
+ throw new TimeoutError(
150
+ `Request to ${path} timed out after ${this.timeoutMs}ms`
151
+ );
152
+ }
153
+ if (err instanceof DOMException && err.name === "AbortError") {
154
+ throw new TimeoutError(
155
+ `Request to ${path} timed out after ${this.timeoutMs}ms`
156
+ );
157
+ }
158
+ throw err;
159
+ } finally {
160
+ clearTimeout(timer);
161
+ }
162
+ }
163
+ post(path, body) {
164
+ return this.request("POST", path, body);
165
+ }
166
+ get(path, query) {
167
+ if (query) {
168
+ const params = new URLSearchParams(query);
169
+ const qs = params.toString();
170
+ if (qs) {
171
+ return this.request("GET", `${path}?${qs}`);
172
+ }
173
+ }
174
+ return this.request("GET", path);
175
+ }
176
+ };
177
+
178
+ // src/api/web-scraping-api.ts
179
+ var import_zod = require("zod");
180
+
181
+ // src/generated/request-schemas.ts
182
+ var z = __toESM(require("zod"), 1);
183
+
184
+ // src/generated/targets.ts
185
+ var Target = /* @__PURE__ */ ((_Target) => {
186
+ _Target["UniversalEcommerce"] = "universal_ecommerce";
187
+ _Target["GoogleSearch"] = "google_search";
188
+ _Target["GoogleTravelHotels"] = "google_travel_hotels";
189
+ _Target["GoogleTrendsExplore"] = "google_trends_explore";
190
+ _Target["GoogleShoppingSearch"] = "google_shopping_search";
191
+ _Target["GoogleShoppingProduct"] = "google_shopping_product";
192
+ _Target["Google"] = "google";
193
+ _Target["GoogleSuggest"] = "google_suggest";
194
+ _Target["GoogleMaps"] = "google_maps";
195
+ _Target["GoogleAiMode"] = "google_ai_mode";
196
+ _Target["GoogleAds"] = "google_ads";
197
+ _Target["GoogleLens"] = "google_lens";
198
+ _Target["BingSearch"] = "bing_search";
199
+ _Target["Bing"] = "bing";
200
+ _Target["YoutubeTranscript"] = "youtube_transcript";
201
+ _Target["AmazonProduct"] = "amazon_product";
202
+ _Target["AmazonPricing"] = "amazon_pricing";
203
+ _Target["AmazonSearch"] = "amazon_search";
204
+ _Target["AmazonSellers"] = "amazon_sellers";
205
+ _Target["AmazonBestsellers"] = "amazon_bestsellers";
206
+ _Target["Amazon"] = "amazon";
207
+ _Target["Ecommerce"] = "ecommerce";
208
+ _Target["WalmartProduct"] = "walmart_product";
209
+ _Target["WalmartSearch"] = "walmart_search";
210
+ _Target["Walmart"] = "walmart";
211
+ _Target["TargetProduct"] = "target_product";
212
+ _Target["TargetSearch"] = "target_search";
213
+ _Target["Target"] = "target";
214
+ _Target["LowesSearch"] = "lowes_search";
215
+ _Target["Universal"] = "universal";
216
+ _Target["Chatgpt"] = "chatgpt";
217
+ _Target["Perplexity"] = "perplexity";
218
+ _Target["Bbb"] = "bbb";
219
+ _Target["Autotrader"] = "autotrader";
220
+ _Target["Mobile"] = "mobile";
221
+ _Target["Airbnb"] = "airbnb";
222
+ _Target["AppleAppStore"] = "apple_app_store";
223
+ _Target["InstagramGraphqlProfile"] = "instagram_graphql_profile";
224
+ _Target["TiktokPost"] = "tiktok_post";
225
+ _Target["TiktokShopSearch"] = "tiktok_shop_search";
226
+ _Target["TiktokShopProduct"] = "tiktok_shop_product";
227
+ _Target["Tiktok"] = "tiktok";
228
+ _Target["RedditPost"] = "reddit_post";
229
+ _Target["RedditSubreddit"] = "reddit_subreddit";
230
+ _Target["RedditUser"] = "reddit_user";
231
+ _Target["YoutubeVideo"] = "youtube_video";
232
+ _Target["YoutubeMetadata"] = "youtube_metadata";
233
+ _Target["YoutubeSearch"] = "youtube_search";
234
+ _Target["YoutubeSearchMax"] = "youtube_search_max";
235
+ _Target["YoutubeSubtitles"] = "youtube_subtitles";
236
+ _Target["YoutubeChannel"] = "youtube_channel";
237
+ return _Target;
238
+ })(Target || {});
239
+ var targets = ["universal_ecommerce" /* UniversalEcommerce */, "google_search" /* GoogleSearch */, "google_travel_hotels" /* GoogleTravelHotels */, "google_trends_explore" /* GoogleTrendsExplore */, "google_shopping_search" /* GoogleShoppingSearch */, "google_shopping_product" /* GoogleShoppingProduct */, "google" /* Google */, "google_suggest" /* GoogleSuggest */, "google_maps" /* GoogleMaps */, "google_ai_mode" /* GoogleAiMode */, "google_ads" /* GoogleAds */, "google_lens" /* GoogleLens */, "bing_search" /* BingSearch */, "bing" /* Bing */, "youtube_transcript" /* YoutubeTranscript */, "amazon_product" /* AmazonProduct */, "amazon_pricing" /* AmazonPricing */, "amazon_search" /* AmazonSearch */, "amazon_sellers" /* AmazonSellers */, "amazon_bestsellers" /* AmazonBestsellers */, "amazon" /* Amazon */, "ecommerce" /* Ecommerce */, "walmart_product" /* WalmartProduct */, "walmart_search" /* WalmartSearch */, "walmart" /* Walmart */, "target_product" /* TargetProduct */, "target_search" /* TargetSearch */, "target" /* Target */, "lowes_search" /* LowesSearch */, "universal" /* Universal */, "chatgpt" /* Chatgpt */, "perplexity" /* Perplexity */, "bbb" /* Bbb */, "autotrader" /* Autotrader */, "mobile" /* Mobile */, "airbnb" /* Airbnb */, "apple_app_store" /* AppleAppStore */, "instagram_graphql_profile" /* InstagramGraphqlProfile */, "tiktok_post" /* TiktokPost */, "tiktok_shop_search" /* TiktokShopSearch */, "tiktok_shop_product" /* TiktokShopProduct */, "tiktok" /* Tiktok */, "reddit_post" /* RedditPost */, "reddit_subreddit" /* RedditSubreddit */, "reddit_user" /* RedditUser */, "youtube_video" /* YoutubeVideo */, "youtube_metadata" /* YoutubeMetadata */, "youtube_search" /* YoutubeSearch */, "youtube_search_max" /* YoutubeSearchMax */, "youtube_subtitles" /* YoutubeSubtitles */, "youtube_channel" /* YoutubeChannel */];
240
+ var targetMeta = {
241
+ ["universal_ecommerce" /* UniversalEcommerce */]: {
242
+ group: "None",
243
+ response_format: "html",
244
+ parameters: ["callback_url"]
245
+ },
246
+ ["google_search" /* GoogleSearch */]: {
247
+ group: "Google",
248
+ response_format: "json",
249
+ parameters: ["query", "headless", "locale", "geo", "device_type", "page_from", "google_results_language", "google_tbm", "google_tbs", "parse", "google_nfpr", "google_safe_search", "session_id", "xhr", "markdown", "page_count", "callback_url"]
250
+ },
251
+ ["google_travel_hotels" /* GoogleTravelHotels */]: {
252
+ group: "Google",
253
+ response_format: "html",
254
+ parameters: ["query", "headless", "locale", "device_type", "page_from", "date_range", "stars", "adults", "children", "session_id", "markdown", "callback_url"]
255
+ },
256
+ ["google_trends_explore" /* GoogleTrendsExplore */]: {
257
+ group: "Google",
258
+ response_format: "json",
259
+ parameters: ["query", "geo", "device_type", "search_type", "date_start", "date_end", "callback_url"]
260
+ },
261
+ ["google_shopping_search" /* GoogleShoppingSearch */]: {
262
+ group: "Google",
263
+ response_format: "json",
264
+ parameters: ["query", "headless", "locale", "geo", "device_type", "page_from", "google_tbs", "parse", "session_id", "google_results_language", "markdown", "callback_url"]
265
+ },
266
+ ["google_shopping_product" /* GoogleShoppingProduct */]: {
267
+ group: "Google",
268
+ response_format: "json",
269
+ parameters: ["query", "headless", "locale", "geo", "device_type", "page_from", "parse", "session_id", "google_results_language", "markdown", "xhr", "callback_url"]
270
+ },
271
+ ["google" /* Google */]: {
272
+ group: "Google",
273
+ response_format: "json",
274
+ parameters: ["url", "headless", "locale", "device_type", "parse", "session_id", "markdown", "xhr", "page_count", "callback_url"]
275
+ },
276
+ ["google_suggest" /* GoogleSuggest */]: {
277
+ group: "Google",
278
+ response_format: "json",
279
+ parameters: ["query", "device_type", "geo", "locale", "session_id", "callback_url"]
280
+ },
281
+ ["google_maps" /* GoogleMaps */]: {
282
+ group: "Google",
283
+ response_format: "html",
284
+ parameters: ["query", "headless", "geo", "locale", "page_from", "device_type", "session_id", "google_results_language", "google_nfpr", "hotel_occupancy", "date_range", "markdown", "callback_url"]
285
+ },
286
+ ["google_ai_mode" /* GoogleAiMode */]: {
287
+ group: "AI Tools",
288
+ response_format: "json",
289
+ parameters: ["query", "geo", "parse", "device_type", "session_id", "markdown", "xhr", "callback_url"]
290
+ },
291
+ ["google_ads" /* GoogleAds */]: {
292
+ group: "Google",
293
+ response_format: "json",
294
+ parameters: ["query", "headless", "locale", "geo", "device_type", "page_from", "google_results_language", "google_tbm", "google_tbs", "parse", "google_nfpr", "session_id", "markdown", "xhr", "page_count", "callback_url"]
295
+ },
296
+ ["google_lens" /* GoogleLens */]: {
297
+ group: "Google",
298
+ response_format: "json",
299
+ parameters: ["query", "headless", "parse", "device_type", "markdown", "callback_url"]
300
+ },
301
+ ["bing_search" /* BingSearch */]: {
302
+ group: "Bing",
303
+ response_format: "json",
304
+ parameters: ["query", "headless", "locale", "geo", "domain", "device_type", "page_from", "parse", "page_count", "session_id", "markdown", "xhr", "callback_url"]
305
+ },
306
+ ["bing" /* Bing */]: {
307
+ group: "Bing",
308
+ response_format: "json",
309
+ parameters: ["url", "headless", "locale", "geo", "device_type", "page_from", "parse", "session_id", "markdown", "xhr", "callback_url"]
310
+ },
311
+ ["youtube_transcript" /* YoutubeTranscript */]: {
312
+ group: "YouTube",
313
+ response_format: "json",
314
+ parameters: ["query", "language_code", "transcript_origin", "callback_url"]
315
+ },
316
+ ["amazon_product" /* AmazonProduct */]: {
317
+ group: "Amazon",
318
+ response_format: "json",
319
+ parameters: ["query", "headless", "domain", "device_type", "parse", "autoselect_variant", "geo", "session_id", "currency", "markdown", "xhr", "callback_url"]
320
+ },
321
+ ["amazon_pricing" /* AmazonPricing */]: {
322
+ group: "Amazon",
323
+ response_format: "json",
324
+ parameters: ["query", "headless", "domain", "device_type", "page_from", "parse", "geo", "session_id", "currency", "markdown", "xhr", "callback_url"]
325
+ },
326
+ ["amazon_search" /* AmazonSearch */]: {
327
+ group: "Amazon",
328
+ response_format: "json",
329
+ parameters: ["query", "headless", "domain", "device_type", "page_from", "category", "merchant", "parse", "geo", "session_id", "sort_by", "currency", "markdown", "xhr", "callback_url"]
330
+ },
331
+ ["amazon_sellers" /* AmazonSellers */]: {
332
+ group: "Amazon",
333
+ response_format: "json",
334
+ parameters: ["query", "headless", "locale", "domain", "device_type", "geo", "parse", "markdown", "xhr", "callback_url"]
335
+ },
336
+ ["amazon_bestsellers" /* AmazonBestsellers */]: {
337
+ group: "Amazon",
338
+ response_format: "json",
339
+ parameters: ["query", "domain", "device_type", "geo", "page_from", "category", "parse", "session_id", "currency", "markdown", "xhr", "callback_url"]
340
+ },
341
+ ["amazon" /* Amazon */]: {
342
+ group: "Amazon",
343
+ response_format: "json",
344
+ parameters: ["url", "headless", "device_type", "parse", "geo", "session_id", "markdown", "xhr", "callback_url"]
345
+ },
346
+ ["ecommerce" /* Ecommerce */]: {
347
+ group: "Other eCommerce",
348
+ response_format: "json",
349
+ parameters: ["url", "headless", "locale", "geo", "device_type", "parse", "parser_type", "callback_url"]
350
+ },
351
+ ["walmart_product" /* WalmartProduct */]: {
352
+ group: "Walmart",
353
+ response_format: "html",
354
+ parameters: ["product_id", "headless", "parse", "xhr", "markdown", "fulfillment_type", "walmart_store_id", "delivery_zip", "callback_url"]
355
+ },
356
+ ["walmart_search" /* WalmartSearch */]: {
357
+ group: "Walmart",
358
+ response_format: "json",
359
+ parameters: ["query", "headless", "parse", "markdown", "fulfillment_type", "walmart_store_id", "delivery_zip", "callback_url"]
360
+ },
361
+ ["walmart" /* Walmart */]: {
362
+ group: "Walmart",
363
+ response_format: "html",
364
+ parameters: ["url", "headless", "locale", "geo", "device_type", "store_id", "markdown", "xhr", "callback_url"]
365
+ },
366
+ ["target_product" /* TargetProduct */]: {
367
+ group: "Target",
368
+ response_format: "json",
369
+ parameters: ["product_id", "headless", "parse", "device_type", "markdown", "xhr", "delivery_type", "target_store_id", "delivery_zip", "callback_url"]
370
+ },
371
+ ["target_search" /* TargetSearch */]: {
372
+ group: "Target",
373
+ response_format: "json",
374
+ parameters: ["query", "headless", "parse", "device_type", "delivery_type", "target_store_id", "delivery_zip", "xhr", "markdown", "callback_url"]
375
+ },
376
+ ["target" /* Target */]: {
377
+ group: "Target",
378
+ response_format: "html",
379
+ parameters: ["url", "headless", "device_type", "xhr", "delivery_zip", "target_store_id", "callback_url"]
380
+ },
381
+ ["lowes_search" /* LowesSearch */]: {
382
+ group: "Lowe's",
383
+ response_format: "json",
384
+ parameters: ["query", "lowes_store_id", "headless", "delivery_zip", "user_agent_type", "free_delivery", "pickup_today", "delivery_today_tomorrow", "callback_url"]
385
+ },
386
+ ["universal" /* Universal */]: {
387
+ group: "Universal",
388
+ response_format: "html",
389
+ 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"]
390
+ },
391
+ ["chatgpt" /* Chatgpt */]: {
392
+ group: "AI Tools",
393
+ response_format: "json",
394
+ parameters: ["prompt", "search", "parse", "geo", "device_type", "markdown", "xhr", "callback_url"]
395
+ },
396
+ ["perplexity" /* Perplexity */]: {
397
+ group: "AI Tools",
398
+ response_format: "json",
399
+ parameters: ["prompt", "parse", "geo", "device_type", "markdown", "xhr", "callback_url"]
400
+ },
401
+ ["bbb" /* Bbb */]: {
402
+ group: "Business Reviews",
403
+ response_format: "html",
404
+ parameters: ["url", "headless", "geo", "device_type", "markdown", "xhr", "callback_url"]
405
+ },
406
+ ["autotrader" /* Autotrader */]: {
407
+ group: "Marketplace",
408
+ response_format: "html",
409
+ parameters: ["url", "headless", "geo", "device_type", "markdown", "xhr", "callback_url"]
410
+ },
411
+ ["mobile" /* Mobile */]: {
412
+ group: "Marketplace",
413
+ response_format: "html",
414
+ parameters: ["url", "headless", "geo", "device_type", "markdown", "xhr", "callback_url"]
415
+ },
416
+ ["airbnb" /* Airbnb */]: {
417
+ group: "Travel",
418
+ response_format: "html",
419
+ parameters: ["url", "headless", "geo", "device_type", "markdown", "xhr", "callback_url"]
420
+ },
421
+ ["apple_app_store" /* AppleAppStore */]: {
422
+ group: "Marketplace",
423
+ response_format: "html",
424
+ parameters: ["url", "headless", "geo", "device_type", "markdown", "xhr", "callback_url"]
425
+ },
426
+ ["instagram_graphql_profile" /* InstagramGraphqlProfile */]: {
427
+ group: "Instagram",
428
+ response_format: "json",
429
+ parameters: ["query", "callback_url"]
430
+ },
431
+ ["tiktok_post" /* TiktokPost */]: {
432
+ group: "TikTok",
433
+ response_format: "html",
434
+ parameters: ["url", "xhr", "callback_url"]
435
+ },
436
+ ["tiktok_shop_search" /* TiktokShopSearch */]: {
437
+ group: "TikTok",
438
+ response_format: "html",
439
+ parameters: ["query", "headless", "device_type", "markdown", "country", "callback_url"]
440
+ },
441
+ ["tiktok_shop_product" /* TiktokShopProduct */]: {
442
+ group: "TikTok",
443
+ response_format: "html",
444
+ parameters: ["product_id", "headless", "device_type", "xhr", "markdown", "country", "callback_url"]
445
+ },
446
+ ["tiktok" /* Tiktok */]: {
447
+ group: "TikTok",
448
+ response_format: "html",
449
+ parameters: ["url", "headless", "user_agent_type", "callback_url"]
450
+ },
451
+ ["reddit_post" /* RedditPost */]: {
452
+ group: "Reddit",
453
+ response_format: "json",
454
+ parameters: ["url", "locale", "geo", "callback_url"]
455
+ },
456
+ ["reddit_subreddit" /* RedditSubreddit */]: {
457
+ group: "Reddit",
458
+ response_format: "json",
459
+ parameters: ["url", "locale", "geo", "callback_url"]
460
+ },
461
+ ["reddit_user" /* RedditUser */]: {
462
+ group: "Reddit",
463
+ response_format: "json",
464
+ parameters: ["url", "locale", "geo", "sort", "callback_url"]
465
+ },
466
+ ["youtube_video" /* YoutubeVideo */]: {
467
+ group: "None",
468
+ response_format: "json",
469
+ parameters: ["query", "geo", "callback_url"]
470
+ },
471
+ ["youtube_metadata" /* YoutubeMetadata */]: {
472
+ group: "YouTube",
473
+ response_format: "json",
474
+ parameters: ["query", "callback_url"]
475
+ },
476
+ ["youtube_search" /* YoutubeSearch */]: {
477
+ group: "YouTube",
478
+ response_format: "json",
479
+ parameters: ["360", "query", "upload_date", "type", "duration", "video_sort_by", "3d", "4k", "creative_commons", "hd", "hdr", "vr180", "live", "location", "purchased", "subtitles", "callback_url"]
480
+ },
481
+ ["youtube_search_max" /* YoutubeSearchMax */]: {
482
+ group: "YouTube",
483
+ response_format: "json",
484
+ parameters: ["360", "query", "upload_date", "type", "duration", "video_sort_by", "3d", "4k", "creative_commons", "hd", "hdr", "vr180", "live", "location", "purchased", "subtitles", "markdown", "callback_url"]
485
+ },
486
+ ["youtube_subtitles" /* YoutubeSubtitles */]: {
487
+ group: "YouTube",
488
+ response_format: "json",
489
+ parameters: ["query", "language_code", "subtitle_origin", "callback_url"]
490
+ },
491
+ ["youtube_channel" /* YoutubeChannel */]: {
492
+ group: "YouTube",
493
+ response_format: "json",
494
+ parameters: ["query", "parse", "limit", "markdown", "callback_url"]
495
+ }
496
+ };
497
+
498
+ // src/generated/request-schemas.ts
499
+ var requestJsonSchemas = {
500
+ ["universal_ecommerce" /* UniversalEcommerce */]: {
501
+ "type": "object",
502
+ "properties": {
503
+ "target": {
504
+ "const": "universal_ecommerce"
505
+ },
506
+ "callback_url": {
507
+ "type": "string"
508
+ }
509
+ },
510
+ "required": [
511
+ "target"
512
+ ],
513
+ "additionalProperties": false
514
+ },
515
+ ["google_search" /* GoogleSearch */]: {
516
+ "type": "object",
517
+ "properties": {
518
+ "target": {
519
+ "const": "google_search"
520
+ },
521
+ "query": {
522
+ "type": "string",
523
+ "maxLength": 2048
524
+ },
525
+ "headless": {
526
+ "type": "string",
527
+ "enum": [
528
+ "html",
529
+ "png"
530
+ ]
531
+ },
532
+ "locale": {
533
+ "type": "string"
534
+ },
535
+ "geo": {
536
+ "type": "string"
537
+ },
538
+ "device_type": {
539
+ "type": "string"
540
+ },
541
+ "page_from": {
542
+ "type": "number",
543
+ "minimum": 0,
544
+ "maximum": 100
545
+ },
546
+ "google_results_language": {
547
+ "type": "string"
548
+ },
549
+ "google_tbm": {
550
+ "type": "string"
551
+ },
552
+ "google_tbs": {
553
+ "type": "string"
554
+ },
555
+ "parse": {
556
+ "type": "boolean"
557
+ },
558
+ "google_nfpr": {
559
+ "type": "boolean"
560
+ },
561
+ "google_safe_search": {
562
+ "type": "boolean"
563
+ },
564
+ "session_id": {
565
+ "type": "string"
566
+ },
567
+ "xhr": {
568
+ "type": "boolean"
569
+ },
570
+ "markdown": {
571
+ "type": "boolean"
572
+ },
573
+ "page_count": {
574
+ "type": "number",
575
+ "minimum": 1,
576
+ "maximum": 10
577
+ },
578
+ "callback_url": {
579
+ "type": "string"
580
+ }
581
+ },
582
+ "required": [
583
+ "target"
584
+ ],
585
+ "additionalProperties": false
586
+ },
587
+ ["google_travel_hotels" /* GoogleTravelHotels */]: {
588
+ "type": "object",
589
+ "properties": {
590
+ "target": {
591
+ "const": "google_travel_hotels"
592
+ },
593
+ "query": {
594
+ "type": "string",
595
+ "maxLength": 2048
596
+ },
597
+ "headless": {
598
+ "type": "string",
599
+ "enum": [
600
+ "html",
601
+ "png"
602
+ ]
603
+ },
604
+ "locale": {
605
+ "type": "string"
606
+ },
607
+ "device_type": {
608
+ "type": "string"
609
+ },
610
+ "page_from": {
611
+ "type": "number",
612
+ "minimum": 0,
613
+ "maximum": 100
614
+ },
615
+ "date_range": {
616
+ "type": "string"
617
+ },
618
+ "stars": {
619
+ "type": "number"
620
+ },
621
+ "adults": {
622
+ "type": "number",
623
+ "minimum": 1,
624
+ "maximum": 3
625
+ },
626
+ "children": {
627
+ "type": "number",
628
+ "minimum": 1,
629
+ "maximum": 3
630
+ },
631
+ "session_id": {
632
+ "type": "string"
633
+ },
634
+ "markdown": {
635
+ "type": "boolean"
636
+ },
637
+ "callback_url": {
638
+ "type": "string"
639
+ }
640
+ },
641
+ "required": [
642
+ "target"
643
+ ],
644
+ "additionalProperties": false
645
+ },
646
+ ["google_trends_explore" /* GoogleTrendsExplore */]: {
647
+ "type": "object",
648
+ "properties": {
649
+ "target": {
650
+ "const": "google_trends_explore"
651
+ },
652
+ "query": {
653
+ "type": "string",
654
+ "maxLength": 2048
655
+ },
656
+ "geo": {
657
+ "type": "string"
658
+ },
659
+ "device_type": {
660
+ "type": "string"
661
+ },
662
+ "search_type": {
663
+ "type": "string"
664
+ },
665
+ "date_start": {
666
+ "type": "string"
667
+ },
668
+ "date_end": {
669
+ "type": "string"
670
+ },
671
+ "callback_url": {
672
+ "type": "string"
673
+ }
674
+ },
675
+ "required": [
676
+ "target"
677
+ ],
678
+ "additionalProperties": false
679
+ },
680
+ ["google_shopping_search" /* GoogleShoppingSearch */]: {
681
+ "type": "object",
682
+ "properties": {
683
+ "target": {
684
+ "const": "google_shopping_search"
685
+ },
686
+ "query": {
687
+ "type": "string",
688
+ "maxLength": 2048
689
+ },
690
+ "headless": {
691
+ "type": "string",
692
+ "enum": [
693
+ "html",
694
+ "png"
695
+ ]
696
+ },
697
+ "locale": {
698
+ "type": "string"
699
+ },
700
+ "geo": {
701
+ "type": "string"
702
+ },
703
+ "device_type": {
704
+ "type": "string"
705
+ },
706
+ "page_from": {
707
+ "type": "number",
708
+ "minimum": 0,
709
+ "maximum": 100
710
+ },
711
+ "google_tbs": {
712
+ "type": "string"
713
+ },
714
+ "parse": {
715
+ "type": "boolean"
716
+ },
717
+ "session_id": {
718
+ "type": "string"
719
+ },
720
+ "google_results_language": {
721
+ "type": "string"
722
+ },
723
+ "markdown": {
724
+ "type": "boolean"
725
+ },
726
+ "callback_url": {
727
+ "type": "string"
728
+ }
729
+ },
730
+ "required": [
731
+ "target"
732
+ ],
733
+ "additionalProperties": false
734
+ },
735
+ ["google_shopping_product" /* GoogleShoppingProduct */]: {
736
+ "type": "object",
737
+ "properties": {
738
+ "target": {
739
+ "const": "google_shopping_product"
740
+ },
741
+ "query": {
742
+ "type": "string",
743
+ "maxLength": 2048
744
+ },
745
+ "headless": {
746
+ "type": "string",
747
+ "enum": [
748
+ "html",
749
+ "png"
750
+ ]
751
+ },
752
+ "locale": {
753
+ "type": "string"
754
+ },
755
+ "geo": {
756
+ "type": "string"
757
+ },
758
+ "device_type": {
759
+ "type": "string"
760
+ },
761
+ "page_from": {
762
+ "type": "number",
763
+ "minimum": 0,
764
+ "maximum": 100
765
+ },
766
+ "parse": {
767
+ "type": "boolean"
768
+ },
769
+ "session_id": {
770
+ "type": "string"
771
+ },
772
+ "google_results_language": {
773
+ "type": "string"
774
+ },
775
+ "markdown": {
776
+ "type": "boolean"
777
+ },
778
+ "xhr": {
779
+ "type": "boolean"
780
+ },
781
+ "callback_url": {
782
+ "type": "string"
783
+ }
784
+ },
785
+ "required": [
786
+ "target"
787
+ ],
788
+ "additionalProperties": false
789
+ },
790
+ ["google" /* Google */]: {
791
+ "type": "object",
792
+ "properties": {
793
+ "target": {
794
+ "const": "google"
795
+ },
796
+ "url": {
797
+ "type": "string",
798
+ "maxLength": 2056
799
+ },
800
+ "headless": {
801
+ "type": "string",
802
+ "enum": [
803
+ "html",
804
+ "png"
805
+ ]
806
+ },
807
+ "locale": {
808
+ "type": "string"
809
+ },
810
+ "device_type": {
811
+ "type": "string"
812
+ },
813
+ "parse": {
814
+ "type": "boolean"
815
+ },
816
+ "session_id": {
817
+ "type": "string"
818
+ },
819
+ "markdown": {
820
+ "type": "boolean"
821
+ },
822
+ "xhr": {
823
+ "type": "boolean"
824
+ },
825
+ "page_count": {
826
+ "type": "number",
827
+ "minimum": 1,
828
+ "maximum": 10
829
+ },
830
+ "callback_url": {
831
+ "type": "string"
832
+ }
833
+ },
834
+ "required": [
835
+ "target"
836
+ ],
837
+ "additionalProperties": false
838
+ },
839
+ ["google_suggest" /* GoogleSuggest */]: {
840
+ "type": "object",
841
+ "properties": {
842
+ "target": {
843
+ "const": "google_suggest"
844
+ },
845
+ "query": {
846
+ "type": "string",
847
+ "maxLength": 2048
848
+ },
849
+ "device_type": {
850
+ "type": "string"
851
+ },
852
+ "geo": {
853
+ "type": "string"
854
+ },
855
+ "locale": {
856
+ "type": "string"
857
+ },
858
+ "session_id": {
859
+ "type": "string"
860
+ },
861
+ "callback_url": {
862
+ "type": "string"
863
+ }
864
+ },
865
+ "required": [
866
+ "target"
867
+ ],
868
+ "additionalProperties": false
869
+ },
870
+ ["google_maps" /* GoogleMaps */]: {
871
+ "type": "object",
872
+ "properties": {
873
+ "target": {
874
+ "const": "google_maps"
875
+ },
876
+ "query": {
877
+ "type": "string",
878
+ "maxLength": 2048
879
+ },
880
+ "headless": {
881
+ "type": "string",
882
+ "enum": [
883
+ "html",
884
+ "png"
885
+ ]
886
+ },
887
+ "geo": {
888
+ "type": "string"
889
+ },
890
+ "locale": {
891
+ "type": "string"
892
+ },
893
+ "page_from": {
894
+ "type": "number",
895
+ "minimum": 0,
896
+ "maximum": 100
897
+ },
898
+ "device_type": {
899
+ "type": "string"
900
+ },
901
+ "session_id": {
902
+ "type": "string"
903
+ },
904
+ "google_results_language": {
905
+ "type": "string"
906
+ },
907
+ "google_nfpr": {
908
+ "type": "boolean"
909
+ },
910
+ "hotel_occupancy": {
911
+ "type": "string"
912
+ },
913
+ "date_range": {
914
+ "type": "string"
915
+ },
916
+ "markdown": {
917
+ "type": "boolean"
918
+ },
919
+ "callback_url": {
920
+ "type": "string"
921
+ }
922
+ },
923
+ "required": [
924
+ "target"
925
+ ],
926
+ "additionalProperties": false
927
+ },
928
+ ["google_ai_mode" /* GoogleAiMode */]: {
929
+ "type": "object",
930
+ "properties": {
931
+ "target": {
932
+ "const": "google_ai_mode"
933
+ },
934
+ "query": {
935
+ "type": "string",
936
+ "maxLength": 2048
937
+ },
938
+ "geo": {
939
+ "type": "string"
940
+ },
941
+ "parse": {
942
+ "type": "boolean"
943
+ },
944
+ "device_type": {
945
+ "type": "string"
946
+ },
947
+ "session_id": {
948
+ "type": "string"
949
+ },
950
+ "markdown": {
951
+ "type": "boolean"
952
+ },
953
+ "xhr": {
954
+ "type": "boolean"
955
+ },
956
+ "callback_url": {
957
+ "type": "string"
958
+ }
959
+ },
960
+ "required": [
961
+ "target"
962
+ ],
963
+ "additionalProperties": false
964
+ },
965
+ ["google_ads" /* GoogleAds */]: {
966
+ "type": "object",
967
+ "properties": {
968
+ "target": {
969
+ "const": "google_ads"
970
+ },
971
+ "query": {
972
+ "type": "string",
973
+ "maxLength": 2048
974
+ },
975
+ "headless": {
976
+ "type": "string",
977
+ "enum": [
978
+ "html",
979
+ "png"
980
+ ]
981
+ },
982
+ "locale": {
983
+ "type": "string"
984
+ },
985
+ "geo": {
986
+ "type": "string"
987
+ },
988
+ "device_type": {
989
+ "type": "string"
990
+ },
991
+ "page_from": {
992
+ "type": "number",
993
+ "minimum": 0,
994
+ "maximum": 100
995
+ },
996
+ "google_results_language": {
997
+ "type": "string"
998
+ },
999
+ "google_tbm": {
1000
+ "type": "string"
1001
+ },
1002
+ "google_tbs": {
1003
+ "type": "string"
1004
+ },
1005
+ "parse": {
1006
+ "type": "boolean"
1007
+ },
1008
+ "google_nfpr": {
1009
+ "type": "boolean"
1010
+ },
1011
+ "session_id": {
1012
+ "type": "string"
1013
+ },
1014
+ "markdown": {
1015
+ "type": "boolean"
1016
+ },
1017
+ "xhr": {
1018
+ "type": "boolean"
1019
+ },
1020
+ "page_count": {
1021
+ "type": "number",
1022
+ "minimum": 1,
1023
+ "maximum": 10
1024
+ },
1025
+ "callback_url": {
1026
+ "type": "string"
1027
+ }
1028
+ },
1029
+ "required": [
1030
+ "target"
1031
+ ],
1032
+ "additionalProperties": false
1033
+ },
1034
+ ["google_lens" /* GoogleLens */]: {
1035
+ "type": "object",
1036
+ "properties": {
1037
+ "target": {
1038
+ "const": "google_lens"
1039
+ },
1040
+ "query": {
1041
+ "type": "string",
1042
+ "maxLength": 2048
1043
+ },
1044
+ "headless": {
1045
+ "type": "string",
1046
+ "enum": [
1047
+ "html",
1048
+ "png"
1049
+ ]
1050
+ },
1051
+ "parse": {
1052
+ "type": "boolean"
1053
+ },
1054
+ "device_type": {
1055
+ "type": "string"
1056
+ },
1057
+ "markdown": {
1058
+ "type": "boolean"
1059
+ },
1060
+ "callback_url": {
1061
+ "type": "string"
1062
+ }
1063
+ },
1064
+ "required": [
1065
+ "target"
1066
+ ],
1067
+ "additionalProperties": false
1068
+ },
1069
+ ["bing_search" /* BingSearch */]: {
1070
+ "type": "object",
1071
+ "properties": {
1072
+ "target": {
1073
+ "const": "bing_search"
1074
+ },
1075
+ "query": {
1076
+ "type": "string",
1077
+ "maxLength": 2048
1078
+ },
1079
+ "headless": {
1080
+ "type": "string",
1081
+ "enum": [
1082
+ "html",
1083
+ "png"
1084
+ ]
1085
+ },
1086
+ "locale": {
1087
+ "type": "string"
1088
+ },
1089
+ "geo": {
1090
+ "type": "string"
1091
+ },
1092
+ "domain": {
1093
+ "type": "string"
1094
+ },
1095
+ "device_type": {
1096
+ "type": "string"
1097
+ },
1098
+ "page_from": {
1099
+ "type": "number",
1100
+ "minimum": 0,
1101
+ "maximum": 100
1102
+ },
1103
+ "parse": {
1104
+ "type": "boolean"
1105
+ },
1106
+ "page_count": {
1107
+ "type": "number",
1108
+ "minimum": 1,
1109
+ "maximum": 10
1110
+ },
1111
+ "session_id": {
1112
+ "type": "string"
1113
+ },
1114
+ "markdown": {
1115
+ "type": "boolean"
1116
+ },
1117
+ "xhr": {
1118
+ "type": "boolean"
1119
+ },
1120
+ "callback_url": {
1121
+ "type": "string"
1122
+ }
1123
+ },
1124
+ "required": [
1125
+ "target"
1126
+ ],
1127
+ "additionalProperties": false
1128
+ },
1129
+ ["bing" /* Bing */]: {
1130
+ "type": "object",
1131
+ "properties": {
1132
+ "target": {
1133
+ "const": "bing"
1134
+ },
1135
+ "url": {
1136
+ "type": "string",
1137
+ "maxLength": 2056
1138
+ },
1139
+ "headless": {
1140
+ "type": "string",
1141
+ "enum": [
1142
+ "html",
1143
+ "png"
1144
+ ]
1145
+ },
1146
+ "locale": {
1147
+ "type": "string"
1148
+ },
1149
+ "geo": {
1150
+ "type": "string"
1151
+ },
1152
+ "device_type": {
1153
+ "type": "string"
1154
+ },
1155
+ "page_from": {
1156
+ "type": "number",
1157
+ "minimum": 0,
1158
+ "maximum": 100
1159
+ },
1160
+ "parse": {
1161
+ "type": "boolean"
1162
+ },
1163
+ "session_id": {
1164
+ "type": "string"
1165
+ },
1166
+ "markdown": {
1167
+ "type": "boolean"
1168
+ },
1169
+ "xhr": {
1170
+ "type": "boolean"
1171
+ },
1172
+ "callback_url": {
1173
+ "type": "string"
1174
+ }
1175
+ },
1176
+ "required": [
1177
+ "target"
1178
+ ],
1179
+ "additionalProperties": false
1180
+ },
1181
+ ["youtube_transcript" /* YoutubeTranscript */]: {
1182
+ "type": "object",
1183
+ "properties": {
1184
+ "target": {
1185
+ "const": "youtube_transcript"
1186
+ },
1187
+ "query": {
1188
+ "type": "string",
1189
+ "maxLength": 2048
1190
+ },
1191
+ "language_code": {
1192
+ "type": "string"
1193
+ },
1194
+ "transcript_origin": {
1195
+ "type": "string"
1196
+ },
1197
+ "callback_url": {
1198
+ "type": "string"
1199
+ }
1200
+ },
1201
+ "required": [
1202
+ "target"
1203
+ ],
1204
+ "additionalProperties": false
1205
+ },
1206
+ ["amazon_product" /* AmazonProduct */]: {
1207
+ "type": "object",
1208
+ "properties": {
1209
+ "target": {
1210
+ "const": "amazon_product"
1211
+ },
1212
+ "query": {
1213
+ "type": "string",
1214
+ "maxLength": 2048
1215
+ },
1216
+ "headless": {
1217
+ "type": "string",
1218
+ "enum": [
1219
+ "html",
1220
+ "png"
1221
+ ]
1222
+ },
1223
+ "domain": {
1224
+ "type": "string"
1225
+ },
1226
+ "device_type": {
1227
+ "type": "string"
1228
+ },
1229
+ "parse": {
1230
+ "type": "boolean"
1231
+ },
1232
+ "autoselect_variant": {
1233
+ "type": "boolean"
1234
+ },
1235
+ "geo": {
1236
+ "type": "string"
1237
+ },
1238
+ "session_id": {
1239
+ "type": "string"
1240
+ },
1241
+ "currency": {
1242
+ "type": "string"
1243
+ },
1244
+ "markdown": {
1245
+ "type": "boolean"
1246
+ },
1247
+ "xhr": {
1248
+ "type": "boolean"
1249
+ },
1250
+ "callback_url": {
1251
+ "type": "string"
1252
+ }
1253
+ },
1254
+ "required": [
1255
+ "target"
1256
+ ],
1257
+ "additionalProperties": false
1258
+ },
1259
+ ["amazon_pricing" /* AmazonPricing */]: {
1260
+ "type": "object",
1261
+ "properties": {
1262
+ "target": {
1263
+ "const": "amazon_pricing"
1264
+ },
1265
+ "query": {
1266
+ "type": "string",
1267
+ "maxLength": 2048
1268
+ },
1269
+ "headless": {
1270
+ "type": "string",
1271
+ "enum": [
1272
+ "html",
1273
+ "png"
1274
+ ]
1275
+ },
1276
+ "domain": {
1277
+ "type": "string"
1278
+ },
1279
+ "device_type": {
1280
+ "type": "string"
1281
+ },
1282
+ "page_from": {
1283
+ "type": "number",
1284
+ "minimum": 0,
1285
+ "maximum": 100
1286
+ },
1287
+ "parse": {
1288
+ "type": "boolean"
1289
+ },
1290
+ "geo": {
1291
+ "type": "string"
1292
+ },
1293
+ "session_id": {
1294
+ "type": "string"
1295
+ },
1296
+ "currency": {
1297
+ "type": "string"
1298
+ },
1299
+ "markdown": {
1300
+ "type": "boolean"
1301
+ },
1302
+ "xhr": {
1303
+ "type": "boolean"
1304
+ },
1305
+ "callback_url": {
1306
+ "type": "string"
1307
+ }
1308
+ },
1309
+ "required": [
1310
+ "target"
1311
+ ],
1312
+ "additionalProperties": false
1313
+ },
1314
+ ["amazon_search" /* AmazonSearch */]: {
1315
+ "type": "object",
1316
+ "properties": {
1317
+ "target": {
1318
+ "const": "amazon_search"
1319
+ },
1320
+ "query": {
1321
+ "type": "string",
1322
+ "maxLength": 2048
1323
+ },
1324
+ "headless": {
1325
+ "type": "string",
1326
+ "enum": [
1327
+ "html",
1328
+ "png"
1329
+ ]
1330
+ },
1331
+ "domain": {
1332
+ "type": "string"
1333
+ },
1334
+ "device_type": {
1335
+ "type": "string"
1336
+ },
1337
+ "page_from": {
1338
+ "type": "number",
1339
+ "minimum": 0,
1340
+ "maximum": 100
1341
+ },
1342
+ "category": {
1343
+ "type": "string"
1344
+ },
1345
+ "merchant": {
1346
+ "type": "string"
1347
+ },
1348
+ "parse": {
1349
+ "type": "boolean"
1350
+ },
1351
+ "geo": {
1352
+ "type": "string"
1353
+ },
1354
+ "session_id": {
1355
+ "type": "string"
1356
+ },
1357
+ "sort_by": {
1358
+ "type": "string"
1359
+ },
1360
+ "currency": {
1361
+ "type": "string"
1362
+ },
1363
+ "markdown": {
1364
+ "type": "boolean"
1365
+ },
1366
+ "xhr": {
1367
+ "type": "boolean"
1368
+ },
1369
+ "callback_url": {
1370
+ "type": "string"
1371
+ }
1372
+ },
1373
+ "required": [
1374
+ "target"
1375
+ ],
1376
+ "additionalProperties": false
1377
+ },
1378
+ ["amazon_sellers" /* AmazonSellers */]: {
1379
+ "type": "object",
1380
+ "properties": {
1381
+ "target": {
1382
+ "const": "amazon_sellers"
1383
+ },
1384
+ "query": {
1385
+ "type": "string",
1386
+ "maxLength": 2048
1387
+ },
1388
+ "headless": {
1389
+ "type": "string",
1390
+ "enum": [
1391
+ "html",
1392
+ "png"
1393
+ ]
1394
+ },
1395
+ "locale": {
1396
+ "type": "string"
1397
+ },
1398
+ "domain": {
1399
+ "type": "string"
1400
+ },
1401
+ "device_type": {
1402
+ "type": "string"
1403
+ },
1404
+ "geo": {
1405
+ "type": "string"
1406
+ },
1407
+ "parse": {
1408
+ "type": "boolean"
1409
+ },
1410
+ "markdown": {
1411
+ "type": "boolean"
1412
+ },
1413
+ "xhr": {
1414
+ "type": "boolean"
1415
+ },
1416
+ "callback_url": {
1417
+ "type": "string"
1418
+ }
1419
+ },
1420
+ "required": [
1421
+ "target"
1422
+ ],
1423
+ "additionalProperties": false
1424
+ },
1425
+ ["amazon_bestsellers" /* AmazonBestsellers */]: {
1426
+ "type": "object",
1427
+ "properties": {
1428
+ "target": {
1429
+ "const": "amazon_bestsellers"
1430
+ },
1431
+ "query": {
1432
+ "type": "string",
1433
+ "maxLength": 2048
1434
+ },
1435
+ "domain": {
1436
+ "type": "string"
1437
+ },
1438
+ "device_type": {
1439
+ "type": "string"
1440
+ },
1441
+ "geo": {
1442
+ "type": "string"
1443
+ },
1444
+ "page_from": {
1445
+ "type": "number",
1446
+ "minimum": 0,
1447
+ "maximum": 100
1448
+ },
1449
+ "category": {
1450
+ "type": "string"
1451
+ },
1452
+ "parse": {
1453
+ "type": "boolean"
1454
+ },
1455
+ "session_id": {
1456
+ "type": "string"
1457
+ },
1458
+ "currency": {
1459
+ "type": "string"
1460
+ },
1461
+ "markdown": {
1462
+ "type": "boolean"
1463
+ },
1464
+ "xhr": {
1465
+ "type": "boolean"
1466
+ },
1467
+ "callback_url": {
1468
+ "type": "string"
1469
+ }
1470
+ },
1471
+ "required": [
1472
+ "target"
1473
+ ],
1474
+ "additionalProperties": false
1475
+ },
1476
+ ["amazon" /* Amazon */]: {
1477
+ "type": "object",
1478
+ "properties": {
1479
+ "target": {
1480
+ "const": "amazon"
1481
+ },
1482
+ "url": {
1483
+ "type": "string",
1484
+ "maxLength": 2056
1485
+ },
1486
+ "headless": {
1487
+ "type": "string",
1488
+ "enum": [
1489
+ "html",
1490
+ "png"
1491
+ ]
1492
+ },
1493
+ "device_type": {
1494
+ "type": "string"
1495
+ },
1496
+ "parse": {
1497
+ "type": "boolean"
1498
+ },
1499
+ "geo": {
1500
+ "type": "string"
1501
+ },
1502
+ "session_id": {
1503
+ "type": "string"
1504
+ },
1505
+ "markdown": {
1506
+ "type": "boolean"
1507
+ },
1508
+ "xhr": {
1509
+ "type": "boolean"
1510
+ },
1511
+ "callback_url": {
1512
+ "type": "string"
1513
+ }
1514
+ },
1515
+ "required": [
1516
+ "target"
1517
+ ],
1518
+ "additionalProperties": false
1519
+ },
1520
+ ["ecommerce" /* Ecommerce */]: {
1521
+ "type": "object",
1522
+ "properties": {
1523
+ "target": {
1524
+ "const": "ecommerce"
1525
+ },
1526
+ "url": {
1527
+ "type": "string",
1528
+ "maxLength": 2056
1529
+ },
1530
+ "headless": {
1531
+ "type": "string",
1532
+ "enum": [
1533
+ "html",
1534
+ "png"
1535
+ ]
1536
+ },
1537
+ "locale": {
1538
+ "type": "string"
1539
+ },
1540
+ "geo": {
1541
+ "type": "string"
1542
+ },
1543
+ "device_type": {
1544
+ "type": "string"
1545
+ },
1546
+ "parse": {
1547
+ "type": "boolean"
1548
+ },
1549
+ "parser_type": {
1550
+ "type": "string"
1551
+ },
1552
+ "callback_url": {
1553
+ "type": "string"
1554
+ }
1555
+ },
1556
+ "required": [
1557
+ "target"
1558
+ ],
1559
+ "additionalProperties": false
1560
+ },
1561
+ ["walmart_product" /* WalmartProduct */]: {
1562
+ "type": "object",
1563
+ "properties": {
1564
+ "target": {
1565
+ "const": "walmart_product"
1566
+ },
1567
+ "product_id": {
1568
+ "type": "string"
1569
+ },
1570
+ "headless": {
1571
+ "type": "string",
1572
+ "enum": [
1573
+ "html",
1574
+ "png"
1575
+ ]
1576
+ },
1577
+ "parse": {
1578
+ "type": "boolean"
1579
+ },
1580
+ "xhr": {
1581
+ "type": "boolean"
1582
+ },
1583
+ "markdown": {
1584
+ "type": "boolean"
1585
+ },
1586
+ "fulfillment_type": {
1587
+ "type": "string"
1588
+ },
1589
+ "walmart_store_id": {
1590
+ "type": "string"
1591
+ },
1592
+ "delivery_zip": {
1593
+ "type": "string"
1594
+ },
1595
+ "callback_url": {
1596
+ "type": "string"
1597
+ }
1598
+ },
1599
+ "required": [
1600
+ "target"
1601
+ ],
1602
+ "additionalProperties": false
1603
+ },
1604
+ ["walmart_search" /* WalmartSearch */]: {
1605
+ "type": "object",
1606
+ "properties": {
1607
+ "target": {
1608
+ "const": "walmart_search"
1609
+ },
1610
+ "query": {
1611
+ "type": "string",
1612
+ "maxLength": 2048
1613
+ },
1614
+ "headless": {
1615
+ "type": "string",
1616
+ "enum": [
1617
+ "html",
1618
+ "png"
1619
+ ]
1620
+ },
1621
+ "parse": {
1622
+ "type": "boolean"
1623
+ },
1624
+ "markdown": {
1625
+ "type": "boolean"
1626
+ },
1627
+ "fulfillment_type": {
1628
+ "type": "string"
1629
+ },
1630
+ "walmart_store_id": {
1631
+ "type": "string"
1632
+ },
1633
+ "delivery_zip": {
1634
+ "type": "string"
1635
+ },
1636
+ "callback_url": {
1637
+ "type": "string"
1638
+ }
1639
+ },
1640
+ "required": [
1641
+ "target"
1642
+ ],
1643
+ "additionalProperties": false
1644
+ },
1645
+ ["walmart" /* Walmart */]: {
1646
+ "type": "object",
1647
+ "properties": {
1648
+ "target": {
1649
+ "const": "walmart"
1650
+ },
1651
+ "url": {
1652
+ "type": "string",
1653
+ "maxLength": 2056
1654
+ },
1655
+ "headless": {
1656
+ "type": "string",
1657
+ "enum": [
1658
+ "html",
1659
+ "png"
1660
+ ]
1661
+ },
1662
+ "locale": {
1663
+ "type": "string"
1664
+ },
1665
+ "geo": {
1666
+ "type": "string"
1667
+ },
1668
+ "device_type": {
1669
+ "type": "string"
1670
+ },
1671
+ "store_id": {
1672
+ "type": "string"
1673
+ },
1674
+ "markdown": {
1675
+ "type": "boolean"
1676
+ },
1677
+ "xhr": {
1678
+ "type": "boolean"
1679
+ },
1680
+ "callback_url": {
1681
+ "type": "string"
1682
+ }
1683
+ },
1684
+ "required": [
1685
+ "target"
1686
+ ],
1687
+ "additionalProperties": false
1688
+ },
1689
+ ["target_product" /* TargetProduct */]: {
1690
+ "type": "object",
1691
+ "properties": {
1692
+ "target": {
1693
+ "const": "target_product"
1694
+ },
1695
+ "product_id": {
1696
+ "type": "string"
1697
+ },
1698
+ "headless": {
1699
+ "type": "string",
1700
+ "enum": [
1701
+ "html",
1702
+ "png"
1703
+ ]
1704
+ },
1705
+ "parse": {
1706
+ "type": "boolean"
1707
+ },
1708
+ "device_type": {
1709
+ "type": "string"
1710
+ },
1711
+ "markdown": {
1712
+ "type": "boolean"
1713
+ },
1714
+ "xhr": {
1715
+ "type": "boolean"
1716
+ },
1717
+ "delivery_type": {
1718
+ "type": "string"
1719
+ },
1720
+ "target_store_id": {
1721
+ "type": "string"
1722
+ },
1723
+ "delivery_zip": {
1724
+ "type": "string"
1725
+ },
1726
+ "callback_url": {
1727
+ "type": "string"
1728
+ }
1729
+ },
1730
+ "required": [
1731
+ "target"
1732
+ ],
1733
+ "additionalProperties": false
1734
+ },
1735
+ ["target_search" /* TargetSearch */]: {
1736
+ "type": "object",
1737
+ "properties": {
1738
+ "target": {
1739
+ "const": "target_search"
1740
+ },
1741
+ "query": {
1742
+ "type": "string",
1743
+ "maxLength": 2048
1744
+ },
1745
+ "headless": {
1746
+ "type": "string",
1747
+ "enum": [
1748
+ "html",
1749
+ "png"
1750
+ ]
1751
+ },
1752
+ "parse": {
1753
+ "type": "boolean"
1754
+ },
1755
+ "device_type": {
1756
+ "type": "string"
1757
+ },
1758
+ "delivery_type": {
1759
+ "type": "string"
1760
+ },
1761
+ "target_store_id": {
1762
+ "type": "string"
1763
+ },
1764
+ "delivery_zip": {
1765
+ "type": "string"
1766
+ },
1767
+ "xhr": {
1768
+ "type": "boolean"
1769
+ },
1770
+ "markdown": {
1771
+ "type": "boolean"
1772
+ },
1773
+ "callback_url": {
1774
+ "type": "string"
1775
+ }
1776
+ },
1777
+ "required": [
1778
+ "target"
1779
+ ],
1780
+ "additionalProperties": false
1781
+ },
1782
+ ["target" /* Target */]: {
1783
+ "type": "object",
1784
+ "properties": {
1785
+ "target": {
1786
+ "const": "target"
1787
+ },
1788
+ "url": {
1789
+ "type": "string",
1790
+ "maxLength": 2056
1791
+ },
1792
+ "headless": {
1793
+ "type": "string",
1794
+ "enum": [
1795
+ "html",
1796
+ "png"
1797
+ ]
1798
+ },
1799
+ "device_type": {
1800
+ "type": "string"
1801
+ },
1802
+ "xhr": {
1803
+ "type": "boolean"
1804
+ },
1805
+ "delivery_zip": {
1806
+ "type": "string"
1807
+ },
1808
+ "target_store_id": {
1809
+ "type": "string"
1810
+ },
1811
+ "callback_url": {
1812
+ "type": "string"
1813
+ }
1814
+ },
1815
+ "required": [
1816
+ "target"
1817
+ ],
1818
+ "additionalProperties": false
1819
+ },
1820
+ ["lowes_search" /* LowesSearch */]: {
1821
+ "type": "object",
1822
+ "properties": {
1823
+ "target": {
1824
+ "const": "lowes_search"
1825
+ },
1826
+ "query": {
1827
+ "type": "string",
1828
+ "maxLength": 2048
1829
+ },
1830
+ "lowes_store_id": {
1831
+ "type": "string"
1832
+ },
1833
+ "headless": {
1834
+ "type": "string",
1835
+ "enum": [
1836
+ "html",
1837
+ "png"
1838
+ ]
1839
+ },
1840
+ "delivery_zip": {
1841
+ "type": "string"
1842
+ },
1843
+ "user_agent_type": {
1844
+ "type": "string"
1845
+ },
1846
+ "free_delivery": {
1847
+ "type": "boolean"
1848
+ },
1849
+ "pickup_today": {
1850
+ "type": "boolean"
1851
+ },
1852
+ "delivery_today_tomorrow": {
1853
+ "type": "boolean"
1854
+ },
1855
+ "callback_url": {
1856
+ "type": "string"
1857
+ }
1858
+ },
1859
+ "required": [
1860
+ "target"
1861
+ ],
1862
+ "additionalProperties": false
1863
+ },
1864
+ ["universal" /* Universal */]: {
1865
+ "type": "object",
1866
+ "properties": {
1867
+ "target": {
1868
+ "const": "universal"
1869
+ },
1870
+ "url": {
1871
+ "type": "string",
1872
+ "maxLength": 2056
1873
+ },
1874
+ "payload": {
1875
+ "type": "string"
1876
+ },
1877
+ "proxy_pool": {
1878
+ "type": "string",
1879
+ "enum": [
1880
+ "standard",
1881
+ "premium"
1882
+ ]
1883
+ },
1884
+ "http_method": {
1885
+ "type": "string"
1886
+ },
1887
+ "headless": {
1888
+ "type": "string",
1889
+ "enum": [
1890
+ "html",
1891
+ "png"
1892
+ ]
1893
+ },
1894
+ "geo": {
1895
+ "type": "string"
1896
+ },
1897
+ "locale": {
1898
+ "type": "string"
1899
+ },
1900
+ "device_type": {
1901
+ "type": "string"
1902
+ },
1903
+ "session_id": {
1904
+ "type": "string"
1905
+ },
1906
+ "successful_status_codes": {
1907
+ "type": "array",
1908
+ "items": {
1909
+ "type": "number"
1910
+ }
1911
+ },
1912
+ "headers": {
1913
+ "type": "object"
1914
+ },
1915
+ "cookies": {
1916
+ "type": "object"
1917
+ },
1918
+ "force_headers": {
1919
+ "type": "boolean"
1920
+ },
1921
+ "force_cookies": {
1922
+ "type": "boolean"
1923
+ },
1924
+ "xhr": {
1925
+ "type": "boolean"
1926
+ },
1927
+ "markdown": {
1928
+ "type": "boolean"
1929
+ },
1930
+ "callback_url": {
1931
+ "type": "string"
1932
+ }
1933
+ },
1934
+ "required": [
1935
+ "target"
1936
+ ],
1937
+ "additionalProperties": false
1938
+ },
1939
+ ["chatgpt" /* Chatgpt */]: {
1940
+ "type": "object",
1941
+ "properties": {
1942
+ "target": {
1943
+ "const": "chatgpt"
1944
+ },
1945
+ "prompt": {
1946
+ "type": "string",
1947
+ "maxLength": 8192
1948
+ },
1949
+ "search": {
1950
+ "type": "boolean"
1951
+ },
1952
+ "parse": {
1953
+ "type": "boolean"
1954
+ },
1955
+ "geo": {
1956
+ "type": "string"
1957
+ },
1958
+ "device_type": {
1959
+ "type": "string"
1960
+ },
1961
+ "markdown": {
1962
+ "type": "boolean"
1963
+ },
1964
+ "xhr": {
1965
+ "type": "boolean"
1966
+ },
1967
+ "callback_url": {
1968
+ "type": "string"
1969
+ }
1970
+ },
1971
+ "required": [
1972
+ "target"
1973
+ ],
1974
+ "additionalProperties": false
1975
+ },
1976
+ ["perplexity" /* Perplexity */]: {
1977
+ "type": "object",
1978
+ "properties": {
1979
+ "target": {
1980
+ "const": "perplexity"
1981
+ },
1982
+ "prompt": {
1983
+ "type": "string",
1984
+ "maxLength": 8192
1985
+ },
1986
+ "parse": {
1987
+ "type": "boolean"
1988
+ },
1989
+ "geo": {
1990
+ "type": "string"
1991
+ },
1992
+ "device_type": {
1993
+ "type": "string"
1994
+ },
1995
+ "markdown": {
1996
+ "type": "boolean"
1997
+ },
1998
+ "xhr": {
1999
+ "type": "boolean"
2000
+ },
2001
+ "callback_url": {
2002
+ "type": "string"
2003
+ }
2004
+ },
2005
+ "required": [
2006
+ "target"
2007
+ ],
2008
+ "additionalProperties": false
2009
+ },
2010
+ ["bbb" /* Bbb */]: {
2011
+ "type": "object",
2012
+ "properties": {
2013
+ "target": {
2014
+ "const": "bbb"
2015
+ },
2016
+ "url": {
2017
+ "type": "string",
2018
+ "maxLength": 2056
2019
+ },
2020
+ "headless": {
2021
+ "type": "string",
2022
+ "enum": [
2023
+ "html",
2024
+ "png"
2025
+ ]
2026
+ },
2027
+ "geo": {
2028
+ "type": "string"
2029
+ },
2030
+ "device_type": {
2031
+ "type": "string"
2032
+ },
2033
+ "markdown": {
2034
+ "type": "boolean"
2035
+ },
2036
+ "xhr": {
2037
+ "type": "boolean"
2038
+ },
2039
+ "callback_url": {
2040
+ "type": "string"
2041
+ }
2042
+ },
2043
+ "required": [
2044
+ "target"
2045
+ ],
2046
+ "additionalProperties": false
2047
+ },
2048
+ ["autotrader" /* Autotrader */]: {
2049
+ "type": "object",
2050
+ "properties": {
2051
+ "target": {
2052
+ "const": "autotrader"
2053
+ },
2054
+ "url": {
2055
+ "type": "string",
2056
+ "maxLength": 2056
2057
+ },
2058
+ "headless": {
2059
+ "type": "string",
2060
+ "enum": [
2061
+ "html",
2062
+ "png"
2063
+ ]
2064
+ },
2065
+ "geo": {
2066
+ "type": "string"
2067
+ },
2068
+ "device_type": {
2069
+ "type": "string"
2070
+ },
2071
+ "markdown": {
2072
+ "type": "boolean"
2073
+ },
2074
+ "xhr": {
2075
+ "type": "boolean"
2076
+ },
2077
+ "callback_url": {
2078
+ "type": "string"
2079
+ }
2080
+ },
2081
+ "required": [
2082
+ "target"
2083
+ ],
2084
+ "additionalProperties": false
2085
+ },
2086
+ ["mobile" /* Mobile */]: {
2087
+ "type": "object",
2088
+ "properties": {
2089
+ "target": {
2090
+ "const": "mobile"
2091
+ },
2092
+ "url": {
2093
+ "type": "string",
2094
+ "maxLength": 2056
2095
+ },
2096
+ "headless": {
2097
+ "type": "string",
2098
+ "enum": [
2099
+ "html",
2100
+ "png"
2101
+ ]
2102
+ },
2103
+ "geo": {
2104
+ "type": "string"
2105
+ },
2106
+ "device_type": {
2107
+ "type": "string"
2108
+ },
2109
+ "markdown": {
2110
+ "type": "boolean"
2111
+ },
2112
+ "xhr": {
2113
+ "type": "boolean"
2114
+ },
2115
+ "callback_url": {
2116
+ "type": "string"
2117
+ }
2118
+ },
2119
+ "required": [
2120
+ "target"
2121
+ ],
2122
+ "additionalProperties": false
2123
+ },
2124
+ ["airbnb" /* Airbnb */]: {
2125
+ "type": "object",
2126
+ "properties": {
2127
+ "target": {
2128
+ "const": "airbnb"
2129
+ },
2130
+ "url": {
2131
+ "type": "string",
2132
+ "maxLength": 2056
2133
+ },
2134
+ "headless": {
2135
+ "type": "string",
2136
+ "enum": [
2137
+ "html",
2138
+ "png"
2139
+ ]
2140
+ },
2141
+ "geo": {
2142
+ "type": "string"
2143
+ },
2144
+ "device_type": {
2145
+ "type": "string"
2146
+ },
2147
+ "markdown": {
2148
+ "type": "boolean"
2149
+ },
2150
+ "xhr": {
2151
+ "type": "boolean"
2152
+ },
2153
+ "callback_url": {
2154
+ "type": "string"
2155
+ }
2156
+ },
2157
+ "required": [
2158
+ "target"
2159
+ ],
2160
+ "additionalProperties": false
2161
+ },
2162
+ ["apple_app_store" /* AppleAppStore */]: {
2163
+ "type": "object",
2164
+ "properties": {
2165
+ "target": {
2166
+ "const": "apple_app_store"
2167
+ },
2168
+ "url": {
2169
+ "type": "string",
2170
+ "maxLength": 2056
2171
+ },
2172
+ "headless": {
2173
+ "type": "string",
2174
+ "enum": [
2175
+ "html",
2176
+ "png"
2177
+ ]
2178
+ },
2179
+ "geo": {
2180
+ "type": "string"
2181
+ },
2182
+ "device_type": {
2183
+ "type": "string"
2184
+ },
2185
+ "markdown": {
2186
+ "type": "boolean"
2187
+ },
2188
+ "xhr": {
2189
+ "type": "boolean"
2190
+ },
2191
+ "callback_url": {
2192
+ "type": "string"
2193
+ }
2194
+ },
2195
+ "required": [
2196
+ "target"
2197
+ ],
2198
+ "additionalProperties": false
2199
+ },
2200
+ ["instagram_graphql_profile" /* InstagramGraphqlProfile */]: {
2201
+ "type": "object",
2202
+ "properties": {
2203
+ "target": {
2204
+ "const": "instagram_graphql_profile"
2205
+ },
2206
+ "query": {
2207
+ "type": "string",
2208
+ "maxLength": 2048
2209
+ },
2210
+ "callback_url": {
2211
+ "type": "string"
2212
+ }
2213
+ },
2214
+ "required": [
2215
+ "target"
2216
+ ],
2217
+ "additionalProperties": false
2218
+ },
2219
+ ["tiktok_post" /* TiktokPost */]: {
2220
+ "type": "object",
2221
+ "properties": {
2222
+ "target": {
2223
+ "const": "tiktok_post"
2224
+ },
2225
+ "url": {
2226
+ "type": "string",
2227
+ "maxLength": 2056
2228
+ },
2229
+ "xhr": {
2230
+ "type": "boolean"
2231
+ },
2232
+ "callback_url": {
2233
+ "type": "string"
2234
+ }
2235
+ },
2236
+ "required": [
2237
+ "target"
2238
+ ],
2239
+ "additionalProperties": false
2240
+ },
2241
+ ["tiktok_shop_search" /* TiktokShopSearch */]: {
2242
+ "type": "object",
2243
+ "properties": {
2244
+ "target": {
2245
+ "const": "tiktok_shop_search"
2246
+ },
2247
+ "query": {
2248
+ "type": "string",
2249
+ "maxLength": 2048
2250
+ },
2251
+ "headless": {
2252
+ "type": "string",
2253
+ "enum": [
2254
+ "html",
2255
+ "png"
2256
+ ]
2257
+ },
2258
+ "device_type": {
2259
+ "type": "string"
2260
+ },
2261
+ "markdown": {
2262
+ "type": "boolean"
2263
+ },
2264
+ "country": {
2265
+ "type": "string"
2266
+ },
2267
+ "callback_url": {
2268
+ "type": "string"
2269
+ }
2270
+ },
2271
+ "required": [
2272
+ "target"
2273
+ ],
2274
+ "additionalProperties": false
2275
+ },
2276
+ ["tiktok_shop_product" /* TiktokShopProduct */]: {
2277
+ "type": "object",
2278
+ "properties": {
2279
+ "target": {
2280
+ "const": "tiktok_shop_product"
2281
+ },
2282
+ "product_id": {
2283
+ "type": "string"
2284
+ },
2285
+ "headless": {
2286
+ "type": "string",
2287
+ "enum": [
2288
+ "html",
2289
+ "png"
2290
+ ]
2291
+ },
2292
+ "device_type": {
2293
+ "type": "string"
2294
+ },
2295
+ "xhr": {
2296
+ "type": "boolean"
2297
+ },
2298
+ "markdown": {
2299
+ "type": "boolean"
2300
+ },
2301
+ "country": {
2302
+ "type": "string"
2303
+ },
2304
+ "callback_url": {
2305
+ "type": "string"
2306
+ }
2307
+ },
2308
+ "required": [
2309
+ "target"
2310
+ ],
2311
+ "additionalProperties": false
2312
+ },
2313
+ ["tiktok" /* Tiktok */]: {
2314
+ "type": "object",
2315
+ "properties": {
2316
+ "target": {
2317
+ "const": "tiktok"
2318
+ },
2319
+ "url": {
2320
+ "type": "string",
2321
+ "maxLength": 2056
2322
+ },
2323
+ "headless": {
2324
+ "type": "string",
2325
+ "enum": [
2326
+ "html",
2327
+ "png"
2328
+ ]
2329
+ },
2330
+ "user_agent_type": {
2331
+ "type": "string"
2332
+ },
2333
+ "callback_url": {
2334
+ "type": "string"
2335
+ }
2336
+ },
2337
+ "required": [
2338
+ "target"
2339
+ ],
2340
+ "additionalProperties": false
2341
+ },
2342
+ ["reddit_post" /* RedditPost */]: {
2343
+ "type": "object",
2344
+ "properties": {
2345
+ "target": {
2346
+ "const": "reddit_post"
2347
+ },
2348
+ "url": {
2349
+ "type": "string",
2350
+ "maxLength": 2056
2351
+ },
2352
+ "locale": {
2353
+ "type": "string"
2354
+ },
2355
+ "geo": {
2356
+ "type": "string"
2357
+ },
2358
+ "callback_url": {
2359
+ "type": "string"
2360
+ }
2361
+ },
2362
+ "required": [
2363
+ "target"
2364
+ ],
2365
+ "additionalProperties": false
2366
+ },
2367
+ ["reddit_subreddit" /* RedditSubreddit */]: {
2368
+ "type": "object",
2369
+ "properties": {
2370
+ "target": {
2371
+ "const": "reddit_subreddit"
2372
+ },
2373
+ "url": {
2374
+ "type": "string",
2375
+ "maxLength": 2056
2376
+ },
2377
+ "locale": {
2378
+ "type": "string"
2379
+ },
2380
+ "geo": {
2381
+ "type": "string"
2382
+ },
2383
+ "callback_url": {
2384
+ "type": "string"
2385
+ }
2386
+ },
2387
+ "required": [
2388
+ "target"
2389
+ ],
2390
+ "additionalProperties": false
2391
+ },
2392
+ ["reddit_user" /* RedditUser */]: {
2393
+ "type": "object",
2394
+ "properties": {
2395
+ "target": {
2396
+ "const": "reddit_user"
2397
+ },
2398
+ "url": {
2399
+ "type": "string",
2400
+ "maxLength": 2056
2401
+ },
2402
+ "locale": {
2403
+ "type": "string"
2404
+ },
2405
+ "geo": {
2406
+ "type": "string"
2407
+ },
2408
+ "sort": {
2409
+ "type": "string"
2410
+ },
2411
+ "callback_url": {
2412
+ "type": "string"
2413
+ }
2414
+ },
2415
+ "required": [
2416
+ "target"
2417
+ ],
2418
+ "additionalProperties": false
2419
+ },
2420
+ ["youtube_video" /* YoutubeVideo */]: {
2421
+ "type": "object",
2422
+ "properties": {
2423
+ "target": {
2424
+ "const": "youtube_video"
2425
+ },
2426
+ "query": {
2427
+ "type": "string",
2428
+ "maxLength": 2048
2429
+ },
2430
+ "geo": {
2431
+ "type": "string"
2432
+ },
2433
+ "callback_url": {
2434
+ "type": "string"
2435
+ }
2436
+ },
2437
+ "required": [
2438
+ "target"
2439
+ ],
2440
+ "additionalProperties": false
2441
+ },
2442
+ ["youtube_metadata" /* YoutubeMetadata */]: {
2443
+ "type": "object",
2444
+ "properties": {
2445
+ "target": {
2446
+ "const": "youtube_metadata"
2447
+ },
2448
+ "query": {
2449
+ "type": "string",
2450
+ "maxLength": 2048
2451
+ },
2452
+ "callback_url": {
2453
+ "type": "string"
2454
+ }
2455
+ },
2456
+ "required": [
2457
+ "target"
2458
+ ],
2459
+ "additionalProperties": false
2460
+ },
2461
+ ["youtube_search" /* YoutubeSearch */]: {
2462
+ "type": "object",
2463
+ "properties": {
2464
+ "360": {
2465
+ "type": "boolean"
2466
+ },
2467
+ "target": {
2468
+ "const": "youtube_search"
2469
+ },
2470
+ "query": {
2471
+ "type": "string",
2472
+ "maxLength": 2048
2473
+ },
2474
+ "upload_date": {
2475
+ "type": "string"
2476
+ },
2477
+ "type": {
2478
+ "type": "string"
2479
+ },
2480
+ "duration": {
2481
+ "type": "string"
2482
+ },
2483
+ "video_sort_by": {
2484
+ "type": "string"
2485
+ },
2486
+ "3d": {
2487
+ "type": "boolean"
2488
+ },
2489
+ "4k": {
2490
+ "type": "boolean"
2491
+ },
2492
+ "creative_commons": {
2493
+ "type": "boolean"
2494
+ },
2495
+ "hd": {
2496
+ "type": "boolean"
2497
+ },
2498
+ "hdr": {
2499
+ "type": "boolean"
2500
+ },
2501
+ "vr180": {
2502
+ "type": "boolean"
2503
+ },
2504
+ "live": {
2505
+ "type": "boolean"
2506
+ },
2507
+ "location": {
2508
+ "type": "boolean"
2509
+ },
2510
+ "purchased": {
2511
+ "type": "boolean"
2512
+ },
2513
+ "subtitles": {
2514
+ "type": "boolean"
2515
+ },
2516
+ "callback_url": {
2517
+ "type": "string"
2518
+ }
2519
+ },
2520
+ "required": [
2521
+ "target"
2522
+ ],
2523
+ "additionalProperties": false
2524
+ },
2525
+ ["youtube_search_max" /* YoutubeSearchMax */]: {
2526
+ "type": "object",
2527
+ "properties": {
2528
+ "360": {
2529
+ "type": "boolean"
2530
+ },
2531
+ "target": {
2532
+ "const": "youtube_search_max"
2533
+ },
2534
+ "query": {
2535
+ "type": "string",
2536
+ "maxLength": 2048
2537
+ },
2538
+ "upload_date": {
2539
+ "type": "string"
2540
+ },
2541
+ "type": {
2542
+ "type": "string"
2543
+ },
2544
+ "duration": {
2545
+ "type": "string"
2546
+ },
2547
+ "video_sort_by": {
2548
+ "type": "string"
2549
+ },
2550
+ "3d": {
2551
+ "type": "boolean"
2552
+ },
2553
+ "4k": {
2554
+ "type": "boolean"
2555
+ },
2556
+ "creative_commons": {
2557
+ "type": "boolean"
2558
+ },
2559
+ "hd": {
2560
+ "type": "boolean"
2561
+ },
2562
+ "hdr": {
2563
+ "type": "boolean"
2564
+ },
2565
+ "vr180": {
2566
+ "type": "boolean"
2567
+ },
2568
+ "live": {
2569
+ "type": "boolean"
2570
+ },
2571
+ "location": {
2572
+ "type": "boolean"
2573
+ },
2574
+ "purchased": {
2575
+ "type": "boolean"
2576
+ },
2577
+ "subtitles": {
2578
+ "type": "boolean"
2579
+ },
2580
+ "markdown": {
2581
+ "type": "boolean"
2582
+ },
2583
+ "callback_url": {
2584
+ "type": "string"
2585
+ }
2586
+ },
2587
+ "required": [
2588
+ "target"
2589
+ ],
2590
+ "additionalProperties": false
2591
+ },
2592
+ ["youtube_subtitles" /* YoutubeSubtitles */]: {
2593
+ "type": "object",
2594
+ "properties": {
2595
+ "target": {
2596
+ "const": "youtube_subtitles"
2597
+ },
2598
+ "query": {
2599
+ "type": "string",
2600
+ "maxLength": 2048
2601
+ },
2602
+ "language_code": {
2603
+ "type": "string"
2604
+ },
2605
+ "subtitle_origin": {
2606
+ "type": "string"
2607
+ },
2608
+ "callback_url": {
2609
+ "type": "string"
2610
+ }
2611
+ },
2612
+ "required": [
2613
+ "target"
2614
+ ],
2615
+ "additionalProperties": false
2616
+ },
2617
+ ["youtube_channel" /* YoutubeChannel */]: {
2618
+ "type": "object",
2619
+ "properties": {
2620
+ "target": {
2621
+ "const": "youtube_channel"
2622
+ },
2623
+ "query": {
2624
+ "type": "string",
2625
+ "maxLength": 2048
2626
+ },
2627
+ "parse": {
2628
+ "type": "boolean"
2629
+ },
2630
+ "limit": {
2631
+ "type": "number",
2632
+ "minimum": 0,
2633
+ "maximum": 100
2634
+ },
2635
+ "markdown": {
2636
+ "type": "boolean"
2637
+ },
2638
+ "callback_url": {
2639
+ "type": "string"
2640
+ }
2641
+ },
2642
+ "required": [
2643
+ "target"
2644
+ ],
2645
+ "additionalProperties": false
2646
+ }
2647
+ };
2648
+ var requestSchemas = {
2649
+ ["universal_ecommerce" /* UniversalEcommerce */]: z.fromJSONSchema(requestJsonSchemas["universal_ecommerce" /* UniversalEcommerce */]),
2650
+ ["google_search" /* GoogleSearch */]: z.fromJSONSchema(requestJsonSchemas["google_search" /* GoogleSearch */]),
2651
+ ["google_travel_hotels" /* GoogleTravelHotels */]: z.fromJSONSchema(requestJsonSchemas["google_travel_hotels" /* GoogleTravelHotels */]),
2652
+ ["google_trends_explore" /* GoogleTrendsExplore */]: z.fromJSONSchema(requestJsonSchemas["google_trends_explore" /* GoogleTrendsExplore */]),
2653
+ ["google_shopping_search" /* GoogleShoppingSearch */]: z.fromJSONSchema(requestJsonSchemas["google_shopping_search" /* GoogleShoppingSearch */]),
2654
+ ["google_shopping_product" /* GoogleShoppingProduct */]: z.fromJSONSchema(requestJsonSchemas["google_shopping_product" /* GoogleShoppingProduct */]),
2655
+ ["google" /* Google */]: z.fromJSONSchema(requestJsonSchemas["google" /* Google */]),
2656
+ ["google_suggest" /* GoogleSuggest */]: z.fromJSONSchema(requestJsonSchemas["google_suggest" /* GoogleSuggest */]),
2657
+ ["google_maps" /* GoogleMaps */]: z.fromJSONSchema(requestJsonSchemas["google_maps" /* GoogleMaps */]),
2658
+ ["google_ai_mode" /* GoogleAiMode */]: z.fromJSONSchema(requestJsonSchemas["google_ai_mode" /* GoogleAiMode */]),
2659
+ ["google_ads" /* GoogleAds */]: z.fromJSONSchema(requestJsonSchemas["google_ads" /* GoogleAds */]),
2660
+ ["google_lens" /* GoogleLens */]: z.fromJSONSchema(requestJsonSchemas["google_lens" /* GoogleLens */]),
2661
+ ["bing_search" /* BingSearch */]: z.fromJSONSchema(requestJsonSchemas["bing_search" /* BingSearch */]),
2662
+ ["bing" /* Bing */]: z.fromJSONSchema(requestJsonSchemas["bing" /* Bing */]),
2663
+ ["youtube_transcript" /* YoutubeTranscript */]: z.fromJSONSchema(requestJsonSchemas["youtube_transcript" /* YoutubeTranscript */]),
2664
+ ["amazon_product" /* AmazonProduct */]: z.fromJSONSchema(requestJsonSchemas["amazon_product" /* AmazonProduct */]),
2665
+ ["amazon_pricing" /* AmazonPricing */]: z.fromJSONSchema(requestJsonSchemas["amazon_pricing" /* AmazonPricing */]),
2666
+ ["amazon_search" /* AmazonSearch */]: z.fromJSONSchema(requestJsonSchemas["amazon_search" /* AmazonSearch */]),
2667
+ ["amazon_sellers" /* AmazonSellers */]: z.fromJSONSchema(requestJsonSchemas["amazon_sellers" /* AmazonSellers */]),
2668
+ ["amazon_bestsellers" /* AmazonBestsellers */]: z.fromJSONSchema(requestJsonSchemas["amazon_bestsellers" /* AmazonBestsellers */]),
2669
+ ["amazon" /* Amazon */]: z.fromJSONSchema(requestJsonSchemas["amazon" /* Amazon */]),
2670
+ ["ecommerce" /* Ecommerce */]: z.fromJSONSchema(requestJsonSchemas["ecommerce" /* Ecommerce */]),
2671
+ ["walmart_product" /* WalmartProduct */]: z.fromJSONSchema(requestJsonSchemas["walmart_product" /* WalmartProduct */]),
2672
+ ["walmart_search" /* WalmartSearch */]: z.fromJSONSchema(requestJsonSchemas["walmart_search" /* WalmartSearch */]),
2673
+ ["walmart" /* Walmart */]: z.fromJSONSchema(requestJsonSchemas["walmart" /* Walmart */]),
2674
+ ["target_product" /* TargetProduct */]: z.fromJSONSchema(requestJsonSchemas["target_product" /* TargetProduct */]),
2675
+ ["target_search" /* TargetSearch */]: z.fromJSONSchema(requestJsonSchemas["target_search" /* TargetSearch */]),
2676
+ ["target" /* Target */]: z.fromJSONSchema(requestJsonSchemas["target" /* Target */]),
2677
+ ["lowes_search" /* LowesSearch */]: z.fromJSONSchema(requestJsonSchemas["lowes_search" /* LowesSearch */]),
2678
+ ["universal" /* Universal */]: z.fromJSONSchema(requestJsonSchemas["universal" /* Universal */]),
2679
+ ["chatgpt" /* Chatgpt */]: z.fromJSONSchema(requestJsonSchemas["chatgpt" /* Chatgpt */]),
2680
+ ["perplexity" /* Perplexity */]: z.fromJSONSchema(requestJsonSchemas["perplexity" /* Perplexity */]),
2681
+ ["bbb" /* Bbb */]: z.fromJSONSchema(requestJsonSchemas["bbb" /* Bbb */]),
2682
+ ["autotrader" /* Autotrader */]: z.fromJSONSchema(requestJsonSchemas["autotrader" /* Autotrader */]),
2683
+ ["mobile" /* Mobile */]: z.fromJSONSchema(requestJsonSchemas["mobile" /* Mobile */]),
2684
+ ["airbnb" /* Airbnb */]: z.fromJSONSchema(requestJsonSchemas["airbnb" /* Airbnb */]),
2685
+ ["apple_app_store" /* AppleAppStore */]: z.fromJSONSchema(requestJsonSchemas["apple_app_store" /* AppleAppStore */]),
2686
+ ["instagram_graphql_profile" /* InstagramGraphqlProfile */]: z.fromJSONSchema(requestJsonSchemas["instagram_graphql_profile" /* InstagramGraphqlProfile */]),
2687
+ ["tiktok_post" /* TiktokPost */]: z.fromJSONSchema(requestJsonSchemas["tiktok_post" /* TiktokPost */]),
2688
+ ["tiktok_shop_search" /* TiktokShopSearch */]: z.fromJSONSchema(requestJsonSchemas["tiktok_shop_search" /* TiktokShopSearch */]),
2689
+ ["tiktok_shop_product" /* TiktokShopProduct */]: z.fromJSONSchema(requestJsonSchemas["tiktok_shop_product" /* TiktokShopProduct */]),
2690
+ ["tiktok" /* Tiktok */]: z.fromJSONSchema(requestJsonSchemas["tiktok" /* Tiktok */]),
2691
+ ["reddit_post" /* RedditPost */]: z.fromJSONSchema(requestJsonSchemas["reddit_post" /* RedditPost */]),
2692
+ ["reddit_subreddit" /* RedditSubreddit */]: z.fromJSONSchema(requestJsonSchemas["reddit_subreddit" /* RedditSubreddit */]),
2693
+ ["reddit_user" /* RedditUser */]: z.fromJSONSchema(requestJsonSchemas["reddit_user" /* RedditUser */]),
2694
+ ["youtube_video" /* YoutubeVideo */]: z.fromJSONSchema(requestJsonSchemas["youtube_video" /* YoutubeVideo */]),
2695
+ ["youtube_metadata" /* YoutubeMetadata */]: z.fromJSONSchema(requestJsonSchemas["youtube_metadata" /* YoutubeMetadata */]),
2696
+ ["youtube_search" /* YoutubeSearch */]: z.fromJSONSchema(requestJsonSchemas["youtube_search" /* YoutubeSearch */]),
2697
+ ["youtube_search_max" /* YoutubeSearchMax */]: z.fromJSONSchema(requestJsonSchemas["youtube_search_max" /* YoutubeSearchMax */]),
2698
+ ["youtube_subtitles" /* YoutubeSubtitles */]: z.fromJSONSchema(requestJsonSchemas["youtube_subtitles" /* YoutubeSubtitles */]),
2699
+ ["youtube_channel" /* YoutubeChannel */]: z.fromJSONSchema(requestJsonSchemas["youtube_channel" /* YoutubeChannel */])
2700
+ };
2701
+
2702
+ // src/schema/bundled-schema.ts
2703
+ var BundledSchema = class _BundledSchema {
2704
+ static shared = new _BundledSchema();
2705
+ getRequestSchema(target) {
2706
+ return requestSchemas[target];
2707
+ }
2708
+ listTargets() {
2709
+ return [...targets];
2710
+ }
2711
+ getTargetMeta(target) {
2712
+ return targetMeta[target];
2713
+ }
2714
+ getTargetParameterSchema(target) {
2715
+ return requestJsonSchemas[target];
2716
+ }
2717
+ getSharedParameters() {
2718
+ return {};
2719
+ }
2720
+ };
2721
+
2722
+ // src/api/web-scraping-api.ts
2723
+ var WebScrapingApi = class {
2724
+ http;
2725
+ schemas;
2726
+ constructor(http, schemas = BundledSchema.shared) {
2727
+ this.http = http;
2728
+ this.schemas = schemas;
2729
+ }
2730
+ validate(params) {
2731
+ const schema = this.schemas.getRequestSchema(params.target);
2732
+ if (!schema) {
2733
+ return;
2734
+ }
2735
+ const parsed = schema.safeParse(params);
2736
+ if (!parsed.success) {
2737
+ throw new ValidationError((0, import_zod.prettifyError)(parsed.error));
2738
+ }
2739
+ }
2740
+ async scrape(params) {
2741
+ this.validate(params);
2742
+ return this.http.post("/v2/scrape", params);
2743
+ }
2744
+ async scrapeAsync(params) {
2745
+ this.validate(params);
2746
+ return this.http.post("/v3/task", params);
2747
+ }
2748
+ async scrapeBatch(params) {
2749
+ return this.http.post("/v3/task/batch", params);
2750
+ }
2751
+ async getStatus(taskId) {
2752
+ return this.http.get(`/v3/task/${taskId}`);
2753
+ }
2754
+ async getResults(taskId) {
2755
+ const res = await this.http.get(
2756
+ `/v3/task/${taskId}/results`
2757
+ );
2758
+ return res ?? null;
2759
+ }
2760
+ };
2761
+
2762
+ // src/client.ts
2763
+ var WEB_API_BASE_URL = "https://scraper-api.decodo.com";
2764
+ var DEFAULT_TIMEOUT_MS = 18e4;
2765
+ var notConfigured = (namespace, hint) => {
2766
+ throw new Error(`${namespace} is not configured. ${hint}`);
2767
+ };
2768
+ var DecodoClient = class {
2769
+ webScrapingApi;
2770
+ constructor(config) {
2771
+ const timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
2772
+ const schema = config.schema ?? BundledSchema.shared;
2773
+ if (config.webScrapingApi) {
2774
+ this.webScrapingApi = new WebScrapingApi(
2775
+ new HttpClient({
2776
+ baseUrl: WEB_API_BASE_URL,
2777
+ auth: {
2778
+ type: "basic",
2779
+ token: config.webScrapingApi.token
2780
+ },
2781
+ timeoutMs,
2782
+ integrationHeader: config.webScrapingApi.integrationHeader
2783
+ }),
2784
+ schema
2785
+ );
2786
+ } else {
2787
+ this.webScrapingApi = new Proxy({}, {
2788
+ get() {
2789
+ notConfigured(
2790
+ "webScrapingApi",
2791
+ "Provide webScrapingApi.token in DecodoConfig."
2792
+ );
2793
+ }
2794
+ });
2795
+ }
2796
+ }
2797
+ };
2798
+
2799
+ // src/schema/remote-schema.ts
2800
+ var import_node_fs = require("node:fs");
2801
+ var import_node_path2 = require("node:path");
2802
+ var z2 = __toESM(require("zod"), 1);
2803
+
2804
+ // src/schema/build-target-meta.ts
2805
+ var getTargetParameterKeys = (parameterSchema) => {
2806
+ const properties = parameterSchema.properties ?? {};
2807
+ return Object.keys(properties).filter((key) => key !== "target");
2808
+ };
2809
+ var buildTargetMeta = (targets2) => {
2810
+ const meta = /* @__PURE__ */ new Map();
2811
+ for (const [targetKey, target] of Object.entries(targets2)) {
2812
+ meta.set(targetKey, {
2813
+ group: target.group,
2814
+ response_format: target.response_format,
2815
+ parameters: getTargetParameterKeys(target.parameter_schema)
2816
+ });
2817
+ }
2818
+ return meta;
2819
+ };
2820
+
2821
+ // src/schema/constants.ts
2822
+ var DEFAULT_IR_PREFIX = "decodo-ir-v";
2823
+ var DEFAULT_IR_BASE = "https://storage.googleapis.com/decodo-sdk-config";
2824
+ var DEFAULT_IR_LIST_URL = "https://storage.googleapis.com/storage/v1/b/decodo-sdk-config/o?prefix=decodo-ir-v";
2825
+ var DEFAULT_IR_CACHE_PATH = "~/.decodo/decodo.ir.json";
2826
+
2827
+ // src/schema/expand-path.ts
2828
+ var import_node_os = require("node:os");
2829
+ var import_node_path = require("node:path");
2830
+ var expandPath = (path) => {
2831
+ if (path.startsWith("~/")) {
2832
+ return (0, import_node_path.resolve)((0, import_node_os.homedir)(), path.slice(2));
2833
+ }
2834
+ if (path === "~") {
2835
+ return (0, import_node_os.homedir)();
2836
+ }
2837
+ return (0, import_node_path.resolve)(path);
2838
+ };
2839
+
2840
+ // src/schema/resolve-latest-ir.ts
2841
+ var IR_OBJECT_PATTERN = /^decodo-ir-v(.+)\.json$/;
2842
+ var parseSemver = (version) => {
2843
+ const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version);
2844
+ if (!match) {
2845
+ return null;
2846
+ }
2847
+ return [Number(match[1]), Number(match[2]), Number(match[3])];
2848
+ };
2849
+ var compareSemver = (left, right) => {
2850
+ const parsedLeft = parseSemver(left);
2851
+ const parsedRight = parseSemver(right);
2852
+ if (!parsedLeft || !parsedRight) {
2853
+ return left.localeCompare(right);
2854
+ }
2855
+ for (let i = 0; i < 3; i += 1) {
2856
+ if (parsedLeft[i] !== parsedRight[i]) {
2857
+ return parsedLeft[i] - parsedRight[i];
2858
+ }
2859
+ }
2860
+ return 0;
2861
+ };
2862
+ var parseIrVersions = (names) => {
2863
+ const versions = [];
2864
+ for (const name of names) {
2865
+ const match = IR_OBJECT_PATTERN.exec(name);
2866
+ if (match && parseSemver(match[1])) {
2867
+ versions.push(match[1]);
2868
+ }
2869
+ }
2870
+ return versions;
2871
+ };
2872
+ var resolveLatestIr = async () => {
2873
+ const res = await fetch(DEFAULT_IR_LIST_URL, {
2874
+ headers: { Accept: "application/json" }
2875
+ });
2876
+ if (!res.ok) {
2877
+ throw new Error(
2878
+ `Failed to list IR versions from ${DEFAULT_IR_LIST_URL}: HTTP ${res.status}`
2879
+ );
2880
+ }
2881
+ const body = await res.json();
2882
+ const names = body.items?.map((item) => item.name) ?? [];
2883
+ const versions = parseIrVersions(names);
2884
+ if (versions.length === 0) {
2885
+ throw new Error(
2886
+ `No versioned IR objects found in bucket with prefix "${DEFAULT_IR_PREFIX}".`
2887
+ );
2888
+ }
2889
+ const version = versions.reduce(
2890
+ (latest, current) => compareSemver(current, latest) > 0 ? current : latest
2891
+ );
2892
+ return {
2893
+ version,
2894
+ url: `${DEFAULT_IR_BASE}/${DEFAULT_IR_PREFIX}${version}.json`
2895
+ };
2896
+ };
2897
+
2898
+ // src/schema/remote-schema.ts
2899
+ var readCachedIr = (cachePath) => {
2900
+ try {
2901
+ const raw = (0, import_node_fs.readFileSync)(cachePath, "utf-8");
2902
+ return JSON.parse(raw);
2903
+ } catch {
2904
+ return null;
2905
+ }
2906
+ };
2907
+ var isCacheFresh = (cached, ttlMs) => {
2908
+ if (ttlMs === void 0) {
2909
+ return true;
2910
+ }
2911
+ return Date.now() - cached.fetchedAt < ttlMs;
2912
+ };
2913
+ var fetchIr = async (url) => {
2914
+ const res = await fetch(url, {
2915
+ headers: { Accept: "application/json" }
2916
+ });
2917
+ if (!res.ok) {
2918
+ throw new Error(`Failed to fetch IR from ${url}: HTTP ${res.status}`);
2919
+ }
2920
+ return await res.json();
2921
+ };
2922
+ var writeCachedIr = (cachePath, cached) => {
2923
+ (0, import_node_fs.mkdirSync)((0, import_node_path2.dirname)(cachePath), { recursive: true });
2924
+ (0, import_node_fs.writeFileSync)(cachePath, JSON.stringify(cached, null, 2));
2925
+ };
2926
+ var resolveIrUrl = async (config) => {
2927
+ if (config.url) {
2928
+ return { url: config.url };
2929
+ }
2930
+ const latest = await resolveLatestIr();
2931
+ return { url: latest.url, version: latest.version };
2932
+ };
2933
+ var loadIr = async (config) => {
2934
+ const cachePath = expandPath(config.cachePath ?? DEFAULT_IR_CACHE_PATH);
2935
+ const cached = readCachedIr(cachePath);
2936
+ const resolved = await resolveIrUrl(config);
2937
+ if (cached?.resolvedUrl === resolved.url) {
2938
+ if (isCacheFresh(cached, config.ttlMs)) {
2939
+ return cached.ir;
2940
+ }
2941
+ if (config.url || cached.ir.version === resolved.version) {
2942
+ return cached.ir;
2943
+ }
2944
+ }
2945
+ const ir = await fetchIr(resolved.url);
2946
+ writeCachedIr(cachePath, {
2947
+ fetchedAt: Date.now(),
2948
+ resolvedUrl: resolved.url,
2949
+ ir
2950
+ });
2951
+ return ir;
2952
+ };
2953
+ var buildRequestSchemas = (ir) => {
2954
+ const schemas = /* @__PURE__ */ new Map();
2955
+ for (const [targetKey, target] of Object.entries(
2956
+ ir.apis.webScrapingApi.targets
2957
+ )) {
2958
+ schemas.set(
2959
+ targetKey,
2960
+ z2.fromJSONSchema(
2961
+ target.parameter_schema
2962
+ )
2963
+ );
2964
+ }
2965
+ return schemas;
2966
+ };
2967
+ var buildParameterSchemas = (ir) => {
2968
+ const schemas = /* @__PURE__ */ new Map();
2969
+ for (const [targetKey, target] of Object.entries(
2970
+ ir.apis.webScrapingApi.targets
2971
+ )) {
2972
+ schemas.set(targetKey, target.parameter_schema);
2973
+ }
2974
+ return schemas;
2975
+ };
2976
+ var RemoteSchema = class _RemoteSchema {
2977
+ version;
2978
+ schemas;
2979
+ meta;
2980
+ parameterSchemas;
2981
+ sharedParameters;
2982
+ targetKeys;
2983
+ constructor(ir, schemas) {
2984
+ this.version = ir.version;
2985
+ this.schemas = schemas;
2986
+ this.meta = buildTargetMeta(ir.apis.webScrapingApi.targets);
2987
+ this.parameterSchemas = buildParameterSchemas(ir);
2988
+ this.sharedParameters = ir.apis.webScrapingApi.parameters ?? {};
2989
+ this.targetKeys = Object.keys(ir.apis.webScrapingApi.targets);
2990
+ }
2991
+ static async load(config = {}) {
2992
+ const ir = await loadIr(config);
2993
+ const schemas = buildRequestSchemas(ir);
2994
+ return new _RemoteSchema(ir, schemas);
2995
+ }
2996
+ getRequestSchema(target) {
2997
+ return this.schemas.get(target);
2998
+ }
2999
+ listTargets() {
3000
+ return this.targetKeys;
3001
+ }
3002
+ getTargetMeta(target) {
3003
+ return this.meta.get(target);
3004
+ }
3005
+ getTargetParameterSchema(target) {
3006
+ return this.parameterSchemas.get(target);
3007
+ }
3008
+ getSharedParameters() {
3009
+ return this.sharedParameters;
3010
+ }
3011
+ };
3012
+
3013
+ // src/generated/parameters.ts
3014
+ var parameterMeta = {
3015
+ "360": { type: "boolean" },
3016
+ callback_url: { type: "string" },
3017
+ query: { type: "string", maxLength: 2048 },
3018
+ headless: { type: "string", enum: ["html", "png"] },
3019
+ locale: { type: "string" },
3020
+ geo: { type: "string" },
3021
+ device_type: { type: "string" },
3022
+ page_from: { type: "number", minimum: 0, maximum: 100 },
3023
+ google_results_language: { type: "string" },
3024
+ google_tbm: { type: "string" },
3025
+ google_tbs: { type: "string" },
3026
+ parse: { type: "boolean" },
3027
+ google_nfpr: { type: "boolean" },
3028
+ google_safe_search: { type: "boolean" },
3029
+ session_id: { type: "string" },
3030
+ xhr: { type: "boolean" },
3031
+ markdown: { type: "boolean" },
3032
+ page_count: { type: "number", minimum: 1, maximum: 10 },
3033
+ date_range: { type: "string" },
3034
+ stars: { type: "number" },
3035
+ adults: { type: "number", minimum: 1, maximum: 3 },
3036
+ children: { type: "number", minimum: 1, maximum: 3 },
3037
+ search_type: { type: "string" },
3038
+ date_start: { type: "string" },
3039
+ date_end: { type: "string" },
3040
+ url: { type: "string", maxLength: 2056 },
3041
+ hotel_occupancy: { type: "string" },
3042
+ domain: { type: "string" },
3043
+ language_code: { type: "string" },
3044
+ transcript_origin: { type: "string" },
3045
+ autoselect_variant: { type: "boolean" },
3046
+ currency: { type: "string" },
3047
+ category: { type: "string" },
3048
+ merchant: { type: "string" },
3049
+ sort_by: { type: "string" },
3050
+ parser_type: { type: "string" },
3051
+ product_id: { type: "string" },
3052
+ fulfillment_type: { type: "string" },
3053
+ walmart_store_id: { type: "string" },
3054
+ delivery_zip: { type: "string" },
3055
+ store_id: { type: "string" },
3056
+ delivery_type: { type: "string" },
3057
+ target_store_id: { type: "string" },
3058
+ lowes_store_id: { type: "string" },
3059
+ user_agent_type: { type: "string" },
3060
+ free_delivery: { type: "boolean" },
3061
+ pickup_today: { type: "boolean" },
3062
+ delivery_today_tomorrow: { type: "boolean" },
3063
+ payload: { type: "string" },
3064
+ proxy_pool: { type: "string", enum: ["standard", "premium"] },
3065
+ http_method: { type: "string" },
3066
+ successful_status_codes: { type: "array", items: { type: "number" } },
3067
+ headers: { type: "object" },
3068
+ cookies: { type: "object" },
3069
+ force_headers: { type: "boolean" },
3070
+ force_cookies: { type: "boolean" },
3071
+ prompt: { type: "string", maxLength: 8192 },
3072
+ search: { type: "boolean" },
3073
+ country: { type: "string" },
3074
+ sort: { type: "string" },
3075
+ upload_date: { type: "string" },
3076
+ type: { type: "string" },
3077
+ duration: { type: "string" },
3078
+ video_sort_by: { type: "string" },
3079
+ "3d": { type: "boolean" },
3080
+ "4k": { type: "boolean" },
3081
+ creative_commons: { type: "boolean" },
3082
+ hd: { type: "boolean" },
3083
+ hdr: { type: "boolean" },
3084
+ vr180: { type: "boolean" },
3085
+ live: { type: "boolean" },
3086
+ location: { type: "boolean" },
3087
+ purchased: { type: "boolean" },
3088
+ subtitles: { type: "boolean" },
3089
+ subtitle_origin: { type: "string" },
3090
+ limit: { type: "number", minimum: 0, maximum: 100 }
3091
+ };
3092
+ // Annotate the CommonJS export names for ESM import in node:
3093
+ 0 && (module.exports = {
3094
+ AuthenticationError,
3095
+ BundledSchema,
3096
+ DecodoClient,
3097
+ DecodoError,
3098
+ RateLimitError,
3099
+ RemoteSchema,
3100
+ Target,
3101
+ TimeoutError,
3102
+ ValidationError,
3103
+ WebScrapingApi,
3104
+ parameterMeta,
3105
+ targetMeta,
3106
+ targets
3107
+ });