Files
mesh-contracts/ts/seats/meshbroker/index.d.ts
T

406 lines
13 KiB
TypeScript

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "mesh-broker", defined whole (seats/mesh-broker/seat.json): The mesh's bus, and the bus state modules ask of it in requires (design 25 § 12). create, apply, recreate and drop are granted to the bus module's own credential alone.
export declare const seat: "mesh-broker";
export declare const verbs: {
readonly list: "list";
readonly show: "show";
readonly check: "check";
readonly orphans: "orphans";
readonly create: "create";
readonly apply: "apply";
readonly recreate: "recreate";
readonly drop: "drop";
readonly snapshotGet: "snapshot-get";
readonly snapshotRestore: "snapshot-restore";
readonly snapshotRestoreCancel: "snapshot-restore-cancel";
readonly snapshotRemove: "snapshot-remove";
};
export declare const events: {
readonly created: "created";
readonly refused: "refused";
readonly drifted: "drifted";
readonly driftCleared: "drift-cleared";
readonly full: "full";
readonly fullCleared: "full-cleared";
readonly orphaned: "orphaned";
readonly recreated: "recreated";
readonly dropped: "dropped";
readonly snapshotRestored: "snapshot-restored";
};
export declare const family: { readonly name: "mesh-broker.events"; readonly maxAgeDays: 7 };
export declare const createdSubject: "mesh.seat.mesh-broker.event.created";
export declare const refusedSubject: "mesh.seat.mesh-broker.event.refused";
export declare const driftedSubject: "mesh.seat.mesh-broker.event.drifted";
export declare const driftClearedSubject: "mesh.seat.mesh-broker.event.drift-cleared";
export declare const fullSubject: "mesh.seat.mesh-broker.event.full";
export declare const fullClearedSubject: "mesh.seat.mesh-broker.event.full-cleared";
export declare const orphanedSubject: "mesh.seat.mesh-broker.event.orphaned";
export declare const recreatedSubject: "mesh.seat.mesh-broker.event.recreated";
export declare const droppedSubject: "mesh.seat.mesh-broker.event.dropped";
export declare const snapshotRestoredStream: "SEAT_mesh-broker_snapshot-restored";
export declare function snapshotRestoredSubject(request: string, act: string): string;
export declare const snapshotRestoredSubjectAll: "mesh.seat.mesh-broker.event.snapshot-restored.*.*";
/** the binding a module receives in its membership for one entry (ADR 0595 §1, §7): the names on the bus of the entry's objects, one form in the events, in list, show and orphans, and in the membership */
export interface Binding {
/** a key-value bucket's name */
"bucket"?: string;
/** a ledger's history stream */
"history"?: string;
/** a ledger's index buckets, by index name */
"indexes"?: Record<string, string>;
/** the entry's local name in the module's manifest */
"local": string;
/** an object store's name */
"object-store"?: string;
/** the bus name of the state's <state>-objects, where its large values go (design 47 G 58, 399) */
"objects"?: string;
/** the subject of a ledger's instances' snapshots */
"snapshot"?: string;
/** a ledger's state bucket */
"state"?: string;
/** how the bus keeps it: the entry's storage type */
"storage": string;
/** a stream's name on the bus */
"stream"?: string;
/** the subject a stream's messages are on; also a ledger's history's */
"subject"?: string;
/** its template */
"template"?: string;
/** a ledger's types, as its manifest declares them */
"types"?: Record<string, unknown>[];
}
/** one piece of bus state as a manifest asks it */
export interface Entry {
/** its own configuration, where no template fits */
"configuration"?: Record<string, unknown>;
/** its local name in the module's manifest */
"local-name": string;
/** the module asking it */
"module": string;
/** the template's options the module set, within their bounds */
"options"?: Record<string, unknown>;
/** how the bus keeps it */
"storage-type": "stream" | "key-value" | "object-store" | "ledger";
/** its template; empty for a configuration of its own */
"template"?: "state" | "events" | "work-queue" | "log" | "objects" | "ledger" | "";
}
export interface Fill {
/** bytes held */
"bytes": number;
/** its cap in bytes */
"cap": number;
/** messages, keys or objects held */
"count": number;
}
/** one entry as the bus holds it */
export interface Held {
/** the binding a module receives for the entry, as created and recreated carry it; present on an entry whose objects the bus holds, absent on one it does not (design 25 bindings-first-view §2) */
"binding"?: Binding;
/** its name on the bus, <module>_<local name> */
"bus-name": string;
/** its own configuration, where no template fits */
"configuration"?: Record<string, unknown>;
"fill"?: Fill;
/** its local name in the module's manifest */
"local-name": string;
/** the module asking it */
"module": string;
/** the template's options the module set, within their bounds */
"options"?: Record<string, unknown>;
/** the settings the bus holds */
"settings"?: Record<string, unknown>;
/** the entry's state: held as asked, refused, waiting to be made, drifted from what is asked, full, or orphaned (no manifest asks it) */
"state"?: "held" | "refused" | "waiting" | "drifted" | "full" | "orphaned";
/** how the bus keeps it */
"storage-type": "stream" | "key-value" | "object-store" | "ledger";
/** its template; empty for a configuration of its own */
"template"?: "state" | "events" | "work-queue" | "log" | "objects" | "ledger" | "";
/** why it is in its state, in plain words; empty when held as asked */
"why"?: string;
}
export interface Named {
/** the entry's local name */
"local-name": string;
/** the module */
"module": string;
}
/** the body of every event of the seat */
export interface Said {
/** the settings asked */
"asked"?: Record<string, unknown>;
"binding"?: Binding;
/** its name on the bus */
"bus-name": string;
/** its own configuration, where no template fits */
"configuration"?: Record<string, unknown>;
"fill"?: Fill;
/** the settings held */
"held"?: Record<string, unknown>;
/** its local name in the module's manifest */
"local-name": string;
/** the module asking it */
"module": string;
/** the template's options the module set, within their bounds */
"options"?: Record<string, unknown>;
/** the indexer's revision of the verdict the bus module acted on (ADR 0622 §2), so a reader orders what it hears */
"revision"?: number;
/** the stream snapshot taken before a recreate or drop */
"snapshot"?: string;
/** how the bus keeps it */
"storage-type"?: "stream" | "key-value" | "object-store" | "ledger";
/** its template; empty for a configuration of its own */
"template"?: "state" | "events" | "work-queue" | "log" | "objects" | "ledger" | "";
/** why: a refusal's cause, a drift's difference, a drop's or recreate's reason */
"why"?: string;
}
export interface Warranted {
/** the entry's local name */
"local-name": string;
/** the module */
"module": string;
/** the operator's warrant, as the operator channel decided it (ADR 0259 §6) */
"warrant": string;
/** why, kept in the record */
"why": string;
}
/** is what list takes. */
export interface ListInput {
/** one module (optional) */
"module"?: string;
}
/** the sum of the bus's caps against its limits, in MiB; an absent limit is unlimited (design 47 G 547, 661) */
export interface ListAnswerCaps {
"account-limit-mib"?: number;
"server-limit-mib"?: number;
"sum-mib": number;
}
/** is what list answers. */
export interface ListAnswer {
/** the sum of the bus's caps against its limits, in MiB; an absent limit is unlimited (design 47 G 547, 661) */
"caps"?: ListAnswerCaps;
/** every entry */
"entries": Held[];
}
/** is what show takes. */
export type ShowInput = Named;
/** is what show answers. */
export type ShowAnswer = Held;
/** is what check takes. */
export interface CheckInput {
/** one module (optional) */
"module"?: string;
}
export interface CheckAnswerDifferencesItem {
/** asked */
"asked"?: Record<string, unknown>;
/** the difference only grows: apply may act on it */
"grows"?: boolean;
/** held */
"held"?: Record<string, unknown>;
/** the entry */
"local-name": string;
/** the module */
"module": string;
}
/** is what check answers. */
export interface CheckAnswer {
/** every difference */
"differences": CheckAnswerDifferencesItem[];
}
/** is what orphans takes. */
export interface OrphansInput {
}
/** is what orphans answers. */
export interface OrphansAnswer {
/** every orphan */
"entries": Held[];
}
/** is what create takes. */
export type CreateInput = Entry;
/** is what create answers. */
export type CreateAnswer = Held;
/** is what apply takes. */
export type ApplyInput = Named;
/** is what apply answers. */
export type ApplyAnswer = Held;
/** is what recreate takes. */
export type RecreateInput = Warranted;
/** is what recreate answers. */
export type RecreateAnswer = Held;
/** is what drop takes. */
export type DropInput = Warranted;
/** is what drop answers. */
export interface DropAnswer {
/** it is gone */
"dropped": boolean;
/** the snapshot taken first */
"snapshot"?: string;
}
/** is what snapshot-get takes. */
export interface SnapshotGetInput {
/** 128 random bits the caller chooses: the subject token of this send's chunks and acknowledgements */
"call": string;
/** the snapshot's request: the id of the request the keeper took it for, in its state requests */
"request": string;
}
/** is what snapshot-get answers. */
export interface SnapshotGetAnswer {
/** when the snapshot was taken, RFC 3339 */
"at"?: string;
/** how many chunks are sent; 0 when the caller is granted no chunk subjects */
"chunks"?: number;
/** sha256: of the file's bytes */
"digest"?: string;
/** why not: snapshot damaged, snapshot missing, snapshot protected or snapshot taken before milestone G; set alone */
"error"?: string;
/** the entry's local name */
"local"?: string;
"module"?: string;
"request"?: string;
"size"?: number;
/** the stream's name on the bus */
"stream"?: string;
}
/** is what snapshot-restore takes. */
export interface SnapshotRestoreInput {
/** the snapshot's request: the id of the request the keeper took it for, in its state requests */
"request": string;
/** check the file against its digest and restore nothing */
"verify"?: boolean;
/** why, which the hand-act log keeps */
"why": string;
}
/** is what snapshot-restore answers. */
export interface SnapshotRestoreAnswer {
/** accepted: the act's id */
"accepted"?: string;
/** busy: the id of the act that runs; it keeps no queue */
"busy"?: string;
/** why not; set alone */
"error"?: string;
}
/** is what snapshot-restore-cancel takes. */
export interface SnapshotRestoreCancelInput {
/** the restore's act id */
"act": string;
/** why, which the hand-act log keeps */
"why": string;
}
/** is what snapshot-restore-cancel answers. */
export interface SnapshotRestoreCancelAnswer {
/** accepted: the act's id */
"accepted"?: string;
/** busy: the id of the act that runs; it keeps no queue */
"busy"?: string;
/** why not; set alone */
"error"?: string;
}
/** is what snapshot-remove takes. */
export interface SnapshotRemoveInput {
/** true: every snapshot past snapshot-keep-days */
"expired"?: boolean;
/** the snapshot's request; or expired true, not both */
"request"?: string;
/** why, which the hand-act log keeps */
"why": string;
}
/** is what snapshot-remove answers. */
export interface SnapshotRemoveAnswer {
/** accepted: the act's id */
"accepted"?: string;
/** busy: the id of the act that runs; it keeps no queue */
"busy"?: string;
/** why not; set alone */
"error"?: string;
}
/** is the body of the event created. */
export type CreatedEvent = Said;
/** is the body of the event refused. */
export type RefusedEvent = Said;
/** is the body of the event drifted. */
export type DriftedEvent = Said;
/** is the body of the event drift-cleared. */
export type DriftClearedEvent = Said;
/** is the body of the event full. */
export type FullEvent = Said;
/** is the body of the event full-cleared. */
export type FullClearedEvent = Said;
/** is the body of the event orphaned. */
export type OrphanedEvent = Said;
/** is the body of the event recreated. */
export type RecreatedEvent = Said;
/** is the body of the event dropped. */
export type DroppedEvent = Said;
/** is the body of the event snapshot-restored. */
export interface SnapshotRestoredEvent {
"act": string;
/** when failed */
"error"?: string;
"outcome": "done" | "failed";
"request": string;
}
/** is the form of the provision bus-state. */
export type BusStateForm = Binding;