The vault's seat definition keeps retire's class act (G) beside main's licence-put; the TypeScript contract is regenerated with join 9's seatgen (seatgen -check clean). Builds: design 47 G §610 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
132 lines
3.7 KiB
JavaScript
132 lines
3.7 KiB
JavaScript
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
|
|
|
// The contract of the seat "mesh-vault", defined whole (seats/mesh-vault/seat.json): The mesh's secrets. accept and move-asks, which no holder served and nothing called, are left out (ADR 0620 §3). The vault's own events stay under its own subjects (ADR 0620 §2).
|
|
|
|
export const seat = "mesh-vault";
|
|
|
|
export const verbs = {
|
|
get: "get",
|
|
secretAsk: "secret-ask",
|
|
issued: "issued",
|
|
rotate: "rotate",
|
|
moveIn: "move-in",
|
|
nodeKey: "node-key",
|
|
own: "own",
|
|
issueAccount: "issue-account",
|
|
sign: "sign",
|
|
enrolmentToken: "enrolment-token",
|
|
nodeAccount: "node-account",
|
|
rotateNode: "rotate-node",
|
|
nodeAccountConfirm: "node-account-confirm",
|
|
abandon: "abandon",
|
|
retire: "retire",
|
|
licencePut: "licence-put",
|
|
};
|
|
|
|
export const holderEvents = {
|
|
provisioned: "provisioned",
|
|
rotated: "rotated",
|
|
secretChanged: "secret-changed",
|
|
accountHashed: "account-hashed",
|
|
ownReplaced: "own-replaced",
|
|
accountIssued: "account-issued",
|
|
signed: "signed",
|
|
rotationBegun: "rotation-begun",
|
|
nodeAccountReady: "node-account-ready",
|
|
rotationDone: "rotation-done",
|
|
ownRetired: "own-retired",
|
|
};
|
|
|
|
export function provisionedHolderSubject(holder) {
|
|
return "mesh.mod." + holder + ".event.provisioned";
|
|
}
|
|
|
|
export function rotatedHolderSubject(holder) {
|
|
return "mesh.mod." + holder + ".event.rotated";
|
|
}
|
|
|
|
export function secretChangedHolderSubject(holder) {
|
|
return "mesh.mod." + holder + ".event.secret-changed";
|
|
}
|
|
|
|
export function accountHashedHolderSubject(holder) {
|
|
return "mesh.mod." + holder + ".event.account-hashed";
|
|
}
|
|
|
|
export function ownReplacedHolderSubject(holder) {
|
|
return "mesh.mod." + holder + ".event.own-replaced";
|
|
}
|
|
|
|
export function accountIssuedHolderSubject(holder) {
|
|
return "mesh.mod." + holder + ".event.account-issued";
|
|
}
|
|
|
|
export function signedHolderSubject(holder) {
|
|
return "mesh.mod." + holder + ".event.signed";
|
|
}
|
|
|
|
export function rotationBegunHolderSubject(holder) {
|
|
return "mesh.mod." + holder + ".event.rotation-begun";
|
|
}
|
|
|
|
export function nodeAccountReadyHolderSubject(holder) {
|
|
return "mesh.mod." + holder + ".event.node-account-ready";
|
|
}
|
|
|
|
export function rotationDoneHolderSubject(holder) {
|
|
return "mesh.mod." + holder + ".event.rotation-done";
|
|
}
|
|
|
|
export function ownRetiredHolderSubject(holder) {
|
|
return "mesh.mod." + holder + ".event.own-retired";
|
|
}
|
|
|
|
export const states = {
|
|
signers: "signers",
|
|
nodeLogins: "node-logins",
|
|
};
|
|
|
|
/** The key of one value of the state signers under the form "key". */
|
|
export function signersByKeyKey() {
|
|
return "key";
|
|
}
|
|
|
|
/** The parts of a key of the form "key", or undefined for a key of another form. */
|
|
export function parseSignersByKeyKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("key")) return undefined;
|
|
_rest = _rest.slice(3);
|
|
if (_rest !== "") return undefined;
|
|
return { };
|
|
}
|
|
|
|
/** The key of one value of the state signers under the form "authority". */
|
|
export function signersByAuthorityKey() {
|
|
return "authority";
|
|
}
|
|
|
|
/** The parts of a key of the form "authority", or undefined for a key of another form. */
|
|
export function parseSignersByAuthorityKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("authority")) return undefined;
|
|
_rest = _rest.slice(9);
|
|
if (_rest !== "") return undefined;
|
|
return { };
|
|
}
|
|
|
|
/** The key of one value of the state node-logins under the form "<node>". */
|
|
export function nodeLoginsByNodeKey(node) {
|
|
return node;
|
|
}
|
|
|
|
/** The parts of a key of the form "<node>", or undefined for a key of another form. */
|
|
export function parseNodeLoginsByNodeKey(_key) {
|
|
let _rest = _key;
|
|
if (_rest === "") return undefined;
|
|
const node = _rest;
|
|
_rest = "";
|
|
if (_rest !== "") return undefined;
|
|
return { node };
|
|
}
|
|
|