@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.
Files changed (307) hide show
  1. package/CHANGELOG.md +252 -0
  2. package/LICENSE.md +1256 -512
  3. package/README.md +4 -4
  4. package/dist/adapter/nuxt/module.d.ts +41 -34
  5. package/dist/adapter/nuxt/module.js +1 -93
  6. package/dist/handler/http/fetch/index.d.ts +297 -4
  7. package/dist/handler/http/fetch/index.js +1 -4
  8. package/dist/handler/http/hono/index.d.ts +1474 -58
  9. package/dist/handler/http/hono/index.js +1 -65
  10. package/dist/handler/http/nextjs/index.d.ts +66 -58
  11. package/dist/handler/http/nextjs/index.js +1 -37
  12. package/dist/handler/http/node/index.d.ts +361 -4
  13. package/dist/handler/http/node/index.js +1 -4
  14. package/dist/handler/http/solid-start/index.d.ts +66 -57
  15. package/dist/handler/http/solid-start/index.js +1 -44
  16. package/dist/index.d.ts +376 -17
  17. package/dist/index.js +1 -13
  18. package/dist/openapi/index.d.ts +24 -5
  19. package/dist/openapi/index.js +1 -5
  20. package/dist/packem_shared/AwsLightFile-BTLiRxXj.js +1 -0
  21. package/dist/packem_shared/AwsLightMetaStorage-DHz1nf_H.js +1 -0
  22. package/dist/packem_shared/AwsLightStorage-CA9cdfJ6.js +1 -0
  23. package/dist/packem_shared/AzureFile-BKHru1zB.js +1 -0
  24. package/dist/packem_shared/AzureSMetaStorage-BqA4jUDJ.js +1 -0
  25. package/dist/packem_shared/AzureStorage-BKUjCymW.js +1 -0
  26. package/dist/packem_shared/BaseTransformer-D68eLyz1.js +1 -0
  27. package/dist/packem_shared/DiskStorage-DNjpDMX9.js +1 -0
  28. package/dist/packem_shared/DiskStorageWithChecksum-Bb6JX_tC.js +1 -0
  29. package/dist/packem_shared/ERRORS-B9jkvKwx.js +1 -0
  30. package/dist/packem_shared/File-alcSNpLq.js +1 -0
  31. package/dist/packem_shared/GCSConfig-BQ0OpVhe.js +1 -0
  32. package/dist/packem_shared/GCSFile-CHjX_fJk.js +1 -0
  33. package/dist/packem_shared/GCSMetaStorage-1UQIN9IN.js +1 -0
  34. package/dist/packem_shared/GCStorage-PJRb2WWC.js +1 -0
  35. package/dist/packem_shared/LocalMetaStorage-BWuFvWn4.js +1 -0
  36. package/dist/packem_shared/MediaTransformer-2C8MJeAg.js +1 -0
  37. package/dist/packem_shared/MetaStorage-Y4m1dWgd.js +1 -0
  38. package/dist/packem_shared/Metadata-B6Ir0KO7.js +1 -0
  39. package/dist/packem_shared/Multipart-Bd9YFFn0.js +1 -0
  40. package/dist/packem_shared/Multipart-D5bcEvga.js +1 -0
  41. package/dist/packem_shared/NetlifyBlobFile-CpzkMKng.js +1 -0
  42. package/dist/packem_shared/NetlifyBlobMetaStorage-dD0oBLom.js +1 -0
  43. package/dist/packem_shared/NetlifyBlobStorage-ByTwCN-h.js +1 -0
  44. package/dist/packem_shared/NoOpMetrics-Dky06sf1.js +1 -0
  45. package/dist/packem_shared/OpenTelemetryMetrics-9uxQMSlg.js +1 -0
  46. package/dist/packem_shared/Rest-CYEBbtCD.js +1 -0
  47. package/dist/packem_shared/Rest-DoonVU7B.js +1 -0
  48. package/dist/packem_shared/S3Client.d-CZ62Jztg.d.ts +20357 -0
  49. package/dist/packem_shared/S3File-Du6wP0Sz.js +1 -0
  50. package/dist/packem_shared/S3MetaStorage-vcriiosn.js +1 -0
  51. package/dist/packem_shared/S3Storage-Fx6-OSc-.js +1 -0
  52. package/dist/packem_shared/TUS_RESUMABLE-B7KtPVeC.js +1 -0
  53. package/dist/packem_shared/Tus-Bd_2Ki2G.js +1 -0
  54. package/dist/packem_shared/Tus-CUBCkuPE.js +1 -0
  55. package/dist/packem_shared/ValidationError-D8KKJiKA.js +1 -0
  56. package/dist/packem_shared/VercelBlobFile-CL9MjKcY.js +1 -0
  57. package/dist/packem_shared/VercelBlobMetaStorage-BsOTx-Su.js +1 -0
  58. package/dist/packem_shared/VercelBlobStorage-kNkk5Cn4.js +1 -0
  59. package/dist/packem_shared/_commonjsHelpers-D6W6KoPK.js +1 -0
  60. package/dist/packem_shared/aws-light-meta-storage-TPyQwLvk.js +4 -0
  61. package/dist/packem_shared/backblaze-DEflv87m.js +1 -0
  62. package/dist/packem_shared/base-handler-core-DaggCVsq.js +1 -0
  63. package/dist/packem_shared/base-handler-fetch-DnarP64X.js +1 -0
  64. package/dist/packem_shared/base-handler-node-BTes6sql.js +1 -0
  65. package/dist/packem_shared/cache-qV_5Umeq.js +1 -0
  66. package/dist/packem_shared/cloudflare-DLAeQvgD.js +1 -0
  67. package/dist/packem_shared/defaultCloudStorageFileNameValidation-yiM9GxHr.js +1 -0
  68. package/dist/packem_shared/digitalOcean-nhZUds87.js +1 -0
  69. package/dist/packem_shared/disk-storage-BvdK4bqF.js +5 -0
  70. package/dist/packem_shared/disk-storage-with-checksum.d-hEoe2ugb.d.ts +148 -0
  71. package/dist/packem_shared/gcs-meta-storage-DXqBZ3Xm.js +1 -0
  72. package/dist/packem_shared/has-content-Bx2p8Okx.js +1 -0
  73. package/dist/packem_shared/headers-DC2MEOrK.js +27 -0
  74. package/dist/packem_shared/is-expired-1JuZjDtb.js +1 -0
  75. package/dist/packem_shared/isRetryableError-DQNSZiBc.js +1 -0
  76. package/dist/packem_shared/isValidMediaType-B-2UKjZx.js +1 -0
  77. package/dist/packem_shared/local-meta-storage-Bkwqi_gi.js +1 -0
  78. package/dist/packem_shared/local-meta-storage.d-Dop9RP9k.d.ts +20 -0
  79. package/dist/packem_shared/media-transformer.d-LGdEjx6A.d.ts +331 -0
  80. package/dist/packem_shared/minio-BWwgGXeE.js +1 -0
  81. package/dist/packem_shared/multipart-base-C6OjBwMS.js +1 -0
  82. package/dist/packem_shared/part-match-DqD5U7An.js +1 -0
  83. package/dist/packem_shared/path-D7rMc9nq-B718mbm6.js +1 -0
  84. package/dist/packem_shared/response-builder-Wdo_fvcF.js +1 -0
  85. package/dist/packem_shared/rest-base-B2Dv7esY.js +1 -0
  86. package/dist/packem_shared/restOpenApiSpec-PaIVbESh.js +1 -0
  87. package/dist/packem_shared/s3-base-storage-xHZNtsGe.js +1 -0
  88. package/dist/packem_shared/s3-base-storage.d-CczjSe98.d.ts +251 -0
  89. package/dist/packem_shared/sharedGet-Ce7WGAsc.js +1 -0
  90. package/dist/packem_shared/storage-m_Cxgiih.js +1 -0
  91. package/dist/packem_shared/storage.d-BOMUJD96.d.ts +939 -0
  92. package/dist/packem_shared/tigris-DZoyrMNd.js +1 -0
  93. package/dist/packem_shared/transformOpenApiSpec-C0vEbDTO.js +1 -0
  94. package/dist/packem_shared/tus-base.d-C20dSee8.d.ts +99 -0
  95. package/dist/packem_shared/tusOpenApiSpec-DF0-hlWV.js +1 -0
  96. package/dist/packem_shared/types.d-B4hqF6yH.d.ts +708 -0
  97. package/dist/packem_shared/types.d-CNvyxOka.d.ts +49 -0
  98. package/dist/packem_shared/update-size-DANV7aa2.js +1 -0
  99. package/dist/packem_shared/validator-DK41xp8N.js +1 -0
  100. package/dist/packem_shared/waitForStorage-ChSBLhLc.js +1 -0
  101. package/dist/packem_shared/wasabi-Dmce4x9s.js +1 -0
  102. package/dist/packem_shared/xhrOpenApiSpec-nyoboz83.js +1 -0
  103. package/dist/storage/aws/clients/index.d.ts +166 -6
  104. package/dist/storage/aws/clients/index.js +1 -6
  105. package/dist/storage/aws/index.d.ts +320 -4
  106. package/dist/storage/aws/index.js +1 -3
  107. package/dist/storage/aws-light/index.d.ts +252 -4
  108. package/dist/storage/aws-light/index.js +1 -3
  109. package/dist/storage/azure/index.d.ts +10422 -4
  110. package/dist/storage/azure/index.js +1 -3
  111. package/dist/storage/gcs/index.d.ts +4107 -5
  112. package/dist/storage/gcs/index.js +1 -4
  113. package/dist/storage/local/index.d.ts +7 -4
  114. package/dist/storage/local/index.js +1 -3
  115. package/dist/storage/netlify-blob/index.d.ts +142 -4
  116. package/dist/storage/netlify-blob/index.js +1 -3
  117. package/dist/storage/vercel-blob/index.d.ts +129 -4
  118. package/dist/storage/vercel-blob/index.js +1 -3
  119. package/dist/transformer/audio-transformer.d.ts +127 -125
  120. package/dist/transformer/audio-transformer.js +1 -278
  121. package/dist/transformer/image-transformer.d.ts +569 -568
  122. package/dist/transformer/image-transformer.js +1 -1100
  123. package/dist/transformer/index.d.ts +62 -5
  124. package/dist/transformer/index.js +1 -4
  125. package/dist/transformer/video-transformer.d.ts +144 -142
  126. package/dist/transformer/video-transformer.js +1 -310
  127. package/package.json +60 -60
  128. package/dist/handler/base/base-handler-core.d.ts +0 -91
  129. package/dist/handler/base/base-handler-fetch.d.ts +0 -76
  130. package/dist/handler/base/base-handler-node.d.ts +0 -137
  131. package/dist/handler/multipart/multipart-base.d.ts +0 -84
  132. package/dist/handler/multipart/multipart-fetch.d.ts +0 -64
  133. package/dist/handler/multipart/multipart.d.ts +0 -49
  134. package/dist/handler/rest/rest-base.d.ts +0 -106
  135. package/dist/handler/rest/rest-fetch.d.ts +0 -88
  136. package/dist/handler/rest/rest.d.ts +0 -93
  137. package/dist/handler/tus/tus-base.d.ts +0 -152
  138. package/dist/handler/tus/tus-fetch.d.ts +0 -72
  139. package/dist/handler/tus/tus.d.ts +0 -78
  140. package/dist/handler/types.d.ts +0 -53
  141. package/dist/handler/utils/request-parser.d.ts +0 -72
  142. package/dist/handler/utils/response-builder.d.ts +0 -83
  143. package/dist/handler/utils/storage-utils.d.ts +0 -10
  144. package/dist/handler/utils/stream-utils.d.ts +0 -29
  145. package/dist/handler/utils/upload-handlers.d.ts +0 -76
  146. package/dist/metrics/index.d.ts +0 -2
  147. package/dist/metrics/no-op-metrics.d.ts +0 -15
  148. package/dist/metrics/opentelemetry-metrics.d.ts +0 -55
  149. package/dist/openapi/rest.d.ts +0 -7
  150. package/dist/openapi/shared.d.ts +0 -13
  151. package/dist/openapi/transform.d.ts +0 -3
  152. package/dist/openapi/tus.d.ts +0 -7
  153. package/dist/openapi/xhr.d.ts +0 -7
  154. package/dist/packem_shared/AwsLightFile-tTneXZgG.js +0 -11
  155. package/dist/packem_shared/AwsLightMetaStorage-BWSOtVaN.js +0 -4
  156. package/dist/packem_shared/AwsLightStorage-Cwkkc-z3.js +0 -133
  157. package/dist/packem_shared/AzureFile-CesgFzps.js +0 -8
  158. package/dist/packem_shared/AzureSMetaStorage-CFs-OYJT.js +0 -88
  159. package/dist/packem_shared/AzureStorage-9MoV2W8q.js +0 -357
  160. package/dist/packem_shared/BaseTransformer-C2gLib6v.js +0 -82
  161. package/dist/packem_shared/DiskStorage-CJtTzMQ3.js +0 -12
  162. package/dist/packem_shared/DiskStorageWithChecksum-BgrG8pvC.js +0 -238
  163. package/dist/packem_shared/ERRORS-D0apMqnc.js +0 -97
  164. package/dist/packem_shared/File-Bb3P23dr.js +0 -69
  165. package/dist/packem_shared/GCSConfig-vPP22kN6.js +0 -11
  166. package/dist/packem_shared/GCSFile-BIEunhAN.js +0 -8
  167. package/dist/packem_shared/GCSMetaStorage-sYiSjLUx.js +0 -7
  168. package/dist/packem_shared/GCStorage-DPl1_DAm.js +0 -406
  169. package/dist/packem_shared/LocalMetaStorage-CZHhKkMd.js +0 -7
  170. package/dist/packem_shared/MediaTransformer-D6658DL1.js +0 -1197
  171. package/dist/packem_shared/MetaStorage-pECeFOad.js +0 -46
  172. package/dist/packem_shared/Metadata-DRLXeJ0F.js +0 -89
  173. package/dist/packem_shared/Multipart-CNFK_Okz.js +0 -163
  174. package/dist/packem_shared/Multipart-CtUL7BQw.js +0 -128
  175. package/dist/packem_shared/NetlifyBlobFile-CXzyjqrD.js +0 -14
  176. package/dist/packem_shared/NetlifyBlobMetaStorage-DxZ5aDvD.js +0 -9
  177. package/dist/packem_shared/NetlifyBlobStorage-C6AX-X0P.js +0 -376
  178. package/dist/packem_shared/NoOpMetrics-DhAk5rXc.js +0 -10
  179. package/dist/packem_shared/OpenTelemetryMetrics-BnxhqIaH.js +0 -67
  180. package/dist/packem_shared/Rest-CAOAEkOj.js +0 -267
  181. package/dist/packem_shared/Rest-DNuLwBrK.js +0 -228
  182. package/dist/packem_shared/S3File-DZiyk9Qt.js +0 -11
  183. package/dist/packem_shared/S3MetaStorage-Dz9aDabA.js +0 -76
  184. package/dist/packem_shared/S3Storage-CgheE2yH.js +0 -316
  185. package/dist/packem_shared/TUS_RESUMABLE-GJzZ9R-f.js +0 -434
  186. package/dist/packem_shared/Tus-B8PmlMgR.js +0 -200
  187. package/dist/packem_shared/Tus-C4F1aYOl.js +0 -195
  188. package/dist/packem_shared/ValidationError-BfF1aE4h.js +0 -26
  189. package/dist/packem_shared/VercelBlobFile-BCg4aTEq.js +0 -18
  190. package/dist/packem_shared/VercelBlobMetaStorage-Bd9F-VFm.js +0 -9
  191. package/dist/packem_shared/VercelBlobStorage-BbuEYhOz.js +0 -261
  192. package/dist/packem_shared/_commonjsHelpers-B85MJLTf.js +0 -5
  193. package/dist/packem_shared/aws-light-meta-storage-DKJBgbR6.js +0 -446
  194. package/dist/packem_shared/backblaze-BlMnIcBC.js +0 -20
  195. package/dist/packem_shared/base-handler-core-BKuf4YLT.js +0 -303
  196. package/dist/packem_shared/base-handler-fetch-Cr0hLiqg.js +0 -291
  197. package/dist/packem_shared/base-handler-node-gk5aN9Cx.js +0 -730
  198. package/dist/packem_shared/cache-B88MXQ_2.js +0 -18
  199. package/dist/packem_shared/cloudflare-Bi1q8wXE.js +0 -21
  200. package/dist/packem_shared/defaultCloudStorageFileNameValidation-oVDgf-Sw.js +0 -11
  201. package/dist/packem_shared/digitalOcean-CWQRJM3L.js +0 -21
  202. package/dist/packem_shared/disk-storage-DkDoHnKB.js +0 -810
  203. package/dist/packem_shared/gcs-meta-storage-etw4wuh5.js +0 -158
  204. package/dist/packem_shared/has-content-CY66ehMK.js +0 -3
  205. package/dist/packem_shared/headers-DoS5nwM-.js +0 -3220
  206. package/dist/packem_shared/is-expired-CTThU1q5.js +0 -8
  207. package/dist/packem_shared/isRetryableError-Dycp7127.js +0 -82
  208. package/dist/packem_shared/isValidMediaType-BeDgiObq.js +0 -35
  209. package/dist/packem_shared/local-meta-storage-By-3SNBI.js +0 -649
  210. package/dist/packem_shared/minio-C2YBZQOw.js +0 -22
  211. package/dist/packem_shared/multipart-base-B3i67SSX.js +0 -102
  212. package/dist/packem_shared/part-match-BMNqHDYD.js +0 -96
  213. package/dist/packem_shared/path-CR6YkPXX-7R1-9CMk.js +0 -161
  214. package/dist/packem_shared/response-builder-BtnRiBUI.js +0 -45
  215. package/dist/packem_shared/rest-base-GRCcnan7.js +0 -457
  216. package/dist/packem_shared/restOpenApiSpec-CwcHHY2C.js +0 -800
  217. package/dist/packem_shared/s3-base-storage-xw6NJFX7.js +0 -510
  218. package/dist/packem_shared/sharedGet-Cpo7QUyu.js +0 -1019
  219. package/dist/packem_shared/storage-BwdYUHs3.js +0 -864
  220. package/dist/packem_shared/tigris-Hac8TKnX.js +0 -21
  221. package/dist/packem_shared/transformOpenApiSpec-DWM5WtnN.js +0 -975
  222. package/dist/packem_shared/tusOpenApiSpec-6ohiToBy.js +0 -740
  223. package/dist/packem_shared/update-size-CCGm6i1J.js +0 -8
  224. package/dist/packem_shared/validator-BeX_lJet.js +0 -78
  225. package/dist/packem_shared/waitForStorage-Cscw85sx.js +0 -18
  226. package/dist/packem_shared/wasabi-DIyflHSd.js +0 -21
  227. package/dist/packem_shared/xhrOpenApiSpec-DS17brnx.js +0 -264
  228. package/dist/storage/aws/clients/backblaze.d.ts +0 -12
  229. package/dist/storage/aws/clients/cloudflare.d.ts +0 -13
  230. package/dist/storage/aws/clients/digital-ocean.d.ts +0 -12
  231. package/dist/storage/aws/clients/minio.d.ts +0 -13
  232. package/dist/storage/aws/clients/tigris.d.ts +0 -12
  233. package/dist/storage/aws/clients/types.d.ts +0 -95
  234. package/dist/storage/aws/clients/wasabi.d.ts +0 -12
  235. package/dist/storage/aws/s3-base-storage.d.ts +0 -248
  236. package/dist/storage/aws/s3-client-adapter.d.ts +0 -110
  237. package/dist/storage/aws/s3-file.d.ts +0 -10
  238. package/dist/storage/aws/s3-meta-storage.d.ts +0 -15
  239. package/dist/storage/aws/s3-storage.d.ts +0 -70
  240. package/dist/storage/aws/types.d.ts +0 -119
  241. package/dist/storage/aws-light/aws-light-api-adapter.d.ts +0 -130
  242. package/dist/storage/aws-light/aws-light-file.d.ts +0 -10
  243. package/dist/storage/aws-light/aws-light-meta-storage.d.ts +0 -19
  244. package/dist/storage/aws-light/aws-light-storage.d.ts +0 -65
  245. package/dist/storage/aws-light/types.d.ts +0 -37
  246. package/dist/storage/azure/azure-file.d.ts +0 -6
  247. package/dist/storage/azure/azure-meta-storage.d.ts +0 -15
  248. package/dist/storage/azure/azure-storage.d.ts +0 -69
  249. package/dist/storage/azure/types.d.ts +0 -62
  250. package/dist/storage/gcs/fetch-error.d.ts +0 -11
  251. package/dist/storage/gcs/gcs-config.d.ts +0 -2
  252. package/dist/storage/gcs/gcs-file.d.ts +0 -6
  253. package/dist/storage/gcs/gcs-meta-storage.d.ts +0 -27
  254. package/dist/storage/gcs/gcs-storage.d.ts +0 -91
  255. package/dist/storage/gcs/types.d.ts +0 -55
  256. package/dist/storage/gcs/utils.d.ts +0 -7
  257. package/dist/storage/local/disk-storage-with-checksum.d.ts +0 -15
  258. package/dist/storage/local/disk-storage.d.ts +0 -135
  259. package/dist/storage/local/local-meta-storage.d.ts +0 -32
  260. package/dist/storage/meta-storage.d.ts +0 -30
  261. package/dist/storage/netlify-blob/netlify-blob-file.d.ts +0 -12
  262. package/dist/storage/netlify-blob/netlify-blob-meta-storage.d.ts +0 -7
  263. package/dist/storage/netlify-blob/netlify-blob-storage.d.ts +0 -93
  264. package/dist/storage/netlify-blob/types.d.ts +0 -30
  265. package/dist/storage/storage.d.ts +0 -353
  266. package/dist/storage/types.d.ts +0 -221
  267. package/dist/storage/utils/file/file.d.ts +0 -25
  268. package/dist/storage/utils/file/get-file-status.d.ts +0 -9
  269. package/dist/storage/utils/file/has-content.d.ts +0 -9
  270. package/dist/storage/utils/file/index.d.ts +0 -10
  271. package/dist/storage/utils/file/is-expired.d.ts +0 -8
  272. package/dist/storage/utils/file/metadata.d.ts +0 -18
  273. package/dist/storage/utils/file/part-match.d.ts +0 -11
  274. package/dist/storage/utils/file/types.d.ts +0 -37
  275. package/dist/storage/utils/file/update-metadata.d.ts +0 -10
  276. package/dist/storage/utils/file/update-size.d.ts +0 -10
  277. package/dist/storage/vercel-blob/types.d.ts +0 -32
  278. package/dist/storage/vercel-blob/vercel-blob-file.d.ts +0 -16
  279. package/dist/storage/vercel-blob/vercel-blob-meta-storage.d.ts +0 -7
  280. package/dist/storage/vercel-blob/vercel-blob-storage.d.ts +0 -76
  281. package/dist/transformer/base-transformer.d.ts +0 -63
  282. package/dist/transformer/media-transformer.d.ts +0 -332
  283. package/dist/transformer/types.d.ts +0 -652
  284. package/dist/transformer/utils.d.ts +0 -33
  285. package/dist/transformer/validation-error.d.ts +0 -23
  286. package/dist/utils/cache.d.ts +0 -32
  287. package/dist/utils/chunked-upload.d.ts +0 -65
  288. package/dist/utils/detect-file-type.d.ts +0 -28
  289. package/dist/utils/errors.d.ts +0 -74
  290. package/dist/utils/file-path-url-matcher.d.ts +0 -18
  291. package/dist/utils/headers.d.ts +0 -111
  292. package/dist/utils/http.d.ts +0 -92
  293. package/dist/utils/locker.d.ts +0 -26
  294. package/dist/utils/pipes/stream-checksum.d.ts +0 -47
  295. package/dist/utils/pipes/stream-length.d.ts +0 -22
  296. package/dist/utils/primitives/get-last-one.d.ts +0 -3
  297. package/dist/utils/primitives/is-record.d.ts +0 -2
  298. package/dist/utils/primitives/map-values.d.ts +0 -9
  299. package/dist/utils/primitives/pick.d.ts +0 -2
  300. package/dist/utils/primitives/to-milliseconds.d.ts +0 -12
  301. package/dist/utils/primitives/to-seconds.d.ts +0 -12
  302. package/dist/utils/range-checksum.d.ts +0 -33
  303. package/dist/utils/range-hasher.d.ts +0 -46
  304. package/dist/utils/retry.d.ts +0 -64
  305. package/dist/utils/types.d.ts +0 -108
  306. package/dist/utils/validation-error.d.ts +0 -22
  307. package/dist/utils/validator.d.ts +0 -36
