/** * `rules rollback` — replay a captured revision through the sync endpoint (POST * /api/proxy-rule-sets/:id/rollback/:revisionId). The response IS a `SyncResponse` (rollback * is a sync under the hood) — rendered by the caller with the existing `formatSyncReport` * from `push.ts`, so the change plan looks identical to a `rules push` report. * * Default target (no `--to`): the newest revision with `current: false`. The `/revisions` * list is already newest-first, so that's simply the first non-current entry — erroring * loudly when there isn't one beats guessing (the only non-current revision to roll back to * IS the live state, i.e. there's nothing to revert). * * `--to` accepts either a full uuid (used as-is, no extra network call) or any unique prefix * of one — notably the 8-char short id `rules revisions` prints, which is otherwise * unusable because the rollback route guards `:revisionId` with a `ParseUUIDPipe`. */ import { type ClientDeps } from '../api/client.js'; import type { RevisionListItem, SyncResponse } from '../api/sync-types.js'; export interface RollbackOptions { apiUrl?: string; apiKey?: string; project?: string; to?: string; dryRun?: boolean; } export interface RollbackOutcome { ok: boolean; response?: SyncResponse; revisionId?: string; error?: string; } /** Newest revision with `current: false` (the list is already newest-first); `null` when * every captured revision is current (nothing to roll back to). */ export declare function pickDefaultRollbackTarget(revisions: RevisionListItem[]): RevisionListItem | null; /** Expand a `--to` value to a full revision uuid against the fetched list. A prefix that * matches exactly one revision wins; zero or several is an error naming the short ids that * DO exist, so a mistyped or stale id is a one-glance fix. Comparison is case-insensitive * because a uuid pasted from anywhere may be upper-cased. */ export declare function resolveRevisionId(to: string, revisions: RevisionListItem[]): string; export declare function runRollback(setName: string, opts: RollbackOptions, cwd: string, deps?: ClientDeps): Promise;