Skip to content
Français

pruneRecoveryRetention

import { pruneRecoveryRetention } from "@elie-laloum/outpost";

Remove the eligible entries of a complete plan, checking each against a fresh plan first; a changed or failed candidate is retained with its reason. Worktrees are removed under their branch lock and keep their branch; journal and cache objects are deleted with conditional writes. An incomplete plan or a transporter that does not match the plan’s source rejects with code configuration.

Complete example and detailed rules.

  • planRequired
    RecoveryRetentionPlan
    Complete plan from planRecoveryRetention(); only its eligible entries are candidates.
  • optionsOptional
    TransportStoreOptions | undefined
    { transporter } used to build a plan whose source is transport; must be omitted for a local plan.
  • options.transporterRequired
    Transport
    Caller-owned object transport used by the store or operation. Closing a workflow or sandbox does not close this transport.
  • observationOptional
    ObservationHub | undefined
    Hub receiving the started, then finished or failed, operation event retention.prune with its duration.

Promise<RecoveryPruneResult>

export declare function pruneRecoveryRetention(
  plan: RecoveryRetentionPlan,
  options?: TransportStoreOptions,
  observation?: ObservationHub,
): Promise<RecoveryPruneResult>;