Files
mesh-delivery/contracts/ts/seats/nodebuildnode/src/index.ts
T

163 lines
5.9 KiB
TypeScript

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "node-build-node", defined whole (seats/node-build-node/seat.json): The Node build module on a node: it takes the asks of the builder and the checker, runs them as steps and answers.
import type * as buildStep from "./parts/build-step.js";
export const seat = "node-build-node";
export const verbs = {
current: "current",
pause: "pause",
resume: "resume",
} as const;
export const accepts = {
delivery: "delivery",
check: "check",
recheck: "recheck",
} as const;
export const deliverySubject = "mesh.seat.node-build-node.accept.delivery";
export const checkSubject = "mesh.seat.node-build-node.accept.check";
export const recheckSubject = "mesh.seat.node-build-node.accept.recheck";
export const states = {
steps: "steps",
pauses: "pauses",
toolchains: "toolchains",
} as const;
/** The key of one value of the state steps under the form "<node>.<id>". */
export function stepsByNodeIDKey(node: string, id: string): string {
return node + "." + id;
}
/** The parts of a key of the form "<node>.<id>", or undefined for a key of another form. */
export function parseStepsByNodeIDKey(_key: string): { node: string; id: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const id = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, id };
}
/** The key of one value of the state pauses under the form "paused.<node>". */
export function pausesByPausedNodeKey(node: string): string {
return "paused." + node;
}
/** The parts of a key of the form "paused.<node>", or undefined for a key of another form. */
export function parsePausesByPausedNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("paused.")) return undefined;
_rest = _rest.slice(7);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
/** The key of one value of the state pauses under the form "capacity.<node>". */
export function pausesByCapacityNodeKey(node: string): string {
return "capacity." + node;
}
/** The parts of a key of the form "capacity.<node>", or undefined for a key of another form. */
export function parsePausesByCapacityNodeKey(_key: string): { node: string } | undefined {
let _rest = _key;
if (!_rest.startsWith("capacity.")) return undefined;
_rest = _rest.slice(9);
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
/** The key of one value of the state toolchains under the form "<node>.<language>". */
export function toolchainsByNodeLanguageKey(node: string, language: string): string {
return node + "." + language;
}
/** The parts of a key of the form "<node>.<language>", or undefined for a key of another form. */
export function parseToolchainsByNodeLanguageKey(_key: string): { node: string; language: string } | undefined {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const language = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, language };
}
export type AskArtifact = buildStep.AskArtifact;
export type BuildAnswer = buildStep.BuildAnswer;
export type BuiltArtifact = buildStep.BuiltArtifact;
export type Capacity = buildStep.Capacity;
export type CheckAnswer = buildStep.CheckAnswer;
export type ComposeAnswer = buildStep.ComposeAnswer;
export type CurrentAnswer = buildStep.CurrentAnswer;
export type CurrentInput = buildStep.CurrentInput;
export type Fetch = buildStep.Fetch;
export type FetchAnswer = buildStep.FetchAnswer;
export type FetchBesideItem = buildStep.FetchBesideItem;
export type FetchPackage = buildStep.FetchPackage;
export type FetchRefusal = buildStep.FetchRefusal;
export type LevelAnswer = buildStep.LevelAnswer;
export type LevelAnswerDigest = buildStep.LevelAnswerDigest;
export type LevelAnswerDigestNeedsItem = buildStep.LevelAnswerDigestNeedsItem;
export type LevelAnswerDigestPackagesItem = buildStep.LevelAnswerDigestPackagesItem;
export type LevelAnswerKeptItem = buildStep.LevelAnswerKeptItem;
export type LevelAnswerUnmetItem = buildStep.LevelAnswerUnmetItem;
export type ModuleTree = buildStep.ModuleTree;
export type Pause = buildStep.Pause;
export type PauseAnswer = buildStep.PauseAnswer;
export type PauseInput = buildStep.PauseInput;
export type PlacedBeside = buildStep.PlacedBeside;
export type Program = buildStep.Program;
export type ResumeAnswer = buildStep.ResumeAnswer;
export type ResumeInput = buildStep.ResumeInput;
export type Step = buildStep.Step;
export type StepAsk = buildStep.StepAsk;
export type StepAskBuild = buildStep.StepAskBuild;
export type StepAskCheck = buildStep.StepAskCheck;
export type StepAskCompose = buildStep.StepAskCompose;
export type StepResult = buildStep.StepResult;
export type TakenVersion = buildStep.TakenVersion;
export type Toolchain = buildStep.Toolchain;
export type ToolchainUsed = buildStep.ToolchainUsed;
/** is the body of delivery. */
export type DeliveryAccept = StepAsk;
/** is the body of check. */
export type CheckAccept = StepAsk;
/** is the body of recheck. */
export type RecheckAccept = StepAsk;
/** is one value of the state steps under the key <node>.<id>. */
export type StepsByNodeIDValue = Step;
/** is one value of the state pauses under the key paused.<node>. */
export type PausesByPausedNodeValue = Pause;
/** is one value of the state pauses under the key capacity.<node>. */
export type PausesByCapacityNodeValue = Capacity;
/** is one value of the state toolchains under the key <node>.<language>. */
export type ToolchainsByNodeLanguageValue = Toolchain;