@tulip-systems/core 0.8.2 → 0.8.3

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 (976) hide show
  1. package/dist/components/common/icons.d.mts +1 -2
  2. package/dist/components/common/icons.mjs +1 -2
  3. package/dist/components/common/status.d.mts +1 -2
  4. package/dist/components/common/status.mjs +1 -2
  5. package/dist/components/editor/components/content.client.d.mts +1 -2
  6. package/dist/components/editor/components/content.client.mjs +1 -2
  7. package/dist/components/editor/components/editor.client.d.mts +1 -2
  8. package/dist/components/editor/components/editor.client.mjs +1 -2
  9. package/dist/components/editor/components/menu-nodes.client.mjs +1 -2
  10. package/dist/components/editor/components/menu.client.d.mts +1 -2
  11. package/dist/components/editor/components/menu.client.mjs +1 -2
  12. package/dist/components/editor/extensions/file-handler/extension.d.mts +1 -2
  13. package/dist/components/editor/extensions/file-handler/extension.mjs +1 -2
  14. package/dist/components/editor/extensions/file-handler/strategy.d.mts +1 -2
  15. package/dist/components/editor/extensions/file-handler/strategy.mjs +1 -2
  16. package/dist/components/editor/extensions/file-handler/utils.mjs +1 -2
  17. package/dist/components/editor/extensions/image/extension.d.mts +1 -2
  18. package/dist/components/editor/extensions/image/extension.mjs +1 -2
  19. package/dist/components/editor/extensions/skeleton/extension.mjs +1 -2
  20. package/dist/components/editor/extensions/skeleton/renderer.mjs +1 -2
  21. package/dist/components/editor/lib/constants.d.mts +1 -2
  22. package/dist/components/editor/lib/constants.mjs +1 -2
  23. package/dist/components/editor/lib/extensions.d.mts +1 -2
  24. package/dist/components/editor/lib/extensions.mjs +1 -2
  25. package/dist/components/editor/lib/helpers.d.mts +1 -2
  26. package/dist/components/editor/lib/helpers.mjs +1 -2
  27. package/dist/components/editor/lib/types.d.mts +1 -2
  28. package/dist/components/editor/lib/variants.mjs +1 -2
  29. package/dist/components/emails/forget-password-email.mjs +2 -3
  30. package/dist/components/header/back-button.client.d.mts +1 -2
  31. package/dist/components/header/back-button.client.mjs +1 -2
  32. package/dist/components/header/bottom-bar.client.d.mts +1 -2
  33. package/dist/components/header/bottom-bar.client.mjs +1 -2
  34. package/dist/components/header/breadcrumbs.client.d.mts +1 -2
  35. package/dist/components/header/breadcrumbs.client.mjs +1 -2
  36. package/dist/components/header/header.client.d.mts +1 -2
  37. package/dist/components/header/header.client.mjs +1 -2
  38. package/dist/components/header/indicator.client.mjs +1 -2
  39. package/dist/components/header/mobile-nav-switcher.client.d.mts +1 -2
  40. package/dist/components/header/mobile-nav-switcher.client.mjs +1 -2
  41. package/dist/components/header/top-bar.client.d.mts +1 -2
  42. package/dist/components/header/top-bar.client.mjs +1 -2
  43. package/dist/components/layouts/admin-content.client.d.mts +1 -2
  44. package/dist/components/layouts/admin-content.client.mjs +1 -2
  45. package/dist/components/layouts/admin-error-pages.d.mts +1 -2
  46. package/dist/components/layouts/admin-error-pages.mjs +1 -2
  47. package/dist/components/layouts/admin-layout.d.mts +1 -2
  48. package/dist/components/layouts/admin-layout.mjs +1 -2
  49. package/dist/components/layouts/admin-loading.d.mts +1 -2
  50. package/dist/components/layouts/admin-loading.mjs +1 -2
  51. package/dist/components/layouts/empty-page.d.mts +1 -2
  52. package/dist/components/layouts/empty-page.mjs +1 -2
  53. package/dist/components/layouts/error-page.d.mts +1 -2
  54. package/dist/components/layouts/error-page.mjs +1 -2
  55. package/dist/components/layouts/error-sections.d.mts +1 -2
  56. package/dist/components/layouts/error-sections.mjs +1 -2
  57. package/dist/components/layouts/list-layout.d.mts +1 -2
  58. package/dist/components/layouts/list-layout.mjs +1 -2
  59. package/dist/components/layouts/providers.client.d.mts +1 -2
  60. package/dist/components/layouts/providers.client.mjs +1 -2
  61. package/dist/components/layouts/root-error-pages.d.mts +1 -2
  62. package/dist/components/layouts/root-error-pages.mjs +1 -2
  63. package/dist/components/layouts/root-layout.server.d.mts +1 -2
  64. package/dist/components/layouts/root-layout.server.mjs +1 -2
  65. package/dist/components/layouts/root-loading.d.mts +1 -2
  66. package/dist/components/layouts/root-loading.mjs +1 -2
  67. package/dist/components/layouts/tab-layout.d.mts +1 -2
  68. package/dist/components/layouts/tab-layout.mjs +1 -2
  69. package/dist/components/lists/data-list.d.mts +1 -2
  70. package/dist/components/lists/data-list.mjs +1 -2
  71. package/dist/components/lists/data-stack.d.mts +1 -2
  72. package/dist/components/lists/data-stack.mjs +1 -2
  73. package/dist/components/navigation/admin-sidebar-header.client.mjs +1 -2
  74. package/dist/components/navigation/admin-sidebar-paths.client.d.mts +1 -2
  75. package/dist/components/navigation/admin-sidebar-paths.client.mjs +1 -2
  76. package/dist/components/navigation/admin-sidebar-skeleton.mjs +1 -2
  77. package/dist/components/ui/accordion.client.d.mts +1 -2
  78. package/dist/components/ui/accordion.client.mjs +1 -2
  79. package/dist/components/ui/alert-dialog.client.d.mts +1 -2
  80. package/dist/components/ui/alert-dialog.client.mjs +1 -2
  81. package/dist/components/ui/alert.d.mts +1 -2
  82. package/dist/components/ui/alert.mjs +1 -2
  83. package/dist/components/ui/aspect-ratio.client.d.mts +1 -2
  84. package/dist/components/ui/aspect-ratio.client.mjs +1 -2
  85. package/dist/components/ui/avatar.client.d.mts +1 -2
  86. package/dist/components/ui/avatar.client.mjs +1 -2
  87. package/dist/components/ui/badge.d.mts +2 -3
  88. package/dist/components/ui/badge.mjs +1 -2
  89. package/dist/components/ui/breadcrumb.d.mts +1 -2
  90. package/dist/components/ui/breadcrumb.mjs +1 -2
  91. package/dist/components/ui/button-group.d.mts +1 -2
  92. package/dist/components/ui/button-group.mjs +1 -2
  93. package/dist/components/ui/button.d.mts +2 -3
  94. package/dist/components/ui/button.mjs +1 -2
  95. package/dist/components/ui/calendar.client.d.mts +1 -2
  96. package/dist/components/ui/calendar.client.mjs +1 -2
  97. package/dist/components/ui/card.d.mts +1 -2
  98. package/dist/components/ui/card.mjs +1 -2
  99. package/dist/components/ui/carousel.client.d.mts +1 -2
  100. package/dist/components/ui/carousel.client.mjs +1 -2
  101. package/dist/components/ui/chart.client.d.mts +1 -2
  102. package/dist/components/ui/chart.client.mjs +1 -2
  103. package/dist/components/ui/checkbox.client.d.mts +1 -2
  104. package/dist/components/ui/checkbox.client.mjs +1 -2
  105. package/dist/components/ui/collapsible.client.d.mts +1 -2
  106. package/dist/components/ui/collapsible.client.mjs +1 -2
  107. package/dist/components/ui/color-picker.client.d.mts +1 -2
  108. package/dist/components/ui/color-picker.client.mjs +1 -2
  109. package/dist/components/ui/combobox-dropdown.client.d.mts +1 -2
  110. package/dist/components/ui/combobox-dropdown.client.mjs +1 -2
  111. package/dist/components/ui/combobox.client.d.mts +1 -2
  112. package/dist/components/ui/combobox.client.mjs +1 -2
  113. package/dist/components/ui/command.client.d.mts +1 -2
  114. package/dist/components/ui/command.client.mjs +1 -2
  115. package/dist/components/ui/context-menu.client.d.mts +1 -2
  116. package/dist/components/ui/context-menu.client.mjs +1 -2
  117. package/dist/components/ui/date-picker.client.d.mts +1 -2
  118. package/dist/components/ui/date-picker.client.mjs +1 -2
  119. package/dist/components/ui/dialog.client.d.mts +1 -2
  120. package/dist/components/ui/dialog.client.mjs +1 -2
  121. package/dist/components/ui/drawer.client.d.mts +1 -2
  122. package/dist/components/ui/drawer.client.mjs +1 -2
  123. package/dist/components/ui/dropdown-menu.client.d.mts +1 -2
  124. package/dist/components/ui/dropdown-menu.client.mjs +1 -2
  125. package/dist/components/ui/empty.d.mts +1 -2
  126. package/dist/components/ui/empty.mjs +1 -2
  127. package/dist/components/ui/field.client.d.mts +1 -2
  128. package/dist/components/ui/field.client.mjs +1 -2
  129. package/dist/components/ui/form.client.d.mts +1 -2
  130. package/dist/components/ui/form.client.mjs +1 -2
  131. package/dist/components/ui/hover-card.client.d.mts +1 -2
  132. package/dist/components/ui/hover-card.client.mjs +1 -2
  133. package/dist/components/ui/input-date-time.client.d.mts +1 -2
  134. package/dist/components/ui/input-date-time.client.mjs +1 -2
  135. package/dist/components/ui/input-date.d.mts +1 -2
  136. package/dist/components/ui/input-date.mjs +1 -2
  137. package/dist/components/ui/input-group.client.d.mts +1 -2
  138. package/dist/components/ui/input-group.client.mjs +1 -2
  139. package/dist/components/ui/input-recipient.d.mts +1 -2
  140. package/dist/components/ui/input-recipient.mjs +1 -2
  141. package/dist/components/ui/input-time.d.mts +1 -2
  142. package/dist/components/ui/input-time.mjs +1 -2
  143. package/dist/components/ui/input.d.mts +1 -2
  144. package/dist/components/ui/input.mjs +1 -2
  145. package/dist/components/ui/item.d.mts +2 -3
  146. package/dist/components/ui/item.mjs +1 -2
  147. package/dist/components/ui/kbd.d.mts +1 -2
  148. package/dist/components/ui/kbd.mjs +1 -2
  149. package/dist/components/ui/label.d.mts +1 -2
  150. package/dist/components/ui/label.mjs +1 -2
  151. package/dist/components/ui/loader.d.mts +1 -2
  152. package/dist/components/ui/loader.mjs +1 -2
  153. package/dist/components/ui/navigation-menu.d.mts +1 -2
  154. package/dist/components/ui/navigation-menu.mjs +1 -2
  155. package/dist/components/ui/pagination.d.mts +1 -2
  156. package/dist/components/ui/pagination.mjs +1 -2
  157. package/dist/components/ui/popover.client.d.mts +1 -2
  158. package/dist/components/ui/popover.client.mjs +1 -2
  159. package/dist/components/ui/progress.client.d.mts +1 -2
  160. package/dist/components/ui/progress.client.mjs +1 -2
  161. package/dist/components/ui/radio-group.d.mts +1 -2
  162. package/dist/components/ui/radio-group.mjs +1 -2
  163. package/dist/components/ui/resizable.client.d.mts +1 -2
  164. package/dist/components/ui/resizable.client.mjs +1 -2
  165. package/dist/components/ui/scroll-area.d.mts +1 -2
  166. package/dist/components/ui/scroll-area.mjs +1 -2
  167. package/dist/components/ui/select.client.d.mts +1 -2
  168. package/dist/components/ui/select.client.mjs +1 -2
  169. package/dist/components/ui/separator.d.mts +1 -2
  170. package/dist/components/ui/separator.mjs +1 -2
  171. package/dist/components/ui/sheet.client.d.mts +1 -2
  172. package/dist/components/ui/sheet.client.mjs +1 -2
  173. package/dist/components/ui/sidebar.client.d.mts +1 -2
  174. package/dist/components/ui/sidebar.client.mjs +1 -2
  175. package/dist/components/ui/skeleton.d.mts +1 -2
  176. package/dist/components/ui/skeleton.mjs +1 -2
  177. package/dist/components/ui/slider.d.mts +1 -2
  178. package/dist/components/ui/slider.mjs +1 -2
  179. package/dist/components/ui/sonner.client.d.mts +1 -2
  180. package/dist/components/ui/sonner.client.mjs +1 -2
  181. package/dist/components/ui/spinner.d.mts +1 -2
  182. package/dist/components/ui/spinner.mjs +1 -2
  183. package/dist/components/ui/switch.client.d.mts +1 -2
  184. package/dist/components/ui/switch.client.mjs +1 -2
  185. package/dist/components/ui/tabs.client.d.mts +1 -2
  186. package/dist/components/ui/tabs.client.mjs +1 -2
  187. package/dist/components/ui/textarea.d.mts +1 -2
  188. package/dist/components/ui/textarea.mjs +1 -2
  189. package/dist/components/ui/toggle-group.client.d.mts +1 -2
  190. package/dist/components/ui/toggle-group.client.mjs +1 -2
  191. package/dist/components/ui/toggle.client.d.mts +1 -2
  192. package/dist/components/ui/toggle.client.mjs +1 -2
  193. package/dist/components/ui/tooltip.client.d.mts +1 -2
  194. package/dist/components/ui/tooltip.client.mjs +1 -2
  195. package/dist/lib/hooks/use-action.d.mts +1 -2
  196. package/dist/lib/hooks/use-action.mjs +1 -2
  197. package/dist/lib/hooks/use-indicator.d.mts +1 -2
  198. package/dist/lib/hooks/use-indicator.mjs +1 -2
  199. package/dist/lib/hooks/use-mobile.client.d.mts +1 -2
  200. package/dist/lib/hooks/use-mobile.client.mjs +1 -2
  201. package/dist/lib/types/config.d.mts +1 -2
  202. package/dist/lib/utils/array-move.d.mts +1 -2
  203. package/dist/lib/utils/array-move.mjs +1 -2
  204. package/dist/lib/utils/cn.d.mts +1 -2
  205. package/dist/lib/utils/cn.mjs +1 -2
  206. package/dist/lib/utils/fonts.d.mts +1 -2
  207. package/dist/lib/utils/fonts.mjs +1 -2
  208. package/dist/lib/utils/format.d.mts +1 -2
  209. package/dist/lib/utils/format.mjs +1 -2
  210. package/dist/lib/utils/manifest.d.mts +1 -2
  211. package/dist/lib/utils/manifest.mjs +1 -2
  212. package/dist/lib/utils/markdown.d.mts +1 -2
  213. package/dist/lib/utils/markdown.mjs +1 -2
  214. package/dist/lib/utils/url.d.mts +1 -2
  215. package/dist/lib/utils/url.mjs +1 -2
  216. package/dist/lib/utils/user-agent.mjs +1 -2
  217. package/dist/modules/auth/components/allowed.client.d.mts +1 -2
  218. package/dist/modules/auth/components/allowed.client.mjs +1 -2
  219. package/dist/modules/auth/components/auth-layout.server.d.mts +1 -2
  220. package/dist/modules/auth/components/auth-layout.server.mjs +1 -2
  221. package/dist/modules/auth/components/auth-loading.d.mts +1 -2
  222. package/dist/modules/auth/components/auth-loading.mjs +1 -2
  223. package/dist/modules/auth/components/create-first-user-guard.server.d.mts +1 -2
  224. package/dist/modules/auth/components/create-first-user-guard.server.mjs +1 -2
  225. package/dist/modules/auth/components/create-first-user-page.client.d.mts +1 -2
  226. package/dist/modules/auth/components/create-first-user-page.client.mjs +1 -2
  227. package/dist/modules/auth/components/forget-password-page.client.d.mts +1 -2
  228. package/dist/modules/auth/components/forget-password-page.client.mjs +1 -2
  229. package/dist/modules/auth/components/guard.server.d.mts +1 -2
  230. package/dist/modules/auth/components/guard.server.mjs +1 -2
  231. package/dist/modules/auth/components/login-page.client.d.mts +1 -2
  232. package/dist/modules/auth/components/login-page.client.mjs +1 -2
  233. package/dist/modules/auth/components/reset-password-page.client.d.mts +1 -2
  234. package/dist/modules/auth/components/reset-password-page.client.mjs +1 -2
  235. package/dist/modules/auth/components/update-password-command.d.mts +1 -2
  236. package/dist/modules/auth/components/update-password-command.mjs +1 -2
  237. package/dist/modules/auth/db/schema.d.mts +1 -2
  238. package/dist/modules/auth/db/schema.mjs +1 -2
  239. package/dist/modules/auth/handler/create-client.client.d.mts +903 -665
  240. package/dist/modules/auth/handler/create-client.client.mjs +1 -2
  241. package/dist/modules/auth/handler/proxy.server.d.mts +1 -2
  242. package/dist/modules/auth/handler/proxy.server.mjs +1 -2
  243. package/dist/modules/auth/handler/route.server.d.mts +1 -2
  244. package/dist/modules/auth/handler/route.server.mjs +1 -2
  245. package/dist/modules/auth/handler/service.server.d.mts +121 -94
  246. package/dist/modules/auth/handler/service.server.mjs +1 -2
  247. package/dist/modules/auth/hooks/use-auth-client.d.mts +1 -2
  248. package/dist/modules/auth/hooks/use-auth-client.mjs +1 -2
  249. package/dist/modules/auth/hooks/use-permission.d.mts +1 -2
  250. package/dist/modules/auth/hooks/use-permission.mjs +1 -2
  251. package/dist/modules/auth/hooks/use-session.d.mts +3 -4
  252. package/dist/modules/auth/hooks/use-session.mjs +1 -2
  253. package/dist/modules/auth/lib/helpers.server.d.mts +2 -3
  254. package/dist/modules/auth/lib/helpers.server.mjs +1 -2
  255. package/dist/modules/auth/lib/permissions.d.mts +1 -2
  256. package/dist/modules/auth/lib/permissions.mjs +1 -2
  257. package/dist/modules/auth/lib/validators.d.mts +1 -2
  258. package/dist/modules/auth/lib/validators.mjs +1 -2
  259. package/dist/modules/commands/components/alert-dialog-command.client.d.mts +1 -2
  260. package/dist/modules/commands/components/alert-dialog-command.client.mjs +1 -2
  261. package/dist/modules/commands/components/click-command.client.d.mts +1 -2
  262. package/dist/modules/commands/components/click-command.client.mjs +1 -2
  263. package/dist/modules/commands/components/command-trigger.client.d.mts +1 -2
  264. package/dist/modules/commands/components/command-trigger.client.mjs +1 -2
  265. package/dist/modules/commands/components/dialog-command.client.d.mts +1 -2
  266. package/dist/modules/commands/components/dialog-command.client.mjs +1 -2
  267. package/dist/modules/commands/components/dropdown-command.client.d.mts +1 -2
  268. package/dist/modules/commands/components/dropdown-command.client.mjs +1 -2
  269. package/dist/modules/commands/components/empty-command.client.d.mts +1 -2
  270. package/dist/modules/commands/components/empty-command.client.mjs +1 -2
  271. package/dist/modules/commands/components/form-dialog-command.client.d.mts +1 -2
  272. package/dist/modules/commands/components/form-dialog-command.client.mjs +1 -2
  273. package/dist/modules/commands/components/render-command.mjs +1 -2
  274. package/dist/modules/commands/hooks/context.client.mjs +1 -2
  275. package/dist/modules/commands/hooks/use-command-menu.client.d.mts +1 -2
  276. package/dist/modules/commands/hooks/use-command-menu.client.mjs +1 -2
  277. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +1 -2
  278. package/dist/modules/commands/hooks/use-command-mutation.client.mjs +1 -2
  279. package/dist/modules/commands/lib/definitions.d.mts +1 -2
  280. package/dist/modules/commands/lib/factory.d.mts +1 -2
  281. package/dist/modules/commands/lib/factory.mjs +1 -2
  282. package/dist/modules/commands/menus/context-menu.client.d.mts +1 -2
  283. package/dist/modules/commands/menus/context-menu.client.mjs +1 -2
  284. package/dist/modules/commands/menus/dropdown-menu.client.d.mts +1 -2
  285. package/dist/modules/commands/menus/dropdown-menu.client.mjs +1 -2
  286. package/dist/modules/commands/menus/floating-menu.client.d.mts +1 -2
  287. package/dist/modules/commands/menus/floating-menu.client.mjs +1 -2
  288. package/dist/modules/commands/menus/inline-menu.client.d.mts +1 -2
  289. package/dist/modules/commands/menus/inline-menu.client.mjs +1 -2
  290. package/dist/modules/commands/menus/responsive-menu.client.d.mts +1 -2
  291. package/dist/modules/commands/menus/responsive-menu.client.mjs +1 -2
  292. package/dist/modules/commands/utils/archive-command.client.d.mts +1 -2
  293. package/dist/modules/commands/utils/archive-command.client.mjs +1 -2
  294. package/dist/modules/commands/utils/delete-command.client.d.mts +1 -2
  295. package/dist/modules/commands/utils/delete-command.client.mjs +1 -2
  296. package/dist/modules/config/lib/config.d.mts +1 -2
  297. package/dist/modules/config/lib/config.mjs +1 -2
  298. package/dist/modules/config/lib/context.d.mts +1 -2
  299. package/dist/modules/config/lib/context.mjs +1 -2
  300. package/dist/modules/config/paths/helpers.d.mts +1 -2
  301. package/dist/modules/config/paths/helpers.mjs +1 -2
  302. package/dist/modules/config/paths/types.d.mts +1 -2
  303. package/dist/modules/data-tables/components/cell/common.client.d.mts +1 -2
  304. package/dist/modules/data-tables/components/cell/common.client.mjs +1 -2
  305. package/dist/modules/data-tables/components/cell/index.client.d.mts +1 -2
  306. package/dist/modules/data-tables/components/cell/index.client.mjs +1 -2
  307. package/dist/modules/data-tables/components/cell/select.client.d.mts +1 -2
  308. package/dist/modules/data-tables/components/cell/select.client.mjs +1 -2
  309. package/dist/modules/data-tables/components/column-header.d.mts +1 -2
  310. package/dist/modules/data-tables/components/column-header.mjs +1 -2
  311. package/dist/modules/data-tables/components/filters/combobox.client.d.mts +1 -2
  312. package/dist/modules/data-tables/components/filters/combobox.client.mjs +1 -2
  313. package/dist/modules/data-tables/components/filters/slider.client.d.mts +1 -2
  314. package/dist/modules/data-tables/components/filters/slider.client.mjs +1 -2
  315. package/dist/modules/data-tables/components/footer.mjs +1 -2
  316. package/dist/modules/data-tables/components/header.d.mts +1 -2
  317. package/dist/modules/data-tables/components/header.mjs +1 -2
  318. package/dist/modules/data-tables/components/layout.d.mts +1 -2
  319. package/dist/modules/data-tables/components/layout.mjs +1 -2
  320. package/dist/modules/data-tables/components/search-input.client.d.mts +1 -2
  321. package/dist/modules/data-tables/components/search-input.client.mjs +1 -2
  322. package/dist/modules/data-tables/components/skeleton.d.mts +1 -2
  323. package/dist/modules/data-tables/components/skeleton.mjs +1 -2
  324. package/dist/modules/data-tables/components/table.d.mts +1 -2
  325. package/dist/modules/data-tables/components/table.mjs +1 -2
  326. package/dist/modules/data-tables/components/toolbar.d.mts +1 -2
  327. package/dist/modules/data-tables/components/toolbar.mjs +1 -2
  328. package/dist/modules/data-tables/hooks/use-context.client.d.mts +1 -2
  329. package/dist/modules/data-tables/hooks/use-context.client.mjs +1 -2
  330. package/dist/modules/data-tables/hooks/use-search.client.mjs +1 -2
  331. package/dist/modules/data-tables/hooks/use-selection.client.mjs +1 -2
  332. package/dist/modules/data-tables/hooks/use-table.client.d.mts +1 -2
  333. package/dist/modules/data-tables/hooks/use-table.client.mjs +1 -2
  334. package/dist/modules/data-tables/lib/converters/cursor.d.mts +1 -2
  335. package/dist/modules/data-tables/lib/converters/cursor.mjs +1 -2
  336. package/dist/modules/data-tables/lib/converters/dto.d.mts +1 -2
  337. package/dist/modules/data-tables/lib/converters/dto.mjs +1 -2
  338. package/dist/modules/data-tables/lib/converters/filter.d.mts +1 -2
  339. package/dist/modules/data-tables/lib/converters/filter.mjs +1 -2
  340. package/dist/modules/data-tables/lib/converters/search.d.mts +1 -2
  341. package/dist/modules/data-tables/lib/converters/search.mjs +1 -2
  342. package/dist/modules/data-tables/lib/converters/sorting.d.mts +1 -2
  343. package/dist/modules/data-tables/lib/converters/sorting.mjs +1 -2
  344. package/dist/modules/data-tables/lib/filters/config.d.mts +1 -2
  345. package/dist/modules/data-tables/lib/filters/config.mjs +1 -2
  346. package/dist/modules/data-tables/lib/filters/helpers.d.mts +1 -2
  347. package/dist/modules/data-tables/lib/filters/helpers.mjs +1 -2
  348. package/dist/modules/data-tables/lib/filters/parsers.d.mts +1 -2
  349. package/dist/modules/data-tables/lib/filters/parsers.mjs +1 -2
  350. package/dist/modules/data-tables/lib/filters/resolvers.d.mts +1 -2
  351. package/dist/modules/data-tables/lib/filters/resolvers.mjs +1 -2
  352. package/dist/modules/data-tables/lib/helpers/create-column.mjs +1 -2
  353. package/dist/modules/data-tables/lib/search-params.d.mts +1 -2
  354. package/dist/modules/data-tables/lib/search-params.mjs +1 -2
  355. package/dist/modules/data-tables/lib/types.d.mts +1 -2
  356. package/dist/modules/data-tables/lib/validators.d.mts +1 -2
  357. package/dist/modules/data-tables/lib/validators.mjs +1 -2
  358. package/dist/modules/data-tables/server/get-data.server.d.mts +2 -3
  359. package/dist/modules/data-tables/server/get-data.server.mjs +1 -2
  360. package/dist/modules/data-tables/strategies/helpers/sorting.mjs +1 -2
  361. package/dist/modules/data-tables/strategies/infinite/components.mjs +1 -2
  362. package/dist/modules/data-tables/strategies/infinite/strategy.d.mts +1 -2
  363. package/dist/modules/data-tables/strategies/infinite/strategy.mjs +1 -2
  364. package/dist/modules/data-tables/strategies/pagination/components.mjs +1 -2
  365. package/dist/modules/data-tables/strategies/pagination/strategy.d.mts +1 -2
  366. package/dist/modules/data-tables/strategies/pagination/strategy.mjs +1 -2
  367. package/dist/modules/data-tables/tables/data-table/components/body.mjs +1 -2
  368. package/dist/modules/data-tables/tables/data-table/components/header.mjs +1 -2
  369. package/dist/modules/data-tables/tables/data-table/components/row.mjs +1 -2
  370. package/dist/modules/data-tables/tables/data-table/components/table.d.mts +1 -2
  371. package/dist/modules/data-tables/tables/data-table/components/table.mjs +1 -2
  372. package/dist/modules/data-tables/tables/inline-table/components/body.mjs +1 -2
  373. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +1 -2
  374. package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs +1 -2
  375. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +1 -2
  376. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs +1 -2
  377. package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.d.mts +1 -2
  378. package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs +1 -2
  379. package/dist/modules/data-tables/tables/inline-table/components/header.mjs +1 -2
  380. package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs +1 -2
  381. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +1 -2
  382. package/dist/modules/data-tables/tables/inline-table/components/table.mjs +1 -2
  383. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +1 -2
  384. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs +1 -2
  385. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts +2 -3
  386. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs +1 -2
  387. package/dist/modules/database/lib/helpers.d.mts +1 -2
  388. package/dist/modules/database/lib/helpers.mjs +1 -2
  389. package/dist/modules/database/lib/service.server.d.mts +1 -2
  390. package/dist/modules/database/lib/service.server.mjs +1 -2
  391. package/dist/modules/database/lib/types.d.mts +1 -2
  392. package/dist/modules/emails/lib/service.server.d.mts +1 -2
  393. package/dist/modules/emails/lib/service.server.mjs +1 -2
  394. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +1 -2
  395. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs +1 -2
  396. package/dist/modules/inline-edit/components/combobox.client.d.mts +1 -2
  397. package/dist/modules/inline-edit/components/combobox.client.mjs +1 -2
  398. package/dist/modules/inline-edit/components/date-input.client.d.mts +1 -2
  399. package/dist/modules/inline-edit/components/date-input.client.mjs +1 -2
  400. package/dist/modules/inline-edit/components/date-picker.client.d.mts +1 -2
  401. package/dist/modules/inline-edit/components/date-picker.client.mjs +1 -2
  402. package/dist/modules/inline-edit/components/date-time.client.d.mts +1 -2
  403. package/dist/modules/inline-edit/components/date-time.client.mjs +1 -2
  404. package/dist/modules/inline-edit/components/editor.client.d.mts +1 -2
  405. package/dist/modules/inline-edit/components/editor.client.mjs +1 -2
  406. package/dist/modules/inline-edit/components/input-recipient.client.d.mts +1 -2
  407. package/dist/modules/inline-edit/components/input-recipient.client.mjs +1 -2
  408. package/dist/modules/inline-edit/components/input-toggle.client.d.mts +1 -2
  409. package/dist/modules/inline-edit/components/input-toggle.client.mjs +1 -2
  410. package/dist/modules/inline-edit/components/input.client.d.mts +1 -2
  411. package/dist/modules/inline-edit/components/input.client.mjs +1 -2
  412. package/dist/modules/inline-edit/components/select.client.d.mts +1 -2
  413. package/dist/modules/inline-edit/components/select.client.mjs +1 -2
  414. package/dist/modules/inline-edit/components/switch.client.d.mts +1 -2
  415. package/dist/modules/inline-edit/components/switch.client.mjs +1 -2
  416. package/dist/modules/inline-edit/components/toggle.client.d.mts +1 -2
  417. package/dist/modules/inline-edit/components/toggle.client.mjs +1 -2
  418. package/dist/modules/inline-edit/hooks/context.client.d.mts +1 -2
  419. package/dist/modules/inline-edit/hooks/context.client.mjs +1 -2
  420. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +1 -2
  421. package/dist/modules/inline-edit/hooks/use-inline.client.mjs +1 -2
  422. package/dist/modules/inline-edit/lib/validators.d.mts +1 -2
  423. package/dist/modules/inline-edit/lib/validators.mjs +1 -2
  424. package/dist/modules/inline-edit/lib/variants.d.mts +2 -3
  425. package/dist/modules/inline-edit/lib/variants.mjs +1 -2
  426. package/dist/modules/router/handler/caller.client.d.mts +1 -2
  427. package/dist/modules/router/handler/caller.client.mjs +1 -2
  428. package/dist/modules/router/handler/caller.server.d.mts +1 -2
  429. package/dist/modules/router/handler/caller.server.mjs +1 -2
  430. package/dist/modules/router/handler/context.server.d.mts +2 -3
  431. package/dist/modules/router/handler/context.server.mjs +1 -2
  432. package/dist/modules/router/handler/init.server.d.mts +3 -31
  433. package/dist/modules/router/handler/init.server.mjs +8 -6
  434. package/dist/modules/router/handler/register.server.d.mts +1 -2
  435. package/dist/modules/router/handler/register.server.mjs +1 -2
  436. package/dist/modules/router/handler/route.server.d.mts +2 -3
  437. package/dist/modules/router/handler/route.server.mjs +1 -2
  438. package/dist/modules/router/lib/helpers.mjs +1 -2
  439. package/dist/modules/router/lib/query-client.d.mts +1 -2
  440. package/dist/modules/router/lib/query-client.mjs +1 -2
  441. package/dist/modules/router/lib/query-client.server.d.mts +1 -2
  442. package/dist/modules/router/lib/query-client.server.mjs +1 -2
  443. package/dist/modules/router/lib/validators.d.mts +1 -2
  444. package/dist/modules/router/lib/validators.mjs +1 -2
  445. package/dist/modules/storage/components/dropzone-context.client.d.mts +1 -2
  446. package/dist/modules/storage/components/dropzone-context.client.mjs +1 -2
  447. package/dist/modules/storage/components/dropzone.client.d.mts +3 -4
  448. package/dist/modules/storage/components/dropzone.client.mjs +1 -2
  449. package/dist/modules/storage/components/image-grid.client.d.mts +1 -2
  450. package/dist/modules/storage/components/image-grid.client.mjs +1 -2
  451. package/dist/modules/storage/components/image.client.d.mts +1 -2
  452. package/dist/modules/storage/components/image.client.mjs +1 -2
  453. package/dist/modules/storage/components/upload-button.client.d.mts +1 -2
  454. package/dist/modules/storage/components/upload-button.client.mjs +1 -2
  455. package/dist/modules/storage/components/upload-zone-context.client.d.mts +1 -2
  456. package/dist/modules/storage/components/upload-zone-context.client.mjs +1 -2
  457. package/dist/modules/storage/components/upload-zone.client.d.mts +1 -2
  458. package/dist/modules/storage/components/upload-zone.client.mjs +1 -2
  459. package/dist/modules/storage/lib/constants.d.mts +1 -2
  460. package/dist/modules/storage/lib/constants.mjs +1 -2
  461. package/dist/modules/storage/lib/helpers.d.mts +1 -2
  462. package/dist/modules/storage/lib/helpers.mjs +1 -2
  463. package/dist/modules/storage/lib/procedures.server.d.mts +10 -11
  464. package/dist/modules/storage/lib/procedures.server.mjs +1 -2
  465. package/dist/modules/storage/lib/router-handlers.server.d.mts +2 -3
  466. package/dist/modules/storage/lib/router-handlers.server.mjs +1 -2
  467. package/dist/modules/storage/lib/schema.d.mts +2 -3
  468. package/dist/modules/storage/lib/schema.mjs +1 -2
  469. package/dist/modules/storage/lib/service.server.d.mts +31 -32
  470. package/dist/modules/storage/lib/service.server.mjs +1 -2
  471. package/dist/modules/storage/lib/upload.client.d.mts +1 -2
  472. package/dist/modules/storage/lib/upload.client.mjs +1 -2
  473. package/dist/modules/storage/lib/validators.d.mts +5 -6
  474. package/dist/modules/storage/lib/validators.mjs +1 -2
  475. package/dist/modules/storage/providers/adapters/s3.server.d.mts +1 -2
  476. package/dist/modules/storage/providers/adapters/s3.server.mjs +1 -2
  477. package/dist/modules/storage/providers/lib/constants.d.mts +1 -2
  478. package/dist/modules/storage/providers/lib/constants.mjs +1 -2
  479. package/dist/modules/storage/providers/lib/errors.d.mts +1 -2
  480. package/dist/modules/storage/providers/lib/errors.mjs +1 -2
  481. package/dist/modules/storage/providers/lib/types.d.mts +1 -2
  482. package/dist/modules/storage/providers/lib/validators.d.mts +1 -2
  483. package/dist/modules/storage/providers/lib/validators.mjs +1 -2
  484. package/package.json +66 -63
  485. package/src/components/emails/forget-password-email.tsx +1 -1
  486. package/src/modules/auth/lib/helpers.server.ts +1 -1
  487. package/src/modules/data-tables/server/get-data.server.ts +1 -1
  488. package/src/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.ts +1 -2
  489. package/src/modules/router/handler/context.server.ts +1 -1
  490. package/src/modules/router/handler/init.server.ts +2 -1
  491. package/src/modules/router/handler/route.server.ts +1 -1
  492. package/src/modules/storage/lib/procedures.server.ts +1 -1
  493. package/src/modules/storage/lib/router-handlers.server.ts +1 -1
  494. package/dist/components/common/icons.d.mts.map +0 -1
  495. package/dist/components/common/icons.mjs.map +0 -1
  496. package/dist/components/common/status.d.mts.map +0 -1
  497. package/dist/components/common/status.mjs.map +0 -1
  498. package/dist/components/editor/components/content.client.d.mts.map +0 -1
  499. package/dist/components/editor/components/content.client.mjs.map +0 -1
  500. package/dist/components/editor/components/editor.client.d.mts.map +0 -1
  501. package/dist/components/editor/components/editor.client.mjs.map +0 -1
  502. package/dist/components/editor/components/menu-nodes.client.mjs.map +0 -1
  503. package/dist/components/editor/components/menu.client.d.mts.map +0 -1
  504. package/dist/components/editor/components/menu.client.mjs.map +0 -1
  505. package/dist/components/editor/extensions/file-handler/extension.d.mts.map +0 -1
  506. package/dist/components/editor/extensions/file-handler/extension.mjs.map +0 -1
  507. package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +0 -1
  508. package/dist/components/editor/extensions/file-handler/strategy.mjs.map +0 -1
  509. package/dist/components/editor/extensions/file-handler/utils.mjs.map +0 -1
  510. package/dist/components/editor/extensions/image/extension.d.mts.map +0 -1
  511. package/dist/components/editor/extensions/image/extension.mjs.map +0 -1
  512. package/dist/components/editor/extensions/skeleton/extension.mjs.map +0 -1
  513. package/dist/components/editor/extensions/skeleton/renderer.mjs.map +0 -1
  514. package/dist/components/editor/lib/constants.d.mts.map +0 -1
  515. package/dist/components/editor/lib/constants.mjs.map +0 -1
  516. package/dist/components/editor/lib/extensions.d.mts.map +0 -1
  517. package/dist/components/editor/lib/extensions.mjs.map +0 -1
  518. package/dist/components/editor/lib/helpers.d.mts.map +0 -1
  519. package/dist/components/editor/lib/helpers.mjs.map +0 -1
  520. package/dist/components/editor/lib/types.d.mts.map +0 -1
  521. package/dist/components/editor/lib/variants.mjs.map +0 -1
  522. package/dist/components/emails/forget-password-email.mjs.map +0 -1
  523. package/dist/components/header/back-button.client.d.mts.map +0 -1
  524. package/dist/components/header/back-button.client.mjs.map +0 -1
  525. package/dist/components/header/bottom-bar.client.d.mts.map +0 -1
  526. package/dist/components/header/bottom-bar.client.mjs.map +0 -1
  527. package/dist/components/header/breadcrumbs.client.d.mts.map +0 -1
  528. package/dist/components/header/breadcrumbs.client.mjs.map +0 -1
  529. package/dist/components/header/header.client.d.mts.map +0 -1
  530. package/dist/components/header/header.client.mjs.map +0 -1
  531. package/dist/components/header/indicator.client.mjs.map +0 -1
  532. package/dist/components/header/mobile-nav-switcher.client.d.mts.map +0 -1
  533. package/dist/components/header/mobile-nav-switcher.client.mjs.map +0 -1
  534. package/dist/components/header/top-bar.client.d.mts.map +0 -1
  535. package/dist/components/header/top-bar.client.mjs.map +0 -1
  536. package/dist/components/layouts/admin-content.client.d.mts.map +0 -1
  537. package/dist/components/layouts/admin-content.client.mjs.map +0 -1
  538. package/dist/components/layouts/admin-error-pages.d.mts.map +0 -1
  539. package/dist/components/layouts/admin-error-pages.mjs.map +0 -1
  540. package/dist/components/layouts/admin-layout.d.mts.map +0 -1
  541. package/dist/components/layouts/admin-layout.mjs.map +0 -1
  542. package/dist/components/layouts/admin-loading.d.mts.map +0 -1
  543. package/dist/components/layouts/admin-loading.mjs.map +0 -1
  544. package/dist/components/layouts/empty-page.d.mts.map +0 -1
  545. package/dist/components/layouts/empty-page.mjs.map +0 -1
  546. package/dist/components/layouts/error-page.d.mts.map +0 -1
  547. package/dist/components/layouts/error-page.mjs.map +0 -1
  548. package/dist/components/layouts/error-sections.d.mts.map +0 -1
  549. package/dist/components/layouts/error-sections.mjs.map +0 -1
  550. package/dist/components/layouts/list-layout.d.mts.map +0 -1
  551. package/dist/components/layouts/list-layout.mjs.map +0 -1
  552. package/dist/components/layouts/providers.client.d.mts.map +0 -1
  553. package/dist/components/layouts/providers.client.mjs.map +0 -1
  554. package/dist/components/layouts/root-error-pages.d.mts.map +0 -1
  555. package/dist/components/layouts/root-error-pages.mjs.map +0 -1
  556. package/dist/components/layouts/root-layout.server.d.mts.map +0 -1
  557. package/dist/components/layouts/root-layout.server.mjs.map +0 -1
  558. package/dist/components/layouts/root-loading.d.mts.map +0 -1
  559. package/dist/components/layouts/root-loading.mjs.map +0 -1
  560. package/dist/components/layouts/tab-layout.d.mts.map +0 -1
  561. package/dist/components/layouts/tab-layout.mjs.map +0 -1
  562. package/dist/components/lists/data-list.d.mts.map +0 -1
  563. package/dist/components/lists/data-list.mjs.map +0 -1
  564. package/dist/components/lists/data-stack.d.mts.map +0 -1
  565. package/dist/components/lists/data-stack.mjs.map +0 -1
  566. package/dist/components/navigation/admin-sidebar-header.client.mjs.map +0 -1
  567. package/dist/components/navigation/admin-sidebar-paths.client.d.mts.map +0 -1
  568. package/dist/components/navigation/admin-sidebar-paths.client.mjs.map +0 -1
  569. package/dist/components/navigation/admin-sidebar-skeleton.mjs.map +0 -1
  570. package/dist/components/ui/accordion.client.d.mts.map +0 -1
  571. package/dist/components/ui/accordion.client.mjs.map +0 -1
  572. package/dist/components/ui/alert-dialog.client.d.mts.map +0 -1
  573. package/dist/components/ui/alert-dialog.client.mjs.map +0 -1
  574. package/dist/components/ui/alert.d.mts.map +0 -1
  575. package/dist/components/ui/alert.mjs.map +0 -1
  576. package/dist/components/ui/aspect-ratio.client.d.mts.map +0 -1
  577. package/dist/components/ui/aspect-ratio.client.mjs.map +0 -1
  578. package/dist/components/ui/avatar.client.d.mts.map +0 -1
  579. package/dist/components/ui/avatar.client.mjs.map +0 -1
  580. package/dist/components/ui/badge.d.mts.map +0 -1
  581. package/dist/components/ui/badge.mjs.map +0 -1
  582. package/dist/components/ui/breadcrumb.d.mts.map +0 -1
  583. package/dist/components/ui/breadcrumb.mjs.map +0 -1
  584. package/dist/components/ui/button-group.d.mts.map +0 -1
  585. package/dist/components/ui/button-group.mjs.map +0 -1
  586. package/dist/components/ui/button.d.mts.map +0 -1
  587. package/dist/components/ui/button.mjs.map +0 -1
  588. package/dist/components/ui/calendar.client.d.mts.map +0 -1
  589. package/dist/components/ui/calendar.client.mjs.map +0 -1
  590. package/dist/components/ui/card.d.mts.map +0 -1
  591. package/dist/components/ui/card.mjs.map +0 -1
  592. package/dist/components/ui/carousel.client.d.mts.map +0 -1
  593. package/dist/components/ui/carousel.client.mjs.map +0 -1
  594. package/dist/components/ui/chart.client.d.mts.map +0 -1
  595. package/dist/components/ui/chart.client.mjs.map +0 -1
  596. package/dist/components/ui/checkbox.client.d.mts.map +0 -1
  597. package/dist/components/ui/checkbox.client.mjs.map +0 -1
  598. package/dist/components/ui/collapsible.client.d.mts.map +0 -1
  599. package/dist/components/ui/collapsible.client.mjs.map +0 -1
  600. package/dist/components/ui/color-picker.client.d.mts.map +0 -1
  601. package/dist/components/ui/color-picker.client.mjs.map +0 -1
  602. package/dist/components/ui/combobox-dropdown.client.d.mts.map +0 -1
  603. package/dist/components/ui/combobox-dropdown.client.mjs.map +0 -1
  604. package/dist/components/ui/combobox.client.d.mts.map +0 -1
  605. package/dist/components/ui/combobox.client.mjs.map +0 -1
  606. package/dist/components/ui/command.client.d.mts.map +0 -1
  607. package/dist/components/ui/command.client.mjs.map +0 -1
  608. package/dist/components/ui/context-menu.client.d.mts.map +0 -1
  609. package/dist/components/ui/context-menu.client.mjs.map +0 -1
  610. package/dist/components/ui/date-picker.client.d.mts.map +0 -1
  611. package/dist/components/ui/date-picker.client.mjs.map +0 -1
  612. package/dist/components/ui/dialog.client.d.mts.map +0 -1
  613. package/dist/components/ui/dialog.client.mjs.map +0 -1
  614. package/dist/components/ui/drawer.client.d.mts.map +0 -1
  615. package/dist/components/ui/drawer.client.mjs.map +0 -1
  616. package/dist/components/ui/dropdown-menu.client.d.mts.map +0 -1
  617. package/dist/components/ui/dropdown-menu.client.mjs.map +0 -1
  618. package/dist/components/ui/empty.d.mts.map +0 -1
  619. package/dist/components/ui/empty.mjs.map +0 -1
  620. package/dist/components/ui/field.client.d.mts.map +0 -1
  621. package/dist/components/ui/field.client.mjs.map +0 -1
  622. package/dist/components/ui/form.client.d.mts.map +0 -1
  623. package/dist/components/ui/form.client.mjs.map +0 -1
  624. package/dist/components/ui/hover-card.client.d.mts.map +0 -1
  625. package/dist/components/ui/hover-card.client.mjs.map +0 -1
  626. package/dist/components/ui/input-date-time.client.d.mts.map +0 -1
  627. package/dist/components/ui/input-date-time.client.mjs.map +0 -1
  628. package/dist/components/ui/input-date.d.mts.map +0 -1
  629. package/dist/components/ui/input-date.mjs.map +0 -1
  630. package/dist/components/ui/input-group.client.d.mts.map +0 -1
  631. package/dist/components/ui/input-group.client.mjs.map +0 -1
  632. package/dist/components/ui/input-recipient.d.mts.map +0 -1
  633. package/dist/components/ui/input-recipient.mjs.map +0 -1
  634. package/dist/components/ui/input-time.d.mts.map +0 -1
  635. package/dist/components/ui/input-time.mjs.map +0 -1
  636. package/dist/components/ui/input.d.mts.map +0 -1
  637. package/dist/components/ui/input.mjs.map +0 -1
  638. package/dist/components/ui/item.d.mts.map +0 -1
  639. package/dist/components/ui/item.mjs.map +0 -1
  640. package/dist/components/ui/kbd.d.mts.map +0 -1
  641. package/dist/components/ui/kbd.mjs.map +0 -1
  642. package/dist/components/ui/label.d.mts.map +0 -1
  643. package/dist/components/ui/label.mjs.map +0 -1
  644. package/dist/components/ui/loader.d.mts.map +0 -1
  645. package/dist/components/ui/loader.mjs.map +0 -1
  646. package/dist/components/ui/navigation-menu.d.mts.map +0 -1
  647. package/dist/components/ui/navigation-menu.mjs.map +0 -1
  648. package/dist/components/ui/pagination.d.mts.map +0 -1
  649. package/dist/components/ui/pagination.mjs.map +0 -1
  650. package/dist/components/ui/popover.client.d.mts.map +0 -1
  651. package/dist/components/ui/popover.client.mjs.map +0 -1
  652. package/dist/components/ui/progress.client.d.mts.map +0 -1
  653. package/dist/components/ui/progress.client.mjs.map +0 -1
  654. package/dist/components/ui/radio-group.d.mts.map +0 -1
  655. package/dist/components/ui/radio-group.mjs.map +0 -1
  656. package/dist/components/ui/resizable.client.d.mts.map +0 -1
  657. package/dist/components/ui/resizable.client.mjs.map +0 -1
  658. package/dist/components/ui/scroll-area.d.mts.map +0 -1
  659. package/dist/components/ui/scroll-area.mjs.map +0 -1
  660. package/dist/components/ui/select.client.d.mts.map +0 -1
  661. package/dist/components/ui/select.client.mjs.map +0 -1
  662. package/dist/components/ui/separator.d.mts.map +0 -1
  663. package/dist/components/ui/separator.mjs.map +0 -1
  664. package/dist/components/ui/sheet.client.d.mts.map +0 -1
  665. package/dist/components/ui/sheet.client.mjs.map +0 -1
  666. package/dist/components/ui/sidebar.client.d.mts.map +0 -1
  667. package/dist/components/ui/sidebar.client.mjs.map +0 -1
  668. package/dist/components/ui/skeleton.d.mts.map +0 -1
  669. package/dist/components/ui/skeleton.mjs.map +0 -1
  670. package/dist/components/ui/slider.d.mts.map +0 -1
  671. package/dist/components/ui/slider.mjs.map +0 -1
  672. package/dist/components/ui/sonner.client.d.mts.map +0 -1
  673. package/dist/components/ui/sonner.client.mjs.map +0 -1
  674. package/dist/components/ui/spinner.d.mts.map +0 -1
  675. package/dist/components/ui/spinner.mjs.map +0 -1
  676. package/dist/components/ui/switch.client.d.mts.map +0 -1
  677. package/dist/components/ui/switch.client.mjs.map +0 -1
  678. package/dist/components/ui/tabs.client.d.mts.map +0 -1
  679. package/dist/components/ui/tabs.client.mjs.map +0 -1
  680. package/dist/components/ui/textarea.d.mts.map +0 -1
  681. package/dist/components/ui/textarea.mjs.map +0 -1
  682. package/dist/components/ui/toggle-group.client.d.mts.map +0 -1
  683. package/dist/components/ui/toggle-group.client.mjs.map +0 -1
  684. package/dist/components/ui/toggle.client.d.mts.map +0 -1
  685. package/dist/components/ui/toggle.client.mjs.map +0 -1
  686. package/dist/components/ui/tooltip.client.d.mts.map +0 -1
  687. package/dist/components/ui/tooltip.client.mjs.map +0 -1
  688. package/dist/lib/hooks/use-action.d.mts.map +0 -1
  689. package/dist/lib/hooks/use-action.mjs.map +0 -1
  690. package/dist/lib/hooks/use-indicator.d.mts.map +0 -1
  691. package/dist/lib/hooks/use-indicator.mjs.map +0 -1
  692. package/dist/lib/hooks/use-mobile.client.d.mts.map +0 -1
  693. package/dist/lib/hooks/use-mobile.client.mjs.map +0 -1
  694. package/dist/lib/types/config.d.mts.map +0 -1
  695. package/dist/lib/utils/array-move.d.mts.map +0 -1
  696. package/dist/lib/utils/array-move.mjs.map +0 -1
  697. package/dist/lib/utils/cn.d.mts.map +0 -1
  698. package/dist/lib/utils/cn.mjs.map +0 -1
  699. package/dist/lib/utils/fonts.d.mts.map +0 -1
  700. package/dist/lib/utils/fonts.mjs.map +0 -1
  701. package/dist/lib/utils/format.d.mts.map +0 -1
  702. package/dist/lib/utils/format.mjs.map +0 -1
  703. package/dist/lib/utils/manifest.d.mts.map +0 -1
  704. package/dist/lib/utils/manifest.mjs.map +0 -1
  705. package/dist/lib/utils/markdown.d.mts.map +0 -1
  706. package/dist/lib/utils/markdown.mjs.map +0 -1
  707. package/dist/lib/utils/url.d.mts.map +0 -1
  708. package/dist/lib/utils/url.mjs.map +0 -1
  709. package/dist/lib/utils/user-agent.mjs.map +0 -1
  710. package/dist/modules/auth/components/allowed.client.d.mts.map +0 -1
  711. package/dist/modules/auth/components/allowed.client.mjs.map +0 -1
  712. package/dist/modules/auth/components/auth-layout.server.d.mts.map +0 -1
  713. package/dist/modules/auth/components/auth-layout.server.mjs.map +0 -1
  714. package/dist/modules/auth/components/auth-loading.d.mts.map +0 -1
  715. package/dist/modules/auth/components/auth-loading.mjs.map +0 -1
  716. package/dist/modules/auth/components/create-first-user-guard.server.d.mts.map +0 -1
  717. package/dist/modules/auth/components/create-first-user-guard.server.mjs.map +0 -1
  718. package/dist/modules/auth/components/create-first-user-page.client.d.mts.map +0 -1
  719. package/dist/modules/auth/components/create-first-user-page.client.mjs.map +0 -1
  720. package/dist/modules/auth/components/forget-password-page.client.d.mts.map +0 -1
  721. package/dist/modules/auth/components/forget-password-page.client.mjs.map +0 -1
  722. package/dist/modules/auth/components/guard.server.d.mts.map +0 -1
  723. package/dist/modules/auth/components/guard.server.mjs.map +0 -1
  724. package/dist/modules/auth/components/login-page.client.d.mts.map +0 -1
  725. package/dist/modules/auth/components/login-page.client.mjs.map +0 -1
  726. package/dist/modules/auth/components/reset-password-page.client.d.mts.map +0 -1
  727. package/dist/modules/auth/components/reset-password-page.client.mjs.map +0 -1
  728. package/dist/modules/auth/components/update-password-command.d.mts.map +0 -1
  729. package/dist/modules/auth/components/update-password-command.mjs.map +0 -1
  730. package/dist/modules/auth/db/schema.d.mts.map +0 -1
  731. package/dist/modules/auth/db/schema.mjs.map +0 -1
  732. package/dist/modules/auth/handler/create-client.client.d.mts.map +0 -1
  733. package/dist/modules/auth/handler/create-client.client.mjs.map +0 -1
  734. package/dist/modules/auth/handler/proxy.server.d.mts.map +0 -1
  735. package/dist/modules/auth/handler/proxy.server.mjs.map +0 -1
  736. package/dist/modules/auth/handler/route.server.d.mts.map +0 -1
  737. package/dist/modules/auth/handler/route.server.mjs.map +0 -1
  738. package/dist/modules/auth/handler/service.server.d.mts.map +0 -1
  739. package/dist/modules/auth/handler/service.server.mjs.map +0 -1
  740. package/dist/modules/auth/hooks/use-auth-client.d.mts.map +0 -1
  741. package/dist/modules/auth/hooks/use-auth-client.mjs.map +0 -1
  742. package/dist/modules/auth/hooks/use-permission.d.mts.map +0 -1
  743. package/dist/modules/auth/hooks/use-permission.mjs.map +0 -1
  744. package/dist/modules/auth/hooks/use-session.d.mts.map +0 -1
  745. package/dist/modules/auth/hooks/use-session.mjs.map +0 -1
  746. package/dist/modules/auth/lib/helpers.server.d.mts.map +0 -1
  747. package/dist/modules/auth/lib/helpers.server.mjs.map +0 -1
  748. package/dist/modules/auth/lib/permissions.d.mts.map +0 -1
  749. package/dist/modules/auth/lib/permissions.mjs.map +0 -1
  750. package/dist/modules/auth/lib/validators.d.mts.map +0 -1
  751. package/dist/modules/auth/lib/validators.mjs.map +0 -1
  752. package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +0 -1
  753. package/dist/modules/commands/components/alert-dialog-command.client.mjs.map +0 -1
  754. package/dist/modules/commands/components/click-command.client.d.mts.map +0 -1
  755. package/dist/modules/commands/components/click-command.client.mjs.map +0 -1
  756. package/dist/modules/commands/components/command-trigger.client.d.mts.map +0 -1
  757. package/dist/modules/commands/components/command-trigger.client.mjs.map +0 -1
  758. package/dist/modules/commands/components/dialog-command.client.d.mts.map +0 -1
  759. package/dist/modules/commands/components/dialog-command.client.mjs.map +0 -1
  760. package/dist/modules/commands/components/dropdown-command.client.d.mts.map +0 -1
  761. package/dist/modules/commands/components/dropdown-command.client.mjs.map +0 -1
  762. package/dist/modules/commands/components/empty-command.client.d.mts.map +0 -1
  763. package/dist/modules/commands/components/empty-command.client.mjs.map +0 -1
  764. package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +0 -1
  765. package/dist/modules/commands/components/form-dialog-command.client.mjs.map +0 -1
  766. package/dist/modules/commands/components/render-command.mjs.map +0 -1
  767. package/dist/modules/commands/hooks/context.client.mjs.map +0 -1
  768. package/dist/modules/commands/hooks/use-command-menu.client.d.mts.map +0 -1
  769. package/dist/modules/commands/hooks/use-command-menu.client.mjs.map +0 -1
  770. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts.map +0 -1
  771. package/dist/modules/commands/hooks/use-command-mutation.client.mjs.map +0 -1
  772. package/dist/modules/commands/lib/definitions.d.mts.map +0 -1
  773. package/dist/modules/commands/lib/factory.d.mts.map +0 -1
  774. package/dist/modules/commands/lib/factory.mjs.map +0 -1
  775. package/dist/modules/commands/menus/context-menu.client.d.mts.map +0 -1
  776. package/dist/modules/commands/menus/context-menu.client.mjs.map +0 -1
  777. package/dist/modules/commands/menus/dropdown-menu.client.d.mts.map +0 -1
  778. package/dist/modules/commands/menus/dropdown-menu.client.mjs.map +0 -1
  779. package/dist/modules/commands/menus/floating-menu.client.d.mts.map +0 -1
  780. package/dist/modules/commands/menus/floating-menu.client.mjs.map +0 -1
  781. package/dist/modules/commands/menus/inline-menu.client.d.mts.map +0 -1
  782. package/dist/modules/commands/menus/inline-menu.client.mjs.map +0 -1
  783. package/dist/modules/commands/menus/responsive-menu.client.d.mts.map +0 -1
  784. package/dist/modules/commands/menus/responsive-menu.client.mjs.map +0 -1
  785. package/dist/modules/commands/utils/archive-command.client.d.mts.map +0 -1
  786. package/dist/modules/commands/utils/archive-command.client.mjs.map +0 -1
  787. package/dist/modules/commands/utils/delete-command.client.d.mts.map +0 -1
  788. package/dist/modules/commands/utils/delete-command.client.mjs.map +0 -1
  789. package/dist/modules/config/lib/config.d.mts.map +0 -1
  790. package/dist/modules/config/lib/config.mjs.map +0 -1
  791. package/dist/modules/config/lib/context.d.mts.map +0 -1
  792. package/dist/modules/config/lib/context.mjs.map +0 -1
  793. package/dist/modules/config/paths/helpers.d.mts.map +0 -1
  794. package/dist/modules/config/paths/helpers.mjs.map +0 -1
  795. package/dist/modules/config/paths/types.d.mts.map +0 -1
  796. package/dist/modules/data-tables/components/cell/common.client.d.mts.map +0 -1
  797. package/dist/modules/data-tables/components/cell/common.client.mjs.map +0 -1
  798. package/dist/modules/data-tables/components/cell/index.client.d.mts.map +0 -1
  799. package/dist/modules/data-tables/components/cell/index.client.mjs.map +0 -1
  800. package/dist/modules/data-tables/components/cell/select.client.d.mts.map +0 -1
  801. package/dist/modules/data-tables/components/cell/select.client.mjs.map +0 -1
  802. package/dist/modules/data-tables/components/column-header.d.mts.map +0 -1
  803. package/dist/modules/data-tables/components/column-header.mjs.map +0 -1
  804. package/dist/modules/data-tables/components/filters/combobox.client.d.mts.map +0 -1
  805. package/dist/modules/data-tables/components/filters/combobox.client.mjs.map +0 -1
  806. package/dist/modules/data-tables/components/filters/slider.client.d.mts.map +0 -1
  807. package/dist/modules/data-tables/components/filters/slider.client.mjs.map +0 -1
  808. package/dist/modules/data-tables/components/footer.mjs.map +0 -1
  809. package/dist/modules/data-tables/components/header.d.mts.map +0 -1
  810. package/dist/modules/data-tables/components/header.mjs.map +0 -1
  811. package/dist/modules/data-tables/components/layout.d.mts.map +0 -1
  812. package/dist/modules/data-tables/components/layout.mjs.map +0 -1
  813. package/dist/modules/data-tables/components/search-input.client.d.mts.map +0 -1
  814. package/dist/modules/data-tables/components/search-input.client.mjs.map +0 -1
  815. package/dist/modules/data-tables/components/skeleton.d.mts.map +0 -1
  816. package/dist/modules/data-tables/components/skeleton.mjs.map +0 -1
  817. package/dist/modules/data-tables/components/table.d.mts.map +0 -1
  818. package/dist/modules/data-tables/components/table.mjs.map +0 -1
  819. package/dist/modules/data-tables/components/toolbar.d.mts.map +0 -1
  820. package/dist/modules/data-tables/components/toolbar.mjs.map +0 -1
  821. package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +0 -1
  822. package/dist/modules/data-tables/hooks/use-context.client.mjs.map +0 -1
  823. package/dist/modules/data-tables/hooks/use-search.client.mjs.map +0 -1
  824. package/dist/modules/data-tables/hooks/use-selection.client.mjs.map +0 -1
  825. package/dist/modules/data-tables/hooks/use-table.client.d.mts.map +0 -1
  826. package/dist/modules/data-tables/hooks/use-table.client.mjs.map +0 -1
  827. package/dist/modules/data-tables/lib/converters/cursor.d.mts.map +0 -1
  828. package/dist/modules/data-tables/lib/converters/cursor.mjs.map +0 -1
  829. package/dist/modules/data-tables/lib/converters/dto.d.mts.map +0 -1
  830. package/dist/modules/data-tables/lib/converters/dto.mjs.map +0 -1
  831. package/dist/modules/data-tables/lib/converters/filter.d.mts.map +0 -1
  832. package/dist/modules/data-tables/lib/converters/filter.mjs.map +0 -1
  833. package/dist/modules/data-tables/lib/converters/search.d.mts.map +0 -1
  834. package/dist/modules/data-tables/lib/converters/search.mjs.map +0 -1
  835. package/dist/modules/data-tables/lib/converters/sorting.d.mts.map +0 -1
  836. package/dist/modules/data-tables/lib/converters/sorting.mjs.map +0 -1
  837. package/dist/modules/data-tables/lib/filters/config.d.mts.map +0 -1
  838. package/dist/modules/data-tables/lib/filters/config.mjs.map +0 -1
  839. package/dist/modules/data-tables/lib/filters/helpers.d.mts.map +0 -1
  840. package/dist/modules/data-tables/lib/filters/helpers.mjs.map +0 -1
  841. package/dist/modules/data-tables/lib/filters/parsers.d.mts.map +0 -1
  842. package/dist/modules/data-tables/lib/filters/parsers.mjs.map +0 -1
  843. package/dist/modules/data-tables/lib/filters/resolvers.d.mts.map +0 -1
  844. package/dist/modules/data-tables/lib/filters/resolvers.mjs.map +0 -1
  845. package/dist/modules/data-tables/lib/helpers/create-column.mjs.map +0 -1
  846. package/dist/modules/data-tables/lib/search-params.d.mts.map +0 -1
  847. package/dist/modules/data-tables/lib/search-params.mjs.map +0 -1
  848. package/dist/modules/data-tables/lib/types.d.mts.map +0 -1
  849. package/dist/modules/data-tables/lib/validators.d.mts.map +0 -1
  850. package/dist/modules/data-tables/lib/validators.mjs.map +0 -1
  851. package/dist/modules/data-tables/server/get-data.server.d.mts.map +0 -1
  852. package/dist/modules/data-tables/server/get-data.server.mjs.map +0 -1
  853. package/dist/modules/data-tables/strategies/helpers/sorting.mjs.map +0 -1
  854. package/dist/modules/data-tables/strategies/infinite/components.mjs.map +0 -1
  855. package/dist/modules/data-tables/strategies/infinite/strategy.d.mts.map +0 -1
  856. package/dist/modules/data-tables/strategies/infinite/strategy.mjs.map +0 -1
  857. package/dist/modules/data-tables/strategies/pagination/components.mjs.map +0 -1
  858. package/dist/modules/data-tables/strategies/pagination/strategy.d.mts.map +0 -1
  859. package/dist/modules/data-tables/strategies/pagination/strategy.mjs.map +0 -1
  860. package/dist/modules/data-tables/tables/data-table/components/body.mjs.map +0 -1
  861. package/dist/modules/data-tables/tables/data-table/components/header.mjs.map +0 -1
  862. package/dist/modules/data-tables/tables/data-table/components/row.mjs.map +0 -1
  863. package/dist/modules/data-tables/tables/data-table/components/table.d.mts.map +0 -1
  864. package/dist/modules/data-tables/tables/data-table/components/table.mjs.map +0 -1
  865. package/dist/modules/data-tables/tables/inline-table/components/body.mjs.map +0 -1
  866. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts.map +0 -1
  867. package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs.map +0 -1
  868. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts.map +0 -1
  869. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs.map +0 -1
  870. package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.d.mts.map +0 -1
  871. package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs.map +0 -1
  872. package/dist/modules/data-tables/tables/inline-table/components/header.mjs.map +0 -1
  873. package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs.map +0 -1
  874. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +0 -1
  875. package/dist/modules/data-tables/tables/inline-table/components/table.mjs.map +0 -1
  876. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +0 -1
  877. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs.map +0 -1
  878. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts.map +0 -1
  879. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs.map +0 -1
  880. package/dist/modules/database/lib/helpers.d.mts.map +0 -1
  881. package/dist/modules/database/lib/helpers.mjs.map +0 -1
  882. package/dist/modules/database/lib/service.server.d.mts.map +0 -1
  883. package/dist/modules/database/lib/service.server.mjs.map +0 -1
  884. package/dist/modules/database/lib/types.d.mts.map +0 -1
  885. package/dist/modules/emails/lib/service.server.d.mts.map +0 -1
  886. package/dist/modules/emails/lib/service.server.mjs.map +0 -1
  887. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +0 -1
  888. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs.map +0 -1
  889. package/dist/modules/inline-edit/components/combobox.client.d.mts.map +0 -1
  890. package/dist/modules/inline-edit/components/combobox.client.mjs.map +0 -1
  891. package/dist/modules/inline-edit/components/date-input.client.d.mts.map +0 -1
  892. package/dist/modules/inline-edit/components/date-input.client.mjs.map +0 -1
  893. package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +0 -1
  894. package/dist/modules/inline-edit/components/date-picker.client.mjs.map +0 -1
  895. package/dist/modules/inline-edit/components/date-time.client.d.mts.map +0 -1
  896. package/dist/modules/inline-edit/components/date-time.client.mjs.map +0 -1
  897. package/dist/modules/inline-edit/components/editor.client.d.mts.map +0 -1
  898. package/dist/modules/inline-edit/components/editor.client.mjs.map +0 -1
  899. package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +0 -1
  900. package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +0 -1
  901. package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +0 -1
  902. package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +0 -1
  903. package/dist/modules/inline-edit/components/input.client.d.mts.map +0 -1
  904. package/dist/modules/inline-edit/components/input.client.mjs.map +0 -1
  905. package/dist/modules/inline-edit/components/select.client.d.mts.map +0 -1
  906. package/dist/modules/inline-edit/components/select.client.mjs.map +0 -1
  907. package/dist/modules/inline-edit/components/switch.client.d.mts.map +0 -1
  908. package/dist/modules/inline-edit/components/switch.client.mjs.map +0 -1
  909. package/dist/modules/inline-edit/components/toggle.client.d.mts.map +0 -1
  910. package/dist/modules/inline-edit/components/toggle.client.mjs.map +0 -1
  911. package/dist/modules/inline-edit/hooks/context.client.d.mts.map +0 -1
  912. package/dist/modules/inline-edit/hooks/context.client.mjs.map +0 -1
  913. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts.map +0 -1
  914. package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +0 -1
  915. package/dist/modules/inline-edit/lib/validators.d.mts.map +0 -1
  916. package/dist/modules/inline-edit/lib/validators.mjs.map +0 -1
  917. package/dist/modules/inline-edit/lib/variants.d.mts.map +0 -1
  918. package/dist/modules/inline-edit/lib/variants.mjs.map +0 -1
  919. package/dist/modules/router/handler/caller.client.d.mts.map +0 -1
  920. package/dist/modules/router/handler/caller.client.mjs.map +0 -1
  921. package/dist/modules/router/handler/caller.server.d.mts.map +0 -1
  922. package/dist/modules/router/handler/caller.server.mjs.map +0 -1
  923. package/dist/modules/router/handler/context.server.d.mts.map +0 -1
  924. package/dist/modules/router/handler/context.server.mjs.map +0 -1
  925. package/dist/modules/router/handler/init.server.d.mts.map +0 -1
  926. package/dist/modules/router/handler/init.server.mjs.map +0 -1
  927. package/dist/modules/router/handler/register.server.d.mts.map +0 -1
  928. package/dist/modules/router/handler/register.server.mjs.map +0 -1
  929. package/dist/modules/router/handler/route.server.d.mts.map +0 -1
  930. package/dist/modules/router/handler/route.server.mjs.map +0 -1
  931. package/dist/modules/router/lib/helpers.mjs.map +0 -1
  932. package/dist/modules/router/lib/query-client.d.mts.map +0 -1
  933. package/dist/modules/router/lib/query-client.mjs.map +0 -1
  934. package/dist/modules/router/lib/query-client.server.d.mts.map +0 -1
  935. package/dist/modules/router/lib/query-client.server.mjs.map +0 -1
  936. package/dist/modules/router/lib/validators.d.mts.map +0 -1
  937. package/dist/modules/router/lib/validators.mjs.map +0 -1
  938. package/dist/modules/storage/components/dropzone-context.client.d.mts.map +0 -1
  939. package/dist/modules/storage/components/dropzone-context.client.mjs.map +0 -1
  940. package/dist/modules/storage/components/dropzone.client.d.mts.map +0 -1
  941. package/dist/modules/storage/components/dropzone.client.mjs.map +0 -1
  942. package/dist/modules/storage/components/image-grid.client.d.mts.map +0 -1
  943. package/dist/modules/storage/components/image-grid.client.mjs.map +0 -1
  944. package/dist/modules/storage/components/image.client.d.mts.map +0 -1
  945. package/dist/modules/storage/components/image.client.mjs.map +0 -1
  946. package/dist/modules/storage/components/upload-button.client.d.mts.map +0 -1
  947. package/dist/modules/storage/components/upload-button.client.mjs.map +0 -1
  948. package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +0 -1
  949. package/dist/modules/storage/components/upload-zone-context.client.mjs.map +0 -1
  950. package/dist/modules/storage/components/upload-zone.client.d.mts.map +0 -1
  951. package/dist/modules/storage/components/upload-zone.client.mjs.map +0 -1
  952. package/dist/modules/storage/lib/constants.d.mts.map +0 -1
  953. package/dist/modules/storage/lib/constants.mjs.map +0 -1
  954. package/dist/modules/storage/lib/helpers.d.mts.map +0 -1
  955. package/dist/modules/storage/lib/helpers.mjs.map +0 -1
  956. package/dist/modules/storage/lib/procedures.server.d.mts.map +0 -1
  957. package/dist/modules/storage/lib/procedures.server.mjs.map +0 -1
  958. package/dist/modules/storage/lib/router-handlers.server.d.mts.map +0 -1
  959. package/dist/modules/storage/lib/router-handlers.server.mjs.map +0 -1
  960. package/dist/modules/storage/lib/schema.d.mts.map +0 -1
  961. package/dist/modules/storage/lib/schema.mjs.map +0 -1
  962. package/dist/modules/storage/lib/service.server.d.mts.map +0 -1
  963. package/dist/modules/storage/lib/service.server.mjs.map +0 -1
  964. package/dist/modules/storage/lib/upload.client.d.mts.map +0 -1
  965. package/dist/modules/storage/lib/upload.client.mjs.map +0 -1
  966. package/dist/modules/storage/lib/validators.d.mts.map +0 -1
  967. package/dist/modules/storage/lib/validators.mjs.map +0 -1
  968. package/dist/modules/storage/providers/adapters/s3.server.d.mts.map +0 -1
  969. package/dist/modules/storage/providers/adapters/s3.server.mjs.map +0 -1
  970. package/dist/modules/storage/providers/lib/constants.d.mts.map +0 -1
  971. package/dist/modules/storage/providers/lib/constants.mjs.map +0 -1
  972. package/dist/modules/storage/providers/lib/errors.d.mts.map +0 -1
  973. package/dist/modules/storage/providers/lib/errors.mjs.map +0 -1
  974. package/dist/modules/storage/providers/lib/types.d.mts.map +0 -1
  975. package/dist/modules/storage/providers/lib/validators.d.mts.map +0 -1
  976. package/dist/modules/storage/providers/lib/validators.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"image-grid.client.mjs","names":[],"sources":["../../../../src/modules/storage/components/image-grid.client.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n closestCenter,\n DndContext,\n type DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useDroppable,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n rectSortingStrategy,\n SortableContext,\n sortableKeyboardCoordinates,\n useSortable,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { GripIcon, UploadIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Icons } from \"@/components/common/icons\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselNext,\n CarouselPrevious,\n} from \"@/components/ui/carousel.client\";\nimport { Dialog, DialogContent, DialogTrigger } from \"@/components/ui/dialog.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { useAction } from \"@/lib/entry.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { getAssetURL } from \"../lib/helpers\";\nimport type { StorageAsset } from \"../lib/validators\";\nimport { StorageImage } from \"./image.client\";\nimport { useUploadZone } from \"./upload-zone-context.client\";\n\n/**\n * Image Grid\n */\ntype ImageGridProps = ComponentProps<\"div\"> & {\n assets: StorageAsset[];\n disabled?: boolean;\n moveAction: (params: { fromIndex: number; toIndex: number }) => Promise<void>;\n optimistic?: {\n move?: (params: { fromIndex: number; toIndex: number }) => Promise<void> | void;\n };\n};\n\nexport function ImageGrid({ assets, moveAction, optimistic, disabled, ...props }: ImageGridProps) {\n const uploadZone = useUploadZone();\n\n const images = assets.flatMap((asset) => ({ ...asset, url: getAssetURL(asset.id) }));\n\n const [current, setCurrent] = React.useState<number>(0);\n\n const { setNodeRef } = useDroppable({ id: \"image-grid\" });\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const moveMuration = useAction({\n mutationFn: async ({ active, over }: DragEndEvent) => {\n if (!moveAction) return Promise.resolve();\n\n const activeId = active.id;\n const overId = over?.id;\n if (!activeId || !overId || activeId === overId) return Promise.resolve();\n\n const fromIndex = images.findIndex((image) => image.id === activeId);\n const toIndex = images.findIndex((image) => image.id === overId);\n\n await optimistic?.move?.({ fromIndex, toIndex });\n await moveAction({ fromIndex, toIndex });\n },\n onSuccess: async () => {\n setCurrent(0);\n await uploadZone.optimistic?.invalidate?.();\n },\n onError: (error) => {\n console.error(\"Error moving image:\", error);\n },\n });\n\n return (\n <Dialog {...props}>\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={moveMuration.mutate}\n >\n <div\n ref={setNodeRef}\n className=\"grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-5\"\n >\n <SortableContext items={images.map((image) => image.id)} strategy={rectSortingStrategy}>\n {images.map((asset, index) => (\n <ImageGridItem key={asset.id} asset={asset} index={index} setCurrent={setCurrent} />\n ))}\n\n {!disabled && (\n <label\n htmlFor=\"file-upload\"\n className=\"relative flex aspect-square w-full cursor-pointer flex-col items-center justify-center rounded-lg border border-muted-foreground border-dashed bg-muted hover:border-primary\"\n >\n <UploadIcon className=\"h-8 w-8\" />\n <Input\n id=\"file-upload\"\n type=\"file\"\n accept=\"image/jpeg, image/png, image/webp, image/gif\"\n className=\"absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0\"\n multiple\n onChange={(e) => {\n if (!e.target.files) return;\n return Array.from(e.target.files).map(uploadZone.onUpload);\n }}\n />\n </label>\n )}\n </SortableContext>\n </div>\n </DndContext>\n\n <Carousel className=\"w-full\" opts={{ startIndex: current }}>\n <DialogContent className=\"border-none bg-transparent p-0 shadow-none md:max-w-[80vw] xl:max-w-[60vw]\">\n <CarouselContent className=\"md:max-h-[80vh]\">\n {images.map(({ id, url }) => (\n <CarouselItem key={id} className=\"overflow-hidden rounded-xl\">\n <StorageImage\n src={url}\n alt=\"Image Preview\"\n width={1920}\n height={1080}\n className=\"h-full w-full rounded-xl object-contain\"\n />\n </CarouselItem>\n ))}\n </CarouselContent>\n <CarouselPrevious />\n <CarouselNext />\n </DialogContent>\n </Carousel>\n </Dialog>\n );\n}\n\n/**\n * Image Grid Item\n */\ntype ImageGridItemProps = {\n asset: StorageAsset & { url: string };\n index: number;\n setCurrent: React.Dispatch<React.SetStateAction<number>>;\n};\n\nfunction ImageGridItem({ asset, index, setCurrent }: ImageGridItemProps) {\n const uploadZone = useUploadZone();\n\n const { attributes, listeners, setNodeRef, transform, transition } = useSortable({\n id: asset.id,\n });\n\n return (\n <Card\n id={asset.id}\n ref={setNodeRef}\n style={{\n transform: CSS.Transform.toString(transform),\n transition,\n }}\n className={cn(\n \"group relative aspect-square w-full\",\n asset.status === \"pending\" && \"opacity-30\",\n )}\n >\n {asset.status === \"ready\" ? (\n <>\n <DialogTrigger onClick={() => setCurrent(index)}>\n <StorageImage\n src={asset.url}\n alt=\"Image Preview\"\n width={100}\n height={100}\n className=\"absolute inset-0 h-full w-full cursor-pointer rounded-lg bg-muted object-contain\"\n />\n </DialogTrigger>\n\n <Button\n {...attributes}\n {...listeners}\n type=\"button\"\n variant=\"secondary\"\n size=\"icon\"\n className=\"absolute top-2 right-2 hidden p-1 group-hover:flex\"\n >\n <GripIcon className=\"size-4\" />\n </Button>\n\n <Button\n type=\"button\"\n variant=\"destructive\"\n size=\"icon\"\n onClick={() => uploadZone.onRemove([asset.id])}\n className=\"absolute top-2 left-2 hidden p-1 group-hover:flex\"\n >\n <Icons.trash className=\"size-4\" />\n </Button>\n </>\n ) : (\n <Skeleton className=\"absolute inset-0 h-full w-full rounded-lg\" />\n )}\n </Card>\n );\n}\n\nexport function ImageGridSkeleton(props: ComponentProps<\"div\">) {\n return (\n <div\n {...props}\n className={cn(\"grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-5\", props.className)}\n >\n {Array.from({ length: 12 }).map((_, index) => (\n <Skeleton key={index} className=\"aspect-square w-full rounded-lg\" />\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqDA,SAAgB,UAAU,EAAE,QAAQ,YAAY,YAAY,UAAU,GAAG,SAAyB;CAChG,MAAM,a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oBAAC,YAAS,WAAU,8CAA8C;GAE/D;;AAIX,SAAgB,kBAAkB,OAA8B;AAC9D,QACE,oBAAC;EACC,GAAI;EACJ,WAAW,GAAG,8DAA8D,MAAM,UAAU;YAE3F,MAAM,KAAK,EAAE,QAAQ,IAAI,CAAC,CAAC,KAAK,GAAG,UAClC,oBAAC,YAAqB,WAAU,qCAAjB,MAAqD,CACpE;GACE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.client.d.mts","names":[],"sources":["../../../../src/modules/storage/components/image.client.tsx"],"mappings":";;;;iBAKgB,YAAA,CAAa,KAAA,EAAO,IAAA,CAAK,UAAA,cAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.client.mjs","names":[],"sources":["../../../../src/modules/storage/components/image.client.tsx"],"sourcesContent":["\"use client\";\n\nimport Image, { type ImageProps } from \"next/image\";\nimport { imageLoader } from \"../lib/helpers\";\n\nexport function StorageImage(props: Omit<ImageProps, \"loader\">) {\n return <Image {...props} loader={imageLoader} />;\n}\n"],"mappings":";;;;;;;AAKA,SAAgB,aAAa,OAAmC;AAC9D,QAAO,oBAAC;EAAM,GAAI;EAAO,QAAQ;GAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-button.client.d.mts","names":[],"sources":["../../../../src/modules/storage/components/upload-button.client.tsx"],"mappings":";;;;;iBASgB,YAAA,CAAA;EAAe,SAAA;EAAA,GAAc;AAAA,GAAS,cAAA,QAAsB,MAAA,IAAO,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-button.client.mjs","names":[],"sources":["../../../../src/modules/storage/components/upload-button.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { UploadIcon } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useUploadZone } from \"./upload-zone-context.client\";\n\nexport function UploadButton({ className, ...props }: ComponentProps<typeof Button>) {\n const { onUpload } = useUploadZone();\n\n return (\n <Button {...props} className={cn(\"relative gap-2\", className)}>\n <UploadIcon className=\"h-3 w-3\" />\n <span>Upload</span>\n\n <Input\n type=\"file\"\n className=\"absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0\"\n multiple\n onChange={(e) => {\n if (!e.target.files) return;\n Array.from(e.target.files).forEach(onUpload);\n }}\n />\n </Button>\n );\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,aAAa,EAAE,WAAW,GAAG,SAAwC;CACnF,MAAM,EAAE,aAAa,eAAe;AAEpC,QACE,qBAAC;EAAO,GAAI;EAAO,WAAW,GAAG,kBAAkB,UAAU;;GAC3D,oBAAC,cAAW,WAAU,YAAY;GAClC,oBAAC,oBAAK,WAAa;GAEnB,oBAAC;IACC,MAAK;IACL,WAAU;IACV;IACA,WAAW,MAAM;AACf,SAAI,CAAC,EAAE,OAAO,MAAO;AACrB,WAAM,KAAK,EAAE,OAAO,MAAM,CAAC,QAAQ,SAAS;;KAE9C;;GACK"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-zone-context.client.d.mts","names":[],"sources":["../../../../src/modules/storage/components/upload-zone-context.client.tsx"],"mappings":";;;;;;;AASA;KAAY,sBAAA;EACV,YAAA,EAAc,YAAA;EACd,QAAA,GAAW,IAAA,EAAM,IAAA,KAAS,OAAA,CAAQ,YAAA;EAClC,QAAA,GAAW,GAAA,eAAkB,OAAA;EAC7B,UAAA;IACE,GAAA,IACE,QAAA,EAAU,IAAA,CACR,YAAA,wEAGC,OAAA;IACL,MAAA,IAAU,GAAA,eAAkB,OAAA;IAC5B,UAAA,SAAmB,OAAA;IACnB,MAAA,SAAe,OAAA;EAAA;EAEjB,QAAA;AAAA;;;;cAMW,iBAAA,EAAiB,KAAA,CAAA,OAAA,CAAA,sBAAA;;;;iBAKd,aAAA,CAAA,GAAa,sBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-zone-context.client.mjs","names":[],"sources":["../../../../src/modules/storage/components/upload-zone-context.client.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport type { UploadClient } from \"../lib/upload.client\";\nimport type { StorageAsset } from \"../lib/validators\";\n\n/**\n * Upload Zone Context Value\n */\nexport type UploadZoneContextValue = {\n uploadClient: UploadClient;\n onUpload: (file: File) => Promise<StorageAsset>;\n onRemove: (ids: string[]) => Promise<void>;\n optimistic?: {\n add?: (\n newValue: Omit<\n StorageAsset,\n \"id\" | \"key\" | \"bucket\" | \"provider\" | \"createdAt\" | \"updatedAt\"\n >,\n ) => Promise<void> | void;\n remove?: (ids: string[]) => Promise<void> | void;\n invalidate?: () => Promise<void> | void;\n cancel?: () => Promise<void> | void;\n };\n disabled?: boolean;\n};\n\n/**\n * Upload Zone Context\n */\nexport const UploadZoneContext = React.createContext<UploadZoneContextValue | null>(null);\n\n/**\n * Upload Zone Hook\n */\nexport function useUploadZone() {\n const context = React.useContext(UploadZoneContext);\n if (!context) {\n throw new Error(\"useUploadZone must be used within an UploadZoneContext provider\");\n }\n return context;\n}\n"],"mappings":";;;;;;;;AA8BA,MAAa,oBAAoB,MAAM,cAA6C,KAAK;;;;AAKzF,SAAgB,gBAAgB;CAC9B,MAAM,UAAU,MAAM,WAAW,kBAAkB;AACnD,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,kEAAkE;AAEpF,QAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-zone.client.d.mts","names":[],"sources":["../../../../src/modules/storage/components/upload-zone.client.tsx"],"mappings":";;;;;;;KAWY,eAAA,GAAkB,cAAA,UAC5B,IAAA,CAAK,sBAAA;EACH,SAAA,EAAW,IAAA,CAAK,WAAA;EAChB,WAAA,GAAc,WAAA;EAEd,iBAAA,IAAqB,KAAA,EAAO,YAAA,KAAiB,OAAA;EAC7C,cAAA,IAAkB,KAAA,cAAmB,OAAA;AAAA;AAAA,iBAGzB,UAAA,CAAA;EACd,SAAA;EACA,UAAA;EACA,YAAA;EACA,WAAA;EACA,iBAAA;EACA,cAAA;EACA,QAAA;EACA,QAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,eAAA,GAAe,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-zone.client.mjs","names":[],"sources":["../../../../src/modules/storage/components/upload-zone.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentProps, useCallback } from \"react\";\nimport { useDropzone } from \"react-dropzone\";\nimport { toast } from \"@/components/ui/sonner.client\";\nimport { useAction } from \"@/lib/hooks/use-action\";\nimport { cn } from \"@/lib/utils/cn\";\nimport type { UploadFileRequest, UploadHooks } from \"../lib/upload.client\";\nimport type { StorageAsset, UploadInput } from \"../lib/validators\";\nimport { UploadZoneContext, type UploadZoneContextValue } from \"./upload-zone-context.client\";\n\nexport type UploadZoneProps = ComponentProps<\"div\"> &\n Pick<UploadZoneContextValue, \"optimistic\" | \"uploadClient\" | \"disabled\"> & {\n variables: Pick<UploadInput, \"visibility\">;\n uploadHooks?: UploadHooks;\n\n onUploadCompleted?: (asset: StorageAsset) => Promise<void> | void;\n onUploadFailed?: (error: unknown) => Promise<void> | void;\n };\n\nexport function UploadZone({\n variables,\n optimistic,\n uploadClient,\n uploadHooks,\n onUploadCompleted,\n onUploadFailed,\n disabled = false,\n children,\n className,\n ...props\n}: UploadZoneProps) {\n /**\n * Delete mutation\n */\n const deleteMutation = useAction({\n mutationFn: async (ids: string[]) => {\n await uploadClient.deleteAssets(ids);\n },\n onMutate: async (ids) => {\n await optimistic?.cancel?.();\n await optimistic?.remove?.(ids);\n },\n onError: async (error) => {\n console.error(\"Delete failed upload error: \", error);\n await onUploadFailed?.(error);\n },\n onSettled: () => {\n optimistic?.invalidate?.();\n },\n });\n\n /**\n * Upload mutation\n */\n const uploadMutation = useAction({\n mutationFn: async (params: UploadFileRequest) => uploadClient.upload(params, uploadHooks),\n onMutate: async (variables) => {\n await optimistic?.cancel?.();\n\n const newAsset = {\n ...variables,\n visibility: variables.visibility ?? \"private\",\n status: \"pending\",\n name: variables.file.name,\n size: variables.file.size,\n contentType: variables.file.type || \"application/octet-stream\",\n etag: null,\n metadata: null,\n uploadedAt: new Date(),\n deletedAt: null,\n } as Omit<StorageAsset, \"id\" | \"key\" | \"bucket\" | \"provider\" | \"createdAt\" | \"updatedAt\">;\n\n await optimistic?.add?.(newAsset);\n },\n onSuccess: async (data) => {\n await onUploadCompleted?.(data);\n toast.success(`Succesvol geupload: ${data.name}`);\n },\n onError: async (error) => {\n await onUploadFailed?.(error);\n\n console.error(\"Upload error: \", error);\n toast.error(\"Bestand uploaden mislukt\", {\n description: error instanceof Error ? error.message : undefined,\n });\n },\n onSettled: () => {\n optimistic?.invalidate?.();\n },\n });\n\n /**\n * Upload file handler\n */\n const onUpload = useCallback(\n async (file: File) => {\n console.info(\"Uploading file\", file);\n const req = uploadClient.prepareUpload({ ...variables, file });\n return await uploadMutation.mutateAsync(req);\n },\n [uploadClient, variables, uploadMutation],\n );\n\n /**\n * Drop handler\n */\n const onDrop = useCallback(\n async (acceptedFiles: File[]) => {\n if (acceptedFiles.length === 0) return;\n await Promise.allSettled(acceptedFiles.map(onUpload));\n },\n [onUpload],\n );\n\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\n onDrop,\n noClick: true,\n disabled,\n });\n\n return (\n <div {...props} {...getRootProps()} className={cn(\"relative z-0\", className)}>\n <input {...getInputProps()} />\n\n {/* Show drag overlay when drag is active */}\n {isDragActive && (\n <div className=\"absolute inset-0 z-10 rounded-md bg-primary/20 opacity-70 backdrop-blur-3xl\" />\n )}\n\n <UploadZoneContext\n value={{\n uploadClient,\n onUpload,\n onRemove: deleteMutation.mutateAsync,\n optimistic,\n disabled,\n }}\n >\n {children}\n </UploadZoneContext>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAoBA,SAAgB,WAAW,EACzB,WACA,YACA,cACA,aACA,mBACA,gBACA,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M,EAAE,cAAc,eAAe,iBAAiB,YAAY;EAChE,QATa,YACb,OAAO,kBAA0B;AAC/B,OAAI,cAAc,WAAW,EAAG;AAChC,SAAM,QAAQ,WAAW,cAAc,IAAI,SAAS,CAAC;KAEvD,CAAC,SAAS,CACX;EAIC,SAAS;EACT;EACD,CAAC;AAEF,QACE,qBAAC;EAAI,GAAI;EAAO,GAAI,cAAc;EAAE,WAAW,GAAG,gBAAgB,UAAU;;GAC1E,oBAAC,WAAM,GAAI,eAAe,GAAI;GAG7B,gBACC,oBAAC,SAAI,WAAU,gFAAgF;GAGjG,oBAAC;IACC,OAAO;KACL;KACA;KACA,UAAU,eAAe;KACzB;KACA;KACD;IAEA;KACiB;;GAChB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/constants.ts"],"mappings":";cACa,iBAAA;AAAA,KACD,gBAAA,WAA2B,iBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.mjs","names":[],"sources":["../../../../src/modules/storage/lib/constants.ts"],"sourcesContent":["// Image dispositions\nexport const imageDispositions = [\"inline\", \"attachment\"] as const;\nexport type ImageDisposition = (typeof imageDispositions)[number];\n"],"mappings":";AACA,MAAa,oBAAoB,CAAC,UAAU,aAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/helpers.ts"],"mappings":";;;;;;AAgBA;;;;;;;;;;iBAAgB,WAAA,CAAY,EAAA,UAAY,OAAA,GAAS,OAAA,CAAQ,gBAAA;;;;iBAYzC,WAAA,CAAA;EAAc;AAAA,GAAO,gBAAA;;;;iBAUrB,WAAA,CAAY,KAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.mjs","names":[],"sources":["../../../../src/modules/storage/lib/helpers.ts"],"sourcesContent":["import type { ImageLoaderProps } from \"next/image\";\nimport type { GetAssetURLInput } from \"../lib/validators\";\n\n/**\n * Builds the public API route URL for a storage file proxy request.\n *\n * Use this helper when you need a stable file URL in the client/UI\n * without manually composing the route path.\n *\n * @param id - Storage asset id\n * @returns File proxy URL for the storage route handler\n * @example\n * const url = getAssetURL(\"019d0051-2c0d-741e-9e3c-e5a5bc4d16a2\", { disposition: \"attachment\" });\n * // /api/storage/files/019d0051-2c0d-741e-9e3c-e5a5bc4d16a2?disposition=attachment\n */\n\nexport function getAssetURL(id: string, options: Partial<GetAssetURLInput> = {}) {\n const searchParams = new URLSearchParams();\n if (options?.disposition) searchParams.set(\"disposition\", options.disposition);\n\n const queryString = searchParams.toString();\n\n return `/api/storage/files/${id}${queryString ? `?${queryString}` : \"\"}`;\n}\n\n/**\n * Image loader\n */\nexport function imageLoader({ src }: ImageLoaderProps) {\n if (typeof window === \"undefined\") return src;\n\n const url = new URL(src, window.location.origin);\n return url.toString();\n}\n\n/**\n * Render bytes\n */\nexport function renderBytes(bytes: number) {\n const units = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\"];\n\n let size = bytes;\n let unitIndex = 0;\n\n while (size >= 1024 && unitIndex < units.length - 1) {\n size /= 1024;\n unitIndex++;\n }\n\n return `${size.toFixed(2)}${units[unitIndex]}`;\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,SAAgB,YAAY,IAAY,UAAqC,EAAE,EAAE;CAC/E,MAAM,eAAe,IAAI,iBAAiB;AAC1C,KAAI,SAAS,YAAa,cAAa,IAAI,eAAe,QAAQ,YAAY;CAE9E,MAAM,cAAc,aAAa,UAAU;AAE3C,QAAO,sBAAsB,KAAK,cAAc,IAAI,gBAAgB;;;;;AAMtE,SAAgB,YAAY,EAAE,OAAyB;AACrD,KAAI,OAAO,WAAW,YAAa,QAAO;AAG1C,QADY,IAAI,IAAI,KAAK,OAAO,SAAS,OAAO,CACrC,UAAU;;;;;AAMvB,SAAgB,YAAY,OAAe;CACzC,MAAM,QAAQ;EAAC;EAAK;EAAM;EAAM;EAAM;EAAM;EAAK;CAEjD,IAAI,OAAO;CAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8C5C,aAAA,GAAgB,UAAA,QAAkB,uBAAA;AAAA,KAClC,oBAAA,GAAuB,kBAAA,CAAmB,aAAA;AAAA,KAC1C,mBAAA,GAAsB,iBAAA,CAAkB,aAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"procedures.server.mjs","names":["z"],"sources":["../../../../src/modules/storage/lib/procedures.server.ts"],"sourcesContent":["import type { InferRouterInputs, InferRouterOutputs } from \"@orpc/server\";\nimport { z } from \"zod\";\nimport type { TDatabaseSchema } from \"@/modules/config/db/types\";\nimport { initRPC } from \"@/modules/router/handler/init.server\";\nimport {\n confirmUploadInputSchema,\n presignUploadInputSchema,\n presignUploadOutputSchema,\n selectStorageAssetSchema,\n} from \"./validators\";\n\nexport function createStorageProcedures<TSchema extends TDatabaseSchema>() {\n const { protectedProcedure } = initRPC<TSchema>();\n\n return {\n presign: protectedProcedure\n .input(presignUploadInputSchema)\n .output(presignUploadOutputSchema)\n .handler(async ({ context, input }) => context.storage.presignUpload(input)),\n\n confirm: protectedProcedure\n .input(confirmUploadInputSchema)\n .output(selectStorageAssetSchema)\n .handler(async ({ context, input }) => context.storage.confirmUpload(input)),\n\n deleteAsset: protectedProcedure\n .input(z.uuid())\n .output(selectStorageAssetSchema.nullable())\n .handler(async ({ context, input }) => context.storage.deleteAsset(input)),\n\n deleteAssets: protectedProcedure\n .input(z.string().array())\n .output(z.array(selectStorageAssetSchema))\n .handler(async ({ context, input }) => context.storage.deleteAssets(input)),\n\n restoreAsset: protectedProcedure\n .input(z.uuid())\n .output(selectStorageAssetSchema.nullable())\n .handler(async ({ context, input }) => context.storage.restoreAsset(input)),\n\n restoreAssets: protectedProcedure\n .input(z.string().array())\n .output(z.array(selectStorageAssetSchema))\n .handler(async ({ context, input }) => context.storage.restoreAssets(input)),\n\n purgeAsset: protectedProcedure\n .input(z.uuid())\n .output(selectStorageAssetSchema.nullable())\n .handler(async ({ context, input }) => context.storage.purgeAsset(input)),\n\n purgeAssets: protectedProcedure\n .input(z.string().array())\n .output(z.array(selectStorageAssetSchema))\n .handler(async ({ context, input }) => context.storage.purgeAssets(input)),\n };\n}\n\nexport type StorageRouter = ReturnType<typeof createStorageProcedures>;\nexport type StorageRouterOutputs = InferRouterOutputs<StorageRouter>;\nexport type StorageRouterInputs = InferRouterInputs<StorageRouter>;\n"],"mappings":";;;;;AAWA,SAAgB,0BAA2D;CACzE,MAAM,EAAE,uBAAuB,SAAkB;AAEjD,QAAO;EACL,SAAS,mBACN,MAAM,yBAAyB,CAC/B,OAAO,0BAA0B,CACjC,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,cAAc,MAAM,CAAC;EAE9E,SAAS,mBACN,MAAM,yBAAyB,CAC/B,OAAO,yBAAyB,CAChC,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,cAAc,MAAM,CAAC;EAE9E,aAAa,mBACV,MAAMA,IAAE,MAAM,CAAC,CACf,OAAO,yBAAyB,UAAU,CAAC,CAC3C,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,YAAY,MAAM,CAAC;EAE5E,cAAc,mBACX,MAAMA,IAAE,QAAQ,CAAC,OAAO,CAAC,CACzB,OAAOA,IAAE,MAAM,yBAAyB,CAAC,CACzC,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,aAAa,MAAM,CAAC;EAE7E,cAAc,mBACX,MAAMA,IAAE,MAAM,CAAC,CACf,OAAO,yBAAyB,UAAU,CAAC,CAC3C,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,aAAa,MAAM,CAAC;EAE7E,eAAe,mBACZ,MAAMA,IAAE,QAAQ,CAAC,OAAO,CAAC,CACzB,OAAOA,IAAE,MAAM,yBAAyB,CAAC,CACzC,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,cAAc,MAAM,CAAC;EAE9E,YAAY,mBACT,MAAMA,IAAE,MAAM,CAAC,CACf,OAAO,yBAAyB,UAAU,CAAC,CAC3C,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,WAAW,MAAM,CAAC;EAE3E,aAAa,mBACV,MAAMA,IAAE,QAAQ,CAAC,OAAO,CAAC,CACzB,OAAOA,IAAE,MAAM,yBAAyB,CAAC,CACzC,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,YAAY,MAAM,CAAC;EAC7E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"router-handlers.server.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/router-handlers.server.ts"],"mappings":";;;;;KAQK,QAAA;EACH,MAAA,EAAQ,OAAA;IAAU,IAAA;EAAA;AAAA;AAAA,KAGf,8BAAA,iBAA+C,eAAA;EAClD,OAAA,EAAS,IAAA,CAAK,YAAA,CAAa,OAAA;AAAA;;;;AAJL;;;;;;;;;;;;;iBAwBR,yBAAA,iBAA0C,eAAA,CAAA,CAAA;EACxD;AAAA,GACC,8BAAA,CAA+B,OAAA;iBAUJ,WAAA,EAAW,GAAA,EAAO,QAAA,KAAQ,OAAA,CAAA,QAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"router-handlers.server.mjs","names":[],"sources":["../../../../src/modules/storage/lib/router-handlers.server.ts"],"sourcesContent":["import { connection, type NextRequest } from \"next/server\";\nimport z from \"zod\";\nimport { getSession } from \"@/modules/auth/lib/helpers.server\";\nimport type { TDatabaseSchema } from \"@/modules/config/db/types\";\nimport type { TulipContext } from \"@/modules/config/lib/context\";\nimport { ServerError } from \"@/modules/router/lib/error.server\";\nimport { getAssetURLSchema } from \"../entry\";\n\ntype RouteCtx = {\n params: Promise<{ rest?: string[] }>;\n};\n\ntype CreateStorageRouteHandlerProps<TSchema extends TDatabaseSchema> = {\n context: Pick<TulipContext<TSchema>, \"auth\" | \"storage\">;\n};\n\n/**\n * Creates a catch-all storage route handler for `/api/storage/[[...rest]]`.\n *\n * Current support:\n * - `GET /api/storage/files/:id`:\n * resolves a storage asset, enforces visibility checks, and redirects\n * to a short-lived signed read URL.\n *\n * Reserved for future extension:\n * - `POST /api/storage/assets/presign`\n * - `POST /api/storage/assets/confirm`\n * - additional storage endpoints under the same catch-all route.\n *\n * @param props - Route handler dependencies (application context)\n * @returns Next.js route handlers for GET, POST, PUT, PATCH, and DELETE\n */\n\nexport function createStorageRouteHandler<TSchema extends TDatabaseSchema>({\n context,\n}: CreateStorageRouteHandlerProps<TSchema>) {\n /**\n * GET /api/storage/[[...rest]]\n *\n * Current route support:\n * - /api/storage/files/:id\n *\n * The file route resolves an asset by id, enforces visibility rules,\n * and redirects to a short-lived signed object URL.\n */\n async function GET(request: NextRequest, ctx: RouteCtx) {\n // Get the params\n const { rest = [] } = await ctx.params;\n const resource = rest[0];\n\n /**\n * Proxy file request\n * GET /api/storage/files/:id\n */\n if (resource === \"files\") {\n const id = rest[1];\n\n // Guard required path segment: /api/storage/files/:id\n if (!id) {\n return Response.json(\n { error: { code: \"BAD_REQUEST\", message: \"Missing id\" } },\n { status: 400 },\n );\n }\n\n console.info(\"Proxying file: \", id);\n\n try {\n // Resolve storage asset record by id\n const asset = await context.storage.getAssetById(id);\n\n if (!asset) {\n return Response.json(\n { error: { code: \"NOT_FOUND\", message: \"Asset not found\" } },\n { status: 404 },\n );\n }\n\n // Enforce private visibility with session auth\n if (asset.visibility === \"private\") {\n const session = await getSession(context);\n if (!session) {\n return Response.json(\n { error: { code: \"UNAUTHORIZED\", message: \"Unauthorized\" } },\n { status: 401 },\n );\n }\n }\n\n // Handle searchParams for disposition\n const searchParams = request.nextUrl.searchParams;\n const disposition = searchParams.get(\"disposition\") ?? undefined;\n\n // Parse the options\n const options = getAssetURLSchema.parse({ disposition });\n\n // Resolve signed read URL and redirect to object storage\n const url = await context.storage.getObjectURL(asset.id, options);\n\n // Return the file\n return Response.redirect(url, 307);\n } catch (error) {\n if (error instanceof z.ZodError) {\n return Response.json(\n { error: { code: \"BAD_REQUEST\", message: \"Invalid request input\" } },\n { status: 400 },\n );\n }\n\n if (error instanceof ServerError) {\n const code = error.code;\n\n if (code === \"BAD_REQUEST\") {\n return Response.json(\n { error: { code: \"BAD_REQUEST\", message: error.message } },\n { status: 400 },\n );\n }\n\n if (code === \"NOT_FOUND\") {\n return Response.json(\n { error: { code: \"NOT_FOUND\", message: error.message } },\n { status: 404 },\n );\n }\n\n if (code === \"UNAUTHORIZED\") {\n return Response.json(\n { error: { code: \"UNAUTHORIZED\", message: error.message } },\n { status: 401 },\n );\n }\n }\n\n if (error instanceof Error && error.message === \"Storage asset not found\") {\n return Response.json(\n { error: { code: \"NOT_FOUND\", message: \"Asset not found\" } },\n { status: 404 },\n );\n }\n\n console.error(\"Storage route error\", error);\n\n return Response.json(\n { error: { code: \"INTERNAL_SERVER_ERROR\", message: \"Something went wrong\" } },\n { status: 500 },\n );\n }\n }\n\n return Response.json(\n { error: { code: \"NOT_FOUND\", message: \"Route not found\" } },\n { status: 404 },\n );\n }\n\n /**\n * POST, PUT, PATCH, DELETE /api/storage/[[...rest]]\n *\n * Reserved for future extension, for example:\n * - POST /api/storage/assets/presign\n * - POST /api/storage/assets/confirm\n */\n async function POST() {\n // Make endpoint dynamic\n await connection();\n\n // future:\n // POST /api/storage/assets/presign\n // POST /api/storage/assets/confirm\n return Response.json(\n { error: { code: \"NOT_FOUND\", message: \"Route not found\" } },\n { status: 404 },\n );\n }\n\n return { GET, POST, PUT: POST, PATCH: POST, DELETE: POST };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAgB,0BAA2D,EACzE,WAC0C;;;;;;;;;;CAU1C,eAAe,IAAI,SAAsB,KAAe;EAEtD,MAAM,EAAE,OAAO,EAAE,KAAK,MAAM,IAAI;;;;;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AAS,eACX,QAAO,SAAS,KACd,EAAE,OAAO;MAAE,MAAM;MAAgB,SAAS,MAAM;MAAS,EAAE,EAC3D,EAAE,QAAQ,KAAK,CAChB;;AAIL,QAAI,iBAAiB,SAAS,MAAM,YAAY,0BAC9C,QAAO,SAAS,KACd,EAAE,OAAO;KAAE,MAAM;KAAa,SAAS;KAAmB,EAAE,EAC5D,EAAE,QAAQ,KAAK,CAChB;AAGH,YAAQ,MAAM,uBAAuB,MAAM;AAE3C,WAAO,SAAS,KACd,EAAE,OAAO;KAAE,MAAM;KAAyB,SAAS;KAAwB,EAAE,EAC7E,EAAE,QAAQ,KAAK,CAChB;;;AAIL,SAAO,SAAS,KACd,EAAE,OAAO;GAAE,MAAM;GAAa,SAAS;GAAmB,EAAE,EAC5D,EAAE,QAAQ,KAAK,CAChB;;;;;;;;;CAUH,eAAe,OAAO;AAEpB,QAAM,YAAY;AAKlB,SAAO,SAAS,KACd,EAAE,OAAO;GAAE,MAAM;GAAa,SAAS;GAAmB,EAAE,EAC5D,EAAE,QAAQ,KAAK,CAChB;;AAGH,QAAO;EAAE;EAAK;EAAM,KAAK;EAAM,OAAO;EAAM,QAAQ;EAAM"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/schema.ts"],"mappings":";;;cAIa,sBAAA,EAAsF,oBAAA,CAAhE,MAAA;AAAA,cACtB,0BAAA,EAAsF,oBAAA,CAA5D,MAAA;;AADvC;;cAMa,aAAA,uBAAa,kBAAA;;;;cAuBzB,oBAAA,CAAA,QAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.mjs","names":[],"sources":["../../../../src/modules/storage/lib/schema.ts"],"sourcesContent":["import { index, pgEnum, pgTable, unique } from \"drizzle-orm/pg-core\";\nimport { baseColumns } from \"@/modules/database/lib/helpers\";\nimport { storageProviders } from \"../providers/lib/constants\";\n\nexport const storageAssetStatusEnum = pgEnum(\"storage_asset_status\", [\"pending\", \"ready\", \"error\"]);\nexport const storageAssetVisibilityEnum = pgEnum(\"storage_asset_visibility\", [\"private\", \"public\"]);\n\n/**\n * Storage objects table\n */\nexport const storageAssets = pgTable(\n \"storage_assets\",\n (t) => ({\n ...baseColumns,\n provider: t.text({ enum: storageProviders }).notNull(),\n bucket: t.text().notNull(),\n key: t.text().notNull(),\n status: storageAssetStatusEnum().notNull(),\n visibility: storageAssetVisibilityEnum().notNull().default(\"private\"),\n size: t.integer().default(0),\n contentType: t.varchar({ length: 255 }),\n uploadId: t.uuid().notNull().defaultRandom(),\n name: t.text(),\n metadata: t.jsonb(),\n etag: t.text(),\n uploadedAt: t.timestamp().defaultNow().notNull(),\n deletedAt: t.timestamp(),\n }),\n (t) => [\n unique(\"storage_assets_provider_bucket_key_unique\").on(t.provider, t.bucket, t.key),\n index(\"storage_assets_status_idx\").on(t.status),\n index(\"storage_assets_bucket_key_idx\").on(t.bucket, t.key),\n ],\n);\n"],"mappings":";;;;;AAIA,MAAa,yBAAyB,OAAO,wBAAwB;CAAC;CAAW;CAAS;CAAQ,CAAC;AACnG,MAAa,6BAA6B,OAAO,4BAA4B,CAAC,WAAW,SAAS,CAAC;;;;AAKnG,MAAa,gBAAgB,QAC3B,mBACC,OAAO;CACN,GAAG;CACH,UAAU,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC,CAAC,SAAS;CACtD,QAAQ,EAAE,MAAM,CAAC,SAAS;CAC1B,KAAK,EAAE,MAAM,CAAC,SAAS;CACvB,QAAQ,wBAAwB,CAAC,SAAS;CAC1C,YAAY,4BAA4B,CAAC,SAAS,CAAC,QAAQ,UAAU;CACrE,MAAM,EAAE,SAAS,CAAC,QAAQ,EAAE;CAC5B,aAAa,EAAE,QAAQ,EAAE,QAAQ,KAAK,CAAC;CACvC,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC,eAAe;CAC5C,MAAM,EAAE,MAAM;CACd,UAAU,EAAE,OAAO;CACnB,MAAM,EAAE,MAAM;CACd,YAAY,EAAE,W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AAA,WAAa,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBzB,YAAA,CAAa,KAAA,aAAe,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B5B,YAAA,CAAa,KAAA,WAAa,OAAA;;;;;;;;;;;;;;;;;;;;;;;;EAY1B,aAAA,CAAc,KAAA,aAAe,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B7B,UAAA,CAAW,KAAA,WAAa,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBxB,WAAA,CAAY,KAAA,aAAe,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.server.mjs","names":["#db","#adapter","#generateKey","#parseError"],"sources":["../../../../src/modules/storage/lib/service.server.ts"],"sourcesContent":["import { and, desc, eq, inArray, isNotNull, isNull } from \"drizzle-orm\";\nimport z from \"zod\";\nimport { generateDefaultUUID } from \"@/modules/database/lib/helpers\";\nimport type { Database } from \"@/modules/database/lib/service.server\";\nimport type { TDatabaseSchema } from \"@/modules/database/lib/types\";\nimport { ServerError } from \"@/modules/router/lib/error.server\";\nimport { StorageAdapterError } from \"../providers/lib/errors\";\nimport type { StorageAdapter } from \"../providers/lib/types\";\nimport type { GetObjectURLOptions } from \"../providers/lib/validators\";\nimport { storageAssets } from \"./schema\";\nimport {\n type ConfirmUploadInput,\n confirmUploadInputSchema,\n type PresignUploadInput,\n presignUploadInputSchema,\n type UploadInput,\n uploadInputSchema,\n} from \"./validators\";\n\nexport type StorageConfig<TSchema extends TDatabaseSchema> = {\n db: Database<TSchema>;\n adapter: StorageAdapter;\n prefix?: string;\n};\n\n/**\n * Storage service for working with asset metadata and object storage.\n *\n * Use `Storage.init()` to create a fully configured instance in app code.\n *\n * @param props - Storage configuration, including `db` and `adapter`\n * @returns A ready-to-use `Storage` instance\n * @example\n * const storage = Storage.init({\n * db: drizzle(dbConnection),\n * adapter: new StorageS3Adapter({\n * bucketName: \"my-app-uploads\",\n * region: \"us-east-1\",\n * credentials: {\n * accessKeyId: process.env.AWS_ACCESS_KEY_ID,\n * secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,\n * },\n * }),\n * });\n */\n\nexport class Storage<TSchema extends TDatabaseSchema> {\n #adapter: StorageAdapter;\n #db: Database<TSchema>;\n prefix: string;\n\n private constructor({ db, adapter, prefix }: StorageConfig<TSchema>) {\n this.#db = db;\n this.#adapter = adapter;\n this.prefix = prefix ?? \"uploads\";\n }\n\n /**\n * Create a storage service instance.\n *\n * This keeps the public API aligned with other Tulip services such as\n * `Database.init()`, `Email.init()`, and `Auth.init()`.\n *\n * @param props - Storage configuration, including `db` and `adapter`\n * @returns A new `Storage` instance\n * @example\n * const storage = Storage.init({\n * db: drizzle(dbConnection),\n * adapter: new StorageS3Adapter({\n * bucketName: \"my-app-uploads\",\n * region: \"us-east-1\",\n * credentials: {\n * accessKeyId: process.env.AWS_ACCESS_KEY_ID,\n * secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,\n * },\n * }),\n * });\n */\n static init<TSchema extends TDatabaseSchema>(props: StorageConfig<TSchema>) {\n return new Storage(props);\n }\n\n /**\n * Generates the canonical object key for a storage asset id.\n *\n * This keeps bucket key structure internal to the storage service,\n * so callers only work with asset ids and do not manage object paths.\n *\n * @param input - Storage asset id (UUID)\n * @returns Canonical storage key (e.g. `uploads/<id>`)\n * @example\n * const key = this.#generateKey(\"019d0051-2c0d-741e-9e3c-e5a5bc4d16a2\");\n * // key => \"uploads/019d0051-2c0d-741e-9e3c-e5a5bc4d16a2\"\n */\n #generateKey(input: string) {\n const id = z.uuid().parse(input);\n return `${this.prefix}/${id}`;\n }\n\n /**\n * Builds a query to fetch a storage asset by its ID and the current adapter's provider.\n * @param id - The asset ID to search for\n * @returns A dynamic Drizzle query for fetching a single asset\n * @example\n * let query = storageService.getAssetByIdQuery(\"asset-123\");\n * query = query.where(eq(storageAssets.contentType, \"image/png\")); // Add additional conditions if needed\n * const [asset] = await query;\n */\n getAssetByIdQuery(id: string) {\n return this.#db\n .select()\n .from(storageAssets)\n .where(\n and(\n eq(storageAssets.id, id),\n eq(storageAssets.provider, this.#adapter.key),\n eq(storageAssets.bucket, this.#adapter.bucketName),\n isNull(storageAssets.deletedAt),\n ),\n )\n .limit(1)\n .$dynamic();\n }\n\n /**\n * Fetches a storage asset by its ID.\n * @param id - The asset ID to retrieve\n * @returns The asset object if found, otherwise null\n * @example\n * const asset = await storageService.getAssetById(\"asset-123\");\n * if (asset) {\n * console.log(asset.key, asset.contentType);\n * }\n */\n async getAssetById(id: string) {\n const parsedId = z.uuid().parse(id);\n const [asset] = await this.getAssetByIdQuery(parsedId);\n return asset ?? null;\n }\n\n /**\n * Builds a query to fetch a single ready storage asset by key\n * within the current adapter provider scope.\n *\n * Notes:\n * - Scoped to `this.#adapter.key` to avoid cross-provider leakage.\n * - Targets ready assets by default.\n * - Uniqueness is expected on `(provider, bucket, key)`.\n *\n * @param key - The object key stored in `storage_assets.key`\n * @returns A dynamic Drizzle query returning max 1 row\n * @example\n * let query = storageService.getAssetByKeyQuery(\"uploads/abc/main\");\n * query = query.leftJoin(otherTable, eq(otherTable.assetId, storageAssets.id));\n * const [asset] = await query;\n */\n getAssetByKeyQuery(key: string) {\n return this.#db\n .select()\n .from(storageAssets)\n .where(\n and(\n eq(storageAssets.key, key),\n eq(storageAssets.provider, this.#adapter.key),\n eq(storageAssets.bucket, this.#adapter.bucketName),\n eq(storageAssets.status, \"ready\"),\n isNull(storageAssets.deletedAt),\n ),\n )\n .limit(1)\n .$dynamic();\n }\n\n /**\n * Fetches a single ready storage asset by key.\n *\n * This is the convenience wrapper around `getAssetByKeyQuery`.\n * Use this when you only need the result, not query composition.\n *\n * @param key - Asset key to look up\n * @returns The matching asset or `null` if none is found\n * @example\n * const asset = await storageService.getAssetByKey(\"uploads/abc/main\");\n * if (!asset) return;\n */\n async getAssetByKey(key: string) {\n const [result] = await this.getAssetByKeyQuery(key);\n return result ?? null;\n }\n\n /**\n * Builds a base query for listing storage assets.\n *\n * Scope and defaults:\n * - Scoped to the current adapter provider (`this.#adapter.key`)\n * - Orders by newest first (`createdAt DESC`)\n *\n * This method returns a dynamic query so callers can extend it with\n * custom filters, joins, pagination, and limits.\n *\n * @returns A dynamic Drizzle query for listing assets\n * @example\n * const query = storageService\n * .listAssetsQuery()\n * .limit(50);\n * const assets = await query;\n */\n listAssetsQuery() {\n return this.#db\n .select()\n .from(storageAssets)\n .where(\n and(\n eq(storageAssets.provider, this.#adapter.key),\n eq(storageAssets.bucket, this.#adapter.bucketName),\n isNull(storageAssets.deletedAt),\n ),\n )\n .orderBy(desc(storageAssets.createdAt))\n .$dynamic();\n }\n\n /**\n * Lists storage assets using safe default pagination.\n *\n * This is the convenience wrapper around `listAssetsQuery`.\n * Use `listAssetsQuery()` directly when you need custom query composition.\n *\n * @returns Up to 100 storage assets sorted by newest first\n * @example\n * const assets = await storageService.listAssets();\n */\n async listAssets() {\n const assets = await this.listAssetsQuery().limit(100);\n return assets ?? [];\n }\n\n /**\n * Creates a pending storage asset record and generates a presigned upload URL.\n *\n * Flow:\n * - Validates the input payload\n * - Inserts a `pending` asset in the catalog (`storage_assets`)\n * - Requests a presigned PUT URL from the storage adapter\n * - Marks the asset as `error` if URL generation fails\n *\n * This method is intended for direct-to-storage browser uploads.\n * The upload should be finalized later via a confirm step.\n *\n * @param props - Presign upload input (contentType, size, metadata)\n * @returns The created asset id, key, and presigned URL\n * @throws {ServerError} If intent creation or URL generation fails\n * @example\n * const result = await storageService.presignUpload({\n * contentType: \"image/png\",\n * size: 120_000,\n * metadata: { uploadToken: crypto.randomUUID() },\n * });\n * // result => { id, uploadId, key, presignedUrl }\n */\n async presignUpload(props: PresignUploadInput) {\n const input = presignUploadInputSchema.parse(props);\n\n const id = generateDefaultUUID();\n const uploadId = input.uploadId ?? generateDefaultUUID();\n const key = this.#generateKey(id);\n\n const { contentType, size, metadata, name, visibility } = input;\n\n const [record] = await this.#db\n .insert(storageAssets)\n .values({\n id,\n uploadId,\n key,\n size,\n contentType,\n name,\n visibility,\n provider: this.#adapter.key,\n bucket: this.#adapter.bucketName,\n status: \"pending\",\n metadata,\n })\n .returning();\n\n if (!record) {\n throw new ServerError(\"INTERNAL_SERVER_ERROR\", {\n message: \"Failed to create upload intent\",\n });\n }\n\n try {\n const presignedUrl = await this.#adapter.putObjectURL({ key, contentType, size, metadata });\n\n return { ...record, presignedUrl };\n } catch (error) {\n await this.#db\n .update(storageAssets)\n .set({ status: \"error\" })\n .where(eq(storageAssets.id, record.id));\n\n throw this.#parseError(error, {\n fallbackMessage: \"Failed to generate upload URL\",\n });\n }\n }\n\n /**\n * Confirms a direct-to-storage upload by verifying object existence\n * and transitioning the asset from `pending` to `ready`.\n *\n * Flow:\n * - Validates confirm input\n * - Loads the asset record scoped to the current adapter provider\n * - Returns early if asset is already `ready` (idempotent behavior)\n * - Verifies object existence/metadata via `adapter.headObject`\n * - Marks asset as `error` if verification fails\n * - Updates status to `ready` and stores upload metadata\n *\n * @param props - Confirm upload payload containing the asset uploadId\n * @returns The updated storage asset record\n * @throws {ServerError} If the asset is missing, verification fails, or update fails\n * @example\n * const asset = await storageService.confirmUpload(\"019d0051-2c0d-741e-9e3c-e5a5bc4d16a2\");\n * // asset.status === \"ready\"\n */\n async confirmUpload(props: ConfirmUploadInput) {\n const uploadId = confirmUploadInputSchema.parse(props);\n\n const [record] = await this.#db\n .select()\n .from(storageAssets)\n .where(\n and(\n eq(storageAssets.uploadId, uploadId),\n eq(storageAssets.provider, this.#adapter.key),\n eq(storageAssets.bucket, this.#adapter.bucketName),\n isNull(storageAssets.deletedAt),\n ),\n )\n .limit(1);\n\n if (!record) {\n throw new ServerError(\"NOT_FOUND\", { message: \"Storage asset not found\" });\n }\n\n if (record.status === \"ready\") return record;\n\n let head: Awaited<ReturnType<StorageAdapter[\"headObject\"]>>;\n\n try {\n head = await this.#adapter.headObject({ key: record.key });\n } catch (error) {\n await this.#db\n .update(storageAssets)\n .set({ status: \"error\" })\n .where(eq(storageAssets.id, record.id));\n\n throw this.#parseError(error, {\n fallbackMessage: \"Failed to verify uploaded object\",\n });\n }\n\n const [updated] = await this.#db\n .update(storageAssets)\n .set({\n status: \"ready\",\n uploadedAt: new Date(),\n size: head.size ?? record.size,\n contentType: head.contentType ?? record.contentType,\n })\n .where(and(eq(storageAssets.id, record.id), eq(storageAssets.status, \"pending\")))\n .returning();\n\n if (!updated) {\n throw new ServerError(\"INTERNAL_SERVER_ERROR\", { message: \"Failed to confirm upload\" });\n }\n\n return updated;\n }\n\n /**\n * Uploads an asset directly from the server and persists its catalog record.\n *\n * Flow:\n * - Validates upload input\n * - Creates a `pending` asset record in `storage_assets`\n * - Uploads the object bytes through the storage adapter\n * - Marks the record as `ready` and stores upload metadata\n * - Marks the record as `error` if upload fails\n *\n * This method is intended for server-side uploads (non-presigned flow).\n * For browser direct uploads, use `presignUpload` + `confirmUpload`.\n *\n * @param props - Upload payload (body, contentType, size)\n * @returns The finalized storage asset record\n * @throws {ServerError} If record creation, upload, or finalization fails\n * @example\n * const asset = await storageService.upload({\n * body: fileBuffer,\n * contentType: \"application/pdf\",\n * size: fileBuffer.byteLength,\n * });\n */\n async upload(props: UploadInput) {\n const { body, contentType, size, metadata, name, visibility } = uploadInputSchema.parse(props);\n\n const id = generateDefaultUUID();\n const key = this.#generateKey(id);\n\n const [record] = await this.#db\n .insert(storageAssets)\n .values({\n id,\n key,\n size,\n contentType,\n name,\n visibility,\n provider: this.#adapter.key,\n bucket: this.#adapter.bucketName,\n status: \"pending\",\n metadata,\n })\n .returning();\n\n if (!record) {\n throw new ServerError(\"INTERNAL_SERVER_ERROR\", {\n message: \"Failed to create upload record\",\n });\n }\n\n try {\n const uploaded = await this.#adapter.putObject({ key, body, contentType, size, metadata });\n\n const [updated] = await this.#db\n .update(storageAssets)\n .set({\n status: \"ready\",\n uploadedAt: new Date(),\n size: uploaded.size ?? size ?? record.size,\n contentType: uploaded.contentType ?? contentType ?? record.contentType,\n })\n .where(and(eq(storageAssets.id, record.id), eq(storageAssets.status, \"pending\")))\n .returning();\n\n if (!updated) {\n throw new ServerError(\"INTERNAL_SERVER_ERROR\", {\n message: \"Failed to finalize upload\",\n });\n }\n\n return updated;\n } catch (error) {\n await this.#db\n .update(storageAssets)\n .set({ status: \"error\" })\n .where(and(eq(storageAssets.id, record.id), eq(storageAssets.status, \"pending\")));\n\n throw this.#parseError(error, {\n fallbackMessage: \"Failed to upload object\",\n });\n }\n }\n\n /**\n * Retrieves the object content for a ready storage asset.\n *\n * Flow:\n * - Looks up the asset record by id, scoped to the current adapter provider\n * - Ensures the asset is in `ready` status\n * - Fetches object content from the storage adapter using the stored key\n *\n * @param id - The storage asset id\n * @returns The adapter object response (stream/body + metadata)\n * @throws {ServerError} If the asset does not exist or is not ready\n * @example\n * const object = await storageService.getObject(\"asset-123\");\n * // object.body can be streamed/consumed by caller\n */\n async getObject(input: string) {\n const id = z.uuid().parse(input);\n\n const [record] = await this.#db\n .select()\n .from(storageAssets)\n .where(\n and(\n eq(storageAssets.id, id),\n eq(storageAssets.provider, this.#adapter.key),\n eq(storageAssets.bucket, this.#adapter.bucketName),\n eq(storageAssets.status, \"ready\"),\n isNull(storageAssets.deletedAt),\n ),\n )\n .limit(1);\n\n if (!record) {\n throw new ServerError(\"NOT_FOUND\", { message: \"Storage asset not found\" });\n }\n\n return this.#adapter.getObject(record.key).catch((error) => {\n throw this.#parseError(error, {\n fallbackMessage: \"Failed to retrieve object\",\n });\n });\n }\n\n /**\n * Generates a presigned read URL for a ready storage asset.\n *\n * Flow:\n * - Validates the asset id\n * - Resolves the asset record scoped to the current adapter provider\n * - Ensures the asset is in `ready` status\n * - Delegates URL signing to the storage adapter using the stored key\n *\n * @param input - Storage asset id (UUID)\n * @param options - Optional URL options (for example expiration/disposition)\n * @returns A presigned URL for reading the object\n * @throws {ServerError} If the asset does not exist or is not ready\n * @example\n * const url = await storageService.getObjectURL(\"019d0051-2c0d-741e-9e3c-e5a5bc4d16a2\", {\n * expiresIn: 3600,\n * });\n */\n\n async getObjectURL(input: string, options?: GetObjectURLOptions) {\n const id = z.uuid().parse(input);\n\n const [record] = await this.#db\n .select()\n .from(storageAssets)\n .where(\n and(\n eq(storageAssets.id, id),\n eq(storageAssets.provider, this.#adapter.key),\n eq(storageAssets.bucket, this.#adapter.bucketName),\n eq(storageAssets.status, \"ready\"),\n isNull(storageAssets.deletedAt),\n ),\n )\n .limit(1);\n\n if (!record) {\n throw new ServerError(\"NOT_FOUND\", { message: \"Storage asset not found\" });\n }\n\n return this.#adapter.getObjectURL(record.key, options).catch((error) => {\n throw this.#parseError(error, {\n fallbackMessage: \"Failed to generate object URL\",\n });\n });\n }\n\n /**\n * Soft deletes a single storage asset by id.\n *\n * This is a convenience wrapper around `deleteAssets`.\n *\n * @param input - Storage asset id (UUID)\n * @returns The soft-deleted asset record, or null if not found/already deleted\n */\n async deleteAsset(input: string) {\n const id = z.uuid().parse(input);\n const [deleted] = await this.deleteAssets([id]);\n return deleted ?? null;\n }\n\n /**\n * Soft deletes multiple storage assets by setting `deletedAt`.\n *\n * Flow:\n * - Validates and de-duplicates ids\n * - Resolves provider-scoped active records\n * - Marks matching rows as deleted by setting `deletedAt`\n *\n * @param input - Storage asset ids (UUID[])\n * @returns Soft-deleted asset records\n */\n async deleteAssets(input: string[]) {\n const ids = [...new Set(z.array(z.uuid()).parse(input))];\n if (ids.length === 0) return [];\n\n return this.#db\n .update(storageAssets)\n .set({ deletedAt: new Date() })\n .where(\n and(\n inArray(storageAssets.id, ids),\n eq(storageAssets.provider, this.#adapter.key),\n eq(storageAssets.bucket, this.#adapter.bucketName),\n isNull(storageAssets.deletedAt),\n ),\n )\n .returning();\n }\n\n /**\n * Restores a single soft-deleted storage asset.\n *\n * This is a convenience wrapper around `restoreAssets`.\n *\n * @param input - Storage asset id (UUID)\n * @returns The restored asset record, or null if not found/not deleted\n */\n async restoreAsset(input: string) {\n const id = z.uuid().parse(input);\n const [restored] = await this.restoreAssets([id]);\n return restored ?? null;\n }\n\n /**\n * Restores multiple soft-deleted storage assets by clearing `deletedAt`.\n *\n * @param input - Storage asset ids (UUID[])\n * @returns Restored asset records\n */\n async restoreAssets(input: string[]) {\n const ids = [...new Set(z.array(z.uuid()).parse(input))];\n if (ids.length === 0) return [];\n\n return this.#db\n .update(storageAssets)\n .set({ deletedAt: null })\n .where(\n and(\n inArray(storageAssets.id, ids),\n eq(storageAssets.provider, this.#adapter.key),\n eq(storageAssets.bucket, this.#adapter.bucketName),\n isNotNull(storageAssets.deletedAt),\n ),\n )\n .returning();\n }\n\n /**\n * Hard deletes a single storage asset.\n *\n * This is a convenience wrapper around `purgeAssets`.\n *\n * @param input - Storage asset id (UUID)\n * @returns The purged asset record, or null if not found\n */\n async purgeAsset(input: string) {\n const id = z.uuid().parse(input);\n const [deleted] = await this.purgeAssets([id]);\n return deleted ?? null;\n }\n\n /**\n * Hard deletes multiple storage assets.\n *\n * Flow:\n * - Validates and de-duplicates ids\n * - Resolves provider-scoped records\n * - Deletes physical objects from the adapter by key\n * - Hard deletes DB records\n *\n * @param input - Storage asset ids (UUID[])\n * @returns Purged asset records\n * @throws {ServerError} If provider deletion fails\n */\n async purgeAssets(input: string[]) {\n const ids = [...new Set(z.array(z.uuid()).parse(input))];\n if (ids.length === 0) return [];\n\n const records = await this.#db\n .select({\n id: storageAssets.id,\n key: storageAssets.key,\n })\n .from(storageAssets)\n .where(\n and(\n inArray(storageAssets.id, ids),\n eq(storageAssets.provider, this.#adapter.key),\n eq(storageAssets.bucket, this.#adapter.bucketName),\n ),\n );\n\n if (records.length === 0) return [];\n\n const keys = records.map((r) => r.key);\n\n try {\n await this.#adapter.deleteObjects(keys);\n } catch (error) {\n throw this.#parseError(error, {\n fallbackMessage: \"Failed to delete storage objects\",\n });\n }\n\n const deletedIds = records.map((r) => r.id);\n\n const deleted = await this.#db\n .delete(storageAssets)\n .where(\n and(\n inArray(storageAssets.id, deletedIds),\n eq(storageAssets.provider, this.#adapter.key),\n eq(storageAssets.bucket, this.#adapter.bucketName),\n ),\n )\n .returning();\n\n return deleted;\n }\n\n /**\n * Normalizes unknown adapter/service errors into a consistent `ServerError`.\n *\n * Behavior:\n * - Returns existing `ServerError` instances unchanged\n * - Maps known storage adapter errors to application-level server errors\n * - Falls back to a generic internal server error for unknown failures\n *\n * This keeps adapter-specific errors inside the storage layer while exposing\n * a stable error contract to route handlers and RPC procedures.\n *\n * @param error - The unknown error to normalize\n * @param options - Optional fallback message for non-specific failures\n * @returns A normalized `ServerError`\n */\n\n #parseError(error: unknown, options?: { fallbackMessage: string }) {\n // If it's already a ServerError, return as-is to avoid double-wrapping\n if (error instanceof ServerError) return error;\n\n // Handle known storage adapter errors and convert to appropriate ServerError\n if (error instanceof StorageAdapterError) {\n if (error.code === \"OBJECT_NOT_FOUND\") {\n return new ServerError(\"NOT_FOUND\", {\n message: \"Storage asset not found\",\n cause: error,\n });\n }\n\n return new ServerError(\"INTERNAL_SERVER_ERROR\", {\n message: options?.fallbackMessage ?? \"Storage adapter error\",\n cause: error,\n });\n }\n\n // For unknown errors, return a generic server error with limited information to avoid leaking details\n return new ServerError(\"INTERNAL_SERVER_ERROR\", {\n message: options?.fallbackMessage ?? \"Unknown storage error\",\n cause: error instanceof Error ? error : undefined,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAa,UAAb,MAAa,QAAyC;CACpD;CACA;CACA;CAEA,AAAQ,YAAY,EAAE,IAAI,SAAS,UAAkC;AACnE,QAAKA,KAAM;AACX,QAAKC,UAAW;AAChB,OAAK,SAAS,UAAU;;;;;;;;;;;;;;;;;;;;;;;CAwB1B,OAAO,KAAsC,OAA+B;AAC1E,SAAO,IAAI,QAAQ,MAAM;;;;;;;;;;;;;;CAe3B,aAAa,OAAe;EAC1B,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,MAAM;AAChC,SAAO,GAAG,KAAK,OAAO,GAAG;;;;;;;;;;;CAY3B,kBAAkB,IAAY;AAC5B,SAAO,MAAKD,GACT,QAAQ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B,iBAAA;EAC9C,MAAA,GAAS,KAAA,EAAO,iBAAA,EAAmB,KAAA,GAAQ,WAAA,KAAgB,OAAA,CAAQ,wBAAA;EACnE,WAAA,GAAc,EAAA,aAAe,OAAA,CAAQ,wBAAA;EACrC,YAAA,GAAe,GAAA,eAAkB,OAAA,CAAQ,wBAAA;EACzC,YAAA,GAAe,EAAA,aAAe,OAAA,CAAQ,wBAAA;EACtC,aAAA,GAAgB,GAAA,eAAkB,OAAA,CAAQ,wBAAA;EAC1C,UAAA,GAAa,EAAA,aAAe,OAAA,CAAQ,wBAAA;EACpC,WAAA,GAAc,GAAA,eAAkB,OAAA,CAAQ,wBAAA;AAAA;;;;KAMrC,wBAAA;EACH,SAAA;IACE,OAAA,GAAU,KAAA,EAAO,mBAAA,gBAAmC,OAAA,CAAQ,oBAAA;IAC5D,OAAA,GAAU,QAAA,EAAU,mBAAA,gBAAmC,OAAA,CAAQ,oBAAA;IAC/D,YAAA,GACE,GAAA,EAAK,mBAAA,qBACF,OAAA,CAAQ,oBAAA;IACb,WAAA,GACE,EAAA,EAAI,mBAAA,oBACD,OAAA,CAAQ,oBAAA;IACb,YAAA,GACE,EAAA,EAAI,mBAAA,qBACD,OAAA,CAAQ,oBAAA;IACb,aAAA,GACE,GAAA,EAAK,mBAAA,sBACF,OAAA,CAAQ,oBAAA;IACb,UAAA,GACE,EAAA,EAAI,mBAAA,mBACD,OAAA,CAAQ,oBAAA;IACb,WAAA,GACE,GAAA,EAAK,mBAAA,oBACF,OAAA,CAAQ,oBAAA;EAAA;AAAA;;;;;;;AAnCjB;;;iBAgDgB,kBAAA,CAAmB,KAAA,EAAO,wBAAA,GAA2B,YAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload.client.mjs","names":[],"sources":["../../../../src/modules/storage/lib/upload.client.ts"],"sourcesContent":["import type { StorageRouterInputs, StorageRouterOutputs } from \"./procedures.server\";\nimport type {\n PresignUploadInput,\n PresignUploadOutput,\n SelectStorageAssetSchema,\n} from \"./validators\";\n\n/**\n * Upload request\n */\nexport type UploadFileRequest = PresignUploadInput & { file: File };\nexport type PrepareUploadInput = Omit<UploadFileRequest, \"name\" | \"contentType\" | \"size\">;\nexport type UploadHooks = {\n beforePresign?: (input: UploadFileRequest) => Promise<void> | void;\n afterPresign?: (presignResult: PresignUploadOutput) => Promise<void> | void;\n beforeConfirm?: (presignResult: PresignUploadOutput) => Promise<void> | void;\n afterConfirm?: (asset: SelectStorageAssetSchema) => Promise<void> | void;\n};\n\n/**\n * Upload client\n */\nexport type UploadClient = {\n prepareUpload: (input: PrepareUploadInput) => UploadFileRequest;\n upload: (input: UploadFileRequest, hooks?: UploadHooks) => Promise<SelectStorageAssetSchema>;\n deleteAsset: (id: string) => Promise<SelectStorageAssetSchema | null>;\n deleteAssets: (ids: string[]) => Promise<SelectStorageAssetSchema[]>;\n restoreAsset: (id: string) => Promise<SelectStorageAssetSchema | null>;\n restoreAssets: (ids: string[]) => Promise<SelectStorageAssetSchema[]>;\n purgeAsset: (id: string) => Promise<SelectStorageAssetSchema | null>;\n purgeAssets: (ids: string[]) => Promise<SelectStorageAssetSchema[]>;\n};\n\n/**\n * Create upload client props\n */\ntype CreateStorageClientProps = {\n endpoints: {\n presign: (input: StorageRouterInputs[\"presign\"]) => Promise<StorageRouterOutputs[\"presign\"]>;\n confirm: (uploadId: StorageRouterInputs[\"confirm\"]) => Promise<StorageRouterOutputs[\"confirm\"]>;\n deleteAssets: (\n ids: StorageRouterInputs[\"deleteAssets\"],\n ) => Promise<StorageRouterOutputs[\"deleteAssets\"]>;\n deleteAsset: (\n id: StorageRouterInputs[\"deleteAsset\"],\n ) => Promise<StorageRouterOutputs[\"deleteAsset\"]>;\n restoreAsset: (\n id: StorageRouterInputs[\"restoreAsset\"],\n ) => Promise<StorageRouterOutputs[\"restoreAsset\"]>;\n restoreAssets: (\n ids: StorageRouterInputs[\"restoreAssets\"],\n ) => Promise<StorageRouterOutputs[\"restoreAssets\"]>;\n purgeAsset: (\n id: StorageRouterInputs[\"purgeAsset\"],\n ) => Promise<StorageRouterOutputs[\"purgeAsset\"]>;\n purgeAssets: (\n ids: StorageRouterInputs[\"purgeAssets\"],\n ) => Promise<StorageRouterOutputs[\"purgeAssets\"]>;\n };\n};\n\n/**\n * Creates an upload client for the storage module.\n *\n * Flow:\n * - Prepare upload payload with generated id and resolved key\n * - Request presigned upload URL from server\n * - Upload file bytes directly to object storage\n * - Confirm upload and receive finalized storage asset\n */\nexport function createUploadClient(props: CreateStorageClientProps): UploadClient {\n /**\n * Create input schema for the upload method\n * @param {PrepareUploadInput} input\n * @returns {UploadFileRequest}\n */\n function prepareUpload(input: PrepareUploadInput): UploadFileRequest {\n return {\n ...input,\n uploadId: input.uploadId ?? crypto.randomUUID(),\n name: input.file.name,\n size: input.file.size,\n contentType: input.file.type || \"application/octet-stream\",\n };\n }\n\n /**\n * Upload file to the server\n * @param {UploadFileRequest} input\n * @returns {Promise<SelectStorageAssetSchema>}\n */\n async function upload(\n input: UploadFileRequest,\n hooks?: UploadHooks,\n ): Promise<SelectStorageAssetSchema> {\n let presignResult: PresignUploadOutput | null = null;\n\n try {\n /**\n * Presign\n */\n await hooks?.beforePresign?.(input);\n presignResult = await props.endpoints.presign(input);\n await hooks?.afterPresign?.(presignResult);\n\n /**\n * Upload the file\n */\n const uploadResponse = await fetch(presignResult.presignedUrl, {\n method: \"PUT\",\n headers: { \"Content-Type\": input.contentType || \"application/octet-stream\" },\n body: input.file,\n });\n\n if (!uploadResponse.ok) {\n const message = await uploadResponse.text();\n throw new Error(`Upload failed: ${message}`);\n }\n\n /**\n * Confirm\n */\n await hooks?.beforeConfirm?.(presignResult);\n const asset = await props.endpoints.confirm(presignResult.uploadId);\n await hooks?.afterConfirm?.(asset);\n /**\n * Return\n */\n return asset;\n } catch (err) {\n console.error(\"Upload error: \", err);\n\n /**\n * Delete if upload failed\n * */\n if (presignResult) {\n await props.endpoints.deleteAsset(presignResult.id).catch((deleteErr) => {\n console.error(\"Failed to delete asset after upload error: \", deleteErr);\n });\n }\n\n throw err;\n }\n }\n\n return {\n prepareUpload,\n upload,\n deleteAsset: props.endpoints.deleteAsset,\n deleteAssets: props.endpoints.deleteAssets,\n restoreAsset: props.endpoints.restoreAsset,\n restoreAssets: props.endpoints.restoreAssets,\n purgeAsset: props.endpoints.purgeAsset,\n purgeAssets: props.endpoints.purgeAssets,\n };\n}\n"],"mappings":";;;;;;;;;;AAsEA,SAAgB,mBAAmB,OAA+C;;;;;;CAMhF,SAAS,cAAc,OAA8C;AACnE,SAAO;GACL,GAAG;GACH,UAAU,MAAM,YAAY,OAAO,YAAY;GAC/C,MAAM,MAAM,KAAK;GACjB,MAAM,MAAM,KAAK;GACjB,aAAa,MAAM,KAAK,QAAQ;GACjC;;;;;;;CAQH,eAAe,OACb,OACA,OACmC;EACnC,IAAI,gBAA4C;AAEhD,MAAI;;;;AAIF,SAAM,OAAO,gBAAgB,MAAM;AACnC,mBAAgB,MAAM,MAAM,UAAU,QAAQ,MAAM;AACpD,SAAM,OAAO,eAAe,cAAc;;;;GAK1C,MAAM,iBAAiB,MAAM,MAAM,cAAc,cAAc;IAC7D,QAAQ;IACR,SAAS,EAAE,gBAAgB,MAAM,eAAe,4BAA4B;IAC5E,MAAM,MAAM;IACb,CAAC;AAEF,OAAI,CAAC,eAAe,IAAI;IACtB,MAAM,UAAU,MAAM,eAAe,MAAM;AAC3C,UAAM,IAAI,MAAM,kBAAkB,UAAU;;;;;AAM9C,SAAM,OAAO,gBAAgB,cAAc;GAC3C,MAAM,QAAQ,MAAM,MAAM,UAAU,QAAQ,cAAc,SAAS;AACnE,SAAM,OAAO,eAAe,MAAM;;;;AAIlC,UAAO;WACA,KAAK;AACZ,WAAQ,MAAM,kBAAkB,IAAI;;;;AAKpC,OAAI,cACF,OAAM,MAAM,UAAU,YAAY,cAAc,GAAG,CAAC,OAAO,cAAc;AACvE,YAAQ,MAAM,+CAA+C,UAAU;KACvE;AAGJ,SAAM;;;AAIV,QAAO;EACL;EACA;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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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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 storageS3Adapter(config: StorageS3AdapterConfig): StorageAdapter {\n return new StorageS3Adapter(config);\n}\n"],"mappings":";;;;;;;;;;;;;AAiDA,IAAM,mBAAN,MAAiD;;;;CAI/C,MAAuB;CACvB;CACA;;;;CAKA,YAAY,EAAE,YAAY,GAAG,UAAkC;AAC7D,OAAK,SAAS,IAAI,SAAS,OAAO;AAClC,OAAK,aAAa;;;;;CAMpB,kBAAkB,OAAuB,UAA4B,EAAE,EAAE;EACvE,MAAM,MAAM,qBAAqB,MAAM,MAAM;EAC7C,MAAM,EAAE,gBAAgB,uBAAuB,MAAM,QAAQ;AAE7D,SAAO,IAAI,iBAAiB;GAC1B,QAAQ,KAAK;GACb,KAAK;GACL,4BAA4B;GAC7B,CAAC;;;;;CAMJ,MAAM,UAAU,OAAuB,UAA4B,EAAE,EAA4B;EAC/F,MAAM,aAAa,MAAKA,iBAAkB,OAAO,QAAQ;EAEzD,MAAM,SAAS,MAAM,KAAK,OAAO,KAAK,WAAW;AAEjD,MAAI,OAAO,QAAQ,KACjB,OAAM,IAAI,oBAAoB,uBAAuB,0BAA0B,EAC7E,uBAAO,IAAI,MACT,kBAAkB,OAAO,cAAc,iBAAiB,OAAO,YAAY,UAAU,OAAO,OAC7F,EACF,CAAC;AAGJ,SAAO,sBAAsB,MAAM;GACjC,aAAa,OAAO;GACpB,MAAM,OAAO;GACb,UAAU,OAAO;GACjB,MAAM,MAAKC,WAAY,OAAO,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SAAS,QAAQ,KAAkC;AAI5D,MAAI,OAAO,SAAS,YAAY,gBAAgB,cAAc,OAAO,SAAS,KAAK,CACjF,QAAO,SAAS,KAAK,CAAC,KAAK,CAAC;AAG9B,QAAM,IAAI,oBAAoB,yBAAyB,+BAA+B;;;;;;;;;;;AAY1F,SAAgB,iBAAiB,QAAgD;AAC/E,QAAO,IAAI,iBAAiB,OAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.mts","names":[],"sources":["../../../../../src/modules/storage/providers/lib/constants.ts"],"mappings":";cACa,gBAAA;AAAA,KACD,eAAA,WAA0B,gBAAA"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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,GAAA,UAAA,CAAA,WAAA,IAAA,GAAA,CAAA,SAAA,CAAA,MAAA,CAAA,eAAA,GAAA,MAAA,CAAA,eAAA,IAAA,GAAA,CAAA,SAAA,CAAA,QAAA,EAAA,QAAA;AAAA,KAOtB,eAAA,GAAkB,GAAA,CAAE,KAAA,QAAa,qBAAA;;;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AAA,GAAkB,GAAA,CAAE,KAAA,QAAa,qBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"validators.mjs","names":["z"],"sources":["../../../../../src/modules/storage/providers/lib/validators.ts"],"sourcesContent":["import { Readable } from \"node:stream\";\nimport { z } from \"zod\";\n\n/**\n * Object body schema\n */\nexport const objectBodyInputSchema = z.union([\n z.string(),\n z.instanceof(Uint8Array),\n z.instanceof(Buffer),\n z.instanceof(Readable),\n]);\n\nexport type ObjectBodyInput = z.infer<typeof objectBodyInputSchema>;\n\n/**\n * Object body output schema (normalized)\n */\nexport const objectBodyOutputSchema = z.instanceof(Readable);\n\nexport type ObjectBodyOutput = z.infer<typeof objectBodyOutputSchema>;\n\n/**\n * Object schema\n */\nexport const objectSchema = z.object({\n contentType: z.string().nullable().optional(),\n size: z.number().nullable().optional(),\n metadata: z.record(z.string(), z.string()).optional(),\n});\n\nexport type ObjectSchema = z.infer<typeof objectSchema>;\n\n/**\n * Get object input\n */\nexport const getObjectInputSchema = z.string();\nexport type GetObjectInput = z.input<typeof getObjectInputSchema>;\n\n/**\n * Get object options schema\n */\nexport const getObjectOptionsDefaults = { disposition: \"inline\" } as const;\n\nexport const getObjectOptionsSchema = z.object({\n disposition: z.string().optional().default(getObjectOptionsDefaults.disposition),\n});\n\nexport type GetObjectOptions = z.input<typeof getObjectOptionsSchema>;\n\n/**\n * Get object URL input\n */\nexport const getObjectURLOptionsSchema = getObjectOptionsSchema.extend({\n expiresIn: z\n .number()\n .optional()\n .default(3600 * 24),\n});\n\nexport type GetObjectURLOptions = z.input<typeof getObjectURLOptionsSchema>;\n\n/**\n * Get object output\n */\nexport const getObjectOutputSchema = objectSchema.extend({\n body: objectBodyOutputSchema,\n});\n\nexport type GetObjectOutput = z.infer<typeof getObjectOutputSchema>;\n\n/**\n * Get object head input\n */\nexport const headObjectInputSchema = z.object({\n key: z.string(),\n});\n\nexport type HeadObjectInput = z.input<typeof headObjectInputSchema>;\n\n/**\n * Head object output\n */\nexport const headObjectOutputSchema = objectSchema;\n\nexport type HeadObjectOutput = z.infer<typeof headObjectOutputSchema>;\n\n/**\n * Put object URL input\n */\nexport const putObjectURLInputSchema = z.object({\n key: z.string(),\n contentType: z.string().nullable().optional(),\n size: z.number().nullable().optional(),\n metadata: z.record(z.string(), z.string()).optional(),\n});\n\nexport type PutObjectURLInput = z.input<typeof putObjectURLInputSchema>;\n\n/**\n * Put object URL input\n */\nexport const putObjectURLOptionsSchema = z.object({\n expiresIn: z.number().optional().default(3600),\n});\n\nexport type PutObjectURLOptions = z.input<typeof putObjectURLOptionsSchema>;\n\n/**\n * Put object input\n */\nexport const putObjectInputSchema = putObjectURLInputSchema.extend({\n body: objectBodyInputSchema,\n});\n\nexport type PutObjectInput = z.input<typeof putObjectInputSchema>;\n\n/**\n * Put object schema\n */\nexport const putObjectOutputSchema = objectSchema;\nexport type PutObjectOutput = z.infer<typeof putObjectOutputSchema>;\n"],"mappings":";;;;;;;AAMA,MAAa,wBAAwBA,IAAE,MAAM;CAC3CA,IAAE,QAAQ;CACVA,IAAE,WAAW,WAAW;CACxBA,IAAE,WAAW,OAAO;CACpBA,IAAE,WAAW,SAAS;CACvB,CAAC;;;;AAOF,MAAa,yBAAyBA,IAAE,WAAW,SAAS;;;;AAO5D,MAAa,eAAeA,IAAE,OAAO;CACnC,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC7C,MAAMA,IAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CACtC,UAAUA,IAAE,OAAOA,IAAE,QAAQ,EAAEA,IAAE,QAAQ,CAAC,CAAC,UAAU;CACtD,CAAC;;;;AAOF,MAAa,uBAAuBA,IAAE,QAAQ;;;;AAM9C,MAAa,2BAA2B,EAAE,aAAa,UAAU;AAEjE,MAAa,yBAAyBA,IAAE,OAAO,EAC7C,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,yBAAyB,YAAY,EACjF,CAAC;;;;AAOF,MAAa,4BAA4B,uBAAuB,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