@visulima/storage 1.0.0-alpha.8 → 1.0.0
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.
- package/CHANGELOG.md +578 -0
- package/LICENSE.md +237 -568
- package/README.md +82 -466
- package/dist/adapter/nuxt/module.d.ts +41 -34
- package/dist/adapter/nuxt/module.js +1 -93
- package/dist/adapter/nuxt/package.json +0 -6
- package/dist/ai/ai-sdk/index.d.ts +113 -0
- package/dist/ai/ai-sdk/index.js +1 -0
- package/dist/ai/claude/index.d.ts +177 -0
- package/dist/ai/claude/index.js +1 -0
- package/dist/ai/openai/index.d.ts +205 -0
- package/dist/ai/openai/index.js +1 -0
- package/dist/ai/tanstack/index.d.ts +115 -0
- package/dist/ai/tanstack/index.js +1 -0
- package/dist/handler/http/fetch/index.d.ts +303 -4
- package/dist/handler/http/fetch/index.js +1 -4
- package/dist/handler/http/hono/index.d.ts +73 -64
- package/dist/handler/http/hono/index.js +1 -65
- package/dist/handler/http/nextjs/index.d.ts +66 -58
- package/dist/handler/http/nextjs/index.js +1 -37
- package/dist/handler/http/node/index.d.ts +368 -4
- package/dist/handler/http/node/index.js +1 -8
- package/dist/handler/http/solid-start/index.d.ts +66 -57
- package/dist/handler/http/solid-start/index.js +1 -44
- package/dist/index.d.ts +106 -17
- package/dist/index.js +1 -13
- package/dist/openapi/index.d.ts +24 -5
- package/dist/openapi/index.js +1 -5
- package/dist/packem_shared/AbstractBaseStorage-Ba7cLu-t.js +1 -0
- package/dist/packem_shared/AwsLightFile-CpZrubaV.js +1 -0
- package/dist/packem_shared/AwsLightMetaStorage-DPqJ9LTr.js +1 -0
- package/dist/packem_shared/AwsLightStorage-DTBVxHXO.js +1 -0
- package/dist/packem_shared/AzureFile-DFSaVe25.js +1 -0
- package/dist/packem_shared/AzureSMetaStorage-ByzM6Aix.js +1 -0
- package/dist/packem_shared/AzureStorage-BFsD4qbF.js +1 -0
- package/dist/packem_shared/BaseTransformer-Buw5lX_3.js +1 -0
- package/dist/packem_shared/BoxFile-CseIoPW1.js +1 -0
- package/dist/packem_shared/BoxMetaStorage-DFwhEI9C.js +1 -0
- package/dist/packem_shared/BoxStorage-B_t-OVzf.js +1 -0
- package/dist/packem_shared/BunS3File-BcYmsz1n.js +1 -0
- package/dist/packem_shared/BunS3MetaStorage-DFwhEI9C.js +1 -0
- package/dist/packem_shared/BunS3Storage-CB_pZWlV.js +1 -0
- package/dist/packem_shared/BunnyFile-BgEOlcYI.js +1 -0
- package/dist/packem_shared/BunnyMetaStorage-DFwhEI9C.js +1 -0
- package/dist/packem_shared/BunnyStorage-CILSK4_Z.js +1 -0
- package/dist/packem_shared/CloudinaryFile-Bo5B-vM1.js +1 -0
- package/dist/packem_shared/CloudinaryMetaStorage-D_vNzewL.js +1 -0
- package/dist/packem_shared/CloudinaryStorage-DiCbdAi_.js +1 -0
- package/dist/packem_shared/DiskStorage-Kp5t3vnF.js +1 -0
- package/dist/packem_shared/DiskStorageWithChecksum-Bh6w-Iu8.js +1 -0
- package/dist/packem_shared/DropboxFile-BFb7eOzy.js +1 -0
- package/dist/packem_shared/DropboxMetaStorage-DFwhEI9C.js +1 -0
- package/dist/packem_shared/DropboxStorage-H8bd8hEz.js +1 -0
- package/dist/packem_shared/ERRORS-BIBxE2oR.js +1 -0
- package/dist/packem_shared/File-W8aOo15X.js +1 -0
- package/dist/packem_shared/Files-BA3mpDwz.js +1 -0
- package/dist/packem_shared/FirebaseFile-BLaBxa2A.js +1 -0
- package/dist/packem_shared/FirebaseMetaStorage-D_vNzewL.js +1 -0
- package/dist/packem_shared/FirebaseStorage-Dgk4XyMr.js +2 -0
- package/dist/packem_shared/FtpFile-ClWDYnt2.js +1 -0
- package/dist/packem_shared/FtpMetaStorage-DFwhEI9C.js +1 -0
- package/dist/packem_shared/FtpStorage-g_DjiR-C.js +1 -0
- package/dist/packem_shared/GCSConfig-BQ0OpVhe.js +1 -0
- package/dist/packem_shared/GCSFile-Cero7qZN.js +1 -0
- package/dist/packem_shared/GCSMetaStorage-3fLTlRd4.js +1 -0
- package/dist/packem_shared/GCStorage-DUfwVFd3.js +1 -0
- package/dist/packem_shared/GoogleDriveFile-DHpLhzg9.js +1 -0
- package/dist/packem_shared/GoogleDriveMetaStorage-DqkgoE46.js +1 -0
- package/dist/packem_shared/GoogleDriveStorage-D0-5egHE.js +1 -0
- package/dist/packem_shared/LocalMetaStorage-Bp5mVc76.js +1 -0
- package/dist/packem_shared/MediaTransformer-D2kUsklW.js +1 -0
- package/dist/packem_shared/MemoryMetaStorage-Ksgh9pe7.js +1 -0
- package/dist/packem_shared/MemoryStorage-DzSTdlAq.js +1 -0
- package/dist/packem_shared/MetaStorage-DPEUyWgN.js +1 -0
- package/dist/packem_shared/Metadata-B7CcBueg.js +1 -0
- package/dist/packem_shared/Multipart-Btj2mo9r.js +1 -0
- package/dist/packem_shared/Multipart-C4GpuHMU.js +1 -0
- package/dist/packem_shared/NetlifyBlobFile-DoFhkzaH.js +1 -0
- package/dist/packem_shared/NetlifyBlobMetaStorage-D_vNzewL.js +1 -0
- package/dist/packem_shared/NetlifyBlobStorage-DZdCmOVW.js +1 -0
- package/dist/packem_shared/NoOpMetrics-BLo6u4NY.js +1 -0
- package/dist/packem_shared/OneDriveFile-CNNJYI43.js +1 -0
- package/dist/packem_shared/OneDriveMetaStorage-DqkgoE46.js +1 -0
- package/dist/packem_shared/OneDriveStorage-CvJetV7_.js +1 -0
- package/dist/packem_shared/OpenTelemetryMetrics-DJDQsNKp.js +1 -0
- package/dist/packem_shared/PocketBaseFile-DpJpxl3e.js +1 -0
- package/dist/packem_shared/PocketBaseMetaStorage-CpvDRnSu.js +1 -0
- package/dist/packem_shared/PocketBaseStorage-BPil-koe.js +1 -0
- package/dist/packem_shared/Rest-BehVaxbl.js +1 -0
- package/dist/packem_shared/Rest-ymPCZkKR.js +1 -0
- package/dist/packem_shared/S3File-CpZrubaV.js +1 -0
- package/dist/packem_shared/S3MetaStorage-CMonflzp.js +1 -0
- package/dist/packem_shared/S3Storage-wslqssvr.js +1 -0
- package/dist/packem_shared/SftpFile-ClWDYnt2.js +1 -0
- package/dist/packem_shared/SftpMetaStorage-DFwhEI9C.js +1 -0
- package/dist/packem_shared/SftpStorage-BVbMtS2b.js +1 -0
- package/dist/packem_shared/SharePointFile-Blz9FS4h.js +1 -0
- package/dist/packem_shared/SharePointMetaStorage-DFwhEI9C.js +1 -0
- package/dist/packem_shared/SharePointStorage-DWjvR5oZ.js +1 -0
- package/dist/packem_shared/SupabaseFile-Bo5B-vM1.js +1 -0
- package/dist/packem_shared/SupabaseMetaStorage-DqkgoE46.js +1 -0
- package/dist/packem_shared/SupabaseStorage-BiKmYKb6.js +1 -0
- package/dist/packem_shared/TUS_RESUMABLE-CyTSRvPU.js +1 -0
- package/dist/packem_shared/Tus-BgbON_wQ.js +1 -0
- package/dist/packem_shared/Tus-v6jzkaIO.js +1 -0
- package/dist/packem_shared/UploadControl-DZJhI9Wh.js +1 -0
- package/dist/packem_shared/UploadThingFile-BTFMpcIA.js +1 -0
- package/dist/packem_shared/UploadThingMetaStorage-D_vNzewL.js +1 -0
- package/dist/packem_shared/UploadThingStorage-jrEnANC5.js +1 -0
- package/dist/packem_shared/ValidationError-3B06DFyE.js +1 -0
- package/dist/packem_shared/VercelBlobFile-CVQwKlZk.js +1 -0
- package/dist/packem_shared/VercelBlobMetaStorage-DFwhEI9C.js +1 -0
- package/dist/packem_shared/VercelBlobStorage-Y-cDgH30.js +1 -0
- package/dist/packem_shared/_commonjsHelpers-CWAkuNXM.js +1 -0
- package/dist/packem_shared/agentsCopyFile-Dl5iffdH.js +1 -0
- package/dist/packem_shared/akamai-DthkaFul.js +1 -0
- package/dist/packem_shared/alibaba-BEi25O1g.js +1 -0
- package/dist/packem_shared/approval-fVHwBp7u.js +1 -0
- package/dist/packem_shared/approval.d-CMAYH9GF.d.ts +75 -0
- package/dist/packem_shared/aws-light-meta-storage-DGrn72VJ.js +4 -0
- package/dist/packem_shared/azure-meta-storage-ClbEsfI4.js +1 -0
- package/dist/packem_shared/backblaze-m1N5NZ9q.js +1 -0
- package/dist/packem_shared/base-handler-core-EeV8gZck.js +1 -0
- package/dist/packem_shared/base-handler-fetch-CHzsgb7C.js +1 -0
- package/dist/packem_shared/base-handler-node-BjpW8pGi.js +1 -0
- package/dist/packem_shared/cache-Cw3QjoVN.js +1 -0
- package/dist/packem_shared/claudeCopyFile-BX9O4ORk.js +1 -0
- package/dist/packem_shared/cloudflare-CdUTErlo.js +1 -0
- package/dist/packem_shared/copyFile-49FtxXcm.js +1 -0
- package/dist/packem_shared/copyFile-BUPezT_c.js +1 -0
- package/dist/packem_shared/createResponsesFileTools-6Tvt2PNr.js +1 -0
- package/dist/packem_shared/createRetryWrapper-CxgiV_hH.js +1 -0
- package/dist/packem_shared/detect-file-type-BA7UBLKA.js +1 -0
- package/dist/packem_shared/digitalOcean-B2uB6pgz.js +1 -0
- package/dist/packem_shared/disk-storage-DIn-VnCh.js +1 -0
- package/dist/packem_shared/disk-storage-with-checksum.d-B-VGEsfl.d.ts +156 -0
- package/dist/packem_shared/executors-BDzMjc4y.js +1 -0
- package/dist/packem_shared/executors.d-BZP2rWo3.d.ts +69 -0
- package/dist/packem_shared/exoscale-BDa1Gjth.js +1 -0
- package/dist/packem_shared/filebase-CsFYJIwB.js +1 -0
- package/dist/packem_shared/files.d-CH0iLBNC.d.ts +655 -0
- package/dist/packem_shared/gcs-meta-storage-Dy37wCjI.js +1 -0
- package/dist/packem_shared/get-file-status-y3wTtDQs.js +1 -0
- package/dist/packem_shared/getFormatFromContentType-DCTTPQHm.js +1 -0
- package/dist/packem_shared/has-content-50BsqrWw.js +1 -0
- package/dist/packem_shared/headers-BAiAKekR.js +26 -0
- package/dist/packem_shared/hetzner-BGGFiRGD.js +1 -0
- package/dist/packem_shared/ibmCos-j-3TfJ5p.js +1 -0
- package/dist/packem_shared/idriveE2-C6pQ5pQ0.js +1 -0
- package/dist/packem_shared/index-nZWCQrSe.js +5 -0
- package/dist/packem_shared/internal-D_cZIFwI.js +1 -0
- package/dist/packem_shared/is-expired-CBEk6XBi.js +1 -0
- package/dist/packem_shared/local-meta-storage-C2T92TYb.js +11 -0
- package/dist/packem_shared/local-meta-storage.d-D9PBfkn6.d.ts +21 -0
- package/dist/packem_shared/media-transformer.d-Quf4ai47.d.ts +331 -0
- package/dist/packem_shared/memory-storage.d-4EU1cMt1.d.ts +101 -0
- package/dist/packem_shared/minio-NKquuBfS.js +1 -0
- package/dist/packem_shared/multipart-base-BOzY19lb.js +1 -0
- package/dist/packem_shared/oauth-refresh-EdGzlcOZ.js +1 -0
- package/dist/packem_shared/oracleCloud-DslqNpn6.js +1 -0
- package/dist/packem_shared/ovhCloud-CMHE6uLV.js +1 -0
- package/dist/packem_shared/part-match-D-9dGX42.js +1 -0
- package/dist/packem_shared/path-0oTTdkvl-BVg7lYf5.js +1 -0
- package/dist/packem_shared/posix-dirname-CfpH5wZi.js +1 -0
- package/dist/packem_shared/response-builder-CbSA8qPa.js +1 -0
- package/dist/packem_shared/rest-base-CynUg0mH.js +1 -0
- package/dist/packem_shared/restOpenApiSpec-Csv513qf.js +1 -0
- package/dist/packem_shared/s3-base-storage-DXZYN24h.js +1 -0
- package/dist/packem_shared/s3-base-storage.d-BQgP5B-t.d.ts +287 -0
- package/dist/packem_shared/scaleway-U1In3v70.js +1 -0
- package/dist/packem_shared/sharedErrorSchemaObject-YN65aAKj.js +1 -0
- package/dist/packem_shared/storage-Cyy73Y6r.js +1 -0
- package/dist/packem_shared/storage.d-CEM1upWM.d.ts +1176 -0
- package/dist/packem_shared/storj-Cb59q9kF.js +1 -0
- package/dist/packem_shared/sync-DhR3536K.js +1 -0
- package/dist/packem_shared/tencent-Q1y2GENc.js +1 -0
- package/dist/packem_shared/tigris-BELKoyyp.js +1 -0
- package/dist/packem_shared/transformOpenApiSpec-CIEAgpBD.js +1 -0
- package/dist/packem_shared/tus-base.d-DLzKE54M.d.ts +106 -0
- package/dist/packem_shared/tusOpenApiSpec-D96B03t5.js +1 -0
- package/dist/packem_shared/types.d-Bon9GVVe.d.ts +104 -0
- package/dist/packem_shared/types.d-CggTCgXr.d.ts +49 -0
- package/dist/packem_shared/types.d-CrUWY4On.d.ts +720 -0
- package/dist/packem_shared/update-size-DuNuLyxj.js +1 -0
- package/dist/packem_shared/vultr-B491cQ4e.js +1 -0
- package/dist/packem_shared/waitForStorage-ByQmG4xF.js +1 -0
- package/dist/packem_shared/wasabi-DFrwIoab.js +1 -0
- package/dist/packem_shared/xhrOpenApiSpec-DQR4h6M8.js +1 -0
- package/dist/packem_shared/yandex-CwzHuEKP.js +1 -0
- package/dist/storage/aws/clients/index.d.ts +612 -6
- package/dist/storage/aws/clients/index.js +1 -6
- package/dist/storage/aws/index.d.ts +332 -4
- package/dist/storage/aws/index.js +1 -3
- package/dist/storage/aws-light/index.d.ts +259 -4
- package/dist/storage/aws-light/index.js +1 -3
- package/dist/storage/azure/index.d.ts +236 -4
- package/dist/storage/azure/index.js +1 -3
- package/dist/storage/box/index.d.ts +189 -0
- package/dist/storage/box/index.js +1 -0
- package/dist/storage/bun-s3/index.d.ts +200 -0
- package/dist/storage/bun-s3/index.js +1 -0
- package/dist/storage/bunny/index.d.ts +119 -0
- package/dist/storage/bunny/index.js +1 -0
- package/dist/storage/cloudinary/index.d.ts +121 -0
- package/dist/storage/cloudinary/index.js +1 -0
- package/dist/storage/dropbox/index.d.ts +132 -0
- package/dist/storage/dropbox/index.js +1 -0
- package/dist/storage/firebase/index.d.ts +192 -0
- package/dist/storage/firebase/index.js +1 -0
- package/dist/storage/ftp/index.d.ts +91 -0
- package/dist/storage/ftp/index.js +1 -0
- package/dist/storage/gcs/index.d.ts +195 -5
- package/dist/storage/gcs/index.js +1 -4
- package/dist/storage/google-drive/index.d.ts +148 -0
- package/dist/storage/google-drive/index.js +1 -0
- package/dist/storage/local/index.d.ts +7 -4
- package/dist/storage/local/index.js +1 -3
- package/dist/storage/memory/index.d.ts +6 -0
- package/dist/storage/memory/index.js +1 -0
- package/dist/storage/netlify-blob/index.d.ts +147 -4
- package/dist/storage/netlify-blob/index.js +1 -3
- package/dist/storage/onedrive/index.d.ts +103 -0
- package/dist/storage/onedrive/index.js +1 -0
- package/dist/storage/pocketbase/index.d.ts +172 -0
- package/dist/storage/pocketbase/index.js +1 -0
- package/dist/storage/sftp/index.d.ts +92 -0
- package/dist/storage/sftp/index.js +1 -0
- package/dist/storage/sharepoint/index.d.ts +180 -0
- package/dist/storage/sharepoint/index.js +1 -0
- package/dist/storage/supabase/index.d.ts +115 -0
- package/dist/storage/supabase/index.js +1 -0
- package/dist/storage/uploadthing/index.d.ts +95 -0
- package/dist/storage/uploadthing/index.js +1 -0
- package/dist/storage/vercel-blob/index.d.ts +189 -4
- package/dist/storage/vercel-blob/index.js +1 -3
- package/dist/transformer/audio-transformer.d.ts +127 -125
- package/dist/transformer/audio-transformer.js +1 -278
- package/dist/transformer/image-transformer.d.ts +573 -568
- package/dist/transformer/image-transformer.js +1 -1100
- package/dist/transformer/index.d.ts +62 -5
- package/dist/transformer/index.js +1 -4
- package/dist/transformer/video-transformer.d.ts +144 -142
- package/dist/transformer/video-transformer.js +1 -310
- package/package.json +202 -50
- package/dist/handler/base/base-handler-core.d.ts +0 -91
- package/dist/handler/base/base-handler-fetch.d.ts +0 -76
- package/dist/handler/base/base-handler-node.d.ts +0 -137
- package/dist/handler/multipart/multipart-base.d.ts +0 -84
- package/dist/handler/multipart/multipart-fetch.d.ts +0 -64
- package/dist/handler/multipart/multipart.d.ts +0 -49
- package/dist/handler/rest/rest-base.d.ts +0 -106
- package/dist/handler/rest/rest-fetch.d.ts +0 -88
- package/dist/handler/rest/rest.d.ts +0 -93
- package/dist/handler/tus/tus-base.d.ts +0 -152
- package/dist/handler/tus/tus-fetch.d.ts +0 -72
- package/dist/handler/tus/tus.d.ts +0 -78
- package/dist/handler/types.d.ts +0 -53
- package/dist/handler/utils/request-parser.d.ts +0 -72
- package/dist/handler/utils/response-builder.d.ts +0 -83
- package/dist/handler/utils/storage-utils.d.ts +0 -10
- package/dist/handler/utils/stream-utils.d.ts +0 -29
- package/dist/handler/utils/upload-handlers.d.ts +0 -76
- package/dist/metrics/index.d.ts +0 -2
- package/dist/metrics/no-op-metrics.d.ts +0 -15
- package/dist/metrics/opentelemetry-metrics.d.ts +0 -55
- package/dist/openapi/rest.d.ts +0 -7
- package/dist/openapi/shared.d.ts +0 -13
- package/dist/openapi/transform.d.ts +0 -3
- package/dist/openapi/tus.d.ts +0 -7
- package/dist/openapi/xhr.d.ts +0 -7
- package/dist/packem_shared/AwsLightFile-tTneXZgG.js +0 -11
- package/dist/packem_shared/AwsLightMetaStorage-BWSOtVaN.js +0 -4
- package/dist/packem_shared/AwsLightStorage-Blv-GP4v.js +0 -133
- package/dist/packem_shared/AzureFile-CesgFzps.js +0 -8
- package/dist/packem_shared/AzureSMetaStorage-CFs-OYJT.js +0 -88
- package/dist/packem_shared/AzureStorage-B0v048hG.js +0 -357
- package/dist/packem_shared/BaseTransformer-C2gLib6v.js +0 -82
- package/dist/packem_shared/DiskStorage-BlltBst6.js +0 -12
- package/dist/packem_shared/DiskStorageWithChecksum-BJTmMklc.js +0 -238
- package/dist/packem_shared/ERRORS-D0apMqnc.js +0 -97
- package/dist/packem_shared/File-Bb3P23dr.js +0 -69
- package/dist/packem_shared/GCSConfig-vPP22kN6.js +0 -11
- package/dist/packem_shared/GCSFile-BIEunhAN.js +0 -8
- package/dist/packem_shared/GCSMetaStorage-BYhwecZl.js +0 -7
- package/dist/packem_shared/GCStorage-BmnoK7Rz.js +0 -406
- package/dist/packem_shared/LocalMetaStorage-CZHhKkMd.js +0 -7
- package/dist/packem_shared/MediaTransformer-D6658DL1.js +0 -1197
- package/dist/packem_shared/MetaStorage-pECeFOad.js +0 -46
- package/dist/packem_shared/Metadata-DRLXeJ0F.js +0 -89
- package/dist/packem_shared/Multipart-5Xpy7WhY.js +0 -163
- package/dist/packem_shared/Multipart-C-iU9LXj.js +0 -128
- package/dist/packem_shared/NetlifyBlobFile-CXzyjqrD.js +0 -14
- package/dist/packem_shared/NetlifyBlobMetaStorage-DxZ5aDvD.js +0 -9
- package/dist/packem_shared/NetlifyBlobStorage-CLPtjHqd.js +0 -376
- package/dist/packem_shared/NoOpMetrics-DhAk5rXc.js +0 -10
- package/dist/packem_shared/OpenTelemetryMetrics-BnxhqIaH.js +0 -67
- package/dist/packem_shared/Rest-DO7OslCs.js +0 -267
- package/dist/packem_shared/Rest-DTaszQ6n.js +0 -228
- package/dist/packem_shared/S3File-DZiyk9Qt.js +0 -11
- package/dist/packem_shared/S3MetaStorage-Dz9aDabA.js +0 -76
- package/dist/packem_shared/S3Storage-DHmTk-hU.js +0 -316
- package/dist/packem_shared/TUS_RESUMABLE-BfguFdM1.js +0 -434
- package/dist/packem_shared/Tus-BQItPVAC.js +0 -200
- package/dist/packem_shared/Tus-BibjweWH.js +0 -195
- package/dist/packem_shared/ValidationError-BfF1aE4h.js +0 -26
- package/dist/packem_shared/VercelBlobFile-BCg4aTEq.js +0 -18
- package/dist/packem_shared/VercelBlobMetaStorage-Bd9F-VFm.js +0 -9
- package/dist/packem_shared/VercelBlobStorage-DD9LMOS6.js +0 -261
- package/dist/packem_shared/_commonjsHelpers-B85MJLTf.js +0 -5
- package/dist/packem_shared/aws-light-meta-storage-DKJBgbR6.js +0 -446
- package/dist/packem_shared/backblaze-BlMnIcBC.js +0 -20
- package/dist/packem_shared/base-handler-core-DLEVHemv.js +0 -303
- package/dist/packem_shared/base-handler-fetch-A7V0N6AJ.js +0 -291
- package/dist/packem_shared/base-handler-node-Dx7ce3sU.js +0 -730
- package/dist/packem_shared/cache-B88MXQ_2.js +0 -18
- package/dist/packem_shared/cloudflare-Bi1q8wXE.js +0 -21
- package/dist/packem_shared/defaultCloudStorageFileNameValidation-DUuacjWv.js +0 -11
- package/dist/packem_shared/digitalOcean-CWQRJM3L.js +0 -21
- package/dist/packem_shared/disk-storage-Bh2wy3YW.js +0 -810
- package/dist/packem_shared/gcs-meta-storage-DqNjM7DP.js +0 -158
- package/dist/packem_shared/has-content-CY66ehMK.js +0 -3
- package/dist/packem_shared/headers-C9DasoT1.js +0 -1318
- package/dist/packem_shared/is-expired-CTThU1q5.js +0 -8
- package/dist/packem_shared/isRetryableError-Dycp7127.js +0 -82
- package/dist/packem_shared/isValidMediaType-BeDgiObq.js +0 -35
- package/dist/packem_shared/local-meta-storage-By-3SNBI.js +0 -649
- package/dist/packem_shared/minio-C2YBZQOw.js +0 -22
- package/dist/packem_shared/multipart-base-BY0rhkw5.js +0 -102
- package/dist/packem_shared/part-match-BMNqHDYD.js +0 -96
- package/dist/packem_shared/path-CR6YkPXX-7R1-9CMk.js +0 -161
- package/dist/packem_shared/response-builder-BtnRiBUI.js +0 -45
- package/dist/packem_shared/rest-base-Bt9Np3M8.js +0 -457
- package/dist/packem_shared/restOpenApiSpec-D1JC_Jto.js +0 -800
- package/dist/packem_shared/s3-base-storage-C1DIHTYY.js +0 -510
- package/dist/packem_shared/sharedGet-Cpo7QUyu.js +0 -1019
- package/dist/packem_shared/storage-C6NSXb8h.js +0 -1175
- package/dist/packem_shared/tigris-Hac8TKnX.js +0 -21
- package/dist/packem_shared/transformOpenApiSpec-DWM5WtnN.js +0 -975
- package/dist/packem_shared/tusOpenApiSpec-mBZkl7he.js +0 -740
- package/dist/packem_shared/update-size-CCGm6i1J.js +0 -8
- package/dist/packem_shared/validator-BeX_lJet.js +0 -78
- package/dist/packem_shared/waitForStorage-Cscw85sx.js +0 -18
- package/dist/packem_shared/wasabi-DIyflHSd.js +0 -21
- package/dist/packem_shared/xhrOpenApiSpec-B1V5Dxrj.js +0 -264
- package/dist/storage/aws/clients/backblaze.d.ts +0 -12
- package/dist/storage/aws/clients/cloudflare.d.ts +0 -13
- package/dist/storage/aws/clients/digital-ocean.d.ts +0 -12
- package/dist/storage/aws/clients/minio.d.ts +0 -13
- package/dist/storage/aws/clients/tigris.d.ts +0 -12
- package/dist/storage/aws/clients/types.d.ts +0 -95
- package/dist/storage/aws/clients/wasabi.d.ts +0 -12
- package/dist/storage/aws/s3-base-storage.d.ts +0 -248
- package/dist/storage/aws/s3-client-adapter.d.ts +0 -110
- package/dist/storage/aws/s3-file.d.ts +0 -10
- package/dist/storage/aws/s3-meta-storage.d.ts +0 -15
- package/dist/storage/aws/s3-storage.d.ts +0 -70
- package/dist/storage/aws/types.d.ts +0 -119
- package/dist/storage/aws-light/aws-light-api-adapter.d.ts +0 -130
- package/dist/storage/aws-light/aws-light-file.d.ts +0 -10
- package/dist/storage/aws-light/aws-light-meta-storage.d.ts +0 -19
- package/dist/storage/aws-light/aws-light-storage.d.ts +0 -65
- package/dist/storage/aws-light/types.d.ts +0 -37
- package/dist/storage/azure/azure-file.d.ts +0 -6
- package/dist/storage/azure/azure-meta-storage.d.ts +0 -15
- package/dist/storage/azure/azure-storage.d.ts +0 -69
- package/dist/storage/azure/types.d.ts +0 -62
- package/dist/storage/gcs/fetch-error.d.ts +0 -11
- package/dist/storage/gcs/gcs-config.d.ts +0 -2
- package/dist/storage/gcs/gcs-file.d.ts +0 -6
- package/dist/storage/gcs/gcs-meta-storage.d.ts +0 -27
- package/dist/storage/gcs/gcs-storage.d.ts +0 -91
- package/dist/storage/gcs/types.d.ts +0 -55
- package/dist/storage/gcs/utils.d.ts +0 -7
- package/dist/storage/local/disk-storage-with-checksum.d.ts +0 -15
- package/dist/storage/local/disk-storage.d.ts +0 -135
- package/dist/storage/local/local-meta-storage.d.ts +0 -32
- package/dist/storage/meta-storage.d.ts +0 -30
- package/dist/storage/netlify-blob/netlify-blob-file.d.ts +0 -12
- package/dist/storage/netlify-blob/netlify-blob-meta-storage.d.ts +0 -7
- package/dist/storage/netlify-blob/netlify-blob-storage.d.ts +0 -93
- package/dist/storage/netlify-blob/types.d.ts +0 -30
- package/dist/storage/storage.d.ts +0 -353
- package/dist/storage/types.d.ts +0 -221
- package/dist/storage/utils/file/file.d.ts +0 -25
- package/dist/storage/utils/file/get-file-status.d.ts +0 -9
- package/dist/storage/utils/file/has-content.d.ts +0 -9
- package/dist/storage/utils/file/index.d.ts +0 -10
- package/dist/storage/utils/file/is-expired.d.ts +0 -8
- package/dist/storage/utils/file/metadata.d.ts +0 -18
- package/dist/storage/utils/file/part-match.d.ts +0 -11
- package/dist/storage/utils/file/types.d.ts +0 -37
- package/dist/storage/utils/file/update-metadata.d.ts +0 -10
- package/dist/storage/utils/file/update-size.d.ts +0 -10
- package/dist/storage/vercel-blob/types.d.ts +0 -32
- package/dist/storage/vercel-blob/vercel-blob-file.d.ts +0 -16
- package/dist/storage/vercel-blob/vercel-blob-meta-storage.d.ts +0 -7
- package/dist/storage/vercel-blob/vercel-blob-storage.d.ts +0 -76
- package/dist/transformer/base-transformer.d.ts +0 -63
- package/dist/transformer/media-transformer.d.ts +0 -332
- package/dist/transformer/types.d.ts +0 -652
- package/dist/transformer/utils.d.ts +0 -33
- package/dist/transformer/validation-error.d.ts +0 -23
- package/dist/utils/cache.d.ts +0 -32
- package/dist/utils/chunked-upload.d.ts +0 -65
- package/dist/utils/detect-file-type.d.ts +0 -28
- package/dist/utils/errors.d.ts +0 -74
- package/dist/utils/file-path-url-matcher.d.ts +0 -18
- package/dist/utils/headers.d.ts +0 -111
- package/dist/utils/http.d.ts +0 -92
- package/dist/utils/locker.d.ts +0 -26
- package/dist/utils/pipes/stream-checksum.d.ts +0 -47
- package/dist/utils/pipes/stream-length.d.ts +0 -22
- package/dist/utils/primitives/get-last-one.d.ts +0 -3
- package/dist/utils/primitives/is-record.d.ts +0 -2
- package/dist/utils/primitives/map-values.d.ts +0 -9
- package/dist/utils/primitives/pick.d.ts +0 -2
- package/dist/utils/primitives/to-milliseconds.d.ts +0 -12
- package/dist/utils/primitives/to-seconds.d.ts +0 -12
- package/dist/utils/range-checksum.d.ts +0 -33
- package/dist/utils/range-hasher.d.ts +0 -46
- package/dist/utils/retry.d.ts +0 -64
- package/dist/utils/types.d.ts +0 -108
- package/dist/utils/validation-error.d.ts +0 -22
- package/dist/utils/validator.d.ts +0 -36
|
@@ -1,4 +1,332 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { F as File, k as MetaStorageOptions, l as BaseStorageOptions, L as LocalMetaStorageOptions, M as MetaStorage, H as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-CEM1upWM.js";
|
|
2
|
+
import { Readable } from 'node:stream';
|
|
3
|
+
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-BQgP5B-t.js";
|
|
4
|
+
import { S3ClientConfig, ObjectCannedACL, S3Client } from '@aws-sdk/client-s3';
|
|
5
|
+
import { ResponseMetadata } from '@aws-sdk/types';
|
|
6
|
+
import 'node:crypto';
|
|
7
|
+
import 'node:http';
|
|
8
|
+
import 'lru-cache';
|
|
9
|
+
declare class S3File extends File {
|
|
10
|
+
Parts?: Part[];
|
|
11
|
+
UploadId?: string;
|
|
12
|
+
uri?: string;
|
|
13
|
+
partsUrls?: string[];
|
|
14
|
+
partSize?: number;
|
|
15
|
+
}
|
|
16
|
+
type S3MetaStorageOptions = MetaStorageOptions & S3ClientConfig & {
|
|
17
|
+
bucket?: string;
|
|
18
|
+
keyFile?: string;
|
|
19
|
+
};
|
|
20
|
+
type S3StorageOptions = BaseStorageOptions & S3ClientConfig & {
|
|
21
|
+
/**
|
|
22
|
+
* Specifying access rules for uploaded files.
|
|
23
|
+
*/
|
|
24
|
+
acl?: ObjectCannedACL;
|
|
25
|
+
/**
|
|
26
|
+
* S3 bucket name.
|
|
27
|
+
* @default 'node-Upload'
|
|
28
|
+
*/
|
|
29
|
+
bucket?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Force compatible client upload directly to S3 storage
|
|
32
|
+
*/
|
|
33
|
+
clientDirectUpload?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use standard auth providers
|
|
36
|
+
*/
|
|
37
|
+
keyFile?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Configure metafiles storage
|
|
40
|
+
* @example
|
|
41
|
+
* Using local metafiles
|
|
42
|
+
* ```ts
|
|
43
|
+
* const storage = new S3Storage({
|
|
44
|
+
* bucket: 'upload',
|
|
45
|
+
* region: 'eu-west-3',
|
|
46
|
+
* metaStorageConfig: { directory: '/tmp/upload-metafiles' }
|
|
47
|
+
* })
|
|
48
|
+
* ```
|
|
49
|
+
* Using a separate bucket for metafiles
|
|
50
|
+
* ```ts
|
|
51
|
+
* const storage = new S3Storage({
|
|
52
|
+
* bucket: 'upload',
|
|
53
|
+
* region: 'eu-west-3',
|
|
54
|
+
* metaStorageConfig: { bucket: 'upload-metafiles' }
|
|
55
|
+
* })
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
metaStorageConfig?: LocalMetaStorageOptions | S3MetaStorageOptions;
|
|
59
|
+
/**
|
|
60
|
+
* The parts size that the client should use for presigned multipart unloading.
|
|
61
|
+
* @default '16MB'
|
|
62
|
+
*/
|
|
63
|
+
partSize?: number | string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* SDK V3
|
|
67
|
+
* A structure containing information about a service or networking error.
|
|
68
|
+
*/
|
|
69
|
+
interface AwsError extends Error {
|
|
70
|
+
$fault?: "client" | "server";
|
|
71
|
+
$metadata: ResponseMetadata;
|
|
72
|
+
$service?: string;
|
|
73
|
+
Code?: string;
|
|
74
|
+
Type?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* SDK V2
|
|
78
|
+
* A structure containing information about a service or networking error.
|
|
79
|
+
*/
|
|
80
|
+
interface AWSErrorV2 extends Error {
|
|
81
|
+
/**
|
|
82
|
+
* CloudFront request ID associated with the response.
|
|
83
|
+
*/
|
|
84
|
+
cfId: string;
|
|
85
|
+
/**
|
|
86
|
+
* A unique short code representing the error that was emitted.
|
|
87
|
+
*/
|
|
88
|
+
code: string;
|
|
89
|
+
/**
|
|
90
|
+
* Second request ID associated with the response from S3.
|
|
91
|
+
*/
|
|
92
|
+
extendedRequestId: string;
|
|
93
|
+
/**
|
|
94
|
+
* Set when a networking error occurs to easily identify the endpoint of the request.
|
|
95
|
+
*/
|
|
96
|
+
hostname: string;
|
|
97
|
+
/**
|
|
98
|
+
* A longer human readable error message.
|
|
99
|
+
*/
|
|
100
|
+
message: string;
|
|
101
|
+
/**
|
|
102
|
+
* Set when a networking error occurs to easily identify the region of the request.
|
|
103
|
+
*/
|
|
104
|
+
region: string;
|
|
105
|
+
/**
|
|
106
|
+
* The unique request ID associated with the response.
|
|
107
|
+
*/
|
|
108
|
+
requestId: string;
|
|
109
|
+
/**
|
|
110
|
+
* Whether the error message is retryable.
|
|
111
|
+
*/
|
|
112
|
+
retryable: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Amount of time (in seconds) that the request waited before being resent.
|
|
115
|
+
*/
|
|
116
|
+
retryDelay: number;
|
|
117
|
+
/**
|
|
118
|
+
* In the case of a request that reached the service, this value contains the response status code.
|
|
119
|
+
*/
|
|
120
|
+
statusCode: number;
|
|
121
|
+
/**
|
|
122
|
+
* The date time object when the error occurred.
|
|
123
|
+
*/
|
|
124
|
+
time: Date;
|
|
125
|
+
}
|
|
126
|
+
declare class S3MetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
127
|
+
config: S3MetaStorageOptions;
|
|
128
|
+
private readonly bucket;
|
|
129
|
+
private readonly client;
|
|
130
|
+
constructor(config: S3MetaStorageOptions);
|
|
131
|
+
override get(id: string): Promise<T>;
|
|
132
|
+
override touch(id: string, file: T): Promise<T>;
|
|
133
|
+
override delete(id: string): Promise<void>;
|
|
134
|
+
override save(id: string, file: T): Promise<T>;
|
|
135
|
+
private accessCheck;
|
|
136
|
+
}
|
|
137
|
+
type ReadableStream = globalThis.ReadableStream;
|
|
138
|
+
/**
|
|
139
|
+
* Adapter that wraps AWS SDK S3Client to implement S3ApiOperations interface.
|
|
140
|
+
*/
|
|
141
|
+
declare class S3ClientAdapter implements S3ApiOperations {
|
|
142
|
+
private readonly client;
|
|
143
|
+
constructor(client: S3Client, _bucket: string);
|
|
144
|
+
createMultipartUpload(params: {
|
|
145
|
+
ACL?: string;
|
|
146
|
+
Bucket: string;
|
|
147
|
+
ContentType?: string;
|
|
148
|
+
Key: string;
|
|
149
|
+
Metadata?: Record<string, string>;
|
|
150
|
+
}, options?: S3CallOptions): Promise<{
|
|
151
|
+
UploadId: string;
|
|
152
|
+
}>;
|
|
153
|
+
uploadPart(params: {
|
|
154
|
+
Body: Readable | ReadableStream | Uint8Array;
|
|
155
|
+
Bucket: string;
|
|
156
|
+
ContentLength?: number;
|
|
157
|
+
ContentMD5?: string;
|
|
158
|
+
Key: string;
|
|
159
|
+
PartNumber: number;
|
|
160
|
+
UploadId: string;
|
|
161
|
+
}, options?: S3CallOptions): Promise<{
|
|
162
|
+
ETag: string;
|
|
163
|
+
}>;
|
|
164
|
+
completeMultipartUpload(params: {
|
|
165
|
+
Bucket: string;
|
|
166
|
+
Key: string;
|
|
167
|
+
Parts: {
|
|
168
|
+
ETag: string;
|
|
169
|
+
PartNumber: number;
|
|
170
|
+
}[];
|
|
171
|
+
UploadId: string;
|
|
172
|
+
}, options?: S3CallOptions): Promise<{
|
|
173
|
+
ETag?: string;
|
|
174
|
+
Location: string;
|
|
175
|
+
}>;
|
|
176
|
+
abortMultipartUpload(params: {
|
|
177
|
+
Bucket: string;
|
|
178
|
+
Key: string;
|
|
179
|
+
UploadId: string;
|
|
180
|
+
}, options?: S3CallOptions): Promise<void>;
|
|
181
|
+
listParts(params: {
|
|
182
|
+
Bucket: string;
|
|
183
|
+
Key: string;
|
|
184
|
+
UploadId: string;
|
|
185
|
+
}, options?: S3CallOptions): Promise<{
|
|
186
|
+
Parts?: Part[];
|
|
187
|
+
}>;
|
|
188
|
+
getObject(params: {
|
|
189
|
+
Bucket: string;
|
|
190
|
+
Key: string;
|
|
191
|
+
Range?: string;
|
|
192
|
+
}, options?: S3CallOptions): Promise<{
|
|
193
|
+
Body?: ReadableStream | Readable;
|
|
194
|
+
ContentLength?: number;
|
|
195
|
+
ContentType?: string;
|
|
196
|
+
ETag?: string;
|
|
197
|
+
Expires?: Date;
|
|
198
|
+
LastModified?: Date;
|
|
199
|
+
Metadata?: Record<string, string>;
|
|
200
|
+
}>;
|
|
201
|
+
headObject(params: {
|
|
202
|
+
Bucket: string;
|
|
203
|
+
Key: string;
|
|
204
|
+
}, options?: S3CallOptions): Promise<{
|
|
205
|
+
ContentLength?: number;
|
|
206
|
+
ContentType?: string;
|
|
207
|
+
ETag?: string;
|
|
208
|
+
Expires?: Date;
|
|
209
|
+
LastModified?: Date;
|
|
210
|
+
}>;
|
|
211
|
+
deleteObject(params: {
|
|
212
|
+
Bucket: string;
|
|
213
|
+
Key: string;
|
|
214
|
+
}, options?: S3CallOptions): Promise<void>;
|
|
215
|
+
copyObject(params: {
|
|
216
|
+
Bucket: string;
|
|
217
|
+
CopySource: string;
|
|
218
|
+
Key: string;
|
|
219
|
+
StorageClass?: string;
|
|
220
|
+
}, options?: S3CallOptions): Promise<void>;
|
|
221
|
+
listObjectsV2(params: {
|
|
222
|
+
Bucket: string;
|
|
223
|
+
ContinuationToken?: string;
|
|
224
|
+
Delimiter?: string;
|
|
225
|
+
MaxKeys?: number;
|
|
226
|
+
Prefix?: string;
|
|
227
|
+
}, options?: S3CallOptions): Promise<{
|
|
228
|
+
CommonPrefixes?: {
|
|
229
|
+
Prefix?: string;
|
|
230
|
+
}[];
|
|
231
|
+
Contents?: {
|
|
232
|
+
Key?: string;
|
|
233
|
+
LastModified?: Date;
|
|
234
|
+
}[];
|
|
235
|
+
IsTruncated?: boolean;
|
|
236
|
+
NextContinuationToken?: string;
|
|
237
|
+
}>;
|
|
238
|
+
getPresignedUrl(params: {
|
|
239
|
+
Bucket: string;
|
|
240
|
+
expiresIn: number;
|
|
241
|
+
Key: string;
|
|
242
|
+
PartNumber: number;
|
|
243
|
+
UploadId: string;
|
|
244
|
+
}): Promise<string>;
|
|
245
|
+
checkBucketAccess(params: {
|
|
246
|
+
Bucket: string;
|
|
247
|
+
}): Promise<void>;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Amazon S3 storage implementation.
|
|
251
|
+
* @example
|
|
252
|
+
* ```ts
|
|
253
|
+
* const storage = new S3Storage({
|
|
254
|
+
* bucket: <YOUR_BUCKET>,
|
|
255
|
+
* endpoint: <YOUR_ENDPOINT>,
|
|
256
|
+
* region: <YOUR_REGION>,
|
|
257
|
+
* credentials: {
|
|
258
|
+
* accessKeyId: <YOUR_ACCESS_KEY_ID>,
|
|
259
|
+
* secretAccessKey: <YOUR_SECRET_ACCESS_KEY>
|
|
260
|
+
* },
|
|
261
|
+
* metaStorageConfig: { directory: '/tmp/upload-metafiles' }
|
|
262
|
+
* });
|
|
263
|
+
* ```
|
|
264
|
+
* @remarks
|
|
265
|
+
* ## Error Handling
|
|
266
|
+
* - S3 API errors are normalized with AWS-specific context
|
|
267
|
+
* - Errors include S3 error codes and metadata for debugging
|
|
268
|
+
* - Batch operations handle individual failures gracefully
|
|
269
|
+
*
|
|
270
|
+
* ## Retry Behavior
|
|
271
|
+
* - All S3 API calls are wrapped with configurable retry logic via `retryConfig` option
|
|
272
|
+
* - Default retryable status codes: 408 (Request Timeout), 429 (Too Many Requests),
|
|
273
|
+
* 500 (Internal Server Error), 502 (Bad Gateway), 503 (Service Unavailable), 504 (Gateway Timeout)
|
|
274
|
+
* - Retries server-side faults ($fault === "server") automatically
|
|
275
|
+
* - Custom `shouldRetry` function can be provided for advanced retry logic
|
|
276
|
+
* - Default retry configuration: maxRetries: 3, initialDelay: 1000ms, maxDelay: 30000ms, backoffMultiplier: 2 (exponential backoff)
|
|
277
|
+
* - Retry wrapper handles transient network errors and rate limiting
|
|
278
|
+
*
|
|
279
|
+
* ## Multipart Uploads
|
|
280
|
+
* - Large files are automatically split into multipart uploads
|
|
281
|
+
* - Maximum 10,000 parts per upload (S3 limitation)
|
|
282
|
+
* - Part size is configurable (default: 16MB, minimum: 5MB)
|
|
283
|
+
* - Failed multipart uploads are automatically aborted
|
|
284
|
+
*
|
|
285
|
+
* ## Supported Operations
|
|
286
|
+
* - ✅ create, write, delete, get, getStream, list, update, copy, move
|
|
287
|
+
* - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
|
|
288
|
+
* - ✅ exists: Implemented (checks metadata and S3 object)
|
|
289
|
+
* - ❌ getUrl: Not implemented (presigned URLs available via buildPresigned for clientDirectUpload)
|
|
290
|
+
* - ❌ getUploadUrl: Not implemented (presigned URLs available via buildPresigned for clientDirectUpload)
|
|
291
|
+
*/
|
|
292
|
+
declare class S3Storage extends S3BaseStorage {
|
|
293
|
+
static override readonly name: string;
|
|
294
|
+
private s3Api;
|
|
295
|
+
private rawClient;
|
|
296
|
+
constructor(config: S3StorageOptions);
|
|
297
|
+
/**
|
|
298
|
+
* Normalizes AWS S3 errors with S3-specific context.
|
|
299
|
+
*/
|
|
300
|
+
override normalizeError(error: AwsError): HttpError;
|
|
301
|
+
override update({
|
|
302
|
+
id
|
|
303
|
+
}: FileQuery, metadata: Partial<S3File>): Promise<S3File>;
|
|
304
|
+
override getStream({
|
|
305
|
+
id
|
|
306
|
+
}: FileQuery, options?: OperationOptions & {
|
|
307
|
+
range?: {
|
|
308
|
+
end?: number;
|
|
309
|
+
start: number;
|
|
310
|
+
};
|
|
311
|
+
}): Promise<{
|
|
312
|
+
headers?: Record<string, string>;
|
|
313
|
+
size?: number;
|
|
314
|
+
stream: Readable;
|
|
315
|
+
}>;
|
|
316
|
+
override get raw(): S3Client;
|
|
317
|
+
override getReadUrl(key: string, options?: {
|
|
318
|
+
expiresIn?: number;
|
|
319
|
+
responseContentDisposition?: string;
|
|
320
|
+
responseContentType?: string;
|
|
321
|
+
}): Promise<string>;
|
|
322
|
+
override getUploadUrl(key: string, options?: {
|
|
323
|
+
contentLength?: number;
|
|
324
|
+
contentType?: string;
|
|
325
|
+
expiresIn?: number;
|
|
326
|
+
}): Promise<string>;
|
|
327
|
+
protected getS3Api(): S3ClientAdapter;
|
|
328
|
+
protected getFileClass(): new (config: FileInit) => S3File;
|
|
329
|
+
protected getAcl(): string | undefined;
|
|
330
|
+
protected accessCheck(_maxWaitTime?: number): Promise<void>;
|
|
331
|
+
}
|
|
332
|
+
export { type AWSErrorV2, type AwsError, S3File, S3MetaStorage, type S3MetaStorageOptions, S3Storage, type S3StorageOptions };
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as S3MetaStorage } from '../../packem_shared/S3MetaStorage-Dz9aDabA.js';
|
|
3
|
-
export { default as S3Storage } from '../../packem_shared/S3Storage-DHmTk-hU.js';
|
|
1
|
+
import{default as t}from"../../packem_shared/S3File-CpZrubaV.js";import{default as r}from"../../packem_shared/S3MetaStorage-CMonflzp.js";import{default as S}from"../../packem_shared/S3Storage-wslqssvr.js";export{t as S3File,r as S3MetaStorage,S as S3Storage};
|
|
@@ -1,4 +1,259 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-BQgP5B-t.js";
|
|
2
|
+
import { F as File, k as MetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, H as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-CEM1upWM.js";
|
|
3
|
+
import { Readable } from 'node:stream';
|
|
4
|
+
import { AwsClient } from 'aws4fetch';
|
|
5
|
+
import 'node:crypto';
|
|
6
|
+
import 'node:http';
|
|
7
|
+
import 'lru-cache';
|
|
8
|
+
declare class AwsLightFile extends File {
|
|
9
|
+
Parts?: Part[];
|
|
10
|
+
UploadId?: string;
|
|
11
|
+
uri?: string;
|
|
12
|
+
partsUrls?: string[];
|
|
13
|
+
partSize?: number;
|
|
14
|
+
}
|
|
15
|
+
interface AwsLightClientConfig {
|
|
16
|
+
accessKeyId: string;
|
|
17
|
+
endpoint?: string;
|
|
18
|
+
region: string;
|
|
19
|
+
secretAccessKey: string;
|
|
20
|
+
service?: string;
|
|
21
|
+
sessionToken?: string;
|
|
22
|
+
}
|
|
23
|
+
type AwsLightMetaStorageOptions = AwsLightClientConfig & MetaStorageOptions & {
|
|
24
|
+
bucket?: string;
|
|
25
|
+
};
|
|
26
|
+
type AwsLightStorageOptions = AwsLightClientConfig & BaseStorageOptions & {
|
|
27
|
+
/**
|
|
28
|
+
* S3 bucket name.
|
|
29
|
+
*/
|
|
30
|
+
bucket?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Force compatible client upload directly to S3 storage
|
|
33
|
+
*/
|
|
34
|
+
clientDirectUpload?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Configure metafiles storage
|
|
37
|
+
*/
|
|
38
|
+
metaStorageConfig?: AwsLightMetaStorageOptions;
|
|
39
|
+
/**
|
|
40
|
+
* The parts size that the client should use for presigned multipart unloading.
|
|
41
|
+
* @default '16MB'
|
|
42
|
+
*/
|
|
43
|
+
partSize?: number | string;
|
|
44
|
+
};
|
|
45
|
+
interface AwsLightError extends Error {
|
|
46
|
+
code?: string;
|
|
47
|
+
requestId?: string;
|
|
48
|
+
statusCode?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* AWS Light meta storage implementation using aws4fetch.
|
|
52
|
+
* Stores metadata in S3 object metadata headers (x-amz-meta-*).
|
|
53
|
+
* Optimized for worker environments (Cloudflare Workers, Web Workers, etc.).
|
|
54
|
+
*/
|
|
55
|
+
declare class AwsLightMetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
56
|
+
config: AwsLightMetaStorageOptions;
|
|
57
|
+
private readonly adapter;
|
|
58
|
+
private readonly bucket;
|
|
59
|
+
constructor(config: AwsLightMetaStorageOptions);
|
|
60
|
+
override get(id: string): Promise<T>;
|
|
61
|
+
override touch(id: string, file: T): Promise<T>;
|
|
62
|
+
override delete(id: string): Promise<void>;
|
|
63
|
+
override save(id: string, file: T): Promise<T>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Adapter that uses aws4fetch to implement S3ApiOperations interface.
|
|
67
|
+
*/
|
|
68
|
+
declare class AwsLightApiAdapter implements S3ApiOperations {
|
|
69
|
+
aws: AwsClient;
|
|
70
|
+
private readonly bucket;
|
|
71
|
+
private readonly endpoint;
|
|
72
|
+
constructor(config: AwsLightClientConfig & {
|
|
73
|
+
bucket: string;
|
|
74
|
+
});
|
|
75
|
+
createMultipartUpload(params: {
|
|
76
|
+
ACL?: string;
|
|
77
|
+
Bucket: string;
|
|
78
|
+
ContentType?: string;
|
|
79
|
+
Key: string;
|
|
80
|
+
Metadata?: Record<string, string>;
|
|
81
|
+
}, options?: S3CallOptions): Promise<{
|
|
82
|
+
UploadId: string;
|
|
83
|
+
}>;
|
|
84
|
+
uploadPart(params: {
|
|
85
|
+
Body: Readable | ReadableStream | Uint8Array;
|
|
86
|
+
Bucket: string;
|
|
87
|
+
ContentLength?: number;
|
|
88
|
+
ContentMD5?: string;
|
|
89
|
+
Key: string;
|
|
90
|
+
PartNumber: number;
|
|
91
|
+
UploadId: string;
|
|
92
|
+
}, options?: S3CallOptions): Promise<{
|
|
93
|
+
ETag: string;
|
|
94
|
+
}>;
|
|
95
|
+
completeMultipartUpload(params: {
|
|
96
|
+
Bucket: string;
|
|
97
|
+
Key: string;
|
|
98
|
+
Parts: {
|
|
99
|
+
ETag: string;
|
|
100
|
+
PartNumber: number;
|
|
101
|
+
}[];
|
|
102
|
+
UploadId: string;
|
|
103
|
+
}, options?: S3CallOptions): Promise<{
|
|
104
|
+
ETag?: string;
|
|
105
|
+
Location: string;
|
|
106
|
+
}>;
|
|
107
|
+
abortMultipartUpload(params: {
|
|
108
|
+
Bucket: string;
|
|
109
|
+
Key: string;
|
|
110
|
+
UploadId: string;
|
|
111
|
+
}, options?: S3CallOptions): Promise<void>;
|
|
112
|
+
listParts(params: {
|
|
113
|
+
Bucket: string;
|
|
114
|
+
Key: string;
|
|
115
|
+
UploadId: string;
|
|
116
|
+
}, options?: S3CallOptions): Promise<{
|
|
117
|
+
Parts?: Part[];
|
|
118
|
+
}>;
|
|
119
|
+
getObject(params: {
|
|
120
|
+
Bucket: string;
|
|
121
|
+
Key: string;
|
|
122
|
+
}, options?: S3CallOptions): Promise<{
|
|
123
|
+
Body?: ReadableStream | Readable;
|
|
124
|
+
ContentLength?: number;
|
|
125
|
+
ContentType?: string;
|
|
126
|
+
ETag?: string;
|
|
127
|
+
Expires?: Date;
|
|
128
|
+
LastModified?: Date;
|
|
129
|
+
Metadata?: Record<string, string>;
|
|
130
|
+
}>;
|
|
131
|
+
headObject(params: {
|
|
132
|
+
Bucket: string;
|
|
133
|
+
Key: string;
|
|
134
|
+
}, options?: S3CallOptions): Promise<{
|
|
135
|
+
ContentLength?: number;
|
|
136
|
+
ContentType?: string;
|
|
137
|
+
ETag?: string;
|
|
138
|
+
Expires?: Date;
|
|
139
|
+
LastModified?: Date;
|
|
140
|
+
Metadata?: Record<string, string>;
|
|
141
|
+
}>;
|
|
142
|
+
deleteObject(params: {
|
|
143
|
+
Bucket: string;
|
|
144
|
+
Key: string;
|
|
145
|
+
}, options?: S3CallOptions): Promise<void>;
|
|
146
|
+
copyObject(params: {
|
|
147
|
+
Bucket: string;
|
|
148
|
+
CopySource: string;
|
|
149
|
+
Key: string;
|
|
150
|
+
StorageClass?: string;
|
|
151
|
+
}, options?: S3CallOptions): Promise<void>;
|
|
152
|
+
listObjectsV2(params: {
|
|
153
|
+
Bucket: string;
|
|
154
|
+
ContinuationToken?: string;
|
|
155
|
+
Delimiter?: string;
|
|
156
|
+
MaxKeys?: number;
|
|
157
|
+
Prefix?: string;
|
|
158
|
+
}, options?: S3CallOptions): Promise<{
|
|
159
|
+
CommonPrefixes?: {
|
|
160
|
+
Prefix?: string;
|
|
161
|
+
}[];
|
|
162
|
+
Contents?: {
|
|
163
|
+
Key?: string;
|
|
164
|
+
LastModified?: Date;
|
|
165
|
+
}[];
|
|
166
|
+
IsTruncated?: boolean;
|
|
167
|
+
NextContinuationToken?: string;
|
|
168
|
+
}>;
|
|
169
|
+
getPresignedUrl(params: {
|
|
170
|
+
Bucket: string;
|
|
171
|
+
expiresIn: number;
|
|
172
|
+
Key: string;
|
|
173
|
+
PartNumber: number;
|
|
174
|
+
UploadId: string;
|
|
175
|
+
}): Promise<string>;
|
|
176
|
+
putObject(params: {
|
|
177
|
+
Body?: Uint8Array | ReadableStream;
|
|
178
|
+
Bucket: string;
|
|
179
|
+
ContentLength?: number;
|
|
180
|
+
ContentType?: string;
|
|
181
|
+
Key: string;
|
|
182
|
+
Metadata?: Record<string, string>;
|
|
183
|
+
}): Promise<void>;
|
|
184
|
+
checkBucketAccess(_params: {
|
|
185
|
+
Bucket: string;
|
|
186
|
+
}): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Builds S3 API URL.
|
|
189
|
+
*/
|
|
190
|
+
private buildUrl;
|
|
191
|
+
/**
|
|
192
|
+
* Converts ReadableStream to Readable for Node.js compatibility.
|
|
193
|
+
*/
|
|
194
|
+
private streamToReadable;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* AWS Light storage implementation using aws4fetch.
|
|
198
|
+
* Optimized for worker environments (Cloudflare Workers, Web Workers, etc.).
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* const storage = new AwsLightStorage({
|
|
202
|
+
* bucket: <YOUR_BUCKET>,
|
|
203
|
+
* region: <YOUR_REGION>,
|
|
204
|
+
* accessKeyId: <YOUR_ACCESS_KEY_ID>,
|
|
205
|
+
* secretAccessKey: <YOUR_SECRET_ACCESS_KEY>
|
|
206
|
+
* });
|
|
207
|
+
* ```
|
|
208
|
+
* @remarks
|
|
209
|
+
* ## Worker Compatibility
|
|
210
|
+
* - Uses aws4fetch for AWS request signing (works in workers)
|
|
211
|
+
* - No Node.js-specific dependencies
|
|
212
|
+
* - Compatible with Cloudflare Workers, Web Workers, and edge runtimes
|
|
213
|
+
*
|
|
214
|
+
* ## Error Handling
|
|
215
|
+
* - S3 API errors are normalized with AWS-specific context
|
|
216
|
+
* - Errors include S3 error codes and status codes for debugging
|
|
217
|
+
*
|
|
218
|
+
* ## Retry Behavior
|
|
219
|
+
* - All S3 API calls are wrapped with configurable retry logic via `retryConfig` option
|
|
220
|
+
* - Default retryable status codes: 408, 429, 500, 502, 503, 504
|
|
221
|
+
* - Custom `shouldRetry` function can be provided for advanced retry logic
|
|
222
|
+
*
|
|
223
|
+
* ## Multipart Uploads
|
|
224
|
+
* - Large files are automatically split into multipart uploads
|
|
225
|
+
* - Maximum 10,000 parts per upload (S3 limitation)
|
|
226
|
+
* - Part size is configurable (default: 16MB, minimum: 5MB)
|
|
227
|
+
* - Failed multipart uploads are automatically aborted
|
|
228
|
+
*
|
|
229
|
+
* ## Supported Operations
|
|
230
|
+
* - ✅ create, write, delete, get, getStream, list, update, copy, move
|
|
231
|
+
* - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
|
|
232
|
+
* - ✅ exists: Implemented (checks metadata and S3 object)
|
|
233
|
+
* - ⚠️ getUrl/getUploadUrl: Limited presigned URL support (uses aws4fetch signing)
|
|
234
|
+
*/
|
|
235
|
+
declare class AwsLightStorage extends S3BaseStorage {
|
|
236
|
+
static override readonly name: string;
|
|
237
|
+
private s3Api;
|
|
238
|
+
constructor(config: AwsLightStorageOptions);
|
|
239
|
+
/**
|
|
240
|
+
* Normalizes AWS S3 errors with S3-specific context.
|
|
241
|
+
*/
|
|
242
|
+
override normalizeError(error: AwsLightError | Error): HttpError;
|
|
243
|
+
override update({
|
|
244
|
+
id
|
|
245
|
+
}: FileQuery, metadata: Partial<AwsLightFile>): Promise<AwsLightFile>;
|
|
246
|
+
override getStream({
|
|
247
|
+
id
|
|
248
|
+
}: FileQuery, options?: OperationOptions): Promise<{
|
|
249
|
+
headers?: Record<string, string>;
|
|
250
|
+
size?: number;
|
|
251
|
+
stream: Readable;
|
|
252
|
+
}>;
|
|
253
|
+
override get raw(): AwsClient;
|
|
254
|
+
protected getS3Api(): AwsLightApiAdapter;
|
|
255
|
+
protected getFileClass(): new (config: FileInit) => AwsLightFile;
|
|
256
|
+
protected getAcl(): string | undefined;
|
|
257
|
+
protected accessCheck(_maxWaitTime?: number): Promise<void>;
|
|
258
|
+
}
|
|
259
|
+
export { type AwsLightClientConfig, type AwsLightError, AwsLightFile, AwsLightMetaStorage, type AwsLightMetaStorageOptions, AwsLightStorage, type AwsLightStorageOptions };
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { A as AwsLightMetaStorage } from '../../packem_shared/aws-light-meta-storage-DKJBgbR6.js';
|
|
3
|
-
export { default as AwsLightStorage } from '../../packem_shared/AwsLightStorage-Blv-GP4v.js';
|
|
1
|
+
import{default as a}from"../../packem_shared/AwsLightFile-CpZrubaV.js";import{p as r}from"../../packem_shared/aws-light-meta-storage-DGrn72VJ.js";import{default as f}from"../../packem_shared/AwsLightStorage-DTBVxHXO.js";export{a as AwsLightFile,r as AwsLightMetaStorage,f as AwsLightStorage};
|