/** * Internal HTTP transport. The only function in the SDK that touches * `fetch`. Every capability module calls this; consumers never see it * (not re-exported from `index.ts`). * * Contract: * - Throws `ApiError(status, message, body?)` on any non-2xx response. * The body is the server's JSON error envelope when parseable, else * the raw text. * - Returns `undefined` for 204 No Content. * - Accepts optional `body` (JSON-stringified) and `query` (URL-encoded). * - Auto-injects an `Idempotency-Key` header on every mutation * (POST / PUT / PATCH / DELETE) unless one is explicitly provided * or `idempotency: false` is set. See `RequestOptions.idempotencyKey`. */ import type { Client } from './client.js'; export interface RequestOptions { readonly body?: unknown; readonly query?: Readonly>; /** * Extra request headers for capability modules that need per-call scoping. * Undefined values are skipped so callers can pass optional selectors directly. */ readonly headers?: Readonly>; /** * Explicit Idempotency-Key. When omitted on a mutating method, the * SDK auto-generates a fresh UUID v4 per call so accidental * network-retries of the SAME SDK invocation are server-side * dedup'd (server middleware `idempotencyMiddleware` enforces). * * Pass an explicit key when: * - The caller wants cross-process retry safety (e.g. a CI script * re-running on retry must produce the same logical mutation). * - The caller is replaying the SAME deterministic operation and * expects the cached response. * * Pass `null` to opt out entirely (the server middleware no-ops on * absent header — this is the "I know what I'm doing" escape hatch * for endpoints that DO accept duplicate non-idempotent submissions * by design, e.g. usage-counter increments). */ readonly idempotencyKey?: string | null; } /** * Substitute `:param` tokens in a contract-sourced path with URL-encoded * values. Throws if any token is missing from `params` — the SDK should * never ship a request with an unfilled placeholder. * * interpolatePath('/projects/:id/domains/:domainId', { id: 'p', domainId: 'd' }) * → '/projects/p/domains/d' */ export declare function interpolatePath(path: string, params: Readonly>): string; export declare function request(client: Client, method: string, path: string, opts?: RequestOptions): Promise; //# sourceMappingURL=http.d.ts.map