@tulip-systems/core 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/dist/auth/server.d.mts +3 -3
  2. package/dist/auth/server.mjs +3 -3
  3. package/dist/components/editor/components/editor.client.d.mts +4 -3
  4. package/dist/components/editor/components/editor.client.d.mts.map +1 -1
  5. package/dist/components/editor/components/editor.client.mjs +5 -2
  6. package/dist/components/editor/components/editor.client.mjs.map +1 -1
  7. package/dist/components/editor/extensions/file-handler/extension.d.mts +4 -4
  8. package/dist/components/editor/extensions/file-handler/extension.d.mts.map +1 -1
  9. package/dist/components/editor/extensions/file-handler/extension.mjs.map +1 -1
  10. package/dist/components/editor/extensions/file-handler/strategy.d.mts +4 -6
  11. package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +1 -1
  12. package/dist/components/editor/extensions/file-handler/strategy.mjs +11 -11
  13. package/dist/components/editor/extensions/file-handler/strategy.mjs.map +1 -1
  14. package/dist/components/editor/extensions/file-handler/utils.mjs +1 -1
  15. package/dist/components/editor/extensions/file-handler/utils.mjs.map +1 -1
  16. package/dist/components/editor/extensions/image/extension.mjs +9 -9
  17. package/dist/components/editor/extensions/image/extension.mjs.map +1 -1
  18. package/dist/components/editor/lib/constants.d.mts +1 -1
  19. package/dist/components/editor/lib/constants.mjs +1 -1
  20. package/dist/components/editor/lib/extensions.d.mts +1 -1
  21. package/dist/components/editor/lib/helpers.d.mts +11 -3
  22. package/dist/components/editor/lib/helpers.d.mts.map +1 -1
  23. package/dist/components/editor/lib/helpers.mjs +27 -13
  24. package/dist/components/editor/lib/helpers.mjs.map +1 -1
  25. package/dist/components/ui/combobox-dropdown.client.mjs +1 -0
  26. package/dist/components/ui/combobox-dropdown.client.mjs.map +1 -1
  27. package/dist/components/ui/combobox.client.mjs +1 -1
  28. package/dist/components/ui/combobox.client.mjs.map +1 -1
  29. package/dist/components.d.mts +2 -2
  30. package/dist/components.mjs +2 -2
  31. package/dist/config/server.d.mts +1 -3
  32. package/dist/config/server.mjs +1 -4
  33. package/dist/config.d.mts +2 -2
  34. package/dist/config.mjs +1 -1
  35. package/dist/data-tables/client.d.mts +2 -1
  36. package/dist/data-tables/client.mjs +2 -1
  37. package/dist/data-tables.d.mts +1 -1
  38. package/dist/database/client.d.mts +1 -0
  39. package/dist/database/client.mjs +1 -0
  40. package/dist/database/server.d.mts +2 -0
  41. package/dist/database/server.mjs +3 -0
  42. package/dist/database.d.mts +3 -0
  43. package/dist/database.mjs +3 -0
  44. package/dist/emails/client.d.mts +1 -0
  45. package/dist/emails/client.mjs +1 -0
  46. package/dist/emails/server.d.mts +2 -0
  47. package/dist/emails/server.mjs +3 -0
  48. package/dist/emails.d.mts +1 -0
  49. package/dist/emails.mjs +1 -0
  50. package/dist/lib/utils/markdown.d.mts +10 -0
  51. package/dist/lib/utils/markdown.d.mts.map +1 -0
  52. package/dist/lib/utils/markdown.mjs +15 -0
  53. package/dist/lib/utils/markdown.mjs.map +1 -0
  54. package/dist/lib/utils/url.mjs +2 -1
  55. package/dist/lib/utils/url.mjs.map +1 -1
  56. package/dist/lib/utils/user-agent.mjs +15 -0
  57. package/dist/lib/utils/user-agent.mjs.map +1 -1
  58. package/dist/lib.d.mts +2 -2
  59. package/dist/lib.mjs +2 -2
  60. package/dist/modules/auth/components/create-first-user-guard.server.d.mts +16 -0
  61. package/dist/modules/auth/components/create-first-user-guard.server.d.mts.map +1 -0
  62. package/dist/modules/auth/components/create-first-user-guard.server.mjs +16 -0
  63. package/dist/modules/auth/components/create-first-user-guard.server.mjs.map +1 -0
  64. package/dist/modules/auth/components/guard.server.d.mts +2 -2
  65. package/dist/modules/auth/components/guard.server.mjs +1 -1
  66. package/dist/modules/auth/components/guard.server.mjs.map +1 -1
  67. package/dist/modules/auth/db/schema.d.mts +1 -1
  68. package/dist/modules/auth/db/schema.mjs +2 -2
  69. package/dist/modules/auth/handler/create-client.client.d.mts +4838 -229
  70. package/dist/modules/auth/handler/create-client.client.d.mts.map +1 -1
  71. package/dist/modules/auth/handler/create-client.client.mjs.map +1 -1
  72. package/dist/modules/auth/handler/proxy.server.mjs +2 -2
  73. package/dist/modules/auth/handler/proxy.server.mjs.map +1 -1
  74. package/dist/modules/auth/handler/route.server.d.mts +2 -2
  75. package/dist/modules/auth/handler/route.server.d.mts.map +1 -1
  76. package/dist/modules/auth/handler/route.server.mjs.map +1 -1
  77. package/dist/modules/auth/handler/{init.d.mts → service.server.d.mts} +322 -90
  78. package/dist/modules/auth/handler/service.server.d.mts.map +1 -0
  79. package/dist/modules/auth/handler/{init.mjs → service.server.mjs} +19 -8
  80. package/dist/modules/auth/handler/service.server.mjs.map +1 -0
  81. package/dist/modules/auth/hooks/use-session.d.mts +9 -4
  82. package/dist/modules/auth/hooks/use-session.d.mts.map +1 -1
  83. package/dist/modules/auth/lib/helpers.server.d.mts +1 -1
  84. package/dist/modules/auth/lib/permissions.d.mts +1 -1
  85. package/dist/modules/auth/lib/validators.mjs +1 -1
  86. package/dist/modules/config/lib/context.d.mts +9 -10
  87. package/dist/modules/config/lib/context.d.mts.map +1 -1
  88. package/dist/modules/config/lib/context.mjs.map +1 -1
  89. package/dist/modules/data-tables/lib/converters/search.d.mts +1 -1
  90. package/dist/modules/data-tables/lib/converters/sorting.d.mts +1 -1
  91. package/dist/modules/data-tables/server/get-data.server.d.mts +3 -3
  92. package/dist/modules/data-tables/server/get-data.server.mjs +1 -1
  93. package/dist/modules/data-tables/server/get-data.server.mjs.map +1 -1
  94. package/dist/modules/data-tables/strategies/infinite/strategy.d.mts +1 -1
  95. package/dist/modules/data-tables/strategies/infinite/strategy.mjs +3 -0
  96. package/dist/modules/data-tables/strategies/infinite/strategy.mjs.map +1 -1
  97. package/dist/modules/data-tables/tables/data-table/components/row.mjs +5 -15
  98. package/dist/modules/data-tables/tables/data-table/components/row.mjs.map +1 -1
  99. package/dist/modules/data-tables/tables/inline-table/components/body.mjs +1 -1
  100. package/dist/modules/data-tables/tables/inline-table/components/body.mjs.map +1 -1
  101. package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs +13 -23
  102. package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs.map +1 -1
  103. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +1 -0
  104. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
  105. package/dist/modules/data-tables/tables/inline-table/components/table.mjs +2 -1
  106. package/dist/modules/data-tables/tables/inline-table/components/table.mjs.map +1 -1
  107. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +5 -1
  108. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
  109. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs +2 -1
  110. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs.map +1 -1
  111. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts +30 -0
  112. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts.map +1 -0
  113. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs +77 -9
  114. package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs.map +1 -1
  115. package/dist/modules/{config/db → database/lib}/helpers.d.mts +2 -2
  116. package/dist/modules/database/lib/helpers.d.mts.map +1 -0
  117. package/dist/modules/{config/db → database/lib}/helpers.mjs +1 -1
  118. package/dist/modules/database/lib/helpers.mjs.map +1 -0
  119. package/dist/modules/database/lib/service.server.d.mts +34 -0
  120. package/dist/modules/database/lib/service.server.d.mts.map +1 -0
  121. package/dist/modules/database/lib/service.server.mjs +24 -0
  122. package/dist/modules/database/lib/service.server.mjs.map +1 -0
  123. package/dist/modules/{config/db → database/lib}/types.d.mts +1 -1
  124. package/dist/modules/database/lib/types.d.mts.map +1 -0
  125. package/dist/modules/emails/lib/service.server.d.mts +29 -0
  126. package/dist/modules/emails/lib/service.server.d.mts.map +1 -0
  127. package/dist/modules/emails/lib/service.server.mjs +21 -0
  128. package/dist/modules/emails/lib/service.server.mjs.map +1 -0
  129. package/dist/modules/inline-edit/components/date-input.client.mjs +1 -1
  130. package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
  131. package/dist/modules/inline-edit/components/date-picker.client.mjs +1 -0
  132. package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
  133. package/dist/modules/inline-edit/components/date-time.client.mjs +1 -0
  134. package/dist/modules/inline-edit/components/date-time.client.mjs.map +1 -1
  135. package/dist/modules/inline-edit/components/editor.client.mjs +1 -0
  136. package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
  137. package/dist/modules/inline-edit/components/input-recipient.client.mjs +1 -0
  138. package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
  139. package/dist/modules/inline-edit/components/input-toggle.client.mjs +1 -0
  140. package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
  141. package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
  142. package/dist/modules/inline-edit/components/input.client.mjs +3 -0
  143. package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
  144. package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
  145. package/dist/modules/inline-edit/components/select.client.mjs +1 -0
  146. package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
  147. package/dist/modules/inline-edit/components/switch.client.mjs +1 -0
  148. package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
  149. package/dist/modules/inline-edit/components/toggle.client.mjs +1 -0
  150. package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
  151. package/dist/modules/router/handler/context.server.d.mts +12 -10
  152. package/dist/modules/router/handler/context.server.d.mts.map +1 -1
  153. package/dist/modules/router/handler/init.server.d.mts +13 -11
  154. package/dist/modules/router/handler/init.server.d.mts.map +1 -1
  155. package/dist/modules/router/handler/init.server.mjs +2 -2
  156. package/dist/modules/router/handler/init.server.mjs.map +1 -1
  157. package/dist/modules/router/handler/route.server.d.mts +1 -1
  158. package/dist/modules/storage/components/dropzone.client.d.mts +2 -2
  159. package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
  160. package/dist/modules/storage/components/dropzone.client.mjs.map +1 -1
  161. package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
  162. package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -1
  163. package/dist/modules/storage/components/image-grid.client.mjs +20 -22
  164. package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
  165. package/dist/modules/storage/components/image.client.d.mts +8 -0
  166. package/dist/modules/storage/components/image.client.d.mts.map +1 -0
  167. package/dist/modules/storage/components/image.client.mjs +17 -0
  168. package/dist/modules/storage/components/image.client.mjs.map +1 -0
  169. package/dist/modules/storage/components/upload-button.client.d.mts +12 -0
  170. package/dist/modules/storage/components/upload-button.client.d.mts.map +1 -0
  171. package/dist/modules/storage/components/upload-button.client.mjs +34 -0
  172. package/dist/modules/storage/components/upload-button.client.mjs.map +1 -0
  173. package/dist/modules/storage/components/upload-zone-context.client.d.mts +5 -5
  174. package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
  175. package/dist/modules/storage/components/upload-zone-context.client.mjs +2 -2
  176. package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
  177. package/dist/modules/storage/components/upload-zone.client.d.mts +4 -4
  178. package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
  179. package/dist/modules/storage/components/upload-zone.client.mjs +16 -9
  180. package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
  181. package/dist/modules/storage/lib/constants.d.mts +1 -5
  182. package/dist/modules/storage/lib/constants.d.mts.map +1 -1
  183. package/dist/modules/storage/lib/constants.mjs +1 -13
  184. package/dist/modules/storage/lib/constants.mjs.map +1 -1
  185. package/dist/modules/storage/lib/helpers.d.mts +14 -28
  186. package/dist/modules/storage/lib/helpers.d.mts.map +1 -1
  187. package/dist/modules/storage/lib/helpers.mjs +17 -75
  188. package/dist/modules/storage/lib/helpers.mjs.map +1 -1
  189. package/dist/modules/storage/lib/procedures.server.d.mts +1991 -0
  190. package/dist/modules/{auth/handler/init.d.mts.map → storage/lib/procedures.server.d.mts.map} +1 -1
  191. package/dist/modules/storage/lib/procedures.server.mjs +22 -0
  192. package/dist/modules/storage/lib/procedures.server.mjs.map +1 -0
  193. package/dist/modules/storage/lib/router-handlers.server.d.mts +41 -0
  194. package/dist/modules/storage/lib/router-handlers.server.d.mts.map +1 -0
  195. package/dist/modules/storage/lib/router-handlers.server.mjs +124 -0
  196. package/dist/modules/storage/lib/router-handlers.server.mjs.map +1 -0
  197. package/dist/modules/storage/lib/schema.d.mts +68 -958
  198. package/dist/modules/storage/lib/schema.d.mts.map +1 -1
  199. package/dist/modules/storage/lib/schema.mjs +28 -65
  200. package/dist/modules/storage/lib/schema.mjs.map +1 -1
  201. package/dist/modules/storage/lib/service.server.d.mts +2155 -141
  202. package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
  203. package/dist/modules/storage/lib/service.server.mjs +453 -242
  204. package/dist/modules/storage/lib/service.server.mjs.map +1 -1
  205. package/dist/modules/storage/lib/upload.client.d.mts +58 -0
  206. package/dist/modules/storage/lib/upload.client.d.mts.map +1 -0
  207. package/dist/modules/storage/lib/upload.client.mjs +87 -0
  208. package/dist/modules/storage/lib/upload.client.mjs.map +1 -0
  209. package/dist/modules/storage/lib/validators.d.mts +297 -835
  210. package/dist/modules/storage/lib/validators.d.mts.map +1 -1
  211. package/dist/modules/storage/lib/validators.mjs +32 -76
  212. package/dist/modules/storage/lib/validators.mjs.map +1 -1
  213. package/dist/modules/storage/providers/adapters/s3.server.d.mts +19 -0
  214. package/dist/modules/storage/providers/adapters/s3.server.d.mts.map +1 -0
  215. package/dist/modules/storage/providers/adapters/s3.server.mjs +173 -0
  216. package/dist/modules/storage/providers/adapters/s3.server.mjs.map +1 -0
  217. package/dist/modules/storage/providers/lib/constants.d.mts +6 -0
  218. package/dist/modules/storage/providers/lib/constants.d.mts.map +1 -0
  219. package/dist/modules/storage/providers/lib/constants.mjs +6 -0
  220. package/dist/modules/storage/providers/lib/constants.mjs.map +1 -0
  221. package/dist/modules/storage/providers/lib/errors.d.mts +12 -0
  222. package/dist/modules/storage/providers/lib/errors.d.mts.map +1 -0
  223. package/dist/modules/storage/providers/lib/errors.mjs +13 -0
  224. package/dist/modules/storage/providers/lib/errors.mjs.map +1 -0
  225. package/dist/modules/storage/providers/lib/types.d.mts +21 -0
  226. package/dist/modules/storage/providers/lib/types.d.mts.map +1 -0
  227. package/dist/modules/storage/providers/lib/validators.d.mts +112 -0
  228. package/dist/modules/storage/providers/lib/validators.d.mts.map +1 -0
  229. package/dist/modules/storage/providers/lib/validators.mjs +75 -0
  230. package/dist/modules/storage/providers/lib/validators.mjs.map +1 -0
  231. package/dist/router/server.d.mts +1 -1
  232. package/dist/storage/client.d.mts +4 -2
  233. package/dist/storage/client.mjs +4 -2
  234. package/dist/storage/server.d.mts +5 -4
  235. package/dist/storage/server.mjs +5 -4
  236. package/dist/storage.d.mts +9 -6
  237. package/dist/storage.mjs +8 -6
  238. package/package.json +18 -5
  239. package/src/components/editor/components/editor.client.tsx +9 -1
  240. package/src/components/editor/extensions/file-handler/extension.ts +4 -4
  241. package/src/components/editor/extensions/file-handler/strategy.ts +15 -40
  242. package/src/components/editor/extensions/file-handler/utils.ts +1 -1
  243. package/src/components/editor/extensions/image/extension.ts +10 -10
  244. package/src/components/editor/lib/helpers.ts +28 -11
  245. package/src/components/ui/combobox-dropdown.client.tsx +1 -0
  246. package/src/components/ui/combobox.client.tsx +1 -1
  247. package/src/entry.ts +12 -51
  248. package/src/lib/entry.ts +1 -5
  249. package/src/lib/utils/markdown.ts +10 -0
  250. package/src/lib/utils/url.ts +2 -1
  251. package/src/lib/utils/user-agent.ts +15 -0
  252. package/src/modules/auth/components/{guard-first-user.server.tsx → create-first-user-guard.server.tsx} +8 -8
  253. package/src/modules/auth/components/guard.server.tsx +1 -1
  254. package/src/modules/auth/entry.server.ts +4 -5
  255. package/src/modules/auth/handler/create-client.client.ts +2 -2
  256. package/src/modules/auth/handler/proxy.server.ts +1 -1
  257. package/src/modules/auth/handler/route.server.ts +2 -2
  258. package/src/modules/auth/handler/{init.ts → service.server.ts} +30 -9
  259. package/src/modules/config/entry.server.ts +0 -9
  260. package/src/modules/config/entry.ts +2 -2
  261. package/src/modules/config/lib/context.ts +9 -9
  262. package/src/modules/data-tables/entry.client.ts +1 -0
  263. package/src/modules/data-tables/server/get-data.server.ts +1 -1
  264. package/src/modules/data-tables/strategies/infinite/strategy.ts +4 -1
  265. package/src/modules/data-tables/tables/data-table/components/row.tsx +12 -21
  266. package/src/modules/data-tables/tables/inline-table/components/body.tsx +1 -1
  267. package/src/modules/data-tables/tables/inline-table/components/row.client.tsx +24 -30
  268. package/src/modules/data-tables/tables/inline-table/components/table.tsx +6 -1
  269. package/src/modules/data-tables/tables/inline-table/hooks/context.client.tsx +5 -0
  270. package/src/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.ts +119 -91
  271. package/src/modules/database/entry.client.ts +0 -0
  272. package/src/modules/database/entry.server.ts +4 -0
  273. package/src/modules/database/entry.ts +5 -0
  274. package/src/modules/database/lib/service.server.ts +33 -0
  275. package/src/modules/emails/entry.client.ts +0 -0
  276. package/src/modules/emails/entry.server.ts +4 -0
  277. package/src/modules/emails/entry.ts +0 -0
  278. package/src/modules/emails/lib/service.server.ts +29 -0
  279. package/src/modules/inline-edit/components/date-input.client.tsx +1 -1
  280. package/src/modules/inline-edit/components/date-picker.client.tsx +1 -0
  281. package/src/modules/inline-edit/components/date-time.client.tsx +1 -0
  282. package/src/modules/inline-edit/components/editor.client.tsx +3 -0
  283. package/src/modules/inline-edit/components/input-recipient.client.tsx +1 -0
  284. package/src/modules/inline-edit/components/input-toggle.client.tsx +1 -0
  285. package/src/modules/inline-edit/components/input.client.tsx +3 -0
  286. package/src/modules/inline-edit/components/select.client.tsx +5 -1
  287. package/src/modules/inline-edit/components/switch.client.tsx +1 -0
  288. package/src/modules/inline-edit/components/toggle.client.tsx +1 -0
  289. package/src/modules/router/handler/init.server.ts +2 -2
  290. package/src/modules/storage/components/dropzone.client.tsx +1 -1
  291. package/src/modules/storage/components/image-grid.client.tsx +23 -20
  292. package/src/modules/storage/components/image.client.tsx +8 -0
  293. package/src/modules/storage/components/upload-zone-context.client.tsx +11 -8
  294. package/src/modules/storage/components/upload-zone.client.tsx +22 -16
  295. package/src/modules/storage/entry.client.ts +3 -1
  296. package/src/modules/storage/entry.server.ts +9 -3
  297. package/src/modules/storage/entry.ts +13 -1
  298. package/src/modules/storage/lib/constants.ts +0 -11
  299. package/src/modules/storage/lib/helpers.ts +18 -65
  300. package/src/modules/storage/lib/procedures.server.ts +60 -0
  301. package/src/modules/storage/lib/router-handlers.server.ts +178 -0
  302. package/src/modules/storage/lib/schema.ts +26 -97
  303. package/src/modules/storage/lib/service.server.ts +636 -374
  304. package/src/modules/storage/lib/upload.client.ts +156 -0
  305. package/src/modules/storage/lib/validators.ts +50 -111
  306. package/src/modules/storage/providers/adapters/s3.server.ts +281 -0
  307. package/src/modules/storage/providers/lib/constants.ts +3 -0
  308. package/src/modules/storage/providers/lib/errors.ts +21 -0
  309. package/src/modules/storage/providers/lib/types.ts +28 -0
  310. package/src/modules/storage/providers/lib/validators.ts +122 -0
  311. package/dist/lib/config/constants.d.mts +0 -5
  312. package/dist/lib/config/constants.d.mts.map +0 -1
  313. package/dist/lib/config/constants.mjs +0 -6
  314. package/dist/lib/config/constants.mjs.map +0 -1
  315. package/dist/modules/auth/components/guard-first-user.server.d.mts +0 -18
  316. package/dist/modules/auth/components/guard-first-user.server.d.mts.map +0 -1
  317. package/dist/modules/auth/components/guard-first-user.server.mjs +0 -16
  318. package/dist/modules/auth/components/guard-first-user.server.mjs.map +0 -1
  319. package/dist/modules/auth/handler/init.mjs.map +0 -1
  320. package/dist/modules/config/db/helpers.d.mts.map +0 -1
  321. package/dist/modules/config/db/helpers.mjs.map +0 -1
  322. package/dist/modules/config/db/init.d.mts +0 -20
  323. package/dist/modules/config/db/init.d.mts.map +0 -1
  324. package/dist/modules/config/db/init.mjs +0 -15
  325. package/dist/modules/config/db/init.mjs.map +0 -1
  326. package/dist/modules/config/db/types.d.mts.map +0 -1
  327. package/dist/modules/config/providers/email.d.mts +0 -12
  328. package/dist/modules/config/providers/email.d.mts.map +0 -1
  329. package/dist/modules/config/providers/email.mjs +0 -11
  330. package/dist/modules/config/providers/email.mjs.map +0 -1
  331. package/dist/modules/storage/config/filters.d.mts +0 -17
  332. package/dist/modules/storage/config/filters.d.mts.map +0 -1
  333. package/dist/modules/storage/config/filters.mjs +0 -17
  334. package/dist/modules/storage/config/filters.mjs.map +0 -1
  335. package/dist/modules/storage/lib/create-client.server.d.mts +0 -11
  336. package/dist/modules/storage/lib/create-client.server.d.mts.map +0 -1
  337. package/dist/modules/storage/lib/create-client.server.mjs +0 -11
  338. package/dist/modules/storage/lib/create-client.server.mjs.map +0 -1
  339. package/dist/modules/storage/lib/create-upload.client.d.mts +0 -56
  340. package/dist/modules/storage/lib/create-upload.client.d.mts.map +0 -1
  341. package/dist/modules/storage/lib/create-upload.client.mjs +0 -98
  342. package/dist/modules/storage/lib/create-upload.client.mjs.map +0 -1
  343. package/dist/modules/storage/lib/proxy.server.d.mts +0 -21
  344. package/dist/modules/storage/lib/proxy.server.d.mts.map +0 -1
  345. package/dist/modules/storage/lib/proxy.server.mjs +0 -46
  346. package/dist/modules/storage/lib/proxy.server.mjs.map +0 -1
  347. package/dist/modules/storage/lib/router.server.d.mts +0 -31002
  348. package/dist/modules/storage/lib/router.server.d.mts.map +0 -1
  349. package/dist/modules/storage/lib/router.server.mjs +0 -86
  350. package/dist/modules/storage/lib/router.server.mjs.map +0 -1
  351. package/src/lib/config/constants.ts +0 -1
  352. package/src/lib/utils/time-picker.ts +0 -139
  353. package/src/modules/config/db/init.ts +0 -21
  354. package/src/modules/config/providers/email.ts +0 -13
  355. package/src/modules/storage/config/filters.ts +0 -12
  356. package/src/modules/storage/lib/create-client.server.ts +0 -14
  357. package/src/modules/storage/lib/create-upload.client.ts +0 -134
  358. package/src/modules/storage/lib/proxy.server.ts +0 -63
  359. package/src/modules/storage/lib/router.server.ts +0 -182
  360. /package/src/modules/{config/db → database/lib}/helpers.ts +0 -0
  361. /package/src/modules/{config/db → database/lib}/types.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/schema.ts"],"mappings":";;;;cAOa,YAAA,EAAuD,oBAAA,CAA3C,MAAA;AAAA,cACZ,YAAA,EAAyD,oBAAA,CAA7C,MAAA;;;AADzB;cAMa,KAAA,uBAAK,kBAAA;;;;UAgBf,oBAAA,CAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEU,cAAA,eAAc,SAAA;UAWxB,YAAA,CAAA,GAAA;;;;;;;;cAKU,YAAA,uBAAY,kBAAA;;;;YAQtB,oBAAA,CAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEU,qBAAA,EAMV,YAAA,CAN+B,SAAA;QAM/B,YAAA,CAAA,GAAA;AAAA;;;;cAKU,iBAAA,uBAAiB,kBAAA;;;;SAe7B,oBAAA,CAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEY,0BAAA,EAMV,YAAA,CANoC,SAAA;QAMpC,YAAA,CAAA,GAAA;AAAA;;;;cAKG,WAAA;;;;;YAOL,oBAAA,CAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KACW,WAAA,UAAqB,WAAA"}
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,75 +1,38 @@
1
- import { nodeSubtypes } from "./helpers.mjs";
2
- import { baseColumns } from "../../config/db/helpers.mjs";
3
- import { users } from "../../auth/db/schema.mjs";
4
- import { imageDispositions, imageVariants } from "./constants.mjs";
5
- import { relations } from "drizzle-orm";
6
- import { boolean, pgEnum, pgTable, unique } from "drizzle-orm/pg-core";
1
+ import { baseColumns } from "../../database/lib/helpers.mjs";
2
+ import { storageProviders } from "../providers/lib/constants.mjs";
3
+ import { index, pgEnum, pgTable, unique } from "drizzle-orm/pg-core";
7
4
 
