@tulip-systems/core 0.7.0 → 0.8.1

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 (361) hide show
  1. package/dist/auth/server.d.mts +3 -3
  2. package/dist/auth/server.mjs +3 -3
  3. package/dist/components/editor/components/editor.client.d.mts +4 -3
  4. package/dist/components/editor/components/editor.client.d.mts.map +1 -1
  5. package/dist/components/editor/components/editor.client.mjs +5 -2
  6. package/dist/components/editor/components/editor.client.mjs.map +1 -1
  7. package/dist/components/editor/extensions/file-handler/extension.d.mts +4 -4
  8. package/dist/components/editor/extensions/file-handler/extension.d.mts.map +1 -1
  9. package/dist/components/editor/extensions/file-handler/extension.mjs.map +1 -1
  10. package/dist/components/editor/extensions/file-handler/strategy.d.mts +4 -6
  11. package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +1 -1
  12. package/dist/components/editor/extensions/file-handler/strategy.mjs +11 -11
  13. package/dist/components/editor/extensions/file-handler/strategy.mjs.map +1 -1
  14. package/dist/components/editor/extensions/file-handler/utils.mjs +1 -1
  15. package/dist/components/editor/extensions/file-handler/utils.mjs.map +1 -1
  16. package/dist/components/editor/extensions/image/extension.mjs +9 -9
  17. package/dist/components/editor/extensions/image/extension.mjs.map +1 -1
  18. package/dist/components/editor/lib/constants.d.mts +1 -1
  19. package/dist/components/editor/lib/constants.mjs +1 -1
  20. package/dist/components/editor/lib/extensions.d.mts +1 -1
  21. package/dist/components/editor/lib/helpers.d.mts +11 -3
  22. package/dist/components/editor/lib/helpers.d.mts.map +1 -1
  23. package/dist/components/editor/lib/helpers.mjs +27 -13
  24. package/dist/components/editor/lib/helpers.mjs.map +1 -1
  25. package/dist/components/ui/combobox-dropdown.client.mjs +1 -0
  26. package/dist/components/ui/combobox-dropdown.client.mjs.map +1 -1
  27. package/dist/components/ui/combobox.client.mjs +1 -1
  28. package/dist/components/ui/combobox.client.mjs.map +1 -1
  29. package/dist/components.d.mts +2 -2
  30. package/dist/components.mjs +2 -2
  31. package/dist/config/server.d.mts +1 -3
  32. package/dist/config/server.mjs +1 -4
  33. package/dist/config.d.mts +2 -2
  34. package/dist/config.mjs +1 -1
  35. package/dist/data-tables/client.d.mts +2 -1
  36. package/dist/data-tables/client.mjs +2 -1
  37. package/dist/data-tables.d.mts +1 -1
  38. package/dist/database/client.d.mts +1 -0
  39. package/dist/database/client.mjs +1 -0
  40. package/dist/database/server.d.mts +2 -0
  41. package/dist/database/server.mjs +3 -0
  42. package/dist/database.d.mts +3 -0
  43. package/dist/database.mjs +3 -0
  44. package/dist/emails/client.d.mts +1 -0
  45. package/dist/emails/client.mjs +1 -0
  46. package/dist/emails/server.d.mts +2 -0
  47. package/dist/emails/server.mjs +3 -0
  48. package/dist/emails.d.mts +1 -0
  49. package/dist/emails.mjs +1 -0
  50. package/dist/lib/utils/markdown.d.mts +10 -0
  51. package/dist/lib/utils/markdown.d.mts.map +1 -0
  52. package/dist/lib/utils/markdown.mjs +15 -0
  53. package/dist/lib/utils/markdown.mjs.map +1 -0
  54. package/dist/lib/utils/url.mjs +2 -1
  55. package/dist/lib/utils/url.mjs.map +1 -1
  56. package/dist/lib/utils/user-agent.mjs +15 -0
  57. package/dist/lib/utils/user-agent.mjs.map +1 -1
  58. package/dist/lib.d.mts +2 -2
  59. package/dist/lib.mjs +2 -2
  60. package/dist/modules/auth/components/create-first-user-guard.server.d.mts +16 -0
  61. package/dist/modules/auth/components/create-first-user-guard.server.d.mts.map +1 -0
  62. package/dist/modules/auth/components/create-first-user-guard.server.mjs +16 -0
  63. package/dist/modules/auth/components/create-first-user-guard.server.mjs.map +1 -0
  64. package/dist/modules/auth/components/guard.server.d.mts +2 -2
  65. package/dist/modules/auth/components/guard.server.mjs +1 -1
  66. package/dist/modules/auth/components/guard.server.mjs.map +1 -1
  67. package/dist/modules/auth/db/schema.d.mts +1 -1
  68. package/dist/modules/auth/db/schema.mjs +2 -2
  69. package/dist/modules/auth/handler/create-client.client.d.mts +4838 -229
  70. package/dist/modules/auth/handler/create-client.client.d.mts.map +1 -1
  71. package/dist/modules/auth/handler/create-client.client.mjs.map +1 -1
  72. package/dist/modules/auth/handler/proxy.server.mjs +2 -2
  73. package/dist/modules/auth/handler/proxy.server.mjs.map +1 -1
  74. package/dist/modules/auth/handler/route.server.d.mts +2 -2
  75. package/dist/modules/auth/handler/route.server.d.mts.map +1 -1
  76. package/dist/modules/auth/handler/route.server.mjs.map +1 -1
  77. package/dist/modules/auth/handler/{init.d.mts → service.server.d.mts} +322 -90
  78. package/dist/modules/auth/handler/service.server.d.mts.map +1 -0
  79. package/dist/modules/auth/handler/{init.mjs → service.server.mjs} +19 -8
  80. package/dist/modules/auth/handler/service.server.mjs.map +1 -0
  81. package/dist/modules/auth/hooks/use-session.d.mts +9 -4
  82. package/dist/modules/auth/hooks/use-session.d.mts.map +1 -1
  83. package/dist/modules/auth/lib/helpers.server.d.mts +1 -1
  84. package/dist/modules/auth/lib/permissions.d.mts +1 -1
  85. package/dist/modules/auth/lib/validators.mjs +1 -1
  86. package/dist/modules/config/lib/context.d.mts +9 -10
  87. package/dist/modules/config/lib/context.d.mts.map +1 -1
  88. package/dist/modules/config/lib/context.mjs.map +1 -1
  89. package/dist/modules/data-tables/lib/converters/search.d.mts +1 -1
  90. package/dist/modules/data-tables/lib/converters/sorting.d.mts +1 -1
  91. package/dist/modules/data-tables/server/get-data.server.d.mts +3 -3
  92. package/dist/modules/data-tables/server/get-data.server.mjs +1 -1
  93. package/dist/modules/data-tables/server/get-data.server.mjs.map +1 -1
  94. package/dist/modules/data-tables/strategies/infinite/strategy.d.mts +1 -1
  95. package/dist/modules/data-tables/strategies/infinite/strategy.mjs +3 -0
  96. package/dist/modules/data-tables/strategies/infinite/strategy.mjs.map +1 -1
  97. package/dist/modules/data-tables/tables/data-table/components/row.mjs +5 -15
  98. package/dist/modules/data-tables/tables/data-table/components/row.mjs.map +1 -1
  99. package/dist/modules/data-tables/tables/inline-table/components/body.mjs +1 -1
  100. package/dist/modules/data-tables/tables/inline-table/components/body.mjs.map +1 -1
  101. package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs +13 -23
  102. package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs.map +1 -1
  103. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +1 -0
  104. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
  105. package/dist/modules/data-tables/tables/inline-table/components/table.mjs +2 -1
  106. package/dist/modules/data-tables/tables/inline-table/components/table.mjs.map +1 -1
  107. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +5 -1
  108. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
  109. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs +2 -1
  110. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs.map +1 -1
  111. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts +30 -0
  112. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts.map +1 -0
  113. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs +77 -9
  114. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs.map +1 -1
  115. package/dist/modules/{config/db → database/lib}/helpers.d.mts +2 -2
  116. package/dist/modules/database/lib/helpers.d.mts.map +1 -0
  117. package/dist/modules/{config/db → database/lib}/helpers.mjs +1 -1
  118. package/dist/modules/database/lib/helpers.mjs.map +1 -0
  119. package/dist/modules/database/lib/service.server.d.mts +34 -0
  120. package/dist/modules/database/lib/service.server.d.mts.map +1 -0
  121. package/dist/modules/database/lib/service.server.mjs +24 -0
  122. package/dist/modules/database/lib/service.server.mjs.map +1 -0
  123. package/dist/modules/{config/db → database/lib}/types.d.mts +1 -1
  124. package/dist/modules/database/lib/types.d.mts.map +1 -0
  125. package/dist/modules/emails/lib/service.server.d.mts +29 -0
  126. package/dist/modules/emails/lib/service.server.d.mts.map +1 -0
  127. package/dist/modules/emails/lib/service.server.mjs +21 -0
  128. package/dist/modules/emails/lib/service.server.mjs.map +1 -0
  129. package/dist/modules/inline-edit/components/date-input.client.mjs +1 -1
  130. package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
  131. package/dist/modules/inline-edit/components/date-picker.client.mjs +1 -0
  132. package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
  133. package/dist/modules/inline-edit/components/date-time.client.mjs +1 -0
  134. package/dist/modules/inline-edit/components/date-time.client.mjs.map +1 -1
  135. package/dist/modules/inline-edit/components/editor.client.mjs +1 -0
  136. package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
  137. package/dist/modules/inline-edit/components/input-recipient.client.mjs +1 -0
  138. package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
  139. package/dist/modules/inline-edit/components/input-toggle.client.mjs +1 -0
  140. package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
  141. package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
  142. package/dist/modules/inline-edit/components/input.client.mjs +3 -0
  143. package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
  144. package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
  145. package/dist/modules/inline-edit/components/select.client.mjs +1 -0
  146. package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
  147. package/dist/modules/inline-edit/components/switch.client.mjs +1 -0
  148. package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
  149. package/dist/modules/inline-edit/components/toggle.client.mjs +1 -0
  150. package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
  151. package/dist/modules/router/handler/context.server.d.mts +12 -10
  152. package/dist/modules/router/handler/context.server.d.mts.map +1 -1
  153. package/dist/modules/router/handler/init.server.d.mts +13 -11
  154. package/dist/modules/router/handler/init.server.d.mts.map +1 -1
  155. package/dist/modules/router/handler/init.server.mjs +2 -2
  156. package/dist/modules/router/handler/init.server.mjs.map +1 -1
  157. package/dist/modules/router/handler/route.server.d.mts +1 -1
  158. package/dist/modules/storage/components/dropzone.client.d.mts +2 -2
  159. package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
  160. package/dist/modules/storage/components/dropzone.client.mjs.map +1 -1
  161. package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
  162. package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -1
  163. package/dist/modules/storage/components/image-grid.client.mjs +20 -22
  164. package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
  165. package/dist/modules/storage/components/image.client.d.mts +8 -0
  166. package/dist/modules/storage/components/image.client.d.mts.map +1 -0
  167. package/dist/modules/storage/components/image.client.mjs +17 -0
  168. package/dist/modules/storage/components/image.client.mjs.map +1 -0
  169. package/dist/modules/storage/components/upload-button.client.d.mts +12 -0
  170. package/dist/modules/storage/components/upload-button.client.d.mts.map +1 -0
  171. package/dist/modules/storage/components/upload-button.client.mjs +34 -0
  172. package/dist/modules/storage/components/upload-button.client.mjs.map +1 -0
  173. package/dist/modules/storage/components/upload-zone-context.client.d.mts +5 -5
  174. package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
  175. package/dist/modules/storage/components/upload-zone-context.client.mjs +2 -2
  176. package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
  177. package/dist/modules/storage/components/upload-zone.client.d.mts +4 -4
  178. package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
  179. package/dist/modules/storage/components/upload-zone.client.mjs +16 -9
  180. package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
  181. package/dist/modules/storage/lib/constants.d.mts +1 -5
  182. package/dist/modules/storage/lib/constants.d.mts.map +1 -1
  183. package/dist/modules/storage/lib/constants.mjs +1 -13
  184. package/dist/modules/storage/lib/constants.mjs.map +1 -1
  185. package/dist/modules/storage/lib/helpers.d.mts +14 -28
  186. package/dist/modules/storage/lib/helpers.d.mts.map +1 -1
  187. package/dist/modules/storage/lib/helpers.mjs +17 -75
  188. package/dist/modules/storage/lib/helpers.mjs.map +1 -1
  189. package/dist/modules/storage/lib/procedures.server.d.mts +1991 -0
  190. package/dist/modules/{auth/handler/init.d.mts.map → storage/lib/procedures.server.d.mts.map} +1 -1
  191. package/dist/modules/storage/lib/procedures.server.mjs +22 -0
  192. package/dist/modules/storage/lib/procedures.server.mjs.map +1 -0
  193. package/dist/modules/storage/lib/router-handlers.server.d.mts +41 -0
  194. package/dist/modules/storage/lib/router-handlers.server.d.mts.map +1 -0
  195. package/dist/modules/storage/lib/router-handlers.server.mjs +124 -0
  196. package/dist/modules/storage/lib/router-handlers.server.mjs.map +1 -0
  197. package/dist/modules/storage/lib/schema.d.mts +68 -958
  198. package/dist/modules/storage/lib/schema.d.mts.map +1 -1
  199. package/dist/modules/storage/lib/schema.mjs +28 -65
  200. package/dist/modules/storage/lib/schema.mjs.map +1 -1
  201. package/dist/modules/storage/lib/service.server.d.mts +2155 -141
  202. package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
  203. package/dist/modules/storage/lib/service.server.mjs +453 -242
  204. package/dist/modules/storage/lib/service.server.mjs.map +1 -1
  205. package/dist/modules/storage/lib/upload.client.d.mts +58 -0
  206. package/dist/modules/storage/lib/upload.client.d.mts.map +1 -0
  207. package/dist/modules/storage/lib/upload.client.mjs +87 -0
  208. package/dist/modules/storage/lib/upload.client.mjs.map +1 -0
  209. package/dist/modules/storage/lib/validators.d.mts +297 -835
  210. package/dist/modules/storage/lib/validators.d.mts.map +1 -1
  211. package/dist/modules/storage/lib/validators.mjs +32 -76
  212. package/dist/modules/storage/lib/validators.mjs.map +1 -1
  213. package/dist/modules/storage/providers/adapters/s3.server.d.mts +19 -0
  214. package/dist/modules/storage/providers/adapters/s3.server.d.mts.map +1 -0
  215. package/dist/modules/storage/providers/adapters/s3.server.mjs +173 -0
  216. package/dist/modules/storage/providers/adapters/s3.server.mjs.map +1 -0
  217. package/dist/modules/storage/providers/lib/constants.d.mts +6 -0
  218. package/dist/modules/storage/providers/lib/constants.d.mts.map +1 -0
  219. package/dist/modules/storage/providers/lib/constants.mjs +6 -0
  220. package/dist/modules/storage/providers/lib/constants.mjs.map +1 -0
  221. package/dist/modules/storage/providers/lib/errors.d.mts +12 -0
  222. package/dist/modules/storage/providers/lib/errors.d.mts.map +1 -0
  223. package/dist/modules/storage/providers/lib/errors.mjs +13 -0
  224. package/dist/modules/storage/providers/lib/errors.mjs.map +1 -0
  225. package/dist/modules/storage/providers/lib/types.d.mts +21 -0
  226. package/dist/modules/storage/providers/lib/types.d.mts.map +1 -0
  227. package/dist/modules/storage/providers/lib/validators.d.mts +112 -0
  228. package/dist/modules/storage/providers/lib/validators.d.mts.map +1 -0
  229. package/dist/modules/storage/providers/lib/validators.mjs +75 -0
  230. package/dist/modules/storage/providers/lib/validators.mjs.map +1 -0
  231. package/dist/router/server.d.mts +1 -1
  232. package/dist/storage/client.d.mts +4 -2
  233. package/dist/storage/client.mjs +4 -2
  234. package/dist/storage/server.d.mts +5 -4
  235. package/dist/storage/server.mjs +5 -4
  236. package/dist/storage.d.mts +9 -6
  237. package/dist/storage.mjs +8 -6
  238. package/package.json +18 -5
  239. package/src/components/editor/components/editor.client.tsx +9 -1
  240. package/src/components/editor/extensions/file-handler/extension.ts +4 -4
  241. package/src/components/editor/extensions/file-handler/strategy.ts +15 -40
  242. package/src/components/editor/extensions/file-handler/utils.ts +1 -1
  243. package/src/components/editor/extensions/image/extension.ts +10 -10
  244. package/src/components/editor/lib/helpers.ts +28 -11
  245. package/src/components/ui/combobox-dropdown.client.tsx +1 -0
  246. package/src/components/ui/combobox.client.tsx +1 -1
  247. package/src/entry.ts +12 -51
  248. package/src/lib/entry.ts +1 -5
  249. package/src/lib/utils/markdown.ts +10 -0
  250. package/src/lib/utils/url.ts +2 -1
  251. package/src/lib/utils/user-agent.ts +15 -0
  252. package/src/modules/auth/components/{guard-first-user.server.tsx → create-first-user-guard.server.tsx} +8 -8
  253. package/src/modules/auth/components/guard.server.tsx +1 -1
  254. package/src/modules/auth/entry.server.ts +4 -5
  255. package/src/modules/auth/handler/create-client.client.ts +2 -2
  256. package/src/modules/auth/handler/proxy.server.ts +1 -1
  257. package/src/modules/auth/handler/route.server.ts +2 -2
  258. package/src/modules/auth/handler/{init.ts → service.server.ts} +30 -9
  259. package/src/modules/config/entry.server.ts +0 -9
  260. package/src/modules/config/entry.ts +2 -2
  261. package/src/modules/config/lib/context.ts +9 -9
  262. package/src/modules/data-tables/entry.client.ts +1 -0
  263. package/src/modules/data-tables/server/get-data.server.ts +1 -1
  264. package/src/modules/data-tables/strategies/infinite/strategy.ts +4 -1
  265. package/src/modules/data-tables/tables/data-table/components/row.tsx +12 -21
  266. package/src/modules/data-tables/tables/inline-table/components/body.tsx +1 -1
  267. package/src/modules/data-tables/tables/inline-table/components/row.client.tsx +24 -30
  268. package/src/modules/data-tables/tables/inline-table/components/table.tsx +6 -1
  269. package/src/modules/data-tables/tables/inline-table/hooks/context.client.tsx +5 -0
  270. package/src/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.ts +119 -91
  271. package/src/modules/database/entry.client.ts +0 -0
  272. package/src/modules/database/entry.server.ts +4 -0
  273. package/src/modules/database/entry.ts +5 -0
  274. package/src/modules/database/lib/service.server.ts +33 -0
  275. package/src/modules/emails/entry.client.ts +0 -0
  276. package/src/modules/emails/entry.server.ts +4 -0
  277. package/src/modules/emails/entry.ts +0 -0
  278. package/src/modules/emails/lib/service.server.ts +29 -0
  279. package/src/modules/inline-edit/components/date-input.client.tsx +1 -1
  280. package/src/modules/inline-edit/components/date-picker.client.tsx +1 -0
  281. package/src/modules/inline-edit/components/date-time.client.tsx +1 -0
  282. package/src/modules/inline-edit/components/editor.client.tsx +3 -0
  283. package/src/modules/inline-edit/components/input-recipient.client.tsx +1 -0
  284. package/src/modules/inline-edit/components/input-toggle.client.tsx +1 -0
  285. package/src/modules/inline-edit/components/input.client.tsx +3 -0
  286. package/src/modules/inline-edit/components/select.client.tsx +5 -1
  287. package/src/modules/inline-edit/components/switch.client.tsx +1 -0
  288. package/src/modules/inline-edit/components/toggle.client.tsx +1 -0
  289. package/src/modules/router/handler/init.server.ts +2 -2
  290. package/src/modules/storage/components/dropzone.client.tsx +1 -1
  291. package/src/modules/storage/components/image-grid.client.tsx +23 -20
  292. package/src/modules/storage/components/image.client.tsx +8 -0
  293. package/src/modules/storage/components/upload-zone-context.client.tsx +11 -8
  294. package/src/modules/storage/components/upload-zone.client.tsx +22 -16
  295. package/src/modules/storage/entry.client.ts +3 -1
  296. package/src/modules/storage/entry.server.ts +9 -3
  297. package/src/modules/storage/entry.ts +13 -1
  298. package/src/modules/storage/lib/constants.ts +0 -11
  299. package/src/modules/storage/lib/helpers.ts +18 -65
  300. package/src/modules/storage/lib/procedures.server.ts +60 -0
  301. package/src/modules/storage/lib/router-handlers.server.ts +178 -0
  302. package/src/modules/storage/lib/schema.ts +26 -97
  303. package/src/modules/storage/lib/service.server.ts +636 -374
  304. package/src/modules/storage/lib/upload.client.ts +156 -0
  305. package/src/modules/storage/lib/validators.ts +50 -111
  306. package/src/modules/storage/providers/adapters/s3.server.ts +281 -0
  307. package/src/modules/storage/providers/lib/constants.ts +3 -0
  308. package/src/modules/storage/providers/lib/errors.ts +21 -0
  309. package/src/modules/storage/providers/lib/types.ts +28 -0
  310. package/src/modules/storage/providers/lib/validators.ts +122 -0
  311. package/dist/lib/config/constants.d.mts +0 -5
  312. package/dist/lib/config/constants.d.mts.map +0 -1
  313. package/dist/lib/config/constants.mjs +0 -6
  314. package/dist/lib/config/constants.mjs.map +0 -1
  315. package/dist/modules/auth/components/guard-first-user.server.d.mts +0 -18
  316. package/dist/modules/auth/components/guard-first-user.server.d.mts.map +0 -1
  317. package/dist/modules/auth/components/guard-first-user.server.mjs +0 -16
  318. package/dist/modules/auth/components/guard-first-user.server.mjs.map +0 -1
  319. package/dist/modules/auth/handler/init.mjs.map +0 -1
  320. package/dist/modules/config/db/helpers.d.mts.map +0 -1
  321. package/dist/modules/config/db/helpers.mjs.map +0 -1
  322. package/dist/modules/config/db/init.d.mts +0 -20
  323. package/dist/modules/config/db/init.d.mts.map +0 -1
  324. package/dist/modules/config/db/init.mjs +0 -15
  325. package/dist/modules/config/db/init.mjs.map +0 -1
  326. package/dist/modules/config/db/types.d.mts.map +0 -1
  327. package/dist/modules/config/providers/email.d.mts +0 -12
  328. package/dist/modules/config/providers/email.d.mts.map +0 -1
  329. package/dist/modules/config/providers/email.mjs +0 -11
  330. package/dist/modules/config/providers/email.mjs.map +0 -1
  331. package/dist/modules/storage/config/filters.d.mts +0 -17
  332. package/dist/modules/storage/config/filters.d.mts.map +0 -1
  333. package/dist/modules/storage/config/filters.mjs +0 -17
  334. package/dist/modules/storage/config/filters.mjs.map +0 -1
  335. package/dist/modules/storage/lib/create-client.server.d.mts +0 -11
  336. package/dist/modules/storage/lib/create-client.server.d.mts.map +0 -1
  337. package/dist/modules/storage/lib/create-client.server.mjs +0 -11
  338. package/dist/modules/storage/lib/create-client.server.mjs.map +0 -1
  339. package/dist/modules/storage/lib/create-upload.client.d.mts +0 -56
  340. package/dist/modules/storage/lib/create-upload.client.d.mts.map +0 -1
  341. package/dist/modules/storage/lib/create-upload.client.mjs +0 -98
  342. package/dist/modules/storage/lib/create-upload.client.mjs.map +0 -1
  343. package/dist/modules/storage/lib/proxy.server.d.mts +0 -21
  344. package/dist/modules/storage/lib/proxy.server.d.mts.map +0 -1
  345. package/dist/modules/storage/lib/proxy.server.mjs +0 -46
  346. package/dist/modules/storage/lib/proxy.server.mjs.map +0 -1
  347. package/dist/modules/storage/lib/router.server.d.mts +0 -31002
  348. package/dist/modules/storage/lib/router.server.d.mts.map +0 -1
  349. package/dist/modules/storage/lib/router.server.mjs +0 -86
  350. package/dist/modules/storage/lib/router.server.mjs.map +0 -1
  351. package/src/lib/config/constants.ts +0 -1
  352. package/src/lib/utils/time-picker.ts +0 -139
  353. package/src/modules/config/db/init.ts +0 -21
  354. package/src/modules/config/providers/email.ts +0 -13
  355. package/src/modules/storage/config/filters.ts +0 -12
  356. package/src/modules/storage/lib/create-client.server.ts +0 -14
  357. package/src/modules/storage/lib/create-upload.client.ts +0 -134
  358. package/src/modules/storage/lib/proxy.server.ts +0 -63
  359. package/src/modules/storage/lib/router.server.ts +0 -182
  360. /package/src/modules/{config/db → database/lib}/helpers.ts +0 -0
  361. /package/src/modules/{config/db → database/lib}/types.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/validators.ts"],"mappings":";;;;;;;;;;KAYY,IAAA,UAAc,KAAA,CAAM,YAAA;AAAA,KACpB,QAAA,UAAkB,KAAA,CAAM,YAAA;EAAiB,IAAA;AAAA;AAAA,KACzC,UAAA,UAAoB,KAAA,CAAM,YAAA;EAAiB,IAAA;AAAA;;;;cAK1C,cAAA,EAAc,GAAA,CAAA,OAAA;;;;KACf,QAAA,GAAW,GAAA,CAAE,KAAA,QAAa,cAAA;AANtC;;;AAAA,cAWa,gBAAA,eAAgB,WAAA;QAE3B,oBAAA,CAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEU,eAAA,GAAkB,GAAA,CAAE,KAAA,QAAa,gBAAA;AAAA,KACjC,gBAAA,GAAmB,GAAA,CAAE,KAAA,QAAa,gBAAA;;;;cAKjC,gBAAA,eAAgB,WAAA;QAA4B,oBAAA,CAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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-tables/lib/validators.mjs";
