/** A deployment row, as the data API hands it back (camel or snake columns). */ export interface DeploymentRow { id: string | number; status?: string; createdAt?: string | Date; created_at?: string | Date; finishedAt?: string | Date; finished_at?: string | Date; imageUrl?: string; image_url?: string; rollbackOf?: string; rollback_of?: string; triggeredBy?: string; triggered_by?: string; triggerSource?: string; trigger_source?: string; triggeredByUserId?: string; triggered_by_user_id?: string; gitCommitHash?: string; gitCommitMessage?: string; deployMessage?: string; deploy_message?: string; frameworkVersion?: string; framework_version?: string; } /** * The backend's rule EXACTLY: a rollback is honoured only for a successful * deploy that recorded an image. Any other row 409s `deploy_not_rollbackable`. */ export declare function isRollbackable(dep: DeploymentRow): boolean; /** finishedAt − createdAt in ms, or null (still running / missing / skewed). */ export declare function deploymentDurationMs(dep: DeploymentRow): number | null; export declare function triggerInfo(dep: DeploymentRow): { by: string; source: string; userId: string; }; /** Shape one deployment row into the stable JSON view the CLI publishes. */ export declare function deploymentView(dep: DeploymentRow): Record; /** * Rows shown when `--limit` is not given. * * History is unbounded and grows one row per deploy, so "all of it" is the * wrong default in both directions: a wall of near-identical lines in a * terminal, and — since JSON mode is entered automatically for any non-TTY * stdout — a project's entire history dumped at anything that pipes the * command. Recent deploys are what the question is almost always about. */ export declare const DEFAULT_DEPLOYMENTS_LIMIT = 20; /** `--limit N`, bounded. A garbage value is a refusal, never a silent default. */ export declare function parseDeploymentsLimit(raw: number | undefined): number; export declare function deploymentsListCommand(rawArgs: string[]): Promise; /** * The deployment id `rollback`/`cancel` was given, if any. * * Both take an optional id, which is what made the old operand filter so easy * to trip: `rebase cloud rollback -p acme` — the documented way to act on an * unlinked project — read `--project`'s value as the id and refused with * "Deployment acme not found", and `cancel -p acme` sent "acme" to the server * as the deployment to cancel. Strict parsing consumes the flag with its value, * so an id given as a flag value is never mistaken for an argument. */ export declare function resolveDeploymentIdArg(rawArgs: string[], command: string): { flags: import("arg").Result<{ readonly "--json": BooleanConstructor; readonly "--yes": BooleanConstructor; readonly "--help": BooleanConstructor; readonly "--project": StringConstructor; readonly "-p": "--project"; readonly "-y": "--yes"; readonly "-h": "--help"; }>; id: string; }; export declare function rollbackCommand(rawArgs: string[]): Promise; export declare function cancelCommand(rawArgs: string[]): Promise;