8
5
  //#region src/modules/storage/lib/schema.ts
9
- const nodeTypeEnum = pgEnum("node_types", ["file", "folder"]);
10
- const nodeModeEnum = pgEnum("node_mode", ["private", "public"]);
6
+ const storageAssetStatusEnum = pgEnum("storage_asset_status", [
7
+ "pending",
8
+ "ready",
9
+ "error"
10
+ ]);
11
+ const storageAssetVisibilityEnum = pgEnum("storage_asset_visibility", ["private", "public"]);
11
12
  /**
12
- * Node table
13
+ * Storage objects table
13
14
  */
14
- const nodes = pgTable("nodes", (t) => ({
15
+ const storageAssets = pgTable("storage_assets", (t) => ({
15
16
  ...baseColumns,
16
- name: t.text().notNull(),
17
- namespace: t.text().notNull().default("global"),
18
- type: nodeTypeEnum(),
19
- mode: nodeModeEnum().default("private"),
20
- subtype: t.text({ enum: nodeSubtypes }).notNull().default("other"),
17
+ provider: t.text({ enum: storageProviders }).notNull(),
18
+ bucket: t.text().notNull(),
19
+ key: t.text().notNull(),
20
+ status: storageAssetStatusEnum().notNull(),
21
+ visibility: storageAssetVisibilityEnum().notNull().default("private"),
21
22
  size: t.integer().default(0),
22
23
  contentType: t.varchar({ length: 255 }),
23
- readonly: boolean().default(false),
24
- hidden: boolean().default(false),
25
- createdBy: t.uuid().references(() => users.id, { onDelete: "set null" }),
26
- isPending: t.boolean().default(false).notNull(),
27
- isDeleted: t.boolean().default(false).notNull(),
28
- orphanedAt: t.timestamp(),
29
- parentId: t.uuid().references(() => nodes.id, { onDelete: "cascade" })
30
- }));
31
- const nodesRelations = relations(nodes, ({ one, many }) => ({
32
- parent: one(nodes, {
33
- fields: [nodes.parentId],
34
- references: [nodes.id],
35
- relationName: "parent"
36
- }),
37
- children: many(nodes, { relationName: "parent" }),
38
- urls: many(nodePresignedUrls),
39
- variants: many(nodeVariants)
40
- }));
41
- /**
42
- * Node variants table
43
- */
44
- const nodeVariants = pgTable("node_variants", (t) => ({
45
- ...baseColumns,
46
- nodeId: t.uuid().notNull().references(() => nodes.id, { onDelete: "cascade" }),
47
- variant: t.text({ enum: imageVariants }).notNull(),
48
- width: t.integer().notNull()
49
- }));
50
- const nodeVariantsRelations = relations(nodeVariants, ({ one }) => ({ node: one(nodes, {
51
- fields: [nodeVariants.nodeId],
52
- references: [nodes.id],
53
- relationName: "node"
54
- }) }));
55
- /**
56
- * Node presigned urls table
57
- */
58
- const nodePresignedUrls = pgTable("node_presigned_urls", (t) => ({
59
- ...baseColumns,
60
- url: t.text().notNull().unique(),
61
- variant: t.text({ enum: imageVariants }).notNull(),
62
- disposition: t.text({ enum: imageDispositions }).notNull(),
63
- expiresAt: t.timestamp().notNull(),
64
- nodeId: t.uuid().notNull().references(() => nodes.id, { onDelete: "cascade" }),
65
- variantId: t.uuid().references(() => nodeVariants.id, { onDelete: "set null" })
66
- }), (t) => [unique("node_presigned_url_unique").on(t.nodeId, t.variant, t.disposition)]);
67
- const nodePresignedUrlsRelations = relations(nodePresignedUrls, ({ one }) => ({ node: one(nodes, {
68
- fields: [nodePresignedUrls.nodeId],
69
- references: [nodes.id],
70
- relationName: "node"
71
- }) }));
24
+ uploadId: t.uuid().notNull().defaultRandom(),
25
+ name: t.text(),
26
+ metadata: t.jsonb(),
27
+ etag: t.text(),
28
+ uploadedAt: t.timestamp().defaultNow().notNull(),
29
+ deletedAt: t.timestamp()
30
+ }), (t) => [
31
+ unique("storage_assets_provider_bucket_key_unique").on(t.provider, t.bucket, t.key),
32
+ index("storage_assets_status_idx").on(t.status),
33
+ index("storage_assets_bucket_key_idx").on(t.bucket, t.key)
34
+ ]);
72
35
 
