Skip to content
Français

FileTransfers

import type { FileTransfers } from "@elie-laloum/outpost";
  • uploadBatchOptional
    ((source: string, entries: readonly FileManifestEntry[], destination: string, options?: TransferOptions) => Promise<void>) | undefined
    Uploads the listed manifest entries from a host directory into a sandbox directory, in batches. Without it, Outpost calls upload() for each file.
  • manifestRequired
    (source: string, paths: readonly string[], options?: TransferOptions) => Promise<readonly FileManifestEntry[]>
    Describes the listed paths, relative to a sandbox directory, with kind, permission bits, size and SHA-256. Outpost uses it to skip files unchanged since the last transfer.
  • downloadBatchRequired
    (source: string, entries: readonly FileManifestEntry[], destination: string, options?: TransferOptions) => Promise<void>
    Downloads the listed manifest entries from a sandbox directory into a host directory, in bounded batches. Outpost then checks each file against the manifest and fails with code workspace on a mismatch.
export interface FileTransfers {
  uploadBatch?(
    source: string,
    entries: readonly FileManifestEntry[],
    destination: string,
    options?: TransferOptions,
  ): Promise<void>;
  manifest(
    source: string,
    paths: readonly string[],
    options?: TransferOptions,
  ): Promise<readonly FileManifestEntry[]>;
  downloadBatch(
    source: string,
    entries: readonly FileManifestEntry[],
    destination: string,
    options?: TransferOptions,
  ): Promise<void>;
}