/** * Multi-region destroy helpers for organisation cascade destruction. * * Mirrors the deployCascadeAccount() pattern from cascadeHelpers.ts but * for destroy operations. No bootstrap step (unlike deploy). */ import type { DestroyParams } from "../../types/params.js"; import { type LeaseDeniedError } from "../application/leaseGate.js"; import type { DeployCallbacks } from "../../types/callbacks.js"; import type { OrganisationOperation } from "../../types/operations.js"; import type { DeployServices } from "../serviceFactory.js"; export interface CascadeDestroyAccountResult { accountName: string; accountId: string; region: string; success: boolean; duration: number; error?: string; skipped?: boolean; /** * Set when the failure was a §5.3 lease denial. The aggregator must * propagate it as a typed overall failure — a denial is a cancel/supersede * signal, not a partial-failure to fold into the skip-root warnings path. */ leaseDenied?: LeaseDeniedError; } export interface DestroyCascadeAccountOptions { /** * Resolved primary (home) region of the cascade. buildParamsContext derives * the account-globals skip from it, mirroring deployCascadeAccount: a * non-home (secondary/DR) region destroy synthesises WITHOUT the fixed-name * org-global IAM resources, matching the deployed stack shape so the destroy * can never identify the primary's globals for teardown. Omitted ⇒ the * globals stay in the synthesised template (home-region semantics). */ primaryRegion?: string; } /** * Destroy a single cascade account (platform or member) in a specific region. * * Flow: assume role -> synth -> destroy pre-flight -> CDK destroy -> * failed-state cleanup if needed (which re-runs the pre-flight before its own * DeleteStack). No bootstrap step (unlike deploy). */ export declare function destroyCascadeAccount(params: DestroyParams, services: DeployServices, operation: OrganisationOperation, account: { id: string; name: string; environment: string | null; }, deployType: "platform" | "account", region: string, callbacks: DeployCallbacks, options?: DestroyCascadeAccountOptions): Promise;