@visulima/storage 1.0.0-alpha.2 → 1.0.0-alpha.20
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 +252 -0
- package/LICENSE.md +1256 -512
- package/README.md +4 -4
- package/dist/adapter/nuxt/module.d.ts +41 -34
- package/dist/adapter/nuxt/module.js +1 -93
- package/dist/handler/http/fetch/index.d.ts +297 -4
- package/dist/handler/http/fetch/index.js +1 -4
- package/dist/handler/http/hono/index.d.ts +1474 -58
- package/dist/handler/http/hono/index.js +1 -65
- package/dist/handler/http/nextjs/index.d.ts +66 -58
- package/dist/handler/http/nextjs/index.js +1 -37
- package/dist/handler/http/node/index.d.ts +361 -4
- package/dist/handler/http/node/index.js +1 -4
- package/dist/handler/http/solid-start/index.d.ts +66 -57
- package/dist/handler/http/solid-start/index.js +1 -44
- package/dist/index.d.ts +376 -17
- package/dist/index.js +1 -13
- package/dist/openapi/index.d.ts +24 -5
- package/dist/openapi/index.js +1 -5
- package/dist/packem_shared/AwsLightFile-BTLiRxXj.js +1 -0
- package/dist/packem_shared/AwsLightMetaStorage-DHz1nf_H.js +1 -0
- package/dist/packem_shared/AwsLightStorage-CA9cdfJ6.js +1 -0
- package/dist/packem_shared/AzureFile-BKHru1zB.js +1 -0
- package/dist/packem_shared/AzureSMetaStorage-BqA4jUDJ.js +1 -0
- package/dist/packem_shared/AzureStorage-BKUjCymW.js +1 -0
- package/dist/packem_shared/BaseTransformer-D68eLyz1.js +1 -0
- package/dist/packem_shared/DiskStorage-DNjpDMX9.js +1 -0
- package/dist/packem_shared/DiskStorageWithChecksum-Bb6JX_tC.js +1 -0
- package/dist/packem_shared/ERRORS-B9jkvKwx.js +1 -0
- package/dist/packem_shared/File-alcSNpLq.js +1 -0
- package/dist/packem_shared/GCSConfig-BQ0OpVhe.js +1 -0
- package/dist/packem_shared/GCSFile-CHjX_fJk.js +1 -0
- package/dist/packem_shared/GCSMetaStorage-1UQIN9IN.js +1 -0
- package/dist/packem_shared/GCStorage-PJRb2WWC.js +1 -0
- package/dist/packem_shared/LocalMetaStorage-BWuFvWn4.js +1 -0
- package/dist/packem_shared/MediaTransformer-2C8MJeAg.js +1 -0
- package/dist/packem_shared/MetaStorage-Y4m1dWgd.js +1 -0
- package/dist/packem_shared/Metadata-B6Ir0KO7.js +1 -0
- package/dist/packem_shared/Multipart-Bd9YFFn0.js +1 -0
- package/dist/packem_shared/Multipart-D5bcEvga.js +1 -0
- package/dist/packem_shared/NetlifyBlobFile-CpzkMKng.js +1 -0
- package/dist/packem_shared/NetlifyBlobMetaStorage-dD0oBLom.js +1 -0
- package/dist/packem_shared/NetlifyBlobStorage-ByTwCN-h.js +1 -0
- package/dist/packem_shared/NoOpMetrics-Dky06sf1.js +1 -0
- package/dist/packem_shared/OpenTelemetryMetrics-9uxQMSlg.js +1 -0
- package/dist/packem_shared/Rest-CYEBbtCD.js +1 -0
- package/dist/packem_shared/Rest-DoonVU7B.js +1 -0
- package/dist/packem_shared/S3Client.d-CZ62Jztg.d.ts +20357 -0
- package/dist/packem_shared/S3File-Du6wP0Sz.js +1 -0
- package/dist/packem_shared/S3MetaStorage-vcriiosn.js +1 -0
- package/dist/packem_shared/S3Storage-Fx6-OSc-.js +1 -0
- package/dist/packem_shared/TUS_RESUMABLE-B7KtPVeC.js +1 -0
- package/dist/packem_shared/Tus-Bd_2Ki2G.js +1 -0
- package/dist/packem_shared/Tus-CUBCkuPE.js +1 -0
- package/dist/packem_shared/ValidationError-D8KKJiKA.js +1 -0
- package/dist/packem_shared/VercelBlobFile-CL9MjKcY.js +1 -0
- package/dist/packem_shared/VercelBlobMetaStorage-BsOTx-Su.js +1 -0
- package/dist/packem_shared/VercelBlobStorage-kNkk5Cn4.js +1 -0
- package/dist/packem_shared/_commonjsHelpers-D6W6KoPK.js +1 -0
- package/dist/packem_shared/aws-light-meta-storage-TPyQwLvk.js +4 -0
- package/dist/packem_shared/backblaze-DEflv87m.js +1 -0
- package/dist/packem_shared/base-handler-core-DaggCVsq.js +1 -0
- package/dist/packem_shared/base-handler-fetch-DnarP64X.js +1 -0
- package/dist/packem_shared/base-handler-node-BTes6sql.js +1 -0
- package/dist/packem_shared/cache-qV_5Umeq.js +1 -0
- package/dist/packem_shared/cloudflare-DLAeQvgD.js +1 -0
- package/dist/packem_shared/defaultCloudStorageFileNameValidation-yiM9GxHr.js +1 -0
- package/dist/packem_shared/digitalOcean-nhZUds87.js +1 -0
- package/dist/packem_shared/disk-storage-BvdK4bqF.js +5 -0
- package/dist/packem_shared/disk-storage-with-checksum.d-hEoe2ugb.d.ts +148 -0
- package/dist/packem_shared/gcs-meta-storage-DXqBZ3Xm.js +1 -0
- package/dist/packem_shared/has-content-Bx2p8Okx.js +1 -0
- package/dist/packem_shared/headers-DC2MEOrK.js +27 -0
- package/dist/packem_shared/is-expired-1JuZjDtb.js +1 -0
- package/dist/packem_shared/isRetryableError-DQNSZiBc.js +1 -0
- package/dist/packem_shared/isValidMediaType-B-2UKjZx.js +1 -0
- package/dist/packem_shared/local-meta-storage-Bkwqi_gi.js +1 -0
- package/dist/packem_shared/local-meta-storage.d-Dop9RP9k.d.ts +20 -0
- package/dist/packem_shared/media-transformer.d-LGdEjx6A.d.ts +331 -0
- package/dist/packem_shared/minio-BWwgGXeE.js +1 -0
- package/dist/packem_shared/multipart-base-C6OjBwMS.js +1 -0
- package/dist/packem_shared/part-match-DqD5U7An.js +1 -0
- package/dist/packem_shared/path-D7rMc9nq-B718mbm6.js +1 -0
- package/dist/packem_shared/response-builder-Wdo_fvcF.js +1 -0
- package/dist/packem_shared/rest-base-B2Dv7esY.js +1 -0
- package/dist/packem_shared/restOpenApiSpec-PaIVbESh.js +1 -0
- package/dist/packem_shared/s3-base-storage-xHZNtsGe.js +1 -0
- package/dist/packem_shared/s3-base-storage.d-CczjSe98.d.ts +251 -0
- package/dist/packem_shared/sharedGet-Ce7WGAsc.js +1 -0
- package/dist/packem_shared/storage-m_Cxgiih.js +1 -0
- package/dist/packem_shared/storage.d-BOMUJD96.d.ts +939 -0
- package/dist/packem_shared/tigris-DZoyrMNd.js +1 -0
- package/dist/packem_shared/transformOpenApiSpec-C0vEbDTO.js +1 -0
- package/dist/packem_shared/tus-base.d-C20dSee8.d.ts +99 -0
- package/dist/packem_shared/tusOpenApiSpec-DF0-hlWV.js +1 -0
- package/dist/packem_shared/types.d-B4hqF6yH.d.ts +708 -0
- package/dist/packem_shared/types.d-CNvyxOka.d.ts +49 -0
- package/dist/packem_shared/update-size-DANV7aa2.js +1 -0
- package/dist/packem_shared/validator-DK41xp8N.js +1 -0
- package/dist/packem_shared/waitForStorage-ChSBLhLc.js +1 -0
- package/dist/packem_shared/wasabi-Dmce4x9s.js +1 -0
- package/dist/packem_shared/xhrOpenApiSpec-nyoboz83.js +1 -0
- package/dist/storage/aws/clients/index.d.ts +166 -6
- package/dist/storage/aws/clients/index.js +1 -6
- package/dist/storage/aws/index.d.ts +320 -4
- package/dist/storage/aws/index.js +1 -3
- package/dist/storage/aws-light/index.d.ts +252 -4
- package/dist/storage/aws-light/index.js +1 -3
- package/dist/storage/azure/index.d.ts +10422 -4
- package/dist/storage/azure/index.js +1 -3
- package/dist/storage/gcs/index.d.ts +4107 -5
- package/dist/storage/gcs/index.js +1 -4
- package/dist/storage/local/index.d.ts +7 -4
- package/dist/storage/local/index.js +1 -3
- package/dist/storage/netlify-blob/index.d.ts +142 -4
- package/dist/storage/netlify-blob/index.js +1 -3
- package/dist/storage/vercel-blob/index.d.ts +129 -4
- package/dist/storage/vercel-blob/index.js +1 -3
- package/dist/transformer/audio-transformer.d.ts +127 -125
- package/dist/transformer/audio-transformer.js +1 -278
- package/dist/transformer/image-transformer.d.ts +569 -568
- package/dist/transformer/image-transformer.js +1 -1100
- package/dist/transformer/index.d.ts +62 -5
- package/dist/transformer/index.js +1 -4
- package/dist/transformer/video-transformer.d.ts +144 -142
- package/dist/transformer/video-transformer.js +1 -310
- package/package.json +60 -60
- package/dist/handler/base/base-handler-core.d.ts +0 -91
- package/dist/handler/base/base-handler-fetch.d.ts +0 -76
- package/dist/handler/base/base-handler-node.d.ts +0 -137
- package/dist/handler/multipart/multipart-base.d.ts +0 -84
- package/dist/handler/multipart/multipart-fetch.d.ts +0 -64
- package/dist/handler/multipart/multipart.d.ts +0 -49
- package/dist/handler/rest/rest-base.d.ts +0 -106
- package/dist/handler/rest/rest-fetch.d.ts +0 -88
- package/dist/handler/rest/rest.d.ts +0 -93
- package/dist/handler/tus/tus-base.d.ts +0 -152
- package/dist/handler/tus/tus-fetch.d.ts +0 -72
- package/dist/handler/tus/tus.d.ts +0 -78
- package/dist/handler/types.d.ts +0 -53
- package/dist/handler/utils/request-parser.d.ts +0 -72
- package/dist/handler/utils/response-builder.d.ts +0 -83
- package/dist/handler/utils/storage-utils.d.ts +0 -10
- package/dist/handler/utils/stream-utils.d.ts +0 -29
- package/dist/handler/utils/upload-handlers.d.ts +0 -76
- package/dist/metrics/index.d.ts +0 -2
- package/dist/metrics/no-op-metrics.d.ts +0 -15
- package/dist/metrics/opentelemetry-metrics.d.ts +0 -55
- package/dist/openapi/rest.d.ts +0 -7
- package/dist/openapi/shared.d.ts +0 -13
- package/dist/openapi/transform.d.ts +0 -3
- package/dist/openapi/tus.d.ts +0 -7
- package/dist/openapi/xhr.d.ts +0 -7
- package/dist/packem_shared/AwsLightFile-tTneXZgG.js +0 -11
- package/dist/packem_shared/AwsLightMetaStorage-BWSOtVaN.js +0 -4
- package/dist/packem_shared/AwsLightStorage-Cwkkc-z3.js +0 -133
- package/dist/packem_shared/AzureFile-CesgFzps.js +0 -8
- package/dist/packem_shared/AzureSMetaStorage-CFs-OYJT.js +0 -88
- package/dist/packem_shared/AzureStorage-9MoV2W8q.js +0 -357
- package/dist/packem_shared/BaseTransformer-C2gLib6v.js +0 -82
- package/dist/packem_shared/DiskStorage-CJtTzMQ3.js +0 -12
- package/dist/packem_shared/DiskStorageWithChecksum-BgrG8pvC.js +0 -238
- package/dist/packem_shared/ERRORS-D0apMqnc.js +0 -97
- package/dist/packem_shared/File-Bb3P23dr.js +0 -69
- package/dist/packem_shared/GCSConfig-vPP22kN6.js +0 -11
- package/dist/packem_shared/GCSFile-BIEunhAN.js +0 -8
- package/dist/packem_shared/GCSMetaStorage-sYiSjLUx.js +0 -7
- package/dist/packem_shared/GCStorage-DPl1_DAm.js +0 -406
- package/dist/packem_shared/LocalMetaStorage-CZHhKkMd.js +0 -7
- package/dist/packem_shared/MediaTransformer-D6658DL1.js +0 -1197
- package/dist/packem_shared/MetaStorage-pECeFOad.js +0 -46
- package/dist/packem_shared/Metadata-DRLXeJ0F.js +0 -89
- package/dist/packem_shared/Multipart-CNFK_Okz.js +0 -163
- package/dist/packem_shared/Multipart-CtUL7BQw.js +0 -128
- package/dist/packem_shared/NetlifyBlobFile-CXzyjqrD.js +0 -14
- package/dist/packem_shared/NetlifyBlobMetaStorage-DxZ5aDvD.js +0 -9
- package/dist/packem_shared/NetlifyBlobStorage-C6AX-X0P.js +0 -376
- package/dist/packem_shared/NoOpMetrics-DhAk5rXc.js +0 -10
- package/dist/packem_shared/OpenTelemetryMetrics-BnxhqIaH.js +0 -67
- package/dist/packem_shared/Rest-CAOAEkOj.js +0 -267
- package/dist/packem_shared/Rest-DNuLwBrK.js +0 -228
- package/dist/packem_shared/S3File-DZiyk9Qt.js +0 -11
- package/dist/packem_shared/S3MetaStorage-Dz9aDabA.js +0 -76
- package/dist/packem_shared/S3Storage-CgheE2yH.js +0 -316
- package/dist/packem_shared/TUS_RESUMABLE-GJzZ9R-f.js +0 -434
- package/dist/packem_shared/Tus-B8PmlMgR.js +0 -200
- package/dist/packem_shared/Tus-C4F1aYOl.js +0 -195
- package/dist/packem_shared/ValidationError-BfF1aE4h.js +0 -26
- package/dist/packem_shared/VercelBlobFile-BCg4aTEq.js +0 -18
- package/dist/packem_shared/VercelBlobMetaStorage-Bd9F-VFm.js +0 -9
- package/dist/packem_shared/VercelBlobStorage-BbuEYhOz.js +0 -261
- package/dist/packem_shared/_commonjsHelpers-B85MJLTf.js +0 -5
- package/dist/packem_shared/aws-light-meta-storage-DKJBgbR6.js +0 -446
- package/dist/packem_shared/backblaze-BlMnIcBC.js +0 -20
- package/dist/packem_shared/base-handler-core-BKuf4YLT.js +0 -303
- package/dist/packem_shared/base-handler-fetch-Cr0hLiqg.js +0 -291
- package/dist/packem_shared/base-handler-node-gk5aN9Cx.js +0 -730
- package/dist/packem_shared/cache-B88MXQ_2.js +0 -18
- package/dist/packem_shared/cloudflare-Bi1q8wXE.js +0 -21
- package/dist/packem_shared/defaultCloudStorageFileNameValidation-oVDgf-Sw.js +0 -11
- package/dist/packem_shared/digitalOcean-CWQRJM3L.js +0 -21
- package/dist/packem_shared/disk-storage-DkDoHnKB.js +0 -810
- package/dist/packem_shared/gcs-meta-storage-etw4wuh5.js +0 -158
- package/dist/packem_shared/has-content-CY66ehMK.js +0 -3
- package/dist/packem_shared/headers-DoS5nwM-.js +0 -3220
- package/dist/packem_shared/is-expired-CTThU1q5.js +0 -8
- package/dist/packem_shared/isRetryableError-Dycp7127.js +0 -82
- package/dist/packem_shared/isValidMediaType-BeDgiObq.js +0 -35
- package/dist/packem_shared/local-meta-storage-By-3SNBI.js +0 -649
- package/dist/packem_shared/minio-C2YBZQOw.js +0 -22
- package/dist/packem_shared/multipart-base-B3i67SSX.js +0 -102
- package/dist/packem_shared/part-match-BMNqHDYD.js +0 -96
- package/dist/packem_shared/path-CR6YkPXX-7R1-9CMk.js +0 -161
- package/dist/packem_shared/response-builder-BtnRiBUI.js +0 -45
- package/dist/packem_shared/rest-base-GRCcnan7.js +0 -457
- package/dist/packem_shared/restOpenApiSpec-CwcHHY2C.js +0 -800
- package/dist/packem_shared/s3-base-storage-xw6NJFX7.js +0 -510
- package/dist/packem_shared/sharedGet-Cpo7QUyu.js +0 -1019
- package/dist/packem_shared/storage-BwdYUHs3.js +0 -864
- package/dist/packem_shared/tigris-Hac8TKnX.js +0 -21
- package/dist/packem_shared/transformOpenApiSpec-DWM5WtnN.js +0 -975
- package/dist/packem_shared/tusOpenApiSpec-6ohiToBy.js +0 -740
- package/dist/packem_shared/update-size-CCGm6i1J.js +0 -8
- package/dist/packem_shared/validator-BeX_lJet.js +0 -78
- package/dist/packem_shared/waitForStorage-Cscw85sx.js +0 -18
- package/dist/packem_shared/wasabi-DIyflHSd.js +0 -21
- package/dist/packem_shared/xhrOpenApiSpec-DS17brnx.js +0 -264
- package/dist/storage/aws/clients/backblaze.d.ts +0 -12
- package/dist/storage/aws/clients/cloudflare.d.ts +0 -13
- package/dist/storage/aws/clients/digital-ocean.d.ts +0 -12
- package/dist/storage/aws/clients/minio.d.ts +0 -13
- package/dist/storage/aws/clients/tigris.d.ts +0 -12
- package/dist/storage/aws/clients/types.d.ts +0 -95
- package/dist/storage/aws/clients/wasabi.d.ts +0 -12
- package/dist/storage/aws/s3-base-storage.d.ts +0 -248
- package/dist/storage/aws/s3-client-adapter.d.ts +0 -110
- package/dist/storage/aws/s3-file.d.ts +0 -10
- package/dist/storage/aws/s3-meta-storage.d.ts +0 -15
- package/dist/storage/aws/s3-storage.d.ts +0 -70
- package/dist/storage/aws/types.d.ts +0 -119
- package/dist/storage/aws-light/aws-light-api-adapter.d.ts +0 -130
- package/dist/storage/aws-light/aws-light-file.d.ts +0 -10
- package/dist/storage/aws-light/aws-light-meta-storage.d.ts +0 -19
- package/dist/storage/aws-light/aws-light-storage.d.ts +0 -65
- package/dist/storage/aws-light/types.d.ts +0 -37
- package/dist/storage/azure/azure-file.d.ts +0 -6
- package/dist/storage/azure/azure-meta-storage.d.ts +0 -15
- package/dist/storage/azure/azure-storage.d.ts +0 -69
- package/dist/storage/azure/types.d.ts +0 -62
- package/dist/storage/gcs/fetch-error.d.ts +0 -11
- package/dist/storage/gcs/gcs-config.d.ts +0 -2
- package/dist/storage/gcs/gcs-file.d.ts +0 -6
- package/dist/storage/gcs/gcs-meta-storage.d.ts +0 -27
- package/dist/storage/gcs/gcs-storage.d.ts +0 -91
- package/dist/storage/gcs/types.d.ts +0 -55
- package/dist/storage/gcs/utils.d.ts +0 -7
- package/dist/storage/local/disk-storage-with-checksum.d.ts +0 -15
- package/dist/storage/local/disk-storage.d.ts +0 -135
- package/dist/storage/local/local-meta-storage.d.ts +0 -32
- package/dist/storage/meta-storage.d.ts +0 -30
- package/dist/storage/netlify-blob/netlify-blob-file.d.ts +0 -12
- package/dist/storage/netlify-blob/netlify-blob-meta-storage.d.ts +0 -7
- package/dist/storage/netlify-blob/netlify-blob-storage.d.ts +0 -93
- package/dist/storage/netlify-blob/types.d.ts +0 -30
- package/dist/storage/storage.d.ts +0 -353
- package/dist/storage/types.d.ts +0 -221
- package/dist/storage/utils/file/file.d.ts +0 -25
- package/dist/storage/utils/file/get-file-status.d.ts +0 -9
- package/dist/storage/utils/file/has-content.d.ts +0 -9
- package/dist/storage/utils/file/index.d.ts +0 -10
- package/dist/storage/utils/file/is-expired.d.ts +0 -8
- package/dist/storage/utils/file/metadata.d.ts +0 -18
- package/dist/storage/utils/file/part-match.d.ts +0 -11
- package/dist/storage/utils/file/types.d.ts +0 -37
- package/dist/storage/utils/file/update-metadata.d.ts +0 -10
- package/dist/storage/utils/file/update-size.d.ts +0 -10
- package/dist/storage/vercel-blob/types.d.ts +0 -32
- package/dist/storage/vercel-blob/vercel-blob-file.d.ts +0 -16
- package/dist/storage/vercel-blob/vercel-blob-meta-storage.d.ts +0 -7
- package/dist/storage/vercel-blob/vercel-blob-storage.d.ts +0 -76
- package/dist/transformer/base-transformer.d.ts +0 -63
- package/dist/transformer/media-transformer.d.ts +0 -332
- package/dist/transformer/types.d.ts +0 -652
- package/dist/transformer/utils.d.ts +0 -33
- package/dist/transformer/validation-error.d.ts +0 -23
- package/dist/utils/cache.d.ts +0 -32
- package/dist/utils/chunked-upload.d.ts +0 -65
- package/dist/utils/detect-file-type.d.ts +0 -28
- package/dist/utils/errors.d.ts +0 -74
- package/dist/utils/file-path-url-matcher.d.ts +0 -18
- package/dist/utils/headers.d.ts +0 -111
- package/dist/utils/http.d.ts +0 -92
- package/dist/utils/locker.d.ts +0 -26
- package/dist/utils/pipes/stream-checksum.d.ts +0 -47
- package/dist/utils/pipes/stream-length.d.ts +0 -22
- package/dist/utils/primitives/get-last-one.d.ts +0 -3
- package/dist/utils/primitives/is-record.d.ts +0 -2
- package/dist/utils/primitives/map-values.d.ts +0 -9
- package/dist/utils/primitives/pick.d.ts +0 -2
- package/dist/utils/primitives/to-milliseconds.d.ts +0 -12
- package/dist/utils/primitives/to-seconds.d.ts +0 -12
- package/dist/utils/range-checksum.d.ts +0 -33
- package/dist/utils/range-hasher.d.ts +0 -46
- package/dist/utils/retry.d.ts +0 -64
- package/dist/utils/types.d.ts +0 -108
- package/dist/utils/validation-error.d.ts +0 -22
- package/dist/utils/validator.d.ts +0 -36
|
@@ -1,4 +1,252 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { P as Part, S as S3ApiOperations, a as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-CczjSe98.js";
|
|
2
|
+
import { F as File, m as MetaStorageOptions, k as BaseStorageOptions, M as MetaStorage, H as HttpError, e as FileQuery, b as FileInit } from "../../packem_shared/storage.d-BOMUJD96.js";
|
|
3
|
+
import { Readable } from 'node:stream';
|
|
4
|
+
import 'node:crypto';
|
|
5
|
+
import 'node:http';
|
|
6
|
+
import 'lru-cache';
|
|
7
|
+
declare class AwsLightFile extends File {
|
|
8
|
+
Parts?: Part[];
|
|
9
|
+
UploadId?: string;
|
|
10
|
+
uri?: string;
|
|
11
|
+
partsUrls?: string[];
|
|
12
|
+
partSize?: number;
|
|
13
|
+
}
|
|
14
|
+
interface AwsLightClientConfig {
|
|
15
|
+
accessKeyId: string;
|
|
16
|
+
endpoint?: string;
|
|
17
|
+
region: string;
|
|
18
|
+
secretAccessKey: string;
|
|
19
|
+
service?: string;
|
|
20
|
+
sessionToken?: string;
|
|
21
|
+
}
|
|
22
|
+
type AwsLightMetaStorageOptions = AwsLightClientConfig & MetaStorageOptions & {
|
|
23
|
+
bucket?: string;
|
|
24
|
+
};
|
|
25
|
+
type AwsLightStorageOptions = AwsLightClientConfig & BaseStorageOptions & {
|
|
26
|
+
/**
|
|
27
|
+
* S3 bucket name.
|
|
28
|
+
*/
|
|
29
|
+
bucket?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Force compatible client upload directly to S3 storage
|
|
32
|
+
*/
|
|
33
|
+
clientDirectUpload?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Configure metafiles storage
|
|
36
|
+
*/
|
|
37
|
+
metaStorageConfig?: AwsLightMetaStorageOptions;
|
|
38
|
+
/**
|
|
39
|
+
* The parts size that the client should use for presigned multipart unloading.
|
|
40
|
+
* @default '16MB'
|
|
41
|
+
*/
|
|
42
|
+
partSize?: number | string;
|
|
43
|
+
};
|
|
44
|
+
interface AwsLightError extends Error {
|
|
45
|
+
code?: string;
|
|
46
|
+
requestId?: string;
|
|
47
|
+
statusCode?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* AWS Light meta storage implementation using aws4fetch.
|
|
51
|
+
* Stores metadata in S3 object metadata headers (x-amz-meta-*).
|
|
52
|
+
* Optimized for worker environments (Cloudflare Workers, Web Workers, etc.).
|
|
53
|
+
*/
|
|
54
|
+
declare class AwsLightMetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
55
|
+
config: AwsLightMetaStorageOptions;
|
|
56
|
+
private readonly adapter;
|
|
57
|
+
private readonly bucket;
|
|
58
|
+
constructor(config: AwsLightMetaStorageOptions);
|
|
59
|
+
override get(id: string): Promise<T>;
|
|
60
|
+
override touch(id: string, file: T): Promise<T>;
|
|
61
|
+
override delete(id: string): Promise<void>;
|
|
62
|
+
override save(id: string, file: T): Promise<T>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Adapter that uses aws4fetch to implement S3ApiOperations interface.
|
|
66
|
+
*/
|
|
67
|
+
declare class AwsLightApiAdapter implements S3ApiOperations {
|
|
68
|
+
private aws;
|
|
69
|
+
private readonly bucket;
|
|
70
|
+
private readonly endpoint;
|
|
71
|
+
constructor(config: AwsLightClientConfig & {
|
|
72
|
+
bucket: string;
|
|
73
|
+
});
|
|
74
|
+
createMultipartUpload(params: {
|
|
75
|
+
ACL?: string;
|
|
76
|
+
Bucket: string;
|
|
77
|
+
ContentType?: string;
|
|
78
|
+
Key: string;
|
|
79
|
+
Metadata?: Record<string, string>;
|
|
80
|
+
}): Promise<{
|
|
81
|
+
UploadId: string;
|
|
82
|
+
}>;
|
|
83
|
+
uploadPart(params: {
|
|
84
|
+
Body: Readable | ReadableStream | Uint8Array;
|
|
85
|
+
Bucket: string;
|
|
86
|
+
ContentLength?: number;
|
|
87
|
+
ContentMD5?: string;
|
|
88
|
+
Key: string;
|
|
89
|
+
PartNumber: number;
|
|
90
|
+
UploadId: string;
|
|
91
|
+
}): Promise<{
|
|
92
|
+
ETag: string;
|
|
93
|
+
}>;
|
|
94
|
+
completeMultipartUpload(params: {
|
|
95
|
+
Bucket: string;
|
|
96
|
+
Key: string;
|
|
97
|
+
Parts: {
|
|
98
|
+
ETag: string;
|
|
99
|
+
PartNumber: number;
|
|
100
|
+
}[];
|
|
101
|
+
UploadId: string;
|
|
102
|
+
}): Promise<{
|
|
103
|
+
ETag?: string;
|
|
104
|
+
Location: string;
|
|
105
|
+
}>;
|
|
106
|
+
abortMultipartUpload(params: {
|
|
107
|
+
Bucket: string;
|
|
108
|
+
Key: string;
|
|
109
|
+
UploadId: string;
|
|
110
|
+
}): Promise<void>;
|
|
111
|
+
listParts(params: {
|
|
112
|
+
Bucket: string;
|
|
113
|
+
Key: string;
|
|
114
|
+
UploadId: string;
|
|
115
|
+
}): Promise<{
|
|
116
|
+
Parts?: Part[];
|
|
117
|
+
}>;
|
|
118
|
+
getObject(params: {
|
|
119
|
+
Bucket: string;
|
|
120
|
+
Key: string;
|
|
121
|
+
}): Promise<{
|
|
122
|
+
Body?: ReadableStream | Readable;
|
|
123
|
+
ContentLength?: number;
|
|
124
|
+
ContentType?: string;
|
|
125
|
+
ETag?: string;
|
|
126
|
+
Expires?: Date;
|
|
127
|
+
LastModified?: Date;
|
|
128
|
+
Metadata?: Record<string, string>;
|
|
129
|
+
}>;
|
|
130
|
+
headObject(params: {
|
|
131
|
+
Bucket: string;
|
|
132
|
+
Key: string;
|
|
133
|
+
}): Promise<{
|
|
134
|
+
ContentLength?: number;
|
|
135
|
+
ContentType?: string;
|
|
136
|
+
ETag?: string;
|
|
137
|
+
Expires?: Date;
|
|
138
|
+
LastModified?: Date;
|
|
139
|
+
Metadata?: Record<string, string>;
|
|
140
|
+
}>;
|
|
141
|
+
deleteObject(params: {
|
|
142
|
+
Bucket: string;
|
|
143
|
+
Key: string;
|
|
144
|
+
}): Promise<void>;
|
|
145
|
+
copyObject(params: {
|
|
146
|
+
Bucket: string;
|
|
147
|
+
CopySource: string;
|
|
148
|
+
Key: string;
|
|
149
|
+
StorageClass?: string;
|
|
150
|
+
}): Promise<void>;
|
|
151
|
+
listObjectsV2(params: {
|
|
152
|
+
Bucket: string;
|
|
153
|
+
ContinuationToken?: string;
|
|
154
|
+
MaxKeys?: number;
|
|
155
|
+
}): Promise<{
|
|
156
|
+
Contents?: {
|
|
157
|
+
Key?: string;
|
|
158
|
+
LastModified?: Date;
|
|
159
|
+
}[];
|
|
160
|
+
IsTruncated?: boolean;
|
|
161
|
+
NextContinuationToken?: string;
|
|
162
|
+
}>;
|
|
163
|
+
getPresignedUrl(params: {
|
|
164
|
+
Bucket: string;
|
|
165
|
+
expiresIn: number;
|
|
166
|
+
Key: string;
|
|
167
|
+
PartNumber: number;
|
|
168
|
+
UploadId: string;
|
|
169
|
+
}): Promise<string>;
|
|
170
|
+
putObject(params: {
|
|
171
|
+
Body?: Uint8Array | ReadableStream;
|
|
172
|
+
Bucket: string;
|
|
173
|
+
ContentLength?: number;
|
|
174
|
+
ContentType?: string;
|
|
175
|
+
Key: string;
|
|
176
|
+
Metadata?: Record<string, string>;
|
|
177
|
+
}): Promise<void>;
|
|
178
|
+
checkBucketAccess(_params: {
|
|
179
|
+
Bucket: string;
|
|
180
|
+
}): Promise<void>;
|
|
181
|
+
/**
|
|
182
|
+
* Builds S3 API URL.
|
|
183
|
+
*/
|
|
184
|
+
private buildUrl;
|
|
185
|
+
/**
|
|
186
|
+
* Converts ReadableStream to Readable for Node.js compatibility.
|
|
187
|
+
*/
|
|
188
|
+
private streamToReadable;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* AWS Light storage implementation using aws4fetch.
|
|
192
|
+
* Optimized for worker environments (Cloudflare Workers, Web Workers, etc.).
|
|
193
|
+
* @example
|
|
194
|
+
* ```ts
|
|
195
|
+
* const storage = new AwsLightStorage({
|
|
196
|
+
* bucket: <YOUR_BUCKET>,
|
|
197
|
+
* region: <YOUR_REGION>,
|
|
198
|
+
* accessKeyId: <YOUR_ACCESS_KEY_ID>,
|
|
199
|
+
* secretAccessKey: <YOUR_SECRET_ACCESS_KEY>
|
|
200
|
+
* });
|
|
201
|
+
* ```
|
|
202
|
+
* @remarks
|
|
203
|
+
* ## Worker Compatibility
|
|
204
|
+
* - Uses aws4fetch for AWS request signing (works in workers)
|
|
205
|
+
* - No Node.js-specific dependencies
|
|
206
|
+
* - Compatible with Cloudflare Workers, Web Workers, and edge runtimes
|
|
207
|
+
*
|
|
208
|
+
* ## Error Handling
|
|
209
|
+
* - S3 API errors are normalized with AWS-specific context
|
|
210
|
+
* - Errors include S3 error codes and status codes for debugging
|
|
211
|
+
*
|
|
212
|
+
* ## Retry Behavior
|
|
213
|
+
* - All S3 API calls are wrapped with configurable retry logic via `retryConfig` option
|
|
214
|
+
* - Default retryable status codes: 408, 429, 500, 502, 503, 504
|
|
215
|
+
* - Custom `shouldRetry` function can be provided for advanced retry logic
|
|
216
|
+
*
|
|
217
|
+
* ## Multipart Uploads
|
|
218
|
+
* - Large files are automatically split into multipart uploads
|
|
219
|
+
* - Maximum 10,000 parts per upload (S3 limitation)
|
|
220
|
+
* - Part size is configurable (default: 16MB, minimum: 5MB)
|
|
221
|
+
* - Failed multipart uploads are automatically aborted
|
|
222
|
+
*
|
|
223
|
+
* ## Supported Operations
|
|
224
|
+
* - ✅ create, write, delete, get, getStream, list, update, copy, move
|
|
225
|
+
* - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
|
|
226
|
+
* - ✅ exists: Implemented (checks metadata and S3 object)
|
|
227
|
+
* - ⚠️ getUrl/getUploadUrl: Limited presigned URL support (uses aws4fetch signing)
|
|
228
|
+
*/
|
|
229
|
+
declare class AwsLightStorage extends S3BaseStorage {
|
|
230
|
+
static override readonly name: string;
|
|
231
|
+
private s3Api;
|
|
232
|
+
constructor(config: AwsLightStorageOptions);
|
|
233
|
+
/**
|
|
234
|
+
* Normalizes AWS S3 errors with S3-specific context.
|
|
235
|
+
*/
|
|
236
|
+
override normalizeError(error: AwsLightError | Error): HttpError;
|
|
237
|
+
override update({
|
|
238
|
+
id
|
|
239
|
+
}: FileQuery, metadata: Partial<AwsLightFile>): Promise<AwsLightFile>;
|
|
240
|
+
override getStream({
|
|
241
|
+
id
|
|
242
|
+
}: FileQuery): Promise<{
|
|
243
|
+
headers?: Record<string, string>;
|
|
244
|
+
size?: number;
|
|
245
|
+
stream: Readable;
|
|
246
|
+
}>;
|
|
247
|
+
protected getS3Api(): AwsLightApiAdapter;
|
|
248
|
+
protected getFileClass(): new (config: FileInit) => AwsLightFile;
|
|
249
|
+
protected getAcl(): string | undefined;
|
|
250
|
+
protected accessCheck(_maxWaitTime?: number): Promise<void>;
|
|
251
|
+
}
|
|
252
|
+
export { type AwsLightClientConfig, type AwsLightError, AwsLightFile, AwsLightMetaStorage, type AwsLightMetaStorageOptions, AwsLightStorage, type AwsLightStorageOptions };
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { A as AwsLightMetaStorage } from '../../packem_shared/aws-light-meta-storage-DKJBgbR6.js';
|
|
3
|
-
export { default as AwsLightStorage } from '../../packem_shared/AwsLightStorage-Cwkkc-z3.js';
|
|
1
|
+
import{default as a}from"../../packem_shared/AwsLightFile-BTLiRxXj.js";import{l as r}from"../../packem_shared/aws-light-meta-storage-TPyQwLvk.js";import{default as f}from"../../packem_shared/AwsLightStorage-CA9cdfJ6.js";export{a as AwsLightFile,r as AwsLightMetaStorage,f as AwsLightStorage};
|