@nestm/storage 0.1.0-alpha.8 → 0.1.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"files-sdk.driver.js","sourceRoot":"","sources":["../../src/files-sdk/files-sdk.driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EACL,KAAK,EACL,UAAU,EACV,QAAQ,GAeT,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AA+B5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAOxE,MAAM,oCAAoC,GAAG;IAC3C,4BAA4B;IAC5B,uBAAuB;IACvB,mBAAmB;IACnB,mBAAmB;IACnB,gCAAgC;IAChC,iBAAiB;IACjB,oBAAoB;IACpB,mBAAmB;IACnB,qBAAqB;IACrB,aAAa;IACb,SAAS;IACT,sBAAsB;IACtB,oBAAoB;IACpB,mBAAmB;CACX,CAAC;AAEX,MAAM,2BAA2B,GAAG;IAClC,GAAG,oCAAoC;IACvC,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,QAAQ;IACR,MAAM;IACN,MAAM;IACN,MAAM;IACN,uBAAuB;IACvB,iBAAiB;IACjB,iBAAiB;IACjB,WAAW;IACX,sBAAsB;IACtB,mBAAmB;IACnB,kBAAkB;IAClB,eAAe;IACf,wBAAwB;IACxB,QAAQ;IACR,KAAK;CACG,CAAC;AAkBX,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAGpC,CAAC;AACJ,MAAM,qBAAqB,GAAG,IAAI,OAAO,EAAU,CAAC;AACpD,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAA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AAG,OAAO;YACV,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS;gBAC/B,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC5D,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS;gBAC9B,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;YACzD,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS;gBAC/B,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;SAC7D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,UAAU,oBAAoB,CAClC,OAA2C;IAE3C,OAAO,IAAI,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { Readable } from 'node:stream';\n\nimport {\n Files,\n FilesError,\n handlers,\n type Adapter,\n type Body,\n type DownloadOptions,\n type FilesOptions,\n type FilesPlugin,\n type ListOptions,\n type OperationOptions,\n type RetryOptions,\n type SearchOptions,\n type SignUploadOptions,\n type StoredFile,\n type UploadOptions,\n type UploadResult,\n type UrlOptions,\n} from 'files-sdk';\n\nimport {\n StorageError,\n StorageErrorCode,\n isStorageError,\n} from '../storage.error.js';\nimport {\n isCanonicalStorageEtag,\n normalizeProviderStorageEtag,\n} from '../storage-etag.js';\nimport type { StorageDriver } from '../storage.driver.js';\nimport type {\n StorageBody,\n StorageConditionalCopyDestinationCapability,\n StorageConditionalCopySourceCapability,\n StorageConditionalDeleteCapability,\n StorageConditionalDeleteOptions,\n StorageConditionalMultipartCompletionCapability,\n StorageConditionalReadCapability,\n StorageConditionalReadOptions,\n StorageConditionalUploadOptions,\n StorageConditionalWriteCapability,\n StorageDownloadOptions,\n StorageListOptions,\n StorageListResult,\n StorageObject,\n StorageObjectMetadata,\n StorageOperationOptions,\n StoragePhysicalKeyCapability,\n StoragePromotionOptions,\n StorageRetryOptions,\n StorageSearchOptions,\n StorageSignedUploadPolicyCapability,\n StorageSignedDownloadPolicyCapability,\n StorageSignedDownloadOptions,\n StorageSignedUpload,\n StorageSignedUploadOptions,\n StorageUploadOptions,\n StorageUploadResult,\n} from '../storage.types.js';\nimport { getFilesSdkUploadControl } from '../storage-upload-control.js';\n\nexport type FilesSdkDriverOptions<AdapterType extends Adapter> =\n FilesOptions<AdapterType>;\n\nexport type FilesSdkS3AdapterProvenance = 'native' | 'verified' | 'unverified';\n\nconst FILES_SDK_S3_RESERVED_EXTENSION_KEYS = [\n 'conditionalCopyDestination',\n 'conditionalCopySource',\n 'conditionalCreate',\n 'conditionalDelete',\n 'conditionalMultipartCompletion',\n 'conditionalRead',\n 'conditionalReplace',\n 'deleteConditional',\n 'downloadConditional',\n 'physicalKey',\n 'promote',\n 'signedDownloadPolicy',\n 'signedUploadPolicy',\n 'uploadConditional',\n] as const;\n\nconst FILES_SDK_S3_AUTHORITY_KEYS = [\n ...FILES_SDK_S3_RESERVED_EXTENSION_KEYS,\n 'bucket',\n 'copy',\n 'delete',\n 'deleteMany',\n 'download',\n 'exists',\n 'head',\n 'list',\n 'move',\n 'reportsUploadProgress',\n 'resumableUpload',\n 'signedUploadUrl',\n 'signedUrl',\n 'supportsCacheControl',\n 'supportsDelimiter',\n 'supportsMetadata',\n 'supportsRange',\n 'supportsServerSideCopy',\n 'upload',\n 'url',\n] as const;\n\ntype FilesSdkS3AuthorityKey = (typeof FILES_SDK_S3_AUTHORITY_KEYS)[number];\n\ninterface FilesSdkS3AuthoritySnapshotEntry {\n readonly present: boolean;\n readonly value: unknown;\n}\n\ntype FilesSdkS3AuthoritySnapshot = Readonly<\n Record<FilesSdkS3AuthorityKey, FilesSdkS3AuthoritySnapshotEntry>\n>;\n\ninterface FilesSdkS3AdapterProvenanceRecord {\n readonly provenance: FilesSdkS3AdapterProvenance;\n readonly surface: FilesSdkS3AuthoritySnapshot;\n}\n\nconst s3AdapterProvenance = new WeakMap<\n object,\n FilesSdkS3AdapterProvenanceRecord\n>();\nconst undecoratedS3Adapters = new WeakSet<object>();\nconst s3AdapterAuthority = new WeakMap<object, object>();\nconst s3MethodAuthority = new WeakMap<Function, object>();\nconst s3AuthorityState = new WeakMap<\n object,\n {\n readonly raw: object;\n readonly record?: FilesSdkS3AdapterProvenanceRecord;\n }\n>();\nconst conflictingS3Authority = Symbol('conflictingS3Authority');\n\nfunction adapterRawObject(adapter: Adapter): object | undefined {\n try {\n const raw = adapter.raw;\n return (typeof raw === 'object' && raw !== null) ||\n typeof raw === 'function'\n ? raw\n : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction s3AdapterAuthorityTokenOf(\n adapter: Adapter,\n): object | typeof conflictingS3Authority | undefined {\n let resolved = s3AdapterAuthority.get(adapter);\n const consider = (token: object | undefined): boolean => {\n if (token === undefined) return true;\n if (resolved !== undefined && resolved !== token) return false;\n resolved = token;\n return true;\n };\n try {\n const candidate = adapter as unknown as Record<PropertyKey, unknown>;\n for (const key of FILES_SDK_S3_AUTHORITY_KEYS) {\n if (!(key in candidate)) continue;\n const value = candidate[key];\n if (\n typeof value === 'function' &&\n !consider(s3MethodAuthority.get(value))\n ) {\n return conflictingS3Authority;\n }\n }\n return resolved;\n } catch {\n return conflictingS3Authority;\n }\n}\n\nfunction bindS3AdapterAuthorityMethods(adapter: Adapter, token: object): void {\n const candidate = adapter as unknown as Record<PropertyKey, unknown>;\n for (const key of FILES_SDK_S3_AUTHORITY_KEYS) {\n if (!(key in candidate)) continue;\n const value = candidate[key];\n if (typeof value !== 'function') continue;\n const existing = s3MethodAuthority.get(value);\n if (existing !== undefined && existing !== token) {\n throw new TypeError('S3 adapter methods have conflicting authority.');\n }\n s3MethodAuthority.set(value, token);\n }\n}\n\nfunction attachS3AdapterAuthority(adapter: Adapter, raw: object): object {\n const existing = s3AdapterAuthorityTokenOf(adapter);\n if (existing === conflictingS3Authority) {\n throw new TypeError('S3 adapter authority is inconsistent.');\n }\n const token = existing ?? Object.freeze({});\n const state = s3AuthorityState.get(token);\n if (state !== undefined && state.raw !== raw) {\n throw new TypeError('S3 adapter authority raw client cannot be changed.');\n }\n if (state === undefined) s3AuthorityState.set(token, { raw });\n s3AdapterAuthority.set(adapter, token);\n bindS3AdapterAuthorityMethods(adapter, token);\n return token;\n}\n\nfunction setS3AdapterProvenance(\n target: object,\n adapter: Adapter,\n provenance: FilesSdkS3AdapterProvenance,\n): FilesSdkS3AdapterProvenanceRecord {\n const existing = s3AdapterProvenanceOfRaw(target);\n if (existing !== undefined) {\n if (\n existing.provenance !== provenance ||\n mismatchedS3Authority(adapter, existing.surface) !== undefined\n ) {\n throw new TypeError('S3 adapter provenance cannot be changed.');\n }\n s3AdapterProvenance.set(target, existing);\n return existing;\n }\n const record = Object.freeze({\n provenance,\n surface: s3AuthoritySnapshot(adapter),\n });\n s3AdapterProvenance.set(target, record);\n return record;\n}\n\nfunction s3AdapterProvenanceOfRaw(\n raw: object,\n): FilesSdkS3AdapterProvenanceRecord | undefined {\n return s3AdapterProvenance.get(raw);\n}\n\nfunction s3AuthoritySnapshot(adapter: Adapter): FilesSdkS3AuthoritySnapshot {\n const candidate = adapter as unknown as Record<PropertyKey, unknown>;\n return Object.freeze(\n Object.fromEntries(\n FILES_SDK_S3_AUTHORITY_KEYS.map((key) => {\n const present = key in candidate;\n return [\n key,\n Object.freeze({\n present,\n value: present ? candidate[key] : undefined,\n }),\n ];\n }),\n ) as Record<FilesSdkS3AuthorityKey, FilesSdkS3AuthoritySnapshotEntry>,\n );\n}\n\nfunction mismatchedS3Authority(\n adapter: Adapter,\n snapshot: FilesSdkS3AuthoritySnapshot,\n): FilesSdkS3AuthorityKey | undefined {\n const candidate = adapter as unknown as Record<PropertyKey, unknown>;\n try {\n return FILES_SDK_S3_AUTHORITY_KEYS.find((key) => {\n const present = key in candidate;\n const expected = snapshot[key];\n return (\n present !== expected.present ||\n !Object.is(present ? candidate[key] : undefined, expected.value)\n );\n });\n } catch {\n return FILES_SDK_S3_AUTHORITY_KEYS[0];\n }\n}\n\n/** Rejects adapters already carrying reserved storage S3 extensions. */\nexport function assertFilesSdkS3AdapterHasNoReservedExtensions(\n adapter: Adapter,\n): void {\n const reserved = filesSdkS3ReservedExtensionOf(adapter);\n if (reserved !== undefined) {\n throw new TypeError(\n `S3 adapter already defines reserved extension \"${reserved}\".`,\n );\n }\n}\n\nfunction filesSdkS3ReservedExtensionOf(\n adapter: Adapter,\n): (typeof FILES_SDK_S3_RESERVED_EXTENSION_KEYS)[number] | undefined {\n const candidate = adapter as unknown as Record<PropertyKey, unknown>;\n try {\n return FILES_SDK_S3_RESERVED_EXTENSION_KEYS.find((key) => key in candidate);\n } catch {\n return FILES_SDK_S3_RESERVED_EXTENSION_KEYS[0];\n }\n}\n\n/** Records that an S3 adapter was constructed but not provider-decorated. */\nexport function markFilesSdkS3AdapterUndecorated(adapter: Adapter): void {\n const raw = adapterRawObject(adapter);\n if (raw === undefined) {\n throw new TypeError('S3 adapter must expose an object raw client.');\n }\n attachS3AdapterAuthority(adapter, raw);\n undecoratedS3Adapters.add(raw);\n}\n\n/** Records the provider verification state of one decorated S3 adapter. */\nexport function markFilesSdkS3AdapterProvenance(\n adapter: Adapter,\n provenance: FilesSdkS3AdapterProvenance,\n): void {\n const raw = adapterRawObject(adapter);\n if (raw === undefined) {\n throw new TypeError('S3 adapter must expose an object raw client.');\n }\n markFilesSdkS3RawClientProvenance(raw, adapter, provenance);\n}\n\n/** Records final provider verification state on one stable raw S3 client. */\nexport function markFilesSdkS3RawClientProvenance(\n raw: object,\n adapter: Adapter,\n provenance: FilesSdkS3AdapterProvenance,\n): void {\n const authority = attachS3AdapterAuthority(adapter, raw);\n const record = setS3AdapterProvenance(raw, adapter, provenance);\n s3AuthorityState.set(authority, { raw, record });\n bindS3AdapterAuthorityMethods(adapter, authority);\n}\n\nfunction isUndecoratedS3Raw(raw: object): boolean {\n return undecoratedS3Adapters.has(raw);\n}\n\nfunction isStructuralS3Raw(raw: object): boolean {\n try {\n const candidate = raw as {\n readonly config?: unknown;\n readonly send?: unknown;\n };\n return (\n typeof candidate.send === 'function' &&\n typeof candidate.config === 'object' &&\n candidate.config !== null &&\n (candidate.config as { readonly serviceId?: unknown }).serviceId === 'S3'\n );\n } catch {\n return false;\n }\n}\n\n/**\n * Optional adapter extension for providers that can conditionally copy an\n * immutable source identity. Plain files-sdk adapters remain fully supported.\n */\nexport interface FilesSdkConditionalCopyAdapter {\n readonly conditionalCopySource?: StorageConditionalCopySourceCapability;\n readonly conditionalCopyDestination?: StorageConditionalCopyDestinationCapability;\n promote(\n sourceKey: string,\n destinationKey: string,\n options: StoragePromotionOptions,\n ): Promise<void>;\n}\n\n/** Optional adapter extension for native compare-and-set uploads. */\nexport interface FilesSdkConditionalUploadAdapter {\n readonly conditionalCreate?: StorageConditionalWriteCapability;\n readonly conditionalReplace?: StorageConditionalWriteCapability;\n readonly conditionalMultipartCompletion?: StorageConditionalMultipartCompletionCapability;\n uploadConditional(\n key: string,\n body: Body,\n options: StorageConditionalUploadOptions,\n ): Promise<StorageUploadResult>;\n}\n\n/** Optional adapter extension for native compare-and-delete. */\nexport interface FilesSdkConditionalDeleteAdapter {\n readonly conditionalDelete: StorageConditionalDeleteCapability;\n deleteConditional(\n key: string,\n options: StorageConditionalDeleteOptions,\n ): Promise<void>;\n}\n\n/** Optional adapter extension for an exact observed-identity read. */\nexport interface FilesSdkConditionalReadAdapter {\n readonly conditionalRead: StorageConditionalReadCapability;\n downloadConditional(\n key: string,\n options: StorageConditionalReadOptions,\n ): Promise<StorageObject>;\n}\n\n/** Optional provider key budget, measured after the driver prefix is applied. */\nexport interface FilesSdkPhysicalKeyAdapter {\n readonly physicalKey: StoragePhysicalKeyCapability;\n}\n\nexport interface FilesSdkSignedUploadPolicyAdapter {\n readonly signedUploadPolicy: StorageSignedUploadPolicyCapability;\n}\n\nexport interface FilesSdkSignedDownloadPolicyAdapter {\n readonly signedDownloadPolicy: StorageSignedDownloadPolicyCapability;\n}\n\nfunction conditionalCopyAdapterOf(\n adapter: Adapter,\n): FilesSdkConditionalCopyAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('promote' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkConditionalCopyAdapter>;\n const source = candidate.conditionalCopySource;\n const destination = candidate.conditionalCopyDestination;\n if (\n (source === undefined && destination === undefined) ||\n (source !== undefined &&\n (typeof source.etag !== 'boolean' ||\n typeof source.version !== 'boolean')) ||\n (destination !== undefined &&\n (typeof destination.create !== 'boolean' ||\n typeof destination.replace !== 'boolean' ||\n typeof destination.atomicWithSource !== 'boolean')) ||\n typeof candidate.promote !== 'function'\n ) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkConditionalCopyAdapter;\n}\n\nfunction conditionalUploadAdapterOf(\n adapter: Adapter,\n): FilesSdkConditionalUploadAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('uploadConditional' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkConditionalUploadAdapter>;\n const create = candidate.conditionalCreate;\n const replace = candidate.conditionalReplace;\n const multipart = candidate.conditionalMultipartCompletion;\n if (\n (create === undefined && replace === undefined) ||\n (create !== undefined && typeof create.resultEtag !== 'boolean') ||\n (replace !== undefined && typeof replace.resultEtag !== 'boolean') ||\n (multipart !== undefined &&\n (typeof multipart.create !== 'boolean' ||\n typeof multipart.replace !== 'boolean')) ||\n typeof candidate.uploadConditional !== 'function'\n ) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkConditionalUploadAdapter;\n}\n\nfunction conditionalDeleteAdapterOf(\n adapter: Adapter,\n): FilesSdkConditionalDeleteAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('conditionalDelete' in adapter) ||\n !('deleteConditional' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkConditionalDeleteAdapter>;\n if (\n candidate.conditionalDelete === undefined ||\n typeof candidate.conditionalDelete.etag !== 'boolean' ||\n typeof candidate.deleteConditional !== 'function'\n ) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkConditionalDeleteAdapter;\n}\n\nfunction conditionalReadAdapterOf(\n adapter: Adapter,\n): FilesSdkConditionalReadAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('conditionalRead' in adapter) ||\n !('downloadConditional' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkConditionalReadAdapter>;\n if (\n candidate.conditionalRead === undefined ||\n typeof candidate.conditionalRead.etag !== 'boolean' ||\n typeof candidate.conditionalRead.version !== 'boolean' ||\n typeof candidate.downloadConditional !== 'function'\n ) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkConditionalReadAdapter;\n}\n\nfunction physicalKeyAdapterOf(\n adapter: Adapter,\n): FilesSdkPhysicalKeyAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('physicalKey' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter & Partial<FilesSdkPhysicalKeyAdapter>;\n const maxBytes = candidate.physicalKey?.maxBytes;\n if (!Number.isSafeInteger(maxBytes) || (maxBytes ?? 0) <= 0) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkPhysicalKeyAdapter;\n}\n\nfunction signedUploadPolicyAdapterOf(\n adapter: Adapter,\n): FilesSdkSignedUploadPolicyAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('signedUploadPolicy' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkSignedUploadPolicyAdapter>;\n const capability = candidate.signedUploadPolicy;\n if (\n capability === undefined ||\n typeof capability.contentType !== 'boolean' ||\n typeof capability.sizeRange !== 'boolean'\n ) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkSignedUploadPolicyAdapter;\n}\n\nfunction signedDownloadPolicyAdapterOf(\n adapter: Adapter,\n): FilesSdkSignedDownloadPolicyAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('signedDownloadPolicy' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkSignedDownloadPolicyAdapter>;\n const capability = candidate.signedDownloadPolicy;\n if (capability === undefined || typeof capability.expiresIn !== 'boolean') {\n return undefined;\n }\n return candidate as Adapter & FilesSdkSignedDownloadPolicyAdapter;\n}\n\ninterface FilesErrorLike {\n readonly name: string;\n readonly message: string;\n readonly code: FilesError['code'];\n readonly aborted: boolean;\n readonly timedOut: boolean;\n readonly permanent: boolean;\n readonly cause?: unknown;\n}\n\nfunction isFilesErrorCode(value: unknown): value is FilesError['code'] {\n return (\n value === 'NotFound' ||\n value === 'Unauthorized' ||\n value === 'Conflict' ||\n value === 'ReadOnly' ||\n value === 'Provider'\n );\n}\n\nfunction isFilesErrorLike(error: unknown): error is FilesErrorLike {\n if (error instanceof FilesError) {\n return true;\n }\n if (!(error instanceof Error)) {\n return false;\n }\n\n try {\n return (\n error.name === 'FilesError' &&\n typeof error.message === 'string' &&\n 'code' in error &&\n isFilesErrorCode(error.code) &&\n 'aborted' in error &&\n typeof error.aborted === 'boolean' &&\n 'timedOut' in error &&\n typeof error.timedOut === 'boolean' &&\n 'permanent' in error &&\n typeof error.permanent === 'boolean'\n );\n } catch {\n return false;\n }\n}\n\nfunction unwrapFilesError(error: FilesErrorLike): FilesErrorLike {\n const seen = new Set<FilesErrorLike>();\n let current = error;\n\n while (\n current.code === 'Provider' &&\n !current.aborted &&\n !current.timedOut &&\n !current.permanent &&\n isFilesErrorLike(current.cause) &&\n current.message === current.cause.message &&\n !seen.has(current.cause)\n ) {\n seen.add(current);\n current = current.cause;\n }\n\n return current;\n}\n\nconst PUBLIC_PROVIDER_ERROR_MESSAGES: Readonly<\n Record<StorageErrorCode, string>\n> = Object.freeze({\n [StorageErrorCode.NOT_FOUND]: 'Storage provider object was not found.',\n [StorageErrorCode.UNAUTHORIZED]:\n 'Storage provider operation was unauthorized.',\n [StorageErrorCode.CONFLICT]:\n 'Storage provider operation conflicted with current state.',\n [StorageErrorCode.READ_ONLY]: 'Storage provider is read-only.',\n [StorageErrorCode.INVALID_ARGUMENT]:\n 'Storage provider rejected an invalid argument.',\n [StorageErrorCode.NOT_SUPPORTED]:\n 'Storage provider operation is not supported.',\n [StorageErrorCode.ABORTED]: 'Storage provider operation was aborted.',\n [StorageErrorCode.TIMEOUT]: 'Storage provider operation timed out.',\n [StorageErrorCode.LIMIT_EXCEEDED]:\n 'Storage provider operation exceeded a limit.',\n [StorageErrorCode.PROVIDER]: 'Storage provider operation failed.',\n});\n\nfunction sanitizedStorageError(error: StorageError): StorageError {\n return new StorageError(PUBLIC_PROVIDER_ERROR_MESSAGES[error.code], {\n aborted: error.aborted,\n code: error.code,\n permanent: error.permanent,\n timedOut: error.timedOut,\n });\n}\n\nexport function mapFilesSdkError(error: unknown): StorageError {\n if (isStorageError(error)) return sanitizedStorageError(error);\n if (!isFilesErrorLike(error)) {\n return new StorageError('Storage provider operation failed.', {\n code: StorageErrorCode.PROVIDER,\n });\n }\n\n const filesError = unwrapFilesError(error);\n\n if (\n filesError.code === 'Provider' &&\n !filesError.aborted &&\n !filesError.timedOut &&\n !filesError.permanent &&\n isStorageError(filesError.cause) &&\n filesError.message === filesError.cause.message\n ) {\n return sanitizedStorageError(filesError.cause);\n }\n\n let code: StorageErrorCode;\n if (filesError.timedOut) {\n code = StorageErrorCode.TIMEOUT;\n } else if (filesError.aborted) {\n code = StorageErrorCode.ABORTED;\n } else {\n switch (filesError.code) {\n case 'NotFound':\n code = StorageErrorCode.NOT_FOUND;\n break;\n case 'Unauthorized':\n code = StorageErrorCode.UNAUTHORIZED;\n break;\n case 'Conflict':\n code = StorageErrorCode.CONFLICT;\n break;\n case 'ReadOnly':\n code = StorageErrorCode.READ_ONLY;\n break;\n case 'Provider':\n code = /(?:not supported|does not support|unsupported)/iu.test(\n filesError.message,\n )\n ? StorageErrorCode.NOT_SUPPORTED\n : StorageErrorCode.PROVIDER;\n break;\n }\n }\n\n return new StorageError(PUBLIC_PROVIDER_ERROR_MESSAGES[code], {\n aborted: filesError.aborted,\n code,\n permanent: filesError.permanent,\n timedOut: filesError.timedOut,\n });\n}\n\nfunction mapRetryOptions(\n retries: StorageRetryOptions | undefined,\n): RetryOptions | undefined {\n if (retries === undefined || typeof retries === 'number') {\n return retries;\n }\n\n return {\n max: retries.max,\n ...(retries.backoff !== undefined && {\n backoff: ({ attempt, error }) =>\n retries.backoff?.({\n attempt,\n error: mapFilesSdkError(error),\n }) ?? 0,\n }),\n };\n}\n\nfunction storageRetryOptions(\n retries: RetryOptions | undefined,\n): StorageRetryOptions | undefined {\n if (retries === undefined || typeof retries === 'number') {\n return retries;\n }\n return {\n max: retries.max,\n ...(retries.backoff !== undefined && {\n backoff: ({ attempt, error }) =>\n retries.backoff?.({\n attempt,\n error: new FilesError(\n error.code === StorageErrorCode.NOT_FOUND\n ? 'NotFound'\n : error.code === StorageErrorCode.UNAUTHORIZED\n ? 'Unauthorized'\n : error.code === StorageErrorCode.CONFLICT\n ? 'Conflict'\n : error.code === StorageErrorCode.READ_ONLY\n ? 'ReadOnly'\n : 'Provider',\n error.message,\n error,\n {\n aborted: error.aborted,\n permanent: error.permanent,\n timedOut: error.timedOut,\n },\n ),\n }) ?? 0,\n }),\n };\n}\n\nfunction operationOptions(\n options?: StorageOperationOptions,\n): OperationOptions | undefined {\n if (options === undefined) {\n return undefined;\n }\n\n const retries = mapRetryOptions(options.retries);\n return {\n ...(retries !== undefined && { retries }),\n ...(options.signal !== undefined && { signal: options.signal }),\n ...(options.timeout !== undefined && { timeout: options.timeout }),\n };\n}\n\nasync function* normalizeNodeChunks(\n source: Readable,\n): AsyncGenerator<Uint8Array> {\n for await (const chunk of source) {\n if (typeof chunk === 'string') {\n yield new TextEncoder().encode(chunk);\n continue;\n }\n if (chunk instanceof Uint8Array) {\n yield chunk;\n continue;\n }\n throw new StorageError(\n 'Node upload streams must yield strings or Uint8Array chunks.',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n}\n\nfunction mapBody(body: StorageBody): Body {\n if (body instanceof Readable) {\n return Readable.toWeb(\n Readable.from(normalizeNodeChunks(body)),\n ) as ReadableStream<Uint8Array>;\n }\n return body;\n}\n\nfunction normalizeDownloadStream(\n source: ReadableStream<Uint8Array>,\n): ReadableStream<Uint8Array> {\n let reader: ReadableStreamDefaultReader<Uint8Array> | undefined =\n source.getReader();\n\n const release = (): void => {\n reader?.releaseLock();\n reader = undefined;\n };\n\n return new ReadableStream<Uint8Array>({\n async cancel(reason) {\n const activeReader = reader;\n if (activeReader === undefined) {\n return;\n }\n try {\n await activeReader.cancel(reason);\n } catch (error) {\n throw mapFilesSdkError(error);\n } finally {\n release();\n }\n },\n async pull(controller) {\n const activeReader = reader;\n if (activeReader === undefined) {\n controller.close();\n return;\n }\n try {\n const result = await activeReader.read();\n if (result.done) {\n release();\n controller.close();\n return;\n }\n controller.enqueue(result.value);\n } catch (error) {\n release();\n controller.error(mapFilesSdkError(error));\n }\n },\n });\n}\n\nfunction uploadOptions(\n options?: StorageUploadOptions,\n): UploadOptions | undefined {\n if (options === undefined) {\n return undefined;\n }\n return {\n ...operationOptions(options),\n ...(options.cacheControl !== undefined && {\n cacheControl: options.cacheControl,\n }),\n ...(options.contentType !== undefined && {\n contentType: options.contentType,\n }),\n ...(options.control !== undefined && {\n control: getFilesSdkUploadControl(options.control),\n }),\n ...(options.metadata !== undefined && { metadata: options.metadata }),\n ...(options.multipart !== undefined && {\n multipart: options.multipart,\n }),\n ...(options.onProgress !== undefined && {\n onProgress: options.onProgress,\n }),\n };\n}\n\nfunction downloadOptions(options?: StorageDownloadOptions): DownloadOptions {\n return {\n ...operationOptions(options),\n as: 'stream',\n ...(options?.range !== undefined && { range: options.range }),\n };\n}\n\nfunction listOptions(options?: StorageListOptions): ListOptions | undefined {\n if (options === undefined) {\n return undefined;\n }\n return {\n ...operationOptions(options),\n ...(options.cursor !== undefined && { cursor: options.cursor }),\n ...(options.delimiter !== undefined && { delimiter: options.delimiter }),\n ...(options.limit !== undefined && { limit: options.limit }),\n ...(options.prefix !== undefined && { prefix: options.prefix }),\n };\n}\n\nfunction searchOptions(\n options?: StorageSearchOptions,\n): SearchOptions | undefined {\n if (options === undefined) {\n return undefined;\n }\n return {\n ...operationOptions(options),\n ...(options.caseInsensitive !== undefined && {\n caseInsensitive: options.caseInsensitive,\n }),\n ...(options.limit !== undefined && { limit: options.limit }),\n ...(options.match !== undefined && { match: options.match }),\n ...(options.maxResults !== undefined && {\n maxResults: options.maxResults,\n }),\n ...(options.prefix !== undefined && { prefix: options.prefix }),\n };\n}\n\nfunction signedDownloadOptions(\n options?: StorageSignedDownloadOptions,\n): UrlOptions | undefined {\n if (options === undefined) {\n return undefined;\n }\n return {\n ...operationOptions(options),\n ...(options.expiresIn !== undefined && {\n expiresIn: options.expiresIn,\n }),\n ...(options.responseContentDisposition !== undefined && {\n responseContentDisposition: options.responseContentDisposition,\n }),\n };\n}\n\nfunction signedUploadOptions(\n options: StorageSignedUploadOptions,\n): SignUploadOptions {\n return {\n ...operationOptions(options),\n expiresIn: options.expiresIn,\n ...(options.contentType !== undefined && {\n contentType: options.contentType,\n }),\n ...(options.maxSize !== undefined && { maxSize: options.maxSize }),\n ...(options.minSize !== undefined && { minSize: options.minSize }),\n };\n}\n\nfunction providerEtag(\n value: unknown,\n key: string,\n operation: 'download' | 'head' | 'list' | 'search' | 'upload',\n): string | undefined {\n if (value === undefined) {\n return undefined;\n }\n const etag = normalizeProviderStorageEtag(value);\n if (etag === undefined) {\n throw new StorageError('Storage adapter returned an invalid ETag.', {\n code: StorageErrorCode.PROVIDER,\n key,\n operation,\n permanent: true,\n });\n }\n return etag;\n}\n\nfunction invalidConditionalEtag(\n label: string,\n key: string,\n operation: 'delete' | 'download' | 'promote' | 'upload',\n): StorageError {\n return new StorageError(`${label} must be a canonical storage ETag.`, {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key,\n operation,\n permanent: true,\n });\n}\n\nfunction metadataOf(\n file: StoredFile,\n operation: 'download' | 'head' | 'list' | 'search',\n): StorageObjectMetadata {\n const etag = providerEtag(file.etag, file.key, operation);\n return {\n contentType: file.type,\n ...(etag !== undefined && { etag }),\n key: file.key,\n ...(file.lastModified !== undefined && {\n lastModified: new Date(file.lastModified),\n }),\n ...(file.metadata !== undefined && {\n metadata: { ...file.metadata },\n }),\n name: file.name,\n size: file.size,\n };\n}\n\nfunction uploadResultOf(result: UploadResult): StorageUploadResult {\n const etag = providerEtag(result.etag, result.key, 'upload');\n return {\n contentType: result.contentType,\n ...(etag !== undefined && { etag }),\n key: result.key,\n ...(result.lastModified !== undefined && {\n lastModified: new Date(result.lastModified),\n }),\n size: result.size,\n };\n}\n\nfunction normalizeFilesSdkPrefix(prefix: unknown): string {\n if (prefix === undefined) return '';\n if (typeof prefix !== 'string') {\n throw new StorageError('prefix must be a string.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n const normalized = prefix.replaceAll(/^\\/+|(?<!\\/)\\/+$/gu, '');\n if (normalized.length === 0 || normalized.includes('\\0')) {\n throw new StorageError(\n 'prefix must be a non-empty string without null bytes.',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n if (\n normalized.split('/').some((segment) => segment === '.' || segment === '..')\n ) {\n throw new StorageError('prefix must not contain . or .. path segments.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n return normalized;\n}\n\nfunction physicalPluginKey(\n prefix: string,\n key: unknown,\n): { readonly logicalKey: string; readonly physicalKey: string } {\n if (typeof key !== 'string' || key.length === 0) {\n throw new StorageError('The final plugin key must be a non-empty string.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n if (key.includes('\\0')) {\n throw new StorageError(\n 'The final plugin key must not contain null bytes.',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key,\n permanent: true,\n },\n );\n }\n const normalized = key.replace(/^\\/+/u, '');\n if (\n normalized.split('/').some((segment) => segment === '.' || segment === '..')\n ) {\n throw new StorageError(\n 'The final plugin key must not contain . or .. path segments.',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key,\n permanent: true,\n },\n );\n }\n return {\n logicalKey: key,\n physicalKey: prefix.length === 0 ? key : `${prefix}/${normalized}`,\n };\n}\n\nfunction assertPhysicalPluginBudget(\n physicalKey: string,\n maxBytes: number | undefined,\n logicalKey?: string,\n): void {\n if (\n maxBytes === undefined ||\n new TextEncoder().encode(physicalKey).byteLength <= maxBytes\n ) {\n return;\n }\n throw new StorageError(\n `The combined storage prefix and key exceed the provider's ${maxBytes}-byte physical-key limit.`,\n {\n code: StorageErrorCode.LIMIT_EXCEEDED,\n ...(logicalKey !== undefined && { key: logicalKey }),\n permanent: true,\n },\n );\n}\n\nfunction physicalKeyGuardPlugin(\n prefix: string,\n maxBytes: number | undefined,\n): FilesPlugin {\n const assertKey = (key: unknown): string => {\n const resolved = physicalPluginKey(prefix, key);\n assertPhysicalPluginBudget(\n resolved.physicalKey,\n maxBytes,\n resolved.logicalKey,\n );\n return resolved.logicalKey;\n };\n const assertListOptions = (options: unknown): ListOptions | undefined => {\n if (\n options !== undefined &&\n (typeof options !== 'object' || options === null)\n ) {\n throw new StorageError(\n 'The final plugin list options must be an object.',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n const listPrefix = (options as { readonly prefix?: unknown } | undefined)\n ?.prefix;\n if (listPrefix === undefined || listPrefix === '') {\n if (prefix.length > 0) {\n assertPhysicalPluginBudget(`${prefix}/`, maxBytes);\n }\n return options === undefined\n ? undefined\n : (() => {\n const { prefix: _prefix, ...rest } = options as ListOptions;\n return Object.freeze({\n ...rest,\n ...(listPrefix === '' && { prefix: listPrefix }),\n });\n })();\n }\n if (typeof listPrefix !== 'string') {\n throw new StorageError('The final plugin list prefix must be a string.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n const resolved = physicalPluginKey(prefix, listPrefix);\n assertPhysicalPluginBudget(\n resolved.physicalKey,\n maxBytes,\n resolved.logicalKey,\n );\n return Object.freeze({\n ...(options as ListOptions),\n prefix: resolved.logicalKey,\n });\n };\n return {\n name: '@nestm/storage/physical-key-guard',\n wrap: handlers({\n copy: (operation, next) => {\n const from = assertKey(operation.from);\n const to = assertKey(operation.to);\n return next(Object.freeze({ ...operation, from, to }));\n },\n delete: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n download: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n exists: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n head: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n list: (operation, next) => {\n const options = assertListOptions(operation.options);\n return next(\n Object.freeze({\n ...operation,\n ...(options !== undefined && { options }),\n }),\n );\n },\n move: (operation, next) => {\n const from = assertKey(operation.from);\n const to = assertKey(operation.to);\n return next(Object.freeze({ ...operation, from, to }));\n },\n signedUploadUrl: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n upload: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n url: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n }),\n };\n}\n\nexport class FilesSdkStorageDriver<\n AdapterType extends Adapter = Adapter,\n> implements StorageDriver {\n readonly #files: Files<AdapterType>;\n readonly #name: string;\n readonly #conditionalCopy: FilesSdkConditionalCopyAdapter | undefined;\n readonly #conditionalDelete: FilesSdkConditionalDeleteAdapter | undefined;\n readonly #conditionalRead: FilesSdkConditionalReadAdapter | undefined;\n readonly #conditionalUpload: FilesSdkConditionalUploadAdapter | undefined;\n readonly #physicalKey: FilesSdkPhysicalKeyAdapter | undefined;\n readonly #prefix: string;\n readonly #readOnly: boolean;\n readonly #retries: StorageRetryOptions | undefined;\n readonly #signal: AbortSignal | undefined;\n readonly #timeout: number | undefined;\n readonly #signedUploadPolicy: FilesSdkSignedUploadPolicyAdapter | undefined;\n readonly #signedDownloadPolicy:\n FilesSdkSignedDownloadPolicyAdapter | undefined;\n\n constructor(options: FilesSdkDriverOptions<AdapterType>) {\n const raw = adapterRawObject(options.adapter);\n const rawProvenance =\n raw === undefined ? undefined : s3AdapterProvenanceOfRaw(raw);\n const authorityToken = s3AdapterAuthorityTokenOf(options.adapter);\n const authorityState =\n typeof authorityToken === 'object'\n ? s3AuthorityState.get(authorityToken)\n : undefined;\n const authorityInvalid =\n authorityToken === conflictingS3Authority ||\n (authorityState !== undefined &&\n (authorityState.record === undefined ||\n raw === undefined ||\n (raw !== authorityState.raw &&\n rawProvenance !== authorityState.record)));\n const s3Provenance = authorityState?.record ?? rawProvenance;\n if (\n authorityInvalid ||\n (s3Provenance === undefined &&\n raw !== undefined &&\n (isUndecoratedS3Raw(raw) || isStructuralS3Raw(raw)))\n ) {\n throw new StorageError(\n 'Raw S3 adapters must be configured with withS3Capabilities() or createS3StorageDriver().',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n const mismatchedAuthority =\n s3Provenance === undefined\n ? undefined\n : mismatchedS3Authority(options.adapter, s3Provenance.surface);\n if (mismatchedAuthority !== undefined) {\n throw new StorageError(\n `S3 adapter authority \"${mismatchedAuthority}\" does not match its verified provider profile.`,\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n const adapterForFiles =\n s3Provenance === undefined\n ? options.adapter\n : (Object.freeze({ ...options.adapter }) as AdapterType);\n const copiedAuthorityMismatch =\n s3Provenance === undefined\n ? undefined\n : mismatchedS3Authority(adapterForFiles, s3Provenance.surface);\n if (copiedAuthorityMismatch !== undefined) {\n throw new StorageError(\n `S3 adapter authority \"${copiedAuthorityMismatch}\" changed while it was being bound.`,\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n const readOnly =\n options.readonly === true || s3Provenance?.provenance === 'unverified';\n this.#physicalKey = physicalKeyAdapterOf(adapterForFiles);\n const guardedPrefix = normalizeFilesSdkPrefix(options.prefix);\n const plugins = [\n ...(options.plugins ?? []),\n physicalKeyGuardPlugin(\n guardedPrefix,\n this.#physicalKey?.physicalKey.maxBytes,\n ),\n ];\n this.#files = new Files({\n ...options,\n adapter: adapterForFiles,\n plugins,\n readonly: readOnly,\n });\n this.#name = adapterForFiles.name;\n this.#conditionalCopy = conditionalCopyAdapterOf(adapterForFiles);\n this.#conditionalDelete = conditionalDeleteAdapterOf(adapterForFiles);\n this.#conditionalRead = conditionalReadAdapterOf(adapterForFiles);\n this.#conditionalUpload = conditionalUploadAdapterOf(adapterForFiles);\n this.#prefix = this.#files.prefix;\n if (guardedPrefix !== this.#prefix) {\n throw new StorageError('Storage prefix normalization was inconsistent.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n this.#assertPhysicalKeyBudget(this.#prefix);\n this.#readOnly = readOnly;\n this.#retries = storageRetryOptions(options.retries);\n this.#signal = options.signal;\n this.#timeout = options.timeout;\n this.#signedUploadPolicy = signedUploadPolicyAdapterOf(adapterForFiles);\n this.#signedDownloadPolicy = signedDownloadPolicyAdapterOf(adapterForFiles);\n }\n\n get name(): string {\n return this.#name;\n }\n\n get capabilities() {\n const capabilities = this.#files.capabilities;\n return {\n cacheControl: capabilities.cacheControl,\n delimiter: capabilities.delimiter,\n metadata: capabilities.metadata,\n rangeRead: capabilities.rangeRead,\n resumableUpload: !this.#readOnly && capabilities.multipart,\n serverSideCopy: !this.#readOnly && capabilities.serverSideCopy,\n ...(this.#conditionalCopy !== undefined &&\n !this.#readOnly && {\n ...(this.#conditionalCopy.conditionalCopySource !== undefined && {\n conditionalCopySource: {\n ...this.#conditionalCopy.conditionalCopySource,\n },\n }),\n ...(this.#conditionalCopy.conditionalCopyDestination !==\n undefined && {\n conditionalCopyDestination: {\n ...this.#conditionalCopy.conditionalCopyDestination,\n },\n }),\n }),\n ...(this.#conditionalDelete !== undefined &&\n !this.#readOnly && {\n conditionalDelete: {\n ...this.#conditionalDelete.conditionalDelete,\n },\n }),\n ...(this.#conditionalRead !== undefined && {\n conditionalRead: { ...this.#conditionalRead.conditionalRead },\n }),\n ...(this.#conditionalUpload !== undefined &&\n !this.#readOnly && {\n ...(this.#conditionalUpload.conditionalCreate !== undefined && {\n conditionalCreate: {\n ...this.#conditionalUpload.conditionalCreate,\n },\n }),\n ...(this.#conditionalUpload.conditionalReplace !== undefined && {\n conditionalReplace: {\n ...this.#conditionalUpload.conditionalReplace,\n },\n }),\n ...(this.#conditionalUpload.conditionalMultipartCompletion !==\n undefined && {\n conditionalMultipartCompletion: {\n ...this.#conditionalUpload.conditionalMultipartCompletion,\n },\n }),\n }),\n ...(this.#physicalKey !== undefined && {\n physicalKey: { ...this.#physicalKey.physicalKey },\n }),\n signedDownload: { ...capabilities.signedUrl },\n ...(this.#signedDownloadPolicy !== undefined && {\n signedDownloadPolicy: {\n ...this.#signedDownloadPolicy.signedDownloadPolicy,\n },\n }),\n signedUpload: this.#readOnly ? false : ('runtime' as const),\n ...(this.#signedUploadPolicy !== undefined &&\n !this.#readOnly && {\n signedUploadPolicy: {\n ...this.#signedUploadPolicy.signedUploadPolicy,\n },\n }),\n nativeUploadProgress: !this.#readOnly && capabilities.uploadProgress,\n };\n }\n\n async upload(\n key: string,\n body: StorageBody,\n options?: StorageUploadOptions,\n ): Promise<StorageUploadResult> {\n this.#assertLogicalKey(key);\n return this.#call(async () =>\n uploadResultOf(\n await this.#files.upload(key, mapBody(body), uploadOptions(options)),\n ),\n );\n }\n\n uploadConditional(\n key: string,\n body: StorageBody,\n options: StorageConditionalUploadOptions,\n ): Promise<StorageUploadResult> {\n if (\n options.condition.type === 'replace' &&\n !isCanonicalStorageEtag(options.condition.etag)\n ) {\n return Promise.reject(\n invalidConditionalEtag('condition.etag', key, 'upload'),\n );\n }\n if (this.#readOnly) {\n return Promise.reject(\n new StorageError(\n `Cannot call uploadConditional() on a read-only storage adapter.`,\n {\n code: StorageErrorCode.READ_ONLY,\n key,\n operation: 'upload',\n permanent: true,\n },\n ),\n );\n }\n const adapter = this.#conditionalUpload;\n const capability =\n options.condition.type === 'create'\n ? adapter?.conditionalCreate\n : adapter?.conditionalReplace;\n const multipartRequested =\n options.multipart !== undefined && options.multipart !== false;\n const multipartSupported =\n !multipartRequested ||\n (options.condition.type === 'create'\n ? adapter?.conditionalMultipartCompletion?.create === true\n : adapter?.conditionalMultipartCompletion?.replace === true);\n if (\n adapter === undefined ||\n capability === undefined ||\n !multipartSupported\n ) {\n return Promise.reject(\n new StorageError(\n `Storage adapter \"${this.#name}\" does not support conditional upload.`,\n {\n code: StorageErrorCode.NOT_SUPPORTED,\n key,\n operation: 'upload',\n permanent: true,\n },\n ),\n );\n }\n const mergedOptions = this.#conditionalOptions(options);\n return this.#call(async () => {\n const physicalKey = this.#path(key);\n const result = await adapter.uploadConditional(\n physicalKey,\n mapBody(body),\n mergedOptions,\n );\n if (result.key !== physicalKey) {\n throw new StorageError(\n 'Storage adapter returned an unexpected conditional upload key.',\n {\n code: StorageErrorCode.PROVIDER,\n key,\n operation: 'upload',\n permanent: true,\n },\n );\n }\n const etag = providerEtag(result.etag, key, 'upload');\n return {\n ...result,\n ...(etag === undefined ? {} : { etag }),\n key,\n };\n });\n }\n\n async download(\n key: string,\n options?: StorageDownloadOptions,\n ): Promise<StorageObject> {\n this.#assertLogicalKey(key);\n return this.#call(async () => {\n const file = await this.#files.download(key, downloadOptions(options));\n return {\n ...metadataOf(file, 'download'),\n body: normalizeDownloadStream(file.stream()),\n };\n });\n }\n\n downloadConditional(\n key: string,\n options: StorageConditionalReadOptions,\n ): Promise<StorageObject> {\n if (\n options.condition.etag !== undefined &&\n !isCanonicalStorageEtag(options.condition.etag)\n ) {\n return Promise.reject(\n invalidConditionalEtag('condition.etag', key, 'download'),\n );\n }\n const adapter = this.#conditionalRead;\n if (\n adapter === undefined ||\n (options.condition.etag !== undefined && !adapter.conditionalRead.etag) ||\n (options.condition.version !== undefined &&\n !adapter.conditionalRead.version)\n ) {\n return Promise.reject(\n new StorageError(\n `Storage adapter \"${this.#name}\" does not support conditional read.`,\n {\n code: StorageErrorCode.NOT_SUPPORTED,\n key,\n operation: 'download',\n permanent: true,\n },\n ),\n );\n }\n return this.#call(async () => {\n const physicalKey = this.#path(key);\n const object = await adapter.downloadConditional(\n physicalKey,\n this.#conditionalOptions(options),\n );\n if (object.key !== physicalKey) {\n await object.body.cancel().catch(() => undefined);\n throw new StorageError(\n 'Storage adapter returned an unexpected conditional download key.',\n {\n code: StorageErrorCode.PROVIDER,\n key,\n operation: 'download',\n permanent: true,\n },\n );\n }\n let etag: string | undefined;\n try {\n etag = providerEtag(object.etag, key, 'download');\n } catch (error) {\n await object.body.cancel(error).catch(() => undefined);\n throw error;\n }\n return {\n ...object,\n body: normalizeDownloadStream(object.body),\n ...(etag === undefined ? {} : { etag }),\n key,\n name: key.split('/').at(-1) ?? key,\n };\n });\n }\n\n async head(\n key: string,\n options?: StorageOperationOptions,\n ): Promise<StorageObjectMetadata> {\n this.#assertLogicalKey(key);\n return this.#call(async () =>\n metadataOf(\n await this.#files.head(key, operationOptions(options)),\n 'head',\n ),\n );\n }\n\n exists(key: string, options?: StorageOperationOptions): Promise<boolean> {\n this.#assertLogicalKey(key);\n return this.#call(() => this.#files.exists(key, operationOptions(options)));\n }\n\n delete(key: string, options?: StorageOperationOptions): Promise<void> {\n this.#assertLogicalKey(key);\n return this.#call(async () => {\n await this.#files.delete(key, operationOptions(options));\n });\n }\n\n deleteConditional(\n key: string,\n options: StorageConditionalDeleteOptions,\n ): Promise<void> {\n if (!isCanonicalStorageEtag(options.condition.etag)) {\n return Promise.reject(\n invalidConditionalEtag('condition.etag', key, 'delete'),\n );\n }\n if (this.#readOnly) {\n return Promise.reject(\n new StorageError(\n `Cannot call deleteConditional() on a read-only storage adapter.`,\n {\n code: StorageErrorCode.READ_ONLY,\n key,\n operation: 'delete',\n permanent: true,\n },\n ),\n );\n }\n const adapter = this.#conditionalDelete;\n if (adapter === undefined || !adapter.conditionalDelete.etag) {\n return Promise.reject(\n new StorageError(\n `Storage adapter \"${this.#name}\" does not support conditional delete.`,\n {\n code: StorageErrorCode.NOT_SUPPORTED,\n key,\n operation: 'delete',\n permanent: true,\n },\n ),\n );\n }\n const mergedOptions = this.#conditionalOptions(options);\n return this.#call(() =>\n adapter.deleteConditional(this.#path(key), mergedOptions),\n );\n }\n\n copy(\n sourceKey: string,\n destinationKey: string,\n options?: StorageOperationOptions,\n ): Promise<void> {\n this.#assertLogicalKey(sourceKey);\n this.#assertLogicalKey(destinationKey);\n return this.#call(() =>\n this.#files.copy(sourceKey, destinationKey, operationOptions(options)),\n );\n }\n\n move(\n sourceKey: string,\n destinationKey: string,\n options?: StorageOperationOptions,\n ): Promise<void> {\n this.#assertLogicalKey(sourceKey);\n this.#assertLogicalKey(destinationKey);\n return this.#call(() =>\n this.#files.move(sourceKey, destinationKey, operationOptions(options)),\n );\n }\n\n promote(\n sourceKey: string,\n destinationKey: string,\n options: StoragePromotionOptions,\n ): Promise<void> {\n const destination = options.destination;\n if (\n destination !== undefined &&\n (typeof destination !== 'object' ||\n destination === null ||\n (destination.type !== 'create' && destination.type !== 'replace'))\n ) {\n return Promise.reject(\n new StorageError('destination.type must be \"create\" or \"replace\".', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key: destinationKey,\n operation: 'promote',\n permanent: true,\n }),\n );\n }\n if (\n options.sourceEtag !== undefined &&\n !isCanonicalStorageEtag(options.sourceEtag)\n ) {\n return Promise.reject(\n invalidConditionalEtag('sourceEtag', sourceKey, 'promote'),\n );\n }\n if (\n destination?.type === 'replace' &&\n !isCanonicalStorageEtag(destination.etag)\n ) {\n return Promise.reject(\n invalidConditionalEtag('destination.etag', destinationKey, 'promote'),\n );\n }\n if (this.#readOnly) {\n return Promise.reject(\n new StorageError(\n `Cannot call promote() on a read-only storage adapter.`,\n {\n code: StorageErrorCode.READ_ONLY,\n key: sourceKey,\n operation: 'promote',\n permanent: true,\n },\n ),\n );\n }\n const adapter = this.#conditionalCopy;\n if (\n adapter === undefined ||\n (options.sourceEtag !== undefined &&\n adapter.conditionalCopySource?.etag !== true) ||\n (options.sourceVersion !== undefined &&\n adapter.conditionalCopySource?.version !== true) ||\n (options.destination?.type === 'create' &&\n adapter.conditionalCopyDestination?.create !== true) ||\n (options.destination?.type === 'replace' &&\n adapter.conditionalCopyDestination?.replace !== true) ||\n (options.destination !== undefined &&\n (options.sourceEtag !== undefined ||\n options.sourceVersion !== undefined) &&\n adapter.conditionalCopyDestination?.atomicWithSource !== true)\n ) {\n return Promise.reject(\n new StorageError(\n `Storage adapter \"${this.#name}\" does not support conditional promotion.`,\n {\n code: StorageErrorCode.NOT_SUPPORTED,\n key: sourceKey,\n operation: 'promote',\n permanent: true,\n },\n ),\n );\n }\n return this.#call(() =>\n adapter.promote(\n this.#path(sourceKey),\n this.#path(destinationKey),\n this.#conditionalOptions(options),\n ),\n );\n }\n\n async list(options?: StorageListOptions): Promise<StorageListResult> {\n this.#assertListPhysicalPrefix(options?.prefix);\n return this.#call(async () => {\n const result = await this.#files.list(listOptions(options));\n return {\n items: result.items.map((file) => metadataOf(file, 'list')),\n ...(result.cursor !== undefined && { cursor: result.cursor }),\n ...(result.prefixes !== undefined && {\n prefixes: [...result.prefixes],\n }),\n };\n });\n }\n\n search(\n pattern: string | RegExp,\n options?: StorageSearchOptions,\n ): AsyncIterable<StorageObjectMetadata> {\n return this.#search(pattern, options);\n }\n\n async *#search(\n pattern: string | RegExp,\n options?: StorageSearchOptions,\n ): AsyncGenerator<StorageObjectMetadata, void> {\n try {\n for await (const file of this.#files.search(\n pattern,\n searchOptions(options),\n )) {\n yield metadataOf(file, 'search');\n }\n } catch (error) {\n throw mapFilesSdkError(error);\n }\n }\n\n signDownload(\n key: string,\n options?: StorageSignedDownloadOptions,\n ): Promise<string> {\n this.#assertLogicalKey(key);\n return this.#call(() =>\n this.#files.url(key, signedDownloadOptions(options)),\n );\n }\n\n signUpload(\n key: string,\n options: StorageSignedUploadOptions,\n ): Promise<StorageSignedUpload> {\n this.#assertLogicalKey(key);\n return this.#call(() =>\n this.#files.signedUploadUrl(key, signedUploadOptions(options)),\n );\n }\n\n async #call<Result>(operation: () => Promise<Result>): Promise<Result> {\n try {\n return await operation();\n } catch (error) {\n throw mapFilesSdkError(error);\n }\n }\n\n #path(key: string): string {\n if (typeof key !== 'string' || key.length === 0) {\n throw new StorageError('key must be a non-empty string.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n if (key.includes('\\0')) {\n throw new StorageError('key must not contain null bytes.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key,\n permanent: true,\n });\n }\n const normalized = key.replace(/^\\/+/u, '');\n if (\n normalized\n .split('/')\n .some((segment) => segment === '.' || segment === '..')\n ) {\n throw new StorageError('key must not contain . or .. path segments.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key,\n permanent: true,\n });\n }\n const physicalKey =\n this.#prefix.length === 0 ? key : `${this.#prefix}/${normalized}`;\n this.#assertPhysicalKeyBudget(physicalKey, key);\n return physicalKey;\n }\n\n #assertLogicalKey(key: string): void {\n this.#path(key);\n }\n\n #assertListPhysicalPrefix(prefix: string | undefined): void {\n if (prefix !== undefined && prefix.length > 0) {\n this.#assertLogicalKey(prefix);\n return;\n }\n if (this.#prefix.length > 0) {\n this.#assertPhysicalKeyBudget(`${this.#prefix}/`);\n }\n }\n\n #physicalKeyExceedsBudget(physicalKey: string): boolean {\n const maxBytes = this.#physicalKey?.physicalKey.maxBytes;\n return (\n maxBytes !== undefined &&\n new TextEncoder().encode(physicalKey).byteLength > maxBytes\n );\n }\n\n #assertPhysicalKeyBudget(physicalKey: string, logicalKey?: string): void {\n const maxBytes = this.#physicalKey?.physicalKey.maxBytes;\n if (maxBytes === undefined || !this.#physicalKeyExceedsBudget(physicalKey))\n return;\n throw new StorageError(\n `The combined storage prefix and key exceed the provider's ${maxBytes}-byte physical-key limit.`,\n {\n code: StorageErrorCode.LIMIT_EXCEEDED,\n ...(logicalKey !== undefined && { key: logicalKey }),\n permanent: true,\n },\n );\n }\n\n #conditionalOptions<\n Options extends\n | StorageConditionalUploadOptions\n | StorageConditionalDeleteOptions\n | StorageConditionalReadOptions\n | StoragePromotionOptions,\n >(options: Options): Options {\n return {\n ...options,\n ...(options.retries === undefined &&\n this.#retries !== undefined && { retries: this.#retries }),\n ...(options.signal === undefined &&\n this.#signal !== undefined && { signal: this.#signal }),\n ...(options.timeout === undefined &&\n this.#timeout !== undefined && { timeout: this.#timeout }),\n };\n }\n}\n\nexport function createFilesSdkDriver<AdapterType extends Adapter>(\n options: FilesSdkDriverOptions<AdapterType>,\n): FilesSdkStorageDriver<AdapterType> {\n return new FilesSdkStorageDriver(options);\n}\n"]}
1
+ {"version":3,"file":"files-sdk.driver.js","sourceRoot":"","sources":["../../src/files-sdk/files-sdk.driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EACL,KAAK,EACL,UAAU,EACV,QAAQ,GAeT,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AA+B5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAKxE;;;GAGG;AACH,SAAS,6BAA6B,CACpC,OAA2C;IAE3C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,OAAO,CACL,CAAC,OAAO,CAAC,OAAO,EAAE,M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CAAC,OAAO,CAAC,MAAM,KAAK,SAAS;gBAC9B,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;YACzD,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS;gBAC/B,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;SAC7D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,UAAU,oBAAoB,CAClC,OAA2C;IAE3C,OAAO,IAAI,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { Readable } from 'node:stream';\n\nimport {\n Files,\n FilesError,\n handlers,\n type Adapter,\n type Body,\n type DownloadOptions,\n type FilesOptions,\n type FilesPlugin,\n type ListOptions,\n type OperationOptions,\n type RetryOptions,\n type SearchOptions,\n type SignUploadOptions,\n type StoredFile,\n type UploadOptions,\n type UploadResult,\n type UrlOptions,\n} from 'files-sdk';\n\nimport {\n StorageError,\n StorageErrorCode,\n isStorageError,\n} from '../storage.error.js';\nimport {\n isCanonicalStorageEtag,\n normalizeProviderStorageEtag,\n} from '../storage-etag.js';\nimport type { StorageDriver } from '../storage.driver.js';\nimport type {\n StorageBody,\n StorageConditionalCopyDestinationCapability,\n StorageConditionalCopySourceCapability,\n StorageConditionalDeleteCapability,\n StorageConditionalDeleteOptions,\n StorageConditionalMultipartCompletionCapability,\n StorageConditionalReadCapability,\n StorageConditionalReadOptions,\n StorageConditionalUploadOptions,\n StorageConditionalWriteCapability,\n StorageDownloadOptions,\n StorageListOptions,\n StorageListResult,\n StorageObject,\n StorageObjectMetadata,\n StorageOperationOptions,\n StoragePhysicalKeyCapability,\n StoragePromotionOptions,\n StorageRetryOptions,\n StorageSearchOptions,\n StorageSignedUploadPolicyCapability,\n StorageSignedDownloadPolicyCapability,\n StorageSignedDownloadOptions,\n StorageSignedUpload,\n StorageSignedUploadOptions,\n StorageUploadOptions,\n StorageUploadResult,\n} from '../storage.types.js';\nimport { getFilesSdkUploadControl } from '../storage-upload-control.js';\n\nexport type FilesSdkDriverOptions<AdapterType extends Adapter> =\n FilesOptions<AdapterType>;\n\n/**\n * Interim compatibility gate until Files SDK exposes native conditional/CAS\n * verbs through the same operation pipeline as its generic data plane.\n */\nfunction hasCallerFilesOperationPolicy<AdapterType extends Adapter>(\n options: FilesSdkDriverOptions<AdapterType>,\n): boolean {\n const hooks = options.hooks;\n return (\n (options.plugins?.length ?? 0) > 0 ||\n typeof hooks?.onAction === 'function' ||\n typeof hooks?.onError === 'function' ||\n typeof hooks?.onRetry === 'function' ||\n (options.receipts !== undefined && options.receipts !== false)\n );\n}\n\nexport type FilesSdkS3AdapterProvenance = 'native' | 'verified' | 'unverified';\n\nconst FILES_SDK_S3_RESERVED_EXTENSION_KEYS = [\n 'conditionalCopyDestination',\n 'conditionalCopySource',\n 'conditionalCreate',\n 'conditionalDelete',\n 'conditionalMultipartCompletion',\n 'conditionalRead',\n 'conditionalReplace',\n 'deleteConditional',\n 'downloadConditional',\n 'physicalKey',\n 'promote',\n 'signedDownloadPolicy',\n 'signedUploadPolicy',\n 'uploadConditional',\n] as const;\n\nconst FILES_SDK_S3_AUTHORITY_KEYS = [\n ...FILES_SDK_S3_RESERVED_EXTENSION_KEYS,\n 'bucket',\n 'copy',\n 'delete',\n 'deleteMany',\n 'download',\n 'exists',\n 'head',\n 'list',\n 'move',\n 'reportsUploadProgress',\n 'resumableUpload',\n 'signedUploadUrl',\n 'signedUrl',\n 'supportsCacheControl',\n 'supportsDelimiter',\n 'supportsMetadata',\n 'supportsRange',\n 'supportsServerSideCopy',\n 'upload',\n 'url',\n] as const;\n\ntype FilesSdkS3AuthorityKey = (typeof FILES_SDK_S3_AUTHORITY_KEYS)[number];\n\ninterface FilesSdkS3AuthoritySnapshotEntry {\n readonly present: boolean;\n readonly value: unknown;\n}\n\ntype FilesSdkS3AuthoritySnapshot = Readonly<\n Record<FilesSdkS3AuthorityKey, FilesSdkS3AuthoritySnapshotEntry>\n>;\n\ninterface FilesSdkS3AdapterProvenanceRecord {\n readonly provenance: FilesSdkS3AdapterProvenance;\n readonly surface: FilesSdkS3AuthoritySnapshot;\n}\n\nconst s3AdapterProvenance = new WeakMap<\n object,\n FilesSdkS3AdapterProvenanceRecord\n>();\nconst undecoratedS3Adapters = new WeakSet<object>();\nconst s3AdapterAuthority = new WeakMap<object, object>();\nconst s3MethodAuthority = new WeakMap<Function, object>();\nconst s3AuthorityState = new WeakMap<\n object,\n {\n readonly raw: object;\n readonly record?: FilesSdkS3AdapterProvenanceRecord;\n }\n>();\nconst conflictingS3Authority = Symbol('conflictingS3Authority');\n\nfunction adapterRawObject(adapter: Adapter): object | undefined {\n try {\n const raw = adapter.raw;\n return (typeof raw === 'object' && raw !== null) ||\n typeof raw === 'function'\n ? raw\n : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction s3AdapterAuthorityTokenOf(\n adapter: Adapter,\n): object | typeof conflictingS3Authority | undefined {\n let resolved = s3AdapterAuthority.get(adapter);\n const consider = (token: object | undefined): boolean => {\n if (token === undefined) return true;\n if (resolved !== undefined && resolved !== token) return false;\n resolved = token;\n return true;\n };\n try {\n const candidate = adapter as unknown as Record<PropertyKey, unknown>;\n for (const key of FILES_SDK_S3_AUTHORITY_KEYS) {\n if (!(key in candidate)) continue;\n const value = candidate[key];\n if (\n typeof value === 'function' &&\n !consider(s3MethodAuthority.get(value))\n ) {\n return conflictingS3Authority;\n }\n }\n return resolved;\n } catch {\n return conflictingS3Authority;\n }\n}\n\nfunction bindS3AdapterAuthorityMethods(adapter: Adapter, token: object): void {\n const candidate = adapter as unknown as Record<PropertyKey, unknown>;\n for (const key of FILES_SDK_S3_AUTHORITY_KEYS) {\n if (!(key in candidate)) continue;\n const value = candidate[key];\n if (typeof value !== 'function') continue;\n const existing = s3MethodAuthority.get(value);\n if (existing !== undefined && existing !== token) {\n throw new TypeError('S3 adapter methods have conflicting authority.');\n }\n s3MethodAuthority.set(value, token);\n }\n}\n\nfunction attachS3AdapterAuthority(adapter: Adapter, raw: object): object {\n const existing = s3AdapterAuthorityTokenOf(adapter);\n if (existing === conflictingS3Authority) {\n throw new TypeError('S3 adapter authority is inconsistent.');\n }\n const token = existing ?? Object.freeze({});\n const state = s3AuthorityState.get(token);\n if (state !== undefined && state.raw !== raw) {\n throw new TypeError('S3 adapter authority raw client cannot be changed.');\n }\n if (state === undefined) s3AuthorityState.set(token, { raw });\n s3AdapterAuthority.set(adapter, token);\n bindS3AdapterAuthorityMethods(adapter, token);\n return token;\n}\n\nfunction setS3AdapterProvenance(\n target: object,\n adapter: Adapter,\n provenance: FilesSdkS3AdapterProvenance,\n): FilesSdkS3AdapterProvenanceRecord {\n const existing = s3AdapterProvenanceOfRaw(target);\n if (existing !== undefined) {\n if (\n existing.provenance !== provenance ||\n mismatchedS3Authority(adapter, existing.surface) !== undefined\n ) {\n throw new TypeError('S3 adapter provenance cannot be changed.');\n }\n s3AdapterProvenance.set(target, existing);\n return existing;\n }\n const record = Object.freeze({\n provenance,\n surface: s3AuthoritySnapshot(adapter),\n });\n s3AdapterProvenance.set(target, record);\n return record;\n}\n\nfunction s3AdapterProvenanceOfRaw(\n raw: object,\n): FilesSdkS3AdapterProvenanceRecord | undefined {\n return s3AdapterProvenance.get(raw);\n}\n\nfunction s3AuthoritySnapshot(adapter: Adapter): FilesSdkS3AuthoritySnapshot {\n const candidate = adapter as unknown as Record<PropertyKey, unknown>;\n return Object.freeze(\n Object.fromEntries(\n FILES_SDK_S3_AUTHORITY_KEYS.map((key) => {\n const present = key in candidate;\n return [\n key,\n Object.freeze({\n present,\n value: present ? candidate[key] : undefined,\n }),\n ];\n }),\n ) as Record<FilesSdkS3AuthorityKey, FilesSdkS3AuthoritySnapshotEntry>,\n );\n}\n\nfunction mismatchedS3Authority(\n adapter: Adapter,\n snapshot: FilesSdkS3AuthoritySnapshot,\n): FilesSdkS3AuthorityKey | undefined {\n const candidate = adapter as unknown as Record<PropertyKey, unknown>;\n try {\n return FILES_SDK_S3_AUTHORITY_KEYS.find((key) => {\n const present = key in candidate;\n const expected = snapshot[key];\n return (\n present !== expected.present ||\n !Object.is(present ? candidate[key] : undefined, expected.value)\n );\n });\n } catch {\n return FILES_SDK_S3_AUTHORITY_KEYS[0];\n }\n}\n\n/** Rejects adapters already carrying reserved storage S3 extensions. */\nexport function assertFilesSdkS3AdapterHasNoReservedExtensions(\n adapter: Adapter,\n): void {\n const reserved = filesSdkS3ReservedExtensionOf(adapter);\n if (reserved !== undefined) {\n throw new TypeError(\n `S3 adapter already defines reserved extension \"${reserved}\".`,\n );\n }\n}\n\nfunction filesSdkS3ReservedExtensionOf(\n adapter: Adapter,\n): (typeof FILES_SDK_S3_RESERVED_EXTENSION_KEYS)[number] | undefined {\n const candidate = adapter as unknown as Record<PropertyKey, unknown>;\n try {\n return FILES_SDK_S3_RESERVED_EXTENSION_KEYS.find((key) => key in candidate);\n } catch {\n return FILES_SDK_S3_RESERVED_EXTENSION_KEYS[0];\n }\n}\n\n/** Records that an S3 adapter was constructed but not provider-decorated. */\nexport function markFilesSdkS3AdapterUndecorated(adapter: Adapter): void {\n const raw = adapterRawObject(adapter);\n if (raw === undefined) {\n throw new TypeError('S3 adapter must expose an object raw client.');\n }\n attachS3AdapterAuthority(adapter, raw);\n undecoratedS3Adapters.add(raw);\n}\n\n/** Records the provider verification state of one decorated S3 adapter. */\nexport function markFilesSdkS3AdapterProvenance(\n adapter: Adapter,\n provenance: FilesSdkS3AdapterProvenance,\n): void {\n const raw = adapterRawObject(adapter);\n if (raw === undefined) {\n throw new TypeError('S3 adapter must expose an object raw client.');\n }\n markFilesSdkS3RawClientProvenance(raw, adapter, provenance);\n}\n\n/** Records final provider verification state on one stable raw S3 client. */\nexport function markFilesSdkS3RawClientProvenance(\n raw: object,\n adapter: Adapter,\n provenance: FilesSdkS3AdapterProvenance,\n): void {\n const authority = attachS3AdapterAuthority(adapter, raw);\n const record = setS3AdapterProvenance(raw, adapter, provenance);\n s3AuthorityState.set(authority, { raw, record });\n bindS3AdapterAuthorityMethods(adapter, authority);\n}\n\nfunction isUndecoratedS3Raw(raw: object): boolean {\n return undecoratedS3Adapters.has(raw);\n}\n\nfunction isStructuralS3Raw(raw: object): boolean {\n try {\n const candidate = raw as {\n readonly config?: unknown;\n readonly send?: unknown;\n };\n return (\n typeof candidate.send === 'function' &&\n typeof candidate.config === 'object' &&\n candidate.config !== null &&\n (candidate.config as { readonly serviceId?: unknown }).serviceId === 'S3'\n );\n } catch {\n return false;\n }\n}\n\n/**\n * Optional adapter extension for providers that can conditionally copy an\n * immutable source identity. Plain files-sdk adapters remain fully supported.\n */\nexport interface FilesSdkConditionalCopyAdapter {\n readonly conditionalCopySource?: StorageConditionalCopySourceCapability;\n readonly conditionalCopyDestination?: StorageConditionalCopyDestinationCapability;\n promote(\n sourceKey: string,\n destinationKey: string,\n options: StoragePromotionOptions,\n ): Promise<void>;\n}\n\n/** Optional adapter extension for native compare-and-set uploads. */\nexport interface FilesSdkConditionalUploadAdapter {\n readonly conditionalCreate?: StorageConditionalWriteCapability;\n readonly conditionalReplace?: StorageConditionalWriteCapability;\n readonly conditionalMultipartCompletion?: StorageConditionalMultipartCompletionCapability;\n uploadConditional(\n key: string,\n body: Body,\n options: StorageConditionalUploadOptions,\n ): Promise<StorageUploadResult>;\n}\n\n/** Optional adapter extension for native compare-and-delete. */\nexport interface FilesSdkConditionalDeleteAdapter {\n readonly conditionalDelete: StorageConditionalDeleteCapability;\n deleteConditional(\n key: string,\n options: StorageConditionalDeleteOptions,\n ): Promise<void>;\n}\n\n/** Optional adapter extension for an exact observed-identity read. */\nexport interface FilesSdkConditionalReadAdapter {\n readonly conditionalRead: StorageConditionalReadCapability;\n downloadConditional(\n key: string,\n options: StorageConditionalReadOptions,\n ): Promise<StorageObject>;\n}\n\n/** Optional provider key budget, measured after the driver prefix is applied. */\nexport interface FilesSdkPhysicalKeyAdapter {\n readonly physicalKey: StoragePhysicalKeyCapability;\n}\n\nexport interface FilesSdkSignedUploadPolicyAdapter {\n readonly signedUploadPolicy: StorageSignedUploadPolicyCapability;\n}\n\nexport interface FilesSdkSignedDownloadPolicyAdapter {\n readonly signedDownloadPolicy: StorageSignedDownloadPolicyCapability;\n}\n\nfunction conditionalCopyAdapterOf(\n adapter: Adapter,\n): FilesSdkConditionalCopyAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('promote' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkConditionalCopyAdapter>;\n const source = candidate.conditionalCopySource;\n const destination = candidate.conditionalCopyDestination;\n if (\n (source === undefined && destination === undefined) ||\n (source !== undefined &&\n (typeof source.etag !== 'boolean' ||\n typeof source.version !== 'boolean')) ||\n (destination !== undefined &&\n (typeof destination.create !== 'boolean' ||\n typeof destination.replace !== 'boolean' ||\n typeof destination.atomicWithSource !== 'boolean')) ||\n typeof candidate.promote !== 'function'\n ) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkConditionalCopyAdapter;\n}\n\nfunction conditionalUploadAdapterOf(\n adapter: Adapter,\n): FilesSdkConditionalUploadAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('uploadConditional' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkConditionalUploadAdapter>;\n const create = candidate.conditionalCreate;\n const replace = candidate.conditionalReplace;\n const multipart = candidate.conditionalMultipartCompletion;\n if (\n (create === undefined && replace === undefined) ||\n (create !== undefined && typeof create.resultEtag !== 'boolean') ||\n (replace !== undefined && typeof replace.resultEtag !== 'boolean') ||\n (multipart !== undefined &&\n (typeof multipart.create !== 'boolean' ||\n typeof multipart.replace !== 'boolean')) ||\n typeof candidate.uploadConditional !== 'function'\n ) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkConditionalUploadAdapter;\n}\n\nfunction conditionalDeleteAdapterOf(\n adapter: Adapter,\n): FilesSdkConditionalDeleteAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('conditionalDelete' in adapter) ||\n !('deleteConditional' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkConditionalDeleteAdapter>;\n if (\n candidate.conditionalDelete === undefined ||\n typeof candidate.conditionalDelete.etag !== 'boolean' ||\n typeof candidate.deleteConditional !== 'function'\n ) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkConditionalDeleteAdapter;\n}\n\nfunction conditionalReadAdapterOf(\n adapter: Adapter,\n): FilesSdkConditionalReadAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('conditionalRead' in adapter) ||\n !('downloadConditional' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkConditionalReadAdapter>;\n if (\n candidate.conditionalRead === undefined ||\n typeof candidate.conditionalRead.etag !== 'boolean' ||\n typeof candidate.conditionalRead.version !== 'boolean' ||\n typeof candidate.downloadConditional !== 'function'\n ) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkConditionalReadAdapter;\n}\n\nfunction physicalKeyAdapterOf(\n adapter: Adapter,\n): FilesSdkPhysicalKeyAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('physicalKey' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter & Partial<FilesSdkPhysicalKeyAdapter>;\n const maxBytes = candidate.physicalKey?.maxBytes;\n if (!Number.isSafeInteger(maxBytes) || (maxBytes ?? 0) <= 0) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkPhysicalKeyAdapter;\n}\n\nfunction signedUploadPolicyAdapterOf(\n adapter: Adapter,\n): FilesSdkSignedUploadPolicyAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('signedUploadPolicy' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkSignedUploadPolicyAdapter>;\n const capability = candidate.signedUploadPolicy;\n if (\n capability === undefined ||\n typeof capability.contentType !== 'boolean' ||\n typeof capability.sizeRange !== 'boolean'\n ) {\n return undefined;\n }\n return candidate as Adapter & FilesSdkSignedUploadPolicyAdapter;\n}\n\nfunction signedDownloadPolicyAdapterOf(\n adapter: Adapter,\n): FilesSdkSignedDownloadPolicyAdapter | undefined {\n if (\n typeof adapter !== 'object' ||\n adapter === null ||\n !('signedDownloadPolicy' in adapter)\n ) {\n return undefined;\n }\n const candidate = adapter as Adapter &\n Partial<FilesSdkSignedDownloadPolicyAdapter>;\n const capability = candidate.signedDownloadPolicy;\n if (capability === undefined || typeof capability.expiresIn !== 'boolean') {\n return undefined;\n }\n return candidate as Adapter & FilesSdkSignedDownloadPolicyAdapter;\n}\n\ninterface FilesErrorLike {\n readonly name: string;\n readonly message: string;\n readonly code: FilesError['code'];\n readonly aborted: boolean;\n readonly timedOut: boolean;\n readonly permanent: boolean;\n readonly cause?: unknown;\n}\n\nfunction isFilesErrorCode(value: unknown): value is FilesError['code'] {\n return (\n value === 'NotFound' ||\n value === 'Unauthorized' ||\n value === 'Conflict' ||\n value === 'ReadOnly' ||\n value === 'Provider'\n );\n}\n\nfunction isFilesErrorLike(error: unknown): error is FilesErrorLike {\n if (error instanceof FilesError) {\n return true;\n }\n if (!(error instanceof Error)) {\n return false;\n }\n\n try {\n return (\n error.name === 'FilesError' &&\n typeof error.message === 'string' &&\n 'code' in error &&\n isFilesErrorCode(error.code) &&\n 'aborted' in error &&\n typeof error.aborted === 'boolean' &&\n 'timedOut' in error &&\n typeof error.timedOut === 'boolean' &&\n 'permanent' in error &&\n typeof error.permanent === 'boolean'\n );\n } catch {\n return false;\n }\n}\n\nfunction unwrapFilesError(error: FilesErrorLike): FilesErrorLike {\n const seen = new Set<FilesErrorLike>();\n let current = error;\n\n while (\n current.code === 'Provider' &&\n !current.aborted &&\n !current.timedOut &&\n !current.permanent &&\n isFilesErrorLike(current.cause) &&\n current.message === current.cause.message &&\n !seen.has(current.cause)\n ) {\n seen.add(current);\n current = current.cause;\n }\n\n return current;\n}\n\nconst PUBLIC_PROVIDER_ERROR_MESSAGES: Readonly<\n Record<StorageErrorCode, string>\n> = Object.freeze({\n [StorageErrorCode.NOT_FOUND]: 'Storage provider object was not found.',\n [StorageErrorCode.UNAUTHORIZED]:\n 'Storage provider operation was unauthorized.',\n [StorageErrorCode.CONFLICT]:\n 'Storage provider operation conflicted with current state.',\n [StorageErrorCode.READ_ONLY]: 'Storage provider is read-only.',\n [StorageErrorCode.INVALID_ARGUMENT]:\n 'Storage provider rejected an invalid argument.',\n [StorageErrorCode.NOT_SUPPORTED]:\n 'Storage provider operation is not supported.',\n [StorageErrorCode.ABORTED]: 'Storage provider operation was aborted.',\n [StorageErrorCode.TIMEOUT]: 'Storage provider operation timed out.',\n [StorageErrorCode.LIMIT_EXCEEDED]:\n 'Storage provider operation exceeded a limit.',\n [StorageErrorCode.PROVIDER]: 'Storage provider operation failed.',\n});\n\nfunction sanitizedStorageError(error: StorageError): StorageError {\n return new StorageError(PUBLIC_PROVIDER_ERROR_MESSAGES[error.code], {\n aborted: error.aborted,\n code: error.code,\n permanent: error.permanent,\n timedOut: error.timedOut,\n });\n}\n\nexport function mapFilesSdkError(error: unknown): StorageError {\n if (isStorageError(error)) return sanitizedStorageError(error);\n if (!isFilesErrorLike(error)) {\n return new StorageError('Storage provider operation failed.', {\n code: StorageErrorCode.PROVIDER,\n });\n }\n\n const filesError = unwrapFilesError(error);\n\n if (\n filesError.code === 'Provider' &&\n !filesError.aborted &&\n !filesError.timedOut &&\n !filesError.permanent &&\n isStorageError(filesError.cause) &&\n filesError.message === filesError.cause.message\n ) {\n return sanitizedStorageError(filesError.cause);\n }\n\n let code: StorageErrorCode;\n if (filesError.timedOut) {\n code = StorageErrorCode.TIMEOUT;\n } else if (filesError.aborted) {\n code = StorageErrorCode.ABORTED;\n } else {\n switch (filesError.code) {\n case 'NotFound':\n code = StorageErrorCode.NOT_FOUND;\n break;\n case 'Unauthorized':\n code = StorageErrorCode.UNAUTHORIZED;\n break;\n case 'Conflict':\n code = StorageErrorCode.CONFLICT;\n break;\n case 'ReadOnly':\n code = StorageErrorCode.READ_ONLY;\n break;\n case 'Provider':\n code = /(?:not supported|does not support|unsupported)/iu.test(\n filesError.message,\n )\n ? StorageErrorCode.NOT_SUPPORTED\n : StorageErrorCode.PROVIDER;\n break;\n }\n }\n\n return new StorageError(PUBLIC_PROVIDER_ERROR_MESSAGES[code], {\n aborted: filesError.aborted,\n code,\n permanent: filesError.permanent,\n timedOut: filesError.timedOut,\n });\n}\n\nfunction mapRetryOptions(\n retries: StorageRetryOptions | undefined,\n): RetryOptions | undefined {\n if (retries === undefined || typeof retries === 'number') {\n return retries;\n }\n\n return {\n max: retries.max,\n ...(retries.backoff !== undefined && {\n backoff: ({ attempt, error }) =>\n retries.backoff?.({\n attempt,\n error: mapFilesSdkError(error),\n }) ?? 0,\n }),\n };\n}\n\nfunction storageRetryOptions(\n retries: RetryOptions | undefined,\n): StorageRetryOptions | undefined {\n if (retries === undefined || typeof retries === 'number') {\n return retries;\n }\n return {\n max: retries.max,\n ...(retries.backoff !== undefined && {\n backoff: ({ attempt, error }) =>\n retries.backoff?.({\n attempt,\n error: new FilesError(\n error.code === StorageErrorCode.NOT_FOUND\n ? 'NotFound'\n : error.code === StorageErrorCode.UNAUTHORIZED\n ? 'Unauthorized'\n : error.code === StorageErrorCode.CONFLICT\n ? 'Conflict'\n : error.code === StorageErrorCode.READ_ONLY\n ? 'ReadOnly'\n : 'Provider',\n error.message,\n error,\n {\n aborted: error.aborted,\n permanent: error.permanent,\n timedOut: error.timedOut,\n },\n ),\n }) ?? 0,\n }),\n };\n}\n\nfunction operationOptions(\n options?: StorageOperationOptions,\n): OperationOptions | undefined {\n if (options === undefined) {\n return undefined;\n }\n\n const retries = mapRetryOptions(options.retries);\n return {\n ...(retries !== undefined && { retries }),\n ...(options.signal !== undefined && { signal: options.signal }),\n ...(options.timeout !== undefined && { timeout: options.timeout }),\n };\n}\n\nasync function* normalizeNodeChunks(\n source: Readable,\n): AsyncGenerator<Uint8Array> {\n for await (const chunk of source) {\n if (typeof chunk === 'string') {\n yield new TextEncoder().encode(chunk);\n continue;\n }\n if (chunk instanceof Uint8Array) {\n yield chunk;\n continue;\n }\n throw new StorageError(\n 'Node upload streams must yield strings or Uint8Array chunks.',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n}\n\nfunction mapBody(body: StorageBody): Body {\n if (body instanceof Readable) {\n return Readable.toWeb(\n Readable.from(normalizeNodeChunks(body)),\n ) as ReadableStream<Uint8Array>;\n }\n return body;\n}\n\nfunction normalizeDownloadStream(\n source: ReadableStream<Uint8Array>,\n): ReadableStream<Uint8Array> {\n let reader: ReadableStreamDefaultReader<Uint8Array> | undefined =\n source.getReader();\n\n const release = (): void => {\n reader?.releaseLock();\n reader = undefined;\n };\n\n return new ReadableStream<Uint8Array>({\n async cancel(reason) {\n const activeReader = reader;\n if (activeReader === undefined) {\n return;\n }\n try {\n await activeReader.cancel(reason);\n } catch (error) {\n throw mapFilesSdkError(error);\n } finally {\n release();\n }\n },\n async pull(controller) {\n const activeReader = reader;\n if (activeReader === undefined) {\n controller.close();\n return;\n }\n try {\n const result = await activeReader.read();\n if (result.done) {\n release();\n controller.close();\n return;\n }\n controller.enqueue(result.value);\n } catch (error) {\n release();\n controller.error(mapFilesSdkError(error));\n }\n },\n });\n}\n\nfunction uploadOptions(\n options?: StorageUploadOptions,\n): UploadOptions | undefined {\n if (options === undefined) {\n return undefined;\n }\n return {\n ...operationOptions(options),\n ...(options.cacheControl !== undefined && {\n cacheControl: options.cacheControl,\n }),\n ...(options.contentType !== undefined && {\n contentType: options.contentType,\n }),\n ...(options.control !== undefined && {\n control: getFilesSdkUploadControl(options.control),\n }),\n ...(options.metadata !== undefined && { metadata: options.metadata }),\n ...(options.multipart !== undefined && {\n multipart: options.multipart,\n }),\n ...(options.onProgress !== undefined && {\n onProgress: options.onProgress,\n }),\n };\n}\n\nfunction downloadOptions(options?: StorageDownloadOptions): DownloadOptions {\n return {\n ...operationOptions(options),\n as: 'stream',\n ...(options?.range !== undefined && { range: options.range }),\n };\n}\n\nfunction listOptions(options?: StorageListOptions): ListOptions | undefined {\n if (options === undefined) {\n return undefined;\n }\n return {\n ...operationOptions(options),\n ...(options.cursor !== undefined && { cursor: options.cursor }),\n ...(options.delimiter !== undefined && { delimiter: options.delimiter }),\n ...(options.limit !== undefined && { limit: options.limit }),\n ...(options.prefix !== undefined && { prefix: options.prefix }),\n };\n}\n\nfunction searchOptions(\n options?: StorageSearchOptions,\n): SearchOptions | undefined {\n if (options === undefined) {\n return undefined;\n }\n return {\n ...operationOptions(options),\n ...(options.caseInsensitive !== undefined && {\n caseInsensitive: options.caseInsensitive,\n }),\n ...(options.limit !== undefined && { limit: options.limit }),\n ...(options.match !== undefined && { match: options.match }),\n ...(options.maxResults !== undefined && {\n maxResults: options.maxResults,\n }),\n ...(options.prefix !== undefined && { prefix: options.prefix }),\n };\n}\n\nfunction signedDownloadOptions(\n options?: StorageSignedDownloadOptions,\n): UrlOptions | undefined {\n if (options === undefined) {\n return undefined;\n }\n return {\n ...operationOptions(options),\n ...(options.expiresIn !== undefined && {\n expiresIn: options.expiresIn,\n }),\n ...(options.responseContentDisposition !== undefined && {\n responseContentDisposition: options.responseContentDisposition,\n }),\n };\n}\n\nfunction signedUploadOptions(\n options: StorageSignedUploadOptions,\n): SignUploadOptions {\n return {\n ...operationOptions(options),\n expiresIn: options.expiresIn,\n ...(options.contentType !== undefined && {\n contentType: options.contentType,\n }),\n ...(options.maxSize !== undefined && { maxSize: options.maxSize }),\n ...(options.minSize !== undefined && { minSize: options.minSize }),\n };\n}\n\nfunction providerEtag(\n value: unknown,\n key: string,\n operation: 'download' | 'head' | 'list' | 'search' | 'upload',\n): string | undefined {\n if (value === undefined) {\n return undefined;\n }\n const etag = normalizeProviderStorageEtag(value);\n if (etag === undefined) {\n throw new StorageError('Storage adapter returned an invalid ETag.', {\n code: StorageErrorCode.PROVIDER,\n key,\n operation,\n permanent: true,\n });\n }\n return etag;\n}\n\nfunction invalidConditionalEtag(\n label: string,\n key: string,\n operation: 'delete' | 'download' | 'promote' | 'upload',\n): StorageError {\n return new StorageError(`${label} must be a canonical storage ETag.`, {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key,\n operation,\n permanent: true,\n });\n}\n\nfunction metadataOf(\n file: StoredFile,\n operation: 'download' | 'head' | 'list' | 'search',\n): StorageObjectMetadata {\n const etag = providerEtag(file.etag, file.key, operation);\n return {\n contentType: file.type,\n ...(etag !== undefined && { etag }),\n key: file.key,\n ...(file.lastModified !== undefined && {\n lastModified: new Date(file.lastModified),\n }),\n ...(file.metadata !== undefined && {\n metadata: { ...file.metadata },\n }),\n name: file.name,\n size: file.size,\n };\n}\n\nfunction uploadResultOf(result: UploadResult): StorageUploadResult {\n const etag = providerEtag(result.etag, result.key, 'upload');\n return {\n contentType: result.contentType,\n ...(etag !== undefined && { etag }),\n key: result.key,\n ...(result.lastModified !== undefined && {\n lastModified: new Date(result.lastModified),\n }),\n size: result.size,\n };\n}\n\nfunction normalizeFilesSdkPrefix(prefix: unknown): string {\n if (prefix === undefined) return '';\n if (typeof prefix !== 'string') {\n throw new StorageError('prefix must be a string.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n const normalized = prefix.replaceAll(/^\\/+|(?<!\\/)\\/+$/gu, '');\n if (normalized.length === 0 || normalized.includes('\\0')) {\n throw new StorageError(\n 'prefix must be a non-empty string without null bytes.',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n if (\n normalized.split('/').some((segment) => segment === '.' || segment === '..')\n ) {\n throw new StorageError('prefix must not contain . or .. path segments.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n return normalized;\n}\n\nfunction physicalPluginKey(\n prefix: string,\n key: unknown,\n): { readonly logicalKey: string; readonly physicalKey: string } {\n if (typeof key !== 'string' || key.length === 0) {\n throw new StorageError('The final plugin key must be a non-empty string.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n if (key.includes('\\0')) {\n throw new StorageError(\n 'The final plugin key must not contain null bytes.',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key,\n permanent: true,\n },\n );\n }\n const normalized = key.replace(/^\\/+/u, '');\n if (\n normalized.split('/').some((segment) => segment === '.' || segment === '..')\n ) {\n throw new StorageError(\n 'The final plugin key must not contain . or .. path segments.',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key,\n permanent: true,\n },\n );\n }\n return {\n logicalKey: key,\n physicalKey: prefix.length === 0 ? key : `${prefix}/${normalized}`,\n };\n}\n\nfunction assertPhysicalPluginBudget(\n physicalKey: string,\n maxBytes: number | undefined,\n logicalKey?: string,\n): void {\n if (\n maxBytes === undefined ||\n new TextEncoder().encode(physicalKey).byteLength <= maxBytes\n ) {\n return;\n }\n throw new StorageError(\n `The combined storage prefix and key exceed the provider's ${maxBytes}-byte physical-key limit.`,\n {\n code: StorageErrorCode.LIMIT_EXCEEDED,\n ...(logicalKey !== undefined && { key: logicalKey }),\n permanent: true,\n },\n );\n}\n\nfunction physicalKeyGuardPlugin(\n prefix: string,\n maxBytes: number | undefined,\n): FilesPlugin {\n const assertKey = (key: unknown): string => {\n const resolved = physicalPluginKey(prefix, key);\n assertPhysicalPluginBudget(\n resolved.physicalKey,\n maxBytes,\n resolved.logicalKey,\n );\n return resolved.logicalKey;\n };\n const assertListOptions = (options: unknown): ListOptions | undefined => {\n if (\n options !== undefined &&\n (typeof options !== 'object' || options === null)\n ) {\n throw new StorageError(\n 'The final plugin list options must be an object.',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n const listPrefix = (options as { readonly prefix?: unknown } | undefined)\n ?.prefix;\n if (listPrefix === undefined || listPrefix === '') {\n if (prefix.length > 0) {\n assertPhysicalPluginBudget(`${prefix}/`, maxBytes);\n }\n return options === undefined\n ? undefined\n : (() => {\n const { prefix: _prefix, ...rest } = options as ListOptions;\n return Object.freeze({\n ...rest,\n ...(listPrefix === '' && { prefix: listPrefix }),\n });\n })();\n }\n if (typeof listPrefix !== 'string') {\n throw new StorageError('The final plugin list prefix must be a string.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n const resolved = physicalPluginKey(prefix, listPrefix);\n assertPhysicalPluginBudget(\n resolved.physicalKey,\n maxBytes,\n resolved.logicalKey,\n );\n return Object.freeze({\n ...(options as ListOptions),\n prefix: resolved.logicalKey,\n });\n };\n return {\n name: '@nestm/storage/physical-key-guard',\n wrap: handlers({\n copy: (operation, next) => {\n const from = assertKey(operation.from);\n const to = assertKey(operation.to);\n return next(Object.freeze({ ...operation, from, to }));\n },\n delete: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n download: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n exists: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n head: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n list: (operation, next) => {\n const options = assertListOptions(operation.options);\n return next(\n Object.freeze({\n ...operation,\n ...(options !== undefined && { options }),\n }),\n );\n },\n move: (operation, next) => {\n const from = assertKey(operation.from);\n const to = assertKey(operation.to);\n return next(Object.freeze({ ...operation, from, to }));\n },\n signedUploadUrl: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n upload: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n url: (operation, next) => {\n const key = assertKey(operation.key);\n return next(Object.freeze({ ...operation, key }));\n },\n }),\n };\n}\n\nexport class FilesSdkStorageDriver<\n AdapterType extends Adapter = Adapter,\n> implements StorageDriver {\n readonly #files: Files<AdapterType>;\n readonly #name: string;\n readonly #conditionalCopy: FilesSdkConditionalCopyAdapter | undefined;\n readonly #conditionalDelete: FilesSdkConditionalDeleteAdapter | undefined;\n readonly #conditionalRead: FilesSdkConditionalReadAdapter | undefined;\n readonly #conditionalUpload: FilesSdkConditionalUploadAdapter | undefined;\n readonly #conditionalOperationsBlockedByFilesPolicy: boolean;\n readonly #physicalKey: FilesSdkPhysicalKeyAdapter | undefined;\n readonly #prefix: string;\n readonly #readOnly: boolean;\n readonly #retries: StorageRetryOptions | undefined;\n readonly #signal: AbortSignal | undefined;\n readonly #timeout: number | undefined;\n readonly #signedUploadPolicy: FilesSdkSignedUploadPolicyAdapter | undefined;\n readonly #signedDownloadPolicy:\n FilesSdkSignedDownloadPolicyAdapter | undefined;\n\n constructor(options: FilesSdkDriverOptions<AdapterType>) {\n const raw = adapterRawObject(options.adapter);\n const rawProvenance =\n raw === undefined ? undefined : s3AdapterProvenanceOfRaw(raw);\n const authorityToken = s3AdapterAuthorityTokenOf(options.adapter);\n const authorityState =\n typeof authorityToken === 'object'\n ? s3AuthorityState.get(authorityToken)\n : undefined;\n const authorityInvalid =\n authorityToken === conflictingS3Authority ||\n (authorityState !== undefined &&\n (authorityState.record === undefined ||\n raw === undefined ||\n (raw !== authorityState.raw &&\n rawProvenance !== authorityState.record)));\n const s3Provenance = authorityState?.record ?? rawProvenance;\n if (\n authorityInvalid ||\n (s3Provenance === undefined &&\n raw !== undefined &&\n (isUndecoratedS3Raw(raw) || isStructuralS3Raw(raw)))\n ) {\n throw new StorageError(\n 'Raw S3 adapters must be configured with withS3Capabilities() or createS3StorageDriver().',\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n const mismatchedAuthority =\n s3Provenance === undefined\n ? undefined\n : mismatchedS3Authority(options.adapter, s3Provenance.surface);\n if (mismatchedAuthority !== undefined) {\n throw new StorageError(\n `S3 adapter authority \"${mismatchedAuthority}\" does not match its verified provider profile.`,\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n const adapterForFiles =\n s3Provenance === undefined\n ? options.adapter\n : (Object.freeze({ ...options.adapter }) as AdapterType);\n const copiedAuthorityMismatch =\n s3Provenance === undefined\n ? undefined\n : mismatchedS3Authority(adapterForFiles, s3Provenance.surface);\n if (copiedAuthorityMismatch !== undefined) {\n throw new StorageError(\n `S3 adapter authority \"${copiedAuthorityMismatch}\" changed while it was being bound.`,\n {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n },\n );\n }\n const readOnly =\n options.readonly === true || s3Provenance?.provenance === 'unverified';\n // Evaluate caller policy before appending NestM's internal key guard below.\n this.#conditionalOperationsBlockedByFilesPolicy =\n hasCallerFilesOperationPolicy(options);\n // Files retains the hooks object by reference. Snapshot it so an initially\n // inactive object cannot be mutated after this compatibility decision and\n // start observing only ordinary operations.\n const hooks =\n options.hooks === undefined\n ? undefined\n : Object.freeze({ ...options.hooks });\n this.#physicalKey = physicalKeyAdapterOf(adapterForFiles);\n const guardedPrefix = normalizeFilesSdkPrefix(options.prefix);\n const plugins = [\n ...(options.plugins ?? []),\n physicalKeyGuardPlugin(\n guardedPrefix,\n this.#physicalKey?.physicalKey.maxBytes,\n ),\n ];\n this.#files = new Files({\n ...options,\n adapter: adapterForFiles,\n ...(hooks !== undefined && { hooks }),\n plugins,\n readonly: readOnly,\n });\n this.#name = adapterForFiles.name;\n this.#conditionalCopy = conditionalCopyAdapterOf(adapterForFiles);\n this.#conditionalDelete = conditionalDeleteAdapterOf(adapterForFiles);\n this.#conditionalRead = conditionalReadAdapterOf(adapterForFiles);\n this.#conditionalUpload = conditionalUploadAdapterOf(adapterForFiles);\n this.#prefix = this.#files.prefix;\n if (guardedPrefix !== this.#prefix) {\n throw new StorageError('Storage prefix normalization was inconsistent.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n this.#assertPhysicalKeyBudget(this.#prefix);\n this.#readOnly = readOnly;\n this.#retries = storageRetryOptions(options.retries);\n this.#signal = options.signal;\n this.#timeout = options.timeout;\n this.#signedUploadPolicy = signedUploadPolicyAdapterOf(adapterForFiles);\n this.#signedDownloadPolicy = signedDownloadPolicyAdapterOf(adapterForFiles);\n }\n\n get name(): string {\n return this.#name;\n }\n\n get capabilities() {\n const capabilities = this.#files.capabilities;\n return {\n cacheControl: capabilities.cacheControl,\n delimiter: capabilities.delimiter,\n metadata: capabilities.metadata,\n rangeRead: capabilities.rangeRead,\n resumableUpload: !this.#readOnly && capabilities.multipart,\n serverSideCopy: !this.#readOnly && capabilities.serverSideCopy,\n ...(!this.#conditionalOperationsBlockedByFilesPolicy &&\n this.#conditionalCopy !== undefined &&\n !this.#readOnly && {\n ...(this.#conditionalCopy.conditionalCopySource !== undefined && {\n conditionalCopySource: {\n ...this.#conditionalCopy.conditionalCopySource,\n },\n }),\n ...(this.#conditionalCopy.conditionalCopyDestination !==\n undefined && {\n conditionalCopyDestination: {\n ...this.#conditionalCopy.conditionalCopyDestination,\n },\n }),\n }),\n ...(!this.#conditionalOperationsBlockedByFilesPolicy &&\n this.#conditionalDelete !== undefined &&\n !this.#readOnly && {\n conditionalDelete: {\n ...this.#conditionalDelete.conditionalDelete,\n },\n }),\n ...(!this.#conditionalOperationsBlockedByFilesPolicy &&\n this.#conditionalRead !== undefined && {\n conditionalRead: { ...this.#conditionalRead.conditionalRead },\n }),\n ...(!this.#conditionalOperationsBlockedByFilesPolicy &&\n this.#conditionalUpload !== undefined &&\n !this.#readOnly && {\n ...(this.#conditionalUpload.conditionalCreate !== undefined && {\n conditionalCreate: {\n ...this.#conditionalUpload.conditionalCreate,\n },\n }),\n ...(this.#conditionalUpload.conditionalReplace !== undefined && {\n conditionalReplace: {\n ...this.#conditionalUpload.conditionalReplace,\n },\n }),\n ...(this.#conditionalUpload.conditionalMultipartCompletion !==\n undefined && {\n conditionalMultipartCompletion: {\n ...this.#conditionalUpload.conditionalMultipartCompletion,\n },\n }),\n }),\n ...(this.#physicalKey !== undefined && {\n physicalKey: { ...this.#physicalKey.physicalKey },\n }),\n signedDownload: { ...capabilities.signedUrl },\n ...(this.#signedDownloadPolicy !== undefined && {\n signedDownloadPolicy: {\n ...this.#signedDownloadPolicy.signedDownloadPolicy,\n },\n }),\n signedUpload: this.#readOnly ? false : ('runtime' as const),\n ...(this.#signedUploadPolicy !== undefined &&\n !this.#readOnly && {\n signedUploadPolicy: {\n ...this.#signedUploadPolicy.signedUploadPolicy,\n },\n }),\n nativeUploadProgress: !this.#readOnly && capabilities.uploadProgress,\n };\n }\n\n async upload(\n key: string,\n body: StorageBody,\n options?: StorageUploadOptions,\n ): Promise<StorageUploadResult> {\n this.#assertLogicalKey(key);\n return this.#call(async () =>\n uploadResultOf(\n await this.#files.upload(key, mapBody(body), uploadOptions(options)),\n ),\n );\n }\n\n uploadConditional(\n key: string,\n body: StorageBody,\n options: StorageConditionalUploadOptions,\n ): Promise<StorageUploadResult> {\n if (\n options.condition.type === 'replace' &&\n !isCanonicalStorageEtag(options.condition.etag)\n ) {\n return Promise.reject(\n invalidConditionalEtag('condition.etag', key, 'upload'),\n );\n }\n if (this.#conditionalOperationsBlockedByFilesPolicy) {\n return Promise.reject(this.#conditionalFilesPolicyError(key, 'upload'));\n }\n if (this.#readOnly) {\n return Promise.reject(\n new StorageError(\n `Cannot call uploadConditional() on a read-only storage adapter.`,\n {\n code: StorageErrorCode.READ_ONLY,\n key,\n operation: 'upload',\n permanent: true,\n },\n ),\n );\n }\n const adapter = this.#conditionalUpload;\n const capability =\n options.condition.type === 'create'\n ? adapter?.conditionalCreate\n : adapter?.conditionalReplace;\n const multipartRequested =\n options.multipart !== undefined && options.multipart !== false;\n const multipartSupported =\n !multipartRequested ||\n (options.condition.type === 'create'\n ? adapter?.conditionalMultipartCompletion?.create === true\n : adapter?.conditionalMultipartCompletion?.replace === true);\n if (\n adapter === undefined ||\n capability === undefined ||\n !multipartSupported\n ) {\n return Promise.reject(\n new StorageError(\n `Storage adapter \"${this.#name}\" does not support conditional upload.`,\n {\n code: StorageErrorCode.NOT_SUPPORTED,\n key,\n operation: 'upload',\n permanent: true,\n },\n ),\n );\n }\n const mergedOptions = this.#conditionalOptions(options);\n return this.#call(async () => {\n const physicalKey = this.#path(key);\n const result = await adapter.uploadConditional(\n physicalKey,\n mapBody(body),\n mergedOptions,\n );\n if (result.key !== physicalKey) {\n throw new StorageError(\n 'Storage adapter returned an unexpected conditional upload key.',\n {\n code: StorageErrorCode.PROVIDER,\n key,\n operation: 'upload',\n permanent: true,\n },\n );\n }\n const etag = providerEtag(result.etag, key, 'upload');\n return {\n ...result,\n ...(etag === undefined ? {} : { etag }),\n key,\n };\n });\n }\n\n async download(\n key: string,\n options?: StorageDownloadOptions,\n ): Promise<StorageObject> {\n this.#assertLogicalKey(key);\n return this.#call(async () => {\n const file = await this.#files.download(key, downloadOptions(options));\n return {\n ...metadataOf(file, 'download'),\n body: normalizeDownloadStream(file.stream()),\n };\n });\n }\n\n downloadConditional(\n key: string,\n options: StorageConditionalReadOptions,\n ): Promise<StorageObject> {\n if (\n options.condition.etag !== undefined &&\n !isCanonicalStorageEtag(options.condition.etag)\n ) {\n return Promise.reject(\n invalidConditionalEtag('condition.etag', key, 'download'),\n );\n }\n if (this.#conditionalOperationsBlockedByFilesPolicy) {\n return Promise.reject(this.#conditionalFilesPolicyError(key, 'download'));\n }\n const adapter = this.#conditionalRead;\n if (\n adapter === undefined ||\n (options.condition.etag !== undefined && !adapter.conditionalRead.etag) ||\n (options.condition.version !== undefined &&\n !adapter.conditionalRead.version)\n ) {\n return Promise.reject(\n new StorageError(\n `Storage adapter \"${this.#name}\" does not support conditional read.`,\n {\n code: StorageErrorCode.NOT_SUPPORTED,\n key,\n operation: 'download',\n permanent: true,\n },\n ),\n );\n }\n return this.#call(async () => {\n const physicalKey = this.#path(key);\n const object = await adapter.downloadConditional(\n physicalKey,\n this.#conditionalOptions(options),\n );\n if (object.key !== physicalKey) {\n await object.body.cancel().catch(() => undefined);\n throw new StorageError(\n 'Storage adapter returned an unexpected conditional download key.',\n {\n code: StorageErrorCode.PROVIDER,\n key,\n operation: 'download',\n permanent: true,\n },\n );\n }\n let etag: string | undefined;\n try {\n etag = providerEtag(object.etag, key, 'download');\n } catch (error) {\n await object.body.cancel(error).catch(() => undefined);\n throw error;\n }\n return {\n ...object,\n body: normalizeDownloadStream(object.body),\n ...(etag === undefined ? {} : { etag }),\n key,\n name: key.split('/').at(-1) ?? key,\n };\n });\n }\n\n async head(\n key: string,\n options?: StorageOperationOptions,\n ): Promise<StorageObjectMetadata> {\n this.#assertLogicalKey(key);\n return this.#call(async () =>\n metadataOf(\n await this.#files.head(key, operationOptions(options)),\n 'head',\n ),\n );\n }\n\n exists(key: string, options?: StorageOperationOptions): Promise<boolean> {\n this.#assertLogicalKey(key);\n return this.#call(() => this.#files.exists(key, operationOptions(options)));\n }\n\n delete(key: string, options?: StorageOperationOptions): Promise<void> {\n this.#assertLogicalKey(key);\n return this.#call(async () => {\n await this.#files.delete(key, operationOptions(options));\n });\n }\n\n deleteConditional(\n key: string,\n options: StorageConditionalDeleteOptions,\n ): Promise<void> {\n if (!isCanonicalStorageEtag(options.condition.etag)) {\n return Promise.reject(\n invalidConditionalEtag('condition.etag', key, 'delete'),\n );\n }\n if (this.#conditionalOperationsBlockedByFilesPolicy) {\n return Promise.reject(this.#conditionalFilesPolicyError(key, 'delete'));\n }\n if (this.#readOnly) {\n return Promise.reject(\n new StorageError(\n `Cannot call deleteConditional() on a read-only storage adapter.`,\n {\n code: StorageErrorCode.READ_ONLY,\n key,\n operation: 'delete',\n permanent: true,\n },\n ),\n );\n }\n const adapter = this.#conditionalDelete;\n if (adapter === undefined || !adapter.conditionalDelete.etag) {\n return Promise.reject(\n new StorageError(\n `Storage adapter \"${this.#name}\" does not support conditional delete.`,\n {\n code: StorageErrorCode.NOT_SUPPORTED,\n key,\n operation: 'delete',\n permanent: true,\n },\n ),\n );\n }\n const mergedOptions = this.#conditionalOptions(options);\n return this.#call(() =>\n adapter.deleteConditional(this.#path(key), mergedOptions),\n );\n }\n\n copy(\n sourceKey: string,\n destinationKey: string,\n options?: StorageOperationOptions,\n ): Promise<void> {\n this.#assertLogicalKey(sourceKey);\n this.#assertLogicalKey(destinationKey);\n return this.#call(() =>\n this.#files.copy(sourceKey, destinationKey, operationOptions(options)),\n );\n }\n\n move(\n sourceKey: string,\n destinationKey: string,\n options?: StorageOperationOptions,\n ): Promise<void> {\n this.#assertLogicalKey(sourceKey);\n this.#assertLogicalKey(destinationKey);\n return this.#call(() =>\n this.#files.move(sourceKey, destinationKey, operationOptions(options)),\n );\n }\n\n promote(\n sourceKey: string,\n destinationKey: string,\n options: StoragePromotionOptions,\n ): Promise<void> {\n const destination = options.destination;\n if (\n destination !== undefined &&\n (typeof destination !== 'object' ||\n destination === null ||\n (destination.type !== 'create' && destination.type !== 'replace'))\n ) {\n return Promise.reject(\n new StorageError('destination.type must be \"create\" or \"replace\".', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key: destinationKey,\n operation: 'promote',\n permanent: true,\n }),\n );\n }\n if (\n options.sourceEtag !== undefined &&\n !isCanonicalStorageEtag(options.sourceEtag)\n ) {\n return Promise.reject(\n invalidConditionalEtag('sourceEtag', sourceKey, 'promote'),\n );\n }\n if (\n destination?.type === 'replace' &&\n !isCanonicalStorageEtag(destination.etag)\n ) {\n return Promise.reject(\n invalidConditionalEtag('destination.etag', destinationKey, 'promote'),\n );\n }\n if (this.#conditionalOperationsBlockedByFilesPolicy) {\n return Promise.reject(\n this.#conditionalFilesPolicyError(sourceKey, 'promote'),\n );\n }\n if (this.#readOnly) {\n return Promise.reject(\n new StorageError(\n `Cannot call promote() on a read-only storage adapter.`,\n {\n code: StorageErrorCode.READ_ONLY,\n key: sourceKey,\n operation: 'promote',\n permanent: true,\n },\n ),\n );\n }\n const adapter = this.#conditionalCopy;\n if (\n adapter === undefined ||\n (options.sourceEtag !== undefined &&\n adapter.conditionalCopySource?.etag !== true) ||\n (options.sourceVersion !== undefined &&\n adapter.conditionalCopySource?.version !== true) ||\n (options.destination?.type === 'create' &&\n adapter.conditionalCopyDestination?.create !== true) ||\n (options.destination?.type === 'replace' &&\n adapter.conditionalCopyDestination?.replace !== true) ||\n (options.destination !== undefined &&\n (options.sourceEtag !== undefined ||\n options.sourceVersion !== undefined) &&\n adapter.conditionalCopyDestination?.atomicWithSource !== true)\n ) {\n return Promise.reject(\n new StorageError(\n `Storage adapter \"${this.#name}\" does not support conditional promotion.`,\n {\n code: StorageErrorCode.NOT_SUPPORTED,\n key: sourceKey,\n operation: 'promote',\n permanent: true,\n },\n ),\n );\n }\n return this.#call(() =>\n adapter.promote(\n this.#path(sourceKey),\n this.#path(destinationKey),\n this.#conditionalOptions(options),\n ),\n );\n }\n\n async list(options?: StorageListOptions): Promise<StorageListResult> {\n this.#assertListPhysicalPrefix(options?.prefix);\n return this.#call(async () => {\n const result = await this.#files.list(listOptions(options));\n return {\n items: result.items.map((file) => metadataOf(file, 'list')),\n ...(result.cursor !== undefined && { cursor: result.cursor }),\n ...(result.prefixes !== undefined && {\n prefixes: [...result.prefixes],\n }),\n };\n });\n }\n\n search(\n pattern: string | RegExp,\n options?: StorageSearchOptions,\n ): AsyncIterable<StorageObjectMetadata> {\n return this.#search(pattern, options);\n }\n\n async *#search(\n pattern: string | RegExp,\n options?: StorageSearchOptions,\n ): AsyncGenerator<StorageObjectMetadata, void> {\n try {\n for await (const file of this.#files.search(\n pattern,\n searchOptions(options),\n )) {\n yield metadataOf(file, 'search');\n }\n } catch (error) {\n throw mapFilesSdkError(error);\n }\n }\n\n signDownload(\n key: string,\n options?: StorageSignedDownloadOptions,\n ): Promise<string> {\n this.#assertLogicalKey(key);\n return this.#call(() =>\n this.#files.url(key, signedDownloadOptions(options)),\n );\n }\n\n signUpload(\n key: string,\n options: StorageSignedUploadOptions,\n ): Promise<StorageSignedUpload> {\n this.#assertLogicalKey(key);\n return this.#call(() =>\n this.#files.signedUploadUrl(key, signedUploadOptions(options)),\n );\n }\n\n async #call<Result>(operation: () => Promise<Result>): Promise<Result> {\n try {\n return await operation();\n } catch (error) {\n throw mapFilesSdkError(error);\n }\n }\n\n #path(key: string): string {\n if (typeof key !== 'string' || key.length === 0) {\n throw new StorageError('key must be a non-empty string.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n permanent: true,\n });\n }\n if (key.includes('\\0')) {\n throw new StorageError('key must not contain null bytes.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key,\n permanent: true,\n });\n }\n const normalized = key.replace(/^\\/+/u, '');\n if (\n normalized\n .split('/')\n .some((segment) => segment === '.' || segment === '..')\n ) {\n throw new StorageError('key must not contain . or .. path segments.', {\n code: StorageErrorCode.INVALID_ARGUMENT,\n key,\n permanent: true,\n });\n }\n const physicalKey =\n this.#prefix.length === 0 ? key : `${this.#prefix}/${normalized}`;\n this.#assertPhysicalKeyBudget(physicalKey, key);\n return physicalKey;\n }\n\n #assertLogicalKey(key: string): void {\n this.#path(key);\n }\n\n #assertListPhysicalPrefix(prefix: string | undefined): void {\n if (prefix !== undefined && prefix.length > 0) {\n this.#assertLogicalKey(prefix);\n return;\n }\n if (this.#prefix.length > 0) {\n this.#assertPhysicalKeyBudget(`${this.#prefix}/`);\n }\n }\n\n #physicalKeyExceedsBudget(physicalKey: string): boolean {\n const maxBytes = this.#physicalKey?.physicalKey.maxBytes;\n return (\n maxBytes !== undefined &&\n new TextEncoder().encode(physicalKey).byteLength > maxBytes\n );\n }\n\n #assertPhysicalKeyBudget(physicalKey: string, logicalKey?: string): void {\n const maxBytes = this.#physicalKey?.physicalKey.maxBytes;\n if (maxBytes === undefined || !this.#physicalKeyExceedsBudget(physicalKey))\n return;\n throw new StorageError(\n `The combined storage prefix and key exceed the provider's ${maxBytes}-byte physical-key limit.`,\n {\n code: StorageErrorCode.LIMIT_EXCEEDED,\n ...(logicalKey !== undefined && { key: logicalKey }),\n permanent: true,\n },\n );\n }\n\n #conditionalFilesPolicyError(\n key: string,\n operation: 'delete' | 'download' | 'promote' | 'upload',\n ): StorageError {\n return new StorageError(\n 'Conditional storage operations are unavailable while Files SDK plugins, hooks, or receipts are configured.',\n {\n code: StorageErrorCode.NOT_SUPPORTED,\n key,\n operation,\n permanent: true,\n },\n );\n }\n\n #conditionalOptions<\n Options extends\n | StorageConditionalUploadOptions\n | StorageConditionalDeleteOptions\n | StorageConditionalReadOptions\n | StoragePromotionOptions,\n >(options: Options): Options {\n return {\n ...options,\n ...(options.retries === undefined &&\n this.#retries !== undefined && { retries: this.#retries }),\n ...(options.signal === undefined &&\n this.#signal !== undefined && { signal: this.#signal }),\n ...(options.timeout === undefined &&\n this.#timeout !== undefined && { timeout: this.#timeout }),\n };\n }\n}\n\nexport function createFilesSdkDriver<AdapterType extends Adapter>(\n options: FilesSdkDriverOptions<AdapterType>,\n): FilesSdkStorageDriver<AdapterType> {\n return new FilesSdkStorageDriver(options);\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  export { StorageWorkspaceError, isStorageWorkspaceError, } from './storage-workspace.error.js';
2
2
  export { Aes256GcmStorageWorkspaceCursorCodec, STORAGE_WORKSPACE_CURSOR_VERSION, STORAGE_WORKSPACE_MAX_CURSOR_BYTES, type Aes256GcmStorageWorkspaceCursorCodecOptions, type StorageWorkspaceCursorCodec, type StorageWorkspaceCursorConfiguration, type StorageWorkspaceCursorEncodeOptions, } from './storage-workspace.cursor.js';
3
3
  export { createStorageWorkspace, mountStorageWorkspace, } from './storage-workspace.js';
4
- export { DEFAULT_STORAGE_WORKSPACE_LIMITS, STORAGE_WORKSPACE_PERMISSIONS, type MountStorageWorkspaceOptions, type StorageWorkspaceBody, type StorageWorkspace, type StorageWorkspaceDirectory, type StorageWorkspaceEntry, type StorageWorkspaceFile, type StorageWorkspaceLimits, type StorageWorkspaceListOptions, type StorageWorkspaceMountOptions, type StorageWorkspaceMutationOptions, type StorageWorkspacePage, type StorageWorkspacePermission, type StorageWorkspaceReadOptions, type StorageWorkspaceSearchMatch, type StorageWorkspaceSearchOptions, type StorageWorkspaceTextFile, type StorageWorkspaceWriteOptions, } from './storage-workspace.types.js';
4
+ export { DEFAULT_STORAGE_WORKSPACE_LIMITS, STORAGE_WORKSPACE_PERMISSIONS, type MountStorageWorkspaceOptions, type StorageWorkspaceBody, type StorageWorkspaceByteFile, type StorageWorkspaceCopyOptions, type StorageWorkspaceDeleteOptions, type StorageWorkspace, type StorageWorkspaceDirectory, type StorageWorkspaceEntry, type StorageWorkspaceFile, type StorageWorkspaceLimits, type StorageWorkspaceListOptions, type StorageWorkspaceMountOptions, type StorageWorkspaceMutationOptions, type StorageWorkspaceOverwriteOptions, type StorageWorkspacePage, type StorageWorkspacePermission, type StorageWorkspaceReadOptions, type StorageWorkspaceSearchMatch, type StorageWorkspaceSearchOptions, type StorageWorkspaceTextFile, type StorageWorkspaceUnconditionalDeleteOptions, type StorageWorkspaceWriteOptions, } from './storage-workspace.types.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,oCAAoC,EACpC,gCAAgC,EAChC,kCAAkC,EAClC,KAAK,2CAA2C,EAChD,KAAK,2BAA2B,EAChC,KAAK,mCAAmC,EACxC,KAAK,mCAAmC,GACzC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,GAClC,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,oCAAoC,EACpC,gCAAgC,EAChC,kCAAkC,EAClC,KAAK,2CAA2C,EAChD,KAAK,2BAA2B,EAChC,KAAK,mCAAmC,EACxC,KAAK,mCAAmC,GACzC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EACpC,KAAK,gCAAgC,EACrC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,0CAA0C,EAC/C,KAAK,4BAA4B,GAClC,MAAM,8BAA8B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,oCAAoC,EACpC,gCAAgC,EAChC,kCAAkC,GAKnC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gCAAgC,EAChC,6BAA6B,GAkB9B,MAAM,8BAA8B,CAAC","sourcesContent":["export {\n StorageWorkspaceError,\n isStorageWorkspaceError,\n} from './storage-workspace.error.js';\nexport {\n Aes256GcmStorageWorkspaceCursorCodec,\n STORAGE_WORKSPACE_CURSOR_VERSION,\n STORAGE_WORKSPACE_MAX_CURSOR_BYTES,\n type Aes256GcmStorageWorkspaceCursorCodecOptions,\n type StorageWorkspaceCursorCodec,\n type StorageWorkspaceCursorConfiguration,\n type StorageWorkspaceCursorEncodeOptions,\n} from './storage-workspace.cursor.js';\nexport {\n createStorageWorkspace,\n mountStorageWorkspace,\n} from './storage-workspace.js';\nexport {\n DEFAULT_STORAGE_WORKSPACE_LIMITS,\n STORAGE_WORKSPACE_PERMISSIONS,\n type MountStorageWorkspaceOptions,\n type StorageWorkspaceBody,\n type StorageWorkspace,\n type StorageWorkspaceDirectory,\n type StorageWorkspaceEntry,\n type StorageWorkspaceFile,\n type StorageWorkspaceLimits,\n type StorageWorkspaceListOptions,\n type StorageWorkspaceMountOptions,\n type StorageWorkspaceMutationOptions,\n type StorageWorkspacePage,\n type StorageWorkspacePermission,\n type StorageWorkspaceReadOptions,\n type StorageWorkspaceSearchMatch,\n type StorageWorkspaceSearchOptions,\n type StorageWorkspaceTextFile,\n type StorageWorkspaceWriteOptions,\n} from './storage-workspace.types.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,oCAAoC,EACpC,gCAAgC,EAChC,kCAAkC,GAKnC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gCAAgC,EAChC,6BAA6B,GAuB9B,MAAM,8BAA8B,CAAC","sourcesContent":["export {\n StorageWorkspaceError,\n isStorageWorkspaceError,\n} from './storage-workspace.error.js';\nexport {\n Aes256GcmStorageWorkspaceCursorCodec,\n STORAGE_WORKSPACE_CURSOR_VERSION,\n STORAGE_WORKSPACE_MAX_CURSOR_BYTES,\n type Aes256GcmStorageWorkspaceCursorCodecOptions,\n type StorageWorkspaceCursorCodec,\n type StorageWorkspaceCursorConfiguration,\n type StorageWorkspaceCursorEncodeOptions,\n} from './storage-workspace.cursor.js';\nexport {\n createStorageWorkspace,\n mountStorageWorkspace,\n} from './storage-workspace.js';\nexport {\n DEFAULT_STORAGE_WORKSPACE_LIMITS,\n STORAGE_WORKSPACE_PERMISSIONS,\n type MountStorageWorkspaceOptions,\n type StorageWorkspaceBody,\n type StorageWorkspaceByteFile,\n type StorageWorkspaceCopyOptions,\n type StorageWorkspaceDeleteOptions,\n type StorageWorkspace,\n type StorageWorkspaceDirectory,\n type StorageWorkspaceEntry,\n type StorageWorkspaceFile,\n type StorageWorkspaceLimits,\n type StorageWorkspaceListOptions,\n type StorageWorkspaceMountOptions,\n type StorageWorkspaceMutationOptions,\n type StorageWorkspaceOverwriteOptions,\n type StorageWorkspacePage,\n type StorageWorkspacePermission,\n type StorageWorkspaceReadOptions,\n type StorageWorkspaceSearchMatch,\n type StorageWorkspaceSearchOptions,\n type StorageWorkspaceTextFile,\n type StorageWorkspaceUnconditionalDeleteOptions,\n type StorageWorkspaceWriteOptions,\n} from './storage-workspace.types.js';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"storage-workspace.d.ts","sourceRoot":"","sources":["../../src/workspace/storage-workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AA+BrD,OAAO,KAAK,EACV,4BAA4B,EAC5B,gBAAgB,IAAI,wBAAwB,EAgB7C,MAAM,8BAA8B,CAAC;AAmlCtC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,4BAA4B,GACpC,wBAAwB,CAgB1B;AAED,wDAAwD;AACxD,eAAO,MAAM,sBAAsB,8BAAwB,CAAC"}
1
+ {"version":3,"file":"storage-workspace.d.ts","sourceRoot":"","sources":["../../src/workspace/storage-workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AA+BrD,OAAO,KAAK,EACV,4BAA4B,EAC5B,gBAAgB,IAAI,wBAAwB,EAoB7C,MAAM,8BAA8B,CAAC;AAqvCtC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,4BAA4B,GACpC,wBAAwB,CAgB1B;AAED,wDAAwD;AACxD,eAAO,MAAM,sBAAsB,8BAAwB,CAAC"}