/** * HTTP catalog transport for {@link HttpClient}. * * Posts JSON-RPC requests to the client's own `${baseUrl}/jsonrpc` endpoint * using the client's configured headers. Unlike the CLI's * {@link httpJsonRpcTransport}, this transport does not consult on-disk CLI * profiles or run lockfiles — a programmatic {@link HttpClient} is constructed * with an explicit `baseUrl` and headers, so connection resolution would be * wrong here. * * @module client/http-operations */ import type { CatalogTransport, ClientRestOperationBinding } from '../cli/operation-client-runtime.ts'; /** * Build a {@link CatalogTransport} that dispatches catalog operations as * JSON-RPC requests to a remote Weft server at `${baseUrl}/jsonrpc`. * * A JSON-RPC error envelope is surfaced as an {@link HttpClientError} so faults * reach callers through the same error type the ergonomic HTTP methods use. * * The JSON-RPC endpoint always responds with HTTP 200 — even for operation * faults — so the status for `HttpClientError` is taken from * `error.data.httpStatus` in the envelope rather than `response.status`. * Transport-level errors (405 Method Not Allowed, 415 Unsupported Media Type, * 413 Payload Too Large, auth short-circuits) return non-JSON bodies; * `response.json()` is wrapped in a try/catch to surface those as * `HttpClientError` rather than a raw `SyntaxError`. */ export declare function httpClientCatalogTransport(baseUrl: string, headers: Record): CatalogTransport; /** Route generated client operations over JSON-RPC or ordinary REST metadata. */ export declare function httpClientOperationTransport(baseUrl: string, headers: Record, restBindings: Readonly>): CatalogTransport;