// Code generated by seatgen from the seat definitions; DO NOT EDIT. // The contract of the seat "mesh-provisioner", defined whole (seats/mesh-provisioner/seat.json): The provisioner (ADR 0349): which domain answers which kind of placeholder, what each module needs, what is applied where. export const seat = "mesh-provisioner"; export const verbs = { provisioning: "provisioning", }; export const states = { plans: "plans", provisions: "provisions", }; /** The key of one value of the state plans under the form ".". */ export function plansByNodeModuleKey(node, module) { return node + "." + module; } /** The parts of a key of the form ".", or undefined for a key of another form. */ export function parsePlansByNodeModuleKey(_key) { 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 module = _rest; _rest = ""; if (_rest !== "") return undefined; return { node, module }; } /** The key of one value of the state provisions under the form "..". */ export function provisionsByNodeConsumerProvisionKey(node, consumer, provision) { return node + "." + consumer + "." + provision; } /** The parts of a key of the form "..", or undefined for a key of another form. */ export function parseProvisionsByNodeConsumerProvisionKey(_key) { let _rest = _key; const _at0 = _rest.indexOf("."); if (_at0 <= 0) return undefined; const node = _rest.slice(0, _at0); _rest = _rest.slice(_at0 + 1); const _at2 = _rest.indexOf("."); if (_at2 <= 0) return undefined; const consumer = _rest.slice(0, _at2); _rest = _rest.slice(_at2 + 1); if (_rest === "") return undefined; const provision = _rest; _rest = ""; if (_rest !== "") return undefined; return { node, consumer, provision }; } /** The key of one value of the state provisions under the form "...". */ export function provisionsByNodeConsumerProvisionLocalKey(node, consumer, provision, local) { return node + "." + consumer + "." + provision + "." + local; } /** The parts of a key of the form "...", or undefined for a key of another form. */ export function parseProvisionsByNodeConsumerProvisionLocalKey(_key) { let _rest = _key; const _at0 = _rest.indexOf("."); if (_at0 <= 0) return undefined; const node = _rest.slice(0, _at0); _rest = _rest.slice(_at0 + 1); const _at2 = _rest.indexOf("."); if (_at2 <= 0) return undefined; const consumer = _rest.slice(0, _at2); _rest = _rest.slice(_at2 + 1); const _at4 = _rest.indexOf("."); if (_at4 <= 0) return undefined; const provision = _rest.slice(0, _at4); _rest = _rest.slice(_at4 + 1); if (_rest === "") return undefined; const local = _rest; _rest = ""; if (_rest !== "") return undefined; return { node, consumer, provision, local }; }