Azure Blob storage provider.
-
connect(): Promise<void>
Establishes the Azure client — injects the SDK lazily or uses injected client.
-
delete(path: string): Promise<boolean>
Deletes an object from Azure Blob Storage.
-
disconnect(): Promise<void>
Disconnect is a no-op for Azure (connectionless HTTP client).
-
exists(path: string): Promise<boolean>
Reports whether an object exists in Azure Blob Storage.
-
get(path: string): Promise<Uint8Array | null>
Retrieves an object from Azure Blob Storage;
nullwhen absent. -
getSignedUrl(): Promise<string>path: string,options: { expiresIn: number; }
Creates a SAS URL for an Azure Blob.
-
getStream(path: string): Promise<ReadableStream<Uint8Array> | null>
Native stream download — adapts Azure
readableStreamBody(Node Readable) into a webReadableStreamvia async iteration. -
isHealthy: () => Promise<boolean>
M70c: delegates to the injected client's optional
isHealthy?()(the real adapter calls the container client'sexists()). Assigned inconnect()only when the client provides the member; a client that omits it is unknown, and the indicator reads absence (notfalse) as that. -
isReady(): boolean
Reports readiness.
-
put(): Promise<void>path: string,data: Uint8Array,options?: PutObjectOptions
Stores an object in Azure Blob Storage, recording any content type and user metadata on the blob so a SAS URL serves it under the right type.
Google Cloud Storage provider.
-
connect(): Promise<void>
Establishes the GCS client — injects the SDK lazily or uses injected client.
-
delete(path: string): Promise<boolean>
Deletes an object from GCS.
-
disconnect(): Promise<void>
Disconnect is a no-op for GCS (connectionless HTTP client).
-
exists(path: string): Promise<boolean>
Reports whether an object exists in GCS.
-
get(path: string): Promise<Uint8Array | null>
Retrieves an object from GCS;
nullwhen absent. -
getSignedUrl(): Promise<string>path: string,options: { expiresIn: number; }
Creates a signed GET URL for a GCS object.
-
getStream(path: string): Promise<ReadableStream<Uint8Array> | null>
Native stream download — adapts GCS
createReadStream()(Node Readable) into a webReadableStreamvia async iteration (nonode:import needed). -
isHealthy: () => Promise<boolean>
M70c: delegates to the injected client's optional
isHealthy?()(the real adapter callsbucket.exists()). Assigned inconnect()only when the client provides the member; a client that omits it is unknown, and the indicator reads absence (notfalse) as that. -
isReady(): boolean
Reports readiness.
-
put(): Promise<void>path: string,data: Uint8Array,options?: PutObjectOptions
Stores an object in GCS, recording any content type and user metadata on the object itself so a signed URL serves it under the right type.
Local file-system storage provider.
-
connect(): Promise<void>
Connects, and PROVES the root is writable rather than assuming it.
-
delete(path: string): Promise<boolean>
Deletes an object from disk.
-
disconnect(): Promise<void>
Disconnect is a no-op for local storage.
-
exists(path: string): Promise<boolean>
Reports whether an object exists on disk.
-
get(path: string): Promise<Uint8Array | null>
Retrieves an object from disk;
nullwhen absent. -
getSignedUrl(): Promise<string>_path: string,_options: { expiresIn: number; }
Throws — local storage cannot produce signed URLs.
-
isHealthy(): Promise<boolean>
M70c:
runtime.fs.stat(root)succeeds — a disk that vanished or a permission change is a real, common failure. -
isReady(): boolean
Reports readiness (true when fs is present and connected).
-
put(): Promise<void>path: string,data: Uint8Array,_options?: PutObjectOptions
Stores an object on disk.
In-memory storage provider backed by Map<string, Uint8Array>.
-
connect(): Promise<void>
Connect is a no-op for the memory provider.
-
delete(path: string): Promise<boolean>
Deletes an object from memory.
-
disconnect(): Promise<void>
Disconnect is a no-op for the memory provider.
-
exists(path: string): Promise<boolean>
Reports whether an object exists in memory.
-
get(path: string): Promise<Uint8Array | null>
Retrieves an object from memory;
nullwhen absent. -
getSignedUrl(): Promise<string>path: string,options: { expiresIn: number; }
Returns a synthetic memory:// URL with expiry query parameter.
-
isHealthy(): Promise<boolean>
M70c: an in-memory store has no backend to be unreachable, so it is always reachable (M47).
-
isReady(): boolean
Reports readiness (memory is always ready once connected).
-
put(): Promise<void>path: string,data: Uint8Array,_options?: PutObjectOptions
Stores an object in memory.
AWS S3 storage provider.
-
connect(): Promise<void>
Establishes the S3 client — injects the SDK lazily or uses injected client.
-
delete(path: string): Promise<boolean>
Deletes an object from S3.
-
disconnect(): Promise<void>
Disconnect is a no-op for S3 (connectionless HTTP client).
-
exists(path: string): Promise<boolean>
Reports whether an object exists in S3.
-
get(path: string): Promise<Uint8Array | null>
Retrieves an object from S3;
nullwhen absent. -
getSignedUrl(): Promise<string>path: string,options: { expiresIn: number; }
Creates a presigned GET URL for an S3 object.
-
getStream(path: string): Promise<ReadableStream<Uint8Array> | null>
Native stream download — zero-copy from S3.
-
isHealthy(): Promise<boolean>
M70c: a
client.head('')-shaped bucket probe using the existingheadmember. Resolvestruewhen the bucket answers,falsewhen it does not (or the provider is not connected). -
isReady(): boolean
Reports readiness.
-
put(): Promise<void>path: string,data: Uint8Array,options?: PutObjectOptions
Stores an object in S3, recording any content type and user metadata on the object itself — which is what makes a presigned URL render in a browser instead of downloading as
application/octet-stream.
Storage service backed by a pluggable provider.
-
delete(path: string): Promise<boolean>
Deletes an object.
-
exists(path: string): Promise<boolean>
Reports whether an object exists.
-
get(path: string): Promise<Uint8Array>
Retrieves an object.
-
getSignedUrl(): Promise<string>path: string,options: SignedUrlOptions
Creates a time-limited URL granting direct access to an object.
-
getStream(path: string): Promise<ReadableStream<Uint8Array>>
Retrieves an object as a streaming body for zero-copy downloads.
-
put(): Promise<void>path: string,data: Uint8Array,options?: PutObjectOptions
Stores an object.
Reports whether key-based SAS signing is possible for these options.
Creates an upload middleware factory.
Retrieves uploaded files for a given field name from ctx.state.
Creates the StoragePlugin.
Options for AzureBlobProvider.
-
accountKey: string
Azure storage account key (required for SAS signing).
-
accountName: string
Azure storage account name.
-
client: IAzureBlobClient
Injected structural client (bypasses lazy import).
-
connectionString: string
Azure connection string (alternative to accountName + accountKey).
-
containerName: string
Container name.
The Azure Blob Storage arm.
-
options: AzureBlobProviderOptions
Container and credentials;
containerNameis required. -
provider: "azure"
Selects the Azure Blob backend.
Options for GcsProvider.
-
bucket: string
Bucket name.
-
client: IGcsClient
Injected structural client (bypasses lazy import).
-
projectId: string
GCP project ID.
The Google Cloud Storage arm.
-
options: GcsProviderOptions
Bucket and project;
bucketis required. -
provider: "gcs"
Selects the GCS backend.
Minimal Azure Blob client shape for structural injection.
- getContainerClient(_name: string): unknown
-
getSignedUrl(): Promise<string>_path: string,_expiresIn: number
Creates a SAS-signed URL. Added by adaptAzureModule internally.
-
isHealthy(): Promise<boolean>
M70c: resolves when the container is reachable — the real adapter calls the container client's
exists(). Optional so a minimal injected fake still type-checks.
Minimal GCS client shape for structural injection.
- bucket(_name?: string): unknown
-
isHealthy(): Promise<boolean>
M70c: resolves when the bucket is reachable — the real adapter calls
bucket.exists(). Optional so a minimal injected fake still type-checks.
The S3 BACKEND surface this package drives — not an @aws-sdk/client-s3
client.
- delete(path: string): Promise<boolean>
- get(path: string): Promise<Uint8Array | null>
-
getSignedUrl(): Promise<string>path: string,expiresIn: number
- getStream(path: string): Promise<ReadableStream<Uint8Array> | null>
- head(path: string): Promise<boolean>
-
put(): Promise<void>path: string,data: Uint8Array,options?: PutObjectOptions
The S3 BACKEND surface this package drives — not an @aws-sdk/client-s3
client.
- delete(path: string): Promise<boolean>
- get(path: string): Promise<Uint8Array | null>
-
getSignedUrl(): Promise<string>path: string,expiresIn: number
- getStream(path: string): Promise<ReadableStream<Uint8Array> | null>
- head(path: string): Promise<boolean>
-
put(): Promise<void>path: string,data: Uint8Array,options?: PutObjectOptions
Object storage abstraction.
-
delete(path: string): Promise<boolean>
Deletes an object.
-
exists(path: string): Promise<boolean>
Reports whether an object exists.
-
get(path: string): Promise<Uint8Array>
Retrieves an object.
-
getSignedUrl(): Promise<string>path: string,options: SignedUrlOptions
Creates a time-limited URL granting direct access to an object.
-
getStream(path: string): Promise<ReadableStream<Uint8Array>>
Retrieves an object as a streaming body for zero-copy downloads.
-
put(): Promise<void>path: string,data: Uint8Array,options?: PutObjectOptions
Stores an object.
The local-filesystem arm.
-
options: LocalStorageProviderOptions
Root directory configuration.
-
provider: "local"
Selects the local-filesystem backend.
Options for LocalStorageProvider.
-
rootDir: string
Root directory for stored objects.
The default arm: in-memory storage, which takes no configuration.
-
provider: "memory"
Selects the memory backend. Optional — an omitted provider means memory.
Object attributes accepted alongside the bytes when storing an object.
-
contentType: string
MIME type recorded on the stored object (e.g.
'image/png'). Omitted leaves the backend's own default, which isapplication/octet-streamon every provider that supports the field. -
metadata: Readonly<Record<string, string>>
Arbitrary user metadata recorded alongside the object. Keys and values are passed through to the backend unmodified; backends impose their own limits on size and on which characters a key may contain.
Options for S3Provider (and 'b2' preset).
-
accessKeyId: string
AWS access key ID.
-
bucket: string
Bucket name.
-
client: IS3Backend
An implementation of the S3 backend, bypassing the lazy SDK import.
-
endpoint: string
Custom S3-compatible endpoint (R2, MinIO, B2).
-
region: string
AWS region.
-
secretAccessKey: string
AWS secret access key.
The S3 arm, shared by 's3' and the 'b2' (Backblaze) preset, which reaches
the same provider over B2's S3-compatible endpoint.
-
options: S3ProviderOptions
Bucket and credentials;
bucketis required. -
provider: "s3" | "b2"
Selects the S3 backend, or the Backblaze B2 preset over it.
Options accepted when creating a signed URL.
-
expiresIn: number
URL validity in seconds.
A single parsed file from a multipart upload.
-
data: Uint8Array
File bytes.
-
filename: string
The client-provided original file name (Content-Disposition
filename="…"). Always present: since M94b a part carrying NOfilenameunder the field name is a plain form value, not an upload (an emptyfilename=""— an empty file input — still is one). -
mimeType: string
MIME type reported by the client.
-
name: string
The form field name the file was uploaded under (Content-Disposition
name="…"). -
size: number
File size in bytes.
Options for the upload middleware factory.
-
allowedMimeTypes: readonly string[]
Allowed MIME-type allow-list (optional).
-
fieldname: string
Form field name to extract (default
'file'). -
maxBodyBytes: number
Hard ceiling, in bytes, on the request body this middleware will PARSE (default 50 MB). The effective bound is
min(maxSize * 2 + framing allowance, maxBodyBytes), so raisingmaxSizeraises the bound only up to this ceiling. -
maxFiles: number
Maximum number of files (default unlimited).
-
maxSize: number
Maximum per-file size in bytes (default 10 MB).
| LocalStorageOptions
| S3StorageOptions
| GcsStorageOptions
| AzureStorageOptions
Top-level options passed to StoragePlugin: a union discriminated
on provider, so each backend's options are checked against that backend's
own shape.
| S3ProviderOptions
| GcsProviderOptions
| AzureBlobProviderOptions
Union of per-provider option shapes.
Supported storage back-ends.
Usage
import * as __setu_ts_storage_plugin____file_object_storage_with_pluggable_providers__memory__local_FS__S3__GCS__Azure_Blob__and_an_upload_middleware___Registers___linkcode_IStorage__under__CAPABILITIES_STORAGE__ from "storage-plugin/src/index.ts";