mesh-delivery-contracts: mesh-delivery-checker, mesh-delivery and mesh-catalog defined whole with their states; mesh-catalog serves seat-definitions and its two events (D-2, D-3, D-27, ADR 0634 §6, ADR 0635 §5, ADR 0636 §1; issue 1966)
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"lockfileVersion": 3,
|
||||
"name": "@novox/mesh-delivery-contracts-mesh-catalog",
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@novox/mesh-delivery-contracts-mesh-catalog",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
},
|
||||
"requires": true,
|
||||
"version": "0.1.0"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"description": "The contract of the seat mesh-catalog, generated from its definition.",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"files": [
|
||||
"src"
|
||||
],
|
||||
"name": "@novox/mesh-delivery-contracts-mesh-catalog",
|
||||
"type": "module",
|
||||
"types": "./src/index.ts",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
@@ -0,0 +1,430 @@
|
||||
// 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",
|
||||
} as const;
|
||||
|
||||
export const events = {
|
||||
seatDefinitionChanged: "seat-definition-changed",
|
||||
seatDefinitionRemoved: "seat-definition-removed",
|
||||
} as const;
|
||||
|
||||
export const family = { name: "mesh-catalog.events", maxAgeDays: 7 } as const;
|
||||
|
||||
export const seatDefinitionChangedSubject = "mesh.seat.mesh-catalog.event.seat-definition-changed";
|
||||
|
||||
export const seatDefinitionRemovedSubject = "mesh.seat.mesh-catalog.event.seat-definition-removed";
|
||||
|
||||
export const states = {
|
||||
manifests: "manifests",
|
||||
modules: "modules",
|
||||
candidates: "candidates",
|
||||
verdicts: "verdicts",
|
||||
predefined: "predefined",
|
||||
configCandidates: "config-candidates",
|
||||
packages: "packages",
|
||||
} as const;
|
||||
|
||||
/** The key of one value of the state manifests under the form "<digest>". */
|
||||
export function manifestsByDigestKey(digest: string): string {
|
||||
return digest;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<digest>", or undefined for a key of another form. */
|
||||
export function parseManifestsByDigestKey(key: string): { digest: string } | undefined {
|
||||
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: string): string {
|
||||
return module;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<module>", or undefined for a key of another form. */
|
||||
export function parseModulesByModuleKey(key: string): { module: string } | undefined {
|
||||
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: string): string {
|
||||
return group;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<group>", or undefined for a key of another form. */
|
||||
export function parseCandidatesByGroupKey(key: string): { group: string } | undefined {
|
||||
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: string): string {
|
||||
return digest;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<digest>", or undefined for a key of another form. */
|
||||
export function parseVerdictsByDigestKey(key: string): { digest: string } | undefined {
|
||||
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(): string {
|
||||
return "list";
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "list", or undefined for a key of another form. */
|
||||
export function parsePredefinedByListKey(key: string): { } | undefined {
|
||||
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: string): string {
|
||||
return pull;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<pull>", or undefined for a key of another form. */
|
||||
export function parseConfigCandidatesByPullKey(key: string): { pull: string } | undefined {
|
||||
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: string): string {
|
||||
return module;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<module>", or undefined for a key of another form. */
|
||||
export function parsePackagesByModuleKey(key: string): { module: string } | undefined {
|
||||
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: string, series: string): string {
|
||||
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: string): { packagePart: string; series: string } | undefined {
|
||||
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 };
|
||||
}
|
||||
|
||||
/** is what modules takes. */
|
||||
export interface ModulesInput {
|
||||
}
|
||||
|
||||
/** is what modules answers. */
|
||||
export type ModulesAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what module takes. */
|
||||
export interface ModuleInput {
|
||||
/** the module's name */
|
||||
"module": string;
|
||||
}
|
||||
|
||||
/** is what module answers. */
|
||||
export type ModuleAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what provides takes. */
|
||||
export interface ProvidesInput {
|
||||
/** the provision, such as postgres-database */
|
||||
"provision": string;
|
||||
}
|
||||
|
||||
/** is what provides answers. */
|
||||
export type ProvidesAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what dependents takes. */
|
||||
export interface DependentsInput {
|
||||
/** the module's name */
|
||||
"module": string;
|
||||
}
|
||||
|
||||
/** is what dependents answers. */
|
||||
export type DependentsAnswer = Record<string, unknown>;
|
||||
|
||||
/** is the body of the event seat-definition-changed. */
|
||||
export interface SeatDefinitionChangedEvent {
|
||||
"digest": string;
|
||||
"seat": string;
|
||||
/** trunk */
|
||||
"source": string;
|
||||
}
|
||||
|
||||
/** is the body of the event seat-definition-removed. */
|
||||
export interface SeatDefinitionRemovedEvent {
|
||||
"seat": string;
|
||||
}
|
||||
|
||||
/** is one value of the state manifests under the key <digest>. */
|
||||
export interface ManifestsByDigestValue {
|
||||
/** the manifest, UTF-8 JSON text */
|
||||
"manifest": string;
|
||||
"module": string;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
export interface ModulesByModuleValueInputs2 {
|
||||
"bases"?: string[];
|
||||
"builder"?: string;
|
||||
"contexts"?: Record<string, string>;
|
||||
"import-form"?: string;
|
||||
"imports"?: string[];
|
||||
"locks"?: Record<string, string>;
|
||||
"packages"?: string[];
|
||||
"paths"?: Record<string, string>;
|
||||
"tree": string;
|
||||
}
|
||||
|
||||
/** is one value of the state modules under the key <module>. */
|
||||
export interface ModulesByModuleValue {
|
||||
"commit": string;
|
||||
/** the old-form fingerprint */
|
||||
"fp"?: string;
|
||||
"fp-src"?: number;
|
||||
/** src2: fingerprint */
|
||||
"fp2"?: string;
|
||||
"inputs2"?: ModulesByModuleValueInputs2;
|
||||
/** manifest digest */
|
||||
"manifest"?: string;
|
||||
"needs"?: string[];
|
||||
"none"?: string;
|
||||
/** why it has none */
|
||||
"none2"?: string;
|
||||
"packages"?: Record<string, string>;
|
||||
"path"?: string;
|
||||
"paths"?: Record<string, string[]>;
|
||||
"problems"?: string[];
|
||||
"repository": string;
|
||||
/** the source revision */
|
||||
"src"?: number;
|
||||
"toolchains"?: Record<string, unknown>;
|
||||
"unknown"?: string[];
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
"verdict"?: string;
|
||||
"warnings"?: string[];
|
||||
}
|
||||
|
||||
export interface CandidatesByGroupValuePullsItemFpsValue {
|
||||
"fp2"?: string;
|
||||
"manifest"?: string;
|
||||
"none2"?: string;
|
||||
"packages"?: Record<string, string>;
|
||||
"paths"?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface CandidatesByGroupValuePullsItem {
|
||||
"fps"?: Record<string, CandidatesByGroupValuePullsItemFpsValue>;
|
||||
"head": string;
|
||||
"modules": string[];
|
||||
"number": number;
|
||||
"repository": string;
|
||||
}
|
||||
|
||||
/** is one value of the state candidates under the key <group>. */
|
||||
export interface CandidatesByGroupValue {
|
||||
/** the source revision it is read on */
|
||||
"base": number;
|
||||
"fpset"?: string;
|
||||
"group": string;
|
||||
"heads": string;
|
||||
"pulls": CandidatesByGroupValuePullsItem[];
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
/** is one value of the state verdicts under the key <digest>. */
|
||||
export interface VerdictsByDigestValue {
|
||||
/** when (RFC 3339 time) */
|
||||
"at"?: string;
|
||||
"judge"?: string;
|
||||
"module": string;
|
||||
"problems"?: string[];
|
||||
"state": string;
|
||||
"unknown"?: string[];
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
"warnings"?: string[];
|
||||
}
|
||||
|
||||
/** is one value of the state predefined under the key list. */
|
||||
export interface PredefinedByListValue {
|
||||
/** when (RFC 3339 time) */
|
||||
"at"?: string;
|
||||
"commit": string;
|
||||
/** the foundation's predefined list as kept */
|
||||
"list": unknown;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
export interface ConfigCandidatesByPullValueDeclaresValueValue {
|
||||
/** the default */
|
||||
"default": unknown;
|
||||
"description"?: string;
|
||||
/** the allowed values */
|
||||
"enum"?: unknown;
|
||||
"kind": string;
|
||||
"maximum"?: number;
|
||||
"minimum"?: number;
|
||||
"pattern"?: string;
|
||||
"predefined"?: string;
|
||||
"required"?: boolean;
|
||||
"runtime"?: boolean;
|
||||
"trusted"?: boolean;
|
||||
"type"?: string;
|
||||
"why": string;
|
||||
}
|
||||
|
||||
/** is one value of the state config-candidates under the key <pull>. */
|
||||
export interface ConfigCandidatesByPullValue {
|
||||
/** when (RFC 3339 time) */
|
||||
"at"?: string;
|
||||
/** module to key to declaration */
|
||||
"declares": Record<string, Record<string, ConfigCandidatesByPullValueDeclaresValueValue>>;
|
||||
"head": string;
|
||||
"pull": string;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
export interface PackagesByModuleValuePackagesItem {
|
||||
"digest": string;
|
||||
"package": string;
|
||||
}
|
||||
|
||||
/** is one value of the state packages under the key <module>. */
|
||||
export interface PackagesByModuleValue {
|
||||
/** when (RFC 3339 time) */
|
||||
"at"?: string;
|
||||
"commit": string;
|
||||
"dir"?: string;
|
||||
/** the Go module path */
|
||||
"module": string;
|
||||
"packages": PackagesByModuleValuePackagesItem[];
|
||||
"repository": string;
|
||||
/** digest of go.mod and go.sum */
|
||||
"requires"?: string;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
export interface PackagesByPackageSeriesValueNewestContentsPackagesItem {
|
||||
"digest": string;
|
||||
"package": string;
|
||||
}
|
||||
|
||||
export interface PackagesByPackageSeriesValueNewestContents {
|
||||
/** when (RFC 3339 time) */
|
||||
"at"?: string;
|
||||
"commit": string;
|
||||
"dir"?: string;
|
||||
/** the Go module path */
|
||||
"module": string;
|
||||
"packages": PackagesByPackageSeriesValueNewestContentsPackagesItem[];
|
||||
"repository": string;
|
||||
/** digest of go.mod and go.sum */
|
||||
"requires"?: string;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
export interface PackagesByPackageSeriesValueNewest {
|
||||
"commit"?: string;
|
||||
"contents"?: PackagesByPackageSeriesValueNewestContents;
|
||||
"digest"?: string;
|
||||
"fingerprint"?: string;
|
||||
"version": string;
|
||||
}
|
||||
|
||||
export interface PackagesByPackageSeriesValueNumberedContentsPackagesItem {
|
||||
"digest": string;
|
||||
"package": string;
|
||||
}
|
||||
|
||||
export interface PackagesByPackageSeriesValueNumberedContents {
|
||||
/** when (RFC 3339 time) */
|
||||
"at"?: string;
|
||||
"commit": string;
|
||||
"dir"?: string;
|
||||
/** the Go module path */
|
||||
"module": string;
|
||||
"packages": PackagesByPackageSeriesValueNumberedContentsPackagesItem[];
|
||||
"repository": string;
|
||||
/** digest of go.mod and go.sum */
|
||||
"requires"?: string;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
export interface PackagesByPackageSeriesValueNumbered {
|
||||
"commit"?: string;
|
||||
"contents"?: PackagesByPackageSeriesValueNumberedContents;
|
||||
"digest"?: string;
|
||||
"fingerprint"?: string;
|
||||
"version": string;
|
||||
}
|
||||
|
||||
/** is one value of the state packages under the key <package>.<series>. */
|
||||
export interface PackagesByPackageSeriesValue {
|
||||
/** when (RFC 3339 time) */
|
||||
"at"?: string;
|
||||
"go-module"?: string;
|
||||
"name": string;
|
||||
"newest"?: PackagesByPackageSeriesValueNewest;
|
||||
"numbered"?: PackagesByPackageSeriesValueNumbered;
|
||||
"package"?: string;
|
||||
"seat"?: string;
|
||||
"series": string;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"noEmit": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"lockfileVersion": 3,
|
||||
"name": "@novox/mesh-delivery-contracts-mesh-delivery",
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@novox/mesh-delivery-contracts-mesh-delivery",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
},
|
||||
"requires": true,
|
||||
"version": "0.1.0"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"description": "The contract of the seat mesh-delivery, generated from its definition.",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"files": [
|
||||
"src"
|
||||
],
|
||||
"name": "@novox/mesh-delivery-contracts-mesh-delivery",
|
||||
"type": "module",
|
||||
"types": "./src/index.ts",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
// 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",
|
||||
times: "times",
|
||||
show: "show",
|
||||
groups: "groups",
|
||||
whatIf: "what-if",
|
||||
checks: "checks",
|
||||
table: "table",
|
||||
stalled: "stalled",
|
||||
recheck: "recheck",
|
||||
release: "release",
|
||||
stop: "stop",
|
||||
close: "close",
|
||||
retireHistory: "retire-history",
|
||||
settle: "settle",
|
||||
} as const;
|
||||
|
||||
export const states = {
|
||||
source: "source",
|
||||
merges: "merges",
|
||||
asks: "asks",
|
||||
owed: "owed",
|
||||
turns: "turns",
|
||||
} as const;
|
||||
|
||||
/** The key of one value of the state source under the form "main". */
|
||||
export function sourceByMainKey(): string {
|
||||
return "main";
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "main", or undefined for a key of another form. */
|
||||
export function parseSourceByMainKey(key: string): { } | undefined {
|
||||
let rest = key;
|
||||
if (!rest.startsWith("main")) return undefined;
|
||||
rest = rest.slice(4);
|
||||
if (rest !== "") return undefined;
|
||||
return { };
|
||||
}
|
||||
|
||||
/** The key of one value of the state merges under the form "<group>". */
|
||||
export function mergesByGroupKey(group: string): string {
|
||||
return group;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<group>", or undefined for a key of another form. */
|
||||
export function parseMergesByGroupKey(key: string): { group: string } | undefined {
|
||||
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: string, heads: string): string {
|
||||
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: string): { group: string; heads: string } | undefined {
|
||||
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: string, number: string, head: string, act: string): string {
|
||||
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: string): { repository: string; number: string; head: string; act: string } | undefined {
|
||||
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: string): string {
|
||||
return repository;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<repository>", or undefined for a key of another form. */
|
||||
export function parseTurnsByRepositoryKey(key: string): { repository: string } | undefined {
|
||||
let rest = key;
|
||||
if (rest === "") return undefined;
|
||||
const repository = rest;
|
||||
rest = "";
|
||||
if (rest !== "") return undefined;
|
||||
return { repository };
|
||||
}
|
||||
|
||||
/** is what deliveries takes. */
|
||||
export interface DeliveriesInput {
|
||||
/** "true": the final ones of the last thirty days too */
|
||||
"all"?: "true" | "false";
|
||||
/** a group's id (its branch name) */
|
||||
"group"?: string;
|
||||
/** owner/repository */
|
||||
"repository"?: string;
|
||||
/** one state, e.g. delivering or held */
|
||||
"state"?: string;
|
||||
}
|
||||
|
||||
/** is what deliveries answers. */
|
||||
export type DeliveriesAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what times takes. */
|
||||
export interface TimesInput {
|
||||
}
|
||||
|
||||
/** is what times answers. */
|
||||
export type TimesAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what show takes. */
|
||||
export interface ShowInput {
|
||||
/** a delivery's id, or a group's */
|
||||
"id": string;
|
||||
}
|
||||
|
||||
/** is what show answers. */
|
||||
export type ShowAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what groups takes. */
|
||||
export interface GroupsInput {
|
||||
/** "true": the groups that ended too */
|
||||
"all"?: "true" | "false";
|
||||
}
|
||||
|
||||
/** is what groups answers. */
|
||||
export type GroupsAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what what-if takes. */
|
||||
export interface WhatIfInput {
|
||||
}
|
||||
|
||||
/** is what what-if answers. */
|
||||
export type WhatIfAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what checks takes. */
|
||||
export interface ChecksInput {
|
||||
/** a commit's sha, or the start of one, instead of a pull request */
|
||||
"commit"?: string;
|
||||
/** a pull request's number: its head is read */
|
||||
"number"?: string;
|
||||
/** owner/repository */
|
||||
"repository": string;
|
||||
}
|
||||
|
||||
/** is what checks answers. */
|
||||
export type ChecksAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what table takes. */
|
||||
export interface TableInput {
|
||||
}
|
||||
|
||||
/** is what table answers. */
|
||||
export type TableAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what stalled takes. */
|
||||
export interface StalledInput {
|
||||
}
|
||||
|
||||
/** is what stalled answers. */
|
||||
export type StalledAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what recheck takes. */
|
||||
export interface RecheckInput {
|
||||
/** the delivery's id */
|
||||
"id": string;
|
||||
/** why, kept with the transition */
|
||||
"why": string;
|
||||
}
|
||||
|
||||
/** is what recheck answers. */
|
||||
export type RecheckAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what release takes. */
|
||||
export interface ReleaseInput {
|
||||
}
|
||||
|
||||
/** is what release answers. */
|
||||
export type ReleaseAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what stop takes. */
|
||||
export interface StopInput {
|
||||
}
|
||||
|
||||
/** is what stop answers. */
|
||||
export type StopAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what close takes. */
|
||||
export interface CloseInput {
|
||||
/** the delivery's id */
|
||||
"id": string;
|
||||
/** the condition it answers */
|
||||
"why": string;
|
||||
}
|
||||
|
||||
/** is what close answers. */
|
||||
export type CloseAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what retire-history takes. */
|
||||
export interface RetireHistoryInput {
|
||||
}
|
||||
|
||||
/** is what retire-history answers. */
|
||||
export type RetireHistoryAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what settle takes. */
|
||||
export interface SettleInput {
|
||||
/** the held deliveries' ids (owner/repository@commit) */
|
||||
"ids": string[];
|
||||
/** why they may be settled, shown to the operator */
|
||||
"why": string;
|
||||
}
|
||||
|
||||
/** is what settle answers. */
|
||||
export type SettleAnswer = Record<string, unknown>;
|
||||
|
||||
/** is one value of the state source under the key main. */
|
||||
export interface SourceByMainValue {
|
||||
/** the group that moved it */
|
||||
"group": string;
|
||||
/** repository to the merged head, a full commit */
|
||||
"heads": Record<string, string>;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
export interface MergesByGroupValuePullsItem {
|
||||
"commit"?: string;
|
||||
"head": string;
|
||||
"number": number;
|
||||
"repository": string;
|
||||
/** merging, merged or refused */
|
||||
"state": string;
|
||||
"words"?: string;
|
||||
}
|
||||
|
||||
/** is one value of the state merges under the key <group>. */
|
||||
export interface MergesByGroupValue {
|
||||
/** <repository>@<number> to the approved head */
|
||||
"approved"?: Record<string, string>;
|
||||
/** the ask key */
|
||||
"ask": string;
|
||||
"group": string;
|
||||
"pulls": MergesByGroupValuePullsItem[];
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
export interface AsksByMergeGroupHeadsValueHeadsItem {
|
||||
/** the full commit */
|
||||
"head": string;
|
||||
"number": number;
|
||||
/** <owner>/<name> */
|
||||
"repository": string;
|
||||
}
|
||||
|
||||
/** is one value of the state asks under the key merge.<group>.<heads>. */
|
||||
export interface AsksByMergeGroupHeadsValue {
|
||||
/** the operator-channel ask as raised */
|
||||
"ask": unknown;
|
||||
/** the number of times it was asked */
|
||||
"asking"?: number;
|
||||
"group": string;
|
||||
"heads": AsksByMergeGroupHeadsValueHeadsItem[];
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
/** is one value of the state owed under the key <repository>.<number>.<head>.<act>. */
|
||||
export interface OwedByRepositoryNumberHeadActValue {
|
||||
/** status=<context>, view, note or comment.<seq> */
|
||||
"act": string;
|
||||
"context"?: string;
|
||||
"ref"?: string;
|
||||
"state"?: string;
|
||||
"target"?: string;
|
||||
"text"?: string;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
export interface TurnsByRepositoryValueWaitingItem {
|
||||
/** when (RFC 3339 time) */
|
||||
"approved": string;
|
||||
"ask"?: string;
|
||||
"group": string;
|
||||
"heads": string;
|
||||
/** when (RFC 3339 time) */
|
||||
"since": string;
|
||||
"step"?: string;
|
||||
"waits-for"?: string;
|
||||
/** when (RFC 3339 time) */
|
||||
"waits-since"?: string;
|
||||
}
|
||||
|
||||
/** is one value of the state turns under the key <repository>. */
|
||||
export interface TurnsByRepositoryValue {
|
||||
"repository": string;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
"waiting": TurnsByRepositoryValueWaitingItem[];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"noEmit": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"lockfileVersion": 3,
|
||||
"name": "@novox/mesh-delivery-contracts-mesh-delivery-checker",
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@novox/mesh-delivery-contracts-mesh-delivery-checker",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
},
|
||||
"requires": true,
|
||||
"version": "0.1.0"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"description": "The contract of the seat mesh-delivery-checker, generated from its definition.",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"files": [
|
||||
"src"
|
||||
],
|
||||
"name": "@novox/mesh-delivery-contracts-mesh-delivery-checker",
|
||||
"type": "module",
|
||||
"types": "./src/index.ts",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
@@ -0,0 +1,341 @@
|
||||
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
||||
|
||||
// The contract of the seat "mesh-delivery-checker", defined whole (seats/mesh-delivery-checker/seat.json): The merge check's tries: start one, read one, end one. The checker's own events stay under its own subjects (ADR 0620 §2).
|
||||
|
||||
export const seat = "mesh-delivery-checker";
|
||||
|
||||
export const verbs = {
|
||||
try: "try",
|
||||
tryRead: "try-read",
|
||||
tryEnd: "try-end",
|
||||
} as const;
|
||||
|
||||
export const holderEvents = {
|
||||
verdict: "verdict",
|
||||
tagWanted: "tag-wanted",
|
||||
previewWritten: "preview.written",
|
||||
} as const;
|
||||
|
||||
export function verdictHolderSubject(holder: string): string {
|
||||
return "mesh.stream." + holder + ".event.verdict";
|
||||
}
|
||||
|
||||
export function tagWantedHolderSubject(holder: string): string {
|
||||
return "mesh.stream." + holder + ".event.tag-wanted";
|
||||
}
|
||||
|
||||
export function previewWrittenHolderSubject(holder: string): string {
|
||||
return "mesh.stream." + holder + ".event.preview.written";
|
||||
}
|
||||
|
||||
export const states = {
|
||||
verdicts: "verdicts",
|
||||
kept: "kept",
|
||||
owed: "owed",
|
||||
previews: "previews",
|
||||
} as const;
|
||||
|
||||
/** The key of one value of the state verdicts under the form "<group>.<heads>". */
|
||||
export function verdictsByGroupHeadsKey(group: string, heads: string): string {
|
||||
return group + "." + heads;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<group>.<heads>", or undefined for a key of another form. */
|
||||
export function parseVerdictsByGroupHeadsKey(key: string): { group: string; heads: string } | undefined {
|
||||
let rest = key;
|
||||
const at0 = rest.indexOf(".");
|
||||
if (at0 <= 0) return undefined;
|
||||
const group = rest.slice(0, at0);
|
||||
rest = rest.slice(at0 + 1);
|
||||
if (rest === "") return undefined;
|
||||
const heads = rest;
|
||||
rest = "";
|
||||
if (rest !== "") return undefined;
|
||||
return { group, heads };
|
||||
}
|
||||
|
||||
/** The key of one value of the state kept under the form "<level>.<digest>". */
|
||||
export function keptByLevelDigestKey(level: string, digest: string): string {
|
||||
return level + "." + digest;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<level>.<digest>", or undefined for a key of another form. */
|
||||
export function parseKeptByLevelDigestKey(key: string): { level: string; digest: string } | undefined {
|
||||
let rest = key;
|
||||
const at0 = rest.indexOf(".");
|
||||
if (at0 <= 0) return undefined;
|
||||
const level = rest.slice(0, at0);
|
||||
rest = rest.slice(at0 + 1);
|
||||
if (rest === "") return undefined;
|
||||
const digest = rest;
|
||||
rest = "";
|
||||
if (rest !== "") return undefined;
|
||||
return { level, digest };
|
||||
}
|
||||
|
||||
/** The key of one value of the state owed under the form "<repository>.<number>.<head>.<act>". */
|
||||
export function owedByRepositoryNumberHeadActKey(repository: string, number: string, head: string, act: string): string {
|
||||
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: string): { repository: string; number: string; head: string; act: string } | undefined {
|
||||
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 previews under the form "<repository>.<head>.<trunk>". */
|
||||
export function previewsByRepositoryHeadTrunkKey(repository: string, head: string, trunk: string): string {
|
||||
return repository + "." + head + "." + trunk;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<repository>.<head>.<trunk>", or undefined for a key of another form. */
|
||||
export function parsePreviewsByRepositoryHeadTrunkKey(key: string): { repository: string; head: string; trunk: string } | undefined {
|
||||
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 head = rest.slice(0, at2);
|
||||
rest = rest.slice(at2 + 1);
|
||||
if (rest === "") return undefined;
|
||||
const trunk = rest;
|
||||
rest = "";
|
||||
if (rest !== "") return undefined;
|
||||
return { repository, head, trunk };
|
||||
}
|
||||
|
||||
/** is what try takes. */
|
||||
export interface TryInput {
|
||||
/** the full commit to try, 40 or 64 hex digits */
|
||||
"head": string;
|
||||
/** unit or integration: only this level; both when absent */
|
||||
"level"?: string;
|
||||
/** <owner>/<name> */
|
||||
"repository": string;
|
||||
/** a go test -run pattern: only those tests run, and nothing is kept */
|
||||
"tests"?: string;
|
||||
/** the trunk commit to merge it onto, or the trunk's branch for its head now; the trunk's head when absent */
|
||||
"trunk"?: string;
|
||||
}
|
||||
|
||||
/** is what try answers. */
|
||||
export interface TryAnswer {
|
||||
/** the try's id */
|
||||
"id": string;
|
||||
/** its state */
|
||||
"state"?: string;
|
||||
}
|
||||
|
||||
/** is what try-read takes. */
|
||||
export interface TryReadInput {
|
||||
/** the try's id, try-<digits> */
|
||||
"id": string;
|
||||
}
|
||||
|
||||
/** is what try-read answers. */
|
||||
export type TryReadAnswer = Record<string, unknown>;
|
||||
|
||||
/** is what try-end takes. */
|
||||
export interface TryEndInput {
|
||||
/** the try's id, try-<digits> */
|
||||
"id": string;
|
||||
/** why it is ended, in words */
|
||||
"why": string;
|
||||
}
|
||||
|
||||
/** is what try-end answers. */
|
||||
export interface TryEndAnswer {
|
||||
/** it is ended */
|
||||
"ended": boolean;
|
||||
/** the try */
|
||||
"id": string;
|
||||
}
|
||||
|
||||
export interface VerdictHolderEventSeriesItem {
|
||||
/** its artifact, or the package's ecosystem name as the module's packages name it */
|
||||
"artifact": string;
|
||||
/** the series on trunk */
|
||||
"from": string;
|
||||
/** the module whose artifact's series changes */
|
||||
"module": string;
|
||||
/** the series the checked head gives it */
|
||||
"to": string;
|
||||
}
|
||||
|
||||
/** is the body of the holder's event verdict. */
|
||||
export interface VerdictHolderEvent {
|
||||
/** the commit checked */
|
||||
"head": string;
|
||||
/** the generated files out of step with their seat definitions, each path (design 26) */
|
||||
"out-of-step"?: string[];
|
||||
/** the pull request's number, for a pull request's check */
|
||||
"pull"?: number;
|
||||
/** owner/repo */
|
||||
"repository": string;
|
||||
/** each change of an artifact's series the checked head makes against trunk's manifests, once each (design 32); absent when it changes none */
|
||||
"series"?: VerdictHolderEventSeriesItem[];
|
||||
/** pass or fail */
|
||||
"verdict": string;
|
||||
}
|
||||
|
||||
/** is the body of the holder's event tag-wanted. */
|
||||
export interface TagWantedHolderEvent {
|
||||
/** the pull request's branch: its tag is removed when the branch ends */
|
||||
"branch": string;
|
||||
/** its head */
|
||||
"head": string;
|
||||
/** the group member */
|
||||
"module": string;
|
||||
/** the package it declares */
|
||||
"package": string;
|
||||
/** the pull request */
|
||||
"pull"?: number;
|
||||
/** owner/repo */
|
||||
"repository": string;
|
||||
/** the tag wanted */
|
||||
"tag"?: string;
|
||||
}
|
||||
|
||||
export interface VerdictsByGroupHeadsValueComposition {
|
||||
"fpset"?: string;
|
||||
"machines"?: string[];
|
||||
"sdk"?: string;
|
||||
/** not-run, pass or fail */
|
||||
"state": string;
|
||||
"words"?: string;
|
||||
}
|
||||
|
||||
export interface VerdictsByGroupHeadsValueFailed {
|
||||
"machine"?: string;
|
||||
"test"?: string;
|
||||
"words"?: string;
|
||||
}
|
||||
|
||||
export interface VerdictsByGroupHeadsValueFailuresItem {
|
||||
"machine"?: string;
|
||||
"test"?: string;
|
||||
"words"?: string;
|
||||
}
|
||||
|
||||
export interface VerdictsByGroupHeadsValueLevelsValue {
|
||||
"kept": number;
|
||||
"run": number;
|
||||
"skipped"?: number;
|
||||
}
|
||||
|
||||
export interface VerdictsByGroupHeadsValueSeriesItem {
|
||||
"artifact": string;
|
||||
"from": string;
|
||||
"module": string;
|
||||
"to": string;
|
||||
}
|
||||
|
||||
/** milliseconds */
|
||||
export interface VerdictsByGroupHeadsValueTook {
|
||||
"clone"?: number;
|
||||
"composition"?: number;
|
||||
"integration-run"?: number;
|
||||
"integration-setup"?: number;
|
||||
"lint"?: number;
|
||||
"queue"?: number;
|
||||
"unit"?: number;
|
||||
}
|
||||
|
||||
/** is one value of the state verdicts under the key <group>.<heads>. */
|
||||
export interface VerdictsByGroupHeadsValue {
|
||||
"beside"?: Record<string, string>;
|
||||
"carried-from"?: Record<string, string>;
|
||||
"composition"?: VerdictsByGroupHeadsValueComposition;
|
||||
"failed"?: VerdictsByGroupHeadsValueFailed;
|
||||
"failures"?: VerdictsByGroupHeadsValueFailuresItem[];
|
||||
"group": string;
|
||||
/** 12 hex digits */
|
||||
"heads": string;
|
||||
/** by level, unit or integration */
|
||||
"levels"?: Record<string, VerdictsByGroupHeadsValueLevelsValue>;
|
||||
"machines"?: string[];
|
||||
"over-bound"?: string[];
|
||||
"sdk"?: string;
|
||||
"series"?: VerdictsByGroupHeadsValueSeriesItem[];
|
||||
/** running, pass or fail */
|
||||
"state": string;
|
||||
/** milliseconds */
|
||||
"took"?: VerdictsByGroupHeadsValueTook;
|
||||
/** repository to the trunk head merged onto */
|
||||
"trunk"?: Record<string, string>;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
/** is one value of the state kept under the key <level>.<digest>. */
|
||||
export interface KeptByLevelDigestValue {
|
||||
/** when (RFC 3339 time) */
|
||||
"at"?: string;
|
||||
"level": string;
|
||||
"package": string;
|
||||
"repository": string;
|
||||
/** pass: a failure is never kept */
|
||||
"state": string;
|
||||
"tests"?: number;
|
||||
"took"?: number;
|
||||
"toolchain"?: string;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
/** is one value of the state owed under the key <repository>.<number>.<head>.<act>. */
|
||||
export interface OwedByRepositoryNumberHeadActValue {
|
||||
/** status=<context>, view, note or comment.<seq> */
|
||||
"act": string;
|
||||
"context"?: string;
|
||||
"ref"?: string;
|
||||
"state"?: string;
|
||||
"target"?: string;
|
||||
"text"?: string;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
export interface PreviewsByRepositoryHeadTrunkValueModulesValue {
|
||||
"locks"?: Record<string, string>;
|
||||
/** manifest digest */
|
||||
"manifest": string;
|
||||
"packages"?: string[];
|
||||
"paths"?: Record<string, string>;
|
||||
"tree": string;
|
||||
}
|
||||
|
||||
/** is one value of the state previews under the key <repository>.<head>.<trunk>. */
|
||||
export interface PreviewsByRepositoryHeadTrunkValue {
|
||||
/** files in conflict */
|
||||
"conflicts"?: string[];
|
||||
"head": string;
|
||||
/** the merge commit */
|
||||
"merge"?: string;
|
||||
/** by directory */
|
||||
"modules"?: Record<string, PreviewsByRepositoryHeadTrunkValueModulesValue>;
|
||||
"repository": string;
|
||||
"trunk": string;
|
||||
/** the layout version */
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"noEmit": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user