@visulima/storage 1.0.0-alpha.1 → 1.0.0-alpha.10

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 (225) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/LICENSE.md +6 -6
  3. package/README.md +33 -14
  4. package/dist/adapter/nuxt/module.d.ts +39 -0
  5. package/dist/adapter/nuxt/module.js +93 -0
  6. package/dist/adapter/nuxt/package.json +20 -0
  7. package/dist/handler/base/base-handler-core.d.ts +91 -0
  8. package/dist/handler/base/base-handler-fetch.d.ts +76 -0
  9. package/dist/handler/base/base-handler-node.d.ts +137 -0
  10. package/dist/handler/http/fetch/index.d.ts +4 -0
  11. package/dist/handler/http/fetch/index.js +4 -0
  12. package/dist/handler/http/hono/index.d.ts +67 -0
  13. package/dist/handler/http/hono/index.js +65 -0
  14. package/dist/handler/http/nextjs/index.d.ts +61 -0
  15. package/dist/handler/http/nextjs/index.js +37 -0
  16. package/dist/handler/http/node/index.d.ts +4 -0
  17. package/dist/handler/http/node/index.js +8 -0
  18. package/dist/handler/http/solid-start/index.d.ts +60 -0
  19. package/dist/handler/http/solid-start/index.js +44 -0
  20. package/dist/handler/multipart/multipart-base.d.ts +84 -0
  21. package/dist/handler/multipart/multipart-fetch.d.ts +64 -0
  22. package/dist/handler/multipart/multipart.d.ts +49 -0
  23. package/dist/handler/rest/rest-base.d.ts +106 -0
  24. package/dist/handler/rest/rest-fetch.d.ts +88 -0
  25. package/dist/handler/rest/rest.d.ts +93 -0
  26. package/dist/handler/tus/tus-base.d.ts +152 -0
  27. package/dist/handler/tus/tus-fetch.d.ts +72 -0
  28. package/dist/handler/tus/tus.d.ts +78 -0
  29. package/dist/handler/types.d.ts +53 -0
  30. package/dist/handler/utils/request-parser.d.ts +72 -0
  31. package/dist/handler/utils/response-builder.d.ts +83 -0
  32. package/dist/handler/utils/storage-utils.d.ts +10 -0
  33. package/dist/handler/utils/stream-utils.d.ts +29 -0
  34. package/dist/handler/utils/upload-handlers.d.ts +76 -0
  35. package/dist/index.d.ts +17 -0
  36. package/dist/index.js +13 -0
  37. package/dist/metrics/index.d.ts +2 -0
  38. package/dist/metrics/no-op-metrics.d.ts +15 -0
  39. package/dist/metrics/opentelemetry-metrics.d.ts +55 -0
  40. package/dist/openapi/index.d.ts +5 -0
  41. package/dist/openapi/index.js +5 -0
  42. package/dist/openapi/rest.d.ts +7 -0
  43. package/dist/openapi/shared.d.ts +13 -0
  44. package/dist/openapi/transform.d.ts +3 -0
  45. package/dist/openapi/tus.d.ts +7 -0
  46. package/dist/openapi/xhr.d.ts +7 -0
  47. package/dist/packem_shared/AwsLightFile-tTneXZgG.js +11 -0
  48. package/dist/packem_shared/AwsLightMetaStorage-BWSOtVaN.js +4 -0
  49. package/dist/packem_shared/AwsLightStorage-Blv-GP4v.js +133 -0
  50. package/dist/packem_shared/AzureFile-CesgFzps.js +8 -0
  51. package/dist/packem_shared/AzureSMetaStorage-CFs-OYJT.js +88 -0
  52. package/dist/packem_shared/AzureStorage-B0v048hG.js +357 -0
  53. package/dist/packem_shared/BaseTransformer-C2gLib6v.js +82 -0
  54. package/dist/packem_shared/DiskStorage-Ck5yGQsq.js +12 -0
  55. package/dist/packem_shared/DiskStorageWithChecksum-BRl-V5x2.js +238 -0
  56. package/dist/packem_shared/ERRORS-D0apMqnc.js +97 -0
  57. package/dist/packem_shared/File-Bb3P23dr.js +69 -0
  58. package/dist/packem_shared/GCSConfig-vPP22kN6.js +11 -0
  59. package/dist/packem_shared/GCSFile-BIEunhAN.js +8 -0
  60. package/dist/packem_shared/GCSMetaStorage-CNX_Nc7d.js +7 -0
  61. package/dist/packem_shared/GCStorage-kdkXVebX.js +406 -0
  62. package/dist/packem_shared/LocalMetaStorage-CZHhKkMd.js +7 -0
  63. package/dist/packem_shared/MediaTransformer-D6658DL1.js +1197 -0
  64. package/dist/packem_shared/MetaStorage-pECeFOad.js +46 -0
  65. package/dist/packem_shared/Metadata-DRLXeJ0F.js +89 -0
  66. package/dist/packem_shared/Multipart-CRV21AUU.js +128 -0
  67. package/dist/packem_shared/Multipart-D2ryPMjD.js +163 -0
  68. package/dist/packem_shared/NetlifyBlobFile-CXzyjqrD.js +14 -0
  69. package/dist/packem_shared/NetlifyBlobMetaStorage-DxZ5aDvD.js +9 -0
  70. package/dist/packem_shared/NetlifyBlobStorage-CLPtjHqd.js +376 -0
  71. package/dist/packem_shared/NoOpMetrics-DhAk5rXc.js +10 -0
  72. package/dist/packem_shared/OpenTelemetryMetrics-BnxhqIaH.js +67 -0
  73. package/dist/packem_shared/Rest-DcxBMBjU.js +228 -0
  74. package/dist/packem_shared/Rest-DjwU3puo.js +267 -0
  75. package/dist/packem_shared/S3File-DZiyk9Qt.js +11 -0
  76. package/dist/packem_shared/S3MetaStorage-Dz9aDabA.js +76 -0
  77. package/dist/packem_shared/S3Storage-DHmTk-hU.js +316 -0
  78. package/dist/packem_shared/TUS_RESUMABLE-Dtfsffnj.js +434 -0
  79. package/dist/packem_shared/Tus-DFVlZHaX.js +200 -0
  80. package/dist/packem_shared/Tus-DaN0FmOy.js +195 -0
  81. package/dist/packem_shared/ValidationError-BfF1aE4h.js +26 -0
  82. package/dist/packem_shared/VercelBlobFile-BCg4aTEq.js +18 -0
  83. package/dist/packem_shared/VercelBlobMetaStorage-Bd9F-VFm.js +9 -0
  84. package/dist/packem_shared/VercelBlobStorage-DD9LMOS6.js +261 -0
  85. package/dist/packem_shared/_commonjsHelpers-BqLXS_qQ.js +5 -0
  86. package/dist/packem_shared/aws-light-meta-storage-DKJBgbR6.js +446 -0
  87. package/dist/packem_shared/backblaze-BlMnIcBC.js +20 -0
  88. package/dist/packem_shared/base-handler-core-BoAqTyz7.js +303 -0
  89. package/dist/packem_shared/base-handler-fetch-D4u2xits.js +291 -0
  90. package/dist/packem_shared/base-handler-node-DGzcHHAy.js +730 -0
  91. package/dist/packem_shared/cache-B88MXQ_2.js +18 -0
  92. package/dist/packem_shared/cloudflare-Bi1q8wXE.js +21 -0
  93. package/dist/packem_shared/defaultCloudStorageFileNameValidation-DUuacjWv.js +11 -0
  94. package/dist/packem_shared/digitalOcean-CWQRJM3L.js +21 -0
  95. package/dist/packem_shared/disk-storage-CD47QI30.js +810 -0
  96. package/dist/packem_shared/gcs-meta-storage-BiQ1dySn.js +158 -0
  97. package/dist/packem_shared/has-content-CY66ehMK.js +3 -0
  98. package/dist/packem_shared/headers-YLRp1dLo.js +1318 -0
  99. package/dist/packem_shared/is-expired-CTThU1q5.js +8 -0
  100. package/dist/packem_shared/isRetryableError-Dycp7127.js +82 -0
  101. package/dist/packem_shared/isValidMediaType-BeDgiObq.js +35 -0
  102. package/dist/packem_shared/local-meta-storage-By-3SNBI.js +649 -0
  103. package/dist/packem_shared/minio-C2YBZQOw.js +22 -0
  104. package/dist/packem_shared/multipart-base-C994naBi.js +102 -0
  105. package/dist/packem_shared/part-match-BMNqHDYD.js +96 -0
  106. package/dist/packem_shared/path-CR6YkPXX-7R1-9CMk.js +161 -0
  107. package/dist/packem_shared/response-builder-BtnRiBUI.js +45 -0
  108. package/dist/packem_shared/rest-base-D9URIFkc.js +457 -0
  109. package/dist/packem_shared/restOpenApiSpec-D1JC_Jto.js +800 -0
  110. package/dist/packem_shared/s3-base-storage-C1DIHTYY.js +510 -0
  111. package/dist/packem_shared/sharedGet-Cpo7QUyu.js +1019 -0
  112. package/dist/packem_shared/storage-C6NSXb8h.js +1175 -0
  113. package/dist/packem_shared/tigris-Hac8TKnX.js +21 -0
  114. package/dist/packem_shared/transformOpenApiSpec-DWM5WtnN.js +975 -0
  115. package/dist/packem_shared/tusOpenApiSpec-mBZkl7he.js +740 -0
  116. package/dist/packem_shared/update-size-CCGm6i1J.js +8 -0
  117. package/dist/packem_shared/validator-BeX_lJet.js +78 -0
  118. package/dist/packem_shared/waitForStorage-Cscw85sx.js +18 -0
  119. package/dist/packem_shared/wasabi-DIyflHSd.js +21 -0
  120. package/dist/packem_shared/xhrOpenApiSpec-B1V5Dxrj.js +264 -0
  121. package/dist/storage/aws/clients/backblaze.d.ts +12 -0
  122. package/dist/storage/aws/clients/cloudflare.d.ts +13 -0
  123. package/dist/storage/aws/clients/digital-ocean.d.ts +12 -0
  124. package/dist/storage/aws/clients/index.d.ts +6 -0
  125. package/dist/storage/aws/clients/index.js +6 -0
  126. package/dist/storage/aws/clients/minio.d.ts +13 -0
  127. package/dist/storage/aws/clients/tigris.d.ts +12 -0
  128. package/dist/storage/aws/clients/types.d.ts +95 -0
  129. package/dist/storage/aws/clients/wasabi.d.ts +12 -0
  130. package/dist/storage/aws/index.d.ts +4 -0
  131. package/dist/storage/aws/index.js +3 -0
  132. package/dist/storage/aws/s3-base-storage.d.ts +248 -0
  133. package/dist/storage/aws/s3-client-adapter.d.ts +110 -0
  134. package/dist/storage/aws/s3-file.d.ts +10 -0
  135. package/dist/storage/aws/s3-meta-storage.d.ts +15 -0
  136. package/dist/storage/aws/s3-storage.d.ts +70 -0
  137. package/dist/storage/aws/types.d.ts +119 -0
  138. package/dist/storage/aws-light/aws-light-api-adapter.d.ts +130 -0
  139. package/dist/storage/aws-light/aws-light-file.d.ts +10 -0
  140. package/dist/storage/aws-light/aws-light-meta-storage.d.ts +19 -0
  141. package/dist/storage/aws-light/aws-light-storage.d.ts +65 -0
  142. package/dist/storage/aws-light/index.d.ts +4 -0
  143. package/dist/storage/aws-light/index.js +3 -0
  144. package/dist/storage/aws-light/types.d.ts +37 -0
  145. package/dist/storage/azure/azure-file.d.ts +6 -0
  146. package/dist/storage/azure/azure-meta-storage.d.ts +15 -0
  147. package/dist/storage/azure/azure-storage.d.ts +69 -0
  148. package/dist/storage/azure/index.d.ts +4 -0
  149. package/dist/storage/azure/index.js +3 -0
  150. package/dist/storage/azure/types.d.ts +62 -0
  151. package/dist/storage/gcs/fetch-error.d.ts +11 -0
  152. package/dist/storage/gcs/gcs-config.d.ts +2 -0
  153. package/dist/storage/gcs/gcs-file.d.ts +6 -0
  154. package/dist/storage/gcs/gcs-meta-storage.d.ts +27 -0
  155. package/dist/storage/gcs/gcs-storage.d.ts +91 -0
  156. package/dist/storage/gcs/index.d.ts +5 -0
  157. package/dist/storage/gcs/index.js +4 -0
  158. package/dist/storage/gcs/types.d.ts +55 -0
  159. package/dist/storage/gcs/utils.d.ts +7 -0
  160. package/dist/storage/local/disk-storage-with-checksum.d.ts +15 -0
  161. package/dist/storage/local/disk-storage.d.ts +135 -0
  162. package/dist/storage/local/index.d.ts +4 -0
  163. package/dist/storage/local/index.js +3 -0
  164. package/dist/storage/local/local-meta-storage.d.ts +32 -0
  165. package/dist/storage/meta-storage.d.ts +30 -0
  166. package/dist/storage/netlify-blob/index.d.ts +4 -0
  167. package/dist/storage/netlify-blob/index.js +3 -0
  168. package/dist/storage/netlify-blob/netlify-blob-file.d.ts +12 -0
  169. package/dist/storage/netlify-blob/netlify-blob-meta-storage.d.ts +7 -0
  170. package/dist/storage/netlify-blob/netlify-blob-storage.d.ts +93 -0
  171. package/dist/storage/netlify-blob/types.d.ts +30 -0
  172. package/dist/storage/storage.d.ts +353 -0
  173. package/dist/storage/types.d.ts +221 -0
  174. package/dist/storage/utils/file/file.d.ts +25 -0
  175. package/dist/storage/utils/file/get-file-status.d.ts +9 -0
  176. package/dist/storage/utils/file/has-content.d.ts +9 -0
  177. package/dist/storage/utils/file/index.d.ts +10 -0
  178. package/dist/storage/utils/file/is-expired.d.ts +8 -0
  179. package/dist/storage/utils/file/metadata.d.ts +18 -0
  180. package/dist/storage/utils/file/part-match.d.ts +11 -0
  181. package/dist/storage/utils/file/types.d.ts +37 -0
  182. package/dist/storage/utils/file/update-metadata.d.ts +10 -0
  183. package/dist/storage/utils/file/update-size.d.ts +10 -0
  184. package/dist/storage/vercel-blob/index.d.ts +4 -0
  185. package/dist/storage/vercel-blob/index.js +3 -0
  186. package/dist/storage/vercel-blob/types.d.ts +32 -0
  187. package/dist/storage/vercel-blob/vercel-blob-file.d.ts +16 -0
  188. package/dist/storage/vercel-blob/vercel-blob-meta-storage.d.ts +7 -0
  189. package/dist/storage/vercel-blob/vercel-blob-storage.d.ts +76 -0
  190. package/dist/transformer/audio-transformer.d.ts +128 -0
  191. package/dist/transformer/audio-transformer.js +278 -0
  192. package/dist/transformer/base-transformer.d.ts +63 -0
  193. package/dist/transformer/image-transformer.d.ts +571 -0
  194. package/dist/transformer/image-transformer.js +1100 -0
  195. package/dist/transformer/index.d.ts +5 -0
  196. package/dist/transformer/index.js +4 -0
  197. package/dist/transformer/media-transformer.d.ts +332 -0
  198. package/dist/transformer/types.d.ts +652 -0
  199. package/dist/transformer/utils.d.ts +33 -0
  200. package/dist/transformer/validation-error.d.ts +23 -0
  201. package/dist/transformer/video-transformer.d.ts +145 -0
  202. package/dist/transformer/video-transformer.js +310 -0
  203. package/dist/utils/cache.d.ts +32 -0
  204. package/dist/utils/chunked-upload.d.ts +65 -0
  205. package/dist/utils/detect-file-type.d.ts +28 -0
  206. package/dist/utils/errors.d.ts +74 -0
  207. package/dist/utils/file-path-url-matcher.d.ts +18 -0
  208. package/dist/utils/headers.d.ts +111 -0
  209. package/dist/utils/http.d.ts +92 -0
  210. package/dist/utils/locker.d.ts +26 -0
  211. package/dist/utils/pipes/stream-checksum.d.ts +47 -0
  212. package/dist/utils/pipes/stream-length.d.ts +22 -0
  213. package/dist/utils/primitives/get-last-one.d.ts +3 -0
  214. package/dist/utils/primitives/is-record.d.ts +2 -0
  215. package/dist/utils/primitives/map-values.d.ts +9 -0
  216. package/dist/utils/primitives/pick.d.ts +2 -0
  217. package/dist/utils/primitives/to-milliseconds.d.ts +12 -0
  218. package/dist/utils/primitives/to-seconds.d.ts +12 -0
  219. package/dist/utils/range-checksum.d.ts +33 -0
  220. package/dist/utils/range-hasher.d.ts +46 -0
  221. package/dist/utils/retry.d.ts +64 -0
  222. package/dist/utils/types.d.ts +108 -0
  223. package/dist/utils/validation-error.d.ts +22 -0
  224. package/dist/utils/validator.d.ts +36 -0
  225. package/package.json +10 -9
