import { CreateBucketCommand, DeleteObjectCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, PutObjectCommand } from "@aws-sdk/client-s3"; import { type BlobRef, type BlobStorage, type StoreBlobOptions } from "veryfront/workflow/blob"; import { type S3BlobStorageStreamUploader } from "./multipart-upload.js"; /** AWS commands issued through the injectable client boundary. */ export type S3BlobStorageCommand = CreateBucketCommand | DeleteObjectCommand | GetObjectCommand | HeadBucketCommand | HeadObjectCommand | PutObjectCommand; /** Provider request options required by the storage implementation. */ export interface S3BlobStorageSendOptions { abortSignal?: AbortSignal; } /** Minimal client boundary used by the storage implementation and deterministic tests. */ export interface S3BlobStorageClient { send(command: S3BlobStorageCommand, options?: S3BlobStorageSendOptions): Promise; destroy?(): void; } /** Injectable provider seams for deterministic tests and custom transports. */ export interface S3BlobStorageDependencies { /** S3-compatible command client. */ client?: S3BlobStorageClient; /** Required for stream uploads when a custom client is supplied. */ streamUploader?: S3BlobStorageStreamUploader; } /** Explicit S3 connection, transport, and object-layout configuration. */ export interface S3BlobStorageConfig { /** AWS region used by the client and bucket creation. */ region: string; /** S3 bucket name. */ bucket: string; /** AWS access-key id. */ accessKeyId: string; /** AWS secret access key. */ secretAccessKey: string; /** Optional temporary-credential session token. */ sessionToken?: string; /** Optional S3-compatible endpoint. */ endpoint?: string; /** Force path-style requests for S3-compatible services. */ forcePathStyle?: boolean; /** Maximum attempts, including the initial request. Defaults to three. */ maxAttempts?: number; /** Explicit SDK retry algorithm. Defaults to standard. */ retryMode?: "standard" | "adaptive"; /** Use AWS dual-stack endpoints. Defaults to false. */ useDualstackEndpoint?: boolean; /** Use AWS FIPS endpoints. Defaults to false. */ useFipsEndpoint?: boolean; /** Resolve an ARN's region instead of the configured region. Defaults to false. */ useArnRegion?: boolean; /** Request-checksum policy. Defaults to the SDK's deterministic supported policy. */ requestChecksumCalculation?: "WHEN_SUPPORTED" | "WHEN_REQUIRED"; /** Response-checksum policy. Defaults to the SDK's deterministic supported policy. */ responseChecksumValidation?: "WHEN_SUPPORTED" | "WHEN_REQUIRED"; /** Disable S3 Express session authentication. Defaults to false. */ disableS3ExpressSessionAuth?: boolean; /** Multipart part size for unknown-length streams. Defaults to 8 MiB. */ multipartPartSize?: number; /** Concurrent multipart requests for unknown-length streams. Defaults to two. */ multipartQueueSize?: number; /** Object-key prefix applied verbatim before each blob id. */ prefix?: string; /** Public base URL used only to populate `BlobRef.url`. */ baseUrl?: string; /** Default TTL in seconds. Zero means no expiry. */ defaultTtl?: number; /** Check for and create a missing bucket before the first upload. */ autoCreateBucket?: boolean; /** Cancellation signal applied to provider requests. */ signal?: AbortSignal; } /** AWS S3 implementation of the framework-owned `BlobStorage` interface. */ export declare class S3BlobStorage implements BlobStorage { #private; constructor(config: S3BlobStorageConfig, dependencies?: S3BlobStorageDependencies); close(): void; put(data: string | Uint8Array | Blob | ReadableStream, options?: StoreBlobOptions): Promise; getStream(id: string): Promise; getText(id: string): Promise; getBytes(id: string): Promise; delete(id: string): Promise; exists(id: string): Promise; stat(id: string): Promise; } //# sourceMappingURL=s3-storage.d.ts.map