@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,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenTelemetry Metrics implementation for storage operations.
|
|
3
|
-
*
|
|
4
|
-
* Provides counters, timers, and gauges using OpenTelemetry Metrics API.
|
|
5
|
-
* This allows integration with any OpenTelemetry-compatible observability backend
|
|
6
|
-
* (Prometheus, Datadog, New Relic, etc.).
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import { metrics } from "@opentelemetry/api";
|
|
10
|
-
* import { OpenTelemetryMetrics } from "@visulima/storage/metrics";
|
|
11
|
-
* import { S3Storage } from "@visulima/storage/provider/aws";
|
|
12
|
-
*
|
|
13
|
-
* // Initialize OpenTelemetry (typically done once in your app)
|
|
14
|
-
* const meter = metrics.getMeter("@visulima/storage", "1.0.0");
|
|
15
|
-
*
|
|
16
|
-
* // Create metrics instance
|
|
17
|
-
* const storageMetrics = new OpenTelemetryMetrics(meter);
|
|
18
|
-
*
|
|
19
|
-
* // Use with storage
|
|
20
|
-
* const storage = new S3Storage({
|
|
21
|
-
* bucket: "my-bucket",
|
|
22
|
-
* metrics: storageMetrics,
|
|
23
|
-
* });
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
import type { Meter } from "@opentelemetry/api";
|
|
27
|
-
import type { Metrics } from "../utils/types.d.ts";
|
|
28
|
-
/**
|
|
29
|
-
* OpenTelemetry-based metrics implementation.
|
|
30
|
-
*/
|
|
31
|
-
declare class OpenTelemetryMetrics implements Metrics {
|
|
32
|
-
private readonly meter;
|
|
33
|
-
private readonly counters;
|
|
34
|
-
private readonly histograms;
|
|
35
|
-
private readonly gauges;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a new OpenTelemetryMetrics instance.
|
|
38
|
-
* @param meter OpenTelemetry Meter instance. If not provided, uses the default meter.
|
|
39
|
-
* @throws {Error} If \@opentelemetry/api is not installed
|
|
40
|
-
*/
|
|
41
|
-
constructor(meter?: Meter);
|
|
42
|
-
/**
|
|
43
|
-
* Increment a counter metric.
|
|
44
|
-
*/
|
|
45
|
-
increment(name: string, value?: number, attributes?: Record<string, string | number>): void;
|
|
46
|
-
/**
|
|
47
|
-
* Record a duration/timing metric in milliseconds.
|
|
48
|
-
*/
|
|
49
|
-
timing(name: string, duration: number, attributes?: Record<string, string | number>): void;
|
|
50
|
-
/**
|
|
51
|
-
* Set a gauge metric value.
|
|
52
|
-
*/
|
|
53
|
-
gauge(name: string, value: number, attributes?: Record<string, string | number>): void;
|
|
54
|
-
}
|
|
55
|
-
export default OpenTelemetryMetrics;
|
package/dist/openapi/rest.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { OpenAPIV3 } from "openapi-types";
|
|
2
|
-
declare const swaggerSpec: (origin: string, path: string, options: {
|
|
3
|
-
supportedTransformerFormat?: string[];
|
|
4
|
-
tags?: string[] | undefined;
|
|
5
|
-
transformer?: boolean | "audio" | "video" | "image";
|
|
6
|
-
}) => Partial<OpenAPIV3.Document>;
|
|
7
|
-
export default swaggerSpec;
|
package/dist/openapi/shared.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { OpenAPIV3 } from "openapi-types";
|
|
2
|
-
type TransformType = boolean | "audio" | "video" | "image";
|
|
3
|
-
declare const getOrganizedTransformationParameters: (transform?: TransformType, format?: string[]) => {
|
|
4
|
-
groups: Record<string, string[]>;
|
|
5
|
-
parameters: OpenAPIV3.ParameterObject[];
|
|
6
|
-
};
|
|
7
|
-
export { getOrganizedTransformationParameters };
|
|
8
|
-
export declare const sharedGet: (operationId: string, tags: string[] | undefined, transform?: TransformType, transformerFormat?: string[]) => OpenAPIV3.OperationObject;
|
|
9
|
-
export declare const sharedGetMeta: (operationId: string, tags: string[] | undefined) => OpenAPIV3.OperationObject;
|
|
10
|
-
export declare const sharedErrorSchemaObject: Record<string, OpenAPIV3.NonArraySchemaObject>;
|
|
11
|
-
export declare const sharedFileMetaSchemaObject: Record<string, OpenAPIV3.NonArraySchemaObject>;
|
|
12
|
-
export declare const sharedFileMetaExampleObject: Record<string, OpenAPIV3.ExampleObject>;
|
|
13
|
-
export declare const sharedGetList: (operationId: string, tags: string[] | undefined) => OpenAPIV3.OperationObject;
|
package/dist/openapi/tus.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { OpenAPIV3 } from "openapi-types";
|
|
2
|
-
declare const swaggerSpec: (path: string, options: {
|
|
3
|
-
supportedTransformerFormat?: string[];
|
|
4
|
-
tags?: string[] | undefined;
|
|
5
|
-
transformer?: boolean | "audio" | "video" | "image";
|
|
6
|
-
}) => Partial<OpenAPIV3.Document>;
|
|
7
|
-
export default swaggerSpec;
|
package/dist/openapi/xhr.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { OpenAPIV3 } from "openapi-types";
|
|
2
|
-
declare const swaggerSpec: (origin: string, path: string, options: {
|
|
3
|
-
supportedTransformerFormat?: string[];
|
|
4
|
-
tags?: string[] | undefined;
|
|
5
|
-
transformer?: boolean | "audio" | "video" | "image";
|
|
6
|
-
}) => Partial<OpenAPIV3.Document>;
|
|
7
|
-
export default swaggerSpec;
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { Readable } from 'node:stream';
|
|
2
|
-
import { S as S3BaseStorage } from './s3-base-storage-xw6NJFX7.js';
|
|
3
|
-
import { a as AwsLightApiAdapter, A as AwsLightMetaStorage } from './aws-light-meta-storage-DKJBgbR6.js';
|
|
4
|
-
import AwsLightFile from './AwsLightFile-tTneXZgG.js';
|
|
5
|
-
|
|
6
|
-
class AwsLightStorage extends S3BaseStorage {
|
|
7
|
-
static name = "aws-light";
|
|
8
|
-
s3Api;
|
|
9
|
-
constructor(config) {
|
|
10
|
-
const { bucket = process.env.S3_BUCKET || process.env.AWS_S3_BUCKET, region = process.env.S3_REGION || process.env.AWS_REGION } = config;
|
|
11
|
-
if (!bucket) {
|
|
12
|
-
throw new Error("S3 bucket is not defined");
|
|
13
|
-
}
|
|
14
|
-
if (!region) {
|
|
15
|
-
throw new Error("S3 region is not defined");
|
|
16
|
-
}
|
|
17
|
-
if (!config.accessKeyId) {
|
|
18
|
-
throw new Error("accessKeyId is required");
|
|
19
|
-
}
|
|
20
|
-
if (!config.secretAccessKey) {
|
|
21
|
-
throw new Error("secretAccessKey is required");
|
|
22
|
-
}
|
|
23
|
-
super({
|
|
24
|
-
bucket,
|
|
25
|
-
clientDirectUpload: config.clientDirectUpload,
|
|
26
|
-
expiration: config.expiration?.maxAge ? { maxAge: String(config.expiration.maxAge) } : void 0,
|
|
27
|
-
filename: config.filename,
|
|
28
|
-
logger: config.logger,
|
|
29
|
-
metaStorage: config.metaStorage,
|
|
30
|
-
metaStorageConfig: config.metaStorageConfig ? { ...config.metaStorageConfig, ...config } : { ...config },
|
|
31
|
-
partSize: config.partSize,
|
|
32
|
-
retryConfig: {
|
|
33
|
-
...config.retryConfig,
|
|
34
|
-
shouldRetry: (error) => {
|
|
35
|
-
const errorWithStatus = error;
|
|
36
|
-
if (errorWithStatus.statusCode && [408, 429, 500, 502, 503, 504].includes(errorWithStatus.statusCode)) {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
return errorWithStatus.retryable ?? false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
this.s3Api = new AwsLightApiAdapter({
|
|
44
|
-
accessKeyId: config.accessKeyId,
|
|
45
|
-
bucket,
|
|
46
|
-
endpoint: config.endpoint,
|
|
47
|
-
region,
|
|
48
|
-
secretAccessKey: config.secretAccessKey,
|
|
49
|
-
service: config.service,
|
|
50
|
-
sessionToken: config.sessionToken
|
|
51
|
-
});
|
|
52
|
-
const { metaStorage, metaStorageConfig } = config;
|
|
53
|
-
if (!metaStorage) {
|
|
54
|
-
const metaConfig = { ...config, ...metaStorageConfig, logger: this.logger };
|
|
55
|
-
this.meta = new AwsLightMetaStorage(metaConfig);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Normalizes AWS S3 errors with S3-specific context.
|
|
60
|
-
*/
|
|
61
|
-
normalizeError(error) {
|
|
62
|
-
const awsError = error;
|
|
63
|
-
if (awsError.statusCode || awsError.code) {
|
|
64
|
-
return {
|
|
65
|
-
code: awsError.code || awsError.name,
|
|
66
|
-
message: awsError.message,
|
|
67
|
-
name: awsError.name,
|
|
68
|
-
statusCode: awsError.statusCode || 500
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
return super.normalizeError(error);
|
|
72
|
-
}
|
|
73
|
-
async update({ id }, metadata) {
|
|
74
|
-
if (this.config.clientDirectUpload) {
|
|
75
|
-
const file = await this.getMeta(id);
|
|
76
|
-
return this.buildPresigned({ ...file, ...metadata });
|
|
77
|
-
}
|
|
78
|
-
return super.update({ id }, metadata);
|
|
79
|
-
}
|
|
80
|
-
async getStream({ id }) {
|
|
81
|
-
return this.instrumentOperation("getStream", async () => {
|
|
82
|
-
const s3Api = this.getS3Api();
|
|
83
|
-
const { Body, ContentLength, ContentType, ETag, Expires, LastModified } = await this.retry(
|
|
84
|
-
() => s3Api.getObject({
|
|
85
|
-
Bucket: this.bucket,
|
|
86
|
-
Key: id
|
|
87
|
-
})
|
|
88
|
-
);
|
|
89
|
-
await this.checkIfExpired({ expiredAt: Expires });
|
|
90
|
-
const stream = Body instanceof ReadableStream ? Readable.fromWeb(Body) : Body;
|
|
91
|
-
const readableStream = new Readable({
|
|
92
|
-
read() {
|
|
93
|
-
stream.on("data", (chunk) => {
|
|
94
|
-
this.push(chunk);
|
|
95
|
-
});
|
|
96
|
-
stream.on("end", () => {
|
|
97
|
-
this.push(null);
|
|
98
|
-
});
|
|
99
|
-
stream.on("error", (error) => {
|
|
100
|
-
this.destroy(error);
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
return {
|
|
105
|
-
headers: {
|
|
106
|
-
"Content-Length": ContentLength?.toString() ?? "0",
|
|
107
|
-
"Content-Type": ContentType,
|
|
108
|
-
...ETag && { ETag },
|
|
109
|
-
...Expires && { "X-Upload-Expires": Expires.toString() },
|
|
110
|
-
...LastModified && { "Last-Modified": LastModified.toString() }
|
|
111
|
-
},
|
|
112
|
-
size: Number(ContentLength),
|
|
113
|
-
stream: readableStream
|
|
114
|
-
};
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
getS3Api() {
|
|
118
|
-
return this.s3Api;
|
|
119
|
-
}
|
|
120
|
-
// eslint-disable-next-line class-methods-use-this
|
|
121
|
-
getFileClass() {
|
|
122
|
-
return AwsLightFile;
|
|
123
|
-
}
|
|
124
|
-
// eslint-disable-next-line class-methods-use-this
|
|
125
|
-
getAcl() {
|
|
126
|
-
return void 0;
|
|
127
|
-
}
|
|
128
|
-
async accessCheck(_maxWaitTime = 30) {
|
|
129
|
-
await this.s3Api.checkBucketAccess({ Bucket: this.bucket });
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export { AwsLightStorage as default };
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { BlobServiceClient, StorageSharedKeyCredential } from '@azure/storage-blob';
|
|
2
|
-
import { throwErrorCode, ERRORS } from './ERRORS-D0apMqnc.js';
|
|
3
|
-
import MetaStorage from './MetaStorage-pECeFOad.js';
|
|
4
|
-
import { parseMetadata, stringifyMetadata } from './Metadata-DRLXeJ0F.js';
|
|
5
|
-
|
|
6
|
-
class AzureMetaStorage extends MetaStorage {
|
|
7
|
-
constructor(config) {
|
|
8
|
-
super(config);
|
|
9
|
-
this.config = config;
|
|
10
|
-
const { client, ...metaConfig } = config;
|
|
11
|
-
if (client === void 0) {
|
|
12
|
-
const connectionString = metaConfig.connectionString || process.env.AZURE_STORAGE_CONNECTION_STRING || void 0;
|
|
13
|
-
if (connectionString) {
|
|
14
|
-
this.client = BlobServiceClient.fromConnectionString(connectionString);
|
|
15
|
-
} else {
|
|
16
|
-
const accountKey = metaConfig.accountKey || process.env.AZURE_STORAGE_ACCOUNT_KEY || void 0;
|
|
17
|
-
const accountName = metaConfig.accountName || process.env.AZURE_STORAGE_ACCOUNT || void 0;
|
|
18
|
-
if (!metaConfig.accountKey) {
|
|
19
|
-
throw new Error("Missing required parameter: Azure blob storage account key.");
|
|
20
|
-
}
|
|
21
|
-
if (!metaConfig.accountName) {
|
|
22
|
-
throw new Error("Missing required parameter: Azure blob storage account name.");
|
|
23
|
-
}
|
|
24
|
-
const signedCredentials = new StorageSharedKeyCredential(accountName, accountKey);
|
|
25
|
-
this.client = new BlobServiceClient(config.endpoint ?? `https://${accountName}.blob.core.windows.net`, signedCredentials);
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
this.client = client;
|
|
29
|
-
}
|
|
30
|
-
const containerName = metaConfig.containerName || process.env.AZURE_STORAGE_CONTAINER || void 0;
|
|
31
|
-
if (!containerName) {
|
|
32
|
-
throw new Error("Missing required parameter: Azure container name.");
|
|
33
|
-
}
|
|
34
|
-
this.containerClient = this.client.getContainerClient(metaConfig.containerName);
|
|
35
|
-
}
|
|
36
|
-
client;
|
|
37
|
-
containerClient;
|
|
38
|
-
async get(id) {
|
|
39
|
-
const appendBlobClient = this.containerClient.getAppendBlobClient(this.getMetaName(id));
|
|
40
|
-
let propertyData;
|
|
41
|
-
try {
|
|
42
|
-
propertyData = await appendBlobClient.getProperties();
|
|
43
|
-
} catch {
|
|
44
|
-
throw throwErrorCode(ERRORS.UNKNOWN_ERROR);
|
|
45
|
-
}
|
|
46
|
-
if (!propertyData.metadata) {
|
|
47
|
-
throw throwErrorCode(ERRORS.FILE_NOT_FOUND);
|
|
48
|
-
}
|
|
49
|
-
const file = propertyData.metadata;
|
|
50
|
-
if (file.metadata && typeof file.metadata === "string") {
|
|
51
|
-
file.metadata = parseMetadata(file.metadata);
|
|
52
|
-
}
|
|
53
|
-
return file;
|
|
54
|
-
}
|
|
55
|
-
async touch(id, file) {
|
|
56
|
-
return this.save(id, file);
|
|
57
|
-
}
|
|
58
|
-
async delete(id) {
|
|
59
|
-
const blobClient = this.containerClient.getBlockBlobClient(this.getMetaName(id));
|
|
60
|
-
await blobClient.deleteIfExists();
|
|
61
|
-
}
|
|
62
|
-
async save(id, file) {
|
|
63
|
-
const transformedMetadata = { ...file };
|
|
64
|
-
if (transformedMetadata.metadata) {
|
|
65
|
-
transformedMetadata.metadata = stringifyMetadata(file.metadata);
|
|
66
|
-
}
|
|
67
|
-
const appendBlobClient = this.containerClient.getAppendBlobClient(this.getMetaName(id));
|
|
68
|
-
await appendBlobClient.setMetadata(transformedMetadata, {});
|
|
69
|
-
return file;
|
|
70
|
-
}
|
|
71
|
-
async list() {
|
|
72
|
-
const blobs = [];
|
|
73
|
-
const iterator = this.containerClient.listBlobsFlat({
|
|
74
|
-
prefix: this.prefix
|
|
75
|
-
});
|
|
76
|
-
for await (const blob of iterator) {
|
|
77
|
-
blobs.push(blob);
|
|
78
|
-
}
|
|
79
|
-
return blobs.filter((blob) => blob.name.endsWith(this.suffix)).map((blob) => {
|
|
80
|
-
return {
|
|
81
|
-
createdAt: blob.properties.createdOn,
|
|
82
|
-
id: this.getIdFromMetaName(blob.name)
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export { AzureMetaStorage as default };
|