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