Skip to content
Français

materializeRecoveryArchive

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

Download a recovery archive into destination, checking each chunk’s revision and SHA-256 and then the transfer’s checksums, and return destination. Symlinks and file modes are restored; on failure the partial destination is kept. Bring the work back with planRecoveryRestore() and restoreRecoveryTransfer().

Complete example and detailed rules.

  • optionsRequired
    RecoveryArchiveRestoreOptions
    Pinned archive reference, transport, new local destination and verification bound.
  • options.referenceRequired
    TransportReference
    Pinned manifest returned by archiveRecovery; every chunk revision and SHA-256 is checked.
  • options.destinationRequired
    string
    New local directory whose parent already exists. Existing destinations are refused; partial data is retained on failure.
  • options.maxBytesOptional
    number | undefined
    Positive total restored payload limit, default 1 GiB; also bounds recovery integrity verification.
  • 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 that receives the start and end events of the archive download.

Promise<string>

export declare function materializeRecoveryArchive(
  options: RecoveryArchiveRestoreOptions,
  observation?: ObservationHub,
): Promise<string>;