Skip to content
Français

publishWorkspaceOutputs

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

Publishes selected settled files with exclusive creation or protected update. Failure attempts conditional rollback and preserves external edits and recovery evidence. Publication validates and stages all selected outputs before mutation, journals the operations through Transport and quarantines replaced entries on the destination filesystem. It is not an atomic tree replacement. Rollback restores only paths that still match the publication effects; concurrent edits and required backups remain available for explicit recovery. It requires settled files with no active sandbox operation and does not undo writable source-mount effects.

Complete example and detailed rules.

  • workspaceRequired
    FileWorkspace
    Open workspace borrowed for this operation; its caller remains responsible for closing it.
  • declarationRequired
    WorkspaceOutputOptions
    Relative output selection, destination and explicit create/update/deletion policy.
  • transporterOptional
    Transport | undefined
    Caller-owned Transport used for conservation; no implicit cloud SDK or credential loading.

Promise<WorkspacePublication>

export declare function publishWorkspaceOutputs(
  workspace: FileWorkspace,
  declaration: WorkspaceOutputOptions,
  transporter?: Transport,
): Promise<WorkspacePublication>;