@tulip-systems/core 0.5.1 → 0.5.2

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 (236) hide show
  1. package/dist/components/common/icons.d.mts +52 -52
  2. package/dist/components/common/icons.d.mts.map +1 -1
  3. package/dist/components/common/status.d.mts +3 -3
  4. package/dist/components/common/status.d.mts.map +1 -1
  5. package/dist/components/editor/components/content.client.d.mts +2 -2
  6. package/dist/components/editor/components/editor.client.d.mts +4 -4
  7. package/dist/components/editor/components/menu.client.d.mts +3 -3
  8. package/dist/components/header/back-button.client.d.mts +2 -2
  9. package/dist/components/header/bottom-bar.client.d.mts +3 -3
  10. package/dist/components/header/breadcrumbs.client.d.mts +7 -7
  11. package/dist/components/header/header.client.d.mts +2 -2
  12. package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
  13. package/dist/components/header/top-bar.client.d.mts +4 -4
  14. package/dist/components/layouts/admin-content.client.d.mts +2 -2
  15. package/dist/components/layouts/admin-layout.d.mts +2 -2
  16. package/dist/components/layouts/admin-layout.d.mts.map +1 -1
  17. package/dist/components/layouts/admin-loading.d.mts +2 -2
  18. package/dist/components/layouts/admin-loading.d.mts.map +1 -1
  19. package/dist/components/layouts/empty-page.d.mts +4 -4
  20. package/dist/components/layouts/empty-page.d.mts.map +1 -1
  21. package/dist/components/layouts/list-layout.d.mts +2 -2
  22. package/dist/components/layouts/list-layout.d.mts.map +1 -1
  23. package/dist/components/layouts/not-found-page.d.mts +3 -3
  24. package/dist/components/layouts/not-found-page.d.mts.map +1 -1
  25. package/dist/components/layouts/providers.client.d.mts +2 -2
  26. package/dist/components/layouts/root-layout.server.d.mts +2 -2
  27. package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
  28. package/dist/components/layouts/root-loading.d.mts +2 -2
  29. package/dist/components/layouts/root-loading.d.mts.map +1 -1
  30. package/dist/components/layouts/tab-layout.d.mts +2 -2
  31. package/dist/components/layouts/tab-layout.d.mts.map +1 -1
  32. package/dist/components/lists/data-list.d.mts +5 -5
  33. package/dist/components/lists/data-list.d.mts.map +1 -1
  34. package/dist/components/lists/data-stack.d.mts +8 -8
  35. package/dist/components/lists/data-stack.d.mts.map +1 -1
  36. package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
  37. package/dist/components/ui/accordion.d.mts +5 -5
  38. package/dist/components/ui/accordion.d.mts.map +1 -1
  39. package/dist/components/ui/alert-dialog.d.mts +12 -12
  40. package/dist/components/ui/alert-dialog.d.mts.map +1 -1
  41. package/dist/components/ui/alert.d.mts +6 -6
  42. package/dist/components/ui/alert.d.mts.map +1 -1
  43. package/dist/components/ui/aspect-ratio.d.mts +2 -2
  44. package/dist/components/ui/aspect-ratio.d.mts.map +1 -1
  45. package/dist/components/ui/avatar.client.d.mts +4 -4
  46. package/dist/components/ui/badge.d.mts +4 -4
  47. package/dist/components/ui/badge.d.mts.map +1 -1
  48. package/dist/components/ui/breadcrumb.d.mts +8 -8
  49. package/dist/components/ui/button.d.mts +5 -5
  50. package/dist/components/ui/calendar.d.mts +3 -3
  51. package/dist/components/ui/card.d.mts +7 -7
  52. package/dist/components/ui/carousel.d.mts +6 -6
  53. package/dist/components/ui/chart.client.d.mts +5 -5
  54. package/dist/components/ui/checkbox.d.mts +2 -2
  55. package/dist/components/ui/collapsible.client.d.mts +4 -4
  56. package/dist/components/ui/color-picker.client.d.mts +2 -2
  57. package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
  58. package/dist/components/ui/combobox.client.d.mts +2 -2
  59. package/dist/components/ui/command.d.mts +10 -10
  60. package/dist/components/ui/context-menu.d.mts +16 -16
  61. package/dist/components/ui/context-menu.d.mts.map +1 -1
  62. package/dist/components/ui/date-picker.client.d.mts +2 -2
  63. package/dist/components/ui/dialog.client.d.mts +11 -11
  64. package/dist/components/ui/drawer.client.d.mts +11 -11
  65. package/dist/components/ui/dropdown-menu.d.mts +16 -16
  66. package/dist/components/ui/form.client.d.mts +7 -7
  67. package/dist/components/ui/hover-card.client.d.mts +4 -4
  68. package/dist/components/ui/input.d.mts +2 -2
  69. package/dist/components/ui/label.d.mts +2 -2
  70. package/dist/components/ui/navigation-menu.d.mts +11 -11
  71. package/dist/components/ui/pagination.d.mts +8 -8
  72. package/dist/components/ui/popover.d.mts +5 -5
  73. package/dist/components/ui/progress.client.d.mts +2 -2
  74. package/dist/components/ui/radio-group.d.mts +3 -3
  75. package/dist/components/ui/resizable.client.d.mts +4 -4
  76. package/dist/components/ui/scroll-area.d.mts +3 -3
  77. package/dist/components/ui/select.client.d.mts +11 -11
  78. package/dist/components/ui/separator.d.mts +2 -2
  79. package/dist/components/ui/sheet.client.d.mts +9 -9
  80. package/dist/components/ui/sidebar.client.d.mts +24 -24
  81. package/dist/components/ui/skeleton.d.mts +2 -2
  82. package/dist/components/ui/slider.d.mts +2 -2
  83. package/dist/components/ui/sonner.client.d.mts +2 -2
  84. package/dist/components/ui/switch.d.mts +2 -2
  85. package/dist/components/ui/tabs.d.mts +5 -5
  86. package/dist/components/ui/textarea.d.mts +2 -2
  87. package/dist/components/ui/time-input.client.d.mts +2 -2
  88. package/dist/components/ui/toggle-group.client.d.mts +3 -3
  89. package/dist/components/ui/toggle.d.mts +2 -2
  90. package/dist/components/ui/tooltip.client.d.mts +5 -5
  91. package/dist/lib/hooks/use-indicator.d.mts +2 -2
  92. package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
  93. package/dist/modules/auth/components/allowed.client.d.mts +2 -2
  94. package/dist/modules/auth/components/allowed.client.d.mts.map +1 -1
  95. package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
  96. package/dist/modules/auth/components/auth-loading.d.mts +2 -2
  97. package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
  98. package/dist/modules/auth/components/create-first-user-page.client.d.mts.map +1 -1
  99. package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
  100. package/dist/modules/auth/components/forget-password-page.client.d.mts.map +1 -1
  101. package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
  102. package/dist/modules/auth/components/guard.server.d.mts +2 -2
  103. package/dist/modules/auth/components/login-page.client.d.mts +2 -2
  104. package/dist/modules/auth/components/login-page.client.d.mts.map +1 -1
  105. package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
  106. package/dist/modules/auth/components/reset-password-page.client.d.mts.map +1 -1
  107. package/dist/modules/auth/components/update-password-command.d.mts +2 -2
  108. package/dist/modules/auth/components/update-password-command.d.mts.map +1 -1
  109. package/dist/modules/auth/db/schema.d.mts +73 -73
  110. package/dist/modules/auth/db/schema.d.mts.map +1 -1
  111. package/dist/modules/auth/handler/client.client.d.mts +2 -2
  112. package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
  113. package/dist/modules/commands/components/click-command.client.d.mts +2 -2
  114. package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
  115. package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
  116. package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
  117. package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
  118. package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
  119. package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
  120. package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
  121. package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
  122. package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
  123. package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
  124. package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
  125. package/dist/modules/config/db/helpers.d.mts +5 -5
  126. package/dist/modules/config/db/helpers.d.mts.map +1 -1
  127. package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
  128. package/dist/modules/data-tables/components/cell/common.client.d.mts.map +1 -1
  129. package/dist/modules/data-tables/components/column-header.d.mts +2 -2
  130. package/dist/modules/data-tables/components/column-header.d.mts.map +1 -1
  131. package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
  132. package/dist/modules/data-tables/components/filters/combobox.client.d.mts.map +1 -1
  133. package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
  134. package/dist/modules/data-tables/components/filters/slider.client.d.mts.map +1 -1
  135. package/dist/modules/data-tables/components/header.d.mts +4 -4
  136. package/dist/modules/data-tables/components/header.d.mts.map +1 -1
  137. package/dist/modules/data-tables/components/layout.d.mts +2 -2
  138. package/dist/modules/data-tables/components/layout.d.mts.map +1 -1
  139. package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
  140. package/dist/modules/data-tables/components/search-input.client.d.mts.map +1 -1
  141. package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
  142. package/dist/modules/data-tables/components/skeleton.d.mts.map +1 -1
  143. package/dist/modules/data-tables/components/table.d.mts +7 -7
  144. package/dist/modules/data-tables/components/table.d.mts.map +1 -1
  145. package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
  146. package/dist/modules/data-tables/components/toolbar.d.mts.map +1 -1
  147. package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
  148. package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +1 -1
  149. package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
  150. package/dist/modules/data-tables/tables/data-table/components/table.d.mts.map +1 -1
  151. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
  152. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts.map +1 -1
  153. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
  154. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts.map +1 -1
  155. package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts +2 -2
  156. package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts.map +1 -1
  157. package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts +2 -2
  158. package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts.map +1 -1
  159. package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts +3 -3
  160. package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts.map +1 -1
  161. package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts +2 -2
  162. package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts.map +1 -1
  163. package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts +2 -2
  164. package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts.map +1 -1
  165. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
  166. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
  167. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
  168. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
  169. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +2 -2
  170. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
  171. package/dist/modules/inline-edit/components/combobox.client.d.mts +2 -2
  172. package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
  173. package/dist/modules/inline-edit/components/date-input.client.d.mts +2 -2
  174. package/dist/modules/inline-edit/components/date-input.client.d.mts.map +1 -1
  175. package/dist/modules/inline-edit/components/date-picker.client.d.mts +2 -2
  176. package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
  177. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts +2 -2
  178. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts.map +1 -1
  179. package/dist/modules/inline-edit/components/editor.client.d.mts +2 -2
  180. package/dist/modules/inline-edit/components/editor.client.d.mts.map +1 -1
  181. package/dist/modules/inline-edit/components/input-recipient.client.d.mts +2 -2
  182. package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +1 -1
  183. package/dist/modules/inline-edit/components/input-toggle.client.d.mts +2 -2
  184. package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +1 -1
  185. package/dist/modules/inline-edit/components/input.client.d.mts +4 -4
  186. package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
  187. package/dist/modules/inline-edit/components/select.client.d.mts +6 -6
  188. package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
  189. package/dist/modules/inline-edit/components/switch.client.d.mts +2 -2
  190. package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
  191. package/dist/modules/inline-edit/components/toggle.client.d.mts +2 -2
  192. package/dist/modules/inline-edit/components/toggle.client.d.mts.map +1 -1
  193. package/dist/modules/inline-edit/hooks/context.client.d.mts +2 -2
  194. package/dist/modules/inline-edit/hooks/context.client.d.mts.map +1 -1
  195. package/dist/modules/router/lib/query-client.server.d.mts +2 -2
  196. package/dist/modules/router/lib/query-client.server.d.mts.map +1 -1
  197. package/dist/modules/storage/components/dropzone-context.client.d.mts +2 -2
  198. package/dist/modules/storage/components/dropzone-context.client.d.mts.map +1 -1
  199. package/dist/modules/storage/components/dropzone.client.d.mts +5 -5
  200. package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
  201. package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
  202. package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -1
  203. package/dist/modules/storage/components/upload-zone.client.d.mts +5 -3
  204. package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
  205. package/dist/modules/storage/components/upload-zone.client.mjs +6 -4
  206. package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
  207. package/dist/modules/storage/config/filters.d.mts +1 -0
  208. package/dist/modules/storage/config/filters.d.mts.map +1 -1
  209. package/dist/modules/storage/config/filters.mjs +2 -1
  210. package/dist/modules/storage/config/filters.mjs.map +1 -1
  211. package/dist/modules/storage/lib/helpers.d.mts +2 -2
  212. package/dist/modules/storage/lib/helpers.d.mts.map +1 -1
  213. package/dist/modules/storage/lib/helpers.mjs +1 -0
  214. package/dist/modules/storage/lib/helpers.mjs.map +1 -1
  215. package/dist/modules/storage/lib/router.server.d.mts +3195 -2217
  216. package/dist/modules/storage/lib/schema.d.mts +122 -88
  217. package/dist/modules/storage/lib/schema.d.mts.map +1 -1
  218. package/dist/modules/storage/lib/schema.mjs +1 -0
  219. package/dist/modules/storage/lib/schema.mjs.map +1 -1
  220. package/dist/modules/storage/lib/service.server.d.mts +39 -12
  221. package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
  222. package/dist/modules/storage/lib/service.server.mjs +9 -3
  223. package/dist/modules/storage/lib/service.server.mjs.map +1 -1
  224. package/dist/modules/storage/lib/validators.d.mts +219 -138
  225. package/dist/modules/storage/lib/validators.d.mts.map +1 -1
  226. package/dist/modules/storage/lib/validators.mjs +14 -24
  227. package/dist/modules/storage/lib/validators.mjs.map +1 -1
  228. package/dist/storage.d.mts +2 -2
  229. package/dist/storage.mjs +2 -2
  230. package/package.json +3 -3
  231. package/src/modules/storage/components/upload-zone.client.tsx +5 -2
  232. package/src/modules/storage/config/filters.ts +1 -0
  233. package/src/modules/storage/lib/helpers.ts +3 -2
  234. package/src/modules/storage/lib/schema.ts +1 -0
  235. package/src/modules/storage/lib/service.server.ts +10 -2
  236. package/src/modules/storage/lib/validators.ts +20 -31
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/validators.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KAYY,IAAA,UAAc,KAAA,CAAM;AAApB,KACA,QAAA,GADc,OACI,KAAA,CAAM,YADQ,GAAA;EAChC,IAAA,EAAA,MAAQ;AACpB,CAAA;AAKa,KALD,UAAA,GAKiD,OAL7B,KAAA,CAAM,YAKX,GAAA;EACf,IAAA,EAAA,QAAQ;AAKpB,CAAA;;;;cANa,gBAAc,GAAA,CAAA;;;;KACf,QAAA,GAAW,GAAA,CAAE,aAAa;;;;cAKzB,+BAAgB;QAE3B,oBAAA,CAAA;;;;;;eAF2B,EAAA,MAAA;IAAA,OAAA,EAAA,IAAA;IAIj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;;;;;;;;;;KAShB,cAAA,GAAiB,GAAA,CAAE,aAAa;SACnC;;KAGG,eAAA,GAAkB,GAAA,CAAE,aAAa"}
@@ -20,19 +20,6 @@ const createNodeSchema = createInsertSchema(nodes, { namespace: z$1.string() });
20
20
  */
