export enum DeployQueueStatus { QUEUED = 'QUEUED', DEPLOYING = 'DEPLOYING', DEPLOYED = 'DEPLOYED', FAILED = 'FAILED', /** Build + gates done, advisory-only findings present, waiting for explicit "Publish anyway". */ AWAITING_ACK = 'AWAITING_ACK' } /** Status returned by the deploy-status polling endpoint. "none" means no queue entry exists. */ export type DeployStatusResponseStatus = 'none' | DeployQueueStatus; /** * Identifies a sub-stage of the native-DB publish lifecycle that the UI * surfaces independently of the overall deploy queue status. `provisioning` * tracks `ensure_database` work; `migrating` tracks `migrate_schema` work. */ export type LifecycleStageKind = 'provisioning' | 'migrating'; /** * Aggregated state of a lifecycle stage across all prod bindings for a * commit. Worst-case wins (any failed → failed, any in_progress → * in_progress, all complete → complete, otherwise pending). */ export type LifecycleStageState = 'pending' | 'in_progress' | 'complete' | 'failed'; /** * Per-datatag row under a parent lifecycle stage when deploy fanned out * across multiple deployed Environments profiles. */ export interface LifecycleStageTargetProgress { bindingKey: string; profile: string; state: LifecycleStageState; errorCode?: string; errorMessage?: string; } export interface LifecycleStageProgress { kind: LifecycleStageKind; state: LifecycleStageState; errorCode?: string; errorMessage?: string; /** Present when multiple profile-scoped bindings participate in this stage. */ targets?: LifecycleStageTargetProgress[]; } /** * Native-DB lifecycle progress for a publish. Sent alongside the deploy * queue status so the UI can render provisioning and migration steps. * Omitted from responses when no native-DB requirements exist for the commit. * * `stages` lists only lifecycle work queued for THIS commit — republishes * that reuse an already-provisioned / already-migrated DB may return * `hasNativeDb: true` with an empty `stages` array. */ export interface DeployLifecycleProgress { hasNativeDb: boolean; stages: LifecycleStageProgress[]; }