@decodo/sdk-ts 2.1.0 → 2.1.1

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