21
21
  const updateNodeSchema = createUpdateSchema(nodes);
22
22
  /**
23
- * Create folder node
24
- */
25
- const createFolderNodeSchema = createNodeSchema.omit({
26
- type: true,
27
- contentType: true,
28
- size: true,
29
- subtype: true
30
- });
31
- /**
32
- * Create file node
33
- */
34
- const createFileNodeSchema = createNodeSchema.omit({ type: true });
35
- /**
36
23
  * Select node
37
24
  */
38
25
  const selectNodeSchema = createSelectSchema(nodes);
@@ -45,20 +32,23 @@ const nodesTableFiltersSchema = resolveFiltersSchema(nodesTableFilters).partial(
45
32
  parentId: z$1.string().nullable()
46
33
  }).transform((input) => ({
47
34
  ...input,
35
+ hidden: input?.hidden ?? false,
48
36
  isDeleted: input?.isDeleted ?? false
49
37
  }));
50
38
  /**
51
- * Upload file schema
39
+ * Create folder node
52
40
  */
53
- const uploadFileSchema = z$1.object({
54
- name: z$1.string().min(1),
55
- namespace: z$1.string(),
56
- mode: nodeModeSchema.optional(),
57
- parentId: z$1.uuid().nullable(),
58
- size: z$1.number().optional().default(0),
59
- contentType: z$1.string().optional().default("")
41
+ const createFolderNodeSchema = createNodeSchema.omit({
42
+ type: true,
43
+ contentType: true,
44
+ size: true,
45
+ subtype: true
60
46
  });
61
47
  /**
48
+ * Upload file schema
49
+ */
50
+ const uploadFileSchema = createNodeSchema.omit({ type: true });
51
+ /**
62
52
  * Presign file schema
63
53
  */
64
54
  const presignFileSchema = uploadFileSchema.extend({ id: z$1.uuid() });
@@ -97,10 +87,10 @@ const putObjectSchema = z$1.object({
97
87
  name: z$1.string().optional().default(""),
98
88
  variant: z$1.enum(imageVariants).optional().default("main"),
99
89
  body: z$1.any().optional(),
100
- contentType: z$1.string().optional().default(""),
101
- size: z$1.number().optional().default(0)
90
+ contentType: z$1.string().nullable().optional(),
91
+ size: z$1.number().nullable().optional()
102
92
  });
103
93
 
104
94
  //#endregion
105
- export { createFileNodeSchema, createFolderNodeSchema, createNodeSchema, getFileURLSchema, getFileURLSchemaDefaults, getNodesByParentIdSchema, getObjectSchema, nodeModeSchema, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema };
95
+ export { createFolderNodeSchema, createNodeSchema, getFileURLSchema, getFileURLSchemaDefaults, getNodesByParentIdSchema, getObjectSchema, nodeModeSchema, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema };
106
96
  //# sourceMappingURL=validators.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"validators.mjs","names":["z"],"sources":["../../../../src/modules/storage/lib/validators.ts"],"sourcesContent":["import { tableQuerySchema } from \"@/modules/data-tables/entry\";\nimport { resolveFiltersSchema } from \"@/modules/data-tables/lib/filters/resolvers\";\nimport { PutObjectCommandInput } from \"@aws-sdk/client-s3\";\nimport { createInsertSchema, createSelectSchema, createUpdateSchema } from \"drizzle-zod\";\nimport { z } from \"zod\";\nimport { nodesTableFilters } from \"../config/filters\";\nimport { imageDispositions, imageVariants } from \"./constants\";\nimport { nodeModeEnum, nodes } from \"./schema\";\n\n/**\n * Nodes\n */\nexport type Node = typeof nodes.$inferSelect;\nexport type FileNode = typeof nodes.$inferSelect & { type: \"file\" };\nexport type FolderNode = typeof nodes.$inferSelect & { type: \"folder\" };\n\n/**\n * Node mode\n */\nexport const nodeModeSchema = z.enum(nodeModeEnum.enumValues);\nexport type NodeMode = z.infer<typeof nodeModeSchema>;\n\n/**\n * Create node\n */\nexport const createNodeSchema = createInsertSchema(nodes, {\n namespace: z.string(),\n});\n\nexport type CreateNodeInput = z.input<typeof createNodeSchema>;\nexport type CreateNodeSchema = z.infer<typeof createNodeSchema>;\n\n/**\n * Update node\n */\nexport const updateNodeSchema = createUpdateSchema(nodes);\n\nexport type UpdateNodeInput = z.input<typeof updateNodeSchema>;\nexport type UpdateNodeSchema = z.infer<typeof updateNodeSchema>;\n\n/**\n * Create folder node\n */\nexport const createFolderNodeSchema = createNodeSchema.omit({\n type: true,\n contentType: true,\n size: true,\n subtype: true,\n});\n\nexport type CreateFolderNodeSchema = z.infer<typeof createFolderNodeSchema>;\n\n/**\n * Create file node\n */\nexport const createFileNodeSchema = createNodeSchema.omit({\n type: true,\n});\nexport type CreateFileNodeSchema = z.infer<typeof createFileNodeSchema>;\n\n/**\n * Select node\n */\nexport const selectNodeSchema = createSelectSchema(nodes);\nexport const selectNodeWithChildrenSchema = selectNodeSchema.extend({\n children: z.array(selectNodeSchema),\n});\n\nexport type SelectNodeSchema = z.infer<typeof selectNodeSchema>;\nexport type SelectNodeWithChildrenSchema = z.infer<typeof selectNodeWithChildrenSchema>;\n\n/**\n * Where input\n */\nexport const nodesTableFiltersSchema = resolveFiltersSchema(nodesTableFilters)\n .partial()\n .extend({\n namespace: z.string(),\n parentId: z.string().nullable(),\n })\n .transform((input) => ({ ...input, isDeleted: input?.isDeleted ?? false }));\n\nexport type NodesTableFilters = z.input<typeof nodesTableFiltersSchema>;\n\n/**\n * Upload file schema\n */\nexport const uploadFileSchema = z.object({\n name: z.string().min(1),\n namespace: z.string(),\n mode: nodeModeSchema.optional(),\n parentId: z.uuid().nullable(),\n size: z.number().optional().default(0),\n contentType: z.string().optional().default(\"\"),\n});\n\nexport type UploadFileSchema = z.infer<typeof uploadFileSchema>;\n\n/**\n * Presign file schema\n */\nexport const presignFileSchema = uploadFileSchema.extend({ id: z.uuid() });\n\nexport type PresignFileSchema = z.infer<typeof presignFileSchema>;\n\n/**\n * Get file url schema\n */\nexport const getFileURLSchemaDefaults = { variant: \"main\", disposition: \"inline\" } as const;\n\nexport const getFileURLSchema = z.object({\n variant: z.enum(imageVariants).optional().default(getFileURLSchemaDefaults.variant),\n disposition: z.enum(imageDispositions).optional().default(getFileURLSchemaDefaults.disposition),\n});\n\nexport type GetFileUrlInput = z.input<typeof getFileURLSchema>;\nexport type GetFileURLSchema = z.infer<typeof getFileURLSchema>;\n\n/**\n * Get by parent id input\n */\nexport const getNodesByParentIdSchema = tableQuerySchema\n .pick({ order: true, sort: true, search: true })\n .extend({ filters: nodesTableFiltersSchema });\n\nexport type GetNodesByParentIdInput = z.input<typeof getNodesByParentIdSchema>;\n\n/**\n * Get object input\n */\nexport const getObjectSchema = z.object({\n id: z.string(),\n variant: z.enum(imageVariants).optional().default(getFileURLSchemaDefaults.variant),\n disposition: z.string().optional().default(getFileURLSchemaDefaults.disposition),\n});\n\nexport type GetObjectInput = z.input<typeof getObjectSchema>;\nexport type GetObjectSchema = z.infer<typeof getObjectSchema>;\n\n/**\n * Put object input\n */\nexport const putObjectSchema = z.object({\n id: z.string(),\n name: z.string().optional().default(\"\"),\n variant: z.enum(imageVariants).optional().default(\"main\"),\n body: z.any().optional(),\n contentType: z.string().optional().default(\"\"),\n size: z.number().optional().default(0),\n});\n\nexport type PutObjectInput = z.input<typeof putObjectSchema> & {\n body?: PutObjectCommandInput[\"Body\"];\n};\n\nexport type PutObjectSchema = z.infer<typeof putObjectSchema>;\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAa,iBAAiBA,IAAE,KAAK,aAAa,WAAW;;;;AAM7D,MAAa,mBAAmB,mBAAmB,OAAO,EACxD,WAAWA,IAAE,QAAQ,EACtB,CAAC;;;;AAQF,MAAa,mBAAmB,mBAAmB,MAAM;;;;AAQzD,MAAa,yBAAyB,iBAAiB,KAAK;CAC1D,MAAM;CACN,aAAa;CACb,MAAM;CACN,SAAS;CACV,CAAC;;;;AAOF,MAAa,uBAAuB,iBAAiB,KAAK,EACxD,MAAM,MACP,CAAC;;;;AAMF,MAAa,mBAAmB,mBAAmB,MAAM;AACzD,MAAa,+BAA+B,iBAAiB,OAAO,EAClE,UAAUA,IAAE,MAAM,iBAAiB,EACpC,CAAC;;;;AAQF,MAAa,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AE,QAAQ,CAAC,UAAU,CAAC,QAAQ,GAAG;CACvC,SAASA,IAAE,KAAK,cAAc,CAAC,UAAU,CAAC,QAAQ,OAAO;CACzD,MAAMA,IAAE,KAAK,CAAC,UAAU;CACxB,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,GAAG;CAC9C,MAAMA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE;CACvC,CAAC"}
1
+ {"version":3,"file":"validators.mjs","names":["z"],"sources":["../../../../src/modules/storage/lib/validators.ts"],"sourcesContent":["import { tableQuerySchema } from \"@/modules/data-tables/entry\";\nimport { resolveFiltersSchema } from \"@/modules/data-tables/lib/filters/resolvers\";\nimport { PutObjectCommandInput } from \"@aws-sdk/client-s3\";\nimport { createInsertSchema, createSelectSchema, createUpdateSchema } from \"drizzle-zod\";\nimport { z } from \"zod\";\nimport { nodesTableFilters } from \"../config/filters\";\nimport { imageDispositions, imageVariants } from \"./constants\";\nimport { nodeModeEnum, nodes } from \"./schema\";\n\n/**\n * Nodes\n */\nexport type Node = typeof nodes.$inferSelect;\nexport type FileNode = typeof nodes.$inferSelect & { type: \"file\" };\nexport type FolderNode = typeof nodes.$inferSelect & { type: \"folder\" };\n\n/**\n * Node mode\n */\nexport const nodeModeSchema = z.enum(nodeModeEnum.enumValues);\nexport type NodeMode = z.infer<typeof nodeModeSchema>;\n\n/**\n * Create node\n */\nexport const createNodeSchema = createInsertSchema(nodes, {\n namespace: z.string(),\n});\n\nexport type CreateNodeInput = z.input<typeof createNodeSchema>;\nexport type CreateNodeSchema = z.infer<typeof createNodeSchema>;\n\n/**\n * Update node\n */\nexport const updateNodeSchema = createUpdateSchema(nodes);\n\nexport type UpdateNodeInput = z.input<typeof updateNodeSchema>;\nexport type UpdateNodeSchema = z.infer<typeof updateNodeSchema>;\n\n/**\n * Select node\n */\nexport const selectNodeSchema = createSelectSchema(nodes);\nexport const selectNodeWithChildrenSchema = selectNodeSchema.extend({\n children: z.array(selectNodeSchema),\n});\n\nexport type SelectNodeSchema = z.infer<typeof selectNodeSchema>;\nexport type SelectNodeWithChildrenSchema = z.infer<typeof selectNodeWithChildrenSchema>;\n\n/**\n * Where input\n */\nexport const nodesTableFiltersSchema = resolveFiltersSchema(nodesTableFilters)\n .partial()\n .extend({\n namespace: z.string(),\n parentId: z.string().nullable(),\n })\n .transform((input) => ({\n ...input,\n hidden: input?.hidden ?? false,\n isDeleted: input?.isDeleted ?? false,\n }));\n\nexport type NodesTableFilters = z.input<typeof nodesTableFiltersSchema>;\n\n/**\n * Create folder node\n */\nexport const createFolderNodeSchema = createNodeSchema.omit({\n type: true,\n contentType: true,\n size: true,\n subtype: true,\n});\n\nexport type CreateFolderNodeSchema = z.infer<typeof createFolderNodeSchema>;\n\n/**\n * Upload file schema\n */\nexport const uploadFileSchema = createNodeSchema.omit({ type: true });\n\nexport type UploadFileSchema = z.infer<typeof uploadFileSchema>;\n\n/**\n * Presign file schema\n */\nexport const presignFileSchema = uploadFileSchema.extend({ id: z.uuid() });\n\nexport type PresignFileSchema = z.infer<typeof presignFileSchema>;\n\n/**\n * Get file url schema\n */\nexport const getFileURLSchemaDefaults = { variant: \"main\", disposition: \"inline\" } as const;\n\nexport const getFileURLSchema = z.object({\n variant: z.enum(imageVariants).optional().default(getFileURLSchemaDefaults.variant),\n disposition: z.enum(imageDispositions).optional().default(getFileURLSchemaDefaults.disposition),\n});\n\nexport type GetFileUrlInput = z.input<typeof getFileURLSchema>;\nexport type GetFileURLSchema = z.infer<typeof getFileURLSchema>;\n\n/**\n * Get by parent id input\n */\nexport const getNodesByParentIdSchema = tableQuerySchema\n .pick({ order: true, sort: true, search: true })\n .extend({ filters: nodesTableFiltersSchema });\n\nexport type GetNodesByParentIdInput = z.input<typeof getNodesByParentIdSchema>;\n\n/**\n * Get object input\n */\nexport const getObjectSchema = z.object({\n id: z.string(),\n variant: z.enum(imageVariants).optional().default(getFileURLSchemaDefaults.variant),\n disposition: z.string().optional().default(getFileURLSchemaDefaults.disposition),\n});\n\nexport type GetObjectInput = z.input<typeof getObjectSchema>;\nexport type GetObjectSchema = z.infer<typeof getObjectSchema>;\n\n/**\n * Put object input\n */\nexport const putObjectSchema = z.object({\n id: z.string(),\n name: z.string().optional().default(\"\"),\n variant: z.enum(imageVariants).optional().default(\"main\"),\n body: z.any().optional(),\n contentType: z.string().nullable().optional(),\n size: z.number().nullable().optional(),\n});\n\nexport type PutObjectInput = z.input<typeof putObjectSchema> & {\n body?: PutObjectCommandInput[\"Body\"];\n};\n\nexport type PutObjectSchema = z.infer<typeof putObjectSchema>;\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAa,iBAAiBA,IAAE,KAAK,aAAa,WAAW;;;;AAM7D,MAAa,mBAAmB,mBAAmB,OAAO,EACxD,WAAWA,IAAE,QAAQ,EACtB,CAAC;;;;AAQF,MAAa,mBAAmB,mBAAmB,MAAM;;;;AAQzD,MAAa,mBAAmB,mBAAmB,MAAM;AACzD,MAAa,+BAA+B,iBAAiB,OAAO,EAClE,UAAUA,IAAE,MAAM,iBAAiB,EACpC,CAAC;;;;AAQF,MAAa,0BAA0B,qBAAqB,kBAAkB,CAC3E,SAAS,CACT,OAAO;CACN,WAAWA,IAAE,QAAQ;CACrB,UAAUA,IAAE,QAAQ,CAAC,UAAU;CAChC,CAAC,CACD,WAAW,WAAW;CACrB,GAAG;CACH,QAAQ,OAAO,UAAU;CACzB,WAAW,OAAO,aAAa;CAChC,EAAE;;;;AAOL,MAAa,yBAAyB,iBAAiB,KAAK;CAC1D,MAAM;CACN,aAAa;CACb,MAAM;CACN,SAAS;CACV,CAAC;;;;AAOF,MAAa,mBAAmB,iBAAiB,KAAK,EAAE,MAAM,MAAM,CAAC;;;;AAOrE,MAAa,oBAAoB,iBAAiB,OAAO,EAAE,IAAIA,IAAE,MAAM,EAAE,CAAC;;;;AAO1E,MAAa,2BAA2B;CAAE,SAAS;CAAQ,aAAa;CAAU;AAElF,MAAa,mBAAmBA,IAAE,OAAO;CACvC,SAASA,IAAE,KAAK,cAAc,CAAC,UAAU,CAAC,QAAQ,yBAAyB,QAAQ;CACnF,aAAaA,IAAE,KAAK,kBAAkB,CAAC,UAAU,CAAC,QAAQ,yBAAyB,YAAY;CAChG,CAAC;;;;AAQF,MAAa,2BAA2B,iBACrC,KAAK;CAAE,OAAO;CAAM,MAAM;CAAM,QAAQ;CAAM,CAAC,CAC/C,OAAO,EAAE,SAAS,yBAAyB,CAAC;;;;AAO/C,MAAa,kBAAkBA,IAAE,OAAO;CACtC,IAAIA,IAAE,QAAQ;CACd,SAASA,IAAE,KAAK,cAAc,CAAC,UAAU,CAAC,QAAQ,yBAAyB,QAAQ;CACnF,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,yBAAyB,YAAY;CACjF,CAAC;;;;AAQF,MAAa,kBAAkBA,IAAE,OAAO;CACtC,IAAIA,IAAE,QAAQ;CACd,MAAMA,IAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,GAAG;CACvC,SAASA,IAAE,KAAK,cAAc,CAAC,UAAU,CAAC,QAAQ,OAAO;CACzD,MAAMA,IAAE,KAAK,CAAC,UAAU;CACxB,aAAaA,IAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CAC7C,MAAMA,IAAE,QAAQ,CAAC,UAAU,CAAC,UAAU;CACvC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { DriveSchema, nodeModeEnum, nodePresignedUrls, nodePresignedUrlsRelations, nodeTypeEnum, nodeVariants, nodeVariantsRelations, nodes, nodesRelations } from "./modules/storage/lib/schema.mjs";
2
- import { CreateFileNodeSchema, CreateFolderNodeSchema, CreateNodeInput, CreateNodeSchema, FileNode, FolderNode, GetFileURLSchema, GetFileUrlInput, GetNodesByParentIdInput, GetObjectInput, GetObjectSchema, Node, NodeMode, NodesTableFilters, PresignFileSchema, PutObjectInput, PutObjectSchema, SelectNodeSchema, SelectNodeWithChildrenSchema, UpdateNodeInput, UpdateNodeSchema, UploadFileSchema, createFileNodeSchema, createFolderNodeSchema, createNodeSchema, getFileURLSchema, getFileURLSchemaDefaults, getNodesByParentIdSchema, getObjectSchema, nodeModeSchema, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema } from "./modules/storage/lib/validators.mjs";
2
+ import { CreateFolderNodeSchema, CreateNodeInput, CreateNodeSchema, FileNode, FolderNode, GetFileURLSchema, GetFileUrlInput, GetNodesByParentIdInput, GetObjectInput, GetObjectSchema, Node, NodeMode, NodesTableFilters, PresignFileSchema, PutObjectInput, PutObjectSchema, SelectNodeSchema, SelectNodeWithChildrenSchema, UpdateNodeInput, UpdateNodeSchema, UploadFileSchema, createFolderNodeSchema, createNodeSchema, getFileURLSchema, getFileURLSchemaDefaults, getNodesByParentIdSchema, getObjectSchema, nodeModeSchema, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema } from "./modules/storage/lib/validators.mjs";
3
3
  import { nodesTableFilters } from "./modules/storage/config/filters.mjs";
4
4
  import { ImageDisposition, ImageVariant, deviceSizes, imageDispositions, imageSizes, imageVariants } from "./modules/storage/lib/constants.mjs";
5
5
  import { NodeSubtype, getDriveBucketKey, getFileUrl, imageLoader, inferNodeSubtype, isFile, isFolder, nodeSubtypes, renderBytes } from "./modules/storage/lib/helpers.mjs";
6
- export { CreateFileNodeSchema, CreateFolderNodeSchema, CreateNodeInput, CreateNodeSchema, DriveSchema, FileNode, FolderNode, GetFileURLSchema, GetFileUrlInput, GetNodesByParentIdInput, GetObjectInput, GetObjectSchema, ImageDisposition, ImageVariant, Node, NodeMode, NodeSubtype, NodesTableFilters, PresignFileSchema, PutObjectInput, PutObjectSchema, SelectNodeSchema, SelectNodeWithChildrenSchema, UpdateNodeInput, UpdateNodeSchema, UploadFileSchema, createFileNodeSchema, createFolderNodeSchema, createNodeSchema, deviceSizes, getDriveBucketKey, getFileURLSchema, getFileURLSchemaDefaults, getFileUrl, getNodesByParentIdSchema, getObjectSchema, imageDispositions, imageLoader, imageSizes, imageVariants, inferNodeSubtype, isFile, isFolder, nodeModeEnum, nodeModeSchema, nodePresignedUrls, nodePresignedUrlsRelations, nodeSubtypes, nodeTypeEnum, nodeVariants, nodeVariantsRelations, nodes, nodesRelations, nodesTableFilters, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, renderBytes, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema };
6
+ export { CreateFolderNodeSchema, CreateNodeInput, CreateNodeSchema, DriveSchema, FileNode, FolderNode, GetFileURLSchema, GetFileUrlInput, GetNodesByParentIdInput, GetObjectInput, GetObjectSchema, ImageDisposition, ImageVariant, Node, NodeMode, NodeSubtype, NodesTableFilters, PresignFileSchema, PutObjectInput, PutObjectSchema, SelectNodeSchema, SelectNodeWithChildrenSchema, UpdateNodeInput, UpdateNodeSchema, UploadFileSchema, createFolderNodeSchema, createNodeSchema, deviceSizes, getDriveBucketKey, getFileURLSchema, getFileURLSchemaDefaults, getFileUrl, getNodesByParentIdSchema, getObjectSchema, imageDispositions, imageLoader, imageSizes, imageVariants, inferNodeSubtype, isFile, isFolder, nodeModeEnum, nodeModeSchema, nodePresignedUrls, nodePresignedUrlsRelations, nodeSubtypes, nodeTypeEnum, nodeVariants, nodeVariantsRelations, nodes, nodesRelations, nodesTableFilters, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, renderBytes, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema };
package/dist/storage.mjs CHANGED
@@ -2,6 +2,6 @@ import { deviceSizes, imageDispositions, imageSizes, imageVariants } from "./mod
2
2
  import { getDriveBucketKey, getFileUrl, imageLoader, inferNodeSubtype, isFile, isFolder, nodeSubtypes, renderBytes } from "./modules/storage/lib/helpers.mjs";
3
3
  import { nodeModeEnum, nodePresignedUrls, nodePresignedUrlsRelations, nodeTypeEnum, nodeVariants, nodeVariantsRelations, nodes, nodesRelations } from "./modules/storage/lib/schema.mjs";
4
4
  import { nodesTableFilters } from "./modules/storage/config/filters.mjs";
5
- import { createFileNodeSchema, createFolderNodeSchema, createNodeSchema, getFileURLSchema, getFileURLSchemaDefaults, getNodesByParentIdSchema, getObjectSchema, nodeModeSchema, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema } from "./modules/storage/lib/validators.mjs";
5
+ import { createFolderNodeSchema, createNodeSchema, getFileURLSchema, getFileURLSchemaDefaults, getNodesByParentIdSchema, getObjectSchema, nodeModeSchema, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema } from "./modules/storage/lib/validators.mjs";
6
6
 
7
- export { createFileNodeSchema, createFolderNodeSchema, createNodeSchema, deviceSizes, getDriveBucketKey, getFileURLSchema, getFileURLSchemaDefaults, getFileUrl, getNodesByParentIdSchema, getObjectSchema, imageDispositions, imageLoader, imageSizes, imageVariants, inferNodeSubtype, isFile, isFolder, nodeModeEnum, nodeModeSchema, nodePresignedUrls, nodePresignedUrlsRelations, nodeSubtypes, nodeTypeEnum, nodeVariants, nodeVariantsRelations, nodes, nodesRelations, nodesTableFilters, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, renderBytes, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema };
7
+ export { createFolderNodeSchema, createNodeSchema, deviceSizes, getDriveBucketKey, getFileURLSchema, getFileURLSchemaDefaults, getFileUrl, getNodesByParentIdSchema, getObjectSchema, imageDispositions, imageLoader, imageSizes, imageVariants, inferNodeSubtype, isFile, isFolder, nodeModeEnum, nodeModeSchema, nodePresignedUrls, nodePresignedUrlsRelations, nodeSubtypes, nodeTypeEnum, nodeVariants, nodeVariantsRelations, nodes, nodesRelations, nodesTableFilters, nodesTableFiltersSchema, presignFileSchema, putObjectSchema, renderBytes, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema, uploadFileSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tulip-systems/core",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -13,8 +13,8 @@
13
13
  "tw-animate-css": "^1.4.0",
14
14
  "typescript": "5.9.3",
15
15
  "vite": "^7.2.7",
16
- "@tulip-systems/eslint-config": "0.0.0",
17
- "@tulip-systems/typescript-config": "0.0.0"
16
+ "@tulip-systems/typescript-config": "0.0.0",
17
+ "@tulip-systems/eslint-config": "0.0.0"
18
18
  },
19
19
  "dependencies": {
20
20
  "@aws-sdk/client-s3": "^3.946.0",
@@ -7,12 +7,13 @@ import { useAction } from "@/lib/hooks/use-action";
7
7
  import { generateDefaultUUID } from "@/modules/config/entry";
8
8
  import { useQueryClient } from "@tanstack/react-query";
9
9
  import { ComponentProps, useCallback, useState } from "react";
10
- import { FileNode, Node, PresignFileSchema } from "../lib/validators";
10
+ import { FileNode, Node, PresignFileSchema, UploadFileSchema } from "../lib/validators";
11
11
  import { UploadZoneContext } from "./upload-zone-context.client";
12
12
 
13
13
  export type UploadZoneProps = ComponentProps<"div"> & {
14
14
  namespace: string;
15
15
  parentId: string | null;
16
+ options?: Pick<UploadFileSchema, "readonly" | "hidden" | "mode">;
16
17
 
17
18
  queryKey: readonly unknown[];
18
19
 
@@ -33,6 +34,7 @@ export type UploadZoneProps = ComponentProps<"div"> & {
33
34
  export function UploadZone({
34
35
  namespace,
35
36
  parentId,
37
+ options,
36
38
  queryKey,
37
39
  presignAction,
38
40
  confirmAction,
@@ -191,6 +193,7 @@ export function UploadZone({
191
193
  * Send the presign request
192
194
  */
193
195
  const { id, presignedUrl } = await presignMutation.mutateAsync({
196
+ ...options,
194
197
  id: generateDefaultUUID(),
195
198
  name: file.name,
196
199
  size: file.size,
@@ -209,7 +212,7 @@ export function UploadZone({
209
212
  */
210
213
  return await confirmMutation.mutateAsync({ id });
211
214
  },
212
- [presignMutation, uploadMutation, confirmMutation, namespace, parentId],
215
+ [presignMutation, options, namespace, parentId, uploadMutation, confirmMutation],
213
216
  );
214
217
 
215
218
  return (
@@ -7,4 +7,5 @@ export const nodesTableFilters = createTableFilters({
7
7
  types: parseFilterArray(z.array(z.enum(nodeTypeEnum.enumValues))),
8
8
  nodeIds: parseFilterArray(z.array(z.string())),
9
9
  isDeleted: parseFilterBoolean(z.boolean()),
10
+ hidden: parseFilterBoolean(z.boolean()),
10
11
  });
@@ -1,6 +1,6 @@
1
1
  import { ImageLoaderProps } from "next/image";
2
2
  import { ImageVariant } from "./constants";
3
- import { FileNode, GetFileURLSchema, Node } from "./validators";
3
+ import { CreateNodeSchema, GetFileURLSchema, Node } from "./validators";
4
4
 
5
5
  /**
6
6
  * Check if the node is a file
@@ -62,7 +62,8 @@ export type NodeSubtype = (typeof nodeSubtypes)[number];
62
62
  export function inferNodeSubtype({
63
63
  name,
64
64
  contentType,
65
- }: Pick<FileNode, "name" | "contentType">): NodeSubtype {
65
+ }: Pick<CreateNodeSchema, "name" | "contentType">): NodeSubtype {
66
+ if (!contentType) return "other";
66
67
  if (contentType?.startsWith("image/")) return "image";
67
68
  if (contentType === "application/pdf") return "document";
68
69
  if (contentType?.includes("spreadsheet")) return "spreadsheet";
@@ -21,6 +21,7 @@ export const nodes = pgTable("nodes", (t) => ({
21
21
  size: t.integer().default(0),
22
22
  contentType: t.varchar({ length: 255 }),
23
23
  readonly: boolean().default(false),
24
+ hidden: boolean().default(false),
24
25
  createdBy: t.uuid().references(() => users.id, { onDelete: "set null" }),
25
26
  isPending: t.boolean().default(false).notNull(),
26
27
  isDeleted: t.boolean().default(false).notNull(),
@@ -101,8 +101,8 @@ export class StorageService<TSchema extends TDatabaseSchema> {
101
101
  Bucket: BUCKET_NAME,
102
102
  Key: getDriveBucketKey(input.id, input.variant),
103
103
  Body: input.body,
104
- ContentType: input.contentType,
105
- ContentLength: input.size,
104
+ ContentType: input.contentType ?? "",
105
+ ContentLength: input.size ?? 0,
106
106
  Metadata: {
107
107
  nodeId: input.id,
108
108
  },
@@ -117,6 +117,13 @@ export class StorageService<TSchema extends TDatabaseSchema> {
117
117
  return await this.#blob.send(putCommand);
118
118
  }
119
119
 
120
+ /**
121
+ * Get node by id
122
+ */
123
+ async getNodeById(id: string) {
124
+ return this.#db.select().from(nodes).where(eq(nodes.id, id));
125
+ }
126
+
120
127
  /**
121
128
  * Get nodes by parent id
122
129
  */
@@ -132,6 +139,7 @@ export class StorageService<TSchema extends TDatabaseSchema> {
132
139
  filters.nodeIds != null ? inArray(nodes.id, filters.nodeIds) : undefined,
133
140
  filters.types != null ? inArray(nodes.type, filters.types) : undefined,
134
141
  filters.isDeleted != null ? eq(nodes.isDeleted, filters.isDeleted) : undefined,
142
+ filters.hidden != null ? eq(nodes.hidden, filters.hidden) : undefined,
135
143
  filters.parentId ? eq(nodes.parentId, filters.parentId) : isNull(nodes.parentId),
136
144
  eq(nodes.namespace, filters.namespace),
137
145
  search,
@@ -38,26 +38,6 @@ export const updateNodeSchema = createUpdateSchema(nodes);
38
38
  export type UpdateNodeInput = z.input<typeof updateNodeSchema>;
39
39
  export type UpdateNodeSchema = z.infer<typeof updateNodeSchema>;
40
40
 
41
- /**
42
- * Create folder node
43
- */
44
- export const createFolderNodeSchema = createNodeSchema.omit({
45
- type: true,
46
- contentType: true,
47
- size: true,
48
- subtype: true,
49
- });
50
-
51
- export type CreateFolderNodeSchema = z.infer<typeof createFolderNodeSchema>;
52
-
53
- /**
54
- * Create file node
55
- */
56
- export const createFileNodeSchema = createNodeSchema.omit({
57
- type: true,
58
- });
59
- export type CreateFileNodeSchema = z.infer<typeof createFileNodeSchema>;
60
-
61
41
  /**
62
42
  * Select node
63
43
  */
@@ -78,22 +58,31 @@ export const nodesTableFiltersSchema = resolveFiltersSchema(nodesTableFilters)
78
58
  namespace: z.string(),
79
59
  parentId: z.string().nullable(),
80
60
  })
81
- .transform((input) => ({ ...input, isDeleted: input?.isDeleted ?? false }));
61
+ .transform((input) => ({
62
+ ...input,
63
+ hidden: input?.hidden ?? false,
64
+ isDeleted: input?.isDeleted ?? false,
65
+ }));
82
66
 
83
67
  export type NodesTableFilters = z.input<typeof nodesTableFiltersSchema>;
84
68
 
85
69
  /**
86
- * Upload file schema
70
+ * Create folder node
87
71
  */
88
- export const uploadFileSchema = z.object({
89
- name: z.string().min(1),
90
- namespace: z.string(),
91
- mode: nodeModeSchema.optional(),
92
- parentId: z.uuid().nullable(),
93
- size: z.number().optional().default(0),
94
- contentType: z.string().optional().default(""),
72
+ export const createFolderNodeSchema = createNodeSchema.omit({
73
+ type: true,
74
+ contentType: true,
75
+ size: true,
76
+ subtype: true,
95
77
  });
96
78
 
79
+ export type CreateFolderNodeSchema = z.infer<typeof createFolderNodeSchema>;
80
+
81
+ /**
82
+ * Upload file schema
83
+ */
84
+ export const uploadFileSchema = createNodeSchema.omit({ type: true });
85
+
97
86
  export type UploadFileSchema = z.infer<typeof uploadFileSchema>;
98
87
 
99
88
  /**
@@ -145,8 +134,8 @@ export const putObjectSchema = z.object({
145
134
  name: z.string().optional().default(""),
146
135
  variant: z.enum(imageVariants).optional().default("main"),
147
136
  body: z.any().optional(),
148
- contentType: z.string().optional().default(""),
149
- size: z.number().optional().default(0),
137
+ contentType: z.string().nullable().optional(),
138
+ size: z.number().nullable().optional(),
150
139
  });
151
140
 
152
141
  export type PutObjectInput = z.input<typeof putObjectSchema> & {