/** * SearchApi.io direct HTTP transport. * * Performs direct GETs against the SearchApi.io REST API * (`https://www.searchapi.io/api/v1`) with an * `Authorization: Bearer ` header — the key NEVER travels as a * query parameter. There is NO internal retry — shared execution owns * retry policy. Fetch and timers are injectable for tests. * * Structurally cloned from `providers/brave/client.ts`, simplified to * the Linkup shape (no retry-hint header parsing; SearchApi exposes no * rate-limit response headers to read). * * Failure taxonomy (SearchApi ERROR_HANDLING, locked): * 401 / 403 -> AuthError (never retry) * 402 -> QuotaError (never retry) * 408 / 504 -> TimeoutError (retryable by shared execution) * 422 -> ApiError 422 (never retry) * 429 -> ApiError 429 (retried by shared execution) * >= 500 / default -> ApiError status (retried by shared execution) * * Raw response bodies NEVER cross this module's error boundary — every * thrown message is a curated constant (NFR-006). * * Boundary rules (ARCHITECTURE.md §2): * - May import Adapter-local config and normalized errors. * - May import `ProviderQuotaFetch` from `providers/types.js`. * - Must NOT import command presentation, capability contracts, or * another Provider's Adapter. * - Must NOT perform response field normalization — the Adapter owns * that. This module declares Provider-native request params only. */ import type { ProviderQuotaFetch } from "../types.js"; /** Injectable transport dependencies (fetch, timers, env). */ export interface SearchApiTransportDeps { readonly fetch?: ProviderQuotaFetch; readonly setTimeout?: typeof setTimeout; readonly clearTimeout?: typeof clearTimeout; readonly env?: NodeJS.ProcessEnv; } /** * Provider-native search request query params (SearchApi API field * names). The Adapter maps the Provider-neutral `SearchControls` into * these before calling {@link fetchSearchApiSearch}; the transport * never imports a capability contract. Result-count projection is a * client-side concern owned by shared execution, so no count field * exists here. */ export interface SearchApiSearchParams { readonly engine?: string; readonly q?: string; readonly gl?: string; readonly time_period?: string; } export declare function resolveTimeoutMs(env: NodeJS.ProcessEnv): number; /** * Perform ONE GET against the SearchApi.io `/api/v1/search` endpoint. * No retry; no response body in public errors. Returns the parsed JSON * body (raw; the Adapter post-processes into normalized search * sources). * * `params` carries SearchApi-native API fields already mapped from * `SearchControls` by the Adapter (`engine`/`q`/`gl`/`time_period`). */ export declare function fetchSearchApiSearch(apiKey: string, params?: SearchApiSearchParams, deps?: SearchApiTransportDeps): Promise; /** * Perform ONE GET against the SearchApi.io `/api/v1/me` endpoint — the * account/subscription metadata probe used by the Quota and Diagnostics * Capabilities. Non-destructive: `/me` is not a search, so it consumes * no search credits. No retry; no response body in public errors. */ export declare function fetchSearchApiMe(apiKey: string, deps?: SearchApiTransportDeps): Promise; //# sourceMappingURL=client.d.ts.map