@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,248 +0,0 @@
|
|
|
1
|
-
import { Readable } from "node:stream";
|
|
2
|
-
import type { RetryConfig } from "../../utils/retry.d.ts";
|
|
3
|
-
import { createRetryWrapper } from "../../utils/retry.d.ts";
|
|
4
|
-
import type MetaStorage from "../meta-storage.d.ts";
|
|
5
|
-
import { BaseStorage } from "../storage.d.ts";
|
|
6
|
-
import type { File, FileInit, FilePart, FileQuery, FileReturn } from "../utils/index.d.ts";
|
|
7
|
-
/**
|
|
8
|
-
* Part interface for multipart uploads.
|
|
9
|
-
*/
|
|
10
|
-
export interface Part {
|
|
11
|
-
ETag?: string;
|
|
12
|
-
PartNumber: number;
|
|
13
|
-
Size?: number;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Base file type for S3-compatible storage.
|
|
17
|
-
*/
|
|
18
|
-
export interface S3CompatibleFile extends File {
|
|
19
|
-
Parts?: Part[];
|
|
20
|
-
partSize?: number;
|
|
21
|
-
partsUrls?: string[];
|
|
22
|
-
UploadId?: string;
|
|
23
|
-
uri?: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* S3 API operations interface that must be implemented by concrete storage classes.
|
|
27
|
-
*/
|
|
28
|
-
export interface S3ApiOperations {
|
|
29
|
-
abortMultipartUpload: (params: {
|
|
30
|
-
Bucket: string;
|
|
31
|
-
Key: string;
|
|
32
|
-
UploadId: string;
|
|
33
|
-
}) => Promise<void>;
|
|
34
|
-
checkBucketAccess: (params: {
|
|
35
|
-
Bucket: string;
|
|
36
|
-
}) => Promise<void>;
|
|
37
|
-
completeMultipartUpload: (params: {
|
|
38
|
-
Bucket: string;
|
|
39
|
-
Key: string;
|
|
40
|
-
Parts: {
|
|
41
|
-
ETag: string;
|
|
42
|
-
PartNumber: number;
|
|
43
|
-
}[];
|
|
44
|
-
UploadId: string;
|
|
45
|
-
}) => Promise<{
|
|
46
|
-
ETag?: string;
|
|
47
|
-
Location: string;
|
|
48
|
-
}>;
|
|
49
|
-
copyObject: (params: {
|
|
50
|
-
Bucket: string;
|
|
51
|
-
CopySource: string;
|
|
52
|
-
Key: string;
|
|
53
|
-
StorageClass?: string;
|
|
54
|
-
}) => Promise<void>;
|
|
55
|
-
createMultipartUpload: (params: {
|
|
56
|
-
ACL?: string;
|
|
57
|
-
Bucket: string;
|
|
58
|
-
ContentType?: string;
|
|
59
|
-
Key: string;
|
|
60
|
-
Metadata?: Record<string, string>;
|
|
61
|
-
}) => Promise<{
|
|
62
|
-
UploadId: string;
|
|
63
|
-
}>;
|
|
64
|
-
deleteObject: (params: {
|
|
65
|
-
Bucket: string;
|
|
66
|
-
Key: string;
|
|
67
|
-
}) => Promise<void>;
|
|
68
|
-
getObject: (params: {
|
|
69
|
-
Bucket: string;
|
|
70
|
-
Key: string;
|
|
71
|
-
}) => Promise<{
|
|
72
|
-
Body?: ReadableStream | Readable;
|
|
73
|
-
ContentLength?: number;
|
|
74
|
-
ContentType?: string;
|
|
75
|
-
ETag?: string;
|
|
76
|
-
Expires?: Date;
|
|
77
|
-
LastModified?: Date;
|
|
78
|
-
Metadata?: Record<string, string>;
|
|
79
|
-
}>;
|
|
80
|
-
getPresignedUrl: (params: {
|
|
81
|
-
Bucket: string;
|
|
82
|
-
expiresIn: number;
|
|
83
|
-
Key: string;
|
|
84
|
-
PartNumber: number;
|
|
85
|
-
UploadId: string;
|
|
86
|
-
}) => Promise<string>;
|
|
87
|
-
headObject: (params: {
|
|
88
|
-
Bucket: string;
|
|
89
|
-
Key: string;
|
|
90
|
-
}) => Promise<{
|
|
91
|
-
ContentLength?: number;
|
|
92
|
-
ContentType?: string;
|
|
93
|
-
ETag?: string;
|
|
94
|
-
Expires?: Date;
|
|
95
|
-
LastModified?: Date;
|
|
96
|
-
Metadata?: Record<string, string>;
|
|
97
|
-
}>;
|
|
98
|
-
listObjectsV2: (params: {
|
|
99
|
-
Bucket: string;
|
|
100
|
-
ContinuationToken?: string;
|
|
101
|
-
MaxKeys?: number;
|
|
102
|
-
}) => Promise<{
|
|
103
|
-
Contents?: {
|
|
104
|
-
Key?: string;
|
|
105
|
-
LastModified?: Date;
|
|
106
|
-
}[];
|
|
107
|
-
IsTruncated?: boolean;
|
|
108
|
-
NextContinuationToken?: string;
|
|
109
|
-
}>;
|
|
110
|
-
listParts: (params: {
|
|
111
|
-
Bucket: string;
|
|
112
|
-
Key: string;
|
|
113
|
-
UploadId: string;
|
|
114
|
-
}) => Promise<{
|
|
115
|
-
Parts?: Part[];
|
|
116
|
-
}>;
|
|
117
|
-
uploadPart: (params: {
|
|
118
|
-
Body: Readable | ReadableStream | Uint8Array;
|
|
119
|
-
Bucket: string;
|
|
120
|
-
ContentLength?: number;
|
|
121
|
-
ContentMD5?: string;
|
|
122
|
-
Key: string;
|
|
123
|
-
PartNumber: number;
|
|
124
|
-
UploadId: string;
|
|
125
|
-
}) => Promise<{
|
|
126
|
-
ETag: string;
|
|
127
|
-
}>;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Base class for S3-compatible storage implementations.
|
|
131
|
-
* Contains all shared business logic for S3 operations.
|
|
132
|
-
* @template TFile The file type used by this storage backend.
|
|
133
|
-
*/
|
|
134
|
-
export declare abstract class S3BaseStorage<TFile extends S3CompatibleFile = S3CompatibleFile> extends BaseStorage<TFile, FileReturn> {
|
|
135
|
-
checksumTypes: string[];
|
|
136
|
-
protected bucket: string;
|
|
137
|
-
protected meta: MetaStorage<TFile>;
|
|
138
|
-
/**
|
|
139
|
-
* S3 multipart upload does not allow more than 10000 parts.
|
|
140
|
-
*/
|
|
141
|
-
protected readonly MAX_PARTS = 10000;
|
|
142
|
-
protected readonly partSize: number;
|
|
143
|
-
protected readonly retry: ReturnType<typeof createRetryWrapper>;
|
|
144
|
-
/**
|
|
145
|
-
* Abstract method to get S3 API operations implementation.
|
|
146
|
-
*/
|
|
147
|
-
protected abstract getS3Api(): S3ApiOperations;
|
|
148
|
-
/**
|
|
149
|
-
* Abstract method to get the file class constructor.
|
|
150
|
-
*/
|
|
151
|
-
protected abstract getFileClass(): new (config: FileInit) => TFile;
|
|
152
|
-
/**
|
|
153
|
-
* Abstract method to get ACL value.
|
|
154
|
-
*/
|
|
155
|
-
protected abstract getAcl(): string | undefined;
|
|
156
|
-
/**
|
|
157
|
-
* Abstract method for access check.
|
|
158
|
-
*/
|
|
159
|
-
protected abstract accessCheck(maxWaitTime?: number): Promise<void>;
|
|
160
|
-
constructor(config: {
|
|
161
|
-
bucket: string;
|
|
162
|
-
clientDirectUpload?: boolean;
|
|
163
|
-
expiration?: {
|
|
164
|
-
maxAge?: string;
|
|
165
|
-
};
|
|
166
|
-
filename?: (file: TFile) => string;
|
|
167
|
-
logger?: BaseStorage<TFile>["logger"];
|
|
168
|
-
metaStorage?: MetaStorage<TFile>;
|
|
169
|
-
metaStorageConfig?: unknown;
|
|
170
|
-
partSize?: number | string;
|
|
171
|
-
retryConfig?: RetryConfig;
|
|
172
|
-
});
|
|
173
|
-
/**
|
|
174
|
-
* Creates a new S3 multipart upload.
|
|
175
|
-
*/
|
|
176
|
-
create(config: FileInit): Promise<TFile>;
|
|
177
|
-
/**
|
|
178
|
-
* Writes data to an S3 multipart upload.
|
|
179
|
-
*/
|
|
180
|
-
write(part: FilePart | FileQuery | TFile): Promise<TFile>;
|
|
181
|
-
/**
|
|
182
|
-
* Deletes an upload and its metadata.
|
|
183
|
-
*/
|
|
184
|
-
delete({ id }: FileQuery): Promise<TFile>;
|
|
185
|
-
/**
|
|
186
|
-
* Copies an upload file to a new location.
|
|
187
|
-
*/
|
|
188
|
-
copy(name: string, destination: string, options?: {
|
|
189
|
-
storageClass?: string;
|
|
190
|
-
}): Promise<TFile>;
|
|
191
|
-
/**
|
|
192
|
-
* Moves an upload file to a new location.
|
|
193
|
-
*/
|
|
194
|
-
move(name: string, destination: string): Promise<TFile>;
|
|
195
|
-
/**
|
|
196
|
-
* Lists files in the bucket.
|
|
197
|
-
*/
|
|
198
|
-
list(limit?: number): Promise<TFile[]>;
|
|
199
|
-
/**
|
|
200
|
-
* Checks if a file exists by verifying both metadata and the actual S3 object.
|
|
201
|
-
* Returns true only if both the metadata and the S3 object exist.
|
|
202
|
-
* @param query File query containing the file ID to check.
|
|
203
|
-
* @returns Promise resolving to true if both metadata and S3 object exist, false otherwise.
|
|
204
|
-
*/
|
|
205
|
-
exists({ id }: FileQuery): Promise<boolean>;
|
|
206
|
-
/**
|
|
207
|
-
* Gets an uploaded file by ID.
|
|
208
|
-
*/
|
|
209
|
-
get({ id }: FileQuery): Promise<FileReturn>;
|
|
210
|
-
/**
|
|
211
|
-
* Gets file stream (abstract - must be implemented by subclasses due to stream differences).
|
|
212
|
-
*/
|
|
213
|
-
abstract getStream(query: FileQuery): Promise<{
|
|
214
|
-
headers?: Record<string, string>;
|
|
215
|
-
size?: number;
|
|
216
|
-
stream: Readable;
|
|
217
|
-
}>;
|
|
218
|
-
/**
|
|
219
|
-
* Builds presigned URLs for client uploads.
|
|
220
|
-
*/
|
|
221
|
-
protected buildPresigned(file: TFile): Promise<TFile>;
|
|
222
|
-
/**
|
|
223
|
-
* Gets presigned URLs for all parts.
|
|
224
|
-
*/
|
|
225
|
-
protected getPartsPresignedUrls(file: TFile): Promise<string[]>;
|
|
226
|
-
/**
|
|
227
|
-
* Gets parts for a multipart upload.
|
|
228
|
-
*/
|
|
229
|
-
protected getParts(file: TFile): Promise<Part[]>;
|
|
230
|
-
/**
|
|
231
|
-
* Completes a multipart upload.
|
|
232
|
-
*/
|
|
233
|
-
protected completeMultipartUpload(file: TFile): Promise<{
|
|
234
|
-
ETag?: string;
|
|
235
|
-
Location: string;
|
|
236
|
-
}>;
|
|
237
|
-
/**
|
|
238
|
-
* Aborts a multipart upload.
|
|
239
|
-
*/
|
|
240
|
-
protected abortMultipartUpload(file: TFile): Promise<void>;
|
|
241
|
-
/**
|
|
242
|
-
* Internal onComplete handler.
|
|
243
|
-
*/
|
|
244
|
-
protected internalOnComplete: (file: TFile) => Promise<[{
|
|
245
|
-
ETag?: string;
|
|
246
|
-
Location: string;
|
|
247
|
-
}, TFile]>;
|
|
248
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { Readable } from "node:stream";
|
|
2
|
-
import type { S3Client } from "@aws-sdk/client-s3";
|
|
3
|
-
import type { Part, S3ApiOperations } from "./s3-base-storage.d.ts";
|
|
4
|
-
type ReadableStream = globalThis.ReadableStream;
|
|
5
|
-
/**
|
|
6
|
-
* Adapter that wraps AWS SDK S3Client to implement S3ApiOperations interface.
|
|
7
|
-
*/
|
|
8
|
-
declare class S3ClientAdapter implements S3ApiOperations {
|
|
9
|
-
private readonly client;
|
|
10
|
-
constructor(client: S3Client, _bucket: string);
|
|
11
|
-
createMultipartUpload(params: {
|
|
12
|
-
ACL?: string;
|
|
13
|
-
Bucket: string;
|
|
14
|
-
ContentType?: string;
|
|
15
|
-
Key: string;
|
|
16
|
-
Metadata?: Record<string, string>;
|
|
17
|
-
}): Promise<{
|
|
18
|
-
UploadId: string;
|
|
19
|
-
}>;
|
|
20
|
-
uploadPart(params: {
|
|
21
|
-
Body: Readable | ReadableStream | Uint8Array;
|
|
22
|
-
Bucket: string;
|
|
23
|
-
ContentLength?: number;
|
|
24
|
-
ContentMD5?: string;
|
|
25
|
-
Key: string;
|
|
26
|
-
PartNumber: number;
|
|
27
|
-
UploadId: string;
|
|
28
|
-
}): Promise<{
|
|
29
|
-
ETag: string;
|
|
30
|
-
}>;
|
|
31
|
-
completeMultipartUpload(params: {
|
|
32
|
-
Bucket: string;
|
|
33
|
-
Key: string;
|
|
34
|
-
Parts: {
|
|
35
|
-
ETag: string;
|
|
36
|
-
PartNumber: number;
|
|
37
|
-
}[];
|
|
38
|
-
UploadId: string;
|
|
39
|
-
}): Promise<{
|
|
40
|
-
ETag?: string;
|
|
41
|
-
Location: string;
|
|
42
|
-
}>;
|
|
43
|
-
abortMultipartUpload(params: {
|
|
44
|
-
Bucket: string;
|
|
45
|
-
Key: string;
|
|
46
|
-
UploadId: string;
|
|
47
|
-
}): Promise<void>;
|
|
48
|
-
listParts(params: {
|
|
49
|
-
Bucket: string;
|
|
50
|
-
Key: string;
|
|
51
|
-
UploadId: string;
|
|
52
|
-
}): Promise<{
|
|
53
|
-
Parts?: Part[];
|
|
54
|
-
}>;
|
|
55
|
-
getObject(params: {
|
|
56
|
-
Bucket: string;
|
|
57
|
-
Key: string;
|
|
58
|
-
}): Promise<{
|
|
59
|
-
Body?: ReadableStream | Readable;
|
|
60
|
-
ContentLength?: number;
|
|
61
|
-
ContentType?: string;
|
|
62
|
-
ETag?: string;
|
|
63
|
-
Expires?: Date;
|
|
64
|
-
LastModified?: Date;
|
|
65
|
-
Metadata?: Record<string, string>;
|
|
66
|
-
}>;
|
|
67
|
-
headObject(params: {
|
|
68
|
-
Bucket: string;
|
|
69
|
-
Key: string;
|
|
70
|
-
}): Promise<{
|
|
71
|
-
ContentLength?: number;
|
|
72
|
-
ContentType?: string;
|
|
73
|
-
ETag?: string;
|
|
74
|
-
Expires?: Date;
|
|
75
|
-
LastModified?: Date;
|
|
76
|
-
}>;
|
|
77
|
-
deleteObject(params: {
|
|
78
|
-
Bucket: string;
|
|
79
|
-
Key: string;
|
|
80
|
-
}): Promise<void>;
|
|
81
|
-
copyObject(params: {
|
|
82
|
-
Bucket: string;
|
|
83
|
-
CopySource: string;
|
|
84
|
-
Key: string;
|
|
85
|
-
StorageClass?: string;
|
|
86
|
-
}): Promise<void>;
|
|
87
|
-
listObjectsV2(params: {
|
|
88
|
-
Bucket: string;
|
|
89
|
-
ContinuationToken?: string;
|
|
90
|
-
MaxKeys?: number;
|
|
91
|
-
}): Promise<{
|
|
92
|
-
Contents?: {
|
|
93
|
-
Key?: string;
|
|
94
|
-
LastModified?: Date;
|
|
95
|
-
}[];
|
|
96
|
-
IsTruncated?: boolean;
|
|
97
|
-
NextContinuationToken?: string;
|
|
98
|
-
}>;
|
|
99
|
-
getPresignedUrl(params: {
|
|
100
|
-
Bucket: string;
|
|
101
|
-
expiresIn: number;
|
|
102
|
-
Key: string;
|
|
103
|
-
PartNumber: number;
|
|
104
|
-
UploadId: string;
|
|
105
|
-
}): Promise<string>;
|
|
106
|
-
checkBucketAccess(params: {
|
|
107
|
-
Bucket: string;
|
|
108
|
-
}): Promise<void>;
|
|
109
|
-
}
|
|
110
|
-
export default S3ClientAdapter;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { File } from "../utils/index.d.ts";
|
|
2
|
-
import type { Part } from "./s3-base-storage.d.ts";
|
|
3
|
-
declare class S3File extends File {
|
|
4
|
-
Parts?: Part[];
|
|
5
|
-
UploadId?: string;
|
|
6
|
-
uri?: string;
|
|
7
|
-
partsUrls?: string[];
|
|
8
|
-
partSize?: number;
|
|
9
|
-
}
|
|
10
|
-
export default S3File;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import MetaStorage from "../meta-storage.d.ts";
|
|
2
|
-
import type { File } from "../utils/index.d.ts";
|
|
3
|
-
import type { S3MetaStorageOptions } from "./types.d.ts";
|
|
4
|
-
declare class S3MetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
5
|
-
config: S3MetaStorageOptions;
|
|
6
|
-
private readonly bucket;
|
|
7
|
-
private readonly client;
|
|
8
|
-
constructor(config: S3MetaStorageOptions);
|
|
9
|
-
get(id: string): Promise<T>;
|
|
10
|
-
touch(id: string, file: T): Promise<T>;
|
|
11
|
-
delete(id: string): Promise<void>;
|
|
12
|
-
save(id: string, file: T): Promise<T>;
|
|
13
|
-
private accessCheck;
|
|
14
|
-
}
|
|
15
|
-
export default S3MetaStorage;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Readable } from "node:stream";
|
|
2
|
-
import type { HttpError } from "../../utils/types.d.ts";
|
|
3
|
-
import type { FileInit, FileQuery } from "../utils/index.d.ts";
|
|
4
|
-
import { S3BaseStorage } from "./s3-base-storage.d.ts";
|
|
5
|
-
import S3ClientAdapter from "./s3-client-adapter.d.ts";
|
|
6
|
-
import S3File from "./s3-file.d.ts";
|
|
7
|
-
import type { AwsError, S3StorageOptions } from "./types.d.ts";
|
|
8
|
-
/**
|
|
9
|
-
* Amazon S3 storage implementation.
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const storage = new S3Storage({
|
|
13
|
-
* bucket: <YOUR_BUCKET>,
|
|
14
|
-
* endpoint: <YOUR_ENDPOINT>,
|
|
15
|
-
* region: <YOUR_REGION>,
|
|
16
|
-
* credentials: {
|
|
17
|
-
* accessKeyId: <YOUR_ACCESS_KEY_ID>,
|
|
18
|
-
* secretAccessKey: <YOUR_SECRET_ACCESS_KEY>
|
|
19
|
-
* },
|
|
20
|
-
* metaStorageConfig: { directory: '/tmp/upload-metafiles' }
|
|
21
|
-
* });
|
|
22
|
-
* ```
|
|
23
|
-
* @remarks
|
|
24
|
-
* ## Error Handling
|
|
25
|
-
* - S3 API errors are normalized with AWS-specific context
|
|
26
|
-
* - Errors include S3 error codes and metadata for debugging
|
|
27
|
-
* - Batch operations handle individual failures gracefully
|
|
28
|
-
*
|
|
29
|
-
* ## Retry Behavior
|
|
30
|
-
* - All S3 API calls are wrapped with configurable retry logic via `retryConfig` option
|
|
31
|
-
* - Default retryable status codes: 408 (Request Timeout), 429 (Too Many Requests),
|
|
32
|
-
* 500 (Internal Server Error), 502 (Bad Gateway), 503 (Service Unavailable), 504 (Gateway Timeout)
|
|
33
|
-
* - Retries server-side faults ($fault === "server") automatically
|
|
34
|
-
* - Custom `shouldRetry` function can be provided for advanced retry logic
|
|
35
|
-
* - Default retry configuration: maxRetries: 3, initialDelay: 1000ms, maxDelay: 30000ms, backoffMultiplier: 2 (exponential backoff)
|
|
36
|
-
* - Retry wrapper handles transient network errors and rate limiting
|
|
37
|
-
*
|
|
38
|
-
* ## Multipart Uploads
|
|
39
|
-
* - Large files are automatically split into multipart uploads
|
|
40
|
-
* - Maximum 10,000 parts per upload (S3 limitation)
|
|
41
|
-
* - Part size is configurable (default: 16MB, minimum: 5MB)
|
|
42
|
-
* - Failed multipart uploads are automatically aborted
|
|
43
|
-
*
|
|
44
|
-
* ## Supported Operations
|
|
45
|
-
* - ✅ create, write, delete, get, getStream, list, update, copy, move
|
|
46
|
-
* - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
|
|
47
|
-
* - ✅ exists: Implemented (checks metadata and S3 object)
|
|
48
|
-
* - ❌ getUrl: Not implemented (presigned URLs available via buildPresigned for clientDirectUpload)
|
|
49
|
-
* - ❌ getUploadUrl: Not implemented (presigned URLs available via buildPresigned for clientDirectUpload)
|
|
50
|
-
*/
|
|
51
|
-
declare class S3Storage extends S3BaseStorage<S3File> {
|
|
52
|
-
static readonly name: string;
|
|
53
|
-
private s3Api;
|
|
54
|
-
constructor(config: S3StorageOptions);
|
|
55
|
-
/**
|
|
56
|
-
* Normalizes AWS S3 errors with S3-specific context.
|
|
57
|
-
*/
|
|
58
|
-
normalizeError(error: AwsError): HttpError;
|
|
59
|
-
update({ id }: FileQuery, metadata: Partial<S3File>): Promise<S3File>;
|
|
60
|
-
getStream({ id }: FileQuery): Promise<{
|
|
61
|
-
headers?: Record<string, string>;
|
|
62
|
-
size?: number;
|
|
63
|
-
stream: Readable;
|
|
64
|
-
}>;
|
|
65
|
-
protected getS3Api(): S3ClientAdapter;
|
|
66
|
-
protected getFileClass(): new (config: FileInit) => S3File;
|
|
67
|
-
protected getAcl(): string | undefined;
|
|
68
|
-
protected accessCheck(_maxWaitTime?: number): Promise<void>;
|
|
69
|
-
}
|
|
70
|
-
export default S3Storage;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import type { ObjectCannedACL, S3Client, S3ClientConfig } from "@aws-sdk/client-s3";
|
|
2
|
-
import type { ResponseMetadata } from "@aws-sdk/types";
|
|
3
|
-
import type { LocalMetaStorageOptions } from "../local/local-meta-storage.d.ts";
|
|
4
|
-
import type { BaseStorageOptions, MetaStorageOptions } from "../types.d.ts";
|
|
5
|
-
import type S3File from "./s3-file.d.ts";
|
|
6
|
-
export type S3MetaStorageOptions = MetaStorageOptions & S3ClientConfig & {
|
|
7
|
-
bucket?: string;
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
client?: S3Client;
|
|
12
|
-
keyFile?: string;
|
|
13
|
-
};
|
|
14
|
-
export type S3StorageOptions = BaseStorageOptions<S3File> & S3ClientConfig & {
|
|
15
|
-
/**
|
|
16
|
-
* Specifying access rules for uploaded files.
|
|
17
|
-
*/
|
|
18
|
-
acl?: ObjectCannedACL;
|
|
19
|
-
/**
|
|
20
|
-
* S3 bucket name.
|
|
21
|
-
* @default 'node-Upload'
|
|
22
|
-
*/
|
|
23
|
-
bucket?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Force compatible client upload directly to S3 storage
|
|
26
|
-
*/
|
|
27
|
-
clientDirectUpload?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated Use standard auth providers
|
|
30
|
-
*/
|
|
31
|
-
keyFile?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Configure metafiles storage
|
|
34
|
-
* @example
|
|
35
|
-
* Using local metafiles
|
|
36
|
-
* ```ts
|
|
37
|
-
* const storage = new S3Storage({
|
|
38
|
-
* bucket: 'upload',
|
|
39
|
-
* region: 'eu-west-3',
|
|
40
|
-
* metaStorageConfig: { directory: '/tmp/upload-metafiles' }
|
|
41
|
-
* })
|
|
42
|
-
* ```
|
|
43
|
-
* Using a separate bucket for metafiles
|
|
44
|
-
* ```ts
|
|
45
|
-
* const storage = new S3Storage({
|
|
46
|
-
* bucket: 'upload',
|
|
47
|
-
* region: 'eu-west-3',
|
|
48
|
-
* metaStorageConfig: { bucket: 'upload-metafiles' }
|
|
49
|
-
* })
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
metaStorageConfig?: LocalMetaStorageOptions | S3MetaStorageOptions;
|
|
53
|
-
/**
|
|
54
|
-
* The parts size that the client should use for presigned multipart unloading.
|
|
55
|
-
* @default '16MB'
|
|
56
|
-
*/
|
|
57
|
-
partSize?: number | string;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* SDK V3
|
|
61
|
-
* A structure containing information about a service or networking error.
|
|
62
|
-
*/
|
|
63
|
-
export interface AwsError extends Error {
|
|
64
|
-
$fault?: "client" | "server";
|
|
65
|
-
$metadata: ResponseMetadata;
|
|
66
|
-
$service?: string;
|
|
67
|
-
Code?: string;
|
|
68
|
-
Type?: string;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* SDK V2
|
|
72
|
-
* A structure containing information about a service or networking error.
|
|
73
|
-
*/
|
|
74
|
-
export interface AWSErrorV2 extends Error {
|
|
75
|
-
/**
|
|
76
|
-
* CloudFront request ID associated with the response.
|
|
77
|
-
*/
|
|
78
|
-
cfId: string;
|
|
79
|
-
/**
|
|
80
|
-
* A unique short code representing the error that was emitted.
|
|
81
|
-
*/
|
|
82
|
-
code: string;
|
|
83
|
-
/**
|
|
84
|
-
* Second request ID associated with the response from S3.
|
|
85
|
-
*/
|
|
86
|
-
extendedRequestId: string;
|
|
87
|
-
/**
|
|
88
|
-
* Set when a networking error occurs to easily identify the endpoint of the request.
|
|
89
|
-
*/
|
|
90
|
-
hostname: string;
|
|
91
|
-
/**
|
|
92
|
-
* A longer human readable error message.
|
|
93
|
-
*/
|
|
94
|
-
message: string;
|
|
95
|
-
/**
|
|
96
|
-
* Set when a networking error occurs to easily identify the region of the request.
|
|
97
|
-
*/
|
|
98
|
-
region: string;
|
|
99
|
-
/**
|
|
100
|
-
* The unique request ID associated with the response.
|
|
101
|
-
*/
|
|
102
|
-
requestId: string;
|
|
103
|
-
/**
|
|
104
|
-
* Whether the error message is retryable.
|
|
105
|
-
*/
|
|
106
|
-
retryable: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Amount of time (in seconds) that the request waited before being resent.
|
|
109
|
-
*/
|
|
110
|
-
retryDelay: number;
|
|
111
|
-
/**
|
|
112
|
-
* In the case of a request that reached the service, this value contains the response status code.
|
|
113
|
-
*/
|
|
114
|
-
statusCode: number;
|
|
115
|
-
/**
|
|
116
|
-
* The date time object when the error occurred.
|
|
117
|
-
*/
|
|
118
|
-
time: Date;
|
|
119
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { Readable } from "node:stream";
|
|
2
|
-
import type { Part, S3ApiOperations } from "../aws/s3-base-storage.d.ts";
|
|
3
|
-
import type { AwsLightClientConfig } from "./types.d.ts";
|
|
4
|
-
/**
|
|
5
|
-
* Adapter that uses aws4fetch to implement S3ApiOperations interface.
|
|
6
|
-
*/
|
|
7
|
-
declare class AwsLightApiAdapter implements S3ApiOperations {
|
|
8
|
-
private aws;
|
|
9
|
-
private readonly bucket;
|
|
10
|
-
private readonly endpoint;
|
|
11
|
-
constructor(config: AwsLightClientConfig & {
|
|
12
|
-
bucket: string;
|
|
13
|
-
});
|
|
14
|
-
createMultipartUpload(params: {
|
|
15
|
-
ACL?: string;
|
|
16
|
-
Bucket: string;
|
|
17
|
-
ContentType?: string;
|
|
18
|
-
Key: string;
|
|
19
|
-
Metadata?: Record<string, string>;
|
|
20
|
-
}): Promise<{
|
|
21
|
-
UploadId: string;
|
|
22
|
-
}>;
|
|
23
|
-
uploadPart(params: {
|
|
24
|
-
Body: Readable | ReadableStream | Uint8Array;
|
|
25
|
-
Bucket: string;
|
|
26
|
-
ContentLength?: number;
|
|
27
|
-
ContentMD5?: string;
|
|
28
|
-
Key: string;
|
|
29
|
-
PartNumber: number;
|
|
30
|
-
UploadId: string;
|
|
31
|
-
}): Promise<{
|
|
32
|
-
ETag: string;
|
|
33
|
-
}>;
|
|
34
|
-
completeMultipartUpload(params: {
|
|
35
|
-
Bucket: string;
|
|
36
|
-
Key: string;
|
|
37
|
-
Parts: {
|
|
38
|
-
ETag: string;
|
|
39
|
-
PartNumber: number;
|
|
40
|
-
}[];
|
|
41
|
-
UploadId: string;
|
|
42
|
-
}): Promise<{
|
|
43
|
-
ETag?: string;
|
|
44
|
-
Location: string;
|
|
45
|
-
}>;
|
|
46
|
-
abortMultipartUpload(params: {
|
|
47
|
-
Bucket: string;
|
|
48
|
-
Key: string;
|
|
49
|
-
UploadId: string;
|
|
50
|
-
}): Promise<void>;
|
|
51
|
-
listParts(params: {
|
|
52
|
-
Bucket: string;
|
|
53
|
-
Key: string;
|
|
54
|
-
UploadId: string;
|
|
55
|
-
}): Promise<{
|
|
56
|
-
Parts?: Part[];
|
|
57
|
-
}>;
|
|
58
|
-
getObject(params: {
|
|
59
|
-
Bucket: string;
|
|
60
|
-
Key: string;
|
|
61
|
-
}): Promise<{
|
|
62
|
-
Body?: ReadableStream | Readable;
|
|
63
|
-
ContentLength?: number;
|
|
64
|
-
ContentType?: string;
|
|
65
|
-
ETag?: string;
|
|
66
|
-
Expires?: Date;
|
|
67
|
-
LastModified?: Date;
|
|
68
|
-
Metadata?: Record<string, string>;
|
|
69
|
-
}>;
|
|
70
|
-
headObject(params: {
|
|
71
|
-
Bucket: string;
|
|
72
|
-
Key: string;
|
|
73
|
-
}): Promise<{
|
|
74
|
-
ContentLength?: number;
|
|
75
|
-
ContentType?: string;
|
|
76
|
-
ETag?: string;
|
|
77
|
-
Expires?: Date;
|
|
78
|
-
LastModified?: Date;
|
|
79
|
-
Metadata?: Record<string, string>;
|
|
80
|
-
}>;
|
|
81
|
-
deleteObject(params: {
|
|
82
|
-
Bucket: string;
|
|
83
|
-
Key: string;
|
|
84
|
-
}): Promise<void>;
|
|
85
|
-
copyObject(params: {
|
|
86
|
-
Bucket: string;
|
|
87
|
-
CopySource: string;
|
|
88
|
-
Key: string;
|
|
89
|
-
StorageClass?: string;
|
|
90
|
-
}): Promise<void>;
|
|
91
|
-
listObjectsV2(params: {
|
|
92
|
-
Bucket: string;
|
|
93
|
-
ContinuationToken?: string;
|
|
94
|
-
MaxKeys?: number;
|
|
95
|
-
}): Promise<{
|
|
96
|
-
Contents?: {
|
|
97
|
-
Key?: string;
|
|
98
|
-
LastModified?: Date;
|
|
99
|
-
}[];
|
|
100
|
-
IsTruncated?: boolean;
|
|
101
|
-
NextContinuationToken?: string;
|
|
102
|
-
}>;
|
|
103
|
-
getPresignedUrl(params: {
|
|
104
|
-
Bucket: string;
|
|
105
|
-
expiresIn: number;
|
|
106
|
-
Key: string;
|
|
107
|
-
PartNumber: number;
|
|
108
|
-
UploadId: string;
|
|
109
|
-
}): Promise<string>;
|
|
110
|
-
putObject(params: {
|
|
111
|
-
Body?: Uint8Array | ReadableStream;
|
|
112
|
-
Bucket: string;
|
|
113
|
-
ContentLength?: number;
|
|
114
|
-
ContentType?: string;
|
|
115
|
-
Key: string;
|
|
116
|
-
Metadata?: Record<string, string>;
|
|
117
|
-
}): Promise<void>;
|
|
118
|
-
checkBucketAccess(_params: {
|
|
119
|
-
Bucket: string;
|
|
120
|
-
}): Promise<void>;
|
|
121
|
-
/**
|
|
122
|
-
* Builds S3 API URL.
|
|
123
|
-
*/
|
|
124
|
-
private buildUrl;
|
|
125
|
-
/**
|
|
126
|
-
* Converts ReadableStream to Readable for Node.js compatibility.
|
|
127
|
-
*/
|
|
128
|
-
private streamToReadable;
|
|
129
|
-
}
|
|
130
|
-
export default AwsLightApiAdapter;
|