import type { DurationJson } from '@bufbuild/protobuf/wkt'; import type { HTTPRequestJson as ConfidentialHTTPRequestJson, HeaderValuesJson } from '../../../../generated/capabilities/networking/confidentialhttp/v1alpha/client_pb'; /** * Build an HTTPRequest JSON shape for the confidential-http capability. * * The proto defines `oneof body { string body_string = 3; bytes body_bytes = 8 }`, * so the JSON wire keys are `bodyString` / `bodyBytes` — never plain `body`. * Three mutually-exclusive ways to set the body, in order of preference: * * - `body` ergonomic; coerces by runtime type: * - `string` -> bodyString (verbatim) * - `Uint8Array` -> bodyBytes (base64) * - object -> JSON.stringify -> bodyString * (bigints as strings) * - `bodyString` pass-through to the canonical proto field * - `bodyBytes` `Uint8Array` is base64-encoded; a `string` is treated as * already-encoded base64 and passed through verbatim * * Supplying more than one of these fields throws — the underlying proto is a * oneof, so the call would otherwise be ambiguous. * * Headers can be passed in two ways: * - `headers`: flat record with single or repeated values, mapped onto the * `multiHeaders` shape under the hood. * - `multiHeaders`: native proto shape `{ [name]: { values: string[] } }` — * useful when forwarding headers already in canonical form. * * If both are supplied, `multiHeaders` is applied first and `headers` entries * merge on top per-name (replacing the values list for that name). */ export interface HttpRequestOptions { url: string; method?: string; body?: string | Uint8Array | object; bodyString?: string; bodyBytes?: Uint8Array | string; headers?: Record; multiHeaders?: Record; templateValues?: Record; timeout?: DurationJson; encryptOutput?: boolean; } export declare function httpRequest(opts: HttpRequestOptions): ConfidentialHTTPRequestJson;