Files
mesh-delivery/contracts/ts/seats/containerimageregistry/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

85 lines
2.6 KiB
JavaScript

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "container-image-registry", defined whole (seats/container-image-registry/seat.json): The mesh's container images, in the one artifact store: the OCI distribution protocol's read side, an image's tags and mirroring an outside image.
export const seat = "container-image-registry";
export const verbs = {
publish: "publish",
publishPart: "publish-part",
versions: "versions",
remove: "remove",
mirror: "mirror",
tags: "tags",
hold: "hold",
release: "release",
list: "list",
};
export const events = {
published: "published",
refused: "refused",
removed: "removed",
kept: "kept",
held: "held",
released: "released",
};
export const family = { name: "container-image-registry.events", maxAgeDays: 7 };
export const publishedSubject = "mesh.seat.container-image-registry.event.published";
export const refusedSubject = "mesh.seat.container-image-registry.event.refused";
export const removedSubject = "mesh.seat.container-image-registry.event.removed";
export const keptSubject = "mesh.seat.container-image-registry.event.kept";
export const heldSubject = "mesh.seat.container-image-registry.event.held";
export const releasedSubject = "mesh.seat.container-image-registry.event.released";
export const states = {
holds: "holds",
windows: "windows",
};
/** The key of one value of the state holds under the form "<seat>.<name>.<digest>". */
export function holdsBySeatNameDigestKey(seat, name, digest) {
return seat + "." + name + "." + digest;
}
/** The parts of a key of the form "<seat>.<name>.<digest>", or undefined for a key of another form. */
export function parseHoldsBySeatNameDigestKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const seat = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const name = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
if (_rest === "") return undefined;
const digest = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { seat, name, digest };
}
/** The key of one value of the state windows under the form "<caller>". */
export function windowsByCallerKey(caller) {
return caller;
}
/** The parts of a key of the form "<caller>", or undefined for a key of another form. */
export function parseWindowsByCallerKey(_key) {
let _rest = _key;
if (_rest === "") return undefined;
const caller = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { caller };
}