/** * Vault Storage Configuration * * Configuration for external storage providers (S3, etc.) */ export interface S3StorageConfig { /** Storage type identifier */ type: 's3'; /** S3 bucket name */ bucket: string; /** AWS region */ region: string; /** Optional endpoint for S3-compatible services (MinIO, etc.) */ endpoint?: string; /** Access key ID (optional if using IAM roles) */ accessKeyId?: string; /** Secret access key (optional if using IAM roles) */ secretAccessKey?: string; /** Use path-style addressing (required for some S3-compatible services) */ forcePathStyle?: boolean; /** Pre-signed URL expiration in seconds (default: 3600 = 1 hour) */ presignedUrlExpiry?: number; /** Maximum file size in bytes (default: 5GB) */ maxFileSize?: number; /** Key prefix for vault storage (default: 'vaults/') */ keyPrefix?: string; } export interface StorageConfig { /** Storage provider configuration */ provider: S3StorageConfig; /** Inline threshold in bytes - files smaller than this are sent inline */ inlineThreshold?: number; /** Enable checksum verification */ verifyChecksum?: boolean; } /** * Storage reference for a vault stored externally */ export interface VaultStorageReference { /** Storage type */ type: 's3' | 'ipfs' | 'arweave' | 'http'; /** Storage URI (s3://bucket/key, ipfs://cid, https://...) */ uri: string; /** SHA-256 checksum of the ciphertext */ checksum: string; /** Size in bytes */ size: number; /** Content type */ contentType?: string; /** Storage-specific metadata */ metadata?: Record; } /** * Pre-signed URL response for uploads */ export interface PresignedUploadUrl { /** URL to upload to */ uploadUrl: string; /** HTTP method to use (PUT or POST) */ method: 'PUT' | 'POST'; /** Headers to include in the upload request */ headers?: Record; /** Fields to include in the form data (for POST uploads) */ fields?: Record; /** URL expiration time */ expiresAt: string; /** Storage key that will be assigned */ storageKey: string; /** Final URI after upload completes */ finalUri: string; } /** * Pre-signed URL response for downloads */ export interface PresignedDownloadUrl { /** URL to download from */ downloadUrl: string; /** URL expiration time */ expiresAt: string; /** Expected file size */ size?: number; /** Expected checksum */ checksum?: string; } /** * Default configuration values */ export declare const DEFAULT_STORAGE_CONFIG: { /** Default inline threshold: 5 MB */ INLINE_THRESHOLD: number; /** Default pre-signed URL expiry: 1 hour */ PRESIGNED_URL_EXPIRY: number; /** Default max file size: 5 GB */ MAX_FILE_SIZE: number; /** Default key prefix */ KEY_PREFIX: string; };