Storage

Filesystem Storage

@dsar/storage-filesystem stores DSAR fulfilment artifacts on the local filesystem. Ideal for development, testing, and single-server deployments.

Installation

Package managerCommand
npmnpm install @dsar/storage-filesystem
pnpmpnpm add @dsar/storage-filesystem
yarnyarn add @dsar/storage-filesystem
bunbun add @dsar/storage-filesystem

Setup

Configuration

OptionDefaultDescription
baseDirLocal directory for artifacts and sidecar metadata (required)
prefixartifactsKey prefix used by the deterministic key builder
retryMaxAttempts1Retries for retriable filesystem failures

Key Layout

Default deterministic key format:

Fallback values:

  • missing requestIdrequest-unknown
  • missing manifestIdmanifest-unknown
  • missing categoryuncategorized
  • missing name/id → artifact.bin

Error and Retry Behaviour

CategoryRetriableExamples
timeoutyesoperation timeout (ETIMEDOUT)
networkyestemporary resource pressure (EAGAIN, EBUSY)
validationnoinvalid key/path traversal, missing object
confignobase directory permission/configuration issues
unknownnounmatched filesystem errors

Manifest Linkage

Manifest metadata is stored in sidecar JSON files alongside artifacts so linkage survives process restarts. Each artifact reference preserves:

  • requestId
  • manifestId
  • manifestHash
  • manifestSignature

Related