3
- import { imageDispositions, imageVariants } from "./constants.mjs";
4
- import { nodeModeEnum, nodes } from "./schema.mjs";
5
- import { nodesTableFilters } from "../config/filters.mjs";
1
+ import { imageDispositions } from "./constants.mjs";
2
+ import { storageAssetVisibilityEnum, storageAssets } from "./schema.mjs";
3
+ import { getObjectOptionsDefaults, objectBodyInputSchema } from "../providers/lib/validators.mjs";
6
4
  import { createInsertSchema, createSelectSchema, createUpdateSchema } from "drizzle-zod";
7
5
  import { z as z$1 } from "zod";
8
6
 
9
7
  //#region src/modules/storage/lib/validators.ts
10
8
  /**
11
- * Node mode
9
+ * StorageAsset visibility enum
12
10
  */
13
- const nodeModeSchema = z$1.enum(nodeModeEnum.enumValues);
11
+ const storageAssetVisibilitySchema = z$1.enum(storageAssetVisibilityEnum.enumValues);
14
12
  /**
15
- * Create node
13
+ * Create storageAsset
16
14
  */
17
- const createNodeSchema = createInsertSchema(nodes, { namespace: z$1.string() });
15
+ const createStorageAssetSchema = createInsertSchema(storageAssets);
18
16
  /**
19
- * Update node
17
+ * Update storageAsset
20
18
  */
