@visulima/storage 1.0.0-alpha.2 → 1.0.0-alpha.21

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 +263 -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-BRDiGnC1.js +1 -0
  34. package/dist/packem_shared/GCStorage-BPkZ9tex.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-CaMptIUg.d.ts +148 -0
  71. package/dist/packem_shared/gcs-meta-storage-DZMf4IHn.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-CGSVabni.d.ts +20 -0
  79. package/dist/packem_shared/media-transformer.d-CLxm_69K.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-BkRmde_Q.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-Cxs42eEK.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-dim7udrK.d.ts +99 -0
  95. package/dist/packem_shared/tusOpenApiSpec-DF0-hlWV.js +1 -0
  96. package/dist/packem_shared/types.d-76N78ehR.d.ts +708 -0
  97. package/dist/packem_shared/types.d-LqXtPPaF.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 +45 -45
  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
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var c=(s,e)=>n(s,"name",{value:e,configurable:!0});var o=Object.defineProperty,S=c((s,e)=>o(s,"name",{value:e,configurable:!0}),"t");const a=S(s=>{const{accessKeyId:e,endpoint:t,secretAccessKey:r}=s??{accessKeyId:process.env.AWS_ACCESS_KEY_ID||process.env.TIGRIS_ACCESS_KEY_ID||process.env.TIGRIS_ACCESS_KEY,endpoint:process.env.TIGRIS_ENDPOINT,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY||process.env.TIGRIS_SECRET_ACCESS_KEY||process.env.TIGRIS_SECRET_KEY};if(!e||!r)throw new Error("Missing required parameters for Tigris client.");return{credentials:{accessKeyId:e,secretAccessKey:r},endpoint:t??"https://t3.storage.dev",forcePathStyle:!1,region:"auto"}},"tigris");export{a as default};
@@ -0,0 +1 @@
1
+ var a=Object.defineProperty;var n=(e,t)=>a(e,"name",{value:t,configurable:!0});import{createHash as i}from"node:crypto";import{createPaginationMetaSchemaObject as o,createPaginationSchemaObject as s}from"@visulima/pagination";import{sharedFileMetaSchemaObject as p,sharedErrorSchemaObject as m,sharedFileMetaExampleObject as c}from"./sharedGet-Ce7WGAsc.js";var d=Object.defineProperty,l=n((e,t)=>d(e,"name",{value:t,configurable:!0}),"n");const g=l((e="/",t=["Transform"])=>{const r=i("sha256").update(e).digest("base64");return{components:{examples:c,parameters:{Affine:{description:"Apply affine transformation",in:"query",name:"affine",schema:{type:"boolean"}},Angle:{description:"Rotation angle in degrees. Note: angles other than 90°, 180°, and 270° require interpolation and may affect quality",in:"query",name:"angle",schema:{type:"number"}},Background:{description:"Background color for rotation (hex, rgb, or color name)",in:"query",name:"background",schema:{type:"string"}},Bitrate:{description:"Target bitrate in bits per second",in:"query",name:"bitrate",schema:{minimum:1,type:"integer"}},Blur:{description:"Apply blur effect",in:"query",name:"blur",schema:{type:"boolean"}},Brightness:{description:"Brightness multiplier for modulation",in:"query",name:"brightness",schema:{type:"number"}},Clahe:{description:"Apply CLAHE (Contrast Limited Adaptive Histogram Equalization)",in:"query",name:"clahe",schema:{type:"boolean"}},Codec:{description:"Video or audio codec",in:"query",name:"codec",schema:{enum:["avc","hevc","vp8","vp9","av1","aac","opus","mp3","vorbis","flac"],type:"string"}},Colourspace:{description:"Convert colourspace",in:"query",name:"colourspace",schema:{enum:["srgb","rgb","cmyk","lab","b-w"],type:"string"}},CropHeight:{description:"Crop area height",in:"query",name:"cropHeight",schema:{minimum:1,type:"integer"}},CropWidth:{description:"Crop area width",in:"query",name:"cropWidth",schema:{minimum:1,type:"integer"}},Dilate:{description:"Apply dilation",in:"query",name:"dilate",schema:{type:"boolean"}},EnsureAlpha:{description:"Ensure alpha channel",in:"query",name:"ensureAlpha",schema:{type:"boolean"}},Erode:{description:"Apply erosion",in:"query",name:"erode",schema:{type:"boolean"}},FastShrinkOnLoad:{description:"Fast shrink on load for large images",in:"query",name:"fastShrinkOnLoad",schema:{type:"boolean"}},FileID:{description:"File identifier",in:"path",name:"id",required:!0,schema:{type:"string"}},Fit:{description:"Resize fit mode",in:"query",name:"fit",schema:{enum:["cover","contain","fill","inside","outside"],type:"string"}},Flatten:{description:"Flatten alpha channel",in:"query",name:"flatten",schema:{type:"boolean"}},Flip:{description:"Flip image vertically",in:"query",name:"flip",schema:{type:"boolean"}},Flop:{description:"Flop image horizontally",in:"query",name:"flop",schema:{type:"boolean"}},Format:{description:"Output format for the transformed media",in:"query",name:"format",schema:{enum:["jpeg","png","webp","avif","tiff","gif","mp4","webm","mkv","ogg","mp3","wav","aac","flac"],type:"string"}},FrameRate:{description:"Video frame rate in Hz",in:"query",name:"frameRate",schema:{minimum:1,type:"number"}},Gamma:{description:"Apply gamma correction",in:"query",name:"gamma",schema:{type:"boolean"}},Greyscale:{description:"Convert to greyscale",in:"query",name:"greyscale",schema:{type:"boolean"}},Height:{description:"Desired height in pixels",in:"query",name:"height",schema:{minimum:1,type:"integer"}},Hue:{description:"Hue rotation in degrees for modulation",in:"query",name:"hue",schema:{type:"integer"}},Kernel:{description:"Resize kernel algorithm",in:"query",name:"kernel",schema:{enum:["nearest","cubic","mitchell","lanczos2","lanczos3"],type:"string"}},KeyFrameInterval:{description:"Video key frame interval in seconds",in:"query",name:"keyFrameInterval",schema:{minimum:.1,type:"number"}},Left:{description:"Crop area left offset",in:"query",name:"left",schema:{minimum:0,type:"integer"}},Lightness:{description:"Lightness adjustment for modulation",in:"query",name:"lightness",schema:{type:"integer"}},Median:{description:"Apply median filter with specified size",in:"query",name:"median",schema:{minimum:1,type:"integer"}},Modulate:{description:"Apply modulation effects",in:"query",name:"modulate",schema:{type:"boolean"}},Negate:{description:"Negate (invert) the image",in:"query",name:"negate",schema:{type:"boolean"}},Normalise:{description:"Normalise the image",in:"query",name:"normalise",schema:{type:"boolean"}},NumberOfChannels:{description:"Audio channel count",in:"query",name:"numberOfChannels",schema:{enum:[1,2,3,4,5,6,7,8],type:"integer"}},PipelineColourspace:{description:"Set pipeline colourspace",in:"query",name:"pipelineColourspace",schema:{type:"boolean"}},Position:{description:"Position for cover/contain fits",in:"query",name:"position",schema:{oneOf:[{enum:["top","right","bottom","left","center"],type:"string"},{minimum:0,type:"integer"}]}},Quality:{description:"Quality setting (0-100 for images, affects compression)",in:"query",name:"quality",schema:{maximum:100,minimum:1,type:"integer"}},RemoveAlpha:{description:"Remove alpha channel",in:"query",name:"removeAlpha",schema:{type:"boolean"}},SampleRate:{description:"Audio sample rate in Hz",in:"query",name:"sampleRate",schema:{enum:[8e3,11025,16e3,22050,32e3,44100,48e3,88200,96e3,192e3],type:"integer"}},Saturation:{description:"Saturation multiplier for modulation",in:"query",name:"saturation",schema:{type:"number"}},Sharpen:{description:"Apply sharpening",in:"query",name:"sharpen",schema:{type:"boolean"}},Threshold:{description:"Apply thresholding with specified value (0-255)",in:"query",name:"threshold",schema:{maximum:255,minimum:0,type:"integer"}},Tint:{description:"Apply tinting",in:"query",name:"tint",schema:{type:"boolean"}},ToColourspace:{description:"Convert to colourspace",in:"query",name:"toColourspace",schema:{type:"boolean"}},Top:{description:"Crop area top offset",in:"query",name:"top",schema:{minimum:0,type:"integer"}},Unflatten:{description:"Unflatten alpha channel",in:"query",name:"unflatten",schema:{type:"boolean"}},Width:{description:"Desired width in pixels",in:"query",name:"width",schema:{minimum:1,type:"integer"}},WithoutEnlargement:{description:"Avoid enlarging images smaller than specified dimensions",in:"query",name:"withoutEnlargement",schema:{type:"boolean"}},WithoutReduction:{description:"Avoid reducing images larger than specified dimensions",in:"query",name:"withoutReduction",schema:{type:"boolean"}}},responses:{404:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Not Found"}},schemas:{...s("FileMetaPagination",{$ref:"#/components/schemas/PaginationMeta"},"#/components/schemas/PaginationMeta"),...o("PaginationMeta"),...m,...p,MediaTransformResult:{description:"Result of media transformation",properties:{bitrate:{description:"Bitrate for video/audio (bits per second)",type:"integer"},buffer:{description:"Binary data buffer (not included in JSON response)",type:"string"},duration:{description:"Duration for video/audio in seconds",type:"number"},format:{description:"Output format",type:"string"},height:{description:"Height for image/video in pixels",type:"integer"},mediaType:{description:"Type of media",enum:["image","video","audio"],type:"string"},numberOfChannels:{description:"Audio channel count",type:"integer"},originalFile:{$ref:"#/components/schemas/FileMeta"},sampleRate:{description:"Audio sample rate in Hz",type:"integer"},size:{description:"File size in bytes",type:"integer"},width:{description:"Width for image/video in pixels",type:"integer"}},required:["format","mediaType","originalFile","size"],type:"object"},ValidationError:{description:"Validation error response",properties:{code:{enum:["INVALID_PARAMS_FOR_IMAGE","INVALID_PARAMS_FOR_VIDEO","INVALID_PARAMS_FOR_AUDIO","INVALID_FIT_VALUE","INVALID_ANGLE_VALUE","INVALID_FORMAT","INCOMPLETE_CROP_PARAMS","INVALID_VIDEO_CODEC","INVALID_VIDEO_FORMAT","INVALID_WIDTH","INVALID_HEIGHT","INVALID_BITRATE","INVALID_FRAME_RATE","INVALID_KEY_FRAME_INTERVAL","INVALID_AUDIO_CODEC","INVALID_AUDIO_FORMAT","INVALID_CHANNEL_COUNT","INVALID_SAMPLE_RATE"],type:"string"},details:{properties:{invalidParams:{items:{type:"string"},type:"array"},mediaType:{enum:["image","video","audio"],type:"string"},suggestions:{items:{type:"string"},type:"array"},validParams:{items:{type:"string"},type:"array"}},required:["invalidParams","validParams","mediaType"],type:"object"},message:{type:"string"},name:{enum:["ValidationError"],type:"string"}},required:["code","details","message","name"],type:"object"}}},paths:{[`${e.replace(/\/$/,"")}/{id}/transform`]:{get:{description:"Get transformation metadata for a file without downloading. Returns information about supported transformations and current file properties.",operationId:`${r}TransformGetMetadata`,parameters:[{$ref:"#/components/parameters/FileID"}],responses:{200:{content:{"application/json":{schema:{description:"File transformation metadata",properties:{bitrate:{description:"Current bitrate for video/audio",type:"integer"},dimensions:{description:"Dimensions for image/video",properties:{height:{type:"integer"},width:{type:"integer"}},type:"object"},duration:{description:"Duration for video/audio in seconds",type:"number"},mediaType:{description:"Detected media type",enum:["image","video","audio"],type:"string"},numberOfChannels:{description:"Current channel count for audio",type:"integer"},originalFormat:{description:"Original file format",type:"string"},sampleRate:{description:"Current sample rate for audio",type:"integer"},supportedFormats:{description:"Supported output formats for this media type",items:{type:"string"},type:"array"},supportedParameters:{description:"Supported transformation parameters",items:{type:"string"},type:"array"}},required:["mediaType","supportedFormats","supportedParameters"],type:"object"}}},description:"Transformation metadata"},404:{$ref:"#/components/responses/404"},default:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Error"}},summary:"Get transformation metadata",tags:t}},[`${e.replace(/\/$/,"")}/{id}`]:{get:{description:"Retrieve and transform a file with optional media transformations. Supports resizing, cropping, format conversion, and codec changes based on query parameters.",operationId:`${r}TransformGetFile`,parameters:[{$ref:"#/components/parameters/FileID"},{$ref:"#/components/parameters/Format"},{$ref:"#/components/parameters/Quality"},{$ref:"#/components/parameters/Width"},{$ref:"#/components/parameters/Height"},{$ref:"#/components/parameters/Fit"},{$ref:"#/components/parameters/Position"},{$ref:"#/components/parameters/WithoutEnlargement"},{$ref:"#/components/parameters/WithoutReduction"},{$ref:"#/components/parameters/Left"},{$ref:"#/components/parameters/Top"},{$ref:"#/components/parameters/CropWidth"},{$ref:"#/components/parameters/CropHeight"},{$ref:"#/components/parameters/Angle"},{$ref:"#/components/parameters/Background"},{$ref:"#/components/parameters/Kernel"},{$ref:"#/components/parameters/FastShrinkOnLoad"},{$ref:"#/components/parameters/Blur"},{$ref:"#/components/parameters/Sharpen"},{$ref:"#/components/parameters/Median"},{$ref:"#/components/parameters/Clahe"},{$ref:"#/components/parameters/Threshold"},{$ref:"#/components/parameters/Gamma"},{$ref:"#/components/parameters/Negate"},{$ref:"#/components/parameters/Normalise"},{$ref:"#/components/parameters/Flatten"},{$ref:"#/components/parameters/Unflatten"},{$ref:"#/components/parameters/Flip"},{$ref:"#/components/parameters/Flop"},{$ref:"#/components/parameters/Greyscale"},{$ref:"#/components/parameters/Modulate"},{$ref:"#/components/parameters/Brightness"},{$ref:"#/components/parameters/Saturation"},{$ref:"#/components/parameters/Hue"},{$ref:"#/components/parameters/Lightness"},{$ref:"#/components/parameters/Tint"},{$ref:"#/components/parameters/Colourspace"},{$ref:"#/components/parameters/Affine"},{$ref:"#/components/parameters/Dilate"},{$ref:"#/components/parameters/Erode"},{$ref:"#/components/parameters/PipelineColourspace"},{$ref:"#/components/parameters/ToColourspace"},{$ref:"#/components/parameters/RemoveAlpha"},{$ref:"#/components/parameters/EnsureAlpha"},{$ref:"#/components/parameters/Codec"},{$ref:"#/components/parameters/Bitrate"},{$ref:"#/components/parameters/FrameRate"},{$ref:"#/components/parameters/KeyFrameInterval"},{$ref:"#/components/parameters/NumberOfChannels"},{$ref:"#/components/parameters/SampleRate"}],responses:{200:{content:{"*/*":{schema:{description:"Transformed media file",format:"binary",type:"string"}}},description:"Transformed file returned successfully",headers:{"Content-Type":{description:"MIME type of the transformed file",schema:{type:"string"}},ETag:{description:"ETag of the transformed file",schema:{type:"string"}},"X-Media-Type":{description:"Type of media (image/video/audio)",schema:{enum:["image","video","audio"],type:"string"}},"X-Original-Format":{description:"Original file format",schema:{type:"string"}},"X-Transformed-Format":{description:"Transformed file format",schema:{type:"string"}}}},400:{content:{"application/json":{examples:{ValidationError:{value:{error:{code:"INVALID_PARAMS_FOR_IMAGE",details:{invalidParams:["codec","bitrate"],mediaType:"image",validParams:["format","quality","width","height","fit","position","withoutEnlargement","withoutReduction","left","top","cropWidth","cropHeight","angle","background"]},message:"Invalid query parameters for image transformation: codec, bitrate. Images support: format, quality, width, height, fit, position, withoutEnlargement, withoutReduction, left, top, cropWidth, cropHeight, angle, background. Video/audio parameters (codec, bitrate) are not supported for images.",name:"ValidationError"}}}},schema:{$ref:"#/components/schemas/ValidationError"}}},description:"Invalid transformation parameters"},404:{$ref:"#/components/responses/404"},413:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"File too large for transformation"},415:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Unsupported media type for transformation"},default:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Error"}},summary:"Transform and retrieve file",tags:t}}}}},"swaggerSpec");export{g as default};
@@ -0,0 +1,99 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import { U as UploadFile, i as ResponseBodyType, B as BaseStorage, j as ErrorResponses } from "./storage.d-Cxs42eEK.js";
3
+ import 'node:stream';
4
+ import { M as MediaTransformer } from "./media-transformer.d-CLxm_69K.js";
5
+ import { U as UploadOptions } from "./types.d-LqXtPPaF.js";
6
+ import 'node:crypto';
7
+ import 'node:http';
8
+ import 'lru-cache';
9
+ import '@visulima/pagination';
10
+ /**
11
+ * Core base class containing shared business logic for all handlers.
12
+ * This class is platform-agnostic and contains no Node.js or Web API specific code.
13
+ * @template TFile The file type used by this handler.
14
+ */
15
+ declare abstract class BaseHandlerCore<TFile extends UploadFile> extends EventEmitter {
16
+ /**
17
+ * Response body type for the handler.
18
+ */
19
+ responseType: ResponseBodyType;
20
+ /**
21
+ * Storage instance for file operations.
22
+ */
23
+ storage: BaseStorage<TFile>;
24
+ /**
25
+ * Optional media transformer for image/video processing.
26
+ */
27
+ mediaTransformer?: MediaTransformer;
28
+ /**
29
+ * Whether to disable termination for finished uploads.
30
+ */
31
+ disableTerminationForFinishedUploads?: boolean;
32
+ /**
33
+ * Logger instance for debugging and error reporting.
34
+ */
35
+ protected logger?: Console;
36
+ /**
37
+ * Gets the logger instance.
38
+ * @returns Logger instance or undefined.
39
+ */
40
+ get loggerInstance(): Console | undefined;
41
+ /**
42
+ * Internal error responses configuration.
43
+ */
44
+ protected internalErrorResponses: ErrorResponses;
45
+ /**
46
+ * Gets the error responses configuration.
47
+ * @returns Error responses configuration.
48
+ */
49
+ get errorResponses(): ErrorResponses;
50
+ constructor({
51
+ disableTerminationForFinishedUploads,
52
+ mediaTransformer,
53
+ storage
54
+ }: UploadOptions<TFile>);
55
+ /**
56
+ * Sets custom error responses.
57
+ * @param value Partial error responses to override defaults.
58
+ */
59
+ set errorResponses(value: Partial<ErrorResponses>);
60
+ /**
61
+ * Assemble error responses by merging defaults with custom overrides.
62
+ * @param customErrors Custom error responses to override defaults
63
+ */
64
+ assembleErrors: (customErrors?: {}) => void;
65
+ /**
66
+ * Parses HTTP Range header and returns start/end byte positions for partial content requests.
67
+ * @param rangeHeader HTTP Range header value (e.g., "bytes=0-1023").
68
+ * @param fileSize Total size of the file in bytes.
69
+ * @returns Object with start and end positions, or undefined if range is invalid.
70
+ */
71
+ parseRangeHeader(rangeHeader: string | undefined, fileSize: number): {
72
+ end: number;
73
+ start: number;
74
+ } | undefined;
75
+ /**
76
+ * Build file URL from request and file data.
77
+ * Platform-agnostic version that accepts URL string.
78
+ * @param requestUrl Request URL string
79
+ * @param file File object containing ID and content type
80
+ * @returns Constructed file URL with extension based on content type
81
+ */
82
+ protected buildFileUrlFromString(requestUrl: string, file: TFile): string;
83
+ /**
84
+ * Negotiates content type based on Accept header and supported formats.
85
+ * Platform-agnostic version that accepts header string.
86
+ * @param acceptHeader Accept header value
87
+ * @param supportedTypes Array of supported MIME types to match against
88
+ * @returns Best matching content type or undefined if no match found
89
+ */
90
+ negotiateContentTypeFromHeader(acceptHeader: string | undefined, supportedTypes: string[]): string | undefined;
91
+ /**
92
+ * Check for undefined ID or path errors and throw appropriate HTTP errors.
93
+ * @param error The error to check
94
+ */
95
+ protected checkForUndefinedIdOrPath(error: unknown): void;
96
+ }
97
+ declare const TUS_RESUMABLE: string;
98
+ declare const TUS_VERSION: string;
99
+ export { BaseHandlerCore as B, TUS_RESUMABLE as T, TUS_VERSION as a };
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var o=(t,a)=>c(t,"name",{value:a,configurable:!0});import{createHash as d}from"node:crypto";import{createPaginationMetaSchemaObject as m,createPaginationSchemaObject as p}from"@visulima/pagination";import{sharedGet as u,sharedFileMetaSchemaObject as l,sharedErrorSchemaObject as f,sharedFileMetaExampleObject as T,sharedGetList as b,sharedGetMeta as r}from"./sharedGet-Ce7WGAsc.js";var U=Object.defineProperty,g=o((t,a)=>U(t,"name",{value:a,configurable:!0}),"o");const R=g((t,a)=>{const{supportedTransformerFormat:i,tags:e,transformer:h}={tags:["Tus"],transformer:!1,...a},s=d("sha256").update(t).digest("base64"),n=u(`${s}TusGetFile`,e,h,i);return{components:{examples:T,responses:{404:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Not Found"}},schemas:{"Tus-Checksum-Algorithm":{description:"Added by the checksum extension. The Tus-Checksum-Algorithm response header MUST be a comma-separated list of the checksum algorithms supported by the server.",type:"string"},"Tus-Extension":{description:"The Tus-Extension response header MUST be a comma-separated list of the extensions supported by the Server. If no extensions are supported, the Tus-Extension header MUST be omitted.",type:"string"},"Tus-Max-Size":{description:"The Tus-Max-Size response header MUST be a non-negative integer indicating the maximum allowed size of an entire upload in bytes. The Server SHOULD set this header if there is a known hard limit.",type:"integer"},"Tus-Resumable":{description:"Protocol version",enum:["1.0.0"],type:"string"},"Tus-Version":{description:"The Tus-Version response header MUST be a comma-separated list of protocol versions supported by the Server. The list MUST be sorted by Server's preference where the first one is the most preferred one.",type:"string"},"Upload-Checksum":{description:"Added by the checksum extension. The Upload-Checksum request header contains information about the checksum of the current body payload. The header MUST consist of the name of the used checksum algorithm and the Base64 encoded checksum separated by a space.",type:"string"},"Upload-Length":{description:"The Upload-Length request and response header indicates the size of the entire upload in bytes. The value MUST be a non-negative integer. In the concatenation extension, the Client MUST NOT include the Upload-Length header in the final upload creation",type:"integer"},"Upload-Offset":{description:"The Upload-Offset request and response header indicates a byte offset within a resource. The value MUST be a non-negative integer.",type:"integer"},...p("FileMetaPagination",{$ref:"#/components/schemas/PaginationMeta"},"#/components/schemas/PaginationMeta"),...m("PaginationMeta"),...f,...l}},paths:{[`${t.replace(/\/$/,"")}/{id}/metadata`]:{get:{...r(`${s}TusGetFileMeta`,e),parameters:[...r(`${s}TusGetFileMeta`,e).parameters,{description:"Version of the protocol supported by the client",in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}]}},[`${t.replace(/\/$/,"")}/{id}`]:{delete:{description:"When receiving a DELETE request for an existing upload the Server SHOULD free associated resources and MUST respond with the 204 No Content status confirming that the upload was terminated. For all future requests to this URL, the Server SHOULD respond with the 404 Not Found or 410 Gone status.",operationId:`${s}TusFilesDelete`,parameters:[{in:"path",name:"id",required:!0,schema:{type:"string"}},{in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}],responses:{204:{description:"Upload was terminated",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}}},summary:"Added by the Termination extension.",tags:e},get:{...n,parameters:[...n.parameters,{description:"Version of the protocol supported by the client",in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}]},head:{description:"Used to determine the offset at which the upload should be continued.",operationId:`${s}TusFilesHead`,parameters:[{in:"path",name:"id",required:!0,schema:{type:"string"}},{in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}}],responses:{200:{description:"Returns offset",headers:{"Cache-Control":{schema:{enum:["no-store"],type:"string"}},"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Upload-Length":{schema:{$ref:"#/components/schemas/Upload-Length"}},"Upload-Offset":{schema:{$ref:"#/components/schemas/Upload-Offset"}}}},403:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"If the resource is not found, the Server SHOULD return either the 404 Not Found, 410 Gone or 403 Forbidden status without the Upload-Offset header.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},404:{$ref:"#/components/responses/404"},410:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"If the resource is not found, the Server SHOULD return either the 404 Not Found, 410 Gone or 403 Forbidden status without the Upload-Offset header.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}}},summary:"Used to determine the offset at which the upload should be continued.",tags:e},patch:{description:"The Server SHOULD accept PATCH requests against any upload URL and apply the bytes contained in the message at the given offset specified by the Upload-Offset header. All PATCH requests MUST use Content-Type: application/offset+octet-stream, otherwise the server SHOULD return a 415 Unsupported Media Type status.",operationId:`${s}TusFilePatch`,parameters:[{in:"path",name:"id",required:!0,schema:{type:"string"}},{in:"header",name:"Tus-Resumable",required:!0,schema:{$ref:"#/components/schemas/Tus-Resumable"}},{description:"Length of the body of this request",in:"header",name:"Content-Length",required:!0,schema:{type:"integer"}},{in:"header",name:"Upload-Offset",required:!0,schema:{$ref:"#/components/schemas/Upload-Offset"}},{in:"header",name:"Upload-Checksum",schema:{$ref:"#/components/schemas/Upload-Checksum"}}],requestBody:{content:{"application/offset+octet-stream":{schema:{type:"string"}}},description:"Remaining (possibly partial) content of the file. Required if Content-Length > 0.",required:!1},responses:{204:{description:"Upload offset was updated",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Upload-Expires":{description:"Added by the expiration extension. The Upload-Expires response header indicates the time after which the unfinished upload expires. A Server MAY wish to remove incomplete upload after a given period of time to prevent abandoned upload from taking up extra storage. The Client SHOULD use this header to determine if an upload is still valid before attempting to resume the upload. This header MUST be included in every PATCH response if the upload is going to expire. If the expiration is known at the creation, the Upload-Expires header MUST be included in the response to the initial POST request. Its value MAY change over time. If a Client does attempt to resume an upload which has since been removed by the Server, the Server SHOULD respond with the 404 Not Found or 410 Gone status. The latter one SHOULD be used if the Server is keeping track of expired upload. In both cases the Client SHOULD start a new upload. The value of the Upload-Expires header MUST be in RFC 7231 datetime format.",schema:{type:"string"}},"Upload-Offset":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},400:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the checksum extension. The checksum algorithm is not supported by the server",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},403:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"In the concatenation extension, the Server MUST respond with the 403 Forbidden status to PATCH requests against a final upload URL and MUST NOT modify the final or its partial upload.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},404:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"PATCH request against a non-existent resource",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},409:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"PATCH request with Upload-Offset unequal to the offset of the resource on the server. The Upload-Offset header's value MUST be equal to the current offset of the resource.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},410:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"PATCH request against a non-existent resource",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}},415:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Content-Type was not application/offset+octet-stream",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},460:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the checksum extension. Checksums mismatch",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}}},summary:"Used to resume the upload",tags:e}},[t.trimEnd()]:{get:b(`${s}TusGetList`,e),options:{operationId:`${s}TusOptions`,responses:{204:{description:"Success",headers:{"Tus-Checksum-Algorithm":{schema:{$ref:"#/components/schemas/Tus-Checksum-Algorithm"}},"Tus-Extension":{schema:{$ref:"#/components/schemas/Tus-Extension"}},"Tus-Max-Size":{schema:{$ref:"#/components/schemas/Tus-Max-Size"}},"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}}},summary:"Request to gather information about the Server's current configuration",tags:e},post:{description:"Endpoint for the Creation extension. Modified by the Creation With Upload extension.",operationId:`${s}TusCreate`,parameters:[{description:"Must be 0 for creation extension. May be a positive number for Creation With Upload extension.",in:"header",name:"Content-Length",schema:{type:"integer"}},{in:"header",name:"Upload-Length",schema:{$ref:"#/components/schemas/Upload-Length"}},{in:"header",name:"Tus-Resumable",schema:{$ref:"#/components/schemas/Tus-Resumable"}},{description:"Added by the Creation extension. The Upload-Metadata request and response header MUST consist of one or more comma-separated key-value pairs. The key and value MUST be separated by a space. The key MUST NOT contain spaces and commas and MUST NOT be empty. The key SHOULD be ASCII encoded and the value MUST be Base64 encoded. All keys MUST be unique. The value MAY be empty. In these cases, the space, which would normally separate the key and the value, MAY be left out. Since metadata can contain arbitrary binary values, Servers SHOULD carefully validate metadata values or sanitize them before using them as header values to avoid header smuggling.",in:"header",name:"Upload-Metadata",schema:{type:"string"}},{description:"Added by the Concatenation extension. The Upload-Concat request and response header MUST be set in both partial and final upload creation requests. It indicates whether the upload is either a partial or final upload. If the upload is a partial one, the header value MUST be partial. In the case of a final upload, its value MUST be final followed by a semicolon and a space-separated list of partial upload URLs that will be concatenated. The partial upload URLs MAY be absolute or relative and MUST NOT contain spaces as defined in RFC 3986.",in:"header",name:"Upload-Concat",schema:{type:"string"}},{description:"Added by the Creation Defer Length extension. The Upload-Defer-Length request and response header indicates that the size of the upload is not known currently and will be transferred later. Its value MUST be 1. If the length of an upload is not deferred, this header MUST be omitted.",in:"header",name:"Upload-Defer-Length",schema:{enum:[1],type:"integer"}},{in:"header",name:"Upload-Offset",schema:{$ref:"#/components/schemas/Upload-Offset"}},{in:"header",name:"Upload-Checksum",schema:{$ref:"#/components/schemas/Upload-Checksum"}}],requestBody:{content:{"application/offset+octet-stream":{schema:{type:"string"}}},description:"(Possibly partial) content of the file. Required if Content-Length > 0.",required:!1},responses:{201:{description:"Created",headers:{Location:{description:"Url of the created resource.",schema:{type:"string"}},"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Upload-Expires":{description:"Added by the Creation With Upload Extension in combination with the expiration extension. The Upload-Expires response header indicates the time after which the unfinished upload expires. A Server MAY wish to remove incomplete upload after a given period of time to prevent abandoned upload from taking up extra storage. The Client SHOULD use this header to determine if an upload is still valid before attempting to resume the upload. This header MUST be included in every PATCH response if the upload is going to expire. If the expiration is known at the creation, the Upload-Expires header MUST be included in the response to the initial POST request. Its value MAY change over time. If a Client does attempt to resume an upload which has since been removed by the Server, the Server SHOULD respond with the 404 Not Found or 410 Gone status. The latter one SHOULD be used if the Server is keeping track of expired upload. In both cases the Client SHOULD start a new upload. The value of the Upload-Expires header MUST be in RFC 7231 datetime format.",schema:{type:"string"}},"Upload-Offset":{schema:{$ref:"#/components/schemas/Upload-Offset"}}}},400:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the Creation With Upload Extension in combination with the checksum extension. The checksum algorithm is not supported by the server",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},412:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Precondition Failed",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}},"Tus-Version":{schema:{$ref:"#/components/schemas/Tus-Version"}}}},413:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"If the length of the upload exceeds the maximum, which MAY be specified using the Tus-Max-Size header, the Server MUST respond with the 413 Request Entity Too Large status.",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},415:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the Creation With Upload Extension. Content-Type was not application/offset+octet-stream",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}},460:{content:{"application/json":{schema:{$ref:"#/components/schemas/Error"}}},description:"Added by the Creation With Upload Extension in combination with the checksum extension. Checksums mismatch",headers:{"Tus-Resumable":{schema:{$ref:"#/components/schemas/Tus-Resumable"}}}}},summary:"An empty POST request is used to create a new upload resource. The Upload-Length header indicates the size of the entire upload in bytes. If the Creation With Upload extension is available, the Client MAY include parts of the upload in the initial Creation request",tags:e}}}}},"swaggerSpec");export{R as default};