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

82 lines
2.6 KiB
JavaScript

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "git", defined whole (seats/git/seat.json): The forge: every read and act a delivery part makes of the mesh's git repositories, and what the forge says happened (design 47 *The seat git*, ADR 0596 §1, §2). A failed read answers an error, never an empty answer. The act verbs are the forge bridge's alone.
export const seat = "git";
export const verbs = {
pull: "pull",
branch: "branch",
openPulls: "open-pulls",
tags: "tags",
trees: "trees",
file: "file",
contains: "contains",
statuses: "statuses",
status: "status",
comment: "comment",
view: "view",
note: "note",
mergePull: "merge-pull",
tag: "tag",
};
export const events = {
pullUpdated: "pull-updated",
pullMerged: "pull-merged",
pullClosed: "pull-closed",
forgePull: "forge-pull",
forgeStatus: "forge-status",
forgeDelete: "forge-delete",
repoWritable: "repo-writable",
branchMoved: "branch-moved",
};
export const family = { name: "git.events", maxAgeDays: 7 };
export const pullUpdatedSubject = "mesh.seat.git.event.pull-updated";
export const pullMergedSubject = "mesh.seat.git.event.pull-merged";
export const pullClosedSubject = "mesh.seat.git.event.pull-closed";
export const forgePullSubject = "mesh.seat.git.event.forge-pull";
export const forgeStatusSubject = "mesh.seat.git.event.forge-status";
export const forgeDeleteSubject = "mesh.seat.git.event.forge-delete";
export const repoWritableSubject = "mesh.seat.git.event.repo-writable";
export const branchMovedStream = "SEAT_git_branch-moved";
export const branchMovedSubject = "mesh.seat.git.event.branch-moved";
export const states = {
failedSteps: "failed-steps",
};
/** The key of one value of the state failed-steps under the form "<module>.<fingerprint>.<step>". */
export function failedStepsByModuleFingerprintStepKey(module, fingerprint, step) {
return module + "." + fingerprint + "." + step;
}
/** The parts of a key of the form "<module>.<fingerprint>.<step>", or undefined for a key of another form. */
export function parseFailedStepsByModuleFingerprintStepKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const module = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const fingerprint = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
if (_rest === "") return undefined;
const step = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { module, fingerprint, step };
}