Files
mesh-delivery/contracts/ts/seats/meshcatalog/index.js
T
jschoubben 72ac9b09cb CT11: regenerate the Go and TypeScript contracts from CT1 to CT9; each TypeScript contract as index.js with index.d.ts
Generated by seatgen (mesh-catalog, GEN1 and GEN2 on its worktree) from the
definitions of CT1 to CT9; module.json names the artifacts of the new seats
mesh-builds, mesh-pipeline-runner and git. seatgen -check is clean; every seat
package's generated fixture test passes.

Builds: design 47 G §341 (a TypeScript contract is emitted as index.js with
index.d.ts), §196, §339 (the generator refuses an unknown callers entry),
§260, §331.

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
2026-11-11 10:48:56 +01:00

360 lines
12 KiB
JavaScript

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "mesh-catalog", defined whole (seats/mesh-catalog/seat.json): The catalog of the mesh: every module the trunk holds with its manifest, fingerprint and verdict, the packages published, and the seat list (ADR 0636 §1, §4).
export const seat = "mesh-catalog";
export const verbs = {
modules: "modules",
module: "module",
provides: "provides",
dependents: "dependents",
seatDefinitions: "seat-definitions",
revision: "revision",
registrations: "registrations",
register: "register",
policy: "policy",
watch: "watch",
unwatch: "unwatch",
versions: "versions",
outdated: "outdated",
input: "input",
entry: "entry",
};
export const events = {
seatDefinitionChanged: "seat-definition-changed",
seatDefinitionRemoved: "seat-definition-removed",
manifestAccepted: "manifest-accepted",
manifestRefused: "manifest-refused",
catalogRevision: "catalog-revision",
filling: "filling",
full: "full",
room: "room",
registrationChanged: "registration-changed",
versionReleased: "version-released",
versionsFilled: "versions-filled",
};
export const family = { name: "mesh-catalog.events", maxAgeDays: 7 };
export const seatDefinitionChangedSubject = "mesh.seat.mesh-catalog.event.seat-definition-changed";
export const seatDefinitionRemovedSubject = "mesh.seat.mesh-catalog.event.seat-definition-removed";
export const manifestAcceptedSubject = "mesh.seat.mesh-catalog.event.manifest-accepted";
export const manifestRefusedSubject = "mesh.seat.mesh-catalog.event.manifest-refused";
export function catalogRevisionSubject(branch) {
return "mesh.seat.mesh-catalog.event.catalog-revision." + branch;
}
export const catalogRevisionSubjectAll = "mesh.seat.mesh-catalog.event.catalog-revision.*";
export const fillingSubject = "mesh.seat.mesh-catalog.event.filling";
export const fullSubject = "mesh.seat.mesh-catalog.event.full";
export const roomSubject = "mesh.seat.mesh-catalog.event.room";
export const registrationChangedStream = "SEAT_mesh-catalog_registration-changed";
export const registrationChangedSubject = "mesh.seat.mesh-catalog.event.registration-changed";
export const versionReleasedStream = "SEAT_mesh-catalog_version-released";
export const versionReleasedSubject = "mesh.seat.mesh-catalog.event.version-released";
export const versionsFilledStream = "SEAT_mesh-catalog_versions-filled";
export const versionsFilledSubject = "mesh.seat.mesh-catalog.event.versions-filled";
export const states = {
manifests: "manifests",
modules: "modules",
candidates: "candidates",
verdicts: "verdicts",
predefined: "predefined",
configCandidates: "config-candidates",
packages: "packages",
catalogRevisions: "catalog-revisions",
registrations: "registrations",
registrationHistory: "registration-history",
versions: "versions",
buildEdges: "build-edges",
inputs: "inputs",
};
/** The key of one value of the state manifests under the form "<digest>". */
export function manifestsByDigestKey(digest) {
return digest;
}
/** The parts of a key of the form "<digest>", or undefined for a key of another form. */
export function parseManifestsByDigestKey(_key) {
let _rest = _key;
if (_rest === "") return undefined;
const digest = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { digest };
}
/** The key of one value of the state modules under the form "<module>". */
export function modulesByModuleKey(module) {
return module;
}
/** The parts of a key of the form "<module>", or undefined for a key of another form. */
export function parseModulesByModuleKey(_key) {
let _rest = _key;
if (_rest === "") return undefined;
const module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { module };
}
/** The key of one value of the state candidates under the form "<group>". */
export function candidatesByGroupKey(group) {
return group;
}
/** The parts of a key of the form "<group>", or undefined for a key of another form. */
export function parseCandidatesByGroupKey(_key) {
let _rest = _key;
if (_rest === "") return undefined;
const group = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { group };
}
/** The key of one value of the state verdicts under the form "<digest>". */
export function verdictsByDigestKey(digest) {
return digest;
}
/** The parts of a key of the form "<digest>", or undefined for a key of another form. */
export function parseVerdictsByDigestKey(_key) {
let _rest = _key;
if (_rest === "") return undefined;
const digest = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { digest };
}
/** The key of one value of the state predefined under the form "list". */
export function predefinedByListKey() {
return "list";
}
/** The parts of a key of the form "list", or undefined for a key of another form. */
export function parsePredefinedByListKey(_key) {
let _rest = _key;
if (!_rest.startsWith("list")) return undefined;
_rest = _rest.slice(4);
if (_rest !== "") return undefined;
return { };
}
/** The key of one value of the state config-candidates under the form "<pull>". */
export function configCandidatesByPullKey(pull) {
return pull;
}
/** The parts of a key of the form "<pull>", or undefined for a key of another form. */
export function parseConfigCandidatesByPullKey(_key) {
let _rest = _key;
if (_rest === "") return undefined;
const pull = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { pull };
}
/** The key of one value of the state packages under the form "<module>". */
export function packagesByModuleKey(module) {
return module;
}
/** The parts of a key of the form "<module>", or undefined for a key of another form. */
export function parsePackagesByModuleKey(_key) {
let _rest = _key;
if (_rest === "") return undefined;
const module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { module };
}
/** The key of one value of the state packages under the form "<package>.<series>". */
export function packagesByPackageSeriesKey(packagePart, series) {
return packagePart + "." + series;
}
/** The parts of a key of the form "<package>.<series>", or undefined for a key of another form. */
export function parsePackagesByPackageSeriesKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const packagePart = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const series = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { packagePart, series };
}
/** The key of one value of the state catalog-revisions under the form "<branch>.<revision>". */
export function catalogRevisionsByBranchRevisionKey(branch, revision) {
return branch + "." + revision;
}
/** The parts of a key of the form "<branch>.<revision>", or undefined for a key of another form. */
export function parseCatalogRevisionsByBranchRevisionKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const branch = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const revision = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { branch, revision };
}
/** The key of one value of the state catalog-revisions under the form "candidate.<group>.<heads>". */
export function catalogRevisionsByCandidateGroupHeadsKey(group, heads) {
return "candidate." + group + "." + heads;
}
/** The parts of a key of the form "candidate.<group>.<heads>", or undefined for a key of another form. */
export function parseCatalogRevisionsByCandidateGroupHeadsKey(_key) {
let _rest = _key;
if (!_rest.startsWith("candidate.")) return undefined;
_rest = _rest.slice(10);
const _at1 = _rest.indexOf(".");
if (_at1 <= 0) return undefined;
const group = _rest.slice(0, _at1);
_rest = _rest.slice(_at1 + 1);
if (_rest === "") return undefined;
const heads = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { group, heads };
}
/** The key of one value of the state catalog-revisions under the form "entry.<digest>". */
export function catalogRevisionsByEntryDigestKey(digest) {
return "entry." + digest;
}
/** The parts of a key of the form "entry.<digest>", or undefined for a key of another form. */
export function parseCatalogRevisionsByEntryDigestKey(_key) {
let _rest = _key;
if (!_rest.startsWith("entry.")) return undefined;
_rest = _rest.slice(6);
if (_rest === "") return undefined;
const digest = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { digest };
}
/** The key of one value of the state registrations under the form "<module>". */
export function registrationsByModuleKey(module) {
return module;
}
/** The parts of a key of the form "<module>", or undefined for a key of another form. */
export function parseRegistrationsByModuleKey(_key) {
let _rest = _key;
if (_rest === "") return undefined;
const module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { module };
}
/** The key of one value of the state registration-history under the form "<module>.<version>". */
export function registrationHistoryByModuleVersionKey(module, version) {
return module + "." + version;
}
/** The parts of a key of the form "<module>.<version>", or undefined for a key of another form. */
export function parseRegistrationHistoryByModuleVersionKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const module = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const version = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { module, version };
}
/** The key of one value of the state versions under the form "<module>.<version>". */
export function versionsByModuleVersionKey(module, version) {
return module + "." + version;
}
/** The parts of a key of the form "<module>.<version>", or undefined for a key of another form. */
export function parseVersionsByModuleVersionKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const module = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const version = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { module, version };
}
/** The key of one value of the state build-edges under the form "<module>.<branch>". */
export function buildEdgesByModuleBranchKey(module, branch) {
return module + "." + branch;
}
/** The parts of a key of the form "<module>.<branch>", or undefined for a key of another form. */
export function parseBuildEdgesByModuleBranchKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const module = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const branch = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { module, branch };
}
/** The key of one value of the state inputs under the form "<time>.<digest>". */
export function inputsByTimeDigestKey(time, digest) {
return time + "." + digest;
}
/** The parts of a key of the form "<time>.<digest>", or undefined for a key of another form. */
export function parseInputsByTimeDigestKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const time = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
if (_rest === "") return undefined;
const digest = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { time, digest };
}