IF Commons GitHub

physical/http

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-anyfs-githost-store FR-003, 0002-anyfs-githost-store FR-013, 0002-anyfs-githost-store FR-004

What the two clients of a host share: one request over a transport, with the token put in the one header the host reads it from, and the failures that mean the same on both (a token not accepted, a token that may not, a throttle, a host that failed) told as the problems of the API. The transport is a function from a request to an answer that never throws: a connection that fails is a value, and no redirect is followed by this code. No URL, header, detail or log line made here holds the token: every sentence passes through the redactor, and the token travels in its one header of its one request.

Source: commons/anyfs-githost/src/physical/http.ts

2 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

Calltypeno test imports it
type Call = (request: Request) => Promise<Result<Reply, ApiProblem>>;

A function from a request to an answer or why there is none.

makeCallerfunction
function makeCaller(options: CallerOptions): Call

A caller over a transport.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

Replytype
type Reply = { readonly status: number; readonly headers: Readonly<Record<string, string>>; readonly body: string };

One answer, whatever its status below 400 and the statuses a host's client reads itself.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

Requesttypeno test imports it
type Request = {
  readonly method: OutRequest["method"];
  readonly path: string;
  readonly query?: Readonly<Record<string, string>>;
  readonly json?: unknown;
};

One request: the method, the path from the base of the API, the query, and a JSON body.

Titles, headings, exports, tables, columns and requirements. Esc closes.