Files
mesh-contracts/ts/seats/meshconfig/index.js
T
jschoubben b96e709d7c mesh-config seat: drop the state kept and the meshconfigclient (issue 1982; ADR 0681 §1, §6)
The mesh knows no pull request (design 47 G, G-1 §38-39), so mesh-config keeps no value held for one. The seat definition
loses the state kept, its fixtures and generated Go and TypeScript (seatgen), and the generated client package, which held
only the held values' key and decoder, goes with its artifact in module.json.

Builds: ADR 0681 §1 (nothing mesh-config records is a held value), §6 (no check reads a held value, so the seat keeps none and its generated client goes).

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-19 22:50:57 +01:00

62 lines
1.8 KiB
JavaScript

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "mesh-config", defined whole (seats/mesh-config/seat.json): The mesh's config values: read and set one, and the renames still open. mesh-config's own events stay under its own subjects (ADR 0620 §2).
export const seat = "mesh-config";
export const verbs = {
config: "config",
renames: "renames",
};
export const holderEvents = {
configChanged: "config-changed",
renamed: "renamed",
retiring: "retiring",
retired: "retired",
};
export function configChangedHolderSubject(holder) {
return "mesh.mod." + holder + ".event.config-changed";
}
export function renamedHolderSubject(holder) {
return "mesh.stream." + holder + ".event.renamed";
}
export function retiringHolderSubject(holder) {
return "mesh.stream." + holder + ".event.retiring";
}
export function retiredHolderSubject(holder) {
return "mesh.stream." + holder + ".event.retired";
}
export const states = {
resolved: "resolved",
};
/** The key of one value of the state resolved under the form "<node>.<module>.<key>". */
export function resolvedByNodeModuleKeyKey(node, module, key) {
return node + "." + module + "." + key;
}
/** The parts of a key of the form "<node>.<module>.<key>", or undefined for a key of another form. */
export function parseResolvedByNodeModuleKeyKey(_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 module = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
if (_rest === "") return undefined;
const key = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module, key };
}