Skip to content
Français

pruneS3Tombstones

import { pruneS3Tombstones } from "@elie-laloum/outpost/transports/s3";

Physically remove tombstone objects under one explicit S3 prefix after every writer has stopped. Refuse missing writersStopped authorization, preserve live empty objects, and return the removed count. This is offline maintenance, not concurrent retention; compatible stores may ignore conditional deletion.

Complete example and detailed rules.

  • optionsRequired
    S3TombstonePruneOptions
    Explicit S3 prefix and stopped-writer authorization for offline marker deletion.
  • options.prefixRequired
    string
    Nonempty transport prefix; deletion is restricted to its descendants.
  • options.writersStoppedRequired
    true
    Required true after stopping every writer sharing the prefix; keep them stopped until pruning ends.
  • options.signalOptional
    AbortSignal | undefined
    Optional cancellation signal; completed deletions remain applied.
  • options.clientRequired
    S3Client
    S3Client configured by the caller with region, credentials and any compatible endpoint. Outpost does not destroy it or forward its credentials to sandboxes.
  • options.bucketRequired
    string
    Existing private bucket that supports conditional PUT and paginated listing, plus conditional DELETE in the default delete mode. The transport never creates it; an empty name rejects.

Promise<number>

export declare function pruneS3Tombstones(
  options: S3TombstonePruneOptions,
): Promise<number>;