73
36
  //#endregion
74
- export { nodeModeEnum, nodePresignedUrls, nodePresignedUrlsRelations, nodeTypeEnum, nodeVariants, nodeVariantsRelations, nodes, nodesRelations };
37
+ export { storageAssetStatusEnum, storageAssetVisibilityEnum, storageAssets };
75
38
  //# sourceMappingURL=schema.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.mjs","names":[],"sources":["../../../../src/modules/storage/lib/schema.ts"],"sourcesContent":["import { relations } from \"drizzle-orm\";\nimport { type AnyPgColumn, boolean, pgEnum, pgTable, unique } from \"drizzle-orm/pg-core\";\nimport { users } from \"@/modules/auth/db/schema\";\nimport { baseColumns } from \"@/modules/config/db/helpers\";\nimport { imageDispositions, imageVariants } from \"./constants\";\nimport { nodeSubtypes } from \"./helpers\";\n\nexport const nodeTypeEnum = pgEnum(\"node_types\", [\"file\", \"folder\"]);\nexport const nodeModeEnum = pgEnum(\"node_mode\", [\"private\", \"public\"]);\n\n/**\n * Node table\n */\nexport const nodes = pgTable(\"nodes\", (t) => ({\n ...baseColumns,\n name: t.text().notNull(),\n namespace: t.text().notNull().default(\"global\"),\n type: nodeTypeEnum(),\n mode: nodeModeEnum().default(\"private\"),\n subtype: t.text({ enum: nodeSubtypes }).notNull().default(\"other\"),\n size: t.integer().default(0),\n contentType: t.varchar({ length: 255 }),\n readonly: boolean().default(false),\n hidden: boolean().default(false),\n createdBy: t.uuid().references(() => users.id, { onDelete: \"set null\" }),\n isPending: t.boolean().default(false).notNull(),\n isDeleted: t.boolean().default(false).notNull(),\n orphanedAt: t.timestamp(),\n parentId: t.uuid().references((): AnyPgColumn => nodes.id, { onDelete: \"cascade\" }),\n}));\n\nexport const nodesRelations = relations(nodes, ({ one, many }) => ({\n parent: one(nodes, {\n fields: [nodes.parentId],\n references: [nodes.id],\n relationName: \"parent\",\n }),\n children: many(nodes, {\n relationName: \"parent\",\n }),\n urls: many(nodePresignedUrls),\n variants: many(nodeVariants),\n}));\n\n/**\n * Node variants table\n */\nexport const nodeVariants = pgTable(\"node_variants\", (t) => ({\n ...baseColumns,\n nodeId: t\n .uuid()\n .notNull()\n .references(() => nodes.id, { onDelete: \"cascade\" }),\n variant: t.text({ enum: imageVariants }).notNull(),\n width: t.integer().notNull(),\n}));\n\nexport const nodeVariantsRelations = relations(nodeVariants, ({ one }) => ({\n node: one(nodes, {\n fields: [nodeVariants.nodeId],\n references: [nodes.id],\n relationName: \"node\",\n }),\n}));\n\n/**\n * Node presigned urls table\n */\nexport const nodePresignedUrls = pgTable(\n \"node_presigned_urls\",\n (t) => ({\n ...baseColumns,\n url: t.text().notNull().unique(),\n variant: t.text({ enum: imageVariants }).notNull(),\n disposition: t.text({ enum: imageDispositions }).notNull(),\n expiresAt: t.timestamp().notNull(),\n nodeId: t\n .uuid()\n .notNull()\n .references(() => nodes.id, { onDelete: \"cascade\" }),\n variantId: t.uuid().references(() => nodeVariants.id, { onDelete: \"set null\" }),\n }),\n (t) => [unique(\"node_presigned_url_unique\").on(t.nodeId, t.variant, t.disposition)],\n);\n\nexport const nodePresignedUrlsRelations = relations(nodePresignedUrls, ({ one }) => ({\n node: one(nodes, {\n fields: [nodePresignedUrls.nodeId],\n references: [nodes.id],\n relationName: \"node\",\n }),\n}));\n\n/**\n * Drive schema\n **/\nconst driveSchema = {\n nodes,\n nodesRelations,\n nodeVariants,\n nodeVariantsRelations,\n nodePresignedUrls,\n nodePresignedUrlsRelations,\n};\nexport type DriveSchema = typeof driveSchema;\n"],"mappings":";;;;;;;;AAOA,MAAa,eAAe,OAAO,cAAc,CAAC,QAAQ,SAAS,CAAC;AACpE,MAAa,eAAe,OAAO,aAAa,CAAC,WAAW,SAAS,CAAC;;;;AAKtE,MAAa,QAAQ,QAAQ,UAAU,OAAO;CAC5C,GAAG;CACH,MAAM,EAAE,MAAM,CAAC,SAAS;CACxB,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,SAAS;CAC/C,MAAM,cAAc;CACpB,MAAM,cAAc,CAAC,QAAQ,UAAU;CACvC,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC,CAAC,SAAS,CAAC,QAAQ,QAAQ;CAClE,MAAM,EAAE,SAAS,CAAC,QAAQ,EAAE;CAC5B,aAAa,EAAE,QAAQ,EAAE,QAAQ,KAAK,CAAC;CACvC,UAAU,SAAS,CAAC,QAAQ,MAAM;CAClC,QAAQ,SAAS,CAAC,QAAQ,MAAM;CAChC,WAAW,EAAE,MAAM,CAAC,iBAAiB,MAAM,IAAI,EAAE,UAAU,YAAY,CAAC;CACxE,WAAW,EAAE,SAAS,CAAC,QAAQ,MAAM,CAAC,SAAS;CAC/C,WAAW,EAAE,SAAS,CAAC,QAAQ,MAAM,CAAC,SAAS;CAC/C,YAAY,EAAE,WAAW;CACzB,UAAU,EAAE,MAAM,CAAC,iBAA8B,MAAM,IAAI,EAAE,UAAU,WAAW,CAAC;CACpF,EAAE;AAEH,MAAa,iBAAiB,UAAU,QAAQ,EAAE,KAAK,YAAY;CACjE,QAAQ,IAAI,OAAO;EACjB,QAAQ,CAAC,MAAM,SAAS;EACxB,YAAY,CAAC,MAAM,GAAG;EACtB,cAAc;EACf,CAAC;CACF,UAAU,KAAK,OAAO,EACpB,cAAc,UACf,CAAC;CACF,MAAM,KAAK,kBAAkB;CAC7B,UAAU,KAAK,aAAa;CAC7B,EAAE;;;;AAKH,MAAa,eAAe,QAAQ,kBAAkB,OAAO;CAC3D,GAAG;CACH,QAAQ,EACL,MAAM,CACN,SAAS,CACT,iBAAiB,MAAM,IAAI,EAAE,UAAU,WAAW,CAAC;CACtD,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC,SAAS;CAClD,OAAO,EAAE,SAAS,CAAC,SAAS;CAC7B,EAAE;AAEH,MAAa,wBAAwB,UAAU,eAAe,EAAE,WAAW,EACzE,MAAM,IAAI,OAAO;CACf,QAAQ,CAAC,aAAa,OAAO;CAC7B,YAAY,CAAC,MAAM,GAAG;CACtB,cAAc;CACf,CAAC,EACH,EAAE;;;;AAKH,MAAa,oBAAoB,QAC/B,wBACC,OAAO;CACN,GAAG;CACH,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ;CAChC,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC,CAAC,SAAS;CAClD,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC,CAAC,SAAS;CAC1D,WAAW,EAAE,WAAW,CAAC,SAAS;CAClC,QAAQ,EACL,MAAM,CACN,SAAS,CACT,iBAAiB,MAAM,IAAI,EAAE,UAAU,WAAW,CAAC;CACtD,WAAW,EAAE,MAAM,CAAC,iBAAiB,aAAa,IAAI,EAAE,UAAU,YAAY,CAAC;CAChF,IACA,MAAM,CAAC,OAAO,4BAA4B,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,CACpF;AAED,MAAa,6BAA6B,UAAU,oBAAoB,EAAE,WAAW,EACnF,MAAM,IAAI,OAAO;CACf,QAAQ,CAAC,kBAAkB,OAAO;CAClC,YAAY,CAAC,MAAM,GAAG;CACtB,cAAc;CACf,CAAC,EACH,EAAE"}
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,WAAW,CAAC,YAAY,CAAC,SAAS;CAChD,WAAW,EAAE,WAAW;CACzB,IACA,MAAM;CACL,OAAO,4CAA4C,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI;CACnF,MAAM,4BAA4B,CAAC,GAAG,EAAE,OAAO;CAC/C,MAAM,gCAAgC,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI;CAC3D,CACF"}