@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,903 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { JSONSchema4 } from 'json-schema';
4
+ import { z } from 'zod';
5
+
6
+ export type BasicAuth = {
7
+ type: "basic";
8
+ token: string;
9
+ };
10
+ export type ApiKeyAuth = {
11
+ type: "apiKey";
12
+ apiKey: string;
13
+ };
14
+ export type HttpClientConfig = {
15
+ baseUrl: string;
16
+ auth: BasicAuth | ApiKeyAuth;
17
+ timeoutMs: number;
18
+ integrationHeader?: string;
19
+ };
20
+ declare class HttpClient {
21
+ private readonly baseUrl;
22
+ private readonly authHeader;
23
+ private readonly timeoutMs;
24
+ private readonly integrationHeader;
25
+ constructor(config: HttpClientConfig);
26
+ request<T>(method: string, path: string, body?: unknown): Promise<T>;
27
+ post<T>(path: string, body: unknown): Promise<T>;
28
+ get<T>(path: string, query?: Record<string, string>): Promise<T>;
29
+ }
30
+ /**
31
+ * Scrape target discriminator (wire string values).
32
+ */
33
+ export declare enum Target {
34
+ UniversalEcommerce = "universal_ecommerce",
35
+ GoogleSearch = "google_search",
36
+ GoogleTravelHotels = "google_travel_hotels",
37
+ GoogleTrendsExplore = "google_trends_explore",
38
+ GoogleShoppingSearch = "google_shopping_search",
39
+ GoogleShoppingProduct = "google_shopping_product",
40
+ Google = "google",
41
+ GoogleSuggest = "google_suggest",
42
+ GoogleMaps = "google_maps",
43
+ GoogleAiMode = "google_ai_mode",
44
+ GoogleAds = "google_ads",
45
+ GoogleLens = "google_lens",
46
+ BingSearch = "bing_search",
47
+ Bing = "bing",
48
+ YoutubeTranscript = "youtube_transcript",
49
+ AmazonProduct = "amazon_product",
50
+ AmazonPricing = "amazon_pricing",
51
+ AmazonSearch = "amazon_search",
52
+ AmazonSellers = "amazon_sellers",
53
+ AmazonBestsellers = "amazon_bestsellers",
54
+ Amazon = "amazon",
55
+ Ecommerce = "ecommerce",
56
+ WalmartProduct = "walmart_product",
57
+ WalmartSearch = "walmart_search",
58
+ Walmart = "walmart",
59
+ TargetProduct = "target_product",
60
+ TargetSearch = "target_search",
61
+ Target = "target",
62
+ LowesSearch = "lowes_search",
63
+ Universal = "universal",
64
+ Chatgpt = "chatgpt",
65
+ Perplexity = "perplexity",
66
+ Bbb = "bbb",
67
+ Autotrader = "autotrader",
68
+ Mobile = "mobile",
69
+ Airbnb = "airbnb",
70
+ AppleAppStore = "apple_app_store",
71
+ InstagramGraphqlProfile = "instagram_graphql_profile",
72
+ TiktokPost = "tiktok_post",
73
+ TiktokShopSearch = "tiktok_shop_search",
74
+ TiktokShopProduct = "tiktok_shop_product",
75
+ Tiktok = "tiktok",
76
+ RedditPost = "reddit_post",
77
+ RedditSubreddit = "reddit_subreddit",
78
+ RedditUser = "reddit_user",
79
+ YoutubeVideo = "youtube_video",
80
+ YoutubeMetadata = "youtube_metadata",
81
+ YoutubeSearch = "youtube_search",
82
+ YoutubeSearchMax = "youtube_search_max",
83
+ YoutubeSubtitles = "youtube_subtitles",
84
+ YoutubeChannel = "youtube_channel"
85
+ }
86
+ /** API discriminator string literals (same values as {@link Target}). */
87
+ export type TargetString = (typeof Target)[keyof typeof Target];
88
+ export declare const targets: readonly [
89
+ Target.UniversalEcommerce,
90
+ Target.GoogleSearch,
91
+ Target.GoogleTravelHotels,
92
+ Target.GoogleTrendsExplore,
93
+ Target.GoogleShoppingSearch,
94
+ Target.GoogleShoppingProduct,
95
+ Target.Google,
96
+ Target.GoogleSuggest,
97
+ Target.GoogleMaps,
98
+ Target.GoogleAiMode,
99
+ Target.GoogleAds,
100
+ Target.GoogleLens,
101
+ Target.BingSearch,
102
+ Target.Bing,
103
+ Target.YoutubeTranscript,
104
+ Target.AmazonProduct,
105
+ Target.AmazonPricing,
106
+ Target.AmazonSearch,
107
+ Target.AmazonSellers,
108
+ Target.AmazonBestsellers,
109
+ Target.Amazon,
110
+ Target.Ecommerce,
111
+ Target.WalmartProduct,
112
+ Target.WalmartSearch,
113
+ Target.Walmart,
114
+ Target.TargetProduct,
115
+ Target.TargetSearch,
116
+ Target.Target,
117
+ Target.LowesSearch,
118
+ Target.Universal,
119
+ Target.Chatgpt,
120
+ Target.Perplexity,
121
+ Target.Bbb,
122
+ Target.Autotrader,
123
+ Target.Mobile,
124
+ Target.Airbnb,
125
+ Target.AppleAppStore,
126
+ Target.InstagramGraphqlProfile,
127
+ Target.TiktokPost,
128
+ Target.TiktokShopSearch,
129
+ Target.TiktokShopProduct,
130
+ Target.Tiktok,
131
+ Target.RedditPost,
132
+ Target.RedditSubreddit,
133
+ Target.RedditUser,
134
+ Target.YoutubeVideo,
135
+ Target.YoutubeMetadata,
136
+ Target.YoutubeSearch,
137
+ Target.YoutubeSearchMax,
138
+ Target.YoutubeSubtitles,
139
+ Target.YoutubeChannel
140
+ ];
141
+ export interface UniversalEcommerceParams {
142
+ callback_url?: string;
143
+ }
144
+ export interface GoogleSearchParams {
145
+ query?: string;
146
+ headless?: "html" | "png";
147
+ locale?: string;
148
+ geo?: string;
149
+ device_type?: string;
150
+ page_from?: number;
151
+ google_results_language?: string;
152
+ google_tbm?: string;
153
+ google_tbs?: string;
154
+ parse?: boolean;
155
+ google_nfpr?: boolean;
156
+ google_safe_search?: boolean;
157
+ session_id?: string;
158
+ xhr?: boolean;
159
+ markdown?: boolean;
160
+ page_count?: number;
161
+ callback_url?: string;
162
+ }
163
+ export interface GoogleTravelHotelsParams {
164
+ query?: string;
165
+ headless?: "html" | "png";
166
+ locale?: string;
167
+ device_type?: string;
168
+ page_from?: number;
169
+ date_range?: string;
170
+ stars?: number;
171
+ adults?: number;
172
+ children?: number;
173
+ session_id?: string;
174
+ markdown?: boolean;
175
+ callback_url?: string;
176
+ }
177
+ export interface GoogleTrendsExploreParams {
178
+ query?: string;
179
+ geo?: string;
180
+ device_type?: string;
181
+ search_type?: string;
182
+ date_start?: string;
183
+ date_end?: string;
184
+ callback_url?: string;
185
+ }
186
+ export interface GoogleShoppingSearchParams {
187
+ query?: string;
188
+ headless?: "html" | "png";
189
+ locale?: string;
190
+ geo?: string;
191
+ device_type?: string;
192
+ page_from?: number;
193
+ google_tbs?: string;
194
+ parse?: boolean;
195
+ session_id?: string;
196
+ google_results_language?: string;
197
+ markdown?: boolean;
198
+ callback_url?: string;
199
+ }
200
+ export interface GoogleShoppingProductParams {
201
+ query?: string;
202
+ headless?: "html" | "png";
203
+ locale?: string;
204
+ geo?: string;
205
+ device_type?: string;
206
+ page_from?: number;
207
+ parse?: boolean;
208
+ session_id?: string;
209
+ google_results_language?: string;
210
+ markdown?: boolean;
211
+ xhr?: boolean;
212
+ callback_url?: string;
213
+ }
214
+ export interface GoogleParams {
215
+ url?: string;
216
+ headless?: "html" | "png";
217
+ locale?: string;
218
+ device_type?: string;
219
+ parse?: boolean;
220
+ session_id?: string;
221
+ markdown?: boolean;
222
+ xhr?: boolean;
223
+ page_count?: number;
224
+ callback_url?: string;
225
+ }
226
+ export interface GoogleSuggestParams {
227
+ query?: string;
228
+ device_type?: string;
229
+ geo?: string;
230
+ locale?: string;
231
+ session_id?: string;
232
+ callback_url?: string;
233
+ }
234
+ export interface GoogleMapsParams {
235
+ query?: string;
236
+ headless?: "html" | "png";
237
+ geo?: string;
238
+ locale?: string;
239
+ page_from?: number;
240
+ device_type?: string;
241
+ session_id?: string;
242
+ google_results_language?: string;
243
+ google_nfpr?: boolean;
244
+ hotel_occupancy?: string;
245
+ date_range?: string;
246
+ markdown?: boolean;
247
+ callback_url?: string;
248
+ }
249
+ export interface GoogleAiModeParams {
250
+ query?: string;
251
+ geo?: string;
252
+ parse?: boolean;
253
+ device_type?: string;
254
+ session_id?: string;
255
+ markdown?: boolean;
256
+ xhr?: boolean;
257
+ callback_url?: string;
258
+ }
259
+ export interface GoogleAdsParams {
260
+ query?: string;
261
+ headless?: "html" | "png";
262
+ locale?: string;
263
+ geo?: string;
264
+ device_type?: string;
265
+ page_from?: number;
266
+ google_results_language?: string;
267
+ google_tbm?: string;
268
+ google_tbs?: string;
269
+ parse?: boolean;
270
+ google_nfpr?: boolean;
271
+ session_id?: string;
272
+ markdown?: boolean;
273
+ xhr?: boolean;
274
+ page_count?: number;
275
+ callback_url?: string;
276
+ }
277
+ export interface GoogleLensParams {
278
+ query?: string;
279
+ headless?: "html" | "png";
280
+ parse?: boolean;
281
+ device_type?: string;
282
+ markdown?: boolean;
283
+ callback_url?: string;
284
+ }
285
+ export interface BingSearchParams {
286
+ query?: string;
287
+ headless?: "html" | "png";
288
+ locale?: string;
289
+ geo?: string;
290
+ domain?: string;
291
+ device_type?: string;
292
+ page_from?: number;
293
+ parse?: boolean;
294
+ page_count?: number;
295
+ session_id?: string;
296
+ markdown?: boolean;
297
+ xhr?: boolean;
298
+ callback_url?: string;
299
+ }
300
+ export interface BingParams {
301
+ url?: string;
302
+ headless?: "html" | "png";
303
+ locale?: string;
304
+ geo?: string;
305
+ device_type?: string;
306
+ page_from?: number;
307
+ parse?: boolean;
308
+ session_id?: string;
309
+ markdown?: boolean;
310
+ xhr?: boolean;
311
+ callback_url?: string;
312
+ }
313
+ export interface YoutubeTranscriptParams {
314
+ query?: string;
315
+ language_code?: string;
316
+ transcript_origin?: string;
317
+ callback_url?: string;
318
+ }
319
+ export interface AmazonProductParams {
320
+ query?: string;
321
+ headless?: "html" | "png";
322
+ domain?: string;
323
+ device_type?: string;
324
+ parse?: boolean;
325
+ autoselect_variant?: boolean;
326
+ geo?: string;
327
+ session_id?: string;
328
+ currency?: string;
329
+ markdown?: boolean;
330
+ xhr?: boolean;
331
+ callback_url?: string;
332
+ }
333
+ export interface AmazonPricingParams {
334
+ query?: string;
335
+ headless?: "html" | "png";
336
+ domain?: string;
337
+ device_type?: string;
338
+ page_from?: number;
339
+ parse?: boolean;
340
+ geo?: string;
341
+ session_id?: string;
342
+ currency?: string;
343
+ markdown?: boolean;
344
+ xhr?: boolean;
345
+ callback_url?: string;
346
+ }
347
+ export interface AmazonSearchParams {
348
+ query?: string;
349
+ headless?: "html" | "png";
350
+ domain?: string;
351
+ device_type?: string;
352
+ page_from?: number;
353
+ category?: string;
354
+ merchant?: string;
355
+ parse?: boolean;
356
+ geo?: string;
357
+ session_id?: string;
358
+ sort_by?: string;
359
+ currency?: string;
360
+ markdown?: boolean;
361
+ xhr?: boolean;
362
+ callback_url?: string;
363
+ }
364
+ export interface AmazonSellersParams {
365
+ query?: string;
366
+ headless?: "html" | "png";
367
+ locale?: string;
368
+ domain?: string;
369
+ device_type?: string;
370
+ geo?: string;
371
+ parse?: boolean;
372
+ markdown?: boolean;
373
+ xhr?: boolean;
374
+ callback_url?: string;
375
+ }
376
+ export interface AmazonBestsellersParams {
377
+ query?: string;
378
+ domain?: string;
379
+ device_type?: string;
380
+ geo?: string;
381
+ page_from?: number;
382
+ category?: string;
383
+ parse?: boolean;
384
+ session_id?: string;
385
+ currency?: string;
386
+ markdown?: boolean;
387
+ xhr?: boolean;
388
+ callback_url?: string;
389
+ }
390
+ export interface AmazonParams {
391
+ url?: string;
392
+ headless?: "html" | "png";
393
+ device_type?: string;
394
+ parse?: boolean;
395
+ geo?: string;
396
+ session_id?: string;
397
+ markdown?: boolean;
398
+ xhr?: boolean;
399
+ callback_url?: string;
400
+ }
401
+ export interface EcommerceParams {
402
+ url?: string;
403
+ headless?: "html" | "png";
404
+ locale?: string;
405
+ geo?: string;
406
+ device_type?: string;
407
+ parse?: boolean;
408
+ parser_type?: string;
409
+ callback_url?: string;
410
+ }
411
+ export interface WalmartProductParams {
412
+ product_id?: string;
413
+ headless?: "html" | "png";
414
+ parse?: boolean;
415
+ xhr?: boolean;
416
+ markdown?: boolean;
417
+ fulfillment_type?: string;
418
+ walmart_store_id?: string;
419
+ delivery_zip?: string;
420
+ callback_url?: string;
421
+ }
422
+ export interface WalmartSearchParams {
423
+ query?: string;
424
+ headless?: "html" | "png";
425
+ parse?: boolean;
426
+ markdown?: boolean;
427
+ fulfillment_type?: string;
428
+ walmart_store_id?: string;
429
+ delivery_zip?: string;
430
+ callback_url?: string;
431
+ }
432
+ export interface WalmartParams {
433
+ url?: string;
434
+ headless?: "html" | "png";
435
+ locale?: string;
436
+ geo?: string;
437
+ device_type?: string;
438
+ store_id?: string;
439
+ markdown?: boolean;
440
+ xhr?: boolean;
441
+ callback_url?: string;
442
+ }
443
+ export interface TargetProductParams {
444
+ product_id?: string;
445
+ headless?: "html" | "png";
446
+ parse?: boolean;
447
+ device_type?: string;
448
+ markdown?: boolean;
449
+ xhr?: boolean;
450
+ delivery_type?: string;
451
+ target_store_id?: string;
452
+ delivery_zip?: string;
453
+ callback_url?: string;
454
+ }
455
+ export interface TargetSearchParams {
456
+ query?: string;
457
+ headless?: "html" | "png";
458
+ parse?: boolean;
459
+ device_type?: string;
460
+ delivery_type?: string;
461
+ target_store_id?: string;
462
+ delivery_zip?: string;
463
+ xhr?: boolean;
464
+ markdown?: boolean;
465
+ callback_url?: string;
466
+ }
467
+ export interface TargetParams {
468
+ url?: string;
469
+ headless?: "html" | "png";
470
+ device_type?: string;
471
+ xhr?: boolean;
472
+ delivery_zip?: string;
473
+ target_store_id?: string;
474
+ callback_url?: string;
475
+ }
476
+ export interface LowesSearchParams {
477
+ query?: string;
478
+ lowes_store_id?: string;
479
+ headless?: "html" | "png";
480
+ delivery_zip?: string;
481
+ user_agent_type?: string;
482
+ free_delivery?: boolean;
483
+ pickup_today?: boolean;
484
+ delivery_today_tomorrow?: boolean;
485
+ callback_url?: string;
486
+ }
487
+ export interface UniversalParams {
488
+ url?: string;
489
+ payload?: string;
490
+ proxy_pool?: "standard" | "premium";
491
+ http_method?: string;
492
+ headless?: "html" | "png";
493
+ geo?: string;
494
+ locale?: string;
495
+ device_type?: string;
496
+ session_id?: string;
497
+ successful_status_codes?: number[];
498
+ headers?: {
499
+ [k: string]: unknown;
500
+ };
501
+ cookies?: {
502
+ [k: string]: unknown;
503
+ };
504
+ force_headers?: boolean;
505
+ force_cookies?: boolean;
506
+ xhr?: boolean;
507
+ markdown?: boolean;
508
+ callback_url?: string;
509
+ }
510
+ export interface ChatgptParams {
511
+ prompt?: string;
512
+ search?: boolean;
513
+ parse?: boolean;
514
+ geo?: string;
515
+ device_type?: string;
516
+ markdown?: boolean;
517
+ xhr?: boolean;
518
+ callback_url?: string;
519
+ }
520
+ export interface PerplexityParams {
521
+ prompt?: string;
522
+ parse?: boolean;
523
+ geo?: string;
524
+ device_type?: string;
525
+ markdown?: boolean;
526
+ xhr?: boolean;
527
+ callback_url?: string;
528
+ }
529
+ export interface BbbParams {
530
+ url?: string;
531
+ headless?: "html" | "png";
532
+ geo?: string;
533
+ device_type?: string;
534
+ markdown?: boolean;
535
+ xhr?: boolean;
536
+ callback_url?: string;
537
+ }
538
+ export interface AutotraderParams {
539
+ url?: string;
540
+ headless?: "html" | "png";
541
+ geo?: string;
542
+ device_type?: string;
543
+ markdown?: boolean;
544
+ xhr?: boolean;
545
+ callback_url?: string;
546
+ }
547
+ export interface MobileParams {
548
+ url?: string;
549
+ headless?: "html" | "png";
550
+ geo?: string;
551
+ device_type?: string;
552
+ markdown?: boolean;
553
+ xhr?: boolean;
554
+ callback_url?: string;
555
+ }
556
+ export interface AirbnbParams {
557
+ url?: string;
558
+ headless?: "html" | "png";
559
+ geo?: string;
560
+ device_type?: string;
561
+ markdown?: boolean;
562
+ xhr?: boolean;
563
+ callback_url?: string;
564
+ }
565
+ export interface AppleAppStoreParams {
566
+ url?: string;
567
+ headless?: "html" | "png";
568
+ geo?: string;
569
+ device_type?: string;
570
+ markdown?: boolean;
571
+ xhr?: boolean;
572
+ callback_url?: string;
573
+ }
574
+ export interface InstagramGraphqlProfileParams {
575
+ query?: string;
576
+ callback_url?: string;
577
+ }
578
+ export interface TiktokPostParams {
579
+ url?: string;
580
+ xhr?: boolean;
581
+ callback_url?: string;
582
+ }
583
+ export interface TiktokShopSearchParams {
584
+ query?: string;
585
+ headless?: "html" | "png";
586
+ device_type?: string;
587
+ markdown?: boolean;
588
+ country?: string;
589
+ callback_url?: string;
590
+ }
591
+ export interface TiktokShopProductParams {
592
+ product_id?: string;
593
+ headless?: "html" | "png";
594
+ device_type?: string;
595
+ xhr?: boolean;
596
+ markdown?: boolean;
597
+ country?: string;
598
+ callback_url?: string;
599
+ }
600
+ export interface TiktokParams {
601
+ url?: string;
602
+ headless?: "html" | "png";
603
+ user_agent_type?: string;
604
+ callback_url?: string;
605
+ }
606
+ export interface RedditPostParams {
607
+ url?: string;
608
+ locale?: string;
609
+ geo?: string;
610
+ callback_url?: string;
611
+ }
612
+ export interface RedditSubredditParams {
613
+ url?: string;
614
+ locale?: string;
615
+ geo?: string;
616
+ callback_url?: string;
617
+ }
618
+ export interface RedditUserParams {
619
+ url?: string;
620
+ locale?: string;
621
+ geo?: string;
622
+ sort?: string;
623
+ callback_url?: string;
624
+ }
625
+ export interface YoutubeVideoParams {
626
+ query?: string;
627
+ geo?: string;
628
+ callback_url?: string;
629
+ }
630
+ export interface YoutubeMetadataParams {
631
+ query?: string;
632
+ callback_url?: string;
633
+ }
634
+ export interface YoutubeSearchParams {
635
+ "360"?: boolean;
636
+ query?: string;
637
+ upload_date?: string;
638
+ type?: string;
639
+ duration?: string;
640
+ video_sort_by?: string;
641
+ "3d"?: boolean;
642
+ "4k"?: boolean;
643
+ creative_commons?: boolean;
644
+ hd?: boolean;
645
+ hdr?: boolean;
646
+ vr180?: boolean;
647
+ live?: boolean;
648
+ location?: boolean;
649
+ purchased?: boolean;
650
+ subtitles?: boolean;
651
+ callback_url?: string;
652
+ }
653
+ export interface YoutubeSearchMaxParams {
654
+ "360"?: boolean;
655
+ query?: string;
656
+ upload_date?: string;
657
+ type?: string;
658
+ duration?: string;
659
+ video_sort_by?: string;
660
+ "3d"?: boolean;
661
+ "4k"?: boolean;
662
+ creative_commons?: boolean;
663
+ hd?: boolean;
664
+ hdr?: boolean;
665
+ vr180?: boolean;
666
+ live?: boolean;
667
+ location?: boolean;
668
+ purchased?: boolean;
669
+ subtitles?: boolean;
670
+ markdown?: boolean;
671
+ callback_url?: string;
672
+ }
673
+ export interface YoutubeSubtitlesParams {
674
+ query?: string;
675
+ language_code?: string;
676
+ subtitle_origin?: string;
677
+ callback_url?: string;
678
+ }
679
+ export interface YoutubeChannelParams {
680
+ query?: string;
681
+ parse?: boolean;
682
+ limit?: number;
683
+ markdown?: boolean;
684
+ callback_url?: string;
685
+ }
686
+ export type TargetParamsMap = {
687
+ [Target.UniversalEcommerce]: UniversalEcommerceParams;
688
+ [Target.GoogleSearch]: GoogleSearchParams;
689
+ [Target.GoogleTravelHotels]: GoogleTravelHotelsParams;
690
+ [Target.GoogleTrendsExplore]: GoogleTrendsExploreParams;
691
+ [Target.GoogleShoppingSearch]: GoogleShoppingSearchParams;
692
+ [Target.GoogleShoppingProduct]: GoogleShoppingProductParams;
693
+ [Target.Google]: GoogleParams;
694
+ [Target.GoogleSuggest]: GoogleSuggestParams;
695
+ [Target.GoogleMaps]: GoogleMapsParams;
696
+ [Target.GoogleAiMode]: GoogleAiModeParams;
697
+ [Target.GoogleAds]: GoogleAdsParams;
698
+ [Target.GoogleLens]: GoogleLensParams;
699
+ [Target.BingSearch]: BingSearchParams;
700
+ [Target.Bing]: BingParams;
701
+ [Target.YoutubeTranscript]: YoutubeTranscriptParams;
702
+ [Target.AmazonProduct]: AmazonProductParams;
703
+ [Target.AmazonPricing]: AmazonPricingParams;
704
+ [Target.AmazonSearch]: AmazonSearchParams;
705
+ [Target.AmazonSellers]: AmazonSellersParams;
706
+ [Target.AmazonBestsellers]: AmazonBestsellersParams;
707
+ [Target.Amazon]: AmazonParams;
708
+ [Target.Ecommerce]: EcommerceParams;
709
+ [Target.WalmartProduct]: WalmartProductParams;
710
+ [Target.WalmartSearch]: WalmartSearchParams;
711
+ [Target.Walmart]: WalmartParams;
712
+ [Target.TargetProduct]: TargetProductParams;
713
+ [Target.TargetSearch]: TargetSearchParams;
714
+ [Target.Target]: TargetParams;
715
+ [Target.LowesSearch]: LowesSearchParams;
716
+ [Target.Universal]: UniversalParams;
717
+ [Target.Chatgpt]: ChatgptParams;
718
+ [Target.Perplexity]: PerplexityParams;
719
+ [Target.Bbb]: BbbParams;
720
+ [Target.Autotrader]: AutotraderParams;
721
+ [Target.Mobile]: MobileParams;
722
+ [Target.Airbnb]: AirbnbParams;
723
+ [Target.AppleAppStore]: AppleAppStoreParams;
724
+ [Target.InstagramGraphqlProfile]: InstagramGraphqlProfileParams;
725
+ [Target.TiktokPost]: TiktokPostParams;
726
+ [Target.TiktokShopSearch]: TiktokShopSearchParams;
727
+ [Target.TiktokShopProduct]: TiktokShopProductParams;
728
+ [Target.Tiktok]: TiktokParams;
729
+ [Target.RedditPost]: RedditPostParams;
730
+ [Target.RedditSubreddit]: RedditSubredditParams;
731
+ [Target.RedditUser]: RedditUserParams;
732
+ [Target.YoutubeVideo]: YoutubeVideoParams;
733
+ [Target.YoutubeMetadata]: YoutubeMetadataParams;
734
+ [Target.YoutubeSearch]: YoutubeSearchParams;
735
+ [Target.YoutubeSearchMax]: YoutubeSearchMaxParams;
736
+ [Target.YoutubeSubtitles]: YoutubeSubtitlesParams;
737
+ [Target.YoutubeChannel]: YoutubeChannelParams;
738
+ };
739
+ export type ScrapeRequest = {
740
+ [T in TargetString]: {
741
+ target: T;
742
+ } & TargetParamsMap[T];
743
+ }[TargetString];
744
+ export type BatchRequest = {
745
+ [T in TargetString]: {
746
+ target: T;
747
+ url?: string[];
748
+ query?: string[];
749
+ } & Omit<TargetParamsMap[T], "url" | "query">;
750
+ }[TargetString];
751
+ export type TargetMeta = {
752
+ group: string;
753
+ response_format: string;
754
+ parameters: string[];
755
+ };
756
+ export declare const targetMeta: Record<Target, TargetMeta>;
757
+ export type RemoteSchemaLoadOptions = {
758
+ url?: string;
759
+ cachePath?: string;
760
+ ttlMs?: number;
761
+ };
762
+ export type DecodoSchema = {
763
+ getRequestSchema: (target: string) => z.ZodType | undefined;
764
+ listTargets: () => string[];
765
+ getTargetMeta: (target: string) => TargetMeta | undefined;
766
+ getTargetParameterSchema: (target: string) => JSONSchema4 | undefined;
767
+ getSharedParameters: () => Record<string, unknown>;
768
+ readonly version?: string;
769
+ };
770
+ export type ResultEntry = {
771
+ content: unknown;
772
+ status_code: number;
773
+ url?: string;
774
+ task_id: string;
775
+ headers?: Record<string, string>;
776
+ cookies?: Record<string, string>[];
777
+ created_at: string;
778
+ updated_at: string;
779
+ help?: string;
780
+ browser_actions_warnings?: Record<string, string>[];
781
+ browser_actions_error?: Record<string, string>[];
782
+ delivery_zip?: string;
783
+ };
784
+ export type SyncResponse = {
785
+ results: ResultEntry[];
786
+ };
787
+ export type AsyncTaskResponse = {
788
+ id: string;
789
+ target?: string;
790
+ url?: string;
791
+ query?: string;
792
+ status: string;
793
+ created_at?: string;
794
+ updated_at?: string;
795
+ page_from?: number;
796
+ limit?: number;
797
+ geo?: string | null;
798
+ device_type?: string;
799
+ headless?: string | null;
800
+ parse?: boolean;
801
+ locale?: string | null;
802
+ domain?: string;
803
+ output_schema?: string | null;
804
+ content_encoding?: string;
805
+ page_count?: number;
806
+ adults?: number;
807
+ children?: number;
808
+ callback_url?: string;
809
+ browser_actions_error?: Record<string, string>[];
810
+ browser_actions_warnings?: Record<string, string>[];
811
+ };
812
+ export type BatchResponse = {
813
+ id?: string;
814
+ queries?: AsyncTaskResponse[];
815
+ errors?: Array<{
816
+ message: string;
817
+ }>;
818
+ };
819
+ export type TaskStatus = "pending" | "faulted" | "done";
820
+ export type TaskMetadata = {
821
+ status: TaskStatus;
822
+ [key: string]: unknown;
823
+ };
824
+ export type TaskResultsResponse = {
825
+ results: ResultEntry[];
826
+ };
827
+ export declare class WebScrapingApi {
828
+ private readonly http;
829
+ private readonly schemas;
830
+ constructor(http: HttpClient, schemas?: DecodoSchema);
831
+ private validate;
832
+ scrape(params: ScrapeRequest): Promise<SyncResponse>;
833
+ scrapeAsync(params: ScrapeRequest): Promise<AsyncTaskResponse>;
834
+ scrapeBatch(params: BatchRequest): Promise<BatchResponse>;
835
+ getStatus(taskId: string): Promise<TaskMetadata>;
836
+ getResults(taskId: string): Promise<TaskResultsResponse | null>;
837
+ }
838
+ export type DecodoConfig = {
839
+ webScrapingApi?: {
840
+ token: string;
841
+ integrationHeader?: string;
842
+ };
843
+ timeoutMs?: number;
844
+ schema?: DecodoSchema;
845
+ };
846
+ export declare class DecodoClient {
847
+ readonly webScrapingApi: WebScrapingApi;
848
+ constructor(config: DecodoConfig);
849
+ }
850
+ export declare class BundledSchema implements DecodoSchema {
851
+ static readonly shared: BundledSchema;
852
+ getRequestSchema(target: string): import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
853
+ listTargets(): string[];
854
+ getTargetMeta(target: string): TargetMeta;
855
+ getTargetParameterSchema(target: string): JSONSchema4 | undefined;
856
+ getSharedParameters(): Record<string, unknown>;
857
+ }
858
+ export declare class RemoteSchema implements DecodoSchema {
859
+ readonly version: string;
860
+ private readonly schemas;
861
+ private readonly meta;
862
+ private readonly parameterSchemas;
863
+ private readonly sharedParameters;
864
+ private readonly targetKeys;
865
+ private constructor();
866
+ static load(config?: RemoteSchemaLoadOptions): Promise<RemoteSchema>;
867
+ getRequestSchema(target: string): z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>> | undefined;
868
+ listTargets(): string[];
869
+ getTargetMeta(target: string): TargetMeta | undefined;
870
+ getTargetParameterSchema(target: string): JSONSchema4 | undefined;
871
+ getSharedParameters(): Record<string, unknown>;
872
+ }
873
+ export type ParameterMeta = {
874
+ type: string;
875
+ maxLength?: number;
876
+ minimum?: number;
877
+ maximum?: number;
878
+ enum?: (string | number)[];
879
+ items?: {
880
+ type: string;
881
+ };
882
+ };
883
+ export declare const parameterMeta: Record<string, ParameterMeta>;
884
+ export declare class DecodoError extends Error {
885
+ readonly statusCode: number;
886
+ readonly apiStatus: string | undefined;
887
+ constructor(message: string, statusCode: number, apiStatus?: string);
888
+ }
889
+ export declare class AuthenticationError extends DecodoError {
890
+ constructor(message?: string);
891
+ }
892
+ export declare class RateLimitError extends DecodoError {
893
+ constructor(message?: string);
894
+ }
895
+ export declare class ValidationError extends DecodoError {
896
+ readonly errors: unknown[] | undefined;
897
+ constructor(message: string, errors?: unknown[]);
898
+ }
899
+ export declare class TimeoutError extends Error {
900
+ constructor(message?: string);
901
+ }
902
+
903
+ export {};