21
- const updateNodeSchema = createUpdateSchema(nodes);
19
+ const updateStorageAssetSchema = createUpdateSchema(storageAssets);
22
20
  /**
23
- * Select node
21
+ * Select storageAsset
24
22
  */
25
- const selectNodeSchema = createSelectSchema(nodes);
26
- const selectNodeWithChildrenSchema = selectNodeSchema.extend({ children: z$1.array(selectNodeSchema) });
23
+ const selectStorageAssetSchema = createSelectSchema(storageAssets);
24
+ const assetMetadataSchema = z$1.record(z$1.string(), z$1.string()).optional();
27
25
  /**
28
- * Where input
26
+ * Upload schema
29
27
  */
30
- const nodesTableFiltersSchema = resolveFiltersSchema(nodesTableFilters).partial().extend({
31
- namespace: z$1.string(),
32
- parentId: z$1.string().nullable()
33
- }).transform((input) => ({
34
- ...input,
35
- hidden: input?.hidden ?? false,
36
- isDeleted: input?.isDeleted ?? false,
37
- orphanedAt: input?.isOrphaned ?? false
38
- }));
39
- /**
40
- * Create folder node
41
- */
42
- const createFolderNodeSchema = createNodeSchema.omit({
43
- type: true,
44
- contentType: true,
45
- size: true,
46
- subtype: true
47
- });
48
- /**
49
- * Upload file schema
50
- */
51
- const uploadFileSchema = createNodeSchema.omit({ type: true });
52
- /**
53
- * Presign file schema
54
- */
55
- const presignFileSchema = uploadFileSchema.extend({ id: z$1.uuid() });
56
- /**
57
- * Get file url schema
58
- */
59
- const getFileURLSchemaDefaults = {
60
- variant: "main",
61
- disposition: "inline"
62
- };
63
- const getFileURLSchema = z$1.object({
64
- variant: z$1.enum(imageVariants).optional().default(getFileURLSchemaDefaults.variant),
65
- disposition: z$1.enum(imageDispositions).optional().default(getFileURLSchemaDefaults.disposition)
28
+ const uploadInputSchema = z$1.object({
29
+ name: z$1.string().min(1),
30
+ visibility: storageAssetVisibilitySchema.optional().default("private"),
31
+ size: z$1.number().int().nonnegative().nullable().optional(),
32
+ contentType: z$1.string().nullable().optional(),
33
+ metadata: assetMetadataSchema,
34
+ body: objectBodyInputSchema
66
35
  });
67
- /**
68
- * Get by parent id input
69
- */
70
- const getNodesByParentIdSchema = tableQuerySchema.pick({
71
- order: true,
72
- sort: true,
73
- search: true
74
- }).extend({ filters: nodesTableFiltersSchema });
75
- /**
76
- * Get object input
77
- */
78
- const getObjectSchema = z$1.object({
79
- id: z$1.string(),
80
- variant: z$1.enum(imageVariants).optional().default(getFileURLSchemaDefaults.variant),
81
- disposition: z$1.string().optional().default(getFileURLSchemaDefaults.disposition)
36
+ const presignUploadInputSchema = z$1.object({
37
+ uploadId: z$1.uuid().optional(),
38
+ name: z$1.string().min(1),
39
+ visibility: storageAssetVisibilitySchema.optional().default("private"),
40
+ size: z$1.number().int().nonnegative().nullable().optional(),
41
+ contentType: z$1.string().nullable().optional(),
42
+ metadata: assetMetadataSchema
82
43
  });
44
+ const presignUploadOutputSchema = selectStorageAssetSchema.extend({ presignedUrl: z$1.string() });
45
+ const confirmUploadInputSchema = z$1.uuid().describe("The upload id of the pending upload to confirm, returned from the presign endpoint");
83
46
  /**
84
- * Put object input
47
+ * Get file url schema
85
48
  */
86
- const putObjectSchema = z$1.object({
87
- id: z$1.string(),
88
- name: z$1.string().optional().default(""),
89
- variant: z$1.enum(imageVariants).optional().default("main"),
90
- body: z$1.any().optional(),
91
- contentType: z$1.string().nullable().optional(),
92
- size: z$1.number().nullable().optional()
93
- });
49
+ const getAssetURLSchema = z$1.object({ disposition: z$1.enum(imageDispositions).optional().default(getObjectOptionsDefaults.disposition) });
94
50
 
95
51
  //#endregion
96
- export { createFolderNodeSchema, createNodeSchema, getFileURLSchema, getFileURLSchemaDefaults, getNodesByParentIdSchema, getObjectSchema, nodeModeSchema, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema };
52
+ export { confirmUploadInputSchema, createStorageAssetSchema, getAssetURLSchema, presignUploadInputSchema, presignUploadOutputSchema, selectStorageAssetSchema, storageAssetVisibilitySchema, updateStorageAssetSchema, uploadInputSchema };
97
53
  //# sourceMappingURL=validators.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"validators.mjs","names":["z"],"sources":["../../../../src/modules/storage/lib/validators.ts"],"sourcesContent":["import type { PutObjectCommandInput } from \"@aws-sdk/client-s3\";\nimport { createInsertSchema, createSelectSchema, createUpdateSchema } from \"drizzle-zod\";\nimport { z } from \"zod\";\nimport { tableQuerySchema } from \"@/modules/data-tables/entry\";\nimport { resolveFiltersSchema } from \"@/modules/data-tables/lib/filters/resolvers\";\nimport { nodesTableFilters } from \"../config/filters\";\nimport { imageDispositions, imageVariants } from \"./constants\";\nimport { nodeModeEnum, nodes } from \"./schema\";\n\n/**\n * Nodes\n */\nexport type Node = typeof nodes.$inferSelect;\nexport type FileNode = typeof nodes.$inferSelect & { type: \"file\" };\nexport type FolderNode = typeof nodes.$inferSelect & { type: \"folder\" };\n\n/**\n * Node mode\n */\nexport const nodeModeSchema = z.enum(nodeModeEnum.enumValues);\nexport type NodeMode = z.infer<typeof nodeModeSchema>;\n\n/**\n * Create node\n */\nexport const createNodeSchema = createInsertSchema(nodes, {\n namespace: z.string(),\n});\n\nexport type CreateNodeInput = z.input<typeof createNodeSchema>;\nexport type CreateNodeSchema = z.infer<typeof createNodeSchema>;\n\n/**\n * Update node\n */\nexport const updateNodeSchema = createUpdateSchema(nodes);\n\nexport type UpdateNodeInput = z.input<typeof updateNodeSchema>;\nexport type UpdateNodeSchema = z.infer<typeof updateNodeSchema>;\n\n/**\n * Select node\n */\nexport const selectNodeSchema = createSelectSchema(nodes);\nexport const selectNodeWithChildrenSchema = selectNodeSchema.extend({\n children: z.array(selectNodeSchema),\n});\n\nexport type SelectNodeSchema = z.infer<typeof selectNodeSchema>;\nexport type SelectNodeWithChildrenSchema = z.infer<typeof selectNodeWithChildrenSchema>;\n\n/**\n * Where input\n */\nexport const nodesTableFiltersSchema = resolveFiltersSchema(nodesTableFilters)\n .partial()\n .extend({\n namespace: z.string(),\n parentId: z.string().nullable(),\n })\n .transform((input) => ({\n ...input,\n hidden: input?.hidden ?? false,\n isDeleted: input?.isDeleted ?? false,\n orphanedAt: input?.isOrphaned ?? false,\n }));\n\nexport type NodesTableFilters = z.input<typeof nodesTableFiltersSchema>;\n\n/**\n * Create folder node\n */\nexport const createFolderNodeSchema = createNodeSchema.omit({\n type: true,\n contentType: true,\n size: true,\n subtype: true,\n});\n\nexport type CreateFolderNodeSchema = z.infer<typeof createFolderNodeSchema>;\n\n/**\n * Upload file schema\n */\nexport const uploadFileSchema = createNodeSchema.omit({ type: true });\n\nexport type UploadFileSchema = z.infer<typeof uploadFileSchema>;\n\n/**\n * Presign file schema\n */\nexport const presignFileSchema = uploadFileSchema.extend({ id: z.uuid() });\n\nexport type PresignFileSchema = z.infer<typeof presignFileSchema>;\n\n/**\n * Get file url schema\n */\nexport const getFileURLSchemaDefaults = { variant: \"main\", disposition: \"inline\" } as const;\n\nexport const getFileURLSchema = z.object({\n variant: z.enum(imageVariants).optional().default(getFileURLSchemaDefaults.variant),\n disposition: z.enum(imageDispositions).optional().default(getFileURLSchemaDefaults.disposition),\n});\n\nexport type GetFileUrlInput = z.input<typeof getFileURLSchema>;\nexport type GetFileURLSchema = z.infer<typeof getFileURLSchema>;\n\n/**\n * Get by parent id input\n */\nexport const getNodesByParentIdSchema = tableQuerySchema\n .pick({ order: true, sort: true, search: true })\n .extend({ filters: nodesTableFiltersSchema });\n\nexport type GetNodesByParentIdInput = z.input<typeof getNodesByParentIdSchema>;\n\n/**\n * Get object input\n */\nexport const getObjectSchema = z.object({\n id: z.string(),\n variant: z.enum(imageVariants).optional().default(getFileURLSchemaDefaults.variant),\n disposition: z.string().optional().default(getFileURLSchemaDefaults.disposition),\n});\n\nexport type GetObjectInput = z.input<typeof getObjectSchema>;\nexport type GetObjectSchema = z.infer<typeof getObjectSchema>;\n\n/**\n * Put object input\n */\nexport const putObjectSchema = z.object({\n id: z.string(),\n name: z.string().optional().default(\"\"),\n variant: z.enum(imageVariants).optional().default(\"main\"),\n body: z.any().optional(),\n contentType: z.string().nullable().optional(),\n size: z.number().nullable().optional(),\n});\n\nexport type PutObjectInput = z.input<typeof putObjectSchema> & {\n body?: PutObjectCommandInput[\"Body\"];\n};\n\nexport type PutObjectSchema = z.infer<typeof putObjectSchema>;\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAa,iBAAiBA,IAAE,KAAK,aAAa,WAAW;;;;AAM7D,MAAa,mBAAmB,mBAAmB,OAAO,EACxD,WAAWA,IAAE,QAAQ,EACtB,CAAC;;;;AAQF,MAAa,mBAAmB,mBAAmB,MAAM;;;;AAQzD,MAAa,mBAAmB,mBAAmB,MAAM;AACzD,MAAa,+BAA+B,iBAAiB,OAAO,EAClE,UAAUA,IAAE,MAAM,iBAAiB,EACpC,CAAC;;;;AAQF,MAAa,0BAA0B,qBAAqB,kBAAkB,CAC3E,SAAS,CACT,OAAO;CACN,WAAWA,IAAE,QAAQ;CACrB,UAAUA,IAAE,QAAQ,CAAC,UAAU;C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AE,QAAQ,CAAC,UAAU,CAAC,UAAU;CACvC,CAAC"}
1
+ {"version":3,"file":"validators.mjs","names":["z"],"sources":["../../../../src/modules/storage/lib/validators.ts"],"sourcesContent":["import { createInsertSchema, createSelectSchema, createUpdateSchema } from \"drizzle-zod\";\nimport { z } from \"zod\";\nimport { getObjectOptionsDefaults, objectBodyInputSchema } from \"../providers/lib/validators\";\nimport { imageDispositions } from \"./constants\";\nimport { storageAssets, storageAssetVisibilityEnum } from \"./schema\";\n\n/**\n * StorageAssets\n */\nexport type StorageAsset = typeof storageAssets.$inferSelect;\n\n/**\n * StorageAsset visibility enum\n */\nexport const storageAssetVisibilitySchema = z.enum(storageAssetVisibilityEnum.enumValues);\nexport type StorageAssetVisibility = z.infer<typeof storageAssetVisibilitySchema>;\n\n/**\n * Create storageAsset\n */\nexport const createStorageAssetSchema = createInsertSchema(storageAssets);\n\nexport type CreateStorageAssetInput = z.input<typeof createStorageAssetSchema>;\nexport type CreateStorageAssetSchema = z.infer<typeof createStorageAssetSchema>;\n\n/**\n * Update storageAsset\n */\nexport const updateStorageAssetSchema = createUpdateSchema(storageAssets);\n\nexport type UpdateStorageAssetInput = z.input<typeof updateStorageAssetSchema>;\nexport type UpdateStorageAssetSchema = z.infer<typeof updateStorageAssetSchema>;\n\n/**\n * Select storageAsset\n */\nexport const selectStorageAssetSchema = createSelectSchema(storageAssets);\n\nexport type SelectStorageAssetSchema = z.infer<typeof selectStorageAssetSchema>;\n\nconst assetMetadataSchema = z.record(z.string(), z.string()).optional();\n\n/**\n * Upload schema\n */\nexport const uploadInputSchema = z.object({\n name: z.string().min(1),\n visibility: storageAssetVisibilitySchema.optional().default(\"private\"),\n size: z.number().int().nonnegative().nullable().optional(),\n contentType: z.string().nullable().optional(),\n metadata: assetMetadataSchema,\n body: objectBodyInputSchema,\n});\n\nexport const presignUploadInputSchema = z.object({\n uploadId: z.uuid().optional(),\n name: z.string().min(1),\n visibility: storageAssetVisibilitySchema.optional().default(\"private\"),\n size: z.number().int().nonnegative().nullable().optional(),\n contentType: z.string().nullable().optional(),\n metadata: assetMetadataSchema,\n});\n\nexport const presignUploadOutputSchema = selectStorageAssetSchema.extend({\n presignedUrl: z.string(),\n});\n\nexport const confirmUploadInputSchema = z\n .uuid()\n .describe(\"The upload id of the pending upload to confirm, returned from the presign endpoint\");\n\nexport type UploadInput = z.input<typeof uploadInputSchema>;\nexport type PresignUploadInput = z.input<typeof presignUploadInputSchema>;\nexport type PresignUploadOutput = z.infer<typeof presignUploadOutputSchema>;\nexport type ConfirmUploadInput = z.input<typeof confirmUploadInputSchema>;\n\n/**\n * Get file url schema\n */\nexport const getAssetURLSchema = z.object({\n disposition: z.enum(imageDispositions).optional().default(getObjectOptionsDefaults.disposition),\n});\n\nexport type GetAssetURLInput = z.input<typeof getAssetURLSchema>;\nexport type GetAssetURLSchema = z.infer<typeof getAssetURLSchema>;\n"],"mappings":";;;;;;;;;;AAcA,MAAa,+BAA+BA,IAAE,KAAK,2BAA2B,WAAW;;;;AAMzF,MAAa,2BAA2B,mBAAmB,cAAc;;;;AAQzE,MAAa,2BAA2B,mBAAmB,cAAc;;;;AAQzE,MAAa,2BAA2B,mBAAmB,cAAc;AAIzE,MAAM,sBAAsBA,IAAE,OAAOA,IAAE,QAAQ,EAAEA,IAAE,QAAQ,CAAC,CAAC,UAAU;;;;AAKvE,MAAa,oBAAoBA,IAAE,OAAO;CACxC,MAAMA,IAAE,QAAQ,CAAC,IAAI,EAAE;CACvB,YAAY,6BAA6B,UAAU,CAAC,QAAQ,UAAU;CACtE,MAAMA,IAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU;CAC1D,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC7C,UAAU;CACV,MAAM;CACP,CAAC;AAEF,MAAa,2BAA2BA,IAAE,OAAO;CAC/C,UAAUA,IAAE,MAAM,CAAC,UAAU;CAC7B,MAAMA,IAAE,QAAQ,CAAC,IAAI,EAAE;CACvB,YAAY,6BAA6B,UAAU,CAAC,QAAQ,UAAU;CACtE,MAAMA,IAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU;CAC1D,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC7C,UAAU;CACX,CAAC;AAEF,MAAa,4BAA4B,yBAAyB,OAAO,EACvE,cAAcA,IAAE,QAAQ,EACzB,CAAC;AAEF,MAAa,2BAA2BA,IACrC,MAAM,CACN,SAAS,qFAAqF;;;;AAUjG,MAAa,oBAAoBA,IAAE,OAAO,EACxC,aAAaA,IAAE,KAAK,kBAAkB,CAAC,UAAU,CAAC,QAAQ,yBAAyB,YAAY,EAChG,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { StorageAdapter } from "../lib/types.mjs";
2
+ import { S3ClientConfig } from "@aws-sdk/client-s3";
3
+
4
+ //#region src/modules/storage/providers/adapters/s3.server.d.ts
5
+ type StorageS3AdapterConfig = S3ClientConfig & {
6
+ bucketName: string;
7
+ };
8
+ /**
9
+ * S3 Storage Adapter
10
+ *
11
+ * This adapter implements the storage service interface using AWS S3 as the backend.
12
+ * It provides methods for uploading, retrieving, and managing files in an S3 bucket.
13
+ *
14
+ * @returns An instance of the S3StorageAdapter class.
15
+ */
16
+ declare function storageS3Adapter(config: StorageS3AdapterConfig): StorageAdapter;
17
+ //#endregion
18
+ export { StorageS3AdapterConfig, storageS3Adapter };
19
+ //# sourceMappingURL=s3.server.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3.server.d.mts","names":[],"sources":["../../../../../src/modules/storage/providers/adapters/s3.server.ts"],"mappings":";;;;KAwCY,sBAAA,GAAyB,cAAA;EACnC,UAAA;AAAA;;;;;AA6OF;;;;iBAAgB,gBAAA,CAAiB,MAAA,EAAQ,sBAAA,GAAyB,cAAA"}
@@ -0,0 +1,173 @@
1
+ import { getObjectInputSchema, getObjectOptionsSchema, getObjectOutputSchema, getObjectURLOptionsSchema, headObjectInputSchema, headObjectOutputSchema, putObjectInputSchema, putObjectOutputSchema, putObjectURLInputSchema, putObjectURLOptionsSchema } from "../lib/validators.mjs";
2
+ import { StorageAdapterError } from "../lib/errors.mjs";
3
+ import z from "zod";
4
+ import { Readable } from "node:stream";
5
+ import { DeleteObjectCommand, DeleteObjectsCommand, GetObjectCommand, HeadObjectCommand, PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
6
+ import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
7
+
8
+ //#region src/modules/storage/providers/adapters/s3.server.ts
9
+ /**
10
+ * S3 Storage Adapter
11
+ * This adapter implements the storage service interface using AWS S3 as the backend.
12
+ * It provides methods for uploading, retrieving, and managing files in an S3 bucket.
13
+ */
14
+ var StorageS3Adapter = class {
15
+ /**
16
+ * S3 Client
17
+ */
18
+ key = "s3";
19
+ client;
20
+ bucketName;
21
+ /**
22
+ * Constructor
23
+ */
24
+ constructor({ bucketName, ...config }) {
25
+ this.client = new S3Client(config);
26
+ this.bucketName = bucketName;
27
+ }
28
+ /**
29
+ * Create get command
30
+ */
31
+ #createGetCommand(input, options = {}) {
32
+ const key = getObjectInputSchema.parse(input);
33
+ const { disposition } = getObjectOptionsSchema.parse(options);
34
+ return new GetObjectCommand({
35
+ Bucket: this.bucketName,
36
+ Key: key,
37
+ ResponseContentDisposition: disposition
38
+ });
39
+ }
40
+ /**
41
+ * Get object
42
+ */
43
+ async getObject(input, options = {}) {
44
+ const getCommand = this.#createGetCommand(input, options);
45
+ const result = await this.client.send(getCommand);
46
+ if (result.Body == null) throw new StorageAdapterError("OBJECT_NOT_READABLE", "Object body is missing", { cause: /* @__PURE__ */ new Error(`ContentLength: ${result.ContentLength}, ContentType: ${result.ContentType}, Body: ${result.Body}`) });
47
+ return getObjectOutputSchema.parse({
48
+ contentType: result.ContentType,
49
+ size: result.ContentLength,
50
+ metadata: result.Metadata,
51
+ body: this.#toReadable(result.Body)
52
+ });
53
+ }
54
+ /**
55
+ * Get object URL
56
+ */
57
+ async getObjectURL(input, options = {}) {
58
+ const { expiresIn } = getObjectURLOptionsSchema.parse(options);
59
+ const getCommand = this.#createGetCommand(input, options);
60
+ return await getSignedUrl(this.client, getCommand, { expiresIn });
61
+ }
62
+ /**
63
+ * Create head command
64
+ */
65
+ #createHeadCommand(input) {
66
+ const { key } = headObjectInputSchema.parse(input);
67
+ return new HeadObjectCommand({
68
+ Bucket: this.bucketName,
69
+ Key: key
70
+ });
71
+ }
72
+ /**
73
+ * Head object
74
+ */
75
+ async headObject(input) {
76
+ const headCommand = this.#createHeadCommand(input);
77
+ const result = await this.client.send(headCommand);
78
+ if (result.ContentLength == null || result.ContentType == null) throw new StorageAdapterError("OBJECT_NOT_FOUND", "Object metadata could not be resolved", { cause: /* @__PURE__ */ new Error(`ContentLength: ${result.ContentLength}, ContentType: ${result.ContentType}`) });
79
+ return headObjectOutputSchema.parse({
80
+ contentType: result.ContentType,
81
+ size: result.ContentLength,
82
+ metadata: result.Metadata
83
+ });
84
+ }
85
+ /**
86
+ * Create put command
87
+ */
88
+ #createPutCommand(data) {
89
+ return new PutObjectCommand({
90
+ Bucket: this.bucketName,
91
+ Key: data.key,
92
+ Body: "body" in data ? data.body : void 0,
93
+ ContentType: data.contentType ?? void 0,
94
+ ContentLength: data.size ?? void 0,
95
+ Metadata: data.metadata ?? void 0
96
+ });
97
+ }
98
+ /**
99
+ * Put object
100
+ */
101
+ async putObject(input) {
102
+ const data = putObjectInputSchema.parse(input);
103
+ const putCommand = this.#createPutCommand(data);
104
+ const result = await this.client.send(putCommand);
105
+ return putObjectOutputSchema.parse({ size: result.Size });
106
+ }
107
+ /**
108
+ * Get signed URL
109
+ */
110
+ async putObjectURL(input, options = {}) {
111
+ const { expiresIn } = putObjectURLOptionsSchema.parse(options);
112
+ const data = putObjectURLInputSchema.parse(input);
113
+ const putCommand = this.#createPutCommand(data);
114
+ return await getSignedUrl(this.client, putCommand, { expiresIn });
115
+ }
116
+ /**
117
+ * Delete object
118
+ */
119
+ async deleteObject(input) {
120
+ const key = z.string().parse(input);
121
+ const deleteCommand = new DeleteObjectCommand({
122
+ Bucket: this.bucketName,
123
+ Key: key
124
+ });
125
+ const response = await this.client.send(deleteCommand);
126
+ if (response.DeleteMarker !== true && response.VersionId) throw new StorageAdapterError("OBJECT_DELETE_FAILED", "Failed to delete object", { cause: /* @__PURE__ */ new Error(`DeleteMarker: ${response.DeleteMarker}, VersionId: ${response.VersionId}`) });
127
+ }
128
+ /**
129
+ * Delete multiple objects
130
+ */
131
+ async deleteObjects(input) {
132
+ const keys = z.array(z.string()).parse(input);
133
+ const deleteCommand = new DeleteObjectsCommand({
134
+ Bucket: this.bucketName,
135
+ Delete: { Objects: keys.map((Key) => ({ Key })) }
136
+ });
137
+ const response = await this.client.send(deleteCommand);
138
+ if (response.Errors && response.Errors.length > 0) throw new StorageAdapterError("OBJECT_DELETE_FAILED", "Failed to delete objects", { cause: new Error(JSON.stringify(response.Errors)) });
139
+ }
140
+ /**
141
+ * Transform the GetObjectCommandOutput Body into a normalized Readable stream
142
+ * S3 can return the Body in different formats depending on the environment and AWS SDK version:
143
+ * - In Node.js, it may return a Readable stream.
144
+ * - In newer AWS SDK versions in Node 18+, it may return a web ReadableStream with transformToWebStream method.
145
+ * - In older AWS SDK versions in Node 16, it may return a web ReadableStream without transformToWebStream.
146
+ * - It may also return a string, Buffer, or Uint8Array for small objects.
147
+ *
148
+ * This method normalizes all these cases into a Node.js Readable stream for consistent handling in the application.
149
+ */
150
+ #toReadable(body) {
151
+ if (!body) throw new StorageAdapterError("OBJECT_NOT_READABLE", "S3 object body is empty");
152
+ if (body instanceof Readable) return body;
153
+ if (typeof body.transformToWebStream === "function") return Readable.fromWeb(body.transformToWebStream());
154
+ if (typeof body.getReader === "function") return Readable.fromWeb(body);
155
+ if (typeof body === "string" || body instanceof Uint8Array || Buffer.isBuffer(body)) return Readable.from([body]);
156
+ throw new StorageAdapterError("UNSUPPORTED_BODY_TYPE", "Unsupported object body type");
157
+ }
158
+ };
159
+ /**
160
+ * S3 Storage Adapter
161
+ *
162
+ * This adapter implements the storage service interface using AWS S3 as the backend.
163
+ * It provides methods for uploading, retrieving, and managing files in an S3 bucket.
164
+ *
165
+ * @returns An instance of the S3StorageAdapter class.
166
+ */
167
+ function storageS3Adapter(config) {
168
+ return new StorageS3Adapter(config);
169
+ }
170
+
171
+ //#endregion
172
+ export { storageS3Adapter };
173
+ //# sourceMappingURL=s3.server.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3.server.mjs","names":["#createGetCommand","#toReadable","#createHeadCommand","#createPutCommand"],"sources":["../../../../../src/modules/storage/providers/adapters/s3.server.ts"],"sourcesContent":["import { Readable } from \"node:stream\";\nimport type { ReadableStream } from \"node:stream/web\";\nimport {\n DeleteObjectCommand,\n DeleteObjectsCommand,\n GetObjectCommand,\n type GetObjectCommandOutput,\n HeadObjectCommand,\n PutObjectCommand,\n S3Client,\n type S3ClientConfig,\n} from \"@aws-sdk/client-s3\";\nimport { getSignedUrl } from \"@aws-sdk/s3-request-presigner\";\nimport z from \"zod\";\nimport type { StorageProvider } from \"../lib/constants\";\nimport { StorageAdapterError } from \"../lib/errors\";\nimport type { StorageAdapter } from \"../lib/types\";\nimport {\n type GetObjectInput,\n type GetObjectOptions,\n type GetObjectOutput,\n type GetObjectURLOptions,\n getObjectInputSchema,\n getObjectOptionsSchema,\n getObjectOutputSchema,\n getObjectURLOptionsSchema,\n type HeadObjectInput,\n type HeadObjectOutput,\n headObjectInputSchema,\n headObjectOutputSchema,\n type PutObjectInput,\n type PutObjectOutput,\n type PutObjectURLInput,\n type PutObjectURLOptions,\n putObjectInputSchema,\n putObjectOutputSchema,\n putObjectURLInputSchema,\n putObjectURLOptionsSchema,\n} from \"../lib/validators\";\n\nexport type StorageS3AdapterConfig = S3ClientConfig & {\n bucketName: string;\n};\n\n/**\n * S3 Storage Adapter\n * This adapter implements the storage service interface using AWS S3 as the backend.\n * It provides methods for uploading, retrieving, and managing files in an S3 bucket.\n */\nclass StorageS3Adapter implements StorageAdapter {\n /**\n * S3 Client\n */\n key: StorageProvider = \"s3\";\n client: S3Client;\n bucketName: string;\n\n /**\n * Constructor\n */\n constructor({ bucketName, ...config }: StorageS3AdapterConfig) {\n this.client = new S3Client(config);\n this.bucketName = bucketName;\n }\n\n /**\n * Create get command\n */\n #createGetCommand(input: GetObjectInput, options: GetObjectOptions = {}) {\n const key = getObjectInputSchema.parse(input);\n const { disposition } = getObjectOptionsSchema.parse(options);\n\n return new GetObjectCommand({\n Bucket: this.bucketName,\n Key: key,\n ResponseContentDisposition: disposition,\n });\n }\n\n /**\n * Get object\n */\n async getObject(input: GetObjectInput, options: GetObjectOptions = {}): Promise<GetObjectOutput> {\n const getCommand = this.#createGetCommand(input, options);\n\n const result = await this.client.send(getCommand);\n\n if (result.Body == null) {\n throw new StorageAdapterError(\"OBJECT_NOT_READABLE\", \"Object body is missing\", {\n cause: new Error(\n `ContentLength: ${result.ContentLength}, ContentType: ${result.ContentType}, Body: ${result.Body}`,\n ),\n });\n }\n\n return getObjectOutputSchema.parse({\n contentType: result.ContentType,\n size: result.ContentLength,\n metadata: result.Metadata,\n body: this.#toReadable(result.Body),\n });\n }\n\n /**\n * Get object URL\n */\n async getObjectURL(input: GetObjectInput, options: GetObjectURLOptions = {}) {\n const { expiresIn } = getObjectURLOptionsSchema.parse(options);\n\n // Validate input and create get command\n const getCommand = this.#createGetCommand(input, options);\n\n // Generate the presigned url\n return await getSignedUrl(this.client, getCommand, { expiresIn });\n }\n\n /**\n * Create head command\n */\n #createHeadCommand(input: HeadObjectInput) {\n const { key } = headObjectInputSchema.parse(input);\n\n return new HeadObjectCommand({\n Bucket: this.bucketName,\n Key: key,\n });\n }\n\n /**\n * Head object\n */\n async headObject(input: HeadObjectInput): Promise<HeadObjectOutput> {\n const headCommand = this.#createHeadCommand(input);\n\n const result = await this.client.send(headCommand);\n\n if (result.ContentLength == null || result.ContentType == null) {\n throw new StorageAdapterError(\"OBJECT_NOT_FOUND\", \"Object metadata could not be resolved\", {\n cause: new Error(\n `ContentLength: ${result.ContentLength}, ContentType: ${result.ContentType}`,\n ),\n });\n }\n\n return headObjectOutputSchema.parse({\n contentType: result.ContentType,\n size: result.ContentLength,\n metadata: result.Metadata,\n });\n }\n\n /**\n * Create put command\n */\n #createPutCommand(\n data: z.infer<typeof putObjectInputSchema> | z.infer<typeof putObjectURLInputSchema>,\n ) {\n return new PutObjectCommand({\n Bucket: this.bucketName,\n Key: data.key,\n Body: \"body\" in data ? data.body : undefined,\n ContentType: data.contentType ?? undefined,\n ContentLength: data.size ?? undefined,\n Metadata: data.metadata ?? undefined,\n });\n }\n\n /**\n * Put object\n */\n async putObject(input: PutObjectInput): Promise<PutObjectOutput> {\n const data = putObjectInputSchema.parse(input);\n const putCommand = this.#createPutCommand(data);\n\n const result = await this.client.send(putCommand);\n\n return putObjectOutputSchema.parse({ size: result.Size });\n }\n\n /**\n * Get signed URL\n */\n async putObjectURL(input: PutObjectURLInput, options: PutObjectURLOptions = {}) {\n const { expiresIn } = putObjectURLOptionsSchema.parse(options);\n\n // Validate input and create put command\n const data = putObjectURLInputSchema.parse(input);\n const putCommand = this.#createPutCommand(data);\n\n // Generate the presigned url\n return await getSignedUrl(this.client, putCommand, { expiresIn });\n }\n\n /**\n * Delete object\n */\n async deleteObject(input: string): Promise<void> {\n const key = z.string().parse(input);\n\n const deleteCommand = new DeleteObjectCommand({\n Bucket: this.bucketName,\n Key: key,\n });\n\n const response = await this.client.send(deleteCommand);\n\n if (response.DeleteMarker !== true && response.VersionId) {\n throw new StorageAdapterError(\"OBJECT_DELETE_FAILED\", \"Failed to delete object\", {\n cause: new Error(\n `DeleteMarker: ${response.DeleteMarker}, VersionId: ${response.VersionId}`,\n ),\n });\n }\n }\n\n /**\n * Delete multiple objects\n */\n async deleteObjects(input: string[]): Promise<void> {\n const keys = z.array(z.string()).parse(input);\n\n const deleteCommand = new DeleteObjectsCommand({\n Bucket: this.bucketName,\n Delete: { Objects: keys.map((Key) => ({ Key })) },\n });\n\n const response = await this.client.send(deleteCommand);\n\n if (response.Errors && response.Errors.length > 0) {\n throw new StorageAdapterError(\"OBJECT_DELETE_FAILED\", \"Failed to delete objects\", {\n cause: new Error(JSON.stringify(response.Errors)),\n });\n }\n }\n\n /**\n * Transform the GetObjectCommandOutput Body into a normalized Readable stream\n * S3 can return the Body in different formats depending on the environment and AWS SDK version:\n * - In Node.js, it may return a Readable stream.\n * - In newer AWS SDK versions in Node 18+, it may return a web ReadableStream with transformToWebStream method.\n * - In older AWS SDK versions in Node 16, it may return a web ReadableStream without transformToWebStream.\n * - It may also return a string, Buffer, or Uint8Array for small objects.\n *\n * This method normalizes all these cases into a Node.js Readable stream for consistent handling in the application.\n */\n #toReadable(body: GetObjectCommandOutput[\"Body\"]): Readable {\n if (!body) throw new StorageAdapterError(\"OBJECT_NOT_READABLE\", \"S3 object body is empty\");\n\n // If it's already a Node Readable, return as is\n if (body instanceof Readable) return body;\n\n if (typeof body.transformToWebStream === \"function\") {\n // biome-ignore lint/suspicious/noExplicitAny: The AWS SDK v3 in Node 18+ returns a web ReadableStream with a transformToWebStream method, but the types don't reflect this correctly, so we need to use 'any' here.\n return Readable.fromWeb((body as any).transformToWebStream());\n }\n\n // biome-ignore lint/suspicious/noExplicitAny: The AWS SDK v3 in Node 16 returns a web ReadableStream without a transformToWebStream method, but the types don't reflect this correctly, so we need to use 'any' here.\n if (typeof (body as any).getReader === \"function\") {\n return Readable.fromWeb(body as unknown as ReadableStream);\n }\n\n // If it's a string, Buffer, or Uint8Array, convert to Readable\n if (typeof body === \"string\" || body instanceof Uint8Array || Buffer.isBuffer(body)) {\n return Readable.from([body]);\n }\n\n throw new StorageAdapterError(\"UNSUPPORTED_BODY_TYPE\", \"Unsupported object body type\");\n }\n}\n\n/**\n * S3 Storage Adapter\n *\n * This adapter implements the storage service interface using AWS S3 as the backend.\n * It provides methods for uploading, retrieving, and managing files in an S3 bucket.\n *\n * @returns An instance of the S3StorageAdapter class.\n */\nexport function stor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(typeof storageProviders)[number];
4
+ //#endregion
5
+ export { StorageProvider, storageProviders };
6
+ //# sourceMappingURL=constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.mts","names":[],"sources":["../../../../../src/modules/storage/providers/lib/constants.ts"],"mappings":";cACa,gBAAA;AAAA,KACD,eAAA,WAA0B,gBAAA"}
@@ -0,0 +1,6 @@
1
+ //#region src/modules/storage/providers/lib/constants.ts
2
+ const storageProviders = ["s3"];
3
+
4
+ //#endregion
5
+ export { storageProviders };
6
+ //# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.mjs","names":[],"sources":["../../../../../src/modules/storage/providers/lib/constants.ts"],"sourcesContent":["// Storage providers\nexport const storageProviders = [\"s3\"] as const;\nexport type StorageProvider = (typeof storageProviders)[number];\n"],"mappings":";AACA,MAAa,mBAAmB,CAAC,KAAK"}
@@ -0,0 +1,12 @@
1
+ //#region src/modules/storage/providers/lib/errors.d.ts
2
+ /**
3
+ * Storage adapter error codes and class
4
+ */
5
+ type StorageAdapterErrorCode = "OBJECT_NOT_FOUND" | "OBJECT_NOT_READABLE" | "OBJECT_DELETE_FAILED" | "OBJECT_HEAD_FAILED" | "OBJECT_UPLOAD_FAILED" | "OBJECT_URL_FAILED" | "UNSUPPORTED_BODY_TYPE";
6
+ declare class StorageAdapterError extends Error {
7
+ code: StorageAdapterErrorCode;
8
+ constructor(code: StorageAdapterErrorCode, message: string, options?: ErrorOptions);
9
+ }
10
+ //#endregion
11
+ export { StorageAdapterError, StorageAdapterErrorCode };
12
+ //# sourceMappingURL=errors.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../../src/modules/storage/providers/lib/errors.ts"],"mappings":";;AAGA;;KAAY,uBAAA;AAAA,cASC,mBAAA,SAA4B,KAAA;EACvC,IAAA,EAAM,uBAAA;cAEM,IAAA,EAAM,uBAAA,EAAyB,OAAA,UAAiB,OAAA,GAAU,YAAA;AAAA"}
@@ -0,0 +1,13 @@
1
+ //#region src/modules/storage/providers/lib/errors.ts
2
+ var StorageAdapterError = class extends Error {
3
+ code;
4
+ constructor(code, message, options) {
5
+ super(message, options);
6
+ this.name = "StorageError";
7
+ this.code = code;
8
+ }
9
+ };
10
+
11
+ //#endregion
12
+ export { StorageAdapterError };
13
+ //# sourceMappingURL=errors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.mjs","names":[],"sources":["../../../../../src/modules/storage/providers/lib/errors.ts"],"sourcesContent":["/**\n * Storage adapter error codes and class\n */\nexport type StorageAdapterErrorCode =\n | \"OBJECT_NOT_FOUND\"\n | \"OBJECT_NOT_READABLE\"\n | \"OBJECT_DELETE_FAILED\"\n | \"OBJECT_HEAD_FAILED\"\n | \"OBJECT_UPLOAD_FAILED\"\n | \"OBJECT_URL_FAILED\"\n | \"UNSUPPORTED_BODY_TYPE\";\n\nexport class StorageAdapterError extends Error {\n code: StorageAdapterErrorCode;\n\n constructor(code: StorageAdapterErrorCode, message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"StorageError\";\n this.code = code;\n }\n}\n"],"mappings":";AAYA,IAAa,sBAAb,cAAyC,MAAM;CAC7C;CAEA,YAAY,MAA+B,SAAiB,SAAwB;AAClF,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;AACZ,OAAK,OAAO"}
@@ -0,0 +1,21 @@
1
+ import { StorageProvider } from "./constants.mjs";
2
+ import { GetObjectInput, GetObjectOptions, GetObjectOutput, GetObjectURLOptions, HeadObjectInput, HeadObjectOutput, PutObjectInput, PutObjectOutput, PutObjectURLInput, PutObjectURLOptions } from "./validators.mjs";
3
+
4
+ //#region src/modules/storage/providers/lib/types.d.ts
5
+ /**
6
+ * Storage adapter interface
7
+ */
8
+ interface StorageAdapter {
9
+ key: StorageProvider;
10
+ bucketName: string;
11
+ getObject: (input: GetObjectInput, options?: GetObjectOptions) => Promise<GetObjectOutput>;
12
+ getObjectURL: (input: GetObjectInput, options?: GetObjectURLOptions) => Promise<string>;
13
+ headObject: (input: HeadObjectInput) => Promise<HeadObjectOutput>;
14
+ putObject: (props: PutObjectInput) => Promise<PutObjectOutput>;
15
+ putObjectURL: (props: PutObjectURLInput, options?: PutObjectURLOptions) => Promise<string>;
16
+ deleteObject: (key: string) => Promise<void>;
17
+ deleteObjects: (keys: string[]) => Promise<void>;
18
+ }
19
+ //#endregion
20
+ export { StorageAdapter };
21
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../src/modules/storage/providers/lib/types.ts"],"mappings":";;;;;;AAiBA;UAAiB,cAAA;EACf,GAAA,EAAK,eAAA;EACL,UAAA;EACA,SAAA,GAAY,KAAA,EAAO,cAAA,EAAgB,OAAA,GAAU,gBAAA,KAAqB,OAAA,CAAQ,eAAA;EAC1E,YAAA,GAAe,KAAA,EAAO,cAAA,EAAgB,OAAA,GAAU,mBAAA,KAAwB,OAAA;EACxE,UAAA,GAAa,KAAA,EAAO,eAAA,KAAoB,OAAA,CAAQ,gBAAA;EAChD,SAAA,GAAY,KAAA,EAAO,cAAA,KAAmB,OAAA,CAAQ,eAAA;EAC9C,YAAA,GAAe,KAAA,EAAO,iBAAA,EAAmB,OAAA,GAAU,mBAAA,KAAwB,OAAA;EAC3E,YAAA,GAAe,GAAA,aAAgB,OAAA;EAC/B,aAAA,GAAgB,IAAA,eAAmB,OAAA;AAAA"}
@@ -0,0 +1,112 @@
1
+ import { z as z$1 } from "zod";
2
+ import { Readable } from "node:stream";
3
+
4
+ //#region src/modules/storage/providers/lib/validators.d.ts
5
+ /**
6
+ * Object body schema
7
+ */
8
+ declare const objectBodyInputSchema: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z$1.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>, z$1.ZodCustom<Readable, Readable>]>;
9
+ type ObjectBodyInput = z$1.infer<typeof objectBodyInputSchema>;
10
+ /**
11
+ * Object body output schema (normalized)
12
+ */
13
+ declare const objectBodyOutputSchema: z$1.ZodCustom<Readable, Readable>;
14
+ type ObjectBodyOutput = z$1.infer<typeof objectBodyOutputSchema>;
15
+ /**
16
+ * Object schema
17
+ */
18
+ declare const objectSchema: z$1.ZodObject<{
19
+ contentType: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
20
+ size: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
21
+ metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
22
+ }, z$1.core.$strip>;
23
+ type ObjectSchema = z$1.infer<typeof objectSchema>;
24
+ /**
25
+ * Get object input
26
+ */
27
+ declare const getObjectInputSchema: z$1.ZodString;
28
+ type GetObjectInput = z$1.input<typeof getObjectInputSchema>;
29
+ /**
30
+ * Get object options schema
31
+ */
32
+ declare const getObjectOptionsDefaults: {
33
+ readonly disposition: "inline";
34
+ };
35
+ declare const getObjectOptionsSchema: z$1.ZodObject<{
36
+ disposition: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodString>>;
37
+ }, z$1.core.$strip>;
38
+ type GetObjectOptions = z$1.input<typeof getObjectOptionsSchema>;
39
+ /**
40
+ * Get object URL input
41
+ */
42
+ declare const getObjectURLOptionsSchema: z$1.ZodObject<{
43
+ disposition: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodString>>;
44
+ expiresIn: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
45
+ }, z$1.core.$strip>;
46
+ type GetObjectURLOptions = z$1.input<typeof getObjectURLOptionsSchema>;
47
+ /**
48
+ * Get object output
49
+ */
50
+ declare const getObjectOutputSchema: z$1.ZodObject<{
51
+ contentType: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
52
+ size: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
53
+ metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
54
+ body: z$1.ZodCustom<Readable, Readable>;
55
+ }, z$1.core.$strip>;
56
+ type GetObjectOutput = z$1.infer<typeof getObjectOutputSchema>;
57
+ /**
58
+ * Get object head input
59
+ */
60
+ declare const headObjectInputSchema: z$1.ZodObject<{
61
+ key: z$1.ZodString;
62
+ }, z$1.core.$strip>;
63
+ type HeadObjectInput = z$1.input<typeof headObjectInputSchema>;
64
+ /**
65
+ * Head object output
66
+ */
67
+ declare const headObjectOutputSchema: z$1.ZodObject<{
68
+ contentType: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
69
+ size: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
70
+ metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
71
+ }, z$1.core.$strip>;
72
+ type HeadObjectOutput = z$1.infer<typeof headObjectOutputSchema>;
73
+ /**
74
+ * Put object URL input
75
+ */
76
+ declare const putObjectURLInputSchema: z$1.ZodObject<{
77
+ key: z$1.ZodString;
78
+ contentType: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
79
+ size: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
80
+ metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
81
+ }, z$1.core.$strip>;
82
+ type PutObjectURLInput = z$1.input<typeof putObjectURLInputSchema>;
83
+ /**
84
+ * Put object URL input
85
+ */
86
+ declare const putObjectURLOptionsSchema: z$1.ZodObject<{
87
+ expiresIn: z$1.ZodDefault<z$1.ZodOptional<z$1.ZodNumber>>;
88
+ }, z$1.core.$strip>;
89
+ type PutObjectURLOptions = z$1.input<typeof putObjectURLOptionsSchema>;
90
+ /**
91
+ * Put object input
92
+ */
93
+ declare const putObjectInputSchema: z$1.ZodObject<{
94
+ key: z$1.ZodString;
95
+ contentType: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
96
+ size: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
97
+ metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
98
+ body: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z$1.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>, z$1.ZodCustom<Readable, Readable>]>;
99
+ }, z$1.core.$strip>;
100
+ type PutObjectInput = z$1.input<typeof putObjectInputSchema>;
101
+ /**
102
+ * Put object schema
103
+ */
104
+ declare const putObjectOutputSchema: z$1.ZodObject<{
105
+ contentType: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
106
+ size: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodNumber>>;
107
+ metadata: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodString>>;
108
+ }, z$1.core.$strip>;
109
+ type PutObjectOutput = z$1.infer<typeof putObjectOutputSchema>;
110
+ //#endregion
111
+ export { GetObjectInput, GetObjectOptions, GetObjectOutput, GetObjectURLOptions, HeadObjectInput, HeadObjectOutput, ObjectBodyInput, ObjectBodyOutput, ObjectSchema, PutObjectInput, PutObjectOutput, PutObjectURLInput, PutObjectURLOptions, getObjectInputSchema, getObjectOptionsDefaults, getObjectOptionsSchema, getObjectOutputSchema, getObjectURLOptionsSchema, headObjectInputSchema, headObjectOutputSchema, objectBodyInputSchema, objectBodyOutputSchema, objectSchema, putObjectInputSchema, putObjectOutputSchema, putObjectURLInputSchema, putObjectURLOptionsSchema };
112
+ //# sourceMappingURL=validators.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.d.mts","names":[],"sources":["../../../../../src/modules/storage/providers/lib/validators.ts"],"mappings":";;;;;;AAMA;cAAa,qBAAA,EAAqB,GAAA,CAAA,QAAA,WAAA,GAAA,CAAA,SAAA,EAAA,GAAA,CAAA,SAAA,CAAA,UAAA,CAAA,WAAA,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