fetchTransportfunctionno test imports itfunction fetchTransport(): TransportThe transport over fetch.
How the store reaches a service: a function from a request to an answer, so that the live network (fetch, which Bun and Node 26 both have) and a recorded or simulated service are the same to the client above it. An answer is the status, the headers in lower case and the bytes; a redirect is an answer and never followed (a bucket in another region is a finding, not a second request that is signed for the wrong host), and a connection that fails is the reason and not a thrown error.
import { fetchTransport } from "./transport.ts";
const send = fetchTransport();
// await send({ method: "GET", url: "http://127.0.0.1:9000/bucket/key", headers: {} }, { timeoutMs: 5000 });fetchTransportfunctionno test imports itfunction fetchTransport(): TransportThe transport over fetch.
HttpMethodtypeno test imports ittype HttpMethod = "GET" | "HEAD" | "PUT" | "DELETE";The methods the store uses.
HttpRequesttypetype HttpRequest = { readonly method: HttpMethod; readonly url: string; readonly headers: Readonly<Record<string, string>>; readonly body?: Uint8Array };A request to a service.
HttpResponsetypeno test imports ittype HttpResponse = { readonly status: number; readonly headers: Readonly<Record<string, string>>; readonly body: Uint8Array };What a service answered.
SendOptionstypeno test imports ittype SendOptions = { readonly timeoutMs: number };What a request is allowed.
Transporttypetype Transport = (request: HttpRequest, options: SendOptions) => Promise<Result<HttpResponse, string>>;The transport: an answer, or why there was none.