approval-carried.<repository>.<pull> is kept 90 days; pins-stated has the keep of pinned, which is the seat's family. Builds: design 47 G §542, §579, §652 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
177 lines
5.6 KiB
JavaScript
177 lines
5.6 KiB
JavaScript
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
|
|
|
// The contract of the seat "mesh-delivery", defined whole (seats/mesh-delivery/seat.json): The delivery gate: reads and steers deliveries, merges and the checks that decide them; the merge is made on the operator's Approve once both checks passed.
|
|
|
|
export const seat = "mesh-delivery";
|
|
|
|
export const verbs = {
|
|
deliveries: "deliveries",
|
|
show: "show",
|
|
groups: "groups",
|
|
source: "source",
|
|
stalled: "stalled",
|
|
recovery: "recovery",
|
|
};
|
|
|
|
export const events = {
|
|
owed: "owed",
|
|
pinned: "pinned",
|
|
freed: "freed",
|
|
headsReplaced: "heads-replaced",
|
|
recordOpened: "record-opened",
|
|
recordEnded: "record-ended",
|
|
filling: "filling",
|
|
full: "full",
|
|
room: "room",
|
|
sourceMoved: "source-moved",
|
|
recoveryMerged: "recovery-merged",
|
|
approvalCarried: "approval-carried",
|
|
pinsStated: "pins-stated",
|
|
};
|
|
|
|
export const family = { name: "mesh-delivery.events", maxAgeDays: 7 };
|
|
|
|
export const owedStream = "SEAT_mesh-delivery_owed";
|
|
|
|
export function owedSubject(repository, number) {
|
|
return "mesh.seat.mesh-delivery.event.owed." + repository + "." + number;
|
|
}
|
|
|
|
export const owedSubjectAll = "mesh.seat.mesh-delivery.event.owed.*.*";
|
|
|
|
export const pinnedSubject = "mesh.seat.mesh-delivery.event.pinned";
|
|
|
|
export const freedSubject = "mesh.seat.mesh-delivery.event.freed";
|
|
|
|
export const headsReplacedSubject = "mesh.seat.mesh-delivery.event.heads-replaced";
|
|
|
|
export const recordOpenedSubject = "mesh.seat.mesh-delivery.event.record-opened";
|
|
|
|
export const recordEndedSubject = "mesh.seat.mesh-delivery.event.record-ended";
|
|
|
|
export const fillingSubject = "mesh.seat.mesh-delivery.event.filling";
|
|
|
|
export const fullSubject = "mesh.seat.mesh-delivery.event.full";
|
|
|
|
export const roomSubject = "mesh.seat.mesh-delivery.event.room";
|
|
|
|
export function sourceMovedSubject(branch) {
|
|
return "mesh.seat.mesh-delivery.event.source-moved." + branch;
|
|
}
|
|
|
|
export const sourceMovedSubjectAll = "mesh.seat.mesh-delivery.event.source-moved.*";
|
|
|
|
export const recoveryMergedSubject = "mesh.seat.mesh-delivery.event.recovery-merged";
|
|
|
|
export const approvalCarriedStream = "SEAT_mesh-delivery_approval-carried";
|
|
|
|
export function approvalCarriedSubject(repository, pull) {
|
|
return "mesh.seat.mesh-delivery.event.approval-carried." + repository + "." + pull;
|
|
}
|
|
|
|
export const approvalCarriedSubjectAll = "mesh.seat.mesh-delivery.event.approval-carried.*.*";
|
|
|
|
export const pinsStatedSubject = "mesh.seat.mesh-delivery.event.pins-stated";
|
|
|
|
export const states = {
|
|
source: "source",
|
|
merges: "merges",
|
|
asks: "asks",
|
|
owed: "owed",
|
|
turns: "turns",
|
|
};
|
|
|
|
/** The key of one value of the state source under the form "<branch>". */
|
|
export function sourceByBranchKey(branch) {
|
|
return branch;
|
|
}
|
|
|
|
/** The parts of a key of the form "<branch>", or undefined for a key of another form. */
|
|
export function parseSourceByBranchKey(_key) {
|
|
let _rest = _key;
|
|
if (_rest === "") return undefined;
|
|
const branch = _rest;
|
|
_rest = "";
|
|
if (_rest !== "") return undefined;
|
|
return { branch };
|
|
}
|
|
|
|
/** The key of one value of the state merges under the form "<group>". */
|
|
export function mergesByGroupKey(group) {
|
|
return group;
|
|
}
|
|
|
|
/** The parts of a key of the form "<group>", or undefined for a key of another form. */
|
|
export function parseMergesByGroupKey(_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 asks under the form "merge.<group>.<heads>". */
|
|
export function asksByMergeGroupHeadsKey(group, heads) {
|
|
return "merge." + group + "." + heads;
|
|
}
|
|
|
|
/** The parts of a key of the form "merge.<group>.<heads>", or undefined for a key of another form. */
|
|
export function parseAsksByMergeGroupHeadsKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("merge.")) return undefined;
|
|
_rest = _rest.slice(6);
|
|
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 owed under the form "<repository>.<number>.<head>.<act>". */
|
|
export function owedByRepositoryNumberHeadActKey(repository, number, head, act) {
|
|
return repository + "." + number + "." + head + "." + act;
|
|
}
|
|
|
|
/** The parts of a key of the form "<repository>.<number>.<head>.<act>", or undefined for a key of another form. */
|
|
export function parseOwedByRepositoryNumberHeadActKey(_key) {
|
|
let _rest = _key;
|
|
const _at0 = _rest.indexOf(".");
|
|
if (_at0 <= 0) return undefined;
|
|
const repository = _rest.slice(0, _at0);
|
|
_rest = _rest.slice(_at0 + 1);
|
|
const _at2 = _rest.indexOf(".");
|
|
if (_at2 <= 0) return undefined;
|
|
const number = _rest.slice(0, _at2);
|
|
_rest = _rest.slice(_at2 + 1);
|
|
const _at4 = _rest.indexOf(".");
|
|
if (_at4 <= 0) return undefined;
|
|
const head = _rest.slice(0, _at4);
|
|
_rest = _rest.slice(_at4 + 1);
|
|
if (_rest === "") return undefined;
|
|
const act = _rest;
|
|
_rest = "";
|
|
if (_rest !== "") return undefined;
|
|
return { repository, number, head, act };
|
|
}
|
|
|
|
/** The key of one value of the state turns under the form "<repository>". */
|
|
export function turnsByRepositoryKey(repository) {
|
|
return repository;
|
|
}
|
|
|
|
/** The parts of a key of the form "<repository>", or undefined for a key of another form. */
|
|
export function parseTurnsByRepositoryKey(_key) {
|
|
let _rest = _key;
|
|
if (_rest === "") return undefined;
|
|
const repository = _rest;
|
|
_rest = "";
|
|
if (_rest !== "") return undefined;
|
|
return { repository };
|
|
}
|
|
|