import type { Fs } from "webappwiz/system"; import { type WallClock } from "webappwiz/time"; import type { CheckReport, Step, StepStage } from "./step.js"; /** Check an event line's `schema` against this before reading the rest of it. */ export declare const EVENTS_SCHEMA: 1; /** * JSON-lines release progress. No path means no event file; `progress`, when * given, also receives one `{"event":"step",...}` line per start, done, failure * or skip, for a caller reading the release's own output. */ export declare class StepEvents { private readonly path; private readonly fs; private readonly clock; private readonly progress?; constructor(path: string | undefined, fs: Fs, clock?: WallClock, progress?: ProgressSink | undefined); declared({ id, step, packages, artifact, }: StepDeclaration): Promise; started({ id, step }: StepDeclaration): Promise; /** A package staged for approval, with where to approve it. */ staged({ id, step }: StepDeclaration, info: { package: string; version: string; stageId: string; url: string; }): Promise; check(declaration: StepDeclaration, { passed, status, url }: CheckReport): Promise; done({ id, step }: StepDeclaration): Promise; /** A step a resumed release found already landed. */ skipped({ id, step }: StepDeclaration): Promise; failed({ id, step }: StepDeclaration, error: unknown): Promise; private report; private write; private at; } /** Where progress lines go; the release's own logger in practice. */ export interface ProgressSink { line(text: string): void; } interface StepEvent { readonly schema: typeof EVENTS_SCHEMA; readonly id: string; readonly name: string; readonly at: string; } export interface StepDeclaredEvent extends StepEvent { readonly type: "declared"; readonly stage: StepStage; readonly packages: string[]; readonly artifact?: string; readonly deadlineMs: number; } export interface StepStartedEvent extends StepEvent { readonly type: "started"; } export interface StepStagedEvent extends StepEvent { readonly type: "staged"; readonly package: string; readonly version: string; readonly stageId: string; readonly url: string; } export interface StepCheckEvent extends StepEvent { readonly type: "check"; readonly passed: boolean; /** What a failed check still waits on, when its step says. */ readonly status?: string; /** Where a person can look into it. */ readonly url?: string; } export interface StepDoneEvent extends StepEvent { readonly type: "done"; } export interface StepSkippedEvent extends StepEvent { readonly type: "skipped"; } export interface StepFailedEvent extends StepEvent { readonly type: "failed"; readonly error: string; } /** One line in the release event file named by WEBAPPWIZ_SHIP_EVENTS or SPLATES_SHIP_EVENTS. */ export type ReleaseStepEvent = StepDeclaredEvent | StepStartedEvent | StepStagedEvent | StepCheckEvent | StepDoneEvent | StepSkippedEvent | StepFailedEvent; /** What a step runner reports, identified independently of its display name. */ export interface StepDeclaration { readonly id: string; readonly step: Step; /** The artifact the step belongs to, when it came from one. */ readonly artifact?: string; /** The workspace packages the step publishes, if any. */ readonly packages?: readonly string[]; } export {};