pathOffunctionfunction pathOf(words: readonly string[]): stringThe path of a command: /v1/ and its words.
The REST surface, as a skeleton (commons headless 0014-rest-surface): the OpenAPI 3.1 document of a program, generated from governance for the caller's tier. One path for each command that the tier may see, that may come through the rest channel and that is not for a person alone: GET for a command that only reads (its options are query parameters), POST for one that changes something (its options and operands are the JSON body); the operation says its effect, its tier and whether it is safe to repeat, and the same refusals as the tool server are the 403 and 409 of every operation.
Pure: a program, a tier and the facts of the API give a JSON value. There is no server here: the routing of a request to a command, the authentication of the caller (which gives the tier) and the transport are Planned (0014 Out of scope), and the document is what they will be held to.
import { pathOf } from "./openapi.ts";
pathOf(["server", "list"]); // "/v1/server/list"pathOffunctionfunction pathOf(words: readonly string[]): stringThe path of a command: /v1/ and its words.
operationIdfunctionfunction operationId(program: string, words: readonly string[]): stringThe identifier of an operation: the program's name and the words of the command joined by underscores.
exposedfunctionfunction exposed(p: Placed): booleanWhether a command is an operation: it may come through the rest channel and it is not for a person alone.
methodOffunctionfunction methodOf(p: Placed): "get" | "post"The method of an operation: GET where the command only reads, POST where it changes something.
REFUSAL_REASONSconstconst REFUSAL_REASONS: readonly string[]The reasons a call is refused, the same as the tool server's: a closed set a client may match on.
ApiInfotypeno test imports ittype ApiInfo = { readonly title?: string; readonly version?: string };What the document says of the API besides the commands.
openApiOffunctionfunction openApiOf(program: Program, tier: TierName, info?: ApiInfo): JsonThe OpenAPI 3.1 document of a program for a caller of a tier.