Skip to content
Français

planRecoveryRetention

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

Inventory the repository’s .outpost, or a transport’s objects, and mark each entry eligible or kept with a reason code under the policy. Removes nothing; an incomplete inventory makes every entry ineligible and quota unknown. An invalid policy, or clean-workspaces or maxWorkspaces with a transporter, rejects with code configuration.

Complete example and detailed rules.

  • optionsRequired
    RecoveryRetentionOptions
    Repository or transporter to inspect, retention policy and scan limit.
  • options.transporterOptional
    Transport | undefined
    Plan over this transport’s objects instead of the repository’s .outpost. Only closed-logs and task-cache apply; clean-workspaces or maxWorkspaces reject with code configuration.
  • options.repositoryOptional
    string | undefined
    Git checkout whose .outpost is inspected, default process.cwd(), resolved to its top-level directory; a missing directory rejects with code workspace. With transporter, only recorded in the plan.
  • options.policyRequired
    RecoveryRetentionPolicy
    Scopes, minimum age and limits deciding which entries are eligible. Validated before inspection; an invalid or unknown field rejects with code configuration.
  • options.maxEntriesOptional
    number | undefined
    Maximum files and directories scanned under .outpost, or objects listed from transporter, default 100000. Exceeding it marks the plan incomplete, so no entry is eligible.
  • observationOptional
    ObservationHub | undefined
    Hub receiving the started, then finished or failed, operation event retention.plan with its duration.

Promise<RecoveryRetentionPlan>

export declare function planRecoveryRetention(
  options: RecoveryRetentionOptions,
  observation?: ObservationHub,
): Promise<RecoveryRetentionPlan>;