package/CHANGELOG.md CHANGED
@@ -1,3 +1,151 @@
1
+ ## @visulima/storage [1.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/storage@1.0.0-alpha.9...@visulima/storage@1.0.0-alpha.10) (2026-03-26)
2
+
3
+ ### Features
4
+
5
+ * **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
6
+
7
+
8
+ ### Dependencies
9
+
10
+ * **@visulima/pagination:** upgraded to 5.0.0-alpha.8
11
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.6
12
+ * **@visulima/humanizer:** upgraded to 3.0.0-alpha.8
13
+ * **@visulima/path:** upgraded to 3.0.0-alpha.7
14
+
15
+ ## @visulima/storage [1.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/storage@1.0.0-alpha.8...@visulima/storage@1.0.0-alpha.9) (2026-03-26)
16
+
17
+ ### Bug Fixes
18
+
19
+ * **storage:** use workspace:* for internal [@visulima](https://github.com/visulima) deps ([ff79afe](https://github.com/visulima/visulima/commit/ff79afe26f1941eab24cff80477d8c18aaec65e9))
20
+ * **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
21
+
22
+ ### Miscellaneous Chores
23
+
24
+ * **storage:** migrate deps to pnpm catalogs ([7dfea89](https://github.com/visulima/visulima/commit/7dfea8981d74cd84317133242d2ab5a31f3f98b7))
25
+
26
+ ### Code Refactoring
27
+
28
+ * **docs:** migrate Nextra components to fumadocs-ui, remove Nextra stripping ([484878f](https://github.com/visulima/visulima/commit/484878f01879363ef5e9a0282904dc4627d6060c))
29
+
30
+
31
+ ### Dependencies
32
+
33
+ * **@visulima/pagination:** upgraded to 5.0.0-alpha.7
34
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.5
35
+ * **@visulima/humanizer:** upgraded to 3.0.0-alpha.7
36
+ * **@visulima/path:** upgraded to 3.0.0-alpha.6
37
+
38
+ ## @visulima/storage [1.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/storage@1.0.0-alpha.7...@visulima/storage@1.0.0-alpha.8) (2026-03-16)
39
+
40
+ ### Bug Fixes
41
+
42
+ * resolve 5 audit vulnerabilities (simple-git, express-rate-limit, tar, file-type, hono) ([2986d77](https://github.com/visulima/visulima/commit/2986d770746afd3223a074dc1a1a0040cca56e61))
43
+
44
+ ### Miscellaneous Chores
45
+
46
+ * **storage:** update dependencies ([a2d2577](https://github.com/visulima/visulima/commit/a2d257702693aac7f368bddfd0481cdac09c3901))
47
+ * visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
48
+
49
+ ## @visulima/storage [1.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/storage@1.0.0-alpha.6...@visulima/storage@1.0.0-alpha.7) (2026-03-06)
50
+
51
+ ### Bug Fixes
52
+
53
+ * **storage:** update packem to 2.0.0-alpha.54 ([a65ad87](https://github.com/visulima/visulima/commit/a65ad877ac5804a0c1354331a380fbcceddf261f))
54
+
55
+ ### Miscellaneous Chores
56
+
57
+ * **storage:** update dependencies ([19b3d5c](https://github.com/visulima/visulima/commit/19b3d5c5fd1e535fbbb1419a827e5c4c0b35fa77))
58
+ * **storage:** update dependencies ([f591768](https://github.com/visulima/visulima/commit/f591768de337c1b201191e4b78dd7e3fb79ca42b))
59
+ * update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
60
+ * year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
61
+
62
+ ### Code Refactoring
63
+
64
+ * **storage:** replace SuperHeaders with native Headers ([68546c5](https://github.com/visulima/visulima/commit/68546c52bedad5c1338d571ad9a2034cc9f49b53))
65
+
66
+
67
+ ### Dependencies
68
+
69
+ * **@visulima/pagination:** upgraded to 5.0.0-alpha.6
70
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.4
71
+ * **@visulima/humanizer:** upgraded to 3.0.0-alpha.6
72
+ * **@visulima/path:** upgraded to 3.0.0-alpha.5
73
+
74
+ ## @visulima/storage [1.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/storage@1.0.0-alpha.5...@visulima/storage@1.0.0-alpha.6) (2026-01-17)
75
+
76
+ ### Miscellaneous Chores
77
+
78
+ * **storage:** update dependencies ([b2450d8](https://github.com/visulima/visulima/commit/b2450d8f096991389ceed4bf4def2f99363daf6f))
79
+
80
+
81
+ ### Dependencies
82
+
83
+ * **@visulima/pagination:** upgraded to 5.0.0-alpha.5
84
+
85
+ ## @visulima/storage [1.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/storage@1.0.0-alpha.4...@visulima/storage@1.0.0-alpha.5) (2025-12-27)
86
+
87
+ ### Bug Fixes
88
+
89
+ * **dependencies:** update hono and related packages to version 4.11.2 and update @hono/swagger-ui to version 0.5.3 ([5d3eed5](https://github.com/visulima/visulima/commit/5d3eed57d30d8216bf91484f35d39678938651fb))
90
+ * **storage:** update package files ([5ef0060](https://github.com/visulima/visulima/commit/5ef0060c39b4457395583a828eb2f72fc3949496))
91
+
92
+ ### Miscellaneous Chores
93
+
94
+ * **dependencies:** update file-type to version 21.2.0, hono to version 4.11.3, and improve README for storage-client with detailed usage examples ([90bebfa](https://github.com/visulima/visulima/commit/90bebfa9b732afd8d80c133ca0636192b8496801))
95
+ * fixed project.json names and schema path ([964722f](https://github.com/visulima/visulima/commit/964722f691db205c7edb9aa6db29e849a647500b))
96
+
97
+
98
+ ### Dependencies
99
+
100
+ * **@visulima/pagination:** upgraded to 5.0.0-alpha.4
101
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.3
102
+ * **@visulima/humanizer:** upgraded to 3.0.0-alpha.5
103
+ * **@visulima/path:** upgraded to 3.0.0-alpha.4
104
+
105
+ ## @visulima/storage [1.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/storage@1.0.0-alpha.3...@visulima/storage@1.0.0-alpha.4) (2025-12-11)
106
+
107
+ ### Bug Fixes
108
+
109
+ * update package OG images across multiple packages ([f08e4dd](https://github.com/visulima/visulima/commit/f08e4dd2b105ccb29c8412020a9c2be36d6c1e9e))
110
+
111
+
112
+ ### Dependencies
113
+
114
+ * **@visulima/pagination:** upgraded to 5.0.0-alpha.3
115
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.2
116
+ * **@visulima/humanizer:** upgraded to 3.0.0-alpha.4
117
+ * **@visulima/path:** upgraded to 3.0.0-alpha.3
118
+
119
+ ## @visulima/storage [1.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/storage@1.0.0-alpha.2...@visulima/storage@1.0.0-alpha.3) (2025-12-10)
120
+
121
+
122
+ ### Dependencies
123
+
124
+ * **@visulima/humanizer:** upgraded to 3.0.0-alpha.3
125
+
126
+ ## @visulima/storage [1.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/storage@1.0.0-alpha.1...@visulima/storage@1.0.0-alpha.2) (2025-12-07)
127
+
128
+ ### ⚠ BREAKING CHANGES
129
+
130
+ * change min node version to 22.13
131
+
132
+ ### Bug Fixes
133
+
134
+ * add new package image, fixed readme rendering on npm, fixed building of packages ([b790ba2](https://github.com/visulima/visulima/commit/b790ba253ea07fef83528fd822a678facf021b5f))
135
+ * update Node.js engine version requirement to >=22.13 in multiple package.json files for improved compatibility ([b828e9a](https://github.com/visulima/visulima/commit/b828e9aeaebfc798eecddccd90e6ec7560c6d36a))
136
+
137
+ ### Miscellaneous Chores
138
+
139
+ * moved all packages into groups ([0615e9d](https://github.com/visulima/visulima/commit/0615e9d14a8a886e11da529ce150cf31ca973c10))
140
+ * update @anolilab/semantic-release-pnpm and @anolilab/semantic-release-preset to versions 3.2.2 and 12.1.2 across multiple package.json files for improved compatibility ([3921626](https://github.com/visulima/visulima/commit/3921626141fe5da398749bf0ba675f1596f18afb))
141
+ * update dependencies across multiple packages to improve compatibility and performance, including upgrading `@anolilab/semantic-release-pnpm` and `@anolilab/semantic-release-preset` to versions 3.2.0 and 12.1.0 respectively, and updating `react`, `react-dom`, and `next` versions to 19.2.1 and 16.0.7 in various package.json files ([aee8fcd](https://github.com/visulima/visulima/commit/aee8fcd796ae9b8d055903260e7150996ea9f53d))
142
+ * update implicit dependencies in project.json for storage package ([2473f8a](https://github.com/visulima/visulima/commit/2473f8a2297df40425ba4eb4d9eb14d40db0b6ac))
143
+
144
+
145
+ ### Dependencies
146
+
147
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.1
148
+
1
149
  ## @visulima/storage 1.0.0-alpha.1 (2025-12-02)
2
150
 
3
151
  ### Features
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 visulima
3
+ Copyright (c) 2026 visulima
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -63,7 +63,7 @@ Repository: git+https://github.com/visulima/visulima.git
63
63
 
64
64
  > MIT License
65
65
  >
66
- > Copyright (c) 2025 visulima
66
+ > Copyright (c) 2026 visulima
67
67
  >
68
68
  > Permission is hereby granted, free of charge, to any person obtaining a copy
69
69
  > of this software and associated documentation files (the "Software"), to deal
@@ -97,7 +97,7 @@ Repository: git+https://github.com/visulima/visulima.git
97
97
  >
98
98
  > > MIT License
99
99
  > >
100
- > > Copyright (c) 2025 visulima
100
+ > > Copyright (c) 2026 visulima
101
101
  > >
102
102
  > > Permission is hereby granted, free of charge, to any person obtaining a copy
103
103
  > > of this software and associated documentation files (the "Software"), to deal
@@ -131,7 +131,7 @@ Repository: git+https://github.com/visulima/visulima.git
131
131
  > >
132
132
  > > > MIT License
133
133
  > > >
134
- > > > Copyright (c) 2025 visulima
134
+ > > > Copyright (c) 2026 visulima
135
135
  > > >
136
136
  > > > Permission is hereby granted, free of charge, to any person obtaining a copy
137
137
  > > > of this software and associated documentation files (the "Software"), to deal
@@ -358,7 +358,7 @@ Repository: git+https://github.com/visulima/visulima.git
358
358
 
359
359
  > MIT License
360
360
  >
361
- > Copyright (c) 2025 visulima
361
+ > Copyright (c) 2026 visulima
362
362
  >
363
363
  > Permission is hereby granted, free of charge, to any person obtaining a copy
364
364
  > of this software and associated documentation files (the "Software"), to deal
@@ -427,7 +427,7 @@ Repository: git+https://github.com/visulima/visulima.git
427
427
 
428
428
  > MIT License
429
429
  >
430
- > Copyright (c) 2025 visulima
430
+ > Copyright (c) 2026 visulima
431
431
  >
432
432
  > Permission is hereby granted, free of charge, to any person obtaining a copy
433
433
  > of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,15 +1,24 @@
1
- <div align="center">
2
- <h3>Visulima upload</h3>
3
- <p>Visulima upload copies files to a web-accessible location and provides a consistent way to get the URLs that correspond to those files.</p>
4
- <p>Visulima upload can also resize, crop and autorotate uploaded images.</p>
5
- <p>Visulima upload includes S3-based, Azure-based, GCS-based and local filesystem-based backends and you may supply others.</p>
6
- </div>
1
+ <!-- START_PACKAGE_OG_IMAGE_PLACEHOLDER -->
2
+
3
+ <a href="https://www.anolilab.com/open-source" align="center">
4
+
5
+ <img src="__assets__/package-og.svg" alt="storage" />
6
+
7
+ </a>
8
+
9
+ <h3 align="center">Visulima upload - Store files in a web-accessible location via a simplified API. Can automatically scale and rotate images. Includes S3, Azure, GCS and local filesystem-based backends with the most convenient features of each.</h3>
10
+
11
+ <!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
7
12
 
8
13
  <br />
9
14
 
10
15
  <div align="center">
11
16
 
12
- [![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]
17
+ [![typescript-image][typescript-badge]][typescript-url]
18
+ [![mit licence][license-badge]][license]
19
+ [![npm downloads][npm-downloads-badge]][npm-downloads]
20
+ [![Chat][chat-badge]][chat]
21
+ [![PRs Welcome][prs-welcome-badge]][prs-welcome]
13
22
 
14
23
  </div>
15
24
 
@@ -549,13 +558,23 @@ If you would like to help take a look at the [list of issues](https://github.com
549
558
  - [Daniel Bannert](https://github.com/prisis)
550
559
  - [All Contributors](https://github.com/visulima/visulima/graphs/contributors)
551
560
 
561
+ ## Made with ❤️ at Anolilab
562
+
563
+ This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Anolilab](https://www.anolilab.com/open-source) is a Development and AI Studio. Contact us at [hello@anolilab.com](mailto:hello@anolilab.com) if you need any help with these technologies or just want to say hi!
564
+
552
565
  ## License
553
566
 
554
- The visulima uploads is open-sourced software licensed under the [MIT][license-url]
567
+ The visulima storage is open-sourced software licensed under the [MIT][license]
568
+
569
+ <!-- badges -->
555
570
 
556
- [typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
557
- [typescript-url]: "typescript"
558
- [license-image]: https://img.shields.io/npm/l/@visulima/upload?color=blueviolet&style=for-the-badge
559
- [license-url]: LICENSE.md "license"
560
- [npm-image]: https://img.shields.io/npm/v/@visulima/upload/latest.svg?style=for-the-badge&logo=npm
561
- [npm-url]: https://www.npmjs.com/package/@visulima/upload/v/latest "npm"
571
+ [license-badge]: https://img.shields.io/npm/l/@visulima/storage?style=for-the-badge
572
+ [license]: https://github.com/visulima/visulima/blob/main/LICENSE
573
+ [npm-downloads-badge]: https://img.shields.io/npm/dm/@visulima/storage?style=for-the-badge
574
+ [npm-downloads]: https://www.npmjs.com/package/@visulima/storage
575
+ [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
576
+ [prs-welcome]: https://github.com/visulima/visulima/blob/main/.github/CONTRIBUTING.md
577
+ [chat-badge]: https://img.shields.io/discord/932323359193186354.svg?style=for-the-badge
578
+ [chat]: https://discord.gg/TtFJY8xkFK
579
+ [typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
580
+ [typescript-url]: https://www.typescriptlang.org/
@@ -0,0 +1,39 @@
1
+ import type { UploadOptions } from "../../handler/types.d.ts";
2
+ import type { BaseStorage } from "../../storage/storage.d.ts";
3
+ import type { UploadFile } from "../../storage/utils/index.d.ts";
4
+ /**
5
+ * CORS configuration for upload endpoints
6
+ */
7
+ export interface CorsOptions {
8
+ /** Allowed CORS headers */
9
+ headers?: string[];
10
+ /** Allowed HTTP methods */
11
+ methods?: string[];
12
+ /** Allowed origins (use "*" for all origins) */
13
+ origin?: string | string[];
14
+ }
15
+ /**
16
+ * Configuration options for the Nuxt storage module
17
+ */
18
+ export interface ModuleOptions {
19
+ /** Base path for upload routes (default: '/api/upload') */
20
+ basePath?: string;
21
+ /** CORS configuration */
22
+ cors?: CorsOptions;
23
+ /** Enable multipart upload endpoint (default: true) */
24
+ multipart?: boolean;
25
+ /** Additional options for multipart handler */
26
+ multipartOptions?: Omit<UploadOptions<UploadFile>, "storage">;
27
+ /** Enable REST API endpoint for direct binary uploads (default: true) */
28
+ rest?: boolean;
29
+ /** Additional options for REST handler */
30
+ restOptions?: Omit<UploadOptions<UploadFile>, "storage">;
31
+ /** Storage instance to use for file uploads */
32
+ storage: BaseStorage;
33
+ /** Enable TUS resumable upload endpoint (default: true) */
34
+ tus?: boolean;
35
+ /** Additional options for TUS handler */
36
+ tusOptions?: Omit<UploadOptions<UploadFile>, "storage">;
37
+ }
38
+ declare const nuxtModule: any;
39
+ export default nuxtModule;
@@ -0,0 +1,93 @@
1
+ import { defineNuxtModule } from '@nuxt/kit';
2
+
3
+ const handlerStorage = /* @__PURE__ */ new Map();
4
+ const nuxtModule = defineNuxtModule({
5
+ defaults: {
6
+ basePath: "/api/upload",
7
+ cors: {
8
+ headers: ["Content-Type", "Upload-Offset", "Upload-Length", "Tus-Resumable"],
9
+ methods: ["GET", "POST", "PATCH", "PUT", "HEAD", "DELETE", "OPTIONS"],
10
+ origin: "*"
11
+ },
12
+ multipart: true,
13
+ rest: true,
14
+ tus: true
15
+ },
16
+ meta: {
17
+ compatibility: {
18
+ nuxt: ">=4.0.0"
19
+ },
20
+ configKey: "storage",
21
+ name: "@visulima/storage"
22
+ },
23
+ async setup(options, nuxt) {
24
+ const {
25
+ basePath = "/api/upload",
26
+ cors = {
27
+ headers: ["Content-Type", "Upload-Offset", "Upload-Length", "Tus-Resumable"],
28
+ methods: ["GET", "POST", "PATCH", "PUT", "HEAD", "DELETE", "OPTIONS"],
29
+ origin: "*"
30
+ },
31
+ multipart = true,
32
+ multipartOptions = {},
33
+ rest = true,
34
+ restOptions = {},
35
+ storage,
36
+ tus = true,
37
+ tusOptions = {}
38
+ } = options;
39
+ if (!storage) {
40
+ throw new Error("[@visulima/storage/nuxt] Storage instance is required");
41
+ }
42
+ const { Multipart, Rest, Tus } = await import('../../handler/http/node/index.js');
43
+ const multipartHandler = multipart ? new Multipart({ storage, ...multipartOptions }) : void 0;
44
+ const restHandler = rest ? new Rest({ storage, ...restOptions }) : void 0;
45
+ const tusHandler = tus ? new Tus({ storage, ...tusOptions }) : void 0;
46
+ const setCorsHeaders = (event) => {
47
+ const origin = Array.isArray(cors.origin) ? cors.origin.join(", ") : cors.origin || "*";
48
+ event.node.res.setHeader("Access-Control-Allow-Origin", origin);
49
+ if (cors.methods) {
50
+ event.node.res.setHeader("Access-Control-Allow-Methods", cors.methods.join(", "));
51
+ }
52
+ if (cors.headers) {
53
+ event.node.res.setHeader("Access-Control-Allow-Headers", cors.headers.join(", "));
54
+ }
55
+ };
56
+ if (multipartHandler) {
57
+ handlerStorage.set(`${basePath}/multipart`, { handler: multipartHandler, setCorsHeaders });
58
+ }
59
+ if (restHandler) {
60
+ handlerStorage.set(`${basePath}/rest`, { handler: restHandler, setCorsHeaders });
61
+ }
62
+ if (tusHandler) {
63
+ handlerStorage.set(`${basePath}/tus`, { handler: tusHandler, setCorsHeaders });
64
+ }
65
+ nuxt.hook("nitro:config", (nitroConfig) => {
66
+ const routeRules = nitroConfig.routeRules || {};
67
+ if (multipartHandler) {
68
+ routeRules[`${basePath}/multipart/**`] = { cors: true };
69
+ }
70
+ if (restHandler) {
71
+ routeRules[`${basePath}/rest/**`] = { cors: true };
72
+ }
73
+ if (tusHandler) {
74
+ routeRules[`${basePath}/tus/**`] = { cors: true };
75
+ }
76
+ nitroConfig.routeRules = routeRules;
77
+ });
78
+ nuxt.hook("nitro:init", (nitro) => {
79
+ nitro.hooks.hook("request", async (event) => {
80
+ const url = event.node.req.url || "";
81
+ for (const [route, { handler, setCorsHeaders: setHeaders }] of handlerStorage.entries()) {
82
+ if (url.startsWith(route)) {
83
+ setHeaders(event);
84
+ await handler.handle(event.node.req, event.node.res);
85
+ return;
86
+ }
87
+ }
88
+ });
89
+ });
90
+ }
91
+ });
92
+
93
+ export { nuxtModule as default };
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@visulima/storage-nuxt",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./module.d.ts",
8
+ "import": "./module.js"
9
+ }
10
+ },
11
+ "main": "./module.js",
12
+ "types": "./module.d.ts",
13
+ "files": [
14
+ "."
15
+ ],
16
+ "peerDependencies": {
17
+ "@nuxt/kit": ">=4.0.0",
18
+ "nuxt": ">=4.0.0"
19
+ }
20
+ }
@@ -0,0 +1,91 @@
1
+ import { EventEmitter } from "node:events";
2
+ import type { BaseStorage } from "../../storage/storage.d.ts";
3
+ import type { UploadFile } from "../../storage/utils/index.d.ts";
4
+ import type MediaTransformer from "../../transformer/media-transformer.d.ts";
5
+ import type { ErrorResponses } from "../../utils/errors.d.ts";
6
+ import type { ResponseBodyType } from "../../utils/types.d.ts";
7
+ import type { UploadOptions } from "../types.d.ts";
8
+ /**
9
+ * Core base class containing shared business logic for all handlers.
10
+ * This class is platform-agnostic and contains no Node.js or Web API specific code.
11
+ * @template TFile The file type used by this handler.
12
+ */
13
+ declare abstract class BaseHandlerCore<TFile extends UploadFile> extends EventEmitter {
14
+ /**
15
+ * Response body type for the handler.
16
+ */
17
+ responseType: ResponseBodyType;
18
+ /**
19
+ * Storage instance for file operations.
20
+ */
21
+ storage: BaseStorage<TFile>;
22
+ /**
23
+ * Optional media transformer for image/video processing.
24
+ */
25
+ mediaTransformer?: MediaTransformer;
26
+ /**
27
+ * Whether to disable termination for finished uploads.
28
+ */
29
+ disableTerminationForFinishedUploads?: boolean;
30
+ /**
31
+ * Logger instance for debugging and error reporting.
32
+ */
33
+ protected logger?: Console;
34
+ /**
35
+ * Gets the logger instance.
36
+ * @returns Logger instance or undefined.
37
+ */
38
+ get loggerInstance(): Console | undefined;
39
+ /**
40
+ * Internal error responses configuration.
41
+ */
42
+ protected internalErrorResponses: ErrorResponses;
43
+ /**
44
+ * Gets the error responses configuration.
45
+ * @returns Error responses configuration.
46
+ */
47
+ get errorResponses(): ErrorResponses;
48
+ constructor({ disableTerminationForFinishedUploads, mediaTransformer, storage }: UploadOptions<TFile>);
49
+ /**
50
+ * Sets custom error responses.
51
+ * @param value Partial error responses to override defaults.
52
+ */
53
+ set errorResponses(value: Partial<ErrorResponses>);
54
+ /**
55
+ * Assemble error responses by merging defaults with custom overrides.
56
+ * @param customErrors Custom error responses to override defaults
57
+ */
58
+ assembleErrors: (customErrors?: {}) => void;
59
+ /**
60
+ * Parses HTTP Range header and returns start/end byte positions for partial content requests.
61
+ * @param rangeHeader HTTP Range header value (e.g., "bytes=0-1023").
62
+ * @param fileSize Total size of the file in bytes.
63
+ * @returns Object with start and end positions, or undefined if range is invalid.
64
+ */
65
+ parseRangeHeader(rangeHeader: string | undefined, fileSize: number): {
66
+ end: number;
67
+ start: number;
68
+ } | undefined;
69
+ /**
70
+ * Build file URL from request and file data.
71
+ * Platform-agnostic version that accepts URL string.
72
+ * @param requestUrl Request URL string
73
+ * @param file File object containing ID and content type
74
+ * @returns Constructed file URL with extension based on content type
75
+ */
76
+ protected buildFileUrlFromString(requestUrl: string, file: TFile): string;
77
+ /**
78
+ * Negotiates content type based on Accept header and supported formats.
79
+ * Platform-agnostic version that accepts header string.
80
+ * @param acceptHeader Accept header value
81
+ * @param supportedTypes Array of supported MIME types to match against
82
+ * @returns Best matching content type or undefined if no match found
83
+ */
84
+ negotiateContentTypeFromHeader(acceptHeader: string | undefined, supportedTypes: string[]): string | undefined;
85
+ /**
86
+ * Check for undefined ID or path errors and throw appropriate HTTP errors.
87
+ * @param error The error to check
88
+ */
89
+ protected checkForUndefinedIdOrPath(error: unknown): void;
90
+ }
91
+ export default BaseHandlerCore;
@@ -0,0 +1,76 @@
1
+ import type { UploadFile } from "../../storage/utils/index.d.ts";
2
+ import type { UploadResponse } from "../../utils/types.d.ts";
3
+ import type { Handlers, ResponseFile, ResponseList, UploadOptions } from "../types.d.ts";
4
+ import BaseHandlerCore from "./base-handler-core.d.ts";
5
+ /**
6
+ * Base handler for Web API Fetch platform (Request/Response).
7
+ * Extends BaseHandlerCore with Fetch-specific request/response handling.
8
+ * @template TFile The file type used by this handler.
9
+ */
10
+ declare abstract class BaseHandlerFetch<TFile extends UploadFile> extends BaseHandlerCore<TFile> {
11
+ /**
12
+ * Limiting enabled HTTP method handler.
13
+ */
14
+ static readonly methods: Handlers[];
15
+ /**
16
+ * Map of registered HTTP method handlers.
17
+ */
18
+ protected registeredHandlers: Map<string, (request: Request) => Promise<ResponseFile<TFile> | ResponseList<TFile>>>;
19
+ constructor(options: UploadOptions<TFile>);
20
+ /**
21
+ * Gets the registered handlers map.
22
+ * @returns Map of registered handlers.
23
+ */
24
+ get handlers(): Map<string, (request: Request) => Promise<ResponseFile<TFile> | ResponseList<TFile>>>;
25
+ /**
26
+ * Handles Web API Fetch requests (for Hono, Cloudflare Workers, etc.).
27
+ * @param request Web API Request object.
28
+ * @returns Promise resolving to Web API Response.
29
+ */
30
+ fetch(request: Request): Promise<globalThis.Response>;
31
+ /**
32
+ * Compose and register HTTP method handlers.
33
+ * Subclasses should override this to register their specific handlers.
34
+ */
35
+ protected abstract compose(): void;
36
+ /**
37
+ * Handle the response from handlers for fetch requests and convert to Web API Response.
38
+ * @param request Web API Request object
39
+ * @param file Response file or list from handler
40
+ * @returns Promise resolving to Web API Response object
41
+ */
42
+ protected handleFetchResponse(request: Request, file: ResponseFile<TFile> | ResponseList<TFile>): Promise<globalThis.Response>;
43
+ /**
44
+ * Convert headers to Web API Headers format by flattening arrays and converting to strings.
45
+ * @param headers Headers object with potentially array values
46
+ * @returns Headers object with all values as strings
47
+ */
48
+ protected convertHeaders(headers: Record<string, number | string | string[]>): Record<string, string>;
49
+ /**
50
+ * Create Web API Response from UploadResponse object.
51
+ * @param uploadResponse Upload response containing body, headers, and status code
52
+ * @returns Web API Response object
53
+ */
54
+ protected createResponse(uploadResponse: UploadResponse): globalThis.Response;
55
+ /**
56
+ * Create error Response from Error object with appropriate status code and message.
57
+ * @param error Error object to convert to HTTP error response
58
+ * @returns Web API Response object with error details
59
+ */
60
+ protected createErrorResponse(error: Error): Promise<globalThis.Response>;
61
+ /**
62
+ * Build file URL from request and file data.
63
+ * @param request Web API Request object
64
+ * @param file File object containing ID and content type
65
+ * @returns Constructed file URL with extension based on content type
66
+ */
67
+ protected buildFileUrl(request: Request, file: TFile): string;
68
+ /**
69
+ * Negotiates content type based on Accept header and supported formats.
70
+ * @param request Web API Request object containing Accept header.
71
+ * @param supportedTypes Array of supported MIME types to match against.
72
+ * @returns Best matching content type or undefined if no match found.
73
+ */
74
+ negotiateContentType(request: Request, supportedTypes: string[]): string | undefined;
75
+ }
76
+ export default BaseHandlerFetch;