@visulima/storage 2.0.0 → 2.0.2
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 +14 -0
- package/LICENSE.md +130 -1
- package/dist/adapter/nuxt/module.d.ts +5 -5
- package/dist/adapter/nuxt/module.js +1 -1
- package/dist/ai/ai-sdk/index.d.ts +7 -7
- package/dist/ai/ai-sdk/index.js +1 -1
- package/dist/ai/claude/index.d.ts +5 -5
- package/dist/ai/claude/index.js +1 -1
- package/dist/ai/openai/index.d.ts +13 -5
- package/dist/ai/openai/index.js +1 -1
- package/dist/ai/tanstack/index.d.ts +6 -6
- package/dist/ai/tanstack/index.js +1 -1
- package/dist/handler/http/fetch/index.d.ts +8 -8
- package/dist/handler/http/fetch/index.js +1 -1
- package/dist/handler/http/hono/index.d.ts +7 -7
- package/dist/handler/http/hono/index.js +1 -1
- package/dist/handler/http/nextjs/index.d.ts +7 -7
- package/dist/handler/http/nextjs/index.js +1 -1
- package/dist/handler/http/node/index.d.ts +7 -7
- package/dist/handler/http/node/index.js +1 -1
- package/dist/handler/http/solid-start/index.d.ts +7 -7
- package/dist/handler/http/solid-start/index.js +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +1 -1
- package/dist/openapi/index.js +1 -1
- package/dist/packem_shared/AbstractBaseStorage-CcIPoAES.js +1 -0
- package/dist/packem_shared/AwsLightFile-CqeZ6M7o.js +1 -0
- package/dist/packem_shared/AwsLightMetaStorage-Cb4xIpax.js +1 -0
- package/dist/packem_shared/AwsLightStorage-Bhg6C3fo.js +1 -0
- package/dist/packem_shared/AzureFile-DoUVXQMI.js +1 -0
- package/dist/packem_shared/AzureSMetaStorage-ByKDwgWo.js +1 -0
- package/dist/packem_shared/AzureStorage-BzYWVRnX.js +1 -0
- package/dist/packem_shared/BaseTransformer-ByIAKnn8.js +1 -0
- package/dist/packem_shared/BoxFile-CKKRYACc.js +1 -0
- package/dist/packem_shared/BoxMetaStorage-BI-G6aeO.js +1 -0
- package/dist/packem_shared/BoxStorage-Bmzt-OTx.js +1 -0
- package/dist/packem_shared/BunS3File-B2rczbY_.js +1 -0
- package/dist/packem_shared/BunS3MetaStorage-BI-G6aeO.js +1 -0
- package/dist/packem_shared/{BunS3Storage-B_roVJ29.js → BunS3Storage-uJ-u5wpg.js} +1 -1
- package/dist/packem_shared/BunnyFile-CBJdpNcB.js +1 -0
- package/dist/packem_shared/BunnyMetaStorage-BI-G6aeO.js +1 -0
- package/dist/packem_shared/BunnyStorage-9fw8VeuO.js +1 -0
- package/dist/packem_shared/CloudinaryFile-Dl8cnbJo.js +1 -0
- package/dist/packem_shared/CloudinaryMetaStorage-CYWznm7F.js +1 -0
- package/dist/packem_shared/CloudinaryStorage-CRVFUrEK.js +1 -0
- package/dist/packem_shared/DiskStorage-Wm6PC8Rc.js +1 -0
- package/dist/packem_shared/DiskStorageWithChecksum-CyhRDK5M.js +1 -0
- package/dist/packem_shared/DropboxFile-BUSubTWW.js +1 -0
- package/dist/packem_shared/DropboxMetaStorage-BYbJBJXr.js +1 -0
- package/dist/packem_shared/DropboxStorage-ZfgP7IMo.js +1 -0
- package/dist/packem_shared/{ERRORS-BIBxE2oR.js → ERRORS-olUcTqo2.js} +1 -1
- package/dist/packem_shared/File-DLAa0hBv.js +1 -0
- package/dist/packem_shared/Files-NF7wRh5C.js +1 -0
- package/dist/packem_shared/FirebaseFile-Dl8cnbJo.js +1 -0
- package/dist/packem_shared/FirebaseMetaStorage-DX1-58UY.js +1 -0
- package/dist/packem_shared/FirebaseStorage-D8NgHiZh.js +2 -0
- package/dist/packem_shared/FtpFile-H8EmE3S_.js +1 -0
- package/dist/packem_shared/FtpMetaStorage-BI-G6aeO.js +1 -0
- package/dist/packem_shared/FtpStorage-BjBdLfTV.js +1 -0
- package/dist/packem_shared/GCSFile-mFuZfcTW.js +1 -0
- package/dist/packem_shared/GCSMetaStorage-C5WuNwdJ.js +1 -0
- package/dist/packem_shared/GCStorage-PTbHNnv0.js +1 -0
- package/dist/packem_shared/GoogleDriveFile-fDYE1aaN.js +1 -0
- package/dist/packem_shared/GoogleDriveMetaStorage-CEleJNZZ.js +1 -0
- package/dist/packem_shared/{GoogleDriveStorage-Du7uBhSm.js → GoogleDriveStorage-CS9nWKP5.js} +1 -1
- package/dist/packem_shared/LocalMetaStorage-EnWCLyKq.js +1 -0
- package/dist/packem_shared/MediaTransformer-GqBUkOvz.js +1 -0
- package/dist/packem_shared/MemoryMetaStorage-DdAIGIVO.js +1 -0
- package/dist/packem_shared/{MemoryStorage-ChKyI6OY.js → MemoryStorage-CJw7SAlG.js} +1 -1
- package/dist/packem_shared/Metadata-BeQVDFer.js +1 -0
- package/dist/packem_shared/{Multipart-V64Bg5dt.js → Multipart-C3ve9Z0D.js} +1 -1
- package/dist/packem_shared/Multipart-PlMON60C.js +1 -0
- package/dist/packem_shared/NetlifyBlobFile-Br5HPqlC.js +1 -0
- package/dist/packem_shared/NetlifyBlobMetaStorage-DD5mbms5.js +1 -0
- package/dist/packem_shared/NetlifyBlobStorage-DVpJgN3v.js +1 -0
- package/dist/packem_shared/NoOpMetrics-CWqe9gwp.js +1 -0
- package/dist/packem_shared/OneDriveFile-Ccv5bkno.js +1 -0
- package/dist/packem_shared/OneDriveMetaStorage-D0GzJ0FC.js +1 -0
- package/dist/packem_shared/OneDriveStorage-CTYdWnnf.js +1 -0
- package/dist/packem_shared/OpenTelemetryMetrics-opDTaCRp.js +1 -0
- package/dist/packem_shared/PocketBaseFile-Dl8cnbJo.js +1 -0
- package/dist/packem_shared/PocketBaseMetaStorage-DgKNhi2j.js +1 -0
- package/dist/packem_shared/PocketBaseStorage-CHQVk7lR.js +1 -0
- package/dist/packem_shared/Rest-DQRxx8yQ.js +1 -0
- package/dist/packem_shared/Rest-DYXzbF-Q.js +1 -0
- package/dist/packem_shared/S3File-CyL0Q6Nx.js +1 -0
- package/dist/packem_shared/S3MetaStorage-DszTVQMa.js +1 -0
- package/dist/packem_shared/S3Storage-Bdns7a3N.js +1 -0
- package/dist/packem_shared/SftpFile-H8EmE3S_.js +1 -0
- package/dist/packem_shared/SftpMetaStorage-BI-G6aeO.js +1 -0
- package/dist/packem_shared/SftpStorage-D08to8f6.js +1 -0
- package/dist/packem_shared/SharePointFile-BWfd3Rel.js +1 -0
- package/dist/packem_shared/SharePointMetaStorage-BI-G6aeO.js +1 -0
- package/dist/packem_shared/{SharePointStorage-Dtnt5-wk.js → SharePointStorage-PtgEmyCY.js} +1 -1
- package/dist/packem_shared/SupabaseFile-CI0eFAyo.js +1 -0
- package/dist/packem_shared/SupabaseMetaStorage-CRw0xTXk.js +1 -0
- package/dist/packem_shared/SupabaseStorage-DJe4YZJD.js +1 -0
- package/dist/packem_shared/TUS_RESUMABLE-Dsxqcx-u.js +1 -0
- package/dist/packem_shared/{Tus-CJBgnJrn.js → Tus-C800fRBi.js} +1 -1
- package/dist/packem_shared/Tus-Vttn79I2.js +1 -0
- package/dist/packem_shared/UploadThingFile-DP4kNmpS.js +1 -0
- package/dist/packem_shared/UploadThingMetaStorage-CYWznm7F.js +1 -0
- package/dist/packem_shared/UploadThingStorage-S3iYzJ8Z.js +1 -0
- package/dist/packem_shared/ValidationError-SzFFFHiN.js +1 -0
- package/dist/packem_shared/VercelBlobFile-Censq2sD.js +1 -0
- package/dist/packem_shared/VercelBlobMetaStorage-DgKNhi2j.js +1 -0
- package/dist/packem_shared/VercelBlobStorage-D1eytZwU.js +1 -0
- package/dist/packem_shared/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/packem_shared/agentsCopyFile-BMTcfVHg.js +1 -0
- package/dist/packem_shared/akamai-BPAk4688.js +1 -0
- package/dist/packem_shared/alibaba-CPhhkaQs.js +1 -0
- package/dist/packem_shared/approval-DcuhtQKs.js +1 -0
- package/dist/packem_shared/aws-light-meta-storage-CgGLgB8g.js +4 -0
- package/dist/packem_shared/azure-meta-storage-DmBO5MmP.js +1 -0
- package/dist/packem_shared/backblaze-CjeWkpeg.js +1 -0
- package/dist/packem_shared/base-handler-core-BvNgdV-9.js +1 -0
- package/dist/packem_shared/base-handler-fetch-DDSPIzWT.js +1 -0
- package/dist/packem_shared/base-handler-node-C83nCFpv.js +1 -0
- package/dist/packem_shared/claudeCopyFile-CMKFZHFh.js +1 -0
- package/dist/packem_shared/cloudflare-CijqmNaq.js +1 -0
- package/dist/packem_shared/copyFile-B7PNh9O7.js +1 -0
- package/dist/packem_shared/copyFile-Q5eYZIU5.js +1 -0
- package/dist/packem_shared/createResponsesFileTools-SU-K9JG4.js +1 -0
- package/dist/packem_shared/createRetryWrapper-BM8PL0cI.js +1 -0
- package/dist/packem_shared/detect-file-type-go3r-MOD.js +1 -0
- package/dist/packem_shared/digitalOcean-BE_d_CcF.js +1 -0
- package/dist/packem_shared/disk-storage-DEOi12bM.js +1 -0
- package/dist/packem_shared/{executors-BDzMjc4y.js → executors-DgKT6b1T.js} +1 -1
- package/dist/packem_shared/{executors.d-B9dIy3NT.d.ts → executors.d-HWHR3Ids.d.ts} +1 -6
- package/dist/packem_shared/exoscale-BzXbsZ3A.js +1 -0
- package/dist/packem_shared/{filebase-CsFYJIwB.js → filebase-pfolz904.js} +1 -1
- package/dist/packem_shared/{files.d-CmSZi3M0.d.ts → files.d-DuIceNg2.d.ts} +1 -1
- package/dist/packem_shared/gcs-meta-storage-B50U4jps.js +1 -0
- package/dist/packem_shared/{get-file-status-y3wTtDQs.js → get-file-status-B8WmWzcM.js} +1 -1
- package/dist/packem_shared/getFormatFromContentType-BAVdaQ0o.js +1 -0
- package/dist/packem_shared/has-content-96mmyLn2.js +1 -0
- package/dist/packem_shared/headers-erjZrwbT.js +26 -0
- package/dist/packem_shared/hetzner-CaLW6ANw.js +1 -0
- package/dist/packem_shared/{ibmCos-j-3TfJ5p.js → ibmCos-Dbcs7XEJ.js} +1 -1
- package/dist/packem_shared/idriveE2-BiiGl7tr.js +1 -0
- package/dist/packem_shared/index-DKzU1HON.js +5 -0
- package/dist/packem_shared/internal-Zb__DDsV.js +1 -0
- package/dist/packem_shared/is-expired-CZlgTFFz.js +1 -0
- package/dist/packem_shared/local-meta-storage-Ca6WrUmN.js +1 -0
- package/dist/packem_shared/{local-meta-storage.d-cRTXr1kb.d.ts → local-meta-storage.d-CYWYyCUo.d.ts} +1 -2
- package/dist/packem_shared/{media-transformer.d-C8tn4J2Z.d.ts → media-transformer.d-Co37isNg.d.ts} +2 -2
- package/dist/packem_shared/minio-CC_RGR-q.js +1 -0
- package/dist/packem_shared/multipart-base-0AXqLN-B.js +1 -0
- package/dist/packem_shared/oauth-refresh-Cf1z47zf.js +1 -0
- package/dist/packem_shared/{oracleCloud-DslqNpn6.js → oracleCloud-eAWm6voZ.js} +1 -1
- package/dist/packem_shared/{ovhCloud-CMHE6uLV.js → ovhCloud-D00DprwO.js} +1 -1
- package/dist/packem_shared/part-match-Cb6xL9eN.js +1 -0
- package/dist/packem_shared/path-CxEa27Rz-DSh0_A5o.js +1 -0
- package/dist/packem_shared/posix-dirname-CSjB98Q5.js +1 -0
- package/dist/packem_shared/response-builder-tJ84C7n4.js +1 -0
- package/dist/packem_shared/rest-base-CzhSrUnH.js +1 -0
- package/dist/packem_shared/{restOpenApiSpec-Csv513qf.js → restOpenApiSpec-BNBrZFuE.js} +1 -1
- package/dist/packem_shared/s3-base-storage-DuHVKzSw.js +1 -0
- package/dist/packem_shared/{s3-base-storage.d-ks99NSs-.d.ts → s3-base-storage.d-BmuspwCF.d.ts} +1 -1
- package/dist/packem_shared/scaleway-Dms2IqTd.js +1 -0
- package/dist/packem_shared/{sharedErrorSchemaObject-YN65aAKj.js → sharedErrorSchemaObject-GTCM7U0s.js} +1 -1
- package/dist/packem_shared/{storage-DR7qdwBN.js → storage-uypoNkqu.js} +1 -1
- package/dist/packem_shared/{storage.d-DwdJrArF.d.ts → storage.d-C9EdfTf1.d.ts} +1 -1
- package/dist/packem_shared/storj-DzEePQoh.js +1 -0
- package/dist/packem_shared/sync-ClnPrYjk.js +1 -0
- package/dist/packem_shared/tencent-7P8z8AwE.js +1 -0
- package/dist/packem_shared/tigris-DlNWhmsM.js +1 -0
- package/dist/packem_shared/{transformOpenApiSpec-CIEAgpBD.js → transformOpenApiSpec-Bcnw9LVy.js} +1 -1
- package/dist/packem_shared/{tus-base.d-BKBoJVy0.d.ts → tus-base.d-Dgnbivbj.d.ts} +3 -8
- package/dist/packem_shared/{tusOpenApiSpec-D96B03t5.js → tusOpenApiSpec-BU8nhLH2.js} +1 -1
- package/dist/packem_shared/{types.d-BEUv414z.d.ts → types.d-D1TIRqKW.d.ts} +1 -1
- package/dist/packem_shared/{types.d-D7Zlz5RE.d.ts → types.d-D6Jkz0Sp.d.ts} +2 -2
- package/dist/packem_shared/{types.d-B1_xZIhu.d.ts → types.d-ZrDWKyVi.d.ts} +1 -2
- package/dist/packem_shared/update-size-Dxc1hvbI.js +1 -0
- package/dist/packem_shared/vultr-Crvmg314.js +1 -0
- package/dist/packem_shared/waitForStorage-afkqWeuz.js +1 -0
- package/dist/packem_shared/wasabi-CyCMxoUT.js +1 -0
- package/dist/packem_shared/{xhrOpenApiSpec-DQR4h6M8.js → xhrOpenApiSpec-xDSkxm2d.js} +1 -1
- package/dist/packem_shared/yandex-D1HwCz7g.js +1 -0
- package/dist/storage/aws/clients/index.js +1 -1
- package/dist/storage/aws/index.d.ts +3 -3
- package/dist/storage/aws/index.js +1 -1
- package/dist/storage/aws-light/index.d.ts +2 -2
- package/dist/storage/aws-light/index.js +1 -1
- package/dist/storage/azure/index.d.ts +2 -2
- package/dist/storage/azure/index.js +1 -1
- package/dist/storage/box/index.d.ts +3 -3
- package/dist/storage/box/index.js +1 -1
- package/dist/storage/bun-s3/index.d.ts +2 -2
- package/dist/storage/bun-s3/index.js +1 -1
- package/dist/storage/bunny/index.d.ts +3 -3
- package/dist/storage/bunny/index.js +1 -1
- package/dist/storage/cloudinary/index.d.ts +3 -3
- package/dist/storage/cloudinary/index.js +1 -1
- package/dist/storage/dropbox/index.d.ts +3 -3
- package/dist/storage/dropbox/index.js +1 -1
- package/dist/storage/firebase/index.d.ts +2 -2
- package/dist/storage/firebase/index.js +1 -1
- package/dist/storage/ftp/index.d.ts +3 -3
- package/dist/storage/ftp/index.js +1 -1
- package/dist/storage/gcs/index.d.ts +2 -2
- package/dist/storage/gcs/index.js +1 -1
- package/dist/storage/google-drive/index.d.ts +3 -3
- package/dist/storage/google-drive/index.js +1 -1
- package/dist/storage/local/index.d.ts +148 -4
- package/dist/storage/local/index.js +1 -1
- package/dist/storage/memory/index.d.ts +93 -3
- package/dist/storage/memory/index.js +1 -1
- package/dist/storage/netlify-blob/index.d.ts +3 -3
- package/dist/storage/netlify-blob/index.js +1 -1
- package/dist/storage/onedrive/index.d.ts +4 -4
- package/dist/storage/onedrive/index.js +1 -1
- package/dist/storage/pocketbase/index.d.ts +2 -2
- package/dist/storage/pocketbase/index.js +1 -1
- package/dist/storage/sftp/index.d.ts +3 -3
- package/dist/storage/sftp/index.js +1 -1
- package/dist/storage/sharepoint/index.d.ts +3 -3
- package/dist/storage/sharepoint/index.js +1 -1
- package/dist/storage/supabase/index.d.ts +3 -3
- package/dist/storage/supabase/index.js +1 -1
- package/dist/storage/uploadthing/index.d.ts +2 -2
- package/dist/storage/uploadthing/index.js +1 -1
- package/dist/storage/vercel-blob/index.d.ts +3 -3
- package/dist/storage/vercel-blob/index.js +1 -1
- package/dist/transformer/audio-transformer.d.ts +2 -2
- package/dist/transformer/audio-transformer.js +1 -1
- package/dist/transformer/image-transformer.d.ts +2 -2
- package/dist/transformer/image-transformer.js +1 -1
- package/dist/transformer/index.d.ts +3 -3
- package/dist/transformer/index.js +1 -1
- package/dist/transformer/video-transformer.d.ts +2 -2
- package/dist/transformer/video-transformer.js +1 -1
- package/package.json +21 -20
- package/dist/packem_shared/AbstractBaseStorage-CLsYmMZg.js +0 -1
- package/dist/packem_shared/AwsLightFile-CpZrubaV.js +0 -1
- package/dist/packem_shared/AwsLightMetaStorage-DPqJ9LTr.js +0 -1
- package/dist/packem_shared/AwsLightStorage-DGSPFUqr.js +0 -1
- package/dist/packem_shared/AzureFile-DFSaVe25.js +0 -1
- package/dist/packem_shared/AzureSMetaStorage-ByzM6Aix.js +0 -1
- package/dist/packem_shared/AzureStorage-DvKk_hhz.js +0 -1
- package/dist/packem_shared/BaseTransformer-Buw5lX_3.js +0 -1
- package/dist/packem_shared/BoxFile-CseIoPW1.js +0 -1
- package/dist/packem_shared/BoxMetaStorage-CJsyeQ63.js +0 -1
- package/dist/packem_shared/BoxStorage-CmM95wi2.js +0 -1
- package/dist/packem_shared/BunS3File-BcYmsz1n.js +0 -1
- package/dist/packem_shared/BunS3MetaStorage-CJsyeQ63.js +0 -1
- package/dist/packem_shared/BunnyFile-BgEOlcYI.js +0 -1
- package/dist/packem_shared/BunnyMetaStorage-CJsyeQ63.js +0 -1
- package/dist/packem_shared/BunnyStorage-eZ1QDVaY.js +0 -1
- package/dist/packem_shared/CloudinaryFile-Bo5B-vM1.js +0 -1
- package/dist/packem_shared/CloudinaryMetaStorage-Bv_YCZ0Q.js +0 -1
- package/dist/packem_shared/CloudinaryStorage-CpH2f0Fv.js +0 -1
- package/dist/packem_shared/DiskStorage-DzjjqCzo.js +0 -1
- package/dist/packem_shared/DiskStorageWithChecksum-MZkDEyts.js +0 -1
- package/dist/packem_shared/DropboxFile-BFb7eOzy.js +0 -1
- package/dist/packem_shared/DropboxMetaStorage-CJsyeQ63.js +0 -1
- package/dist/packem_shared/DropboxStorage-BB9NoWK2.js +0 -1
- package/dist/packem_shared/File-W8aOo15X.js +0 -1
- package/dist/packem_shared/Files-DyMJ9FPN.js +0 -1
- package/dist/packem_shared/FirebaseFile-BLaBxa2A.js +0 -1
- package/dist/packem_shared/FirebaseMetaStorage-Bv_YCZ0Q.js +0 -1
- package/dist/packem_shared/FirebaseStorage-BgbxzYNC.js +0 -2
- package/dist/packem_shared/FtpFile-ClWDYnt2.js +0 -1
- package/dist/packem_shared/FtpMetaStorage-CJsyeQ63.js +0 -1
- package/dist/packem_shared/FtpStorage-CNqXDz7P.js +0 -1
- package/dist/packem_shared/GCSFile-Cero7qZN.js +0 -1
- package/dist/packem_shared/GCSMetaStorage-Cm_XzR0C.js +0 -1
- package/dist/packem_shared/GCStorage-DcvsI7eu.js +0 -1
- package/dist/packem_shared/GoogleDriveFile-DHpLhzg9.js +0 -1
- package/dist/packem_shared/GoogleDriveMetaStorage-B0gLF7Io.js +0 -1
- package/dist/packem_shared/LocalMetaStorage-CcGfFG39.js +0 -1
- package/dist/packem_shared/MediaTransformer-D2kUsklW.js +0 -1
- package/dist/packem_shared/MemoryMetaStorage-Ksgh9pe7.js +0 -1
- package/dist/packem_shared/Metadata-B7CcBueg.js +0 -1
- package/dist/packem_shared/Multipart-C35TR2qL.js +0 -1
- package/dist/packem_shared/NetlifyBlobFile-DoFhkzaH.js +0 -1
- package/dist/packem_shared/NetlifyBlobMetaStorage-Bv_YCZ0Q.js +0 -1
- package/dist/packem_shared/NetlifyBlobStorage-CZsr_0DF.js +0 -1
- package/dist/packem_shared/NoOpMetrics-BLo6u4NY.js +0 -1
- package/dist/packem_shared/OneDriveFile-CNNJYI43.js +0 -1
- package/dist/packem_shared/OneDriveMetaStorage-B0gLF7Io.js +0 -1
- package/dist/packem_shared/OneDriveStorage-B8qFgMq1.js +0 -1
- package/dist/packem_shared/OpenTelemetryMetrics-DJDQsNKp.js +0 -1
- package/dist/packem_shared/PocketBaseFile-DpJpxl3e.js +0 -1
- package/dist/packem_shared/PocketBaseMetaStorage-Cm3v8g1-.js +0 -1
- package/dist/packem_shared/PocketBaseStorage-D2vMN-oY.js +0 -1
- package/dist/packem_shared/Rest-BrEMYgxZ.js +0 -1
- package/dist/packem_shared/Rest-aPVP2ww1.js +0 -1
- package/dist/packem_shared/S3File-CpZrubaV.js +0 -1
- package/dist/packem_shared/S3MetaStorage-CMonflzp.js +0 -1
- package/dist/packem_shared/S3Storage-CTe_BMDl.js +0 -1
- package/dist/packem_shared/SftpFile-ClWDYnt2.js +0 -1
- package/dist/packem_shared/SftpMetaStorage-CJsyeQ63.js +0 -1
- package/dist/packem_shared/SftpStorage-BKeAzuej.js +0 -1
- package/dist/packem_shared/SharePointFile-Blz9FS4h.js +0 -1
- package/dist/packem_shared/SharePointMetaStorage-CJsyeQ63.js +0 -1
- package/dist/packem_shared/SupabaseFile-Bo5B-vM1.js +0 -1
- package/dist/packem_shared/SupabaseMetaStorage-B0gLF7Io.js +0 -1
- package/dist/packem_shared/SupabaseStorage-CmGQjqXf.js +0 -1
- package/dist/packem_shared/TUS_RESUMABLE-CyTSRvPU.js +0 -1
- package/dist/packem_shared/Tus-D9c7KDnl.js +0 -1
- package/dist/packem_shared/UploadThingFile-BTFMpcIA.js +0 -1
- package/dist/packem_shared/UploadThingMetaStorage-Bv_YCZ0Q.js +0 -1
- package/dist/packem_shared/UploadThingStorage-DZ4zNvDH.js +0 -1
- package/dist/packem_shared/ValidationError-3B06DFyE.js +0 -1
- package/dist/packem_shared/VercelBlobFile-CVQwKlZk.js +0 -1
- package/dist/packem_shared/VercelBlobMetaStorage-CJsyeQ63.js +0 -1
- package/dist/packem_shared/VercelBlobStorage-DDNEofR3.js +0 -1
- package/dist/packem_shared/_commonjsHelpers-CWAkuNXM.js +0 -1
- package/dist/packem_shared/agentsCopyFile-Dl5iffdH.js +0 -1
- package/dist/packem_shared/akamai-DthkaFul.js +0 -1
- package/dist/packem_shared/alibaba-BEi25O1g.js +0 -1
- package/dist/packem_shared/approval-fVHwBp7u.js +0 -1
- package/dist/packem_shared/aws-light-meta-storage-DGrn72VJ.js +0 -4
- package/dist/packem_shared/azure-meta-storage-ClbEsfI4.js +0 -1
- package/dist/packem_shared/backblaze-m1N5NZ9q.js +0 -1
- package/dist/packem_shared/base-handler-core-BJP9jHCE.js +0 -1
- package/dist/packem_shared/base-handler-fetch-yrYrukwL.js +0 -1
- package/dist/packem_shared/base-handler-node-C8P9rkaH.js +0 -1
- package/dist/packem_shared/claudeCopyFile-BX9O4ORk.js +0 -1
- package/dist/packem_shared/cloudflare-CdUTErlo.js +0 -1
- package/dist/packem_shared/copyFile-49FtxXcm.js +0 -1
- package/dist/packem_shared/copyFile-BUPezT_c.js +0 -1
- package/dist/packem_shared/createResponsesFileTools-6Tvt2PNr.js +0 -1
- package/dist/packem_shared/createRetryWrapper-DgmeHPNF.js +0 -1
- package/dist/packem_shared/detect-file-type-BA7UBLKA.js +0 -1
- package/dist/packem_shared/digitalOcean-B2uB6pgz.js +0 -1
- package/dist/packem_shared/disk-storage-DqnnFQAQ.js +0 -1
- package/dist/packem_shared/disk-storage-with-checksum.d-Dgwyza8a.d.ts +0 -146
- package/dist/packem_shared/exoscale-BDa1Gjth.js +0 -1
- package/dist/packem_shared/gcs-meta-storage-Bu2upyHK.js +0 -1
- package/dist/packem_shared/getFormatFromContentType-DCTTPQHm.js +0 -1
- package/dist/packem_shared/has-content-50BsqrWw.js +0 -1
- package/dist/packem_shared/headers-BAiAKekR.js +0 -26
- package/dist/packem_shared/hetzner-BGGFiRGD.js +0 -1
- package/dist/packem_shared/idriveE2-C6pQ5pQ0.js +0 -1
- package/dist/packem_shared/index-nZWCQrSe.js +0 -5
- package/dist/packem_shared/internal-D_cZIFwI.js +0 -1
- package/dist/packem_shared/is-expired-CBEk6XBi.js +0 -1
- package/dist/packem_shared/local-meta-storage-BELb1YwO.js +0 -11
- package/dist/packem_shared/memory-storage.d-BNZvDG1b.d.ts +0 -93
- package/dist/packem_shared/minio-NKquuBfS.js +0 -1
- package/dist/packem_shared/multipart-base-BOzY19lb.js +0 -1
- package/dist/packem_shared/oauth-refresh-EdGzlcOZ.js +0 -1
- package/dist/packem_shared/part-match-D-9dGX42.js +0 -1
- package/dist/packem_shared/path-C-OWflAo-_mqb5p5d.js +0 -1
- package/dist/packem_shared/posix-dirname-CfpH5wZi.js +0 -1
- package/dist/packem_shared/response-builder-CbSA8qPa.js +0 -1
- package/dist/packem_shared/rest-base-BQ_dhWyV.js +0 -1
- package/dist/packem_shared/s3-base-storage-CX94H-Za.js +0 -1
- package/dist/packem_shared/scaleway-U1In3v70.js +0 -1
- package/dist/packem_shared/storj-Cb59q9kF.js +0 -1
- package/dist/packem_shared/sync-DhR3536K.js +0 -1
- package/dist/packem_shared/tencent-Q1y2GENc.js +0 -1
- package/dist/packem_shared/tigris-BELKoyyp.js +0 -1
- package/dist/packem_shared/update-size-DuNuLyxj.js +0 -1
- package/dist/packem_shared/vultr-B491cQ4e.js +0 -1
- package/dist/packem_shared/waitForStorage-ByQmG4xF.js +0 -1
- package/dist/packem_shared/wasabi-DFrwIoab.js +0 -1
- package/dist/packem_shared/yandex-CwzHuEKP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Readable as Y}from"node:stream";import{setInterval as G}from"node:timers";import{inspect as K}from"node:util";import{W as H,v as O}from"./path-C-OWflAo-_mqb5p5d.js";import q from"type-is";import J from"./NoOpMetrics-BLo6u4NY.js";import{N as Q}from"./cache-Cw3QjoVN.js";import{ErrorMap as $,throwErrorCode as b,ERRORS as v}from"./ERRORS-BIBxE2oR.js";import{randomUUID as X}from"node:crypto";import{LRUCache as ee}from"lru-cache";import{retry as te}from"./createRetryWrapper-DgmeHPNF.js";import{t as re}from"./is-expired-CBEk6XBi.js";const se=new RegExp("^(?<value>-?\\d+(?:[\\p{Zs}'’.,]\\d+)*)\\p{Zs}*(?<type>[a-z]+)?$","iu"),oe={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},ie=["metric","iec","metric_octet","iec_octet"],ne=1024,ae=t=>t==="iec"||t==="iec_octet",R=new Map,ce=t=>{let e=R.get(t);if(e===void 0){const r=new Intl.NumberFormat(t);e={decimalSeparator:r.format(1.1).replaceAll(new RegExp("\\p{Number}","gu"),""),thousandSeparator:r.format(11111).replaceAll(new RegExp("\\p{Number}","gu"),"")},R.set(t,e)}return e},le=(t,e)=>{const{decimalSeparator:r,thousandSeparator:s}=ce(e),o=t.replaceAll(/[\p{Zs}'’]/gu,"");return Number.parseFloat(o.replaceAll(new RegExp(`\\${s}`,"g"),"").replace(new RegExp(`\\${r}`),"."))},ue=t=>{switch(t){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},ge=(t,e)=>{for(const r of[e,...ie.filter(s=>s!==e)]){const s=oe[r].findIndex(o=>o.short.toUpperCase()===t||o.long.toUpperCase()===t);if(s!==-1)return{level:s,system:r}}},U=(t,e)=>{const r={base:2,locale:"en-US",units:"metric",...e};if(typeof t!="string"||t.length===0)throw new TypeError("Value is not a string or is empty.");if(t.length>100)throw new TypeError("Value exceeds the maximum length of 100 characters.");const s=se.exec(t)?.groups;if(!s)return Number.NaN;const o=le(s.value,r.locale),i=ge((s.type??"Bytes").toUpperCase(),r.units);if(i===void 0)return Number.NaN;const n=ue(r.base),c=ae(i.system)?ne:n;return o*c**i.level},me=(t,e,r,s,o,i,n,c,l,a,u,m,g,p)=>{const d={d:s,h:o,m:i,mo:e,ms:c,s:n,w:r,y:t};return d.future=l,d.past=a,d.decimal=u,m!==void 0&&(d.unitMap=m),d.groupSeparator=g,d.placeholderSeparator=p,d},I={d:"d",day:"d",days:"d",h:"h",hour:"h",hours:"h",hr:"h",hrs:"h",m:"m",millisecond:"ms",milliseconds:"ms",min:"m",mins:"m",minute:"m",minutes:"m",mo:"mo",month:"mo",months:"mo",ms:"ms",s:"s",sec:"s",second:"s",seconds:"s",secs:"s",w:"w",week:"w",weeks:"w",y:"y",year:"y",years:"y",yr:"y",yrs:"y"},de=me(t=>`year${t===1?"":"s"}`,t=>`month${t===1?"":"s"}`,t=>`week${t===1?"":"s"}`,t=>`day${t===1?"":"s"}`,t=>`hour${t===1?"":"s"}`,t=>`minute${t===1?"":"s"}`,t=>`second${t===1?"":"s"}`,t=>`millisecond${t===1?"":"s"}`,"in %s","%s ago",".",I,",","_"),z=new WeakSet,he=t=>{if(z.has(t))return;const e=["y","mo","w","d","h","m","s","ms"];for(const s of e)if(!Object.hasOwn(t,s))throw new TypeError(`Missing required property: ${s}`);if(t.future!==void 0&&typeof t.future!="string")throw new TypeError("Properties future and past must be of type string");if(t.past!==void 0&&typeof t.past!="string")throw new TypeError("Properties future and past must be of type string");const r=["y","mo","w","d","h","m","s","ms"];for(const s of r)if(typeof t[s]!="string"&&typeof t[s]!="function")throw new TypeError(`Property ${s} must be of type string or function`);if(t.decimal&&typeof t.decimal!="string")throw new TypeError("Property decimal must be of type string");if(t.delimiter&&typeof t.delimiter!="string")throw new TypeError("Property delimiter must be of type string");if(t._digitReplacements&&!Array.isArray(t._digitReplacements))throw new TypeError("Property _digitReplacements must be an array");if(t._numberFirst&&typeof t._numberFirst!="boolean")throw new TypeError("Property _numberFirst must be of type boolean");if(t.unitMap&&typeof t.unitMap!="object")throw new TypeError("Property unitMap must be an object");if(t.unitMap&&Object.values(t.unitMap).some(s=>typeof s!="string"))throw new TypeError("All values in unitMap must be of type string");z.add(t)},w={d:864e5,h:36e5,m:6e4,mo:2629746e3,ms:1,s:1e3,w:6048e5,y:31556952e3},S=/[-/\\^$*+?.()|[\]{}]/g,P=new WeakMap,B=new WeakMap,pe=t=>{let e=B.get(t);if(e===void 0){const r=t.decimal??".",s=t.groupSeparator??",",o=t.placeholderSeparator??"_",i=r.replaceAll(S,String.raw`\$&`),n=s.replaceAll(S,String.raw`\$&`),c=o.replaceAll(S,String.raw`\$&`);e={decimalRewrite:r==="."?void 0:new RegExp(String.raw`(\d)${i}(\d)`,"g"),groupStrip:new RegExp(String.raw`(\d)[${c}${n}](\d)`,"g")},B.set(t,e)}return e},E=t=>String.raw`(?:(\d+(?:[.,]\d+)?)${t})?`,fe=new RegExp(`^P${E("Y")}${E("M")}${E("W")}${E("D")}(?:T${E("H")}${E("M")}${E("S")})?$`,"i"),ye=/^(?:\s*,)?\s*$/,A=new Map,we=64,be=t=>{const e=t===void 0?"":t.trim();if(e.length===0)return ye;let r=A.get(e);if(r===void 0){A.size>=we&&A.clear();const s=e.replaceAll(S,String.raw`\$&`);r=new RegExp(String.raw`^(?:\s*,)?\s*(?:${s}\s*)?$`,"i"),A.set(e,r)}return r},ve=/^(?:(\d+):)?(?:(\d+):)?(\d+)$/,Ee=/^[+-]?\d+(?:\.\d+)?$/,$e=/^[-+]/,xe=(t,e)=>{if(typeof t!="string"||t.length===0)return;const{conjunction:r,defaultUnit:s="ms",language:o=de}={};he(o);const{decimalRewrite:i,groupStrip:n}=pe(o),c=o.unitMap??I;let l=t.replaceAll(n,"$1$2");if(i!==void 0&&(l=l.replaceAll(i,"$1.$2")),Ee.test(l.trim())){const f=Number.parseFloat(l.trim());if(!Number.isNaN(f)){const h=c[s];if(h!==void 0)return f*w[h]}return}const a=fe.exec(t);if(a){const f=[[1,w.y],[2,w.mo],[3,w.w],[4,w.d],[5,w.h],[6,w.m],[7,w.s]];let h=0,y=!1;for(const[N,D]of f){const x=a[N];x!==void 0&&(y=!0,h+=Number.parseFloat(x.replace(",","."))*D)}if(y)return h}const u=ve.exec(t);if(u){let f=0,h=0;u[2]!==void 0?(f=Number.parseInt(u[1]??"0",10),h=Number.parseInt(u[2],10)):u[1]!==void 0&&(h=Number.parseInt(u[1],10));const y=Number.parseInt(u[3]??"0",10);return f*36e5+h*6e4+y*1e3}let m=P.get(c);if(m===void 0){const f=Object.keys(c).toSorted((h,y)=>y.length-h.length).map(h=>h.replaceAll(S,String.raw`\$&`)).join("|");m=new RegExp(String.raw`(-?\d*\.?\d+)\s*(${f})`,"gi"),P.set(c,m)}const g=be(r);let p=0,d,T=!1,_=-1,M=0;for(m.lastIndex=0;(d=m.exec(l))!==null;){const f=d[1],h=d[2];if(!f||!h)continue;const y=f.trim(),N=y.startsWith("-")?-1:1,D=y.replace($e,""),x=Number.parseFloat(D),k=c[h.toLowerCase()];if(k===void 0)continue;if(!T)_=d.index;else if(!g.test(l.slice(M,d.index)))return;T=!0,M=m.lastIndex;const Z=w[k];if(Number.isNaN(x))return;p+=N*x*Z}const j=l.slice(0,_).trim(),W=l.slice(M).trim();if(!(T&&(j.length>0||W.length>0))&&T)return p};class Se extends ee{constructor(e){super({ttl:3e4,ttlAutopurge:!0,...e})}lock(e){if(this.get(e)!==void 0)throw new Error(`${e} is locked`);const r=X();return this.set(e,r),r}unlock(e,r){return this.get(e)!==r?!1:this.delete(e)}}const C=t=>{if(t===Number(t))return t;if(!t)return;const e=xe(t);if(e!==void 0)return e};class Te extends Error{code;statusCode;body;headers;name="ValidationError";constructor(e,r,s,o){const i=typeof s=="string"?s:s?.message||"Validation error";super(i),this.code=e,this.statusCode=r,this.body=s,this.headers=o}}const Ae=t=>t&&t[0].toUpperCase()+t.slice(1),Ce=t=>{if(!Array.isArray(t))return t;const[e,r,s]=t;return{body:r,headers:s,statusCode:e}};class Me{constructor(e="ValidationError"){this.prefix=e}prefix;validators={};add(e){Object.entries(e).forEach(([r,s])=>{const o=`${this.prefix}${Ae(r)}`;if(this.validators[o]={...this.validators[o],...s},typeof this.validators[o].isValid!="function")throw new TypeError('Validation config "isValid" is missing, or it is not a function!')})}async verify(e){for(const[r,s]of Object.entries(this.validators))if(!await s.isValid(e)){const o=s.response||(r in $?$[r]:$.UnknownError),i=Ce(o),{body:n,headers:c,message:l,statusCode:a}=i;throw new Te(r,a,n||l,c)}}}const Ye=t=>t.name==="ValidationError",Ne=t=>{if(typeof t.name=="string")return t.name;if(typeof t.title=="string")return t.title;if(typeof t.originalName=="string")return t.originalName;if(typeof t.filename=="string")return t.filename},F=(t,e)=>{const r={...t};return Object.keys(e).forEach(s=>{const o=e[s];if(o!==null&&typeof o=="object"&&!Array.isArray(o)){const i=r[s],n=i&&typeof i=="object"&&!Array.isArray(i)?i:{};r[s]=F(n,o)}else r[s]=o}),r},De=(t,e)=>{const r=F(t,e);Object.assign(t,r),t.originalName=Ne(t.metadata)||t.originalName},Oe=/(secret|password|passwd|pwd|token|api[_-]?key|credential|authorization|sas|signature|sessiontoken|connectionstring)/i,L=t=>{const e={};for(const[r,s]of Object.entries(t))typeof s=="string"&&Oe.test(r)?e[r]="[REDACTED]":s&&typeof s=="object"&&!Array.isArray(s)&&s.constructor===Object?e[r]=L(s):e[r]=s;return e},_e={allowMIME:["*/*"],filename:({id:t})=>t,maxMetadataSize:"8MB",maxUploadSize:"5TB",onComplete:()=>{},onCreate:()=>{},onDelete:()=>{},onError:()=>{},onUpdate:()=>{},useRelativeLocation:!1,validation:{}},ke=t=>!t||t.length<3||t.length>255||O(t)?!1:!(t.toUpperCase().includes("../")||t.includes("\0")),Ge=t=>{if(!t||t.length<3||t.length>255||O(t))return!1;const e=t.toUpperCase();return!['"',"*",":","<",">","?","\\","|","../","\0"].some(r=>e.includes(r))};class V{onCreate;onUpdate;onComplete;onDelete;onError;isReady=!0;errorResponses={};cache;logger;metrics;genericConfig;maxMetadataSize;checksumTypes=[];supportsRange=!1;supportsMetadata=!0;supportsCacheControl=!1;supportsDelimiter=!1;reportsUploadProgress=!1;maxUploadSize;expiration;locker;namingFunction;validation=new Me;assetFolder=void 0;concurrency;autoPurgeTimer;constructor(e){const r={..._e,...e};this.onCreate=r.onCreate,this.onUpdate=r.onUpdate,this.onComplete=r.onComplete,this.onDelete=r.onDelete,this.onError=r.onError,this.namingFunction=r.filename,this.maxUploadSize=typeof r.maxUploadSize=="string"?U(r.maxUploadSize):r.maxUploadSize,this.maxMetadataSize=typeof r.maxMetadataSize=="string"?U(r.maxMetadataSize):r.maxMetadataSize,this.expiration=r.expiration,this.genericConfig=r,r.assetFolder!==void 0&&(this.assetFolder=H(r.assetFolder)),this.locker=new Se({max:1e3,ttl:3e4,ttlAutopurge:!0}),this.cache=r.cache??new Q,this.logger=r.logger,this.metrics=r.metrics??new J,this.logger?.debug(`${this.constructor.name} config: ${K(L({...e,logger:this.logger.constructor}))}`);const s=C(r.expiration?.purgeInterval);s&&this.startAutoPurge(s);const o={isValid(l){if(l.size===void 0)return!0;const a=l.size;if(a==null)return!1;const u=typeof a=="number"?a:Number(a);if(Number.isNaN(u)||u<0)return!1;const m=typeof this.value=="number"?this.value:Number(this.value);return!Number.isNaN(m)&&u<=m},response:$.RequestEntityTooLarge,value:this.maxUploadSize},i={isValid(l){return!!q.is(l.contentType,this.value)},response:$.UnsupportedMediaType,value:r.allowMIME},n=r.fileNameValidation??ke,c={isValid(l){return n(l.name)},response:$.InvalidFileName};this.validation.add({filename:c,mime:i,size:o}),this.validation.add({...r.validation})}get raw(){}async getReadUrl(e,r){return b(v.METHOD_NOT_ALLOWED,`${this.constructor.name} does not implement getReadUrl()`)}async getUploadUrl(e,r){return b(v.METHOD_NOT_ALLOWED,`${this.constructor.name} does not implement getUploadUrl()`)}get tusExtension(){const e=["creation","creation-with-upload","termination","checksum","creation-defer-length","concatenation"];return this.expiration&&e.push("expiration"),e}async validate(e){await this.validation.verify(e)}async exists(e,r){return this.instrumentOperation("exists",async()=>{try{return await this.getMeta(e.id,r),!0}catch{return!1}})}normalizeError(e){const r={code:e.name,message:e.message,name:e.name,statusCode:500};return{...r,message:`[${this.constructor.name}] ${r.message}`}}get config(){return this.genericConfig}async saveMeta(e){return V.assertSafeId(e.id),this.updateTimestamps(e),this.cache.set(e.id,e),this.meta.save(e.id,e)}static assertSafeId(e){(!e||typeof e!="string"||e.includes("\0")||e.includes("../")||e.includes("..\\")||e===".."||e.startsWith("../")||e.startsWith("..\\")||O(e)||/^[A-Z]:[/\\]/i.test(e))&&b(v.INVALID_FILE_NAME,`Invalid file id: "${e}"`)}async deleteMeta(e){return this.cache.delete(e),this.meta.delete(e)}async getMeta(e,r){try{const s=await this.meta.get(e);return this.cache.set(s.id,s),{...s}}catch(s){const o=this.normalizeError(s instanceof Error?s:new Error(String(s)));return await this.onError(o),b(v.FILE_NOT_FOUND)}}async checkIfExpired(e){return re(e)?(this.delete(e).catch(()=>{}),this.deleteMeta(e.id).catch(()=>{}),b(v.GONE)):e}async purge(e){return this.instrumentOperation("purge",async()=>{const r=C(e||this.expiration?.maxAge),s={items:[],maxAgeMs:r};if(r){const o=Date.now()-r,i=(await this.list()).filter(n=>Number(new Date(this.expiration?.rolling&&n.modifiedAt||n.createdAt))<o);for await(const{id:n,...c}of i)try{const l=await this.delete({id:n});s.items.push({...l,...c})}catch(l){this.logger?.warn(`Failed to delete file ${n} during purge: ${l instanceof Error?l.message:String(l)}`)}s.items.length>0&&(this.logger?.info(`Purge: removed ${s.items.length} uploads`),this.metrics.gauge("storage.operations.purge.items_count",s.items.length,{storage:this.constructor.name.toLowerCase().replace("storage","")}))}return s})}async getStream({id:e},r){return this.instrumentOperation("getStream",async()=>{const s=await this.get({id:e},r),o=Y.from(s.content);return{headers:{"Content-Length":String(s.size),"Content-Type":s.contentType,...s.ETag&&{ETag:s.ETag},...s.modifiedAt&&{"Last-Modified":s.modifiedAt.toString()}},size:typeof s.size=="number"?s.size:void 0,stream:o}})}async list(e=1e3,r){return this.instrumentOperation("list",async()=>{throw new Error("Not implemented")})}async listDirectory(e){return b(v.METHOD_NOT_ALLOWED,`${this.constructor.name} does not implement listDirectory()`)}async update({id:e},r){return this.instrumentOperation("update",async()=>{const s=await this.getMeta(e),o={...r};if("ttl"in o&&o.ttl!==void 0){const n=o.ttl,c=typeof n=="string"?C(n):n;c!==void 0&&(o.expiredAt=Date.now()+c),delete o.ttl}De(s,o),await this.saveMeta(s);const i={...s,status:"updated"};return await this.onUpdate(i),i})}async deleteBatch(e,r){const s=Date.now(),o=this.constructor.name.toLowerCase().replace("storage","");this.metrics.increment("storage.operations.batch.delete.count",1,{batch_size:e.length,storage:o});const i=[],n=[],c=e.map(async u=>{try{return{file:await this.delete({id:u},r),id:u,success:!0}}catch(m){const g=m instanceof Error?m.message:"Delete failed";return this.metrics.increment("storage.operations.delete.error.count",1,{error:g,storage:o}),{error:g,id:u,success:!1}}}),l=await Promise.allSettled(c);for(const u of l)u.status==="fulfilled"?u.value.success?i.push(u.value.file):n.push({error:u.value.error,id:u.value.id}):n.push({error:u.reason?.message||"Delete failed",id:""});const a=Date.now()-s;return this.metrics.timing("storage.operations.batch.delete.duration",a,{batch_size:e.length,storage:o}),this.metrics.gauge("storage.operations.batch.delete.success_count",i.length,{storage:o}),this.metrics.gauge("storage.operations.batch.delete.failed_count",n.length,{storage:o}),{failed:n,failedCount:n.length,successful:i,successfulCount:i.length}}async copyBatch(e){const r=Date.now(),s=this.constructor.name.toLowerCase().replace("storage","");this.metrics.increment("storage.operations.batch.copy.count",1,{batch_size:e.length,storage:s});const o=[],i=[],n=e.map(async({destination:a,options:u,source:m})=>{try{return{file:await this.copy(m,a,u),id:a,success:!0}}catch(g){const p=g instanceof Error?g.message:"Copy failed";return this.metrics.increment("storage.operations.copy.error.count",1,{error:p,storage:s}),{error:p,id:a,success:!1}}}),c=await Promise.allSettled(n);for(const a of c)a.status==="fulfilled"?a.value.success&&a.value.file?o.push(a.value.file):i.push({error:a.value.error||"Copy failed",id:a.value.id}):i.push({error:a.reason?.message||"Copy failed",id:""});const l=Date.now()-r;return this.metrics.timing("storage.operations.batch.copy.duration",l,{batch_size:e.length,storage:s}),this.metrics.gauge("storage.operations.batch.copy.success_count",o.length,{storage:s}),this.metrics.gauge("storage.operations.batch.copy.failed_count",i.length,{storage:s}),{failed:i,failedCount:i.length,successful:o,successfulCount:o.length}}async moveBatch(e){const r=Date.now(),s=this.constructor.name.toLowerCase().replace("storage","");this.metrics.increment("storage.operations.batch.move.count",1,{batch_size:e.length,storage:s});const o=[],i=[],n=e.map(async({destination:a,source:u})=>{try{return{file:await this.move(u,a),id:a,success:!0}}catch(m){const g=m instanceof Error?m.message:"Move failed";return this.metrics.increment("storage.operations.move.error.count",1,{error:g,storage:s}),{error:g,id:a,success:!1}}}),c=await Promise.allSettled(n);for(const a of c)a.status==="fulfilled"?a.value.success&&a.value.file?o.push(a.value.file):i.push({error:a.value.error||"Move failed",id:a.value.id}):i.push({error:a.reason?.message||"Move failed",id:a.reason?.id||""});const l=Date.now()-r;return this.metrics.timing("storage.operations.batch.move.duration",l,{batch_size:e.length,storage:s}),this.metrics.gauge("storage.operations.batch.move.success_count",o.length,{storage:s}),this.metrics.gauge("storage.operations.batch.move.failed_count",i.length,{storage:s}),{failed:i,failedCount:i.length,successful:o,successfulCount:o.length}}async lock(e){return this.locker.has(e)?b(v.FILE_LOCKED):this.config.concurrency&&typeof this.config.concurrency=="number"&&this.config.concurrency<=this.locker.size?b(v.STORAGE_BUSY):this.locker.lock(e)}async unlock(e,r){if(r===void 0){this.locker.delete(e);return}this.locker.unlock(e,r)}async withLock(e,r){const s=await this.lock(e);try{return await r()}finally{await this.unlock(e,s)}}isUnsupportedChecksum(e=""){return!!e&&!this.checksumTypes.includes(e)}startAutoPurge(e){if(e>=2147483647)throw new Error("“purgeInterval” must be less than 2147483647 ms");this.autoPurgeTimer=G(()=>{this.purge().catch(r=>this.logger?.error(r))},e),this.autoPurgeTimer.unref?.()}stopAutoPurge(){this.autoPurgeTimer&&(clearInterval(this.autoPurgeTimer),this.autoPurgeTimer=void 0)}async close(){this.stopAutoPurge()}updateTimestamps(e){e.createdAt??=new Date().toISOString();const r=C(this.expiration?.maxAge);return r&&!e.expiredAt&&(e.expiredAt=this.expiration?.rolling?Date.now()+r:+new Date(e.createdAt)+r),e}getRetryConfig(){}runOperation(e,r,s){let o;typeof e?.retries=="number"?o={maxRetries:e.retries}:e?.retries&&(o=e.retries);const i={...this.getRetryConfig(),...o};s?.replayable===!1&&(i.maxRetries=0);const n=[];this.genericConfig.defaultSignal&&n.push(this.genericConfig.defaultSignal),e?.signal&&n.push(e.signal);let c;n.length===1?[c]=n:n.length>1&&(c=AbortSignal.any(n));const l=typeof e?.timeout=="number"?e.timeout:this.genericConfig.defaultTimeout,a=typeof l=="number"&&l>0?l:void 0,u=i.shouldRetry;i.shouldRetry=g=>c?.aborted||g instanceof Error&&g.name==="AbortError"?!1:u?u(g):void 0;const m=g=>{if(g instanceof Error&&g.name==="AbortError")return g;const p=g instanceof Error&&g.message?g.message:"The operation was aborted",d=new Error(p,{cause:g});return d.name="AbortError",d};return te(async()=>{if(c?.aborted)throw m(c.reason);let g,p;if(a===void 0)p=c;else{const d=new AbortController;g=setTimeout(()=>{d.abort(new DOMException(`The operation timed out after ${a}ms`,"TimeoutError"))},a),p=c?AbortSignal.any([c,d.signal]):d.signal}try{return await r(p)}catch(d){throw p?.aborted?m(d):d}finally{g&&clearTimeout(g)}},i)}async instrumentOperation(e,r,s){const o=Date.now(),i={storage:this.constructor.name.toLowerCase().replace("storage",""),...s};try{this.metrics.increment(`storage.operations.${e}.count`,1,i);const n=await r(),c=Date.now()-o;return this.metrics.timing(`storage.operations.${e}.duration`,c,i),n&&typeof n=="object"&&"size"in n&&typeof n.size=="number"&&this.metrics.gauge("storage.files.size",n.size,{...i,operation:e}),n}catch(n){const c=Date.now()-o,l=n instanceof Error?n.message:"Unknown error";throw this.metrics.timing(`storage.operations.${e}.duration`,c,{...i,error:"true"}),this.metrics.increment(`storage.operations.${e}.error.count`,1,{...i,error:l}),n}}}export{V as B,xe as J,U as O,Ge as a,Te as b,C as c,ke as d,De as e,Ye as i};
|
|
1
|
+
import{Readable as Z}from"node:stream";import{setInterval as W}from"node:timers";import{inspect as K}from"node:util";import{G as H,v as R}from"./path-CxEa27Rz-DSh0_A5o.js";import q from"type-is";import J from"./NoOpMetrics-CWqe9gwp.js";import{N as Q}from"./cache-Cw3QjoVN.js";import{ErrorMap as x,throwErrorCode as b,ERRORS as v}from"./ERRORS-olUcTqo2.js";import{randomUUID as X}from"node:crypto";import{LRUCache as ee}from"lru-cache";import{retry as te}from"./createRetryWrapper-BM8PL0cI.js";import{i as re}from"./is-expired-CZlgTFFz.js";const se=new RegExp("^(?<value>-?\\d+(?:[\\p{Zs}'’.,]\\d+)*)\\p{Zs}*(?<type>[a-z]+)?$","iu"),oe={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},ie=["metric","iec","metric_octet","iec_octet"],ne=1024,ae=t=>t==="iec"||t==="iec_octet",D=new Map,ce=t=>{let e=D.get(t);if(e===void 0){const r=new Intl.NumberFormat(t);e={decimalSeparator:r.format(1.1).replaceAll(new RegExp("\\p{Number}","gu"),""),thousandSeparator:r.format(11111).replaceAll(new RegExp("\\p{Number}","gu"),"")},D.set(t,e)}return e},le=(t,e)=>{const{decimalSeparator:r,thousandSeparator:s}=ce(e),o=t.replaceAll(/[\p{Zs}'’]/gu,"");return Number.parseFloat(o.replaceAll(new RegExp(`\\${s}`,"g"),"").replace(new RegExp(`\\${r}`),"."))},ue=t=>{switch(t){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},ge=(t,e)=>{for(const r of[e,...ie.filter(s=>s!==e)]){const s=oe[r].findIndex(o=>o.short.toUpperCase()===t||o.long.toUpperCase()===t);if(s!==-1)return{level:s,system:r}}},P=(t,e)=>{const r={base:2,locale:"en-US",units:"metric",...e};if(typeof t!="string"||t.length===0)throw new TypeError("Value is not a string or is empty.");if(t.length>100)throw new TypeError("Value exceeds the maximum length of 100 characters.");const s=se.exec(t)?.groups;if(!s)return Number.NaN;const o=le(s.value,r.locale),a=ge((s.type??"Bytes").toUpperCase(),r.units);if(a===void 0)return Number.NaN;const c=ue(r.base),i=ae(a.system)?ne:c;return o*i**a.level},pe=(t,e,r,s,o,a,c,i,l,n,u,p,g,h)=>{const d={d:s,h:o,m:a,mo:e,ms:i,s:c,w:r,y:t};return d.future=l,d.past=n,d.decimal=u,p!==void 0&&(d.unitMap=p),d.groupSeparator=g,d.placeholderSeparator=h,d},I={d:"d",day:"d",days:"d",h:"h",hour:"h",hours:"h",hr:"h",hrs:"h",m:"m",millisecond:"ms",milliseconds:"ms",min:"m",mins:"m",minute:"m",minutes:"m",mo:"mo",month:"mo",months:"mo",ms:"ms",s:"s",sec:"s",second:"s",seconds:"s",secs:"s",w:"w",week:"w",weeks:"w",y:"y",year:"y",years:"y",yr:"y",yrs:"y"},de=pe(t=>`year${t===1?"":"s"}`,t=>`month${t===1?"":"s"}`,t=>`week${t===1?"":"s"}`,t=>`day${t===1?"":"s"}`,t=>`hour${t===1?"":"s"}`,t=>`minute${t===1?"":"s"}`,t=>`second${t===1?"":"s"}`,t=>`millisecond${t===1?"":"s"}`,"in %s","%s ago",".",I,",","_"),U=new WeakSet,me=t=>{if(U.has(t))return;const e=["y","mo","w","d","h","m","s","ms"];for(const s of e)if(!Object.hasOwn(t,s))throw new TypeError(`Missing required property: ${s}`);if(t.future!==void 0&&typeof t.future!="string")throw new TypeError("Properties future and past must be of type string");if(t.past!==void 0&&typeof t.past!="string")throw new TypeError("Properties future and past must be of type string");const r=["y","mo","w","d","h","m","s","ms"];for(const s of r)if(typeof t[s]!="string"&&typeof t[s]!="function")throw new TypeError(`Property ${s} must be of type string or function`);if(t.decimal&&typeof t.decimal!="string")throw new TypeError("Property decimal must be of type string");if(t.delimiter&&typeof t.delimiter!="string")throw new TypeError("Property delimiter must be of type string");if(t._digitReplacements&&!Array.isArray(t._digitReplacements))throw new TypeError("Property _digitReplacements must be an array");if(t._numberFirst&&typeof t._numberFirst!="boolean")throw new TypeError("Property _numberFirst must be of type boolean");if(t.unitMap&&typeof t.unitMap!="object")throw new TypeError("Property unitMap must be an object");if(t.unitMap&&Object.values(t.unitMap).some(s=>typeof s!="string"))throw new TypeError("All values in unitMap must be of type string");U.add(t)},w={d:864e5,h:36e5,m:6e4,mo:2629746e3,ms:1,s:1e3,w:6048e5,y:31556952e3},T=/[-/\\^$*+?.()|[\]{}]/g,k=new WeakMap,F=new WeakMap,he=t=>{let e=F.get(t);if(e===void 0){const r=t.decimal??".",s=t.groupSeparator??",",o=t.placeholderSeparator??"_",a=r.replaceAll(T,String.raw`\$&`),c=s.replaceAll(T,String.raw`\$&`),i=o.replaceAll(T,String.raw`\$&`);e={decimalRewrite:r==="."?void 0:new RegExp(String.raw`(\d)${a}(\d)`,"g"),groupStrip:new RegExp(String.raw`(\d)[${i}${c}](\d)`,"g")},F.set(t,e)}return e},E=t=>String.raw`(?:(\d+(?:[.,]\d+)?)${t})?`,fe=new RegExp(`^P${E("Y")}${E("M")}${E("W")}${E("D")}(?:T${E("H")}${E("M")}${E("S")})?$`,"i"),ye=/^(?:\s*,)?\s*$/,M=new Map,we=64,be=t=>{const e=t===void 0?"":t.trim();if(e.length===0)return ye;let r=M.get(e);if(r===void 0){M.size>=we&&M.clear();const s=e.replaceAll(T,String.raw`\$&`);r=new RegExp(String.raw`^(?:\s*,)?\s*(?:${s}\s*)?$`,"i"),M.set(e,r)}return r},ve=/^(?:(\d+):)?(?:(\d+):)?(\d+)$/,Ee=/^[+-]?\d+(?:\.\d+)?$/,xe=/^[-+]/,$e=(t,e)=>{if(typeof t!="string"||t.length===0)return;const{conjunction:r,defaultUnit:s="ms",language:o=de}={};me(o);const{decimalRewrite:a,groupStrip:c}=he(o),i=o.unitMap??I;let l=t.replaceAll(c,"$1$2");if(a!==void 0&&(l=l.replaceAll(a,"$1.$2")),Ee.test(l.trim())){const f=Number.parseFloat(l.trim());if(!Number.isNaN(f)){const m=i[s];if(m!==void 0)return f*w[m]}return}const n=fe.exec(t);if(n){const f=[[1,w.y],[2,w.mo],[3,w.w],[4,w.d],[5,w.h],[6,w.m],[7,w.s]];let m=0,y=!1;for(const[N,_]of f){const $=n[N];$!==void 0&&(y=!0,m+=Number.parseFloat($.replace(",","."))*_)}if(y)return m}const u=ve.exec(t);if(u){let f=0,m=0;u[2]!==void 0?(f=Number.parseInt(u[1]??"0",10),m=Number.parseInt(u[2],10)):u[1]!==void 0&&(m=Number.parseInt(u[1],10));const y=Number.parseInt(u[3]??"0",10);return f*36e5+m*6e4+y*1e3}let p=k.get(i);if(p===void 0){const f=Object.keys(i).toSorted((m,y)=>y.length-m.length).map(m=>m.replaceAll(T,String.raw`\$&`)).join("|");p=new RegExp(String.raw`(-?\d*\.?\d+)\s*(${f})`,"gi"),k.set(i,p)}const g=be(r);let h=0,d,S=!1,z=-1,A=0;for(p.lastIndex=0;(d=p.exec(l))!==null;){const f=d[1],m=d[2];if(!f||!m)continue;const y=f.trim(),N=y.startsWith("-")?-1:1,_=y.replace(xe,""),$=Number.parseFloat(_),O=i[m.toLowerCase()];if(O===void 0)continue;if(!S)z=d.index;else if(!g.test(l.slice(A,d.index)))return;S=!0,A=p.lastIndex;const Y=w[O];if(Number.isNaN($))return;h+=N*$*Y}const j=l.slice(0,z).trim(),G=l.slice(A).trim();if(!(S&&(j.length>0||G.length>0))&&S)return h};class Te extends ee{constructor(e){super({ttl:3e4,ttlAutopurge:!0,...e})}lock(e){if(this.get(e)!==void 0)throw new Error(`${e} is locked`);const r=X();return this.set(e,r),r}unlock(e,r){return this.get(e)!==r?!1:this.delete(e)}}const C=t=>{if(t===Number(t))return t;if(!t)return;const e=$e(t);if(e!==void 0)return e};class Se extends Error{code;statusCode;body;headers;name="ValidationError";constructor(e,r,s,o){const a=typeof s=="string"?s:s?.message||"Validation error";super(a),this.code=e,this.statusCode=r,this.body=s,this.headers=o}}const Me=t=>t&&t[0].toUpperCase()+t.slice(1),Ce=t=>{if(!Array.isArray(t))return t;const[e,r,s]=t;return{body:r,headers:s,statusCode:e}};class Ae{constructor(e="ValidationError"){this.prefix=e}prefix;validators={};add(e){Object.entries(e).forEach(([r,s])=>{const o=`${this.prefix}${Me(r)}`;if(this.validators[o]={...this.validators[o],...s},typeof this.validators[o].isValid!="function")throw new TypeError('Validation config "isValid" is missing, or it is not a function!')})}async verify(e){for(const[r,s]of Object.entries(this.validators))if(!await s.isValid(e)){const a=s.response||(r in x?x[r]:x.UnknownError),c=Ce(a),{body:i,headers:l,message:n,statusCode:u}=c;throw new Se(r,u,i||n,l)}}}const Ze=t=>t.name==="ValidationError",Ne=t=>{if(typeof t.name=="string")return t.name;if(typeof t.title=="string")return t.title;if(typeof t.originalName=="string")return t.originalName;if(typeof t.filename=="string")return t.filename},V=(t,e)=>{const r={...t};return Object.keys(e).forEach(s=>{const o=e[s];if(o!==null&&typeof o=="object"&&!Array.isArray(o)){const a=r[s],c=a&&typeof a=="object"&&!Array.isArray(a)?a:{};r[s]=V(c,o)}else r[s]=o}),r},_e=(t,e)=>{const r=V(t,e);Object.assign(t,r),t.originalName=Ne(t.metadata)||t.originalName},Re=/(secret|password|passwd|pwd|token|api[_-]?key|credential|authorization|sas|signature|sessiontoken|connectionstring)/i,B=t=>{const e={};for(const[r,s]of Object.entries(t))typeof s=="string"&&Re.test(r)?e[r]="[REDACTED]":s&&typeof s=="object"&&!Array.isArray(s)&&s.constructor===Object?e[r]=B(s):e[r]=s;return e},ze={allowMIME:["*/*"],filename:({id:t})=>t,maxMetadataSize:"8MB",maxUploadSize:"5TB",onComplete:()=>{},onCreate:()=>{},onDelete:()=>{},onError:()=>{},onUpdate:()=>{},useRelativeLocation:!1,validation:{}},Oe=t=>!t||t.length<3||t.length>255||R(t)?!1:!(t.toUpperCase().includes("../")||t.includes("\0")),We=t=>{if(!t||t.length<3||t.length>255||R(t))return!1;const e=t.toUpperCase();return!['"',"*",":","<",">","?","\\","|","../","\0"].some(s=>e.includes(s))};class L{onCreate;onUpdate;onComplete;onDelete;onError;isReady=!0;errorResponses={};cache;logger;metrics;genericConfig;maxMetadataSize;checksumTypes=[];supportsRange=!1;supportsMetadata=!0;supportsCacheControl=!1;supportsDelimiter=!1;reportsUploadProgress=!1;maxUploadSize;expiration;locker;namingFunction;validation=new Ae;assetFolder=void 0;concurrency;autoPurgeTimer;constructor(e){const r={...ze,...e};this.onCreate=r.onCreate,this.onUpdate=r.onUpdate,this.onComplete=r.onComplete,this.onDelete=r.onDelete,this.onError=r.onError,this.namingFunction=r.filename,this.maxUploadSize=typeof r.maxUploadSize=="string"?P(r.maxUploadSize):r.maxUploadSize,this.maxMetadataSize=typeof r.maxMetadataSize=="string"?P(r.maxMetadataSize):r.maxMetadataSize,this.expiration=r.expiration,this.genericConfig=r,r.assetFolder!==void 0&&(this.assetFolder=H(r.assetFolder)),this.locker=new Te({max:1e3,ttl:3e4,ttlAutopurge:!0}),this.cache=r.cache??new Q,this.logger=r.logger,this.metrics=r.metrics??new J,this.logger?.debug(`${this.constructor.name} config: ${K(B({...e,logger:this.logger.constructor}))}`);const s=C(r.expiration?.purgeInterval);s&&this.startAutoPurge(s);const o={isValid(l){if(l.size===void 0)return!0;const n=l.size;if(n==null)return!1;const u=typeof n=="number"?n:Number(n);if(Number.isNaN(u)||u<0)return!1;const p=typeof this.value=="number"?this.value:Number(this.value);return!Number.isNaN(p)&&u<=p},response:x.RequestEntityTooLarge,value:this.maxUploadSize},a={isValid(l){return!!q.is(l.contentType,this.value)},response:x.UnsupportedMediaType,value:r.allowMIME},c=r.fileNameValidation??Oe,i={isValid(l){return c(l.name)},response:x.InvalidFileName};this.validation.add({filename:i,mime:a,size:o}),this.validation.add({...r.validation})}get raw(){}async getReadUrl(e,r){return b(v.METHOD_NOT_ALLOWED,`${this.constructor.name} does not implement getReadUrl()`)}async getUploadUrl(e,r){return b(v.METHOD_NOT_ALLOWED,`${this.constructor.name} does not implement getUploadUrl()`)}get tusExtension(){const e=["creation","creation-with-upload","termination","checksum","creation-defer-length","concatenation"];return this.expiration&&e.push("expiration"),e}async validate(e){await this.validation.verify(e)}async exists(e,r){return this.instrumentOperation("exists",async()=>{try{return await this.getMeta(e.id,r),!0}catch{return!1}})}normalizeError(e){const r={code:e.name,message:e.message,name:e.name,statusCode:500};return{...r,message:`[${this.constructor.name}] ${r.message}`}}get config(){return this.genericConfig}async saveMeta(e){return L.assertSafeId(e.id),this.updateTimestamps(e),this.cache.set(e.id,e),this.meta.save(e.id,e)}static assertSafeId(e){(!e||typeof e!="string"||e.includes("\0")||e.includes("../")||e.includes("..\\")||e===".."||e.startsWith("../")||e.startsWith("..\\")||R(e)||/^[A-Z]:[/\\]/i.test(e))&&b(v.INVALID_FILE_NAME,`Invalid file id: "${e}"`)}async deleteMeta(e){return this.cache.delete(e),this.meta.delete(e)}async getMeta(e,r){try{const s=await this.meta.get(e);return this.cache.set(s.id,s),{...s}}catch(s){const o=this.normalizeError(s instanceof Error?s:new Error(String(s)));return await this.onError(o),b(v.FILE_NOT_FOUND)}}async checkIfExpired(e){return re(e)?(this.delete(e).catch(()=>{}),this.deleteMeta(e.id).catch(()=>{}),b(v.GONE)):e}async purge(e){return this.instrumentOperation("purge",async()=>{const r=C(e||this.expiration?.maxAge),s={items:[],maxAgeMs:r};if(r){const o=Date.now()-r,c=(await this.list()).filter(i=>Number(new Date(this.expiration?.rolling&&i.modifiedAt||i.createdAt))<o);for await(const{id:i,...l}of c)try{const n=await this.delete({id:i});s.items.push({...n,...l})}catch(n){this.logger?.warn(`Failed to delete file ${i} during purge: ${n instanceof Error?n.message:String(n)}`)}s.items.length>0&&(this.logger?.info(`Purge: removed ${s.items.length} uploads`),this.metrics.gauge("storage.operations.purge.items_count",s.items.length,{storage:this.constructor.name.toLowerCase().replace("storage","")}))}return s})}async getStream({id:e},r){return this.instrumentOperation("getStream",async()=>{const s=await this.get({id:e},r),o=Z.from(s.content);return{headers:{"Content-Length":String(s.size),"Content-Type":s.contentType,...s.ETag&&{ETag:s.ETag},...s.modifiedAt&&{"Last-Modified":s.modifiedAt.toString()}},size:typeof s.size=="number"?s.size:void 0,stream:o}})}async list(e=1e3,r){return this.instrumentOperation("list",async()=>{throw new Error("Not implemented")})}async listDirectory(e){return b(v.METHOD_NOT_ALLOWED,`${this.constructor.name} does not implement listDirectory()`)}async update({id:e},r){return this.instrumentOperation("update",async()=>{const s=await this.getMeta(e),o={...r};if("ttl"in o&&o.ttl!==void 0){const c=o.ttl,i=typeof c=="string"?C(c):c;i!==void 0&&(o.expiredAt=Date.now()+i),delete o.ttl}_e(s,o),await this.saveMeta(s);const a={...s,status:"updated"};return await this.onUpdate(a),a})}async deleteBatch(e,r){const s=Date.now(),o=this.constructor.name.toLowerCase().replace("storage","");this.metrics.increment("storage.operations.batch.delete.count",1,{batch_size:e.length,storage:o});const a=[],c=[],i=e.map(async u=>{try{return{file:await this.delete({id:u},r),id:u,success:!0}}catch(p){const g=p instanceof Error?p.message:"Delete failed";return this.metrics.increment("storage.operations.delete.error.count",1,{error:g,storage:o}),{error:g,id:u,success:!1}}}),l=await Promise.allSettled(i);for(const u of l)u.status==="fulfilled"?u.value.success?a.push(u.value.file):c.push({error:u.value.error,id:u.value.id}):c.push({error:u.reason?.message||"Delete failed",id:""});const n=Date.now()-s;return this.metrics.timing("storage.operations.batch.delete.duration",n,{batch_size:e.length,storage:o}),this.metrics.gauge("storage.operations.batch.delete.success_count",a.length,{storage:o}),this.metrics.gauge("storage.operations.batch.delete.failed_count",c.length,{storage:o}),{failed:c,failedCount:c.length,successful:a,successfulCount:a.length}}async copyBatch(e){const r=Date.now(),s=this.constructor.name.toLowerCase().replace("storage","");this.metrics.increment("storage.operations.batch.copy.count",1,{batch_size:e.length,storage:s});const o=[],a=[],c=e.map(async({destination:n,options:u,source:p})=>{try{return{file:await this.copy(p,n,u),id:n,success:!0}}catch(g){const h=g instanceof Error?g.message:"Copy failed";return this.metrics.increment("storage.operations.copy.error.count",1,{error:h,storage:s}),{error:h,id:n,success:!1}}}),i=await Promise.allSettled(c);for(const n of i)n.status==="fulfilled"?n.value.success&&n.value.file?o.push(n.value.file):a.push({error:n.value.error||"Copy failed",id:n.value.id}):a.push({error:n.reason?.message||"Copy failed",id:""});const l=Date.now()-r;return this.metrics.timing("storage.operations.batch.copy.duration",l,{batch_size:e.length,storage:s}),this.metrics.gauge("storage.operations.batch.copy.success_count",o.length,{storage:s}),this.metrics.gauge("storage.operations.batch.copy.failed_count",a.length,{storage:s}),{failed:a,failedCount:a.length,successful:o,successfulCount:o.length}}async moveBatch(e){const r=Date.now(),s=this.constructor.name.toLowerCase().replace("storage","");this.metrics.increment("storage.operations.batch.move.count",1,{batch_size:e.length,storage:s});const o=[],a=[],c=e.map(async({destination:n,source:u})=>{try{return{file:await this.move(u,n),id:n,success:!0}}catch(p){const g=p instanceof Error?p.message:"Move failed";return this.metrics.increment("storage.operations.move.error.count",1,{error:g,storage:s}),{error:g,id:n,success:!1}}}),i=await Promise.allSettled(c);for(const n of i)n.status==="fulfilled"?n.value.success&&n.value.file?o.push(n.value.file):a.push({error:n.value.error||"Move failed",id:n.value.id}):a.push({error:n.reason?.message||"Move failed",id:n.reason?.id||""});const l=Date.now()-r;return this.metrics.timing("storage.operations.batch.move.duration",l,{batch_size:e.length,storage:s}),this.metrics.gauge("storage.operations.batch.move.success_count",o.length,{storage:s}),this.metrics.gauge("storage.operations.batch.move.failed_count",a.length,{storage:s}),{failed:a,failedCount:a.length,successful:o,successfulCount:o.length}}async lock(e){return this.locker.has(e)?b(v.FILE_LOCKED):this.config.concurrency&&typeof this.config.concurrency=="number"&&this.config.concurrency<=this.locker.size?b(v.STORAGE_BUSY):this.locker.lock(e)}async unlock(e,r){if(r===void 0){this.locker.delete(e);return}this.locker.unlock(e,r)}async withLock(e,r){const s=await this.lock(e);try{return await r()}finally{await this.unlock(e,s)}}isUnsupportedChecksum(e=""){return!!e&&!this.checksumTypes.includes(e)}startAutoPurge(e){if(e>=2147483647)throw new Error("“purgeInterval” must be less than 2147483647 ms");this.autoPurgeTimer=W(()=>{this.purge().catch(r=>this.logger?.error(r))},e),this.autoPurgeTimer.unref?.()}stopAutoPurge(){this.autoPurgeTimer&&(clearInterval(this.autoPurgeTimer),this.autoPurgeTimer=void 0)}async close(){this.stopAutoPurge()}updateTimestamps(e){e.createdAt??=new Date().toISOString();const r=C(this.expiration?.maxAge);return r&&!e.expiredAt&&(e.expiredAt=this.expiration?.rolling?Date.now()+r:+new Date(e.createdAt)+r),e}getRetryConfig(){}runOperation(e,r,s){let o;typeof e?.retries=="number"?o={maxRetries:e.retries}:e?.retries&&(o=e.retries);const a={...this.getRetryConfig(),...o};s?.replayable===!1&&(a.maxRetries=0);const c=[];this.genericConfig.defaultSignal&&c.push(this.genericConfig.defaultSignal),e?.signal&&c.push(e.signal);let i;c.length===1?[i]=c:c.length>1&&(i=AbortSignal.any(c));const l=typeof e?.timeout=="number"?e.timeout:this.genericConfig.defaultTimeout,n=typeof l=="number"&&l>0?l:void 0,u=a.shouldRetry;a.shouldRetry=g=>i?.aborted||g instanceof Error&&g.name==="AbortError"?!1:u?u(g):void 0;const p=g=>{if(g instanceof Error&&g.name==="AbortError")return g;const h=g instanceof Error&&g.message?g.message:"The operation was aborted",d=new Error(h,{cause:g});return d.name="AbortError",d};return te(async()=>{if(i?.aborted)throw p(i.reason);let g,h;if(n===void 0)h=i;else{const d=new AbortController;g=setTimeout(()=>{d.abort(new DOMException(`The operation timed out after ${n}ms`,"TimeoutError"))},n),h=i?AbortSignal.any([i,d.signal]):d.signal}try{return await r(h)}catch(d){throw h?.aborted?p(d):d}finally{g&&clearTimeout(g)}},a)}async instrumentOperation(e,r,s){const o=Date.now(),c={storage:this.constructor.name.toLowerCase().replace("storage",""),...s};try{this.metrics.increment(`storage.operations.${e}.count`,1,c);const i=await r(),l=Date.now()-o;return this.metrics.timing(`storage.operations.${e}.duration`,l,c),i&&typeof i=="object"&&"size"in i&&typeof i.size=="number"&&this.metrics.gauge("storage.files.size",i.size,{...c,operation:e}),i}catch(i){const l=Date.now()-o,n=i instanceof Error?i.message:"Unknown error";throw this.metrics.timing(`storage.operations.${e}.duration`,l,{...c,error:"true"}),this.metrics.increment(`storage.operations.${e}.error.count`,1,{...c,error:n}),i}}}export{L as B,Se as V,We as a,$e as b,Oe as d,Ze as i,C as t,_e as u,P as z};
|
|
@@ -1183,4 +1183,4 @@ declare abstract class BaseStorage<TFile extends File = File, TFileReturn extend
|
|
|
1183
1183
|
*/
|
|
1184
1184
|
protected instrumentOperation<T>(operation: string, function_: () => Promise<T>, attributes?: Record<string, string | number>): Promise<T>;
|
|
1185
1185
|
}
|
|
1186
|
-
export { retry as $, OnUpdate as A, BaseStorage as B, Cache as C, DiskStorageOptions as D, ErrorResponses as E, File as F, RangeChecksum as G,
|
|
1186
|
+
export { retry as $, OnUpdate as A, BaseStorage as B, Cache as C, DiskStorageOptions as D, ErrorResponses as E, File as F, RangeChecksum as G, Header as H, IncomingMessageWithBody as I, RangeHasher as J, ResponseBody as K, LocalMetaStorageOptions as L, MetaStorage as M, ResponseTuple as N, OperationOptions as O, PurgeList as P, ValidationError as Q, RetryConfig as R, ValidatorConfig as S, defaultCloudStorageFileNameValidation as T, UploadFile as U, Validation as V, defaultFilesystemFileNameValidation as W, extractHttpStatus as X, isRetryableError as Y, isUploadError as Z, mapStatusToErrorCode as _, UploadError as a, throwErrorCode as a0, wrapStorageError as a1, UploadEventType as b, createRetryWrapper as c, FileInit as d, FilePart as e, FileQuery as f, FileReturn as g, ResponseBodyType as h, BaseStorageOptions as i, UploadResponse as j, Metrics as k, BatchOperationResponse as l, BatchOperationResult as m, DiskStorageWithChecksumOptions as n, ERRORS as o, ErrorMap as p, ExpirationOptions as q, Headers as r, HttpError as s, HttpErrorBody as t, MetaStorageOptions as u, Metadata as v, OnComplete as w, OnCreate as x, OnDelete as y, OnError as z };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=e=>{const s=e?.accessKeyId??process.env.AWS_ACCESS_KEY_ID??process.env.STORJ_ACCESS_KEY_ID??process.env.STORJ_ACCESS_KEY,c=e?.endpoint??process.env.STORJ_ENDPOINT,o=e?.secretAccessKey??process.env.AWS_SECRET_ACCESS_KEY??process.env.STORJ_SECRET_ACCESS_KEY??process.env.STORJ_SECRET_KEY;if(!s||!o)throw new Error("Missing required parameters for Storj client.");return{credentials:{accessKeyId:s,secretAccessKey:o},endpoint:c??"https://gateway.storjshare.io",forcePathStyle:!1,region:"global"}};export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as B,r as L,c as O,o as N}from"./internal-Zb__DDsV.js";const _=async(g,h,U={})=>{const{concurrency:D=B,limit:A,onProgress:k,overwrite:M=!1,prefix:m,signal:u,stopOnError:o=!1,transformKey:E}=U,y=[],l=[],f=[];let p=!1,i=0;const w=t=>{if(k)try{k(t)}catch{}},b=g.listAll({...m!==void 0&&{prefix:m},...A!==void 0&&{limit:A}}),v=async t=>{if(p||u?.aborted)return;const P=E?E(t):t;try{if(!M&&await h.exists(P,{signal:u})){l.push(t),i+=1,w({done:i,key:t,status:"skipped"});return}const c=await g.download(t,{signal:u});await h.upload(P,c.body,{...c.contentType&&{contentType:c.contentType},...c.metadata&&{metadata:c.metadata},signal:u}),y.push(t),i+=1,w({done:i,key:t,status:"transferred"})}catch(c){const T=O(t,c);if(f.push(T),i+=1,w({done:i,error:T.error,key:t,status:"errored"}),o)throw p=!0,T.error}};if(o){try{for await(const t of b){if(p||u?.aborted)break;try{await v(t.key)}catch{break}}}finally{await b.return?.()}return f.length>0?{errors:f,skipped:l,transferred:y}:{skipped:l,transferred:y}}const s=Math.max(1,D),x=async()=>{for(;!p&&!u?.aborted;){const t=await b.next();if(t.done)return;await v(t.value.key)}};try{await Promise.all(Array.from({length:s},()=>x()))}finally{await b.return?.()}return f.length>0?{errors:f,skipped:l,transferred:y}:{skipped:l,transferred:y}},z=async(g,h,U={})=>{const{concurrency:D=B,dryRun:A=!1,limit:k,onProgress:M,prefix:m,prune:u=!1,signal:o,stopOnError:E=!1,transformKey:y}=U,l=[],f=[],p=[],i=[],w=[],b=new Set;let v=!1,s=0;const x=a=>{if(M)try{M(a)}catch{}},t=g.listAll({...m!==void 0&&{prefix:m},...k!==void 0&&{limit:k}}),P=async a=>{if(v||o?.aborted)return;const r=a.key,C=y?y(r):r;b.add(C);try{let e;try{e=await h.head(C,{signal:o})}catch{e=void 0}if(e){let n=a;if(a.size===void 0&&a.etag===void 0)try{n=await g.head(r,{signal:o})}catch{}if(N(n,e)){p.push(r),s+=1,x({done:s,key:r,status:"unchanged"});return}}const d=e!==void 0;if(!A){const n=await g.download(r,{signal:o});await h.upload(C,n.body,{...n.contentType&&{contentType:n.contentType},...n.metadata&&{metadata:n.metadata},signal:o})}d?f.push(r):l.push(r),s+=1,x({done:s,key:r,status:d?"updated":"uploaded"})}catch(e){const d=O(r,e);if(w.push(d),s+=1,x({done:s,error:d.error,key:r,status:"errored"}),E)throw v=!0,d.error}},c=Math.max(1,D),T=async()=>{for(;!v&&!o?.aborted;){const a=await t.next();if(a.done)return;await P(a.value)}};try{await Promise.all(Array.from({length:c},()=>T()))}finally{await t.return?.()}if(u&&!v&&!o?.aborted){const a=[],r=h.listAll({...m!==void 0&&{prefix:m},...k!==void 0&&{limit:k}});try{for await(const e of r)b.has(e.key)||a.push(e.key)}finally{await r.return?.()}const C=await L(a,async e=>(A||await h.delete(e,{signal:o}),e),{concurrency:c,signal:o,stopOnError:E});for(const[e,d]of C.entries()){const n=a[e];if(d)if(d.status==="fulfilled")i.push(n),s+=1,x({done:s,key:n,status:"deleted"});else{const R=O(n,d.reason);w.push(R),s+=1,x({done:s,error:R.error,key:n,status:"errored"})}}}return w.length>0?{deleted:i,errors:w,unchanged:p,updated:f,uploaded:l}:{deleted:i,unchanged:p,updated:f,uploaded:l}};export{z as sync,_ as transfer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const E=e=>{const c=e?.accessKeyId??process.env.AWS_ACCESS_KEY_ID??process.env.TENCENT_SECRET_ID,o=e?.endpoint??process.env.TENCENT_ENDPOINT,s=e?.region??process.env.TENCENT_REGION,n=e?.secretAccessKey??process.env.AWS_SECRET_ACCESS_KEY??process.env.TENCENT_SECRET_KEY;if(!s||!c||!n)throw new Error("Missing required parameters for Tencent Cloud COS client.");return{credentials:{accessKeyId:c,secretAccessKey:n},endpoint:o??`https://cos.${s}.myqcloud.com`,forcePathStyle:!1,region:s}};export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=e=>{const s=e?.accessKeyId??process.env.AWS_ACCESS_KEY_ID??process.env.TIGRIS_ACCESS_KEY_ID??process.env.TIGRIS_ACCESS_KEY,n=e?.endpoint??process.env.TIGRIS_ENDPOINT,c=e?.secretAccessKey??process.env.AWS_SECRET_ACCESS_KEY??process.env.TIGRIS_SECRET_ACCESS_KEY??process.env.TIGRIS_SECRET_KEY;if(!s||!c)throw new Error("Missing required parameters for Tigris client.");return{credentials:{accessKeyId:s,secretAccessKey:c},endpoint:n??"https://t3.storage.dev",forcePathStyle:!1,region:"auto"}};export{r as default};
|
package/dist/packem_shared/{transformOpenApiSpec-CIEAgpBD.js → transformOpenApiSpec-Bcnw9LVy.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHash as n}from"node:crypto";import{createPaginationMetaSchemaObject as a,createPaginationSchemaObject as i}from"@visulima/pagination";import{sharedFileMetaSchemaObject as o,sharedErrorSchemaObject as s,sharedFileMetaExampleObject as p}from"./sharedErrorSchemaObject-YN65aAKj.js";const l=(e="/",t=["Transform"])=>{const r=n("sha256").update(e).digest("base64");return{components:{examples:p,parameters:{Affine:{description:"Apply affine transformation",in:"query",name:"affine",schema:{type:"boolean"}},Angle:{description:"Rotation angle in degrees. Note: angles other than 90°, 180°, and 270° require interpolation and may affect quality",in:"query",name:"angle",schema:{type:"number"}},Background:{description:"Background color for rotation (hex, rgb, or color name)",in:"query",name:"background",schema:{type:"string"}},Bitrate:{description:"Target bitrate in bits per second",in:"query",name:"bitrate",schema:{minimum:1,type:"integer"}},Blur:{description:"Apply blur effect",in:"query",name:"blur",schema:{type:"boolean"}},Brightness:{description:"Brightness multiplier for modulation",in:"query",name:"brightness",schema:{type:"number"}},Clahe:{description:"Apply CLAHE (Contrast Limited Adaptive Histogram Equalization)",in:"query",name:"clahe",schema:{type:"boolean"}},Codec:{description:"Video or audio codec",in:"query",name:"codec",schema:{enum:["avc","hevc","vp8","vp9","av1","aac","opus","mp3","vorbis","flac"],type:"string"}},Colourspace:{description:"Convert colourspace",in:"query",name:"colourspace",schema:{enum:["srgb","rgb","cmyk","lab","b-w"],type:"string"}},CropHeight:{description:"Crop area height",in:"query",name:"cropHeight",schema:{minimum:1,type:"integer"}},CropWidth:{description:"Crop area width",in:"query",name:"cropWidth",schema:{minimum:1,type:"integer"}},Dilate:{description:"Apply dilation",in:"query",name:"dilate",schema:{type:"boolean"}},EnsureAlpha:{description:"Ensure alpha channel",in:"query",name:"ensureAlpha",schema:{type:"boolean"}},Erode:{description:"Apply erosion",in:"query",name:"erode",schema:{type:"boolean"}},FastShrinkOnLoad:{description:"Fast shrink on load for large images",in:"query",name:"fastShrinkOnLoad",schema:{type:"boolean"}},FileID:{description:"File identifier",in:"path",name:"id",required:!0,schema:{type:"string"}},Fit:{description:"Resize fit mode",in:"query",name:"fit",schema:{enum:["cover","contain","fill","inside","outside"],type:"string"}},Flatten:{description:"Flatten alpha channel",in:"query",name:"flatten",schema:{type:"boolean"}},Flip:{description:"Flip image vertically",in:"query",name:"flip",schema:{type:"boolean"}},Flop:{description:"Flop image horizontally",in:"query",name:"flop",schema:{type:"boolean"}},Format:{description:"Output format for the transformed media",in:"query",name:"format",schema:{enum:["jpeg","png","webp","avif","tiff","gif","mp4","webm","mkv","ogg","mp3","wav","aac","flac"],type:"string"}},FrameRate:{description:"Video frame rate in Hz",in:"query",name:"frameRate",schema:{minimum:1,type:"number"}},Gamma:{description:"Apply gamma correction",in:"query",name:"gamma",schema:{type:"boolean"}},Greyscale:{description:"Convert to greyscale",in:"query",name:"greyscale",schema:{type:"boolean"}},Height:{description:"Desired height in pixels",in:"query",name:"height",schema:{minimum:1,type:"integer"}},Hue:{description:"Hue rotation in degrees for modulation",in:"query",name:"hue",schema:{type:"integer"}},Kernel:{description:"Resize kernel algorithm",in:"query",name:"kernel",schema:{enum:["nearest","cubic","mitchell","lanczos2","lanczos3"],type:"string"}},KeyFrameInterval:{description:"Video key frame interval in seconds",in:"query",name:"keyFrameInterval",schema:{minimum:.1,type:"number"}},Left:{description:"Crop area left offset",in:"query",name:"left",schema:{minimum:0,type:"integer"}},Lightness:{description:"Lightness adjustment for modulation",in:"query",name:"lightness",schema:{type:"integer"}},Median:{description:"Apply median filter with specified size",in:"query",name:"median",schema:{minimum:1,type:"integer"}},Modulate:{description:"Apply modulation effects",in:"query",name:"modulate",schema:{type:"boolean"}},Negate:{description:"Negate (invert) the image",in:"query",name:"negate",schema:{type:"boolean"}},Normalise:{description:"Normalise the image",in:"query",name:"normalise",schema:{type:"boolean"}},NumberOfChannels:{description:"Audio channel count",in:"query",name:"numberOfChannels",schema:{enum:[1,2,3,4,5,6,7,8],type:"integer"}},PipelineColourspace:{description:"Set pipeline colourspace",in:"query",name:"pipelineColourspace",schema:{type:"boolean"}},Position:{description:"Position for cover/contain fits",in:"query",name:"position",schema:{oneOf:[{enum:["top","right","bottom","left","center"],type:"string"},{minimum:0,type:"integer"}]}},Quality:{description:"Quality setting (0-100 for images, affects compression)",in:"query",name:"quality",schema:{maximum:100,minimum:1,type:"integer"}},RemoveAlpha:{description:"Remove alpha channel",in:"query",name:"removeAlpha",schema:{type:"boolean"}},SampleRate:{description:"Audio sample rate in Hz",in:"query",name:"sampleRate",schema:{enum:[8e3,11025,16e3,22050,32e3,44100,48e3,88200,96e3,192e3],type:"integer"}},Saturation:{description:"Saturation multiplier for modulation",in:"query",name:"saturation",schema:{type:"number"}},Sharpen:{description:"Apply sharpening",in:"query",name:"sharpen",schema:{type:"boolean"}},Threshold:{description:"Apply thresholding with specified value (0-255)",in:"query",name:"threshold",schema:{maximum:255,minimum:0,type:"integer"}},Tint:{description:"Apply tinting",in:"query",name:"tint",schema:{type:"boolean"}},ToColourspace:{description:"Convert to colourspace",in:"query",name:"toColourspace",schema:{type:"boolean"}},Top:{description:"Crop area top offset",in:"query",name:"top",schema:{minimum:0,type:"integer"}},Unflatten:{description:"Unflatten alpha channel",in:"query",name:"unflatten",schema:{type:"boolean"}},Width:{description:"Desired width in pixels",in:"query",name:"width",schema:{minimum:1,type:"integer"}},WithoutEnlargement:{description:"Avoid enlarging images smaller than specified dimensions",in:"query",name:"withoutEnlargement",schema:{type:"boolean"}},WithoutReduction:{description:"Avoid reducing images larger than specified dimensions",in:"query",name:"withoutReduction",schema:{type:"boolean"}}},responses:{404:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Not Found"}},schemas:{...i("FileMetaPagination",{$ref:"#/components/schemas/PaginationMeta"},"#/components/schemas/PaginationMeta"),...a("PaginationMeta"),...s,...o,MediaTransformResult:{description:"Result of media transformation",properties:{bitrate:{description:"Bitrate for video/audio (bits per second)",type:"integer"},buffer:{description:"Binary data buffer (not included in JSON response)",type:"string"},duration:{description:"Duration for video/audio in seconds",type:"number"},format:{description:"Output format",type:"string"},height:{description:"Height for image/video in pixels",type:"integer"},mediaType:{description:"Type of media",enum:["image","video","audio"],type:"string"},numberOfChannels:{description:"Audio channel count",type:"integer"},originalFile:{$ref:"#/components/schemas/FileMeta"},sampleRate:{description:"Audio sample rate in Hz",type:"integer"},size:{description:"File size in bytes",type:"integer"},width:{description:"Width for image/video in pixels",type:"integer"}},required:["format","mediaType","originalFile","size"],type:"object"},ValidationError:{description:"Validation error response",properties:{code:{enum:["INVALID_PARAMS_FOR_IMAGE","INVALID_PARAMS_FOR_VIDEO","INVALID_PARAMS_FOR_AUDIO","INVALID_FIT_VALUE","INVALID_ANGLE_VALUE","INVALID_FORMAT","INCOMPLETE_CROP_PARAMS","INVALID_VIDEO_CODEC","INVALID_VIDEO_FORMAT","INVALID_WIDTH","INVALID_HEIGHT","INVALID_BITRATE","INVALID_FRAME_RATE","INVALID_KEY_FRAME_INTERVAL","INVALID_AUDIO_CODEC","INVALID_AUDIO_FORMAT","INVALID_CHANNEL_COUNT","INVALID_SAMPLE_RATE"],type:"string"},details:{properties:{invalidParams:{items:{type:"string"},type:"array"},mediaType:{enum:["image","video","audio"],type:"string"},suggestions:{items:{type:"string"},type:"array"},validParams:{items:{type:"string"},type:"array"}},required:["invalidParams","validParams","mediaType"],type:"object"},message:{type:"string"},name:{enum:["ValidationError"],type:"string"}},required:["code","details","message","name"],type:"object"}}},paths:{[`${e.replace(/\/$/,"")}/{id}/transform`]:{get:{description:"Get transformation metadata for a file without downloading. Returns information about supported transformations and current file properties.",operationId:`${r}TransformGetMetadata`,parameters:[{$ref:"#/components/parameters/FileID"}],responses:{200:{content:{"application/json":{schema:{description:"File transformation metadata",properties:{bitrate:{description:"Current bitrate for video/audio",type:"integer"},dimensions:{description:"Dimensions for image/video",properties:{height:{type:"integer"},width:{type:"integer"}},type:"object"},duration:{description:"Duration for video/audio in seconds",type:"number"},mediaType:{description:"Detected media type",enum:["image","video","audio"],type:"string"},numberOfChannels:{description:"Current channel count for audio",type:"integer"},originalFormat:{description:"Original file format",type:"string"},sampleRate:{description:"Current sample rate for audio",type:"integer"},supportedFormats:{description:"Supported output formats for this media type",items:{type:"string"},type:"array"},supportedParameters:{description:"Supported transformation parameters",items:{type:"string"},type:"array"}},required:["mediaType","supportedFormats","supportedParameters"],type:"object"}}},description:"Transformation metadata"},404:{$ref:"#/components/responses/404"},default:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Error"}},summary:"Get transformation metadata",tags:t}},[`${e.replace(/\/$/,"")}/{id}`]:{get:{description:"Retrieve and transform a file with optional media transformations. Supports resizing, cropping, format conversion, and codec changes based on query parameters.",operationId:`${r}TransformGetFile`,parameters:[{$ref:"#/components/parameters/FileID"},{$ref:"#/components/parameters/Format"},{$ref:"#/components/parameters/Quality"},{$ref:"#/components/parameters/Width"},{$ref:"#/components/parameters/Height"},{$ref:"#/components/parameters/Fit"},{$ref:"#/components/parameters/Position"},{$ref:"#/components/parameters/WithoutEnlargement"},{$ref:"#/components/parameters/WithoutReduction"},{$ref:"#/components/parameters/Left"},{$ref:"#/components/parameters/Top"},{$ref:"#/components/parameters/CropWidth"},{$ref:"#/components/parameters/CropHeight"},{$ref:"#/components/parameters/Angle"},{$ref:"#/components/parameters/Background"},{$ref:"#/components/parameters/Kernel"},{$ref:"#/components/parameters/FastShrinkOnLoad"},{$ref:"#/components/parameters/Blur"},{$ref:"#/components/parameters/Sharpen"},{$ref:"#/components/parameters/Median"},{$ref:"#/components/parameters/Clahe"},{$ref:"#/components/parameters/Threshold"},{$ref:"#/components/parameters/Gamma"},{$ref:"#/components/parameters/Negate"},{$ref:"#/components/parameters/Normalise"},{$ref:"#/components/parameters/Flatten"},{$ref:"#/components/parameters/Unflatten"},{$ref:"#/components/parameters/Flip"},{$ref:"#/components/parameters/Flop"},{$ref:"#/components/parameters/Greyscale"},{$ref:"#/components/parameters/Modulate"},{$ref:"#/components/parameters/Brightness"},{$ref:"#/components/parameters/Saturation"},{$ref:"#/components/parameters/Hue"},{$ref:"#/components/parameters/Lightness"},{$ref:"#/components/parameters/Tint"},{$ref:"#/components/parameters/Colourspace"},{$ref:"#/components/parameters/Affine"},{$ref:"#/components/parameters/Dilate"},{$ref:"#/components/parameters/Erode"},{$ref:"#/components/parameters/PipelineColourspace"},{$ref:"#/components/parameters/ToColourspace"},{$ref:"#/components/parameters/RemoveAlpha"},{$ref:"#/components/parameters/EnsureAlpha"},{$ref:"#/components/parameters/Codec"},{$ref:"#/components/parameters/Bitrate"},{$ref:"#/components/parameters/FrameRate"},{$ref:"#/components/parameters/KeyFrameInterval"},{$ref:"#/components/parameters/NumberOfChannels"},{$ref:"#/components/parameters/SampleRate"}],responses:{200:{content:{"*/*":{schema:{description:"Transformed media file",format:"binary",type:"string"}}},description:"Transformed file returned successfully",headers:{"Content-Type":{description:"MIME type of the transformed file",schema:{type:"string"}},ETag:{description:"ETag of the transformed file",schema:{type:"string"}},"X-Media-Type":{description:"Type of media (image/video/audio)",schema:{enum:["image","video","audio"],type:"string"}},"X-Original-Format":{description:"Original file format",schema:{type:"string"}},"X-Transformed-Format":{description:"Transformed file format",schema:{type:"string"}}}},400:{content:{"application/json":{examples:{ValidationError:{value:{error:{code:"INVALID_PARAMS_FOR_IMAGE",details:{invalidParams:["codec","bitrate"],mediaType:"image",validParams:["format","quality","width","height","fit","position","withoutEnlargement","withoutReduction","left","top","cropWidth","cropHeight","angle","background"]},message:"Invalid query parameters for image transformation: codec, bitrate. Images support: format, quality, width, height, fit, position, withoutEnlargement, withoutReduction, left, top, cropWidth, cropHeight, angle, background. Video/audio parameters (codec, bitrate) are not supported for images.",name:"ValidationError"}}}},schema:{$ref:"#/components/schemas/ValidationError"}}},description:"Invalid transformation parameters"},404:{$ref:"#/components/responses/404"},413:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"File too large for transformation"},415:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Unsupported media type for transformation"},default:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Error"}},summary:"Transform and retrieve file",tags:t}}}}};export{l as default};
|
|
1
|
+
import{createHash as n}from"node:crypto";import{createPaginationMetaSchemaObject as a,createPaginationSchemaObject as i}from"@visulima/pagination";import{sharedFileMetaSchemaObject as o,sharedErrorSchemaObject as s,sharedFileMetaExampleObject as p}from"./sharedErrorSchemaObject-GTCM7U0s.js";const l=(e="/",t=["Transform"])=>{const r=n("sha256").update(e).digest("base64");return{components:{examples:p,parameters:{Affine:{description:"Apply affine transformation",in:"query",name:"affine",schema:{type:"boolean"}},Angle:{description:"Rotation angle in degrees. Note: angles other than 90°, 180°, and 270° require interpolation and may affect quality",in:"query",name:"angle",schema:{type:"number"}},Background:{description:"Background color for rotation (hex, rgb, or color name)",in:"query",name:"background",schema:{type:"string"}},Bitrate:{description:"Target bitrate in bits per second",in:"query",name:"bitrate",schema:{minimum:1,type:"integer"}},Blur:{description:"Apply blur effect",in:"query",name:"blur",schema:{type:"boolean"}},Brightness:{description:"Brightness multiplier for modulation",in:"query",name:"brightness",schema:{type:"number"}},Clahe:{description:"Apply CLAHE (Contrast Limited Adaptive Histogram Equalization)",in:"query",name:"clahe",schema:{type:"boolean"}},Codec:{description:"Video or audio codec",in:"query",name:"codec",schema:{enum:["avc","hevc","vp8","vp9","av1","aac","opus","mp3","vorbis","flac"],type:"string"}},Colourspace:{description:"Convert colourspace",in:"query",name:"colourspace",schema:{enum:["srgb","rgb","cmyk","lab","b-w"],type:"string"}},CropHeight:{description:"Crop area height",in:"query",name:"cropHeight",schema:{minimum:1,type:"integer"}},CropWidth:{description:"Crop area width",in:"query",name:"cropWidth",schema:{minimum:1,type:"integer"}},Dilate:{description:"Apply dilation",in:"query",name:"dilate",schema:{type:"boolean"}},EnsureAlpha:{description:"Ensure alpha channel",in:"query",name:"ensureAlpha",schema:{type:"boolean"}},Erode:{description:"Apply erosion",in:"query",name:"erode",schema:{type:"boolean"}},FastShrinkOnLoad:{description:"Fast shrink on load for large images",in:"query",name:"fastShrinkOnLoad",schema:{type:"boolean"}},FileID:{description:"File identifier",in:"path",name:"id",required:!0,schema:{type:"string"}},Fit:{description:"Resize fit mode",in:"query",name:"fit",schema:{enum:["cover","contain","fill","inside","outside"],type:"string"}},Flatten:{description:"Flatten alpha channel",in:"query",name:"flatten",schema:{type:"boolean"}},Flip:{description:"Flip image vertically",in:"query",name:"flip",schema:{type:"boolean"}},Flop:{description:"Flop image horizontally",in:"query",name:"flop",schema:{type:"boolean"}},Format:{description:"Output format for the transformed media",in:"query",name:"format",schema:{enum:["jpeg","png","webp","avif","tiff","gif","mp4","webm","mkv","ogg","mp3","wav","aac","flac"],type:"string"}},FrameRate:{description:"Video frame rate in Hz",in:"query",name:"frameRate",schema:{minimum:1,type:"number"}},Gamma:{description:"Apply gamma correction",in:"query",name:"gamma",schema:{type:"boolean"}},Greyscale:{description:"Convert to greyscale",in:"query",name:"greyscale",schema:{type:"boolean"}},Height:{description:"Desired height in pixels",in:"query",name:"height",schema:{minimum:1,type:"integer"}},Hue:{description:"Hue rotation in degrees for modulation",in:"query",name:"hue",schema:{type:"integer"}},Kernel:{description:"Resize kernel algorithm",in:"query",name:"kernel",schema:{enum:["nearest","cubic","mitchell","lanczos2","lanczos3"],type:"string"}},KeyFrameInterval:{description:"Video key frame interval in seconds",in:"query",name:"keyFrameInterval",schema:{minimum:.1,type:"number"}},Left:{description:"Crop area left offset",in:"query",name:"left",schema:{minimum:0,type:"integer"}},Lightness:{description:"Lightness adjustment for modulation",in:"query",name:"lightness",schema:{type:"integer"}},Median:{description:"Apply median filter with specified size",in:"query",name:"median",schema:{minimum:1,type:"integer"}},Modulate:{description:"Apply modulation effects",in:"query",name:"modulate",schema:{type:"boolean"}},Negate:{description:"Negate (invert) the image",in:"query",name:"negate",schema:{type:"boolean"}},Normalise:{description:"Normalise the image",in:"query",name:"normalise",schema:{type:"boolean"}},NumberOfChannels:{description:"Audio channel count",in:"query",name:"numberOfChannels",schema:{enum:[1,2,3,4,5,6,7,8],type:"integer"}},PipelineColourspace:{description:"Set pipeline colourspace",in:"query",name:"pipelineColourspace",schema:{type:"boolean"}},Position:{description:"Position for cover/contain fits",in:"query",name:"position",schema:{oneOf:[{enum:["top","right","bottom","left","center"],type:"string"},{minimum:0,type:"integer"}]}},Quality:{description:"Quality setting (0-100 for images, affects compression)",in:"query",name:"quality",schema:{maximum:100,minimum:1,type:"integer"}},RemoveAlpha:{description:"Remove alpha channel",in:"query",name:"removeAlpha",schema:{type:"boolean"}},SampleRate:{description:"Audio sample rate in Hz",in:"query",name:"sampleRate",schema:{enum:[8e3,11025,16e3,22050,32e3,44100,48e3,88200,96e3,192e3],type:"integer"}},Saturation:{description:"Saturation multiplier for modulation",in:"query",name:"saturation",schema:{type:"number"}},Sharpen:{description:"Apply sharpening",in:"query",name:"sharpen",schema:{type:"boolean"}},Threshold:{description:"Apply thresholding with specified value (0-255)",in:"query",name:"threshold",schema:{maximum:255,minimum:0,type:"integer"}},Tint:{description:"Apply tinting",in:"query",name:"tint",schema:{type:"boolean"}},ToColourspace:{description:"Convert to colourspace",in:"query",name:"toColourspace",schema:{type:"boolean"}},Top:{description:"Crop area top offset",in:"query",name:"top",schema:{minimum:0,type:"integer"}},Unflatten:{description:"Unflatten alpha channel",in:"query",name:"unflatten",schema:{type:"boolean"}},Width:{description:"Desired width in pixels",in:"query",name:"width",schema:{minimum:1,type:"integer"}},WithoutEnlargement:{description:"Avoid enlarging images smaller than specified dimensions",in:"query",name:"withoutEnlargement",schema:{type:"boolean"}},WithoutReduction:{description:"Avoid reducing images larger than specified dimensions",in:"query",name:"withoutReduction",schema:{type:"boolean"}}},responses:{404:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Not Found"}},schemas:{...i("FileMetaPagination",{$ref:"#/components/schemas/PaginationMeta"},"#/components/schemas/PaginationMeta"),...a("PaginationMeta"),...s,...o,MediaTransformResult:{description:"Result of media transformation",properties:{bitrate:{description:"Bitrate for video/audio (bits per second)",type:"integer"},buffer:{description:"Binary data buffer (not included in JSON response)",type:"string"},duration:{description:"Duration for video/audio in seconds",type:"number"},format:{description:"Output format",type:"string"},height:{description:"Height for image/video in pixels",type:"integer"},mediaType:{description:"Type of media",enum:["image","video","audio"],type:"string"},numberOfChannels:{description:"Audio channel count",type:"integer"},originalFile:{$ref:"#/components/schemas/FileMeta"},sampleRate:{description:"Audio sample rate in Hz",type:"integer"},size:{description:"File size in bytes",type:"integer"},width:{description:"Width for image/video in pixels",type:"integer"}},required:["format","mediaType","originalFile","size"],type:"object"},ValidationError:{description:"Validation error response",properties:{code:{enum:["INVALID_PARAMS_FOR_IMAGE","INVALID_PARAMS_FOR_VIDEO","INVALID_PARAMS_FOR_AUDIO","INVALID_FIT_VALUE","INVALID_ANGLE_VALUE","INVALID_FORMAT","INCOMPLETE_CROP_PARAMS","INVALID_VIDEO_CODEC","INVALID_VIDEO_FORMAT","INVALID_WIDTH","INVALID_HEIGHT","INVALID_BITRATE","INVALID_FRAME_RATE","INVALID_KEY_FRAME_INTERVAL","INVALID_AUDIO_CODEC","INVALID_AUDIO_FORMAT","INVALID_CHANNEL_COUNT","INVALID_SAMPLE_RATE"],type:"string"},details:{properties:{invalidParams:{items:{type:"string"},type:"array"},mediaType:{enum:["image","video","audio"],type:"string"},suggestions:{items:{type:"string"},type:"array"},validParams:{items:{type:"string"},type:"array"}},required:["invalidParams","validParams","mediaType"],type:"object"},message:{type:"string"},name:{enum:["ValidationError"],type:"string"}},required:["code","details","message","name"],type:"object"}}},paths:{[`${e.replace(/\/$/,"")}/{id}/transform`]:{get:{description:"Get transformation metadata for a file without downloading. Returns information about supported transformations and current file properties.",operationId:`${r}TransformGetMetadata`,parameters:[{$ref:"#/components/parameters/FileID"}],responses:{200:{content:{"application/json":{schema:{description:"File transformation metadata",properties:{bitrate:{description:"Current bitrate for video/audio",type:"integer"},dimensions:{description:"Dimensions for image/video",properties:{height:{type:"integer"},width:{type:"integer"}},type:"object"},duration:{description:"Duration for video/audio in seconds",type:"number"},mediaType:{description:"Detected media type",enum:["image","video","audio"],type:"string"},numberOfChannels:{description:"Current channel count for audio",type:"integer"},originalFormat:{description:"Original file format",type:"string"},sampleRate:{description:"Current sample rate for audio",type:"integer"},supportedFormats:{description:"Supported output formats for this media type",items:{type:"string"},type:"array"},supportedParameters:{description:"Supported transformation parameters",items:{type:"string"},type:"array"}},required:["mediaType","supportedFormats","supportedParameters"],type:"object"}}},description:"Transformation metadata"},404:{$ref:"#/components/responses/404"},default:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Error"}},summary:"Get transformation metadata",tags:t}},[`${e.replace(/\/$/,"")}/{id}`]:{get:{description:"Retrieve and transform a file with optional media transformations. Supports resizing, cropping, format conversion, and codec changes based on query parameters.",operationId:`${r}TransformGetFile`,parameters:[{$ref:"#/components/parameters/FileID"},{$ref:"#/components/parameters/Format"},{$ref:"#/components/parameters/Quality"},{$ref:"#/components/parameters/Width"},{$ref:"#/components/parameters/Height"},{$ref:"#/components/parameters/Fit"},{$ref:"#/components/parameters/Position"},{$ref:"#/components/parameters/WithoutEnlargement"},{$ref:"#/components/parameters/WithoutReduction"},{$ref:"#/components/parameters/Left"},{$ref:"#/components/parameters/Top"},{$ref:"#/components/parameters/CropWidth"},{$ref:"#/components/parameters/CropHeight"},{$ref:"#/components/parameters/Angle"},{$ref:"#/components/parameters/Background"},{$ref:"#/components/parameters/Kernel"},{$ref:"#/components/parameters/FastShrinkOnLoad"},{$ref:"#/components/parameters/Blur"},{$ref:"#/components/parameters/Sharpen"},{$ref:"#/components/parameters/Median"},{$ref:"#/components/parameters/Clahe"},{$ref:"#/components/parameters/Threshold"},{$ref:"#/components/parameters/Gamma"},{$ref:"#/components/parameters/Negate"},{$ref:"#/components/parameters/Normalise"},{$ref:"#/components/parameters/Flatten"},{$ref:"#/components/parameters/Unflatten"},{$ref:"#/components/parameters/Flip"},{$ref:"#/components/parameters/Flop"},{$ref:"#/components/parameters/Greyscale"},{$ref:"#/components/parameters/Modulate"},{$ref:"#/components/parameters/Brightness"},{$ref:"#/components/parameters/Saturation"},{$ref:"#/components/parameters/Hue"},{$ref:"#/components/parameters/Lightness"},{$ref:"#/components/parameters/Tint"},{$ref:"#/components/parameters/Colourspace"},{$ref:"#/components/parameters/Affine"},{$ref:"#/components/parameters/Dilate"},{$ref:"#/components/parameters/Erode"},{$ref:"#/components/parameters/PipelineColourspace"},{$ref:"#/components/parameters/ToColourspace"},{$ref:"#/components/parameters/RemoveAlpha"},{$ref:"#/components/parameters/EnsureAlpha"},{$ref:"#/components/parameters/Codec"},{$ref:"#/components/parameters/Bitrate"},{$ref:"#/components/parameters/FrameRate"},{$ref:"#/components/parameters/KeyFrameInterval"},{$ref:"#/components/parameters/NumberOfChannels"},{$ref:"#/components/parameters/SampleRate"}],responses:{200:{content:{"*/*":{schema:{description:"Transformed media file",format:"binary",type:"string"}}},description:"Transformed file returned successfully",headers:{"Content-Type":{description:"MIME type of the transformed file",schema:{type:"string"}},ETag:{description:"ETag of the transformed file",schema:{type:"string"}},"X-Media-Type":{description:"Type of media (image/video/audio)",schema:{enum:["image","video","audio"],type:"string"}},"X-Original-Format":{description:"Original file format",schema:{type:"string"}},"X-Transformed-Format":{description:"Transformed file format",schema:{type:"string"}}}},400:{content:{"application/json":{examples:{ValidationError:{value:{error:{code:"INVALID_PARAMS_FOR_IMAGE",details:{invalidParams:["codec","bitrate"],mediaType:"image",validParams:["format","quality","width","height","fit","position","withoutEnlargement","withoutReduction","left","top","cropWidth","cropHeight","angle","background"]},message:"Invalid query parameters for image transformation: codec, bitrate. Images support: format, quality, width, height, fit, position, withoutEnlargement, withoutReduction, left, top, cropWidth, cropHeight, angle, background. Video/audio parameters (codec, bitrate) are not supported for images.",name:"ValidationError"}}}},schema:{$ref:"#/components/schemas/ValidationError"}}},description:"Invalid transformation parameters"},404:{$ref:"#/components/responses/404"},413:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"File too large for transformation"},415:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Unsupported media type for transformation"},default:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Error"}},summary:"Transform and retrieve file",tags:t}}}}};export{l as default};
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
2
|
import { IncomingMessage } from 'node:http';
|
|
3
|
-
import { U as UploadFile, h as ResponseBodyType, B as BaseStorage, E as ErrorResponses } from "./storage.d-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { U as UploadOptions } from "./types.d-D7Zlz5RE.js";
|
|
7
|
-
import 'node:crypto';
|
|
8
|
-
import 'lru-cache';
|
|
9
|
-
import '@visulima/pagination';
|
|
10
|
-
import 'node:timers';
|
|
3
|
+
import { U as UploadFile, h as ResponseBodyType, B as BaseStorage, E as ErrorResponses } from "./storage.d-C9EdfTf1.js";
|
|
4
|
+
import { M as MediaTransformer } from "./media-transformer.d-Co37isNg.js";
|
|
5
|
+
import { U as UploadOptions } from "./types.d-D6Jkz0Sp.js";
|
|
11
6
|
/**
|
|
12
7
|
* Core base class containing shared business logic for all handlers.
|
|
13
8
|
* This class is platform-agnostic and contains no Node.js or Web API specific code.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHash as h}from"node:crypto";import{createPaginationMetaSchemaObject as c,createPaginationSchemaObject as d}from"@visulima/pagination";import{sharedGet as m,sharedFileMetaSchemaObject as p,sharedErrorSchemaObject as u,sharedFileMetaExampleObject as l,sharedGetList as f,sharedGetMeta as n}from"./sharedErrorSchemaObject-YN65aAKj.js";const g=(t,o)=>{const{supportedTransformerFormat:r,tags:e,transformer:i}={tags:["Tus"],transformer:!1,...o},s=h("sha256").update(t).digest("base64"),a=m(`${s}TusGetFile`,e,i,r);return{components:{examples:l,responses:{404:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Not Found"}},schemas:{"Tus-Checksum-Algorithm":{description:"Added by the checksum extension. The Tus-Checksum-Algorithm response header MUST be a comma-separated list of the checksum algorithms supported by the server.",type:"string"},"Tus-Extension":{description:"The Tus-Extension response header MUST be a comma-separated list of the extensions supported by the Server. If no extensions are supported, the Tus-Extension header MUST be omitted.",type:"string"},"Tus-Max-Size":{description:"The Tus-Max-Size response header MUST be a non-negative integer indicating the maximum allowed size of an entire upload in bytes. The Server SHOULD set this header if there is a known hard limit.",type:"integer"},"Tus-Resumable":{description:"Protocol version",enum:["1.0.0"],type:"string"},"Tus-Version":{description:"The Tus-Version response header MUST be a comma-separated list of protocol versions supported by the Server. The list MUST be sorted by Server's preference where the first one is the most preferred one.",type:"string"},"Upload-Checksum":{description:"Added by the checksum extension. The Upload-Checksum request header contains information about the checksum of the current body payload. The header MUST consist of the name of the used checksum algorithm and the Base64 encoded checksum separated by a space.",type:"string"},"Upload-Length":{description:"The Upload-Length request and response header indicates the size of the entire upload in bytes. The value MUST be a non-negative integer. In the concatenation extension, the Client MUST NOT include the Upload-Length header in the final upload creation",type:"integer"},"Upload-Offset":{description:"The Upload-Offset request and response header indicates a byte offset within a resource. The value MUST be a non-negative integer.",type:"integer"},...d("FileMetaPagination",{$ref:"#/components/schemas/PaginationMeta"},"#/components/schemas/PaginationMeta"),...c("PaginationMeta"),...u,...p}},paths:{[`${t.replace(/\/$/,"")}/{id}/metadata`]:{get:{...n(`${s}TusGetFileMeta`,e),parameters:[...n(`${s}TusGetFileMeta`,e).parameters,{description:"Version of the protocol supported by the client",in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}]}},[`${t.replace(/\/$/,"")}/{id}`]:{delete:{description:"When receiving a DELETE request for an existing upload the Server SHOULD free associated resources and MUST respond with the 204 No Content status confirming that the upload was terminated. For all future requests to this URL, the Server SHOULD respond with the 404 Not Found or 410 Gone status.",operationId:`${s}TusFilesDelete`,parameters:[{in:"path",name:"id",required:!0,schema:{type:"string"}},{in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}],responses:{204:{description:"Upload was terminated",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}}},summary:"Added by the Termination extension.",tags:e},get:{...a,parameters:[...a.parameters,{description:"Version of the protocol supported by the client",in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}]},head:{description:"Used to determine the offset at which the upload should be continued.",operationId:`${s}TusFilesHead`,parameters:[{in:"path",name:"id",required:!0,schema:{type:"string"}},{in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}],responses:{200:{description:"Returns offset",headers:{"Cache-Control":{schema:{enum:["no-store"],type:"string"}},"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Upload-Length":{schema:{$ref:"#/components/schemas/Upload-Length"}},"Upload-Offset":{schema:{$ref:"#/components/schemas/Upload-Offset"}}}},403:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"If the resource is not found, the Server SHOULD return either the 404 Not Found, 410 Gone or 403 Forbidden status without the Upload-Offset header.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},404:{$ref:"#/components/responses/404"},410:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"If the resource is not found, the Server SHOULD return either the 404 Not Found, 410 Gone or 403 Forbidden status without the Upload-Offset header.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}}},summary:"Used to determine the offset at which the upload should be continued.",tags:e},patch:{description:"The Server SHOULD accept PATCH requests against any upload URL and apply the bytes contained in the message at the given offset specified by the Upload-Offset header. All PATCH requests MUST use Content-Type: application/offset+octet-stream, otherwise the server SHOULD return a 415 Unsupported Media Type status.",operationId:`${s}TusFilePatch`,parameters:[{in:"path",name:"id",required:!0,schema:{type:"string"}},{in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}},{description:"Length of the body of this request",in:"header",name:"Content-Length",required:!0,schema:{type:"integer"}},{in:"header",name:"Upload-Offset",required:!0,schema:{$ref:"#/components/schemas/Upload-Offset"}},{in:"header",name:"Upload-Checksum",schema:{$ref:"#/components/schemas/Upload-Checksum"}}],requestBody:{content:{"application/offset+octet-stream":{schema:{type:"string"}}},description:"Remaining (possibly partial) content of the file. Required if Content-Length > 0.",required:!1},responses:{204:{description:"Upload offset was updated",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Upload-Expires":{description:"Added by the expiration extension. The Upload-Expires response header indicates the time after which the unfinished upload expires. A Server MAY wish to remove incomplete upload after a given period of time to prevent abandoned upload from taking up extra storage. The Client SHOULD use this header to determine if an upload is still valid before attempting to resume the upload. This header MUST be included in every PATCH response if the upload is going to expire. If the expiration is known at the creation, the Upload-Expires header MUST be included in the response to the initial POST request. Its value MAY change over time. If a Client does attempt to resume an upload which has since been removed by the Server, the Server SHOULD respond with the 404 Not Found or 410 Gone status. The latter one SHOULD be used if the Server is keeping track of expired upload. In both cases the Client SHOULD start a new upload. The value of the Upload-Expires header MUST be in RFC 7231 datetime format.",schema:{type:"string"}},"Upload-Offset":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},400:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the checksum extension. The checksum algorithm is not supported by the server",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},403:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"In the concatenation extension, the Server MUST respond with the 403 Forbidden status to PATCH requests against a final upload URL and MUST NOT modify the final or its partial upload.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},404:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"PATCH request against a non-existent resource",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},409:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"PATCH request with Upload-Offset unequal to the offset of the resource on the server. The Upload-Offset header's value MUST be equal to the current offset of the resource.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},410:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"PATCH request against a non-existent resource",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}},415:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Content-Type was not application/offset+octet-stream",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},460:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the checksum extension. Checksums mismatch",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}}},summary:"Used to resume the upload",tags:e}},[t.trimEnd()]:{get:f(`${s}TusGetList`,e),options:{operationId:`${s}TusOptions`,responses:{204:{description:"Success",headers:{"Tus-Checksum-Algorithm":{schema:{$ref:"#/components/schemas/Tus-Checksum-Algorithm"}},"Tus-Extension":{schema:{$ref:"#/components/schemas/Tus-Extension"}},"Tus-Max-Size":{schema:{$ref:"#/components/schemas/Tus-Max-Size"}},"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}}},summary:"Request to gather information about the Server's current configuration",tags:e},post:{description:"Endpoint for the Creation extension. Modified by the Creation With Upload extension.",operationId:`${s}TusCreate`,parameters:[{description:"Must be 0 for creation extension. May be a positive number for Creation With Upload extension.",in:"header",name:"Content-Length",schema:{type:"integer"}},{in:"header",name:"Upload-Length",schema:{$ref:"#/components/schemas/Upload-Length"}},{in:"header",name:"Tus-Resumable",schema:{$ref:"#/components/schemas/Tus-Resumable"}},{description:"Added by the Creation extension. The Upload-Metadata request and response header MUST consist of one or more comma-separated key-value pairs. The key and value MUST be separated by a space. The key MUST NOT contain spaces and commas and MUST NOT be empty. The key SHOULD be ASCII encoded and the value MUST be Base64 encoded. All keys MUST be unique. The value MAY be empty. In these cases, the space, which would normally separate the key and the value, MAY be left out. Since metadata can contain arbitrary binary values, Servers SHOULD carefully validate metadata values or sanitize them before using them as header values to avoid header smuggling.",in:"header",name:"Upload-Metadata",schema:{type:"string"}},{description:"Added by the Concatenation extension. The Upload-Concat request and response header MUST be set in both partial and final upload creation requests. It indicates whether the upload is either a partial or final upload. If the upload is a partial one, the header value MUST be partial. In the case of a final upload, its value MUST be final followed by a semicolon and a space-separated list of partial upload URLs that will be concatenated. The partial upload URLs MAY be absolute or relative and MUST NOT contain spaces as defined in RFC 3986.",in:"header",name:"Upload-Concat",schema:{type:"string"}},{description:"Added by the Creation Defer Length extension. The Upload-Defer-Length request and response header indicates that the size of the upload is not known currently and will be transferred later. Its value MUST be 1. If the length of an upload is not deferred, this header MUST be omitted.",in:"header",name:"Upload-Defer-Length",schema:{enum:[1],type:"integer"}},{in:"header",name:"Upload-Offset",schema:{$ref:"#/components/schemas/Upload-Offset"}},{in:"header",name:"Upload-Checksum",schema:{$ref:"#/components/schemas/Upload-Checksum"}}],requestBody:{content:{"application/offset+octet-stream":{schema:{type:"string"}}},description:"(Possibly partial) content of the file. Required if Content-Length > 0.",required:!1},responses:{201:{description:"Created",headers:{Location:{description:"Url of the created resource.",schema:{type:"string"}},"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Upload-Expires":{description:"Added by the Creation With Upload Extension in combination with the expiration extension. The Upload-Expires response header indicates the time after which the unfinished upload expires. A Server MAY wish to remove incomplete upload after a given period of time to prevent abandoned upload from taking up extra storage. The Client SHOULD use this header to determine if an upload is still valid before attempting to resume the upload. This header MUST be included in every PATCH response if the upload is going to expire. If the expiration is known at the creation, the Upload-Expires header MUST be included in the response to the initial POST request. Its value MAY change over time. If a Client does attempt to resume an upload which has since been removed by the Server, the Server SHOULD respond with the 404 Not Found or 410 Gone status. The latter one SHOULD be used if the Server is keeping track of expired upload. In both cases the Client SHOULD start a new upload. The value of the Upload-Expires header MUST be in RFC 7231 datetime format.",schema:{type:"string"}},"Upload-Offset":{schema:{$ref:"#/components/schemas/Upload-Offset"}}}},400:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the Creation With Upload Extension in combination with the checksum extension. The checksum algorithm is not supported by the server",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}},413:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"If the length of the upload exceeds the maximum, which MAY be specified using the Tus-Max-Size header, the Server MUST respond with the 413 Request Entity Too Large status.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},415:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the Creation With Upload Extension. Content-Type was not application/offset+octet-stream",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},460:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the Creation With Upload Extension in combination with the checksum extension. Checksums mismatch",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}}},summary:"An empty POST request is used to create a new upload resource. The Upload-Length header indicates the size of the entire upload in bytes. If the Creation With Upload extension is available, the Client MAY include parts of the upload in the initial Creation request",tags:e}}}}};export{g as default};
|
|
1
|
+
import{createHash as h}from"node:crypto";import{createPaginationMetaSchemaObject as c,createPaginationSchemaObject as d}from"@visulima/pagination";import{sharedGet as m,sharedFileMetaSchemaObject as p,sharedErrorSchemaObject as u,sharedFileMetaExampleObject as l,sharedGetList as f,sharedGetMeta as n}from"./sharedErrorSchemaObject-GTCM7U0s.js";const g=(t,o)=>{const{supportedTransformerFormat:r,tags:e,transformer:i}={tags:["Tus"],transformer:!1,...o},s=h("sha256").update(t).digest("base64"),a=m(`${s}TusGetFile`,e,i,r);return{components:{examples:l,responses:{404:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Not Found"}},schemas:{"Tus-Checksum-Algorithm":{description:"Added by the checksum extension. The Tus-Checksum-Algorithm response header MUST be a comma-separated list of the checksum algorithms supported by the server.",type:"string"},"Tus-Extension":{description:"The Tus-Extension response header MUST be a comma-separated list of the extensions supported by the Server. If no extensions are supported, the Tus-Extension header MUST be omitted.",type:"string"},"Tus-Max-Size":{description:"The Tus-Max-Size response header MUST be a non-negative integer indicating the maximum allowed size of an entire upload in bytes. The Server SHOULD set this header if there is a known hard limit.",type:"integer"},"Tus-Resumable":{description:"Protocol version",enum:["1.0.0"],type:"string"},"Tus-Version":{description:"The Tus-Version response header MUST be a comma-separated list of protocol versions supported by the Server. The list MUST be sorted by Server's preference where the first one is the most preferred one.",type:"string"},"Upload-Checksum":{description:"Added by the checksum extension. The Upload-Checksum request header contains information about the checksum of the current body payload. The header MUST consist of the name of the used checksum algorithm and the Base64 encoded checksum separated by a space.",type:"string"},"Upload-Length":{description:"The Upload-Length request and response header indicates the size of the entire upload in bytes. The value MUST be a non-negative integer. In the concatenation extension, the Client MUST NOT include the Upload-Length header in the final upload creation",type:"integer"},"Upload-Offset":{description:"The Upload-Offset request and response header indicates a byte offset within a resource. The value MUST be a non-negative integer.",type:"integer"},...d("FileMetaPagination",{$ref:"#/components/schemas/PaginationMeta"},"#/components/schemas/PaginationMeta"),...c("PaginationMeta"),...u,...p}},paths:{[`${t.replace(/\/$/,"")}/{id}/metadata`]:{get:{...n(`${s}TusGetFileMeta`,e),parameters:[...n(`${s}TusGetFileMeta`,e).parameters,{description:"Version of the protocol supported by the client",in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}]}},[`${t.replace(/\/$/,"")}/{id}`]:{delete:{description:"When receiving a DELETE request for an existing upload the Server SHOULD free associated resources and MUST respond with the 204 No Content status confirming that the upload was terminated. For all future requests to this URL, the Server SHOULD respond with the 404 Not Found or 410 Gone status.",operationId:`${s}TusFilesDelete`,parameters:[{in:"path",name:"id",required:!0,schema:{type:"string"}},{in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}],responses:{204:{description:"Upload was terminated",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}}},summary:"Added by the Termination extension.",tags:e},get:{...a,parameters:[...a.parameters,{description:"Version of the protocol supported by the client",in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}]},head:{description:"Used to determine the offset at which the upload should be continued.",operationId:`${s}TusFilesHead`,parameters:[{in:"path",name:"id",required:!0,schema:{type:"string"}},{in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}],responses:{200:{description:"Returns offset",headers:{"Cache-Control":{schema:{enum:["no-store"],type:"string"}},"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Upload-Length":{schema:{$ref:"#/components/schemas/Upload-Length"}},"Upload-Offset":{schema:{$ref:"#/components/schemas/Upload-Offset"}}}},403:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"If the resource is not found, the Server SHOULD return either the 404 Not Found, 410 Gone or 403 Forbidden status without the Upload-Offset header.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},404:{$ref:"#/components/responses/404"},410:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"If the resource is not found, the Server SHOULD return either the 404 Not Found, 410 Gone or 403 Forbidden status without the Upload-Offset header.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}}},summary:"Used to determine the offset at which the upload should be continued.",tags:e},patch:{description:"The Server SHOULD accept PATCH requests against any upload URL and apply the bytes contained in the message at the given offset specified by the Upload-Offset header. All PATCH requests MUST use Content-Type: application/offset+octet-stream, otherwise the server SHOULD return a 415 Unsupported Media Type status.",operationId:`${s}TusFilePatch`,parameters:[{in:"path",name:"id",required:!0,schema:{type:"string"}},{in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}},{description:"Length of the body of this request",in:"header",name:"Content-Length",required:!0,schema:{type:"integer"}},{in:"header",name:"Upload-Offset",required:!0,schema:{$ref:"#/components/schemas/Upload-Offset"}},{in:"header",name:"Upload-Checksum",schema:{$ref:"#/components/schemas/Upload-Checksum"}}],requestBody:{content:{"application/offset+octet-stream":{schema:{type:"string"}}},description:"Remaining (possibly partial) content of the file. Required if Content-Length > 0.",required:!1},responses:{204:{description:"Upload offset was updated",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Upload-Expires":{description:"Added by the expiration extension. The Upload-Expires response header indicates the time after which the unfinished upload expires. A Server MAY wish to remove incomplete upload after a given period of time to prevent abandoned upload from taking up extra storage. The Client SHOULD use this header to determine if an upload is still valid before attempting to resume the upload. This header MUST be included in every PATCH response if the upload is going to expire. If the expiration is known at the creation, the Upload-Expires header MUST be included in the response to the initial POST request. Its value MAY change over time. If a Client does attempt to resume an upload which has since been removed by the Server, the Server SHOULD respond with the 404 Not Found or 410 Gone status. The latter one SHOULD be used if the Server is keeping track of expired upload. In both cases the Client SHOULD start a new upload. The value of the Upload-Expires header MUST be in RFC 7231 datetime format.",schema:{type:"string"}},"Upload-Offset":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},400:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the checksum extension. The checksum algorithm is not supported by the server",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},403:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"In the concatenation extension, the Server MUST respond with the 403 Forbidden status to PATCH requests against a final upload URL and MUST NOT modify the final or its partial upload.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},404:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"PATCH request against a non-existent resource",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},409:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"PATCH request with Upload-Offset unequal to the offset of the resource on the server. The Upload-Offset header's value MUST be equal to the current offset of the resource.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},410:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"PATCH request against a non-existent resource",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}},415:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Content-Type was not application/offset+octet-stream",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},460:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the checksum extension. Checksums mismatch",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}}},summary:"Used to resume the upload",tags:e}},[t.trimEnd()]:{get:f(`${s}TusGetList`,e),options:{operationId:`${s}TusOptions`,responses:{204:{description:"Success",headers:{"Tus-Checksum-Algorithm":{schema:{$ref:"#/components/schemas/Tus-Checksum-Algorithm"}},"Tus-Extension":{schema:{$ref:"#/components/schemas/Tus-Extension"}},"Tus-Max-Size":{schema:{$ref:"#/components/schemas/Tus-Max-Size"}},"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}}},summary:"Request to gather information about the Server's current configuration",tags:e},post:{description:"Endpoint for the Creation extension. Modified by the Creation With Upload extension.",operationId:`${s}TusCreate`,parameters:[{description:"Must be 0 for creation extension. May be a positive number for Creation With Upload extension.",in:"header",name:"Content-Length",schema:{type:"integer"}},{in:"header",name:"Upload-Length",schema:{$ref:"#/components/schemas/Upload-Length"}},{in:"header",name:"Tus-Resumable",schema:{$ref:"#/components/schemas/Tus-Resumable"}},{description:"Added by the Creation extension. The Upload-Metadata request and response header MUST consist of one or more comma-separated key-value pairs. The key and value MUST be separated by a space. The key MUST NOT contain spaces and commas and MUST NOT be empty. The key SHOULD be ASCII encoded and the value MUST be Base64 encoded. All keys MUST be unique. The value MAY be empty. In these cases, the space, which would normally separate the key and the value, MAY be left out. Since metadata can contain arbitrary binary values, Servers SHOULD carefully validate metadata values or sanitize them before using them as header values to avoid header smuggling.",in:"header",name:"Upload-Metadata",schema:{type:"string"}},{description:"Added by the Concatenation extension. The Upload-Concat request and response header MUST be set in both partial and final upload creation requests. It indicates whether the upload is either a partial or final upload. If the upload is a partial one, the header value MUST be partial. In the case of a final upload, its value MUST be final followed by a semicolon and a space-separated list of partial upload URLs that will be concatenated. The partial upload URLs MAY be absolute or relative and MUST NOT contain spaces as defined in RFC 3986.",in:"header",name:"Upload-Concat",schema:{type:"string"}},{description:"Added by the Creation Defer Length extension. The Upload-Defer-Length request and response header indicates that the size of the upload is not known currently and will be transferred later. Its value MUST be 1. If the length of an upload is not deferred, this header MUST be omitted.",in:"header",name:"Upload-Defer-Length",schema:{enum:[1],type:"integer"}},{in:"header",name:"Upload-Offset",schema:{$ref:"#/components/schemas/Upload-Offset"}},{in:"header",name:"Upload-Checksum",schema:{$ref:"#/components/schemas/Upload-Checksum"}}],requestBody:{content:{"application/offset+octet-stream":{schema:{type:"string"}}},description:"(Possibly partial) content of the file. Required if Content-Length > 0.",required:!1},responses:{201:{description:"Created",headers:{Location:{description:"Url of the created resource.",schema:{type:"string"}},"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Upload-Expires":{description:"Added by the Creation With Upload Extension in combination with the expiration extension. The Upload-Expires response header indicates the time after which the unfinished upload expires. A Server MAY wish to remove incomplete upload after a given period of time to prevent abandoned upload from taking up extra storage. The Client SHOULD use this header to determine if an upload is still valid before attempting to resume the upload. This header MUST be included in every PATCH response if the upload is going to expire. If the expiration is known at the creation, the Upload-Expires header MUST be included in the response to the initial POST request. Its value MAY change over time. If a Client does attempt to resume an upload which has since been removed by the Server, the Server SHOULD respond with the 404 Not Found or 410 Gone status. The latter one SHOULD be used if the Server is keeping track of expired upload. In both cases the Client SHOULD start a new upload. The value of the Upload-Expires header MUST be in RFC 7231 datetime format.",schema:{type:"string"}},"Upload-Offset":{schema:{$ref:"#/components/schemas/Upload-Offset"}}}},400:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the Creation With Upload Extension in combination with the checksum extension. The checksum algorithm is not supported by the server",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}},413:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"If the length of the upload exceeds the maximum, which MAY be specified using the Tus-Max-Size header, the Server MUST respond with the 413 Request Entity Too Large status.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},415:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the Creation With Upload Extension. Content-Type was not application/offset+octet-stream",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},460:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the Creation With Upload Extension in combination with the checksum extension. Checksums mismatch",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}}},summary:"An empty POST request is used to create a new upload resource. The Upload-Length header indicates the size of the entire upload in bytes. If the Creation With Upload extension is available, the Client MAY include parts of the upload in the initial Creation request",tags:e}}}}};export{g as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Cache, F as File, g as FileReturn, B as BaseStorage } from "./storage.d-
|
|
1
|
+
import { C as Cache, F as File, g as FileReturn, B as BaseStorage } from "./storage.d-C9EdfTf1.js";
|
|
2
2
|
import { Readable } from 'node:stream';
|
|
3
3
|
/**
|
|
4
4
|
* Base transformer configuration with common properties
|
|
@@ -2,8 +2,8 @@ import { EventEmitter } from 'node:events';
|
|
|
2
2
|
import { IncomingMessage } from 'node:http';
|
|
3
3
|
import { Readable } from 'node:stream';
|
|
4
4
|
import { PaginationResult } from '@visulima/pagination';
|
|
5
|
-
import { U as UploadFile, B as BaseStorage, a as UploadError, b as UploadEventType } from "./storage.d-
|
|
6
|
-
import { M as MediaTransformer } from "./media-transformer.d-
|
|
5
|
+
import { U as UploadFile, B as BaseStorage, a as UploadError, b as UploadEventType } from "./storage.d-C9EdfTf1.js";
|
|
6
|
+
import { M as MediaTransformer } from "./media-transformer.d-Co37isNg.js";
|
|
7
7
|
type WebRequest = globalThis.Request;
|
|
8
8
|
type WebResponse = globalThis.Response;
|
|
9
9
|
interface BaseResponse {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions,
|
|
2
|
-
import 'node:stream';
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, i as BaseStorageOptions } from "./storage.d-C9EdfTf1.js";
|
|
3
2
|
import { Client } from '@microsoft/microsoft-graph-client';
|
|
4
3
|
declare class OneDriveFile extends File {
|
|
5
4
|
driveItemId?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=(t,e)=>(e<t.size&&(t.size=e),t);export{r as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=e=>{const c=e?.accessKeyId??process.env.AWS_ACCESS_KEY_ID??process.env.VULTR_ACCESS_KEY_ID??process.env.VULTR_ACCESS_KEY,s=e?.location??process.env.VULTR_LOCATION,o=e?.secretAccessKey??process.env.AWS_SECRET_ACCESS_KEY??process.env.VULTR_SECRET_ACCESS_KEY??process.env.VULTR_SECRET_KEY;if(!s||!c||!o)throw new Error("Missing required parameters for Vultr Object Storage client.");return{credentials:{accessKeyId:c,secretAccessKey:o},endpoint:`https://${s}.vultrobjects.com`,forcePathStyle:!1,region:s}};export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=async(i,t=5e3)=>{if(i.isReady)return;const e=Date.now();for(;!i.isReady&&Date.now()-e<t;)await new Promise(a=>{setTimeout(()=>{a()},100)});if(!i.isReady)throw new Error("Storage initialization timeout")};export{o as waitForStorage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=s=>{const c=s?.accessKeyId??process.env.AWS_ACCESS_KEY_ID??process.env.WASABI_ACCESS_KEY_ID??process.env.WASABI_ACCESS_KEY,e=s?.region??process.env.AWS_REGION??process.env.WASABI_REGION,n=s?.secretAccessKey??process.env.AWS_SECRET_ACCESS_KEY??process.env.WASABI_SECRET_ACCESS_KEY??process.env.WASABI_SECRET_KEY;if(!e||!c||!n)throw new Error("Missing required parameters for Wasabi client.");return{apiVersion:"2006-03-01",credentials:{accessKeyId:c,secretAccessKey:n},endpoint:`https://s3.${e}.wasabisys.com`,region:e}};export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHash as n}from"node:crypto";import{createPaginationMetaSchemaObject as p,createPaginationSchemaObject as d}from"@visulima/pagination";import{sharedFileMetaSchemaObject as c,sharedErrorSchemaObject as m,sharedFileMetaExampleObject as l,sharedGetList as
|
|
1
|
+
import{createHash as n}from"node:crypto";import{createPaginationMetaSchemaObject as p,createPaginationSchemaObject as d}from"@visulima/pagination";import{sharedFileMetaSchemaObject as c,sharedErrorSchemaObject as m,sharedFileMetaExampleObject as l,sharedGetList as f,sharedGet as h,sharedGetMeta as u}from"./sharedErrorSchemaObject-GTCM7U0s.js";const x=(r,t,o)=>{const{supportedTransformerFormat:s,tags:e,transformer:i}={tags:["Multipart"],transformer:!1,...o},a=n("sha256").update(t).digest("base64");return{components:{examples:l,parameters:{UploadIDinPath:{description:"Upload ID",in:"path",name:"id",schema:{type:"string"}}},responses:{404:{content:{"application/json":{example:{error:{code:"FileNotFound",message:"Not found"}},schema:{$ref:"#/components/schemas/Error"}}},description:"Not Found"}},schemas:{...d("FileMetaPagination",{$ref:"#/components/schemas/PaginationMeta"},"#/components/schemas/PaginationMeta"),...p("PaginationMeta"),...m,...c}},paths:{[`${t.replace(/\/$/,"")}/{id}/metadata`]:{get:u(`${a}MultipartGetFileMeta`,e)},[`${t.replace(/\/$/,"")}/{id}`]:{delete:{description:"Cancel upload",operationId:`${a}MultipartCancel`,parameters:[{$ref:"#/components/parameters/UploadIDinPath"}],responses:{204:{description:"No Content"}},summary:"Cancel upload",tags:e},get:h(`${a}TusGetFile`,e,i,s)},[t.trimEnd()]:{get:f(`${a}MultipartGetList`,e),post:{description:"Create upload",operationId:`${a}MultipartCreate`,requestBody:{content:{"multipart/form-data":{schema:{properties:{file:{description:"File to upload",format:"binary",type:"string"},metadata:{description:"JSON stringifies metadata",example:'{ "name": "video.mp4", "mimeType": "video/mp4", "size": 741, "lastModified": 1631750105530 }',type:"string"}},type:"object"}}},description:"Upload Metadata",required:!1},responses:{200:{description:"The file already exists, send a resume request",headers:{ETag:{description:"Upload ETag",schema:{example:"d41d8cd98f00b204e9800998ecf8427e",type:"string"}},Location:{description:"Resumable URI",schema:{example:`${r}/files?uploadType=Upload&upload_id=2b62dbec20048158af963572fbdf89c6`,format:"uri",type:"string"}},"X-Upload-Expires":{description:"Upload expiration date",schema:{example:"2021-08-25T11:12:26.635Z",format:"date-time",type:"string"}}}},201:{description:"Upload accepted, send the file contents",headers:{ETag:{description:"Upload ETag",schema:{example:"d41d8cd98f00b204e9800998ecf8427e",type:"string"}},Location:{description:"Resumable URI",schema:{example:`${r}/files?uploadType=Upload&upload_id=2b62dbec20048158af963572fbdf89c6`,format:"uri",type:"string"}},"X-Upload-Expires":{description:"Upload expiration date",schema:{example:"2021-08-25T11:12:26.635Z",format:"date-time",type:"string"}}}},400:{content:{"application/json":{example:{error:{code:"InvalidFileName",message:"Invalid file name",name:"ValidationError"}},schema:{$ref:"#/components/schemas/Error"}}},description:"Bad Request"},413:{content:{"application/json":{example:{error:{code:"RequestEntityTooLarge",message:"Request entity too large",name:"ValidationError"}},schema:{$ref:"#/components/schemas/Error"}}},description:"Request Entity Too Large"},415:{content:{"application/json":{example:{error:{code:"UnsupportedMediaType",message:"Unsupported media type",name:"ValidationError"}},schema:{$ref:"#/components/schemas/Error"}}},description:"Unsupported Media Type"},423:{content:{"application/json":{example:{error:{code:"FileLocked",message:"File locked"}},schema:{$ref:"#/components/schemas/Error"}}},description:"File locked"},500:{content:{"application/json":{example:{error:{code:"GenericUploadError",message:"Generic Upload Error"}},schema:{$ref:"#/components/schemas/Error"}}},description:"Internal Server Error"},default:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Error"}},summary:"Create upload",tags:e}}}}};export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=e=>{const s=e?.accessKeyId??process.env.AWS_ACCESS_KEY_ID??process.env.YANDEX_ACCESS_KEY_ID,c=e?.endpoint??process.env.YANDEX_ENDPOINT,o=e?.region??process.env.AWS_REGION??process.env.YANDEX_REGION??"ru-central1",n=e?.secretAccessKey??process.env.AWS_SECRET_ACCESS_KEY??process.env.YANDEX_SECRET_ACCESS_KEY;if(!s||!n)throw new Error("Missing required parameters for Yandex Object Storage client.");return{credentials:{accessKeyId:s,secretAccessKey:n},endpoint:c??"https://storage.yandexcloud.net",forcePathStyle:!1,region:o}};export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as o}from"../../../packem_shared/akamai-
|
|
1
|
+
import{default as o}from"../../../packem_shared/akamai-BPAk4688.js";import{default as t}from"../../../packem_shared/alibaba-CPhhkaQs.js";import{default as l}from"../../../packem_shared/backblaze-CjeWkpeg.js";import{default as d}from"../../../packem_shared/cloudflare-CijqmNaq.js";import{default as m}from"../../../packem_shared/digitalOcean-BE_d_CcF.js";import{default as p}from"../../../packem_shared/exoscale-BzXbsZ3A.js";import{default as b}from"../../../packem_shared/filebase-pfolz904.js";import{default as n}from"../../../packem_shared/hetzner-CaLW6ANw.js";import{default as C}from"../../../packem_shared/ibmCos-Dbcs7XEJ.js";import{default as h}from"../../../packem_shared/idriveE2-BiiGl7tr.js";import{default as w}from"../../../packem_shared/minio-CC_RGR-q.js";import{default as z}from"../../../packem_shared/oracleCloud-eAWm6voZ.js";import{default as E}from"../../../packem_shared/ovhCloud-D00DprwO.js";import{default as q}from"../../../packem_shared/scaleway-Dms2IqTd.js";import{default as B}from"../../../packem_shared/storj-DzEePQoh.js";import{default as F}from"../../../packem_shared/tencent-7P8z8AwE.js";import{default as H}from"../../../packem_shared/tigris-DlNWhmsM.js";import{default as J}from"../../../packem_shared/vultr-Crvmg314.js";import{default as L}from"../../../packem_shared/wasabi-CyCMxoUT.js";import{default as N}from"../../../packem_shared/yandex-D1HwCz7g.js";export{o as akamai,t as alibaba,l as backblaze,d as cloudflare,m as digitalOcean,p as exoscale,b as filebase,n as hetzner,C as ibmCos,h as idriveE2,w as minio,z as oracleCloud,E as ovhCloud,q as scaleway,B as storj,F as tencent,H as tigris,J as vultr,L as wasabi,N as yandex};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-ks99NSs-.js";
|
|
1
|
+
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-BmuspwCF.js";
|
|
2
|
+
import { F as File, u as MetaStorageOptions, i as BaseStorageOptions, L as LocalMetaStorageOptions, M as MetaStorage, s as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-C9EdfTf1.js";
|
|
4
3
|
import { S3ClientConfig, ObjectCannedACL, S3Client } from '@aws-sdk/client-s3';
|
|
5
4
|
import { ResponseMetadata } from '@aws-sdk/types';
|
|
5
|
+
import { Readable } from 'node:stream';
|
|
6
6
|
import 'node:timers';
|
|
7
7
|
import 'node:crypto';
|
|
8
8
|
import 'node:http';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as t}from"../../packem_shared/S3File-
|
|
1
|
+
import{default as t}from"../../packem_shared/S3File-CyL0Q6Nx.js";import{default as r}from"../../packem_shared/S3MetaStorage-DszTVQMa.js";import{default as S}from"../../packem_shared/S3Storage-Bdns7a3N.js";export{t as S3File,r as S3MetaStorage,S as S3Storage};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-
|
|
2
|
-
import { F as File,
|
|
1
|
+
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-BmuspwCF.js";
|
|
2
|
+
import { F as File, u as MetaStorageOptions, i as BaseStorageOptions, M as MetaStorage, s as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-C9EdfTf1.js";
|
|
3
3
|
import { Readable } from 'node:stream';
|
|
4
4
|
import { AwsClient } from 'aws4fetch';
|
|
5
5
|
import 'node:timers';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as
|
|
1
|
+
import{default as e}from"../../packem_shared/AwsLightFile-CqeZ6M7o.js";import{a as r}from"../../packem_shared/aws-light-meta-storage-CgGLgB8g.js";import{default as f}from"../../packem_shared/AwsLightStorage-Bhg6C3fo.js";export{e as AwsLightFile,r as AwsLightMetaStorage,f as AwsLightStorage};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { F as File,
|
|
2
|
-
import 'node:stream';
|
|
1
|
+
import { F as File, u as MetaStorageOptions, L as LocalMetaStorageOptions, i as BaseStorageOptions, M as MetaStorage, R as RetryConfig, d as FileInit, O as OperationOptions, f as FileQuery, l as BatchOperationResponse, e as FilePart, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-C9EdfTf1.js";
|
|
3
2
|
import { TokenCredential } from '@azure/core-auth';
|
|
4
3
|
import { BlobServiceClient } from '@azure/storage-blob';
|
|
4
|
+
import 'node:stream';
|
|
5
5
|
import 'node:timers';
|
|
6
6
|
import 'node:crypto';
|
|
7
7
|
import 'node:http';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/AzureFile-
|
|
1
|
+
import{default as a}from"../../packem_shared/AzureFile-DoUVXQMI.js";import{A as t}from"../../packem_shared/azure-meta-storage-DmBO5MmP.js";import{default as u}from"../../packem_shared/AzureStorage-BzYWVRnX.js";export{a as AzureFile,t as AzureSMetaStorage,u as AzureStorage};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions,
|
|
2
|
-
import
|
|
3
|
-
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, i as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-C9EdfTf1.js";
|
|
2
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-CYWYyCUo.js";
|
|
4
3
|
import { BoxClient } from 'box-typescript-sdk-gen';
|
|
4
|
+
import 'node:stream';
|
|
5
5
|
import 'node:timers';
|
|
6
6
|
import 'node:crypto';
|
|
7
7
|
import 'node:http';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/BoxFile-
|
|
1
|
+
import{default as a}from"../../packem_shared/BoxFile-CKKRYACc.js";import{default as r}from"../../packem_shared/BoxMetaStorage-BI-G6aeO.js";import{default as x}from"../../packem_shared/BoxStorage-Bmzt-OTx.js";export{a as BoxFile,r as BoxMetaStorage,x as BoxStorage};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions,
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, i as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-C9EdfTf1.js";
|
|
2
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-CYWYyCUo.js";
|
|
2
3
|
import { Readable } from 'node:stream';
|
|
3
|
-
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
4
4
|
import 'node:timers';
|
|
5
5
|
import 'node:crypto';
|
|
6
6
|
import 'node:http';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as t}from"../../packem_shared/BunS3File-
|
|
1
|
+
import{default as t}from"../../packem_shared/BunS3File-B2rczbY_.js";import{default as r}from"../../packem_shared/BunS3MetaStorage-BI-G6aeO.js";import{default as u}from"../../packem_shared/BunS3Storage-uJ-u5wpg.js";export{t as BunS3File,r as BunS3MetaStorage,u as BunS3Storage};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions,
|
|
2
|
-
import
|
|
3
|
-
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, i as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-C9EdfTf1.js";
|
|
2
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-CYWYyCUo.js";
|
|
4
3
|
import * as BunnyStorageSDK from '@bunny.net/storage-sdk';
|
|
4
|
+
import 'node:stream';
|
|
5
5
|
import 'node:timers';
|
|
6
6
|
import 'node:crypto';
|
|
7
7
|
import 'node:http';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as t}from"../../packem_shared/BunnyFile-
|
|
1
|
+
import{default as t}from"../../packem_shared/BunnyFile-CBJdpNcB.js";import{default as r}from"../../packem_shared/BunnyMetaStorage-BI-G6aeO.js";import{default as n}from"../../packem_shared/BunnyStorage-9fw8VeuO.js";export{t as BunnyFile,r as BunnyMetaStorage,n as BunnyStorage};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions,
|
|
2
|
-
import
|
|
3
|
-
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, i as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-C9EdfTf1.js";
|
|
2
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-CYWYyCUo.js";
|
|
4
3
|
import { v2 } from 'cloudinary';
|
|
4
|
+
import 'node:stream';
|
|
5
5
|
import 'node:timers';
|
|
6
6
|
import 'node:crypto';
|
|
7
7
|
import 'node:http';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as r}from"../../packem_shared/CloudinaryFile-
|
|
1
|
+
import{default as r}from"../../packem_shared/CloudinaryFile-Dl8cnbJo.js";import{default as t}from"../../packem_shared/CloudinaryMetaStorage-CYWznm7F.js";import{default as d}from"../../packem_shared/CloudinaryStorage-CRVFUrEK.js";export{r as CloudinaryFile,t as CloudinaryMetaStorage,d as CloudinaryStorage};
|