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, documented 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 redirect is an answer for the client to judge, so that a bearer token is never sent to an address nobody checked), 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: "https://graph.microsoft.com/v1.0/me/drive/root", headers: {} }, { timeoutMs: 5000 });fetchTransportfunctionno test imports itfunction fetchTransport(): TransportThe transport over fetch.
HttpMethodtypeno test imports ittype HttpMethod = "GET" | "PUT" | "DELETE";The methods the store uses.
HttpRequesttypeno test imports ittype 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.
Transporttypeno test imports ittype Transport = (request: HttpRequest, options: SendOptions) => Promise<Result<HttpResponse, string>>;The transport: an answer, or why there was none.