Files
mesh-delivery/contracts/ts/seats/meshcatalog/src/index.ts
T

431 lines
12 KiB
TypeScript

// 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;
}