Setu-TS
    Preparing search index...

    Class StorageService

    Storage service backed by a pluggable provider.

    The committed IStorage.get throws when an object is absent; providers signal absence with null, and this service performs the null → throw conversion so the throw contract lives in one place.

    Every method is async, which is load-bearing rather than stylistic: this class is exported, so an application can hand it its own provider (structural typing needs no StorageProvider import), and a non-async return provider.x() would let that provider's SYNCHRONOUS throw escape IStorage before the promise exists, where a caller using .catch() can never see it. async turns it into a rejection.

    When its StoragePlugin was opted into diagnostics (M98m), each public operation settlement is additionally counted under one approved alias. The getStream buffered fallback shares the private unobserved buffered read with get, so one fallback is exactly ONE getStream observation — the internal read is never counted as a second public get, and a concurrent public get is never suppressed. A service constructed directly carries no collector and runs unobserved.

    0.1.0

    Implements

    Index
    • Retrieves an object as a streaming body for zero-copy downloads.

      Delegates to the provider's optional getStream; falls back to wrapping the buffered get result in a one-chunk ReadableStream when the provider lacks native streaming support.

      Observation records the ACQUISITION of the stream — or, for the buffered fallback, the buffered read behind it — and its outcome. Transfer completion is unknown and never claimed: the stream is returned to the caller untouched, with no diagnostic read, tee, wrap or listener.

      Parameters

      • path: string

        Object path/key

      Returns Promise<ReadableStream<Uint8Array<ArrayBufferLike>>>

      A ReadableStream of object bytes

      If the object does not exist

    • Stores an object.

      Parameters

      • path: string

        Object path/key

      • data: Uint8Array

        Object bytes

      • Optionaloptions: PutObjectOptions

        Object attributes to record with the bytes; forwarded to the provider verbatim, and omitted entirely when the caller omits it, so a provider can tell "no attributes given" from "empty attributes given"

      Returns Promise<void>