Beignet API reference
    Preparing search index...

    App-facing object storage port.

    Implement this with S3, R2, local disk, or a test adapter. Application code should depend on this interface instead of provider-specific SDKs.

    interface StoragePort {
        delete(key: string): Promise<boolean>;
        exists(key: string): Promise<boolean>;
        get(key: string): Promise<StorageObjectBody | null>;
        publicUrl(key: string): Promise<string | null>;
        put(
            key: string,
            body: StorageBody,
            options?: StoragePutOptions,
        ): Promise<StorageObject>;
        stat(key: string): Promise<StorageObject | null>;
        temporaryUrl(
            key: string,
            options: StorageTemporaryUrlOptions,
        ): Promise<StorageTemporaryUrlResult>;
    }
    Index
    • Delete an object.

      Parameters

      • key: string

      Returns Promise<boolean>

      true when the object existed.

    • Return whether an object exists.

      Parameters

      • key: string

      Returns Promise<boolean>

    • Return object metadata and body, or null when missing.

      Parameters

      • key: string

      Returns Promise<StorageObjectBody | null>

    • Return a public URL when the object is public and the adapter can build one.

      Parameters

      • key: string

      Returns Promise<string | null>

    • Return object metadata without its body, or null when missing.

      Parameters

      • key: string

      Returns Promise<StorageObject | null>

    • Issue a temporary GET URL with attachment disposition and private, non-cacheable delivery. Does not authenticate or authorize the caller. Unsupported providers report that capability without checking existence. Provider failures reject; they are not reported as missing objects.

      Parameters

      Returns Promise<StorageTemporaryUrlResult>