@openserp/sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1587 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ interface paths {
6
+ "/{engine}/search": {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ /**
14
+ * Search web results from a specific engine
15
+ * @description Engine path values are `google`, `yandex`, `baidu`, `bing`, `duck`, and `ecosia` (`duck` maps to DuckDuckGo internally). Use `?format=markdown|text|ndjson` for alternative output formats.
16
+ */
17
+ get: operations["searchWeb"];
18
+ put?: never;
19
+ post?: never;
20
+ delete?: never;
21
+ options?: never;
22
+ head?: never;
23
+ patch?: never;
24
+ trace?: never;
25
+ };
26
+ "/{engine}/image": {
27
+ parameters: {
28
+ query?: never;
29
+ header?: never;
30
+ path?: never;
31
+ cookie?: never;
32
+ };
33
+ /** Search image results from a specific engine */
34
+ get: operations["searchImages"];
35
+ put?: never;
36
+ post?: never;
37
+ delete?: never;
38
+ options?: never;
39
+ head?: never;
40
+ patch?: never;
41
+ trace?: never;
42
+ };
43
+ "/google/parse": {
44
+ parameters: {
45
+ query?: never;
46
+ header?: never;
47
+ path?: never;
48
+ cookie?: never;
49
+ };
50
+ get?: never;
51
+ put?: never;
52
+ /**
53
+ * Parse a Google SERP HTML document into structured results
54
+ * @description Accepts raw Google SERP HTML in the request body and returns a standard search envelope. Useful when an upstream provider delivers raw HTML rather than JSON. No browser is used; parsing is done with goquery. The body size limit is 10 MB.
55
+ */
56
+ post: operations["parseGoogleHTML"];
57
+ delete?: never;
58
+ options?: never;
59
+ head?: never;
60
+ patch?: never;
61
+ trace?: never;
62
+ };
63
+ "/bing/parse": {
64
+ parameters: {
65
+ query?: never;
66
+ header?: never;
67
+ path?: never;
68
+ cookie?: never;
69
+ };
70
+ get?: never;
71
+ put?: never;
72
+ /**
73
+ * Parse a Bing SERP HTML document into structured results
74
+ * @description Accepts raw Bing SERP HTML in the request body and returns a standard search envelope. Useful when an upstream provider delivers raw HTML rather than JSON. No browser is used; parsing is done with goquery. The body size limit is 10 MB.
75
+ */
76
+ post: operations["parseBingHTML"];
77
+ delete?: never;
78
+ options?: never;
79
+ head?: never;
80
+ patch?: never;
81
+ trace?: never;
82
+ };
83
+ "/mega/search": {
84
+ parameters: {
85
+ query?: never;
86
+ header?: never;
87
+ path?: never;
88
+ cookie?: never;
89
+ };
90
+ /**
91
+ * Search across multiple engines with selectable execution mode
92
+ * @description Mode controls engine execution strategy: `balanced` (default) queries all selected engines in parallel, `any` runs engines sequentially in requested order until first success, and `fast` queries only the fastest engine based on circuit-breaker average response time stats. In `balanced` mode, `dedupe` and `merge` tune aggregation behavior. Partial failures are surfaced in `meta.engines_failed` and `meta.engine_errors`. If all selected engines fail, the endpoint returns a 502 with per-engine error details. Use `?format=markdown|text|ndjson` for alternative output formats.
93
+ */
94
+ get: operations["megaSearch"];
95
+ put?: never;
96
+ post?: never;
97
+ delete?: never;
98
+ options?: never;
99
+ head?: never;
100
+ patch?: never;
101
+ trace?: never;
102
+ };
103
+ "/mega/image": {
104
+ parameters: {
105
+ query?: never;
106
+ header?: never;
107
+ path?: never;
108
+ cookie?: never;
109
+ };
110
+ /** Image search across multiple engines with selectable execution mode */
111
+ get: operations["megaImageSearch"];
112
+ put?: never;
113
+ post?: never;
114
+ delete?: never;
115
+ options?: never;
116
+ head?: never;
117
+ patch?: never;
118
+ trace?: never;
119
+ };
120
+ "/mega/engines": {
121
+ parameters: {
122
+ query?: never;
123
+ header?: never;
124
+ path?: never;
125
+ cookie?: never;
126
+ };
127
+ /** List available engines and runtime state */
128
+ get: operations["listMegaEngines"];
129
+ put?: never;
130
+ post?: never;
131
+ delete?: never;
132
+ options?: never;
133
+ head?: never;
134
+ patch?: never;
135
+ trace?: never;
136
+ };
137
+ "/health": {
138
+ parameters: {
139
+ query?: never;
140
+ header?: never;
141
+ path?: never;
142
+ cookie?: never;
143
+ };
144
+ /** Service health status */
145
+ get: operations["healthCheck"];
146
+ put?: never;
147
+ post?: never;
148
+ delete?: never;
149
+ options?: never;
150
+ head?: never;
151
+ patch?: never;
152
+ trace?: never;
153
+ };
154
+ "/ready": {
155
+ parameters: {
156
+ query?: never;
157
+ header?: never;
158
+ path?: never;
159
+ cookie?: never;
160
+ };
161
+ /** Service readiness status */
162
+ get: operations["readinessCheck"];
163
+ put?: never;
164
+ post?: never;
165
+ delete?: never;
166
+ options?: never;
167
+ head?: never;
168
+ patch?: never;
169
+ trace?: never;
170
+ };
171
+ "/stats": {
172
+ parameters: {
173
+ query?: never;
174
+ header?: never;
175
+ path?: never;
176
+ cookie?: never;
177
+ };
178
+ /** Combined cache, proxy, and circuit-breaker stats */
179
+ get: operations["getStats"];
180
+ put?: never;
181
+ post?: never;
182
+ delete?: never;
183
+ options?: never;
184
+ head?: never;
185
+ patch?: never;
186
+ trace?: never;
187
+ };
188
+ "/stats/cache": {
189
+ parameters: {
190
+ query?: never;
191
+ header?: never;
192
+ path?: never;
193
+ cookie?: never;
194
+ };
195
+ /** Cache statistics only */
196
+ get: operations["getCacheStats"];
197
+ put?: never;
198
+ post?: never;
199
+ delete?: never;
200
+ options?: never;
201
+ head?: never;
202
+ patch?: never;
203
+ trace?: never;
204
+ };
205
+ "/stats/proxy": {
206
+ parameters: {
207
+ query?: never;
208
+ header?: never;
209
+ path?: never;
210
+ cookie?: never;
211
+ };
212
+ /** Proxy pool and per-engine proxy policy statistics */
213
+ get: operations["getProxyStats"];
214
+ put?: never;
215
+ post?: never;
216
+ delete?: never;
217
+ options?: never;
218
+ head?: never;
219
+ patch?: never;
220
+ trace?: never;
221
+ };
222
+ "/stats/cb": {
223
+ parameters: {
224
+ query?: never;
225
+ header?: never;
226
+ path?: never;
227
+ cookie?: never;
228
+ };
229
+ /** Circuit breaker state per engine */
230
+ get: operations["getCircuitBreakerStats"];
231
+ put?: never;
232
+ post?: never;
233
+ delete?: never;
234
+ options?: never;
235
+ head?: never;
236
+ patch?: never;
237
+ trace?: never;
238
+ };
239
+ "/openapi.yaml": {
240
+ parameters: {
241
+ query?: never;
242
+ header?: never;
243
+ path?: never;
244
+ cookie?: never;
245
+ };
246
+ /** Get raw OpenAPI YAML */
247
+ get: operations["getOpenAPISpec"];
248
+ put?: never;
249
+ post?: never;
250
+ delete?: never;
251
+ options?: never;
252
+ head?: never;
253
+ patch?: never;
254
+ trace?: never;
255
+ };
256
+ "/docs": {
257
+ parameters: {
258
+ query?: never;
259
+ header?: never;
260
+ path?: never;
261
+ cookie?: never;
262
+ };
263
+ /** Swagger UI for interactive API docs */
264
+ get: operations["getSwaggerUI"];
265
+ put?: never;
266
+ post?: never;
267
+ delete?: never;
268
+ options?: never;
269
+ head?: never;
270
+ patch?: never;
271
+ trace?: never;
272
+ };
273
+ }
274
+ type webhooks = Record<string, never>;
275
+ interface components {
276
+ schemas: {
277
+ QueryEcho: {
278
+ /** @example golang */
279
+ text: string;
280
+ /** @example EN */
281
+ lang?: string;
282
+ /** @example US */
283
+ region?: string;
284
+ /**
285
+ * @example [
286
+ * "google"
287
+ * ]
288
+ */
289
+ engines_requested: string[];
290
+ };
291
+ ResponseMeta: {
292
+ /** @example 01HXYZ... */
293
+ request_id: string;
294
+ /**
295
+ * Format: date-time
296
+ * @example 2026-04-24T12:00:00Z
297
+ */
298
+ requested_at: string;
299
+ /** @example 842 */
300
+ took_ms: number;
301
+ /** @example [] */
302
+ engines_failed: string[];
303
+ /** @description Sanitized per-engine failures for mega endpoints. */
304
+ engine_errors?: components["schemas"]["EngineErrorDetail"][];
305
+ /** @example 2.1 */
306
+ version: string;
307
+ };
308
+ EngineErrorDetail: {
309
+ /** @example bing */
310
+ engine: string;
311
+ /** @example blocked */
312
+ error: string;
313
+ /**
314
+ * @description Sanitized detail; proxy credentials are never included.
315
+ * @example blocked: 403
316
+ */
317
+ message?: string;
318
+ };
319
+ Pagination: {
320
+ /** @example 1 */
321
+ page: number;
322
+ /** @example true */
323
+ has_more: boolean;
324
+ /** @example 25 */
325
+ next_start: number;
326
+ };
327
+ Position: {
328
+ /**
329
+ * @description 1-based rank in the mixed SERP stream, across both organic and ad blocks. Always present so SEO callers can plot rank vs. on-page position without inferring it from result order.
330
+ * @example 2
331
+ */
332
+ absolute: number;
333
+ };
334
+ DomainInfo: {
335
+ /** @example org */
336
+ tld?: string;
337
+ /** @example wikipedia */
338
+ sld?: string;
339
+ /**
340
+ * @description Empty string when the domain matches no known category.
341
+ * @enum {string}
342
+ */
343
+ category: "" | "gov" | "edu" | "mil" | "news" | "forum" | "marketplace" | "social";
344
+ };
345
+ Classification: {
346
+ /**
347
+ * @example article
348
+ * @enum {string}
349
+ */
350
+ content_type?: "article" | "document" | "video" | "forum_thread" | "webpage";
351
+ /** @example encyclopedia */
352
+ source_hint?: string;
353
+ };
354
+ /**
355
+ * @description SERP block type. New values require a minor version bump (`meta.version: "2.1"`). In v2.1, engines may emit specialized modules such as `people_also_ask` when a parser can classify them reliably.
356
+ * @enum {string}
357
+ */
358
+ ResultType: "organic" | "ad" | "featured_snippet" | "knowledge_panel" | "people_also_ask" | "video" | "image" | "news" | "shopping" | "local" | "answer_box";
359
+ Result: {
360
+ /**
361
+ * @description Stable identifier: `s_` + hex(first 8 bytes of MD5(engine|normalized_url)). Normalized URL: lowercase scheme+host, trailing slash stripped, utm_*\/fbclid/gclid tracking params removed. Same URL → same ID across requests.
362
+ * @example s_a1b2c3d4e5f6a1b2
363
+ */
364
+ id: string;
365
+ /** @example 1 */
366
+ rank: number;
367
+ type: components["schemas"]["ResultType"];
368
+ /** @example The Go Programming Language */
369
+ title: string;
370
+ /** @example https://go.dev/ */
371
+ url: string;
372
+ /**
373
+ * @description Breadcrumb form of the URL (e.g. `go.dev › doc › install`).
374
+ * @example go.dev
375
+ */
376
+ display_url: string;
377
+ /** @example Go is an open source programming language... */
378
+ snippet: string;
379
+ /**
380
+ * @description Registrable domain with leading `www.` stripped.
381
+ * @example go.dev
382
+ */
383
+ domain: string;
384
+ /**
385
+ * @description Constructed as `https://{domain}/favicon.ico`. Not probed.
386
+ * @example https://go.dev/favicon.ico
387
+ */
388
+ favicon: string;
389
+ position: components["schemas"]["Position"];
390
+ /** @example google */
391
+ engine: string;
392
+ domain_info?: components["schemas"]["DomainInfo"];
393
+ classification?: components["schemas"]["Classification"];
394
+ };
395
+ ImageData: {
396
+ /** @example https://example.com/gopher.png */
397
+ url: string;
398
+ /** @example https://example.com/gopher-thumb.png */
399
+ thumbnail?: string;
400
+ /** @example 1200 */
401
+ width?: number;
402
+ /** @example 800 */
403
+ height?: number;
404
+ };
405
+ ImageSource: {
406
+ /** @example https://example.com/article-about-gophers */
407
+ page_url: string;
408
+ /** @example example.com */
409
+ domain: string;
410
+ };
411
+ ImageResult: {
412
+ /**
413
+ * @description Stable identifier prefixed with `i_`.
414
+ * @example i_a1b2c3d4e5f6a1b2
415
+ */
416
+ id: string;
417
+ /** @example 1 */
418
+ rank: number;
419
+ /** @enum {string} */
420
+ type: "image";
421
+ title: string;
422
+ image: components["schemas"]["ImageData"];
423
+ source: components["schemas"]["ImageSource"];
424
+ engine: string;
425
+ };
426
+ ClusterOccurrence: {
427
+ /** @example google */
428
+ engine: string;
429
+ /** @example 1 */
430
+ rank: number;
431
+ /** @example s_a1b2c3d4e5f6a1b2 */
432
+ result_id: string;
433
+ };
434
+ Cluster: {
435
+ /**
436
+ * @description Stable identifier: `c_` + hex(first 8 bytes of MD5(normalized_url)).
437
+ * @example c_a1b2c3d4e5f6a1b2
438
+ */
439
+ id: string;
440
+ /** @example https://go.dev/ */
441
+ canonical_url: string;
442
+ /** @example go.dev */
443
+ domain: string;
444
+ /** @example The Go Programming Language */
445
+ title: string;
446
+ occurrences: components["schemas"]["ClusterOccurrence"][];
447
+ /**
448
+ * @description Number of engines this URL appeared in.
449
+ * @example 3
450
+ */
451
+ engines_count: number;
452
+ /**
453
+ * @description Lowest (best) rank seen across all engines.
454
+ * @example 1
455
+ */
456
+ best_rank: number;
457
+ /**
458
+ * Format: float
459
+ * @description Cross-engine agreement score: sum(1/rank for each occurrence) / engines_queried, capped at 1.0. Higher is better.
460
+ * @example 0.92
461
+ */
462
+ score: number;
463
+ };
464
+ SearchEnvelope: {
465
+ query: components["schemas"]["QueryEcho"];
466
+ meta: components["schemas"]["ResponseMeta"];
467
+ results: components["schemas"]["Result"][];
468
+ pagination: components["schemas"]["Pagination"];
469
+ };
470
+ MegaSearchEnvelope: components["schemas"]["SearchEnvelope"] & {
471
+ /** @description Cross-engine clusters, sorted by score descending. Only present on /mega/search responses. Absent (not null) on single-engine endpoints. */
472
+ clusters?: components["schemas"]["Cluster"][] | null;
473
+ };
474
+ ImageEnvelope: {
475
+ query: components["schemas"]["QueryEcho"];
476
+ meta: components["schemas"]["ResponseMeta"];
477
+ results: components["schemas"]["ImageResult"][];
478
+ pagination: components["schemas"]["Pagination"];
479
+ };
480
+ ErrorResponse: {
481
+ /**
482
+ * @description Stable machine-readable error class. Search-pipeline failures use the following codes: `captcha_detected`, `blocked`, `rate_limited`, `search_timeout`, `proxy_connect`, `proxy_auth`, `proxy_timeout`, `proxy_unavailable`, `parser_failure`, `engine_internal`, `all_engines_failed`, `circuit_open`, `request_timeout`, `request_canceled`. Validation errors use `bad_request`. Other generic codes (`not_found`, `service_unavailable`, `server_error`, `client_error`, `error`) may appear for non-search routes.
483
+ * @example bad_request
484
+ * @enum {string}
485
+ */
486
+ error: "bad_request" | "not_found" | "rate_limited" | "service_unavailable" | "server_error" | "client_error" | "error" | "captcha_detected" | "blocked" | "search_timeout" | "proxy_connect" | "proxy_auth" | "proxy_timeout" | "proxy_unavailable" | "parser_failure" | "engine_internal" | "all_engines_failed" | "circuit_open" | "request_timeout" | "request_canceled";
487
+ /** @example 400 */
488
+ code: number;
489
+ /**
490
+ * @description Matches the `X-Request-ID` response header.
491
+ * @example 01HXYZ...
492
+ */
493
+ request_id?: string;
494
+ /** @example INVALID_LIMIT: limit must be between 1 and 100 */
495
+ message?: string;
496
+ /**
497
+ * @description Stable client-actionable reason code. Present on 400 errors. Known values: INVALID_LIMIT, INVALID_START, INVALID_PARAM, EMPTY_QUERY, NO_ENGINES, UNKNOWN_FORMAT, REQUEST_PROXY_URL_DISABLED, UNSUPPORTED_PROXY_SCHEME.
498
+ * @example INVALID_LIMIT
499
+ */
500
+ reason?: string;
501
+ /** @description Sanitized context for search-pipeline errors. Credentials are never included. */
502
+ meta?: {
503
+ /** @example google */
504
+ engine?: string;
505
+ /**
506
+ * @description Masked `scheme://host:port`; never includes credentials.
507
+ * @example http://proxy.example:8080
508
+ */
509
+ proxy_used?: string;
510
+ /** @example us */
511
+ proxy_country?: string;
512
+ /** @example residential */
513
+ proxy_class?: string;
514
+ /** @example webshare */
515
+ proxy_provider?: string;
516
+ /** @example sid-123 */
517
+ proxy_session_id?: string;
518
+ /**
519
+ * @description Sanitized underlying error detail when available.
520
+ * @example proxy_connect: dial tcp proxy.example:8080: connection refused
521
+ */
522
+ error_detail?: string;
523
+ engine_errors?: components["schemas"]["EngineErrorDetail"][];
524
+ } & {
525
+ [key: string]: unknown;
526
+ };
527
+ };
528
+ EngineHealth: {
529
+ /** @example google */
530
+ name: string;
531
+ /** @example true */
532
+ initialized: boolean;
533
+ /** @enum {string} */
534
+ status: "ready" | "not_initialized" | "circuit_open";
535
+ };
536
+ HealthStatus: {
537
+ /** @enum {string} */
538
+ status: "healthy" | "degraded" | "unhealthy";
539
+ /** @example 1h12m3s */
540
+ uptime: string;
541
+ engines: components["schemas"]["EngineHealth"][];
542
+ system: {
543
+ [key: string]: unknown;
544
+ };
545
+ };
546
+ ReadinessStatus: {
547
+ /** @enum {string} */
548
+ status: "ready" | "draining";
549
+ };
550
+ CacheStatsEnabled: {
551
+ /** @enum {boolean} */
552
+ status: true;
553
+ entries: number;
554
+ hits: number;
555
+ misses: number;
556
+ bypasses: number;
557
+ evictions: number;
558
+ ttl_seconds: number;
559
+ max_size: number;
560
+ };
561
+ CacheStatsDisabled: {
562
+ /** @enum {boolean} */
563
+ status: false;
564
+ };
565
+ CacheStats: components["schemas"]["CacheStatsEnabled"] | components["schemas"]["CacheStatsDisabled"];
566
+ ProxyTagSummary: {
567
+ configured: number;
568
+ healthy: number;
569
+ };
570
+ ProxyStatsEntry: {
571
+ proxy: string;
572
+ tags: string[];
573
+ healthy: boolean;
574
+ failures: number;
575
+ disabled: boolean;
576
+ };
577
+ ProxyEngineStats: {
578
+ tag?: string;
579
+ selected_proxy: string;
580
+ };
581
+ /** @description Sticky proxy lane state observed by this worker. */
582
+ LaneStats: {
583
+ /**
584
+ * @description Number of lanes currently held by the worker.
585
+ * @example 12
586
+ */
587
+ active: number;
588
+ /**
589
+ * @description Lanes evicted by the LRU bound since worker start.
590
+ * @example 7
591
+ */
592
+ evicted_lru: number;
593
+ /**
594
+ * @description Lane cookie drops triggered by captcha/challenge responses.
595
+ * @example 20
596
+ */
597
+ cookies_dropped: number;
598
+ };
599
+ /** @description Live state of the per-process Chrome pool. Each authenticated upstream proxy identity (scheme+host+port+username) gets a dedicated Chrome so Chrome can answer 407 challenges natively. Direct and unauthenticated proxies share one Chrome with per-BrowserContext proxy override. */
600
+ BrowserPoolStats: {
601
+ /**
602
+ * @description Number of Chrome processes currently held by the pool.
603
+ * @example 3
604
+ */
605
+ active: number;
606
+ /**
607
+ * @description Configured `app.max_processes` LRU cap.
608
+ * @example 4
609
+ */
610
+ max: number;
611
+ /**
612
+ * @description Chrome processes closed because the LRU cap was exceeded.
613
+ * @example 12
614
+ */
615
+ evicted_lru: number;
616
+ /**
617
+ * @description Chrome processes closed by the idle sweeper after `app.idle_ttl`.
618
+ * @example 5
619
+ */
620
+ evicted_idle: number;
621
+ };
622
+ ProxyStats: {
623
+ configured_count: number;
624
+ healthy_count: number;
625
+ unhealthy_count: number;
626
+ /** @description Whether `proxies.allow_request_proxy_url` is enabled on this worker. */
627
+ request_proxy_url_enabled: boolean;
628
+ lanes: components["schemas"]["LaneStats"];
629
+ browser_processes: components["schemas"]["BrowserPoolStats"];
630
+ tags: {
631
+ [key: string]: components["schemas"]["ProxyTagSummary"];
632
+ };
633
+ entries: components["schemas"]["ProxyStatsEntry"][];
634
+ engines?: {
635
+ [key: string]: components["schemas"]["ProxyEngineStats"];
636
+ };
637
+ };
638
+ CircuitBreakerStat: {
639
+ engine: string;
640
+ /** @enum {string} */
641
+ state: "closed" | "open" | "half-open";
642
+ failure_count: number;
643
+ /** Format: date-time */
644
+ last_changed: string;
645
+ /** @description Seconds until next half-open attempt (present when state is open). */
646
+ retry_in?: number;
647
+ /** @description Average successful engine response time in milliseconds. */
648
+ avg_response_ms?: number;
649
+ };
650
+ CircuitBreakerStatsResponse: {
651
+ circuit_breakers: components["schemas"]["CircuitBreakerStat"][];
652
+ };
653
+ StatsResponse: {
654
+ cache: components["schemas"]["CacheStats"];
655
+ proxy: components["schemas"]["ProxyStats"];
656
+ circuit_breakers: components["schemas"]["CircuitBreakerStat"][];
657
+ };
658
+ MegaEngineInfo: {
659
+ name: string;
660
+ initialized: boolean;
661
+ /** @enum {string} */
662
+ circuit_state?: "closed" | "open" | "half-open";
663
+ };
664
+ MegaEnginesResponse: {
665
+ engines: components["schemas"]["MegaEngineInfo"][];
666
+ total: number;
667
+ };
668
+ };
669
+ responses: {
670
+ /** @description Invalid request parameters */
671
+ BadRequestError: {
672
+ headers: {
673
+ [name: string]: unknown;
674
+ };
675
+ content: {
676
+ "application/json": components["schemas"]["ErrorResponse"];
677
+ };
678
+ };
679
+ /** @description The search engine blocked the request */
680
+ ForbiddenError: {
681
+ headers: {
682
+ [name: string]: unknown;
683
+ };
684
+ content: {
685
+ "application/json": components["schemas"]["ErrorResponse"];
686
+ };
687
+ };
688
+ /** @description Captcha challenge or rate-limit response from the search engine */
689
+ TooManyRequestsError: {
690
+ headers: {
691
+ [name: string]: unknown;
692
+ };
693
+ content: {
694
+ "application/json": components["schemas"]["ErrorResponse"];
695
+ };
696
+ };
697
+ /** @description Engine internal failure, parser drift, or all-engine failure when fallback is enabled. */
698
+ BadGatewayError: {
699
+ headers: {
700
+ [name: string]: unknown;
701
+ };
702
+ content: {
703
+ "application/json": components["schemas"]["ErrorResponse"];
704
+ };
705
+ };
706
+ /** @description Search timed out waiting for required SERP elements */
707
+ GatewayTimeoutError: {
708
+ headers: {
709
+ [name: string]: unknown;
710
+ };
711
+ content: {
712
+ "application/json": components["schemas"]["ErrorResponse"];
713
+ };
714
+ };
715
+ /** @description Proxy-layer failure (no healthy proxy or transport error). The search itself was not produced. */
716
+ ServiceUnavailableError: {
717
+ headers: {
718
+ [name: string]: unknown;
719
+ };
720
+ content: {
721
+ "application/json": components["schemas"]["ErrorResponse"];
722
+ };
723
+ };
724
+ /** @description Endpoint not found */
725
+ NotFoundError: {
726
+ headers: {
727
+ [name: string]: unknown;
728
+ };
729
+ content: {
730
+ "application/json": components["schemas"]["ErrorResponse"];
731
+ };
732
+ };
733
+ /** @description Internal error while handling request */
734
+ InternalServerError: {
735
+ headers: {
736
+ [name: string]: unknown;
737
+ };
738
+ content: {
739
+ "application/json": components["schemas"]["ErrorResponse"];
740
+ };
741
+ };
742
+ };
743
+ parameters: {
744
+ /** @description Search engine endpoint alias (`duck` is DuckDuckGo). */
745
+ EnginePath: "google" | "yandex" | "baidu" | "bing" | "duck" | "ecosia";
746
+ /**
747
+ * @description Search query text. At least one of `text`, `site`, or `file` must be non-empty.
748
+ * @example golang
749
+ */
750
+ TextQuery: string;
751
+ /**
752
+ * @description Language code (engine-specific behavior).
753
+ * @example EN
754
+ */
755
+ LangQuery: string;
756
+ /** @description Market/location hint. Yandex accepts numeric `lr` region IDs such as `213`; Google, Bing, and DuckDuckGo use country/locale-style hints such as `RU`, `US`, or `en-GB` where supported. */
757
+ RegionQuery: string;
758
+ /**
759
+ * @description Date interval in `YYYYMMDD..YYYYMMDD` format.
760
+ * @example 20250101..20250131
761
+ */
762
+ DateQuery: string;
763
+ /**
764
+ * @description File extension filter (for engines that support it).
765
+ * @example PDF
766
+ */
767
+ FileQuery: string;
768
+ /**
769
+ * @description Site/domain filter.
770
+ * @example github.com
771
+ */
772
+ SiteQuery: string;
773
+ /**
774
+ * @description Maximum organic results to return (1–100). Ads may be returned in addition.
775
+ * @example 10
776
+ */
777
+ LimitQuery: number;
778
+ /**
779
+ * @description Pagination offset (must be >= 0).
780
+ * @example 20
781
+ */
782
+ StartQuery: number;
783
+ /** @description Duplicate filtering flag (primarily used by Google parser behavior). */
784
+ FilterQuery: boolean;
785
+ /** @description Include answer box style results when supported. */
786
+ AnswersQuery: boolean;
787
+ /**
788
+ * @description Comma-separated engine list for mega endpoints. If omitted, all available engines are used.
789
+ * @example google,bing,duckduckgo
790
+ */
791
+ EnginesQuery: string;
792
+ /** @description Mega execution mode. `balanced` (default) runs all selected engines in parallel. `any` runs selected engines sequentially in request order until first success. `fast` runs only one engine: the fastest by circuit-breaker average response time. */
793
+ MegaModeQuery: "balanced" | "any" | "fast";
794
+ /** @description Enable deduplication by normalized URL. Default `true`. */
795
+ MegaDedupeQuery: boolean;
796
+ /** @description Merge results from all successful engines into one flat list. Default `true`. When `false`, only the first requested engine that returned results is kept. */
797
+ MegaMergeQuery: boolean;
798
+ /** @description Output format. `json` (default) returns the envelope. `markdown` returns a Markdown document suitable for Slack/email. `text` returns a minimal plain-text block optimised for LLM context windows. `ndjson` returns one result object per line with no envelope. The `Accept` header is also checked (`text/markdown`, `text/plain`, `application/x-ndjson`). */
799
+ FormatQuery: "json" | "markdown" | "text" | "ndjson";
800
+ /** @description Request-scoped proxy override. Use `direct` to disable proxy or a tag name to force a specific proxy pool. */
801
+ UseProxyHeader: string;
802
+ /**
803
+ * @description Per-request proxy URL supplied by an upstream balancer. Honored only when `proxies.allow_request_proxy_url: true` is set on the worker; otherwise the request is rejected with `400 bad_request` and `reason=REQUEST_PROXY_URL_DISABLED`. Authenticated SOCKS proxies are rejected in browser mode (`reason=UNSUPPORTED_PROXY_SCHEME`). Credentials are never logged or returned. Precedence: `X-Use-Proxy: direct` > `X-Proxy-URL` > `X-Use-Proxy: <tag>` > per-engine configured tag > `proxies.global` > direct.
804
+ * @example http://user:pass@proxy.example:8080
805
+ */
806
+ ProxyURLHeader: string;
807
+ /**
808
+ * @description Two-letter market country code for the supplied proxy. Used as part of the cache key so different markets do not share results.
809
+ * @example us
810
+ */
811
+ ProxyCountryHeader: string;
812
+ /**
813
+ * @description Proxy class identifier (e.g. `datacenter`, `residential`, `mobile`). Part of the cache key.
814
+ * @example residential
815
+ */
816
+ ProxyClassHeader: string;
817
+ /**
818
+ * @description Upstream proxy provider identifier (e.g. `webshare`, `brightdata`). Part of the cache key.
819
+ * @example webshare
820
+ */
821
+ ProxyProviderHeader: string;
822
+ /**
823
+ * @description Sticky session identifier minted by the balancer. Reusing the same value lets OpenSERP reuse cookies and browser profile for that lane. Lanes are LRU-bounded by `proxies.lanes.max_lanes`. Rotating the session ID gives a clean lane.
824
+ * @example sid-123
825
+ */
826
+ ProxySessionIDHeader: string;
827
+ /** @description Optional tenant scope used to namespace sticky lane state across multi-tenant deployments. When present, lanes are keyed by `tenant + engine + session_id`. */
828
+ TenantHeader: string;
829
+ };
830
+ requestBodies: never;
831
+ headers: {
832
+ /** @description UUID v7 request identifier. Matches `meta.request_id` in the response body and appears in server logs for correlation. */
833
+ XRequestID: string;
834
+ /** @description Cache status when cache is enabled (`HIT`, `MISS`, `BYPASS`). */
835
+ XCache: "HIT" | "MISS" | "BYPASS";
836
+ /** @description Engine name used when dedicated endpoint fallback served the response. */
837
+ XFallbackEngine: string;
838
+ /** @description Effective proxy mode for the request. `request_url` indicates a per-request `X-Proxy-URL` was honored. */
839
+ XProxyMode: "off" | "tag_pool" | "request_url";
840
+ /** @description Effective proxy tag when `X-Proxy-Mode=tag_pool`. Header is omitted when no tag is in effect (i.e. `X-Proxy-Mode` is `request_url` or `off`). */
841
+ XProxyTag: string;
842
+ /** @description Effective proxy target used. Values: `direct`, masked `scheme://host:port` URL, `pooled`, `multiple`, or `mixed`. Credentials are never included. */
843
+ XProxyUsed: string;
844
+ /** @description Aggregate inbound network bytes consumed while executing the search request. Single-engine endpoints report that engine's request bytes; mega endpoints report the sum across selected engines. Cache hits return `0`. */
845
+ XNetworkBytes: number;
846
+ /** @description Browser profile ID selected for browser-mode execution. Mega endpoints may return a comma-separated list when multiple profiles were used. */
847
+ XBrowserProfileID: string;
848
+ };
849
+ pathItems: never;
850
+ }
851
+ type $defs = Record<string, never>;
852
+ interface operations {
853
+ searchWeb: {
854
+ parameters: {
855
+ query?: {
856
+ /**
857
+ * @description Search query text. At least one of `text`, `site`, or `file` must be non-empty.
858
+ * @example golang
859
+ */
860
+ text?: components["parameters"]["TextQuery"];
861
+ /**
862
+ * @description Language code (engine-specific behavior).
863
+ * @example EN
864
+ */
865
+ lang?: components["parameters"]["LangQuery"];
866
+ /** @description Market/location hint. Yandex accepts numeric `lr` region IDs such as `213`; Google, Bing, and DuckDuckGo use country/locale-style hints such as `RU`, `US`, or `en-GB` where supported. */
867
+ region?: components["parameters"]["RegionQuery"];
868
+ /**
869
+ * @description Date interval in `YYYYMMDD..YYYYMMDD` format.
870
+ * @example 20250101..20250131
871
+ */
872
+ date?: components["parameters"]["DateQuery"];
873
+ /**
874
+ * @description File extension filter (for engines that support it).
875
+ * @example PDF
876
+ */
877
+ file?: components["parameters"]["FileQuery"];
878
+ /**
879
+ * @description Site/domain filter.
880
+ * @example github.com
881
+ */
882
+ site?: components["parameters"]["SiteQuery"];
883
+ /**
884
+ * @description Maximum organic results to return (1–100). Ads may be returned in addition.
885
+ * @example 10
886
+ */
887
+ limit?: components["parameters"]["LimitQuery"];
888
+ /**
889
+ * @description Pagination offset (must be >= 0).
890
+ * @example 20
891
+ */
892
+ start?: components["parameters"]["StartQuery"];
893
+ /** @description Duplicate filtering flag (primarily used by Google parser behavior). */
894
+ filter?: components["parameters"]["FilterQuery"];
895
+ /** @description Include answer box style results when supported. */
896
+ answers?: components["parameters"]["AnswersQuery"];
897
+ /** @description Output format. `json` (default) returns the envelope. `markdown` returns a Markdown document suitable for Slack/email. `text` returns a minimal plain-text block optimised for LLM context windows. `ndjson` returns one result object per line with no envelope. The `Accept` header is also checked (`text/markdown`, `text/plain`, `application/x-ndjson`). */
898
+ format?: components["parameters"]["FormatQuery"];
899
+ };
900
+ header?: {
901
+ /** @description Request-scoped proxy override. Use `direct` to disable proxy or a tag name to force a specific proxy pool. */
902
+ "X-Use-Proxy"?: components["parameters"]["UseProxyHeader"];
903
+ /**
904
+ * @description Per-request proxy URL supplied by an upstream balancer. Honored only when `proxies.allow_request_proxy_url: true` is set on the worker; otherwise the request is rejected with `400 bad_request` and `reason=REQUEST_PROXY_URL_DISABLED`. Authenticated SOCKS proxies are rejected in browser mode (`reason=UNSUPPORTED_PROXY_SCHEME`). Credentials are never logged or returned. Precedence: `X-Use-Proxy: direct` > `X-Proxy-URL` > `X-Use-Proxy: <tag>` > per-engine configured tag > `proxies.global` > direct.
905
+ * @example http://user:pass@proxy.example:8080
906
+ */
907
+ "X-Proxy-URL"?: components["parameters"]["ProxyURLHeader"];
908
+ /**
909
+ * @description Two-letter market country code for the supplied proxy. Used as part of the cache key so different markets do not share results.
910
+ * @example us
911
+ */
912
+ "X-Proxy-Country"?: components["parameters"]["ProxyCountryHeader"];
913
+ /**
914
+ * @description Proxy class identifier (e.g. `datacenter`, `residential`, `mobile`). Part of the cache key.
915
+ * @example residential
916
+ */
917
+ "X-Proxy-Class"?: components["parameters"]["ProxyClassHeader"];
918
+ /**
919
+ * @description Upstream proxy provider identifier (e.g. `webshare`, `brightdata`). Part of the cache key.
920
+ * @example webshare
921
+ */
922
+ "X-Proxy-Provider"?: components["parameters"]["ProxyProviderHeader"];
923
+ /**
924
+ * @description Sticky session identifier minted by the balancer. Reusing the same value lets OpenSERP reuse cookies and browser profile for that lane. Lanes are LRU-bounded by `proxies.lanes.max_lanes`. Rotating the session ID gives a clean lane.
925
+ * @example sid-123
926
+ */
927
+ "X-Proxy-Session-ID"?: components["parameters"]["ProxySessionIDHeader"];
928
+ /** @description Optional tenant scope used to namespace sticky lane state across multi-tenant deployments. When present, lanes are keyed by `tenant + engine + session_id`. */
929
+ "X-Tenant"?: components["parameters"]["TenantHeader"];
930
+ };
931
+ path: {
932
+ /** @description Search engine endpoint alias (`duck` is DuckDuckGo). */
933
+ engine: components["parameters"]["EnginePath"];
934
+ };
935
+ cookie?: never;
936
+ };
937
+ requestBody?: never;
938
+ responses: {
939
+ /** @description Search results envelope */
940
+ 200: {
941
+ headers: {
942
+ "X-Request-ID": components["headers"]["XRequestID"];
943
+ "X-Cache": components["headers"]["XCache"];
944
+ "X-Fallback-Engine": components["headers"]["XFallbackEngine"];
945
+ "X-Proxy-Mode": components["headers"]["XProxyMode"];
946
+ "X-Proxy-Tag": components["headers"]["XProxyTag"];
947
+ "X-Proxy-Used": components["headers"]["XProxyUsed"];
948
+ "X-Network-Bytes": components["headers"]["XNetworkBytes"];
949
+ "X-Browser-Profile-Id": components["headers"]["XBrowserProfileID"];
950
+ [name: string]: unknown;
951
+ };
952
+ content: {
953
+ "application/json": components["schemas"]["SearchEnvelope"];
954
+ "text/markdown": string;
955
+ "text/plain": string;
956
+ "application/x-ndjson": string;
957
+ };
958
+ };
959
+ 400: components["responses"]["BadRequestError"];
960
+ 403: components["responses"]["ForbiddenError"];
961
+ 404: components["responses"]["NotFoundError"];
962
+ 429: components["responses"]["TooManyRequestsError"];
963
+ 500: components["responses"]["InternalServerError"];
964
+ 502: components["responses"]["BadGatewayError"];
965
+ 503: components["responses"]["ServiceUnavailableError"];
966
+ 504: components["responses"]["GatewayTimeoutError"];
967
+ };
968
+ };
969
+ searchImages: {
970
+ parameters: {
971
+ query?: {
972
+ /**
973
+ * @description Search query text. At least one of `text`, `site`, or `file` must be non-empty.
974
+ * @example golang
975
+ */
976
+ text?: components["parameters"]["TextQuery"];
977
+ /**
978
+ * @description Language code (engine-specific behavior).
979
+ * @example EN
980
+ */
981
+ lang?: components["parameters"]["LangQuery"];
982
+ /** @description Market/location hint. Yandex accepts numeric `lr` region IDs such as `213`; Google, Bing, and DuckDuckGo use country/locale-style hints such as `RU`, `US`, or `en-GB` where supported. */
983
+ region?: components["parameters"]["RegionQuery"];
984
+ /**
985
+ * @description Date interval in `YYYYMMDD..YYYYMMDD` format.
986
+ * @example 20250101..20250131
987
+ */
988
+ date?: components["parameters"]["DateQuery"];
989
+ /**
990
+ * @description File extension filter (for engines that support it).
991
+ * @example PDF
992
+ */
993
+ file?: components["parameters"]["FileQuery"];
994
+ /**
995
+ * @description Site/domain filter.
996
+ * @example github.com
997
+ */
998
+ site?: components["parameters"]["SiteQuery"];
999
+ /**
1000
+ * @description Maximum organic results to return (1–100). Ads may be returned in addition.
1001
+ * @example 10
1002
+ */
1003
+ limit?: components["parameters"]["LimitQuery"];
1004
+ /**
1005
+ * @description Pagination offset (must be >= 0).
1006
+ * @example 20
1007
+ */
1008
+ start?: components["parameters"]["StartQuery"];
1009
+ /** @description Duplicate filtering flag (primarily used by Google parser behavior). */
1010
+ filter?: components["parameters"]["FilterQuery"];
1011
+ /** @description Include answer box style results when supported. */
1012
+ answers?: components["parameters"]["AnswersQuery"];
1013
+ /** @description Output format. `json` (default) returns the envelope. `markdown` returns a Markdown document suitable for Slack/email. `text` returns a minimal plain-text block optimised for LLM context windows. `ndjson` returns one result object per line with no envelope. The `Accept` header is also checked (`text/markdown`, `text/plain`, `application/x-ndjson`). */
1014
+ format?: components["parameters"]["FormatQuery"];
1015
+ };
1016
+ header?: {
1017
+ /** @description Request-scoped proxy override. Use `direct` to disable proxy or a tag name to force a specific proxy pool. */
1018
+ "X-Use-Proxy"?: components["parameters"]["UseProxyHeader"];
1019
+ /**
1020
+ * @description Per-request proxy URL supplied by an upstream balancer. Honored only when `proxies.allow_request_proxy_url: true` is set on the worker; otherwise the request is rejected with `400 bad_request` and `reason=REQUEST_PROXY_URL_DISABLED`. Authenticated SOCKS proxies are rejected in browser mode (`reason=UNSUPPORTED_PROXY_SCHEME`). Credentials are never logged or returned. Precedence: `X-Use-Proxy: direct` > `X-Proxy-URL` > `X-Use-Proxy: <tag>` > per-engine configured tag > `proxies.global` > direct.
1021
+ * @example http://user:pass@proxy.example:8080
1022
+ */
1023
+ "X-Proxy-URL"?: components["parameters"]["ProxyURLHeader"];
1024
+ /**
1025
+ * @description Two-letter market country code for the supplied proxy. Used as part of the cache key so different markets do not share results.
1026
+ * @example us
1027
+ */
1028
+ "X-Proxy-Country"?: components["parameters"]["ProxyCountryHeader"];
1029
+ /**
1030
+ * @description Proxy class identifier (e.g. `datacenter`, `residential`, `mobile`). Part of the cache key.
1031
+ * @example residential
1032
+ */
1033
+ "X-Proxy-Class"?: components["parameters"]["ProxyClassHeader"];
1034
+ /**
1035
+ * @description Upstream proxy provider identifier (e.g. `webshare`, `brightdata`). Part of the cache key.
1036
+ * @example webshare
1037
+ */
1038
+ "X-Proxy-Provider"?: components["parameters"]["ProxyProviderHeader"];
1039
+ /**
1040
+ * @description Sticky session identifier minted by the balancer. Reusing the same value lets OpenSERP reuse cookies and browser profile for that lane. Lanes are LRU-bounded by `proxies.lanes.max_lanes`. Rotating the session ID gives a clean lane.
1041
+ * @example sid-123
1042
+ */
1043
+ "X-Proxy-Session-ID"?: components["parameters"]["ProxySessionIDHeader"];
1044
+ /** @description Optional tenant scope used to namespace sticky lane state across multi-tenant deployments. When present, lanes are keyed by `tenant + engine + session_id`. */
1045
+ "X-Tenant"?: components["parameters"]["TenantHeader"];
1046
+ };
1047
+ path: {
1048
+ /** @description Search engine endpoint alias (`duck` is DuckDuckGo). */
1049
+ engine: components["parameters"]["EnginePath"];
1050
+ };
1051
+ cookie?: never;
1052
+ };
1053
+ requestBody?: never;
1054
+ responses: {
1055
+ /** @description Image search results envelope */
1056
+ 200: {
1057
+ headers: {
1058
+ "X-Request-ID": components["headers"]["XRequestID"];
1059
+ "X-Cache": components["headers"]["XCache"];
1060
+ "X-Fallback-Engine": components["headers"]["XFallbackEngine"];
1061
+ "X-Proxy-Mode": components["headers"]["XProxyMode"];
1062
+ "X-Proxy-Tag": components["headers"]["XProxyTag"];
1063
+ "X-Proxy-Used": components["headers"]["XProxyUsed"];
1064
+ "X-Network-Bytes": components["headers"]["XNetworkBytes"];
1065
+ "X-Browser-Profile-Id": components["headers"]["XBrowserProfileID"];
1066
+ [name: string]: unknown;
1067
+ };
1068
+ content: {
1069
+ "application/json": components["schemas"]["ImageEnvelope"];
1070
+ };
1071
+ };
1072
+ 400: components["responses"]["BadRequestError"];
1073
+ 403: components["responses"]["ForbiddenError"];
1074
+ 404: components["responses"]["NotFoundError"];
1075
+ 429: components["responses"]["TooManyRequestsError"];
1076
+ 500: components["responses"]["InternalServerError"];
1077
+ 502: components["responses"]["BadGatewayError"];
1078
+ 503: components["responses"]["ServiceUnavailableError"];
1079
+ 504: components["responses"]["GatewayTimeoutError"];
1080
+ };
1081
+ };
1082
+ parseGoogleHTML: {
1083
+ parameters: {
1084
+ query?: {
1085
+ /** @description Output format. `json` (default) returns the envelope. `markdown` returns a Markdown document suitable for Slack/email. `text` returns a minimal plain-text block optimised for LLM context windows. `ndjson` returns one result object per line with no envelope. The `Accept` header is also checked (`text/markdown`, `text/plain`, `application/x-ndjson`). */
1086
+ format?: components["parameters"]["FormatQuery"];
1087
+ };
1088
+ header?: never;
1089
+ path?: never;
1090
+ cookie?: never;
1091
+ };
1092
+ requestBody: {
1093
+ content: {
1094
+ "text/html": string;
1095
+ };
1096
+ };
1097
+ responses: {
1098
+ /** @description Parsed search results envelope */
1099
+ 200: {
1100
+ headers: {
1101
+ [name: string]: unknown;
1102
+ };
1103
+ content: {
1104
+ "application/json": components["schemas"]["SearchEnvelope"];
1105
+ "text/markdown": string;
1106
+ "text/plain": string;
1107
+ "application/x-ndjson": string;
1108
+ };
1109
+ };
1110
+ 400: components["responses"]["BadRequestError"];
1111
+ 500: components["responses"]["InternalServerError"];
1112
+ };
1113
+ };
1114
+ parseBingHTML: {
1115
+ parameters: {
1116
+ query?: {
1117
+ /** @description Output format. `json` (default) returns the envelope. `markdown` returns a Markdown document suitable for Slack/email. `text` returns a minimal plain-text block optimised for LLM context windows. `ndjson` returns one result object per line with no envelope. The `Accept` header is also checked (`text/markdown`, `text/plain`, `application/x-ndjson`). */
1118
+ format?: components["parameters"]["FormatQuery"];
1119
+ };
1120
+ header?: never;
1121
+ path?: never;
1122
+ cookie?: never;
1123
+ };
1124
+ requestBody: {
1125
+ content: {
1126
+ "text/html": string;
1127
+ };
1128
+ };
1129
+ responses: {
1130
+ /** @description Parsed search results envelope */
1131
+ 200: {
1132
+ headers: {
1133
+ [name: string]: unknown;
1134
+ };
1135
+ content: {
1136
+ "application/json": components["schemas"]["SearchEnvelope"];
1137
+ "text/markdown": string;
1138
+ "text/plain": string;
1139
+ "application/x-ndjson": string;
1140
+ };
1141
+ };
1142
+ 400: components["responses"]["BadRequestError"];
1143
+ 500: components["responses"]["InternalServerError"];
1144
+ };
1145
+ };
1146
+ megaSearch: {
1147
+ parameters: {
1148
+ query?: {
1149
+ /**
1150
+ * @description Search query text. At least one of `text`, `site`, or `file` must be non-empty.
1151
+ * @example golang
1152
+ */
1153
+ text?: components["parameters"]["TextQuery"];
1154
+ /**
1155
+ * @description Language code (engine-specific behavior).
1156
+ * @example EN
1157
+ */
1158
+ lang?: components["parameters"]["LangQuery"];
1159
+ /** @description Market/location hint. Yandex accepts numeric `lr` region IDs such as `213`; Google, Bing, and DuckDuckGo use country/locale-style hints such as `RU`, `US`, or `en-GB` where supported. */
1160
+ region?: components["parameters"]["RegionQuery"];
1161
+ /**
1162
+ * @description Date interval in `YYYYMMDD..YYYYMMDD` format.
1163
+ * @example 20250101..20250131
1164
+ */
1165
+ date?: components["parameters"]["DateQuery"];
1166
+ /**
1167
+ * @description File extension filter (for engines that support it).
1168
+ * @example PDF
1169
+ */
1170
+ file?: components["parameters"]["FileQuery"];
1171
+ /**
1172
+ * @description Site/domain filter.
1173
+ * @example github.com
1174
+ */
1175
+ site?: components["parameters"]["SiteQuery"];
1176
+ /**
1177
+ * @description Maximum organic results to return (1–100). Ads may be returned in addition.
1178
+ * @example 10
1179
+ */
1180
+ limit?: components["parameters"]["LimitQuery"];
1181
+ /**
1182
+ * @description Pagination offset (must be >= 0).
1183
+ * @example 20
1184
+ */
1185
+ start?: components["parameters"]["StartQuery"];
1186
+ /** @description Duplicate filtering flag (primarily used by Google parser behavior). */
1187
+ filter?: components["parameters"]["FilterQuery"];
1188
+ /** @description Include answer box style results when supported. */
1189
+ answers?: components["parameters"]["AnswersQuery"];
1190
+ /**
1191
+ * @description Comma-separated engine list for mega endpoints. If omitted, all available engines are used.
1192
+ * @example google,bing,duckduckgo
1193
+ */
1194
+ engines?: components["parameters"]["EnginesQuery"];
1195
+ /** @description Mega execution mode. `balanced` (default) runs all selected engines in parallel. `any` runs selected engines sequentially in request order until first success. `fast` runs only one engine: the fastest by circuit-breaker average response time. */
1196
+ mode?: components["parameters"]["MegaModeQuery"];
1197
+ /** @description Enable deduplication by normalized URL. Default `true`. */
1198
+ dedupe?: components["parameters"]["MegaDedupeQuery"];
1199
+ /** @description Merge results from all successful engines into one flat list. Default `true`. When `false`, only the first requested engine that returned results is kept. */
1200
+ merge?: components["parameters"]["MegaMergeQuery"];
1201
+ /** @description Output format. `json` (default) returns the envelope. `markdown` returns a Markdown document suitable for Slack/email. `text` returns a minimal plain-text block optimised for LLM context windows. `ndjson` returns one result object per line with no envelope. The `Accept` header is also checked (`text/markdown`, `text/plain`, `application/x-ndjson`). */
1202
+ format?: components["parameters"]["FormatQuery"];
1203
+ };
1204
+ header?: {
1205
+ /** @description Request-scoped proxy override. Use `direct` to disable proxy or a tag name to force a specific proxy pool. */
1206
+ "X-Use-Proxy"?: components["parameters"]["UseProxyHeader"];
1207
+ /**
1208
+ * @description Per-request proxy URL supplied by an upstream balancer. Honored only when `proxies.allow_request_proxy_url: true` is set on the worker; otherwise the request is rejected with `400 bad_request` and `reason=REQUEST_PROXY_URL_DISABLED`. Authenticated SOCKS proxies are rejected in browser mode (`reason=UNSUPPORTED_PROXY_SCHEME`). Credentials are never logged or returned. Precedence: `X-Use-Proxy: direct` > `X-Proxy-URL` > `X-Use-Proxy: <tag>` > per-engine configured tag > `proxies.global` > direct.
1209
+ * @example http://user:pass@proxy.example:8080
1210
+ */
1211
+ "X-Proxy-URL"?: components["parameters"]["ProxyURLHeader"];
1212
+ /**
1213
+ * @description Two-letter market country code for the supplied proxy. Used as part of the cache key so different markets do not share results.
1214
+ * @example us
1215
+ */
1216
+ "X-Proxy-Country"?: components["parameters"]["ProxyCountryHeader"];
1217
+ /**
1218
+ * @description Proxy class identifier (e.g. `datacenter`, `residential`, `mobile`). Part of the cache key.
1219
+ * @example residential
1220
+ */
1221
+ "X-Proxy-Class"?: components["parameters"]["ProxyClassHeader"];
1222
+ /**
1223
+ * @description Upstream proxy provider identifier (e.g. `webshare`, `brightdata`). Part of the cache key.
1224
+ * @example webshare
1225
+ */
1226
+ "X-Proxy-Provider"?: components["parameters"]["ProxyProviderHeader"];
1227
+ /**
1228
+ * @description Sticky session identifier minted by the balancer. Reusing the same value lets OpenSERP reuse cookies and browser profile for that lane. Lanes are LRU-bounded by `proxies.lanes.max_lanes`. Rotating the session ID gives a clean lane.
1229
+ * @example sid-123
1230
+ */
1231
+ "X-Proxy-Session-ID"?: components["parameters"]["ProxySessionIDHeader"];
1232
+ /** @description Optional tenant scope used to namespace sticky lane state across multi-tenant deployments. When present, lanes are keyed by `tenant + engine + session_id`. */
1233
+ "X-Tenant"?: components["parameters"]["TenantHeader"];
1234
+ };
1235
+ path?: never;
1236
+ cookie?: never;
1237
+ };
1238
+ requestBody?: never;
1239
+ responses: {
1240
+ /** @description Aggregated envelope with clusters */
1241
+ 200: {
1242
+ headers: {
1243
+ "X-Request-ID": components["headers"]["XRequestID"];
1244
+ "X-Cache": components["headers"]["XCache"];
1245
+ "X-Proxy-Mode": components["headers"]["XProxyMode"];
1246
+ "X-Proxy-Tag": components["headers"]["XProxyTag"];
1247
+ "X-Proxy-Used": components["headers"]["XProxyUsed"];
1248
+ "X-Network-Bytes": components["headers"]["XNetworkBytes"];
1249
+ "X-Browser-Profile-Id": components["headers"]["XBrowserProfileID"];
1250
+ [name: string]: unknown;
1251
+ };
1252
+ content: {
1253
+ "application/json": components["schemas"]["MegaSearchEnvelope"];
1254
+ "text/markdown": string;
1255
+ "text/plain": string;
1256
+ "application/x-ndjson": string;
1257
+ };
1258
+ };
1259
+ 400: components["responses"]["BadRequestError"];
1260
+ 403: components["responses"]["ForbiddenError"];
1261
+ 429: components["responses"]["TooManyRequestsError"];
1262
+ 500: components["responses"]["InternalServerError"];
1263
+ 502: components["responses"]["BadGatewayError"];
1264
+ 503: components["responses"]["ServiceUnavailableError"];
1265
+ 504: components["responses"]["GatewayTimeoutError"];
1266
+ };
1267
+ };
1268
+ megaImageSearch: {
1269
+ parameters: {
1270
+ query?: {
1271
+ /**
1272
+ * @description Search query text. At least one of `text`, `site`, or `file` must be non-empty.
1273
+ * @example golang
1274
+ */
1275
+ text?: components["parameters"]["TextQuery"];
1276
+ /**
1277
+ * @description Language code (engine-specific behavior).
1278
+ * @example EN
1279
+ */
1280
+ lang?: components["parameters"]["LangQuery"];
1281
+ /** @description Market/location hint. Yandex accepts numeric `lr` region IDs such as `213`; Google, Bing, and DuckDuckGo use country/locale-style hints such as `RU`, `US`, or `en-GB` where supported. */
1282
+ region?: components["parameters"]["RegionQuery"];
1283
+ /**
1284
+ * @description Date interval in `YYYYMMDD..YYYYMMDD` format.
1285
+ * @example 20250101..20250131
1286
+ */
1287
+ date?: components["parameters"]["DateQuery"];
1288
+ /**
1289
+ * @description File extension filter (for engines that support it).
1290
+ * @example PDF
1291
+ */
1292
+ file?: components["parameters"]["FileQuery"];
1293
+ /**
1294
+ * @description Site/domain filter.
1295
+ * @example github.com
1296
+ */
1297
+ site?: components["parameters"]["SiteQuery"];
1298
+ /**
1299
+ * @description Maximum organic results to return (1–100). Ads may be returned in addition.
1300
+ * @example 10
1301
+ */
1302
+ limit?: components["parameters"]["LimitQuery"];
1303
+ /**
1304
+ * @description Pagination offset (must be >= 0).
1305
+ * @example 20
1306
+ */
1307
+ start?: components["parameters"]["StartQuery"];
1308
+ /** @description Duplicate filtering flag (primarily used by Google parser behavior). */
1309
+ filter?: components["parameters"]["FilterQuery"];
1310
+ /** @description Include answer box style results when supported. */
1311
+ answers?: components["parameters"]["AnswersQuery"];
1312
+ /**
1313
+ * @description Comma-separated engine list for mega endpoints. If omitted, all available engines are used.
1314
+ * @example google,bing,duckduckgo
1315
+ */
1316
+ engines?: components["parameters"]["EnginesQuery"];
1317
+ /** @description Mega execution mode. `balanced` (default) runs all selected engines in parallel. `any` runs selected engines sequentially in request order until first success. `fast` runs only one engine: the fastest by circuit-breaker average response time. */
1318
+ mode?: components["parameters"]["MegaModeQuery"];
1319
+ /** @description Enable deduplication by normalized URL. Default `true`. */
1320
+ dedupe?: components["parameters"]["MegaDedupeQuery"];
1321
+ /** @description Merge results from all successful engines into one flat list. Default `true`. When `false`, only the first requested engine that returned results is kept. */
1322
+ merge?: components["parameters"]["MegaMergeQuery"];
1323
+ /** @description Output format. `json` (default) returns the envelope. `markdown` returns a Markdown document suitable for Slack/email. `text` returns a minimal plain-text block optimised for LLM context windows. `ndjson` returns one result object per line with no envelope. The `Accept` header is also checked (`text/markdown`, `text/plain`, `application/x-ndjson`). */
1324
+ format?: components["parameters"]["FormatQuery"];
1325
+ };
1326
+ header?: {
1327
+ /** @description Request-scoped proxy override. Use `direct` to disable proxy or a tag name to force a specific proxy pool. */
1328
+ "X-Use-Proxy"?: components["parameters"]["UseProxyHeader"];
1329
+ /**
1330
+ * @description Per-request proxy URL supplied by an upstream balancer. Honored only when `proxies.allow_request_proxy_url: true` is set on the worker; otherwise the request is rejected with `400 bad_request` and `reason=REQUEST_PROXY_URL_DISABLED`. Authenticated SOCKS proxies are rejected in browser mode (`reason=UNSUPPORTED_PROXY_SCHEME`). Credentials are never logged or returned. Precedence: `X-Use-Proxy: direct` > `X-Proxy-URL` > `X-Use-Proxy: <tag>` > per-engine configured tag > `proxies.global` > direct.
1331
+ * @example http://user:pass@proxy.example:8080
1332
+ */
1333
+ "X-Proxy-URL"?: components["parameters"]["ProxyURLHeader"];
1334
+ /**
1335
+ * @description Two-letter market country code for the supplied proxy. Used as part of the cache key so different markets do not share results.
1336
+ * @example us
1337
+ */
1338
+ "X-Proxy-Country"?: components["parameters"]["ProxyCountryHeader"];
1339
+ /**
1340
+ * @description Proxy class identifier (e.g. `datacenter`, `residential`, `mobile`). Part of the cache key.
1341
+ * @example residential
1342
+ */
1343
+ "X-Proxy-Class"?: components["parameters"]["ProxyClassHeader"];
1344
+ /**
1345
+ * @description Upstream proxy provider identifier (e.g. `webshare`, `brightdata`). Part of the cache key.
1346
+ * @example webshare
1347
+ */
1348
+ "X-Proxy-Provider"?: components["parameters"]["ProxyProviderHeader"];
1349
+ /**
1350
+ * @description Sticky session identifier minted by the balancer. Reusing the same value lets OpenSERP reuse cookies and browser profile for that lane. Lanes are LRU-bounded by `proxies.lanes.max_lanes`. Rotating the session ID gives a clean lane.
1351
+ * @example sid-123
1352
+ */
1353
+ "X-Proxy-Session-ID"?: components["parameters"]["ProxySessionIDHeader"];
1354
+ /** @description Optional tenant scope used to namespace sticky lane state across multi-tenant deployments. When present, lanes are keyed by `tenant + engine + session_id`. */
1355
+ "X-Tenant"?: components["parameters"]["TenantHeader"];
1356
+ };
1357
+ path?: never;
1358
+ cookie?: never;
1359
+ };
1360
+ requestBody?: never;
1361
+ responses: {
1362
+ /** @description Aggregated image results envelope */
1363
+ 200: {
1364
+ headers: {
1365
+ "X-Request-ID": components["headers"]["XRequestID"];
1366
+ "X-Cache": components["headers"]["XCache"];
1367
+ "X-Proxy-Mode": components["headers"]["XProxyMode"];
1368
+ "X-Proxy-Tag": components["headers"]["XProxyTag"];
1369
+ "X-Proxy-Used": components["headers"]["XProxyUsed"];
1370
+ "X-Network-Bytes": components["headers"]["XNetworkBytes"];
1371
+ "X-Browser-Profile-Id": components["headers"]["XBrowserProfileID"];
1372
+ [name: string]: unknown;
1373
+ };
1374
+ content: {
1375
+ "application/json": components["schemas"]["ImageEnvelope"];
1376
+ };
1377
+ };
1378
+ 400: components["responses"]["BadRequestError"];
1379
+ 403: components["responses"]["ForbiddenError"];
1380
+ 429: components["responses"]["TooManyRequestsError"];
1381
+ 500: components["responses"]["InternalServerError"];
1382
+ 502: components["responses"]["BadGatewayError"];
1383
+ 503: components["responses"]["ServiceUnavailableError"];
1384
+ 504: components["responses"]["GatewayTimeoutError"];
1385
+ };
1386
+ };
1387
+ listMegaEngines: {
1388
+ parameters: {
1389
+ query?: never;
1390
+ header?: never;
1391
+ path?: never;
1392
+ cookie?: never;
1393
+ };
1394
+ requestBody?: never;
1395
+ responses: {
1396
+ /** @description Engine list */
1397
+ 200: {
1398
+ headers: {
1399
+ [name: string]: unknown;
1400
+ };
1401
+ content: {
1402
+ "application/json": components["schemas"]["MegaEnginesResponse"];
1403
+ };
1404
+ };
1405
+ };
1406
+ };
1407
+ healthCheck: {
1408
+ parameters: {
1409
+ query?: never;
1410
+ header?: never;
1411
+ path?: never;
1412
+ cookie?: never;
1413
+ };
1414
+ requestBody?: never;
1415
+ responses: {
1416
+ /** @description Healthy or degraded service */
1417
+ 200: {
1418
+ headers: {
1419
+ [name: string]: unknown;
1420
+ };
1421
+ content: {
1422
+ "application/json": components["schemas"]["HealthStatus"];
1423
+ };
1424
+ };
1425
+ /** @description Unhealthy service */
1426
+ 503: {
1427
+ headers: {
1428
+ [name: string]: unknown;
1429
+ };
1430
+ content: {
1431
+ "application/json": components["schemas"]["HealthStatus"];
1432
+ };
1433
+ };
1434
+ };
1435
+ };
1436
+ readinessCheck: {
1437
+ parameters: {
1438
+ query?: never;
1439
+ header?: never;
1440
+ path?: never;
1441
+ cookie?: never;
1442
+ };
1443
+ requestBody?: never;
1444
+ responses: {
1445
+ /** @description Instance is ready */
1446
+ 200: {
1447
+ headers: {
1448
+ [name: string]: unknown;
1449
+ };
1450
+ content: {
1451
+ "application/json": components["schemas"]["ReadinessStatus"];
1452
+ };
1453
+ };
1454
+ /** @description Instance is draining */
1455
+ 503: {
1456
+ headers: {
1457
+ [name: string]: unknown;
1458
+ };
1459
+ content: {
1460
+ "application/json": components["schemas"]["ReadinessStatus"];
1461
+ };
1462
+ };
1463
+ };
1464
+ };
1465
+ getStats: {
1466
+ parameters: {
1467
+ query?: never;
1468
+ header?: never;
1469
+ path?: never;
1470
+ cookie?: never;
1471
+ };
1472
+ requestBody?: never;
1473
+ responses: {
1474
+ /** @description Runtime statistics */
1475
+ 200: {
1476
+ headers: {
1477
+ [name: string]: unknown;
1478
+ };
1479
+ content: {
1480
+ "application/json": components["schemas"]["StatsResponse"];
1481
+ };
1482
+ };
1483
+ };
1484
+ };
1485
+ getCacheStats: {
1486
+ parameters: {
1487
+ query?: never;
1488
+ header?: never;
1489
+ path?: never;
1490
+ cookie?: never;
1491
+ };
1492
+ requestBody?: never;
1493
+ responses: {
1494
+ /** @description Cache status */
1495
+ 200: {
1496
+ headers: {
1497
+ [name: string]: unknown;
1498
+ };
1499
+ content: {
1500
+ "application/json": components["schemas"]["CacheStats"];
1501
+ };
1502
+ };
1503
+ };
1504
+ };
1505
+ getProxyStats: {
1506
+ parameters: {
1507
+ query?: never;
1508
+ header?: never;
1509
+ path?: never;
1510
+ cookie?: never;
1511
+ };
1512
+ requestBody?: never;
1513
+ responses: {
1514
+ /** @description Proxy stats */
1515
+ 200: {
1516
+ headers: {
1517
+ [name: string]: unknown;
1518
+ };
1519
+ content: {
1520
+ "application/json": components["schemas"]["ProxyStats"];
1521
+ };
1522
+ };
1523
+ };
1524
+ };
1525
+ getCircuitBreakerStats: {
1526
+ parameters: {
1527
+ query?: never;
1528
+ header?: never;
1529
+ path?: never;
1530
+ cookie?: never;
1531
+ };
1532
+ requestBody?: never;
1533
+ responses: {
1534
+ /** @description Circuit breaker stats */
1535
+ 200: {
1536
+ headers: {
1537
+ [name: string]: unknown;
1538
+ };
1539
+ content: {
1540
+ "application/json": components["schemas"]["CircuitBreakerStatsResponse"];
1541
+ };
1542
+ };
1543
+ };
1544
+ };
1545
+ getOpenAPISpec: {
1546
+ parameters: {
1547
+ query?: never;
1548
+ header?: never;
1549
+ path?: never;
1550
+ cookie?: never;
1551
+ };
1552
+ requestBody?: never;
1553
+ responses: {
1554
+ /** @description OpenAPI YAML */
1555
+ 200: {
1556
+ headers: {
1557
+ [name: string]: unknown;
1558
+ };
1559
+ content: {
1560
+ "application/yaml": string;
1561
+ };
1562
+ };
1563
+ };
1564
+ };
1565
+ getSwaggerUI: {
1566
+ parameters: {
1567
+ query?: never;
1568
+ header?: never;
1569
+ path?: never;
1570
+ cookie?: never;
1571
+ };
1572
+ requestBody?: never;
1573
+ responses: {
1574
+ /** @description HTML page loading Swagger UI from CDN */
1575
+ 200: {
1576
+ headers: {
1577
+ [name: string]: unknown;
1578
+ };
1579
+ content: {
1580
+ "text/html": string;
1581
+ };
1582
+ };
1583
+ };
1584
+ };
1585
+ }
1586
+
1587
+ export type { $defs, components, operations, paths, webhooks };