@@ -1,4 +1 @@
1
- export { default as GCSConfig } from '../../packem_shared/GCSConfig-vPP22kN6.js';
2
- export { default as GCSFile } from '../../packem_shared/GCSFile-BIEunhAN.js';
3
- export { G as GCSMetaStorage } from '../../packem_shared/gcs-meta-storage-etw4wuh5.js';
4
- export { default as GCStorage } from '../../packem_shared/GCStorage-DPl1_DAm.js';
1
+ import{default as a}from"../../packem_shared/GCSConfig-BQ0OpVhe.js";import{default as t}from"../../packem_shared/GCSFile-CHjX_fJk.js";import{E as C}from"../../packem_shared/gcs-meta-storage-DXqBZ3Xm.js";import{default as l}from"../../packem_shared/GCStorage-PJRb2WWC.js";export{a as GCSConfig,t as GCSFile,C as GCSMetaStorage,l as GCStorage};
@@ -1,4 +1,7 @@
1
- export { default as DiskStorage } from "./disk-storage.d.ts";
2
- export { default as DiskStorageWithChecksum } from "./disk-storage-with-checksum.d.ts";
3
- export type { LocalMetaStorageOptions } from "./local-meta-storage.d.ts";
4
- export { default as LocalMetaStorage } from "./local-meta-storage.d.ts";
1
+ export { D as DiskStorage, a as DiskStorageWithChecksum } from "../../packem_shared/disk-storage-with-checksum.d-hEoe2ugb.js";
2
+ export { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-Dop9RP9k.js";
3
+ export { type L as LocalMetaStorageOptions } from "../../packem_shared/storage.d-BOMUJD96.js";
4
+ import 'node:stream';
5
+ import 'node:crypto';
6
+ import 'node:http';
7
+ import 'lru-cache';
@@ -1,3 +1 @@
1
- export { D as DiskStorage } from '../../packem_shared/disk-storage-DkDoHnKB.js';
2
- export { default as DiskStorageWithChecksum } from '../../packem_shared/DiskStorageWithChecksum-BgrG8pvC.js';
3
- export { L as LocalMetaStorage } from '../../packem_shared/local-meta-storage-By-3SNBI.js';
1
+ import{q as e}from"../../packem_shared/disk-storage-BvdK4bqF.js";import{default as t}from"../../packem_shared/DiskStorageWithChecksum-Bb6JX_tC.js";import{O as f}from"../../packem_shared/local-meta-storage-Bkwqi_gi.js";export{e as DiskStorage,t as DiskStorageWithChecksum,f as LocalMetaStorage};
@@ -1,4 +1,142 @@
1
- export { default as NetlifyBlobFile } from "./netlify-blob-file.d.ts";
2
- export { default as NetlifyBlobMetaStorage } from "./netlify-blob-meta-storage.d.ts";
3
- export { default as NetlifyBlobStorage } from "./netlify-blob-storage.d.ts";
4
- export type { NetlifyBlobStorageOptions } from "./types.d.ts";
1
+ import { F as File, L as LocalMetaStorageOptions, k as BaseStorageOptions, M as MetaStorage, b as FileInit, d as FilePart, e as FileQuery, a as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-BOMUJD96.js";
2
+ import 'node:stream';
3
+ import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-Dop9RP9k.js";
4
+ import 'node:crypto';
5
+ import 'node:http';
6
+ import 'lru-cache';
7
+ declare class NetlifyBlobFile extends File {
8
+ /**
9
+ * The blob's public URL
10
+ */
11
+ url?: string;
12
+ /**
13
+ * The blob's pathname within the store
14
+ */
15
+ pathname?: string;
16
+ }
17
+ declare class NetlifyBlobMetaStorage extends LocalMetaStorage {
18
+ constructor(config?: LocalMetaStorageOptions);
19
+ }
20
+ interface NetlifyBlobStorageOptions extends BaseStorageOptions {
21
+ /**
22
+ * Configure metafiles storage
23
+ * @example
24
+ * Using local metafiles
25
+ * ```ts
26
+ * const storage = new NetlifyBlobStorage({
27
+ * storeName: 'uploads',
28
+ * metaStorageConfig: { directory: '/tmp/upload-metafiles' }
29
+ * })
30
+ * ```
31
+ */
32
+ metaStorageConfig?: LocalMetaStorageOptions;
33
+ /**
34
+ * Netlify site ID (optional, used for explicit store access)
35
+ */
36
+ siteID?: string;
37
+ /**
38
+ * Netlify Blob store name
39
+ * @default 'default'
40
+ */
41
+ storeName?: string;
42
+ /**
43
+ * Netlify API token (optional, can use environment variable NETLIFY_TOKEN)
44
+ */
45
+ token?: string;
46
+ }
47
+ /**
48
+ * Netlify Blob storage based backend.
49
+ * @example
50
+ * ```ts
51
+ * const storage = new NetlifyBlobStorage({
52
+ * storeName: 'uploads',
53
+ * metaStorageConfig: { directory: '/tmp/upload-metafiles' }
54
+ * });
55
+ * ```
56
+ * @remarks
57
+ * ## Supported Operations
58
+ * - ✅ create, write, delete, get, list, copy, move
59
+ * - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
60
+ * - ✅ exists: Implemented (checks metadata and Netlify Blob)
61
+ * - ✅ update: Implemented (updates metadata file, Netlify Blob API doesn't support blob metadata updates)
62
+ * - ❌ getStream: Not implemented (use get() for file retrieval)
63
+ * - ❌ getUrl: Not implemented (Netlify Blob URLs available via Netlify Blob API)
64
+ * - ❌ getUploadUrl: Not implemented (Netlify Blob upload URLs handled internally)
65
+ */
66
+ declare class NetlifyBlobStorage extends BaseStorage<NetlifyBlobFile> {
67
+ static override readonly name: string;
68
+ override checksumTypes: string[];
69
+ protected meta: MetaStorage;
70
+ private readonly storeName;
71
+ private readonly siteID?;
72
+ private readonly token?;
73
+ private store;
74
+ private readonly retry;
75
+ constructor(config: NetlifyBlobStorageOptions);
76
+ create(config: FileInit): Promise<NetlifyBlobFile>;
77
+ write(part: FilePart | FileQuery | NetlifyBlobFile): Promise<NetlifyBlobFile>;
78
+ /**
79
+ * Deletes an upload and its metadata.
80
+ * @param query File query containing the file ID to delete.
81
+ * @param query.id File ID to delete.
82
+ * @returns Promise resolving to the deleted file object with status: "deleted".
83
+ * @throws {UploadError} If the file metadata cannot be found.
84
+ */
85
+ delete({
86
+ id
87
+ }: FileQuery): Promise<NetlifyBlobFile>;
88
+ /**
89
+ * Checks if a file exists by verifying both metadata and the actual Netlify Blob.
90
+ * Returns true only if both the metadata and the blob exist.
91
+ * @param query File query containing the file ID to check.
92
+ * @returns Promise resolving to true if both metadata and blob exist, false otherwise.
93
+ */
94
+ override exists({
95
+ id
96
+ }: FileQuery): Promise<boolean>;
97
+ get({
98
+ id
99
+ }: FileQuery): Promise<FileReturn>;
100
+ /**
101
+ * Copies an upload file to a new location.
102
+ * @param name Source file name/ID.
103
+ * @param destination Destination file name/ID.
104
+ * @returns Promise resolving to the copied file object.
105
+ * @throws {UploadError} If the source file cannot be found.
106
+ */
107
+ copy(name: string, destination: string): Promise<NetlifyBlobFile>;
108
+ /**
109
+ * Moves an upload file to a new location.
110
+ * @param name Source file name/ID.
111
+ * @param destination Destination file name/ID.
112
+ * @returns Promise resolving to the moved file object.
113
+ * @throws {UploadError} If the source file cannot be found.
114
+ */
115
+ move(name: string, destination: string): Promise<NetlifyBlobFile>;
116
+ /**
117
+ * Updates file metadata with user-provided key-value pairs.
118
+ * Updates the metadata file (overwrites it) but does not update Netlify Blob metadata
119
+ * since the Netlify Blob API doesn't support metadata updates.
120
+ * @param query File query containing the file ID to update.
121
+ * @param query.id File ID to update.
122
+ * @param metadata Partial file object containing fields to update.
123
+ * @returns Promise resolving to the updated file object.
124
+ * @throws {UploadError} If the file cannot be found (ERRORS.FILE_NOT_FOUND).
125
+ * @remarks
126
+ * Supports TTL (time-to-live) option: if metadata contains a 'ttl' field,
127
+ * it will be converted to an 'expiredAt' timestamp.
128
+ * TTL can be a number (milliseconds) or string (e.g., "1h", "30m", "7d").
129
+ */
130
+ override update({
131
+ id
132
+ }: FileQuery, metadata: Partial<NetlifyBlobFile>): Promise<NetlifyBlobFile>;
133
+ override list(limit?: number): Promise<NetlifyBlobFile[]>;
134
+ private internalOnComplete;
135
+ /**
136
+ * Generate a URL for a blob in Netlify Blob store
137
+ * Note: Netlify Blob doesn't provide direct public URLs like Vercel Blob
138
+ * In production, you would typically serve these through Netlify Functions or Edge Functions
139
+ */
140
+ private getBlobUrl;
141
+ }
142
+ export { NetlifyBlobFile, NetlifyBlobMetaStorage, NetlifyBlobStorage, type NetlifyBlobStorageOptions };
@@ -1,3 +1 @@
1
- export { default as NetlifyBlobFile } from '../../packem_shared/NetlifyBlobFile-CXzyjqrD.js';
2
- export { default as NetlifyBlobMetaStorage } from '../../packem_shared/NetlifyBlobMetaStorage-DxZ5aDvD.js';
3
- export { default as NetlifyBlobStorage } from '../../packem_shared/NetlifyBlobStorage-C6AX-X0P.js';
1
+ import{default as o}from"../../packem_shared/NetlifyBlobFile-CpzkMKng.js";import{default as a}from"../../packem_shared/NetlifyBlobMetaStorage-dD0oBLom.js";import{default as r}from"../../packem_shared/NetlifyBlobStorage-ByTwCN-h.js";export{o as NetlifyBlobFile,a as NetlifyBlobMetaStorage,r as NetlifyBlobStorage};
@@ -1,4 +1,129 @@
1
- export type { VercelBlobStorageOptions } from "./types.d.ts";
2
- export { default as VercelBlobFile } from "./vercel-blob-file.d.ts";
3
- export { default as VercelBlobMetaStorage } from "./vercel-blob-meta-storage.d.ts";
4
- export { default as VercelBlobStorage } from "./vercel-blob-storage.d.ts";
1
+ import { L as LocalMetaStorageOptions, k as BaseStorageOptions, F as File, M as MetaStorage, b as FileInit, d as FilePart, e as FileQuery, a as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-BOMUJD96.js";
2
+ import 'node:stream';
3
+ import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-Dop9RP9k.js";
4
+ import 'node:crypto';
5
+ import 'node:http';
6
+ import 'lru-cache';
7
+ interface VercelBlobStorageOptions extends BaseStorageOptions {
8
+ /**
9
+ * Configure metafiles storage
10
+ * @example
11
+ * Using local metafiles
12
+ * ```ts
13
+ * const storage = new VercelBlobStorage({
14
+ * token: process.env.BLOB_READ_WRITE_TOKEN,
15
+ * metaStorageConfig: { directory: '/tmp/upload-metafiles' }
16
+ * })
17
+ * ```
18
+ */
19
+ metaStorageConfig?: LocalMetaStorageOptions;
20
+ /**
21
+ * Enable multipart uploads for large files
22
+ * Can be a boolean to always use multipart, or a number (in bytes) as threshold
23
+ * @default false
24
+ * @example
25
+ * // Always use multipart uploads
26
+ * multipart: true
27
+ * // Use multipart for files larger than 100MB
28
+ * multipart: 100 * 1024 * 1024
29
+ */
30
+ multipart?: boolean | number;
31
+ /**
32
+ * Vercel Blob read-write token
33
+ */
34
+ token?: string;
35
+ }
36
+ declare class VercelBlobFile extends File {
37
+ /**
38
+ * The blob's public URL
39
+ */
40
+ url?: string;
41
+ /**
42
+ * The blob's download URL (may be different from url for private blobs)
43
+ */
44
+ downloadUrl?: string;
45
+ /**
46
+ * The blob's pathname within the store
47
+ */
48
+ pathname?: string;
49
+ }
50
+ declare class VercelBlobMetaStorage extends LocalMetaStorage {
51
+ constructor(config?: LocalMetaStorageOptions);
52
+ }
53
+ /**
54
+ * Vercel Blob storage based backend.
55
+ * @example
56
+ * ```ts
57
+ * const storage = new VercelBlobStorage({
58
+ * token: process.env.BLOB_READ_WRITE_TOKEN,
59
+ * metaStorageConfig: { directory: '/tmp/upload-metafiles' }
60
+ * });
61
+ * ```
62
+ * @remarks
63
+ * ## Supported Operations
64
+ * - ✅ create, write, delete, get, copy, move
65
+ * - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
66
+ * - ✅ exists: Implemented (checks metadata and Vercel Blob)
67
+ * - ❌ getStream: Not implemented (use get() for file retrieval)
68
+ * - ❌ list: Not implemented (Vercel Blob API doesn't support listing)
69
+ * - ❌ update: Not implemented (Vercel Blob API doesn't support metadata updates)
70
+ * - ❌ getUrl: Not implemented (Vercel Blob URLs available via Vercel Blob API)
71
+ * - ❌ getUploadUrl: Not implemented (Vercel Blob upload URLs handled internally)
72
+ */
73
+ declare class VercelBlobStorage extends BaseStorage<VercelBlobFile> {
74
+ static override readonly name: string;
75
+ override checksumTypes: string[];
76
+ protected meta: MetaStorage;
77
+ private readonly token;
78
+ private readonly multipart;
79
+ constructor(config: VercelBlobStorageOptions);
80
+ create(config: FileInit): Promise<VercelBlobFile>;
81
+ write(part: FilePart | FileQuery | VercelBlobFile): Promise<VercelBlobFile>;
82
+ /**
83
+ * Deletes an upload and its metadata.
84
+ * @param query File query containing the file ID to delete.
85
+ * @param query.id File ID to delete.
86
+ * @returns Promise resolving to the deleted file object with status: "deleted".
87
+ * @throws {UploadError} If the file metadata cannot be found.
88
+ */
89
+ delete({
90
+ id
91
+ }: FileQuery): Promise<VercelBlobFile>;
92
+ /**
93
+ * Checks if a file exists by verifying both metadata and the actual Vercel Blob.
94
+ * Returns true only if both the metadata and the blob exist.
95
+ * @param query File query containing the file ID to check.
96
+ * @returns Promise resolving to true if both metadata and blob exist, false otherwise.
97
+ */
98
+ override exists({
99
+ id
100
+ }: FileQuery): Promise<boolean>;
101
+ get({
102
+ id
103
+ }: FileQuery): Promise<FileReturn>;
104
+ /**
105
+ * Copies an upload file to a new location.
106
+ * @param name Source file name/ID.
107
+ * @param destination Destination file name/ID.
108
+ * @returns Promise resolving to the copied file object.
109
+ * @throws {UploadError} If the source file cannot be found.
110
+ */
111
+ copy(name: string, destination: string): Promise<VercelBlobFile>;
112
+ /**
113
+ * Moves an upload file to a new location.
114
+ * @param name Source file name/ID.
115
+ * @param destination Destination file name/ID.
116
+ * @returns Promise resolving to the moved file object.
117
+ * @throws {UploadError} If the source file cannot be found.
118
+ */
119
+ move(name: string, destination: string): Promise<VercelBlobFile>;
120
+ override list(limit?: number): Promise<VercelBlobFile[]>;
121
+ private internalOnComplete;
122
+ /**
123
+ * Determines if multipart upload should be used for the given file.
124
+ * @param file File object to check.
125
+ * @returns True if multipart upload should be used, false otherwise.
126
+ */
127
+ private shouldUseMultipart;
128
+ }
129
+ export { VercelBlobFile, VercelBlobMetaStorage, VercelBlobStorage, type VercelBlobStorageOptions };
@@ -1,3 +1 @@
1
- export { default as VercelBlobFile } from '../../packem_shared/VercelBlobFile-BCg4aTEq.js';
2
- export { default as VercelBlobMetaStorage } from '../../packem_shared/VercelBlobMetaStorage-Bd9F-VFm.js';
3
- export { default as VercelBlobStorage } from '../../packem_shared/VercelBlobStorage-BbuEYhOz.js';
1
+ import{default as r}from"../../packem_shared/VercelBlobFile-CL9MjKcY.js";import{default as a}from"../../packem_shared/VercelBlobMetaStorage-BsOTx-Su.js";import{default as f}from"../../packem_shared/VercelBlobStorage-kNkk5Cn4.js";export{r as VercelBlobFile,a as VercelBlobMetaStorage,f as VercelBlobStorage};
@@ -1,128 +1,130 @@
1
- import type { BaseStorage } from "../storage/storage.d.ts";
2
- import type { File, FileReturn } from "../storage/utils/index.d.ts";
3
- import BaseTransformer from "./base-transformer.d.ts";
4
- import type { AudioChannelMixOptions, AudioResampleOptions, AudioTransformationStep, AudioTransformerConfig, AudioTransformOptions, AudioTransformResult } from "./types.d.ts";
1
+ import { F as File, a as FileReturn, B as BaseStorage } from "../packem_shared/storage.d-BOMUJD96.js";
2
+ import { A as AudioTransformerConfig, a as AudioTransformResult, b as AudioResampleOptions, c as AudioChannelMixOptions, d as AudioTransformOptions, e as AudioTransformationStep, B as BaseTransformer } from "../packem_shared/types.d-B4hqF6yH.js";
3
+ import 'node:stream';
4
+ import 'node:crypto';
5
+ import 'node:http';
6
+ import 'lru-cache';
5
7
  /**
6
- * Audio transformer that uses storage backends and Mediabunny to retrieve and transform audio files
7
- *
8
- * Supports audio transformations with query parameters for on-demand audio processing.
9
- * @example
10
- * ```ts
11
- * const transformer = new AudioTransformer(storage, {
12
- * maxAudioSize: 50 * 1024 * 1024, // 50MB
13
- * cache: new Map()
14
- * });
15
- *
16
- * // Programmatic usage - resample audio
17
- * const result = await transformer.resample('audio-id', {
18
- * sampleRate: 44100
19
- * });
20
- *
21
- * // URL-based transformations
22
- * // GET /files/audio-id?sampleRate=48000&codec=aac&bitrate=128000
23
- * // GET /files/audio-id?numberOfChannels=1&format=mp3
24
- * ```
25
- *
26
- * ## Supported Query Parameters
27
- *
28
- * - `sampleRate`: Sample rate in Hz (Number)
29
- * - `numberOfChannels`: Number of channels (Number)
30
- * - `codec`: Audio codec - aac/opus/mp3/vorbis/flac
31
- * - `bitrate`: Audio bitrate in bits per second (Number)
32
- * - `format`: Output format - mp3/wav/ogg/aac/flac
33
- */
8
+ * Audio transformer that uses storage backends and Mediabunny to retrieve and transform audio files
9
+ *
10
+ * Supports audio transformations with query parameters for on-demand audio processing.
11
+ * @example
12
+ * ```ts
13
+ * const transformer = new AudioTransformer(storage, {
14
+ * maxAudioSize: 50 * 1024 * 1024, // 50MB
15
+ * cache: new Map()
16
+ * });
17
+ *
18
+ * // Programmatic usage - resample audio
19
+ * const result = await transformer.resample('audio-id', {
20
+ * sampleRate: 44100
21
+ * });
22
+ *
23
+ * // URL-based transformations
24
+ * // GET /files/audio-id?sampleRate=48000&codec=aac&bitrate=128000
25
+ * // GET /files/audio-id?numberOfChannels=1&format=mp3
26
+ * ```
27
+ *
28
+ * ## Supported Query Parameters
29
+ *
30
+ * - `sampleRate`: Sample rate in Hz (Number)
31
+ * - `numberOfChannels`: Number of channels (Number)
32
+ * - `codec`: Audio codec - aac/opus/mp3/vorbis/flac
33
+ * - `bitrate`: Audio bitrate in bits per second (Number)
34
+ * - `format`: Output format - mp3/wav/ogg/aac/flac
35
+ */
34
36
  declare class AudioTransformer<TFile extends File = File, TFileReturn extends FileReturn = FileReturn> extends BaseTransformer<AudioTransformerConfig, AudioTransformResult<TFileReturn>, TFile, TFileReturn> {
35
- /**
36
- * Creates a new AudioTransformer instance.
37
- * @param storage The storage backend for retrieving and storing audio files.
38
- * @param config Configuration options for audio transformation including cache settings, codec defaults, and size limits.
39
- */
40
- constructor(storage: BaseStorage<TFile, TFileReturn>, config?: AudioTransformerConfig);
41
- /**
42
- * Resamples audio to different sample rate.
43
- * @param fileId Unique identifier of the audio file to resample.
44
- * @param options Resample options including target sample rate.
45
- * @returns Promise resolving to transformed audio result.
46
- */
47
- resample(fileId: string, options: AudioResampleOptions): Promise<AudioTransformResult<TFileReturn>>;
48
- /**
49
- * Changes number of channels (up/downmixing).
50
- * @param fileId Unique identifier of the audio file to process.
51
- * @param options Channel mix options including target number of channels.
52
- * @returns Promise resolving to transformed audio result.
53
- */
54
- mixChannels(fileId: string, options: AudioChannelMixOptions): Promise<AudioTransformResult<TFileReturn>>;
55
- /**
56
- * Converts audio format or codec.
57
- * @param fileId Unique identifier of the audio file to convert.
58
- * @param format Target audio format (e.g., "mp3", "wav", "ogg").
59
- * @param options Additional transform options.
60
- * @returns Promise resolving to transformed audio result.
61
- */
62
- convertFormat(fileId: string, format: string, options?: AudioTransformOptions): Promise<AudioTransformResult<TFileReturn>>;
63
- /**
64
- * Transcodes audio to different codec.
65
- * @param fileId Unique identifier of the audio file to transcode.
66
- * @param codec Target audio codec (e.g., "aac", "opus", "mp3").
67
- * @param options Additional transform options.
68
- * @returns Promise resolving to transformed audio result.
69
- */
70
- transcode(fileId: string, codec: AudioTransformOptions["codec"], options?: Omit<AudioTransformOptions, "codec">): Promise<AudioTransformResult<TFileReturn>>;
71
- /**
72
- * Applies a custom transformation pipeline to an audio file.
73
- * @param fileId Unique identifier of the audio file to transform.
74
- * @param steps Array of transformation steps to apply in sequence.
75
- * @returns Promise resolving to transformed audio result.
76
- */
77
- transform(fileId: string, steps: AudioTransformationStep[]): Promise<AudioTransformResult<TFileReturn>>;
78
- /**
79
- * Apply multiple transformations in sequence using Mediabunny
80
- */
81
- private applyTransformations;
82
- /**
83
- * Convert transformation steps to Mediabunny audio options
84
- * @param steps Array of audio transformation steps to convert
85
- * @returns Mediabunny audio options object for conversion
86
- * @private
87
- */
88
- private stepsToAudioOptions;
89
- /**
90
- * Determine output format based on transformation steps
91
- * @param steps Array of audio transformation steps
92
- * @returns Mediabunny output format instance (defaults to MP3)
93
- * @private
94
- */
95
- private determineOutputFormat;
96
- /**
97
- * Convert format string to Mediabunny output format
98
- * @param format Audio format string (aac, flac, mp3, ogg, wav)
99
- * @returns Mediabunny output format instance
100
- * @private
101
- */
102
- private formatStringToOutputFormat;
103
- /**
104
- * Validate that the file is a supported audio file
105
- * @param file The file to validate
106
- * @returns Promise that resolves if validation passes
107
- * @throws Error if file size exceeds limits, wrong content type, unsupported format, or invalid audio
108
- * @private
109
- */
110
- private validateAudio;
111
- /**
112
- * Create transformation result with metadata
113
- * @param buffer The transformed audio buffer
114
- * @param originalFile The original file information
115
- * @returns Audio transformation result with metadata
116
- * @private
117
- */
118
- private createTransformResult;
119
- /**
120
- * Generate cache key for transformation
121
- * @param fileId The file identifier
122
- * @param steps Array of transformation steps
123
- * @returns Unique cache key string
124
- * @private
125
- */
126
- private generateCacheKey;
37
+ /**
38
+ * Creates a new AudioTransformer instance.
39
+ * @param storage The storage backend for retrieving and storing audio files.
40
+ * @param config Configuration options for audio transformation including cache settings, codec defaults, and size limits.
41
+ */
42
+ constructor(storage: BaseStorage<TFile, TFileReturn>, config?: AudioTransformerConfig);
43
+ /**
44
+ * Resamples audio to different sample rate.
45
+ * @param fileId Unique identifier of the audio file to resample.
46
+ * @param options Resample options including target sample rate.
47
+ * @returns Promise resolving to transformed audio result.
48
+ */
49
+ resample(fileId: string, options: AudioResampleOptions): Promise<AudioTransformResult<TFileReturn>>;
50
+ /**
51
+ * Changes number of channels (up/downmixing).
52
+ * @param fileId Unique identifier of the audio file to process.
53
+ * @param options Channel mix options including target number of channels.
54
+ * @returns Promise resolving to transformed audio result.
55
+ */
56
+ mixChannels(fileId: string, options: AudioChannelMixOptions): Promise<AudioTransformResult<TFileReturn>>;
57
+ /**
58
+ * Converts audio format or codec.
59
+ * @param fileId Unique identifier of the audio file to convert.
60
+ * @param format Target audio format (e.g., "mp3", "wav", "ogg").
61
+ * @param options Additional transform options.
62
+ * @returns Promise resolving to transformed audio result.
63
+ */
64
+ convertFormat(fileId: string, format: string, options?: AudioTransformOptions): Promise<AudioTransformResult<TFileReturn>>;
65
+ /**
66
+ * Transcodes audio to different codec.
67
+ * @param fileId Unique identifier of the audio file to transcode.
68
+ * @param codec Target audio codec (e.g., "aac", "opus", "mp3").
69
+ * @param options Additional transform options.
70
+ * @returns Promise resolving to transformed audio result.
71
+ */
72
+ transcode(fileId: string, codec: AudioTransformOptions["codec"], options?: Omit<AudioTransformOptions, "codec">): Promise<AudioTransformResult<TFileReturn>>;
73
+ /**
74
+ * Applies a custom transformation pipeline to an audio file.
75
+ * @param fileId Unique identifier of the audio file to transform.
76
+ * @param steps Array of transformation steps to apply in sequence.
77
+ * @returns Promise resolving to transformed audio result.
78
+ */
79
+ transform(fileId: string, steps: AudioTransformationStep[]): Promise<AudioTransformResult<TFileReturn>>;
80
+ /**
81
+ * Apply multiple transformations in sequence using Mediabunny
82
+ */
83
+ private applyTransformations;
84
+ /**
85
+ * Convert transformation steps to Mediabunny audio options
86
+ * @param steps Array of audio transformation steps to convert
87
+ * @returns Mediabunny audio options object for conversion
88
+ * @private
89
+ */
90
+ private stepsToAudioOptions;
91
+ /**
92
+ * Determine output format based on transformation steps
93
+ * @param steps Array of audio transformation steps
94
+ * @returns Mediabunny output format instance (defaults to MP3)
95
+ * @private
96
+ */
97
+ private determineOutputFormat;
98
+ /**
99
+ * Convert format string to Mediabunny output format
100
+ * @param format Audio format string (aac, flac, mp3, ogg, wav)
101
+ * @returns Mediabunny output format instance
102
+ * @private
103
+ */
104
+ private formatStringToOutputFormat;
105
+ /**
106
+ * Validate that the file is a supported audio file
107
+ * @param file The file to validate
108
+ * @returns Promise that resolves if validation passes
109
+ * @throws Error if file size exceeds limits, wrong content type, unsupported format, or invalid audio
110
+ * @private
111
+ */
112
+ private validateAudio;
113
+ /**
114
+ * Create transformation result with metadata
115
+ * @param buffer The transformed audio buffer
116
+ * @param originalFile The original file information
117
+ * @returns Audio transformation result with metadata
118
+ * @private
119
+ */
120
+ private createTransformResult;
121
+ /**
122
+ * Generate cache key for transformation
123
+ * @param fileId The file identifier
124
+ * @param steps Array of transformation steps
125
+ * @returns Unique cache key string
126
+ * @private
127
+ */
128
+ private generateCacheKey;
127
129
  }
128
- export default AudioTransformer;
130
+ export { AudioTransformer as default };