@tulip-systems/core 0.6.1 → 0.8.0
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.
- package/LICENSE +662 -0
- package/dist/auth/server.d.mts +3 -3
- package/dist/auth/server.mjs +3 -3
- package/dist/components/client.d.mts +19 -3
- package/dist/components/client.mjs +18 -2
- package/dist/components/editor/components/editor.client.d.mts +4 -3
- package/dist/components/editor/components/editor.client.d.mts.map +1 -1
- package/dist/components/editor/components/editor.client.mjs +5 -2
- package/dist/components/editor/components/editor.client.mjs.map +1 -1
- package/dist/components/editor/components/menu-nodes.client.mjs +1 -1
- package/dist/components/editor/components/menu-nodes.client.mjs.map +1 -1
- package/dist/components/editor/components/menu.client.mjs +3 -3
- package/dist/components/editor/components/menu.client.mjs.map +1 -1
- package/dist/components/editor/extensions/file-handler/extension.d.mts +4 -4
- package/dist/components/editor/extensions/file-handler/extension.d.mts.map +1 -1
- package/dist/components/editor/extensions/file-handler/extension.mjs.map +1 -1
- package/dist/components/editor/extensions/file-handler/strategy.d.mts +4 -6
- package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +1 -1
- package/dist/components/editor/extensions/file-handler/strategy.mjs +11 -11
- package/dist/components/editor/extensions/file-handler/strategy.mjs.map +1 -1
- package/dist/components/editor/extensions/file-handler/utils.mjs +1 -1
- package/dist/components/editor/extensions/file-handler/utils.mjs.map +1 -1
- package/dist/components/editor/extensions/image/extension.mjs +9 -9
- package/dist/components/editor/extensions/image/extension.mjs.map +1 -1
- package/dist/components/editor/lib/constants.d.mts +1 -1
- package/dist/components/editor/lib/constants.mjs +1 -1
- package/dist/components/editor/lib/extensions.d.mts +1 -1
- package/dist/components/editor/lib/helpers.d.mts +11 -3
- package/dist/components/editor/lib/helpers.d.mts.map +1 -1
- package/dist/components/editor/lib/helpers.mjs +27 -13
- package/dist/components/editor/lib/helpers.mjs.map +1 -1
- package/dist/components/emails/forget-password-email.mjs +6 -6
- package/dist/components/emails/forget-password-email.mjs.map +1 -1
- package/dist/components/header/back-button.client.mjs +2 -2
- package/dist/components/header/back-button.client.mjs.map +1 -1
- package/dist/components/header/bottom-bar.client.mjs +2 -2
- package/dist/components/header/bottom-bar.client.mjs.map +1 -1
- package/dist/components/header/breadcrumbs.client.mjs +1 -1
- package/dist/components/header/breadcrumbs.client.mjs.map +1 -1
- package/dist/components/header/header.client.mjs +1 -1
- package/dist/components/header/header.client.mjs.map +1 -1
- package/dist/components/layouts/empty-page.mjs +2 -2
- package/dist/components/layouts/empty-page.mjs.map +1 -1
- package/dist/components/layouts/error-page.mjs +3 -3
- package/dist/components/layouts/error-page.mjs.map +1 -1
- package/dist/components/layouts/providers.client.d.mts.map +1 -1
- package/dist/components/layouts/providers.client.mjs +3 -2
- package/dist/components/layouts/providers.client.mjs.map +1 -1
- package/dist/components/layouts/root-loading.mjs +2 -2
- package/dist/components/layouts/root-loading.mjs.map +1 -1
- package/dist/components/layouts/tab-layout.mjs +1 -1
- package/dist/components/layouts/tab-layout.mjs.map +1 -1
- package/dist/components/lists/data-list.mjs +1 -1
- package/dist/components/lists/data-list.mjs.map +1 -1
- package/dist/components/lists/data-stack.mjs +1 -1
- package/dist/components/lists/data-stack.mjs.map +1 -1
- package/dist/components/navigation/admin-sidebar-header.client.mjs +3 -3
- package/dist/components/navigation/admin-sidebar-header.client.mjs.map +1 -1
- package/dist/components/navigation/admin-sidebar-skeleton.mjs +1 -1
- package/dist/components/navigation/admin-sidebar-skeleton.mjs.map +1 -1
- package/dist/components/ui/accordion.client.d.mts +26 -0
- package/dist/components/ui/accordion.client.d.mts.map +1 -0
- package/dist/components/ui/accordion.client.mjs +58 -0
- package/dist/components/ui/accordion.client.mjs.map +1 -0
- package/dist/components/ui/alert-dialog.client.d.mts +61 -0
- package/dist/components/ui/alert-dialog.client.d.mts.map +1 -0
- package/dist/components/ui/alert-dialog.client.mjs +104 -0
- package/dist/components/ui/alert-dialog.client.mjs.map +1 -0
- package/dist/components/ui/alert.d.mts +5 -1
- package/dist/components/ui/alert.d.mts.map +1 -1
- package/dist/components/ui/alert.mjs +13 -6
- package/dist/components/ui/alert.mjs.map +1 -1
- package/dist/components/ui/aspect-ratio.client.d.mts +10 -0
- package/dist/components/ui/aspect-ratio.client.d.mts.map +1 -0
- package/dist/components/ui/aspect-ratio.client.mjs +16 -0
- package/dist/components/ui/aspect-ratio.client.mjs.map +1 -0
- package/dist/components/ui/avatar.client.d.mts +21 -6
- package/dist/components/ui/avatar.client.d.mts.map +1 -1
- package/dist/components/ui/avatar.client.mjs +31 -9
- package/dist/components/ui/avatar.client.mjs.map +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/badge.d.mts.map +1 -1
- package/dist/components/ui/badge.mjs +11 -8
- package/dist/components/ui/badge.mjs.map +1 -1
- package/dist/components/ui/breadcrumb.d.mts +3 -1
- package/dist/components/ui/breadcrumb.d.mts.map +1 -1
- package/dist/components/ui/breadcrumb.mjs +7 -7
- package/dist/components/ui/breadcrumb.mjs.map +1 -1
- package/dist/components/ui/button-group.d.mts +29 -0
- package/dist/components/ui/button-group.d.mts.map +1 -0
- package/dist/components/ui/button-group.mjs +41 -0
- package/dist/components/ui/button-group.mjs.map +1 -0
- package/dist/components/ui/button.d.mts +2 -2
- package/dist/components/ui/button.d.mts.map +1 -1
- package/dist/components/ui/button.mjs +19 -13
- package/dist/components/ui/button.mjs.map +1 -1
- package/dist/components/ui/{calendar.d.mts → calendar.client.d.mts} +7 -4
- package/dist/components/ui/calendar.client.d.mts.map +1 -0
- package/dist/components/ui/{calendar.mjs → calendar.client.mjs} +22 -19
- package/dist/components/ui/calendar.client.mjs.map +1 -0
- package/dist/components/ui/card.d.mts +9 -2
- package/dist/components/ui/card.d.mts.map +1 -1
- package/dist/components/ui/card.mjs +15 -7
- package/dist/components/ui/card.mjs.map +1 -1
- package/dist/components/ui/{carousel.d.mts → carousel.client.d.mts} +12 -3
- package/dist/components/ui/carousel.client.d.mts.map +1 -0
- package/dist/components/ui/{carousel.mjs → carousel.client.mjs} +10 -10
- package/dist/components/ui/carousel.client.mjs.map +1 -0
- package/dist/components/ui/chart.client.d.mts.map +1 -1
- package/dist/components/ui/chart.client.mjs +11 -11
- package/dist/components/ui/chart.client.mjs.map +1 -1
- package/dist/components/ui/checkbox.client.d.mts +12 -0
- package/dist/components/ui/checkbox.client.d.mts.map +1 -0
- package/dist/components/ui/checkbox.client.mjs +24 -0
- package/dist/components/ui/checkbox.client.mjs.map +1 -0
- package/dist/components/ui/collapsible.client.d.mts +6 -6
- package/dist/components/ui/collapsible.client.d.mts.map +1 -1
- package/dist/components/ui/collapsible.client.mjs +6 -6
- package/dist/components/ui/collapsible.client.mjs.map +1 -1
- package/dist/components/ui/combobox-dropdown.client.d.mts +1 -1
- package/dist/components/ui/combobox-dropdown.client.mjs +3 -2
- package/dist/components/ui/combobox-dropdown.client.mjs.map +1 -1
- package/dist/components/ui/combobox.client.mjs +5 -5
- package/dist/components/ui/combobox.client.mjs.map +1 -1
- package/dist/components/ui/{command.d.mts → command.client.d.mts} +8 -2
- package/dist/components/ui/command.client.d.mts.map +1 -0
- package/dist/components/ui/command.client.mjs +91 -0
- package/dist/components/ui/command.client.mjs.map +1 -0
- package/dist/components/ui/context-menu.client.d.mts +86 -0
- package/dist/components/ui/context-menu.client.d.mts.map +1 -0
- package/dist/components/ui/context-menu.client.mjs +128 -0
- package/dist/components/ui/context-menu.client.mjs.map +1 -0
- package/dist/components/ui/date-picker.client.mjs +2 -2
- package/dist/components/ui/date-picker.client.mjs.map +1 -1
- package/dist/components/ui/dialog.client.d.mts +19 -12
- package/dist/components/ui/dialog.client.d.mts.map +1 -1
- package/dist/components/ui/dialog.client.mjs +40 -29
- package/dist/components/ui/dialog.client.mjs.map +1 -1
- package/dist/components/ui/drawer.client.d.mts.map +1 -1
- package/dist/components/ui/drawer.client.mjs +5 -5
- package/dist/components/ui/drawer.client.mjs.map +1 -1
- package/dist/components/ui/dropdown-menu.client.d.mts +85 -0
- package/dist/components/ui/dropdown-menu.client.d.mts.map +1 -0
- package/dist/components/ui/dropdown-menu.client.mjs +131 -0
- package/dist/components/ui/dropdown-menu.client.mjs.map +1 -0
- package/dist/components/ui/empty.d.mts +36 -0
- package/dist/components/ui/empty.d.mts.map +1 -0
- package/dist/components/ui/empty.mjs +62 -0
- package/dist/components/ui/empty.mjs.map +1 -0
- package/dist/components/ui/field.client.d.mts +65 -0
- package/dist/components/ui/field.client.d.mts.map +1 -0
- package/dist/components/ui/field.client.mjs +114 -0
- package/dist/components/ui/field.client.mjs.map +1 -0
- package/dist/components/ui/form.client.d.mts +3 -4
- package/dist/components/ui/form.client.d.mts.map +1 -1
- package/dist/components/ui/form.client.mjs +4 -4
- package/dist/components/ui/form.client.mjs.map +1 -1
- package/dist/components/ui/hover-card.client.d.mts +6 -6
- package/dist/components/ui/hover-card.client.d.mts.map +1 -1
- package/dist/components/ui/hover-card.client.mjs +14 -11
- package/dist/components/ui/hover-card.client.mjs.map +1 -1
- package/dist/components/ui/{input-date-time.d.mts → input-date-time.client.d.mts} +3 -3
- package/dist/components/ui/input-date-time.client.d.mts.map +1 -0
- package/dist/components/ui/{input-date-time.mjs → input-date-time.client.mjs} +4 -2
- package/dist/components/ui/input-date-time.client.mjs.map +1 -0
- package/dist/components/ui/input-date.d.mts +1 -1
- package/dist/components/ui/input-date.d.mts.map +1 -1
- package/dist/components/ui/input-date.mjs.map +1 -1
- package/dist/components/ui/input-group.client.d.mts +59 -0
- package/dist/components/ui/input-group.client.d.mts.map +1 -0
- package/dist/components/ui/input-group.client.mjs +106 -0
- package/dist/components/ui/input-group.client.mjs.map +1 -0
- package/dist/components/ui/input-recipient.mjs +11 -11
- package/dist/components/ui/input-recipient.mjs.map +1 -1
- package/dist/components/ui/input-time.d.mts +1 -1
- package/dist/components/ui/input-time.d.mts.map +1 -1
- package/dist/components/ui/input-time.mjs.map +1 -1
- package/dist/components/ui/input.d.mts.map +1 -1
- package/dist/components/ui/input.mjs +1 -1
- package/dist/components/ui/input.mjs.map +1 -1
- package/dist/components/ui/item.d.mts +63 -0
- package/dist/components/ui/item.d.mts.map +1 -0
- package/dist/components/ui/item.mjs +119 -0
- package/dist/components/ui/item.mjs.map +1 -0
- package/dist/components/ui/kbd.d.mts +14 -0
- package/dist/components/ui/kbd.d.mts.map +1 -0
- package/dist/components/ui/kbd.mjs +22 -0
- package/dist/components/ui/kbd.mjs.map +1 -0
- package/dist/components/ui/label.d.mts +4 -4
- package/dist/components/ui/label.d.mts.map +1 -1
- package/dist/components/ui/label.mjs +5 -5
- package/dist/components/ui/label.mjs.map +1 -1
- package/dist/components/ui/loader.d.mts +7 -0
- package/dist/components/ui/loader.d.mts.map +1 -0
- package/dist/components/ui/loader.mjs +63 -0
- package/dist/components/ui/loader.mjs.map +1 -0
- package/dist/components/ui/navigation-menu.d.mts +11 -11
- package/dist/components/ui/navigation-menu.d.mts.map +1 -1
- package/dist/components/ui/navigation-menu.mjs +18 -20
- package/dist/components/ui/navigation-menu.mjs.map +1 -1
- package/dist/components/ui/pagination.d.mts +8 -2
- package/dist/components/ui/pagination.d.mts.map +1 -1
- package/dist/components/ui/pagination.mjs +29 -21
- package/dist/components/ui/pagination.mjs.map +1 -1
- package/dist/components/ui/popover.client.d.mts +35 -0
- package/dist/components/ui/popover.client.d.mts.map +1 -0
- package/dist/components/ui/popover.client.mjs +59 -0
- package/dist/components/ui/popover.client.mjs.map +1 -0
- package/dist/components/ui/progress.client.d.mts +4 -4
- package/dist/components/ui/progress.client.d.mts.map +1 -1
- package/dist/components/ui/progress.client.mjs +7 -7
- package/dist/components/ui/progress.client.mjs.map +1 -1
- package/dist/components/ui/radio-group.d.mts +5 -5
- package/dist/components/ui/radio-group.d.mts.map +1 -1
- package/dist/components/ui/radio-group.mjs +10 -11
- package/dist/components/ui/radio-group.mjs.map +1 -1
- package/dist/components/ui/resizable.client.d.mts +3 -4
- package/dist/components/ui/resizable.client.d.mts.map +1 -1
- package/dist/components/ui/resizable.client.mjs +5 -9
- package/dist/components/ui/resizable.client.mjs.map +1 -1
- package/dist/components/ui/scroll-area.d.mts +5 -5
- package/dist/components/ui/scroll-area.d.mts.map +1 -1
- package/dist/components/ui/scroll-area.mjs +12 -11
- package/dist/components/ui/scroll-area.mjs.map +1 -1
- package/dist/components/ui/select.client.d.mts +18 -13
- package/dist/components/ui/select.client.d.mts.map +1 -1
- package/dist/components/ui/select.client.mjs +37 -32
- package/dist/components/ui/select.client.mjs.map +1 -1
- package/dist/components/ui/separator.d.mts +4 -4
- package/dist/components/ui/separator.d.mts.map +1 -1
- package/dist/components/ui/separator.mjs +6 -6
- package/dist/components/ui/separator.mjs.map +1 -1
- package/dist/components/ui/sheet.client.d.mts +9 -7
- package/dist/components/ui/sheet.client.d.mts.map +1 -1
- package/dist/components/ui/sheet.client.mjs +30 -20
- package/dist/components/ui/sheet.client.mjs.map +1 -1
- package/dist/components/ui/sidebar.client.mjs +28 -28
- package/dist/components/ui/sidebar.client.mjs.map +1 -1
- package/dist/components/ui/skeleton.mjs +1 -1
- package/dist/components/ui/skeleton.mjs.map +1 -1
- package/dist/components/ui/slider.d.mts +4 -4
- package/dist/components/ui/slider.d.mts.map +1 -1
- package/dist/components/ui/slider.mjs +11 -11
- package/dist/components/ui/slider.mjs.map +1 -1
- package/dist/components/ui/spinner.d.mts +10 -0
- package/dist/components/ui/spinner.d.mts.map +1 -0
- package/dist/components/ui/spinner.mjs +9 -55
- package/dist/components/ui/spinner.mjs.map +1 -1
- package/dist/components/ui/switch.client.d.mts +15 -0
- package/dist/components/ui/switch.client.d.mts.map +1 -0
- package/dist/components/ui/switch.client.mjs +23 -0
- package/dist/components/ui/switch.client.mjs.map +1 -0
- package/dist/components/ui/tabs.client.d.mts +31 -0
- package/dist/components/ui/tabs.client.d.mts.map +1 -0
- package/dist/components/ui/tabs.client.mjs +49 -0
- package/dist/components/ui/tabs.client.mjs.map +1 -0
- package/dist/components/ui/textarea.d.mts.map +1 -1
- package/dist/components/ui/textarea.mjs +1 -1
- package/dist/components/ui/textarea.mjs.map +1 -1
- package/dist/components/ui/toggle-group.client.d.mts +11 -6
- package/dist/components/ui/toggle-group.client.d.mts.map +1 -1
- package/dist/components/ui/toggle-group.client.mjs +20 -12
- package/dist/components/ui/toggle-group.client.mjs.map +1 -1
- package/dist/components/ui/{toggle.d.mts → toggle.client.d.mts} +6 -6
- package/dist/components/ui/toggle.client.d.mts.map +1 -0
- package/dist/components/ui/toggle.client.mjs +40 -0
- package/dist/components/ui/toggle.client.mjs.map +1 -0
- package/dist/components/ui/tooltip.client.d.mts +7 -7
- package/dist/components/ui/tooltip.client.d.mts.map +1 -1
- package/dist/components/ui/tooltip.client.mjs +10 -10
- package/dist/components/ui/tooltip.client.mjs.map +1 -1
- package/dist/components.d.mts +13 -21
- package/dist/components.mjs +13 -21
- package/dist/config/server.d.mts +1 -3
- package/dist/config/server.mjs +1 -4
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +1 -1
- package/dist/data-tables/client.d.mts +2 -1
- package/dist/data-tables/client.mjs +2 -1
- package/dist/data-tables.d.mts +1 -1
- package/dist/database/client.d.mts +1 -0
- package/dist/database/client.mjs +1 -0
- package/dist/database/server.d.mts +2 -0
- package/dist/database/server.mjs +3 -0
- package/dist/database.d.mts +3 -0
- package/dist/database.mjs +3 -0
- package/dist/emails/client.d.mts +1 -0
- package/dist/emails/client.mjs +1 -0
- package/dist/emails/server.d.mts +2 -0
- package/dist/emails/server.mjs +3 -0
- package/dist/emails.d.mts +1 -0
- package/dist/emails.mjs +1 -0
- package/dist/inline-edit/client.d.mts +2 -2
- package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
- package/dist/lib/hooks/use-indicator.mjs.map +1 -1
- package/dist/lib/utils/markdown.d.mts +10 -0
- package/dist/lib/utils/markdown.d.mts.map +1 -0
- package/dist/lib/utils/markdown.mjs +15 -0
- package/dist/lib/utils/markdown.mjs.map +1 -0
- package/dist/lib/utils/url.mjs +2 -1
- package/dist/lib/utils/url.mjs.map +1 -1
- package/dist/lib/utils/user-agent.mjs +15 -0
- package/dist/lib/utils/user-agent.mjs.map +1 -1
- package/dist/lib.d.mts +2 -2
- package/dist/lib.mjs +2 -2
- package/dist/modules/auth/components/auth-layout.server.mjs +2 -2
- package/dist/modules/auth/components/auth-layout.server.mjs.map +1 -1
- package/dist/modules/auth/components/create-first-user-guard.server.d.mts +16 -0
- package/dist/modules/auth/components/create-first-user-guard.server.d.mts.map +1 -0
- package/dist/modules/auth/components/create-first-user-guard.server.mjs +16 -0
- package/dist/modules/auth/components/create-first-user-guard.server.mjs.map +1 -0
- package/dist/modules/auth/components/create-first-user-page.client.mjs +3 -3
- package/dist/modules/auth/components/create-first-user-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/forget-password-page.client.mjs +1 -1
- package/dist/modules/auth/components/forget-password-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/guard.server.d.mts +2 -2
- package/dist/modules/auth/components/guard.server.mjs +1 -1
- package/dist/modules/auth/components/guard.server.mjs.map +1 -1
- package/dist/modules/auth/components/login-page.client.mjs +5 -5
- package/dist/modules/auth/components/login-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/reset-password-page.client.mjs +5 -5
- package/dist/modules/auth/components/reset-password-page.client.mjs.map +1 -1
- package/dist/modules/auth/db/schema.d.mts +1 -1
- package/dist/modules/auth/db/schema.mjs +2 -2
- package/dist/modules/auth/handler/create-client.client.d.mts +4838 -229
- package/dist/modules/auth/handler/create-client.client.d.mts.map +1 -1
- package/dist/modules/auth/handler/create-client.client.mjs.map +1 -1
- package/dist/modules/auth/handler/proxy.server.mjs +2 -2
- package/dist/modules/auth/handler/proxy.server.mjs.map +1 -1
- package/dist/modules/auth/handler/route.server.d.mts +2 -2
- package/dist/modules/auth/handler/route.server.d.mts.map +1 -1
- package/dist/modules/auth/handler/route.server.mjs.map +1 -1
- package/dist/modules/auth/handler/{init.d.mts → service.server.d.mts} +322 -90
- package/dist/modules/auth/handler/service.server.d.mts.map +1 -0
- package/dist/modules/auth/handler/{init.mjs → service.server.mjs} +19 -8
- package/dist/modules/auth/handler/service.server.mjs.map +1 -0
- package/dist/modules/auth/hooks/use-session.d.mts +9 -4
- package/dist/modules/auth/hooks/use-session.d.mts.map +1 -1
- package/dist/modules/auth/lib/helpers.server.d.mts +1 -1
- package/dist/modules/auth/lib/permissions.d.mts +1 -1
- package/dist/modules/auth/lib/validators.mjs +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts +9 -9
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.mjs +3 -3
- package/dist/modules/commands/components/alert-dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/click-command.client.mjs +2 -2
- package/dist/modules/commands/components/click-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
- package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/dialog-command.client.mjs +2 -2
- package/dist/modules/commands/components/dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/dropdown-command.client.mjs +2 -2
- package/dist/modules/commands/components/dropdown-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/empty-command.client.mjs +2 -2
- package/dist/modules/commands/components/empty-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -9
- package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.mjs +8 -6
- package/dist/modules/commands/components/form-dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/menus/context-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/context-menu.client.mjs +1 -1
- package/dist/modules/commands/menus/context-menu.client.mjs.map +1 -1
- package/dist/modules/commands/menus/dropdown-menu.client.mjs +2 -2
- package/dist/modules/commands/menus/dropdown-menu.client.mjs.map +1 -1
- package/dist/modules/commands/menus/floating-menu.client.mjs +2 -2
- package/dist/modules/commands/menus/floating-menu.client.mjs.map +1 -1
- package/dist/modules/commands/utils/archive-command.client.mjs +1 -1
- package/dist/modules/commands/utils/archive-command.client.mjs.map +1 -1
- package/dist/modules/commands/utils/delete-command.client.mjs +1 -1
- package/dist/modules/commands/utils/delete-command.client.mjs.map +1 -1
- package/dist/modules/config/lib/context.d.mts +9 -10
- package/dist/modules/config/lib/context.d.mts.map +1 -1
- package/dist/modules/config/lib/context.mjs.map +1 -1
- package/dist/modules/data-tables/components/cell/select.client.mjs +1 -1
- package/dist/modules/data-tables/components/cell/select.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/column-header.mjs +5 -5
- package/dist/modules/data-tables/components/column-header.mjs.map +1 -1
- package/dist/modules/data-tables/components/filters/combobox.client.mjs +6 -6
- package/dist/modules/data-tables/components/filters/combobox.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/filters/slider.client.mjs +2 -2
- package/dist/modules/data-tables/components/filters/slider.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/header.mjs +1 -1
- package/dist/modules/data-tables/components/header.mjs.map +1 -1
- package/dist/modules/data-tables/components/skeleton.mjs +2 -2
- package/dist/modules/data-tables/components/skeleton.mjs.map +1 -1
- package/dist/modules/data-tables/components/table.mjs +3 -3
- package/dist/modules/data-tables/components/table.mjs.map +1 -1
- package/dist/modules/data-tables/components/toolbar.mjs +1 -1
- package/dist/modules/data-tables/components/toolbar.mjs.map +1 -1
- package/dist/modules/data-tables/lib/converters/search.d.mts +1 -1
- package/dist/modules/data-tables/lib/converters/sorting.d.mts +1 -1
- package/dist/modules/data-tables/server/get-data.server.d.mts +3 -3
- package/dist/modules/data-tables/server/get-data.server.mjs +1 -1
- package/dist/modules/data-tables/server/get-data.server.mjs.map +1 -1
- package/dist/modules/data-tables/strategies/infinite/strategy.d.mts +1 -1
- package/dist/modules/data-tables/strategies/infinite/strategy.mjs +3 -0
- package/dist/modules/data-tables/strategies/infinite/strategy.mjs.map +1 -1
- package/dist/modules/data-tables/strategies/pagination/components.mjs +3 -3
- package/dist/modules/data-tables/strategies/pagination/components.mjs.map +1 -1
- package/dist/modules/data-tables/tables/data-table/components/row.mjs +5 -15
- package/dist/modules/data-tables/tables/data-table/components/row.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/body.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/body.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs +13 -23
- package/dist/modules/data-tables/tables/inline-table/components/row.client.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +1 -0
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.mjs +2 -1
- package/dist/modules/data-tables/tables/inline-table/components/table.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +5 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs +2 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts +30 -0
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.d.mts.map +1 -0
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs +77 -9
- package/dist/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.mjs.map +1 -1
- package/dist/modules/{config/db → database/lib}/helpers.d.mts +2 -2
- package/dist/modules/database/lib/helpers.d.mts.map +1 -0
- package/dist/modules/{config/db → database/lib}/helpers.mjs +1 -1
- package/dist/modules/database/lib/helpers.mjs.map +1 -0
- package/dist/modules/database/lib/service.server.d.mts +34 -0
- package/dist/modules/database/lib/service.server.d.mts.map +1 -0
- package/dist/modules/database/lib/service.server.mjs +24 -0
- package/dist/modules/database/lib/service.server.mjs.map +1 -0
- package/dist/modules/{config/db → database/lib}/types.d.mts +1 -1
- package/dist/modules/database/lib/types.d.mts.map +1 -0
- package/dist/modules/emails/lib/service.server.d.mts +29 -0
- package/dist/modules/emails/lib/service.server.d.mts.map +1 -0
- package/dist/modules/emails/lib/service.server.mjs +21 -0
- package/dist/modules/emails/lib/service.server.mjs.map +1 -0
- package/dist/modules/inline-edit/components/date-input.client.mjs +4 -4
- package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.mjs +3 -2
- package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-time.client.d.mts +1 -1
- package/dist/modules/inline-edit/components/date-time.client.mjs +2 -1
- package/dist/modules/inline-edit/components/date-time.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/editor.client.mjs +1 -0
- package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-recipient.client.mjs +1 -0
- package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-toggle.client.mjs +3 -2
- package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/input.client.mjs +6 -3
- package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/select.client.d.mts +8 -11
- package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/select.client.mjs +1 -0
- package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.d.mts +3 -2
- package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.mjs +2 -1
- package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/toggle.client.mjs +2 -1
- package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/lib/variants.d.mts +1 -1
- package/dist/modules/inline-edit/lib/variants.mjs +1 -1
- package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
- package/dist/modules/router/handler/context.server.d.mts +12 -10
- package/dist/modules/router/handler/context.server.d.mts.map +1 -1
- package/dist/modules/router/handler/init.server.d.mts +13 -11
- package/dist/modules/router/handler/init.server.d.mts.map +1 -1
- package/dist/modules/router/handler/init.server.mjs +2 -2
- package/dist/modules/router/handler/init.server.mjs.map +1 -1
- package/dist/modules/router/handler/route.server.d.mts +1 -1
- package/dist/modules/storage/components/dropzone.client.d.mts +2 -2
- package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/dropzone.client.mjs +8 -8
- package/dist/modules/storage/components/dropzone.client.mjs.map +1 -1
- package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
- package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -1
- package/dist/modules/storage/components/image-grid.client.mjs +24 -26
- package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
- package/dist/modules/storage/components/image.client.d.mts +8 -0
- package/dist/modules/storage/components/image.client.d.mts.map +1 -0
- package/dist/modules/storage/components/image.client.mjs +17 -0
- package/dist/modules/storage/components/image.client.mjs.map +1 -0
- package/dist/modules/storage/components/upload-button.client.d.mts +12 -0
- package/dist/modules/storage/components/upload-button.client.d.mts.map +1 -0
- package/dist/modules/storage/components/upload-button.client.mjs +34 -0
- package/dist/modules/storage/components/upload-button.client.mjs.map +1 -0
- package/dist/modules/storage/components/upload-zone-context.client.d.mts +5 -5
- package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone-context.client.mjs +2 -2
- package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.d.mts +4 -4
- package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.mjs +17 -10
- package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
- package/dist/modules/storage/lib/constants.d.mts +1 -5
- package/dist/modules/storage/lib/constants.d.mts.map +1 -1
- package/dist/modules/storage/lib/constants.mjs +1 -13
- package/dist/modules/storage/lib/constants.mjs.map +1 -1
- package/dist/modules/storage/lib/helpers.d.mts +14 -28
- package/dist/modules/storage/lib/helpers.d.mts.map +1 -1
- package/dist/modules/storage/lib/helpers.mjs +17 -75
- package/dist/modules/storage/lib/helpers.mjs.map +1 -1
- package/dist/modules/storage/lib/procedures.server.d.mts +1991 -0
- package/dist/modules/{auth/handler/init.d.mts.map → storage/lib/procedures.server.d.mts.map} +1 -1
- package/dist/modules/storage/lib/procedures.server.mjs +22 -0
- package/dist/modules/storage/lib/procedures.server.mjs.map +1 -0
- package/dist/modules/storage/lib/router-handlers.server.d.mts +41 -0
- package/dist/modules/storage/lib/router-handlers.server.d.mts.map +1 -0
- package/dist/modules/storage/lib/router-handlers.server.mjs +124 -0
- package/dist/modules/storage/lib/router-handlers.server.mjs.map +1 -0
- package/dist/modules/storage/lib/schema.d.mts +68 -958
- package/dist/modules/storage/lib/schema.d.mts.map +1 -1
- package/dist/modules/storage/lib/schema.mjs +28 -65
- package/dist/modules/storage/lib/schema.mjs.map +1 -1
- package/dist/modules/storage/lib/service.server.d.mts +2155 -141
- package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
- package/dist/modules/storage/lib/service.server.mjs +453 -242
- package/dist/modules/storage/lib/service.server.mjs.map +1 -1
- package/dist/modules/storage/lib/upload.client.d.mts +58 -0
- package/dist/modules/storage/lib/upload.client.d.mts.map +1 -0
- package/dist/modules/storage/lib/upload.client.mjs +87 -0
- package/dist/modules/storage/lib/upload.client.mjs.map +1 -0
- package/dist/modules/storage/lib/validators.d.mts +297 -835
- package/dist/modules/storage/lib/validators.d.mts.map +1 -1
- package/dist/modules/storage/lib/validators.mjs +32 -76
- package/dist/modules/storage/lib/validators.mjs.map +1 -1
- package/dist/modules/storage/providers/adapters/s3.server.d.mts +19 -0
- package/dist/modules/storage/providers/adapters/s3.server.d.mts.map +1 -0
- package/dist/modules/storage/providers/adapters/s3.server.mjs +173 -0
- package/dist/modules/storage/providers/adapters/s3.server.mjs.map +1 -0
- package/dist/modules/storage/providers/lib/constants.d.mts +6 -0
- package/dist/modules/storage/providers/lib/constants.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/constants.mjs +6 -0
- package/dist/modules/storage/providers/lib/constants.mjs.map +1 -0
- package/dist/modules/storage/providers/lib/errors.d.mts +12 -0
- package/dist/modules/storage/providers/lib/errors.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/errors.mjs +13 -0
- package/dist/modules/storage/providers/lib/errors.mjs.map +1 -0
- package/dist/modules/storage/providers/lib/types.d.mts +21 -0
- package/dist/modules/storage/providers/lib/types.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/validators.d.mts +112 -0
- package/dist/modules/storage/providers/lib/validators.d.mts.map +1 -0
- package/dist/modules/storage/providers/lib/validators.mjs +75 -0
- package/dist/modules/storage/providers/lib/validators.mjs.map +1 -0
- package/dist/router/server.d.mts +1 -1
- package/dist/storage/client.d.mts +4 -2
- package/dist/storage/client.mjs +4 -2
- package/dist/storage/server.d.mts +5 -4
- package/dist/storage/server.mjs +5 -4
- package/dist/storage.d.mts +9 -6
- package/dist/storage.mjs +8 -6
- package/package.json +20 -32
- package/src/components/editor/components/editor.client.tsx +9 -1
- package/src/components/editor/components/menu-nodes.client.tsx +1 -1
- package/src/components/editor/components/menu.client.tsx +3 -3
- package/src/components/editor/extensions/file-handler/extension.ts +4 -4
- package/src/components/editor/extensions/file-handler/strategy.ts +15 -40
- package/src/components/editor/extensions/file-handler/utils.ts +1 -1
- package/src/components/editor/extensions/image/extension.ts +10 -10
- package/src/components/editor/lib/helpers.ts +28 -11
- package/src/components/emails/forget-password-email.tsx +6 -6
- package/src/components/entry.client.ts +16 -0
- package/src/components/entry.ts +6 -14
- package/src/components/header/back-button.client.tsx +2 -2
- package/src/components/header/bottom-bar.client.tsx +2 -2
- package/src/components/header/breadcrumbs.client.tsx +1 -1
- package/src/components/header/header.client.tsx +1 -1
- package/src/components/layouts/empty-page.tsx +2 -2
- package/src/components/layouts/error-page.tsx +3 -3
- package/src/components/layouts/providers.client.tsx +8 -5
- package/src/components/layouts/root-loading.tsx +2 -2
- package/src/components/layouts/tab-layout.tsx +1 -1
- package/src/components/lists/data-list.tsx +1 -1
- package/src/components/lists/data-stack.tsx +1 -1
- package/src/components/navigation/admin-sidebar-header.client.tsx +3 -3
- package/src/components/navigation/admin-sidebar-skeleton.tsx +1 -1
- package/src/components/ui/accordion.client.tsx +83 -0
- package/src/components/ui/alert-dialog.client.tsx +181 -0
- package/src/components/ui/alert.tsx +15 -7
- package/src/components/ui/aspect-ratio.client.tsx +9 -0
- package/src/components/ui/avatar.client.tsx +61 -6
- package/src/components/ui/badge.tsx +17 -11
- package/src/components/ui/breadcrumb.tsx +9 -10
- package/src/components/ui/button-group.tsx +78 -0
- package/src/components/ui/button.tsx +26 -16
- package/src/components/ui/{calendar.tsx → calendar.client.tsx} +27 -20
- package/src/components/ui/card.tsx +41 -8
- package/src/components/ui/{carousel.tsx → carousel.client.tsx} +12 -12
- package/src/components/ui/chart.client.tsx +105 -103
- package/src/components/ui/checkbox.client.tsx +28 -0
- package/src/components/ui/collapsible.client.tsx +2 -2
- package/src/components/ui/combobox-dropdown.client.tsx +3 -2
- package/src/components/ui/combobox.client.tsx +7 -7
- package/src/components/ui/command.client.tsx +179 -0
- package/src/components/ui/{context-menu.tsx → context-menu.client.tsx} +86 -64
- package/src/components/ui/date-picker.client.tsx +2 -2
- package/src/components/ui/dialog.client.tsx +43 -20
- package/src/components/ui/drawer.client.tsx +13 -15
- package/src/components/ui/{dropdown-menu.tsx → dropdown-menu.client.tsx} +45 -24
- package/src/components/ui/empty.tsx +93 -0
- package/src/components/ui/field.client.tsx +224 -0
- package/src/components/ui/form.client.tsx +4 -4
- package/src/components/ui/hover-card.client.tsx +14 -13
- package/src/components/ui/{input-date-time.tsx → input-date-time.client.tsx} +6 -1
- package/src/components/ui/input-date.tsx +1 -1
- package/src/components/ui/input-group.client.tsx +191 -0
- package/src/components/ui/input-recipient.tsx +12 -12
- package/src/components/ui/input-time.tsx +1 -1
- package/src/components/ui/input.tsx +2 -4
- package/src/components/ui/item.tsx +182 -0
- package/src/components/ui/kbd.tsx +26 -0
- package/src/components/ui/label.tsx +2 -3
- package/src/components/ui/loader.tsx +51 -0
- package/src/components/ui/navigation-menu.tsx +14 -17
- package/src/components/ui/pagination.tsx +31 -26
- package/src/components/ui/popover.client.tsx +73 -0
- package/src/components/ui/progress.client.tsx +6 -4
- package/src/components/ui/radio-group.tsx +5 -7
- package/src/components/ui/resizable.client.tsx +9 -19
- package/src/components/ui/scroll-area.tsx +5 -7
- package/src/components/ui/select.client.tsx +40 -22
- package/src/components/ui/separator.tsx +3 -4
- package/src/components/ui/sheet.client.tsx +19 -18
- package/src/components/ui/sidebar.client.tsx +27 -27
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/slider.tsx +5 -10
- package/src/components/ui/spinner.tsx +12 -48
- package/src/components/ui/switch.client.tsx +32 -0
- package/src/components/ui/tabs.client.tsx +79 -0
- package/src/components/ui/textarea.tsx +1 -2
- package/src/components/ui/toggle-group.client.tsx +26 -10
- package/src/components/ui/toggle.client.tsx +44 -0
- package/src/components/ui/tooltip.client.tsx +4 -9
- package/src/entry.ts +12 -51
- package/src/lib/entry.ts +1 -5
- package/src/lib/hooks/use-indicator.tsx +4 -7
- package/src/lib/utils/markdown.ts +10 -0
- package/src/lib/utils/url.ts +2 -1
- package/src/lib/utils/user-agent.ts +15 -0
- package/src/modules/auth/components/auth-layout.server.tsx +2 -2
- package/src/modules/auth/components/{guard-first-user.server.tsx → create-first-user-guard.server.tsx} +8 -8
- package/src/modules/auth/components/create-first-user-page.client.tsx +4 -4
- package/src/modules/auth/components/forget-password-page.client.tsx +1 -1
- package/src/modules/auth/components/guard.server.tsx +1 -1
- package/src/modules/auth/components/login-page.client.tsx +6 -6
- package/src/modules/auth/components/reset-password-page.client.tsx +7 -7
- package/src/modules/auth/entry.server.ts +4 -5
- package/src/modules/auth/handler/create-client.client.ts +2 -2
- package/src/modules/auth/handler/proxy.server.ts +1 -1
- package/src/modules/auth/handler/route.server.ts +2 -2
- package/src/modules/auth/handler/{init.ts → service.server.ts} +30 -9
- package/src/modules/commands/components/alert-dialog-command.client.tsx +20 -16
- package/src/modules/commands/components/click-command.client.tsx +2 -2
- package/src/modules/commands/components/dialog-command.client.tsx +11 -10
- package/src/modules/commands/components/dropdown-command.client.tsx +2 -2
- package/src/modules/commands/components/empty-command.client.tsx +2 -2
- package/src/modules/commands/components/form-dialog-command.client.tsx +29 -13
- package/src/modules/commands/menus/context-menu.client.tsx +3 -4
- package/src/modules/commands/menus/dropdown-menu.client.tsx +2 -2
- package/src/modules/commands/menus/floating-menu.client.tsx +2 -2
- package/src/modules/commands/utils/archive-command.client.tsx +1 -1
- package/src/modules/commands/utils/delete-command.client.tsx +1 -1
- package/src/modules/config/entry.server.ts +0 -9
- package/src/modules/config/entry.ts +2 -2
- package/src/modules/config/lib/context.ts +9 -9
- package/src/modules/data-tables/components/cell/select.client.tsx +1 -1
- package/src/modules/data-tables/components/column-header.tsx +5 -5
- package/src/modules/data-tables/components/filters/combobox.client.tsx +6 -6
- package/src/modules/data-tables/components/filters/slider.client.tsx +2 -2
- package/src/modules/data-tables/components/header.tsx +1 -1
- package/src/modules/data-tables/components/skeleton.tsx +2 -2
- package/src/modules/data-tables/components/table.tsx +3 -3
- package/src/modules/data-tables/components/toolbar.tsx +1 -1
- package/src/modules/data-tables/entry.client.ts +1 -0
- package/src/modules/data-tables/server/get-data.server.ts +1 -1
- package/src/modules/data-tables/strategies/infinite/strategy.ts +4 -1
- package/src/modules/data-tables/strategies/pagination/components.tsx +3 -3
- package/src/modules/data-tables/tables/data-table/components/row.tsx +12 -21
- package/src/modules/data-tables/tables/inline-table/components/body.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/cells/common.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/cells/read-only.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/row.client.tsx +24 -30
- package/src/modules/data-tables/tables/inline-table/components/table.tsx +6 -1
- package/src/modules/data-tables/tables/inline-table/hooks/context.client.tsx +5 -0
- package/src/modules/data-tables/tables/inline-table/hooks/use-hotkeys.client.ts +119 -91
- package/src/modules/database/entry.client.ts +0 -0
- package/src/modules/database/entry.server.ts +4 -0
- package/src/modules/database/entry.ts +5 -0
- package/src/modules/database/lib/service.server.ts +33 -0
- package/src/modules/emails/entry.client.ts +0 -0
- package/src/modules/emails/entry.server.ts +4 -0
- package/src/modules/emails/entry.ts +0 -0
- package/src/modules/emails/lib/service.server.ts +29 -0
- package/src/modules/inline-edit/components/date-input.client.tsx +4 -4
- package/src/modules/inline-edit/components/date-picker.client.tsx +3 -2
- package/src/modules/inline-edit/components/date-time.client.tsx +2 -1
- package/src/modules/inline-edit/components/editor.client.tsx +3 -0
- package/src/modules/inline-edit/components/input-recipient.client.tsx +1 -0
- package/src/modules/inline-edit/components/input-toggle.client.tsx +3 -2
- package/src/modules/inline-edit/components/input.client.tsx +6 -3
- package/src/modules/inline-edit/components/select.client.tsx +11 -21
- package/src/modules/inline-edit/components/switch.client.tsx +4 -3
- package/src/modules/inline-edit/components/toggle.client.tsx +2 -1
- package/src/modules/inline-edit/lib/variants.ts +1 -1
- package/src/modules/router/handler/init.server.ts +2 -2
- package/src/modules/storage/components/dropzone.client.tsx +9 -9
- package/src/modules/storage/components/image-grid.client.tsx +28 -25
- package/src/modules/storage/components/image.client.tsx +8 -0
- package/src/modules/storage/components/upload-zone-context.client.tsx +11 -8
- package/src/modules/storage/components/upload-zone.client.tsx +23 -17
- package/src/modules/storage/entry.client.ts +3 -1
- package/src/modules/storage/entry.server.ts +9 -3
- package/src/modules/storage/entry.ts +13 -1
- package/src/modules/storage/lib/constants.ts +0 -11
- package/src/modules/storage/lib/helpers.ts +18 -65
- package/src/modules/storage/lib/procedures.server.ts +60 -0
- package/src/modules/storage/lib/router-handlers.server.ts +178 -0
- package/src/modules/storage/lib/schema.ts +26 -97
- package/src/modules/storage/lib/service.server.ts +636 -374
- package/src/modules/storage/lib/upload.client.ts +156 -0
- package/src/modules/storage/lib/validators.ts +50 -111
- package/src/modules/storage/providers/adapters/s3.server.ts +281 -0
- package/src/modules/storage/providers/lib/constants.ts +3 -0
- package/src/modules/storage/providers/lib/errors.ts +21 -0
- package/src/modules/storage/providers/lib/types.ts +28 -0
- package/src/modules/storage/providers/lib/validators.ts +122 -0
- package/src/styles.css +1 -3
- package/dist/components/ui/accordion.d.mts +0 -25
- package/dist/components/ui/accordion.d.mts.map +0 -1
- package/dist/components/ui/accordion.mjs +0 -46
- package/dist/components/ui/accordion.mjs.map +0 -1
- package/dist/components/ui/alert-dialog.d.mts +0 -43
- package/dist/components/ui/alert-dialog.d.mts.map +0 -1
- package/dist/components/ui/alert-dialog.mjs +0 -84
- package/dist/components/ui/alert-dialog.mjs.map +0 -1
- package/dist/components/ui/aspect-ratio.d.mts +0 -8
- package/dist/components/ui/aspect-ratio.d.mts.map +0 -1
- package/dist/components/ui/aspect-ratio.mjs +0 -16
- package/dist/components/ui/aspect-ratio.mjs.map +0 -1
- package/dist/components/ui/calendar.d.mts.map +0 -1
- package/dist/components/ui/calendar.mjs.map +0 -1
- package/dist/components/ui/carousel.d.mts.map +0 -1
- package/dist/components/ui/carousel.mjs.map +0 -1
- package/dist/components/ui/checkbox.d.mts +0 -12
- package/dist/components/ui/checkbox.d.mts.map +0 -1
- package/dist/components/ui/checkbox.mjs +0 -24
- package/dist/components/ui/checkbox.mjs.map +0 -1
- package/dist/components/ui/command.d.mts.map +0 -1
- package/dist/components/ui/command.mjs +0 -88
- package/dist/components/ui/command.mjs.map +0 -1
- package/dist/components/ui/context-menu.d.mts +0 -77
- package/dist/components/ui/context-menu.d.mts.map +0 -1
- package/dist/components/ui/context-menu.mjs +0 -125
- package/dist/components/ui/context-menu.mjs.map +0 -1
- package/dist/components/ui/dropdown-menu.d.mts +0 -78
- package/dist/components/ui/dropdown-menu.d.mts.map +0 -1
- package/dist/components/ui/dropdown-menu.mjs +0 -126
- package/dist/components/ui/dropdown-menu.mjs.map +0 -1
- package/dist/components/ui/input-date-time.d.mts.map +0 -1
- package/dist/components/ui/input-date-time.mjs.map +0 -1
- package/dist/components/ui/popover.d.mts +0 -23
- package/dist/components/ui/popover.d.mts.map +0 -1
- package/dist/components/ui/popover.mjs +0 -38
- package/dist/components/ui/popover.mjs.map +0 -1
- package/dist/components/ui/switch.d.mts +0 -12
- package/dist/components/ui/switch.d.mts.map +0 -1
- package/dist/components/ui/switch.mjs +0 -22
- package/dist/components/ui/switch.mjs.map +0 -1
- package/dist/components/ui/tabs.d.mts +0 -24
- package/dist/components/ui/tabs.d.mts.map +0 -1
- package/dist/components/ui/tabs.mjs +0 -39
- package/dist/components/ui/tabs.mjs.map +0 -1
- package/dist/components/ui/toggle.d.mts.map +0 -1
- package/dist/components/ui/toggle.mjs +0 -40
- package/dist/components/ui/toggle.mjs.map +0 -1
- package/dist/lib/config/constants.d.mts +0 -5
- package/dist/lib/config/constants.d.mts.map +0 -1
- package/dist/lib/config/constants.mjs +0 -6
- package/dist/lib/config/constants.mjs.map +0 -1
- package/dist/modules/auth/components/guard-first-user.server.d.mts +0 -18
- package/dist/modules/auth/components/guard-first-user.server.d.mts.map +0 -1
- package/dist/modules/auth/components/guard-first-user.server.mjs +0 -16
- package/dist/modules/auth/components/guard-first-user.server.mjs.map +0 -1
- package/dist/modules/auth/handler/init.mjs.map +0 -1
- package/dist/modules/config/db/helpers.d.mts.map +0 -1
- package/dist/modules/config/db/helpers.mjs.map +0 -1
- package/dist/modules/config/db/init.d.mts +0 -20
- package/dist/modules/config/db/init.d.mts.map +0 -1
- package/dist/modules/config/db/init.mjs +0 -15
- package/dist/modules/config/db/init.mjs.map +0 -1
- package/dist/modules/config/db/types.d.mts.map +0 -1
- package/dist/modules/config/providers/email.d.mts +0 -12
- package/dist/modules/config/providers/email.d.mts.map +0 -1
- package/dist/modules/config/providers/email.mjs +0 -11
- package/dist/modules/config/providers/email.mjs.map +0 -1
- package/dist/modules/storage/config/filters.d.mts +0 -17
- package/dist/modules/storage/config/filters.d.mts.map +0 -1
- package/dist/modules/storage/config/filters.mjs +0 -17
- package/dist/modules/storage/config/filters.mjs.map +0 -1
- package/dist/modules/storage/lib/create-client.server.d.mts +0 -11
- package/dist/modules/storage/lib/create-client.server.d.mts.map +0 -1
- package/dist/modules/storage/lib/create-client.server.mjs +0 -11
- package/dist/modules/storage/lib/create-client.server.mjs.map +0 -1
- package/dist/modules/storage/lib/create-upload.client.d.mts +0 -56
- package/dist/modules/storage/lib/create-upload.client.d.mts.map +0 -1
- package/dist/modules/storage/lib/create-upload.client.mjs +0 -98
- package/dist/modules/storage/lib/create-upload.client.mjs.map +0 -1
- package/dist/modules/storage/lib/proxy.server.d.mts +0 -21
- package/dist/modules/storage/lib/proxy.server.d.mts.map +0 -1
- package/dist/modules/storage/lib/proxy.server.mjs +0 -46
- package/dist/modules/storage/lib/proxy.server.mjs.map +0 -1
- package/dist/modules/storage/lib/router.server.d.mts +0 -31002
- package/dist/modules/storage/lib/router.server.d.mts.map +0 -1
- package/dist/modules/storage/lib/router.server.mjs +0 -86
- package/dist/modules/storage/lib/router.server.mjs.map +0 -1
- package/src/components/ui/accordion.tsx +0 -63
- package/src/components/ui/alert-dialog.tsx +0 -133
- package/src/components/ui/aspect-ratio.tsx +0 -9
- package/src/components/ui/checkbox.tsx +0 -29
- package/src/components/ui/command.tsx +0 -154
- package/src/components/ui/popover.tsx +0 -42
- package/src/components/ui/switch.tsx +0 -28
- package/src/components/ui/tabs.tsx +0 -54
- package/src/components/ui/toggle.tsx +0 -46
- package/src/lib/config/constants.ts +0 -1
- package/src/lib/utils/time-picker.ts +0 -139
- package/src/modules/config/db/init.ts +0 -21
- package/src/modules/config/providers/email.ts +0 -13
- package/src/modules/storage/config/filters.ts +0 -12
- package/src/modules/storage/lib/create-client.server.ts +0 -14
- package/src/modules/storage/lib/create-upload.client.ts +0 -134
- package/src/modules/storage/lib/proxy.server.ts +0 -63
- package/src/modules/storage/lib/router.server.ts +0 -182
- /package/src/modules/{config/db → database/lib}/helpers.ts +0 -0
- /package/src/modules/{config/db → database/lib}/types.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const BUCKET_NAME = process.env.S3_BUCKET ?? "";
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* regular expression to check for valid hour format (01-23)
|
|
3
|
-
*/
|
|
4
|
-
export function isValidHour(value: string) {
|
|
5
|
-
return /^(0[0-9]|1[0-9]|2[0-3])$/.test(value);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* regular expression to check for valid 12 hour format (01-12)
|
|
10
|
-
*/
|
|
11
|
-
export function isValid12Hour(value: string) {
|
|
12
|
-
return /^(0[1-9]|1[0-2])$/.test(value);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* regular expression to check for valid minute format (00-59)
|
|
17
|
-
*/
|
|
18
|
-
export function isValidMinuteOrSecond(value: string) {
|
|
19
|
-
return /^[0-5][0-9]$/.test(value);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
type GetValidNumberConfig = { max: number; min?: number; loop?: boolean };
|
|
23
|
-
|
|
24
|
-
export function getValidNumber(
|
|
25
|
-
value: string,
|
|
26
|
-
{ max, min = 0, loop = false }: GetValidNumberConfig,
|
|
27
|
-
) {
|
|
28
|
-
let numericValue = parseInt(value, 10);
|
|
29
|
-
|
|
30
|
-
if (!Number.isNaN(numericValue)) {
|
|
31
|
-
if (!loop) {
|
|
32
|
-
if (numericValue > max) numericValue = max;
|
|
33
|
-
if (numericValue < min) numericValue = min;
|
|
34
|
-
} else {
|
|
35
|
-
if (numericValue > max) numericValue = min;
|
|
36
|
-
if (numericValue < min) numericValue = max;
|
|
37
|
-
}
|
|
38
|
-
return numericValue.toString().padStart(2, "0");
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return "00";
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function getValidHour(value: string) {
|
|
45
|
-
if (isValidHour(value)) return value;
|
|
46
|
-
return getValidNumber(value, { max: 23 });
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function getValid12Hour(value: string) {
|
|
50
|
-
if (isValid12Hour(value)) return value;
|
|
51
|
-
return getValidNumber(value, { max: 12 });
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function getValidMinuteOrSecond(value: string) {
|
|
55
|
-
if (isValidMinuteOrSecond(value)) return value;
|
|
56
|
-
return getValidNumber(value, { max: 59 });
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
type GetValidArrowNumberConfig = {
|
|
60
|
-
min: number;
|
|
61
|
-
max: number;
|
|
62
|
-
step: number;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export function getValidArrowNumber(value: string, { min, max, step }: GetValidArrowNumberConfig) {
|
|
66
|
-
let numericValue = parseInt(value, 10);
|
|
67
|
-
if (!Number.isNaN(numericValue)) {
|
|
68
|
-
numericValue += step;
|
|
69
|
-
return getValidNumber(String(numericValue), { min, max, loop: true });
|
|
70
|
-
}
|
|
71
|
-
return "00";
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function getValidArrowHour(value: string, step: number) {
|
|
75
|
-
return getValidArrowNumber(value, { min: 0, max: 23, step });
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function getValidArrowMinuteOrSecond(value: string, step: number) {
|
|
79
|
-
return getValidArrowNumber(value, { min: 0, max: 59, step });
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function setMinutes(date: Date, value: string) {
|
|
83
|
-
const minutes = getValidMinuteOrSecond(value);
|
|
84
|
-
date.setMinutes(parseInt(minutes, 10));
|
|
85
|
-
return date;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function setSeconds(date: Date, value: string) {
|
|
89
|
-
const seconds = getValidMinuteOrSecond(value);
|
|
90
|
-
date.setSeconds(parseInt(seconds, 10));
|
|
91
|
-
return date;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export function setHours(date: Date, value: string) {
|
|
95
|
-
const hours = getValidHour(value);
|
|
96
|
-
date.setHours(parseInt(hours, 10));
|
|
97
|
-
return date;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export type TimePickerType = "minutes" | "seconds" | "hours"; // | "12hours";
|
|
101
|
-
|
|
102
|
-
export function setDateByType(date: Date, value: string, type: TimePickerType) {
|
|
103
|
-
switch (type) {
|
|
104
|
-
case "minutes":
|
|
105
|
-
return setMinutes(date, value);
|
|
106
|
-
case "seconds":
|
|
107
|
-
return setSeconds(date, value);
|
|
108
|
-
case "hours":
|
|
109
|
-
return setHours(date, value);
|
|
110
|
-
default:
|
|
111
|
-
return date;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export function getDateByType(date: Date, type: TimePickerType) {
|
|
116
|
-
switch (type) {
|
|
117
|
-
case "minutes":
|
|
118
|
-
return getValidMinuteOrSecond(String(date.getMinutes()));
|
|
119
|
-
case "seconds":
|
|
120
|
-
return getValidMinuteOrSecond(String(date.getSeconds()));
|
|
121
|
-
case "hours":
|
|
122
|
-
return getValidHour(String(date.getHours()));
|
|
123
|
-
default:
|
|
124
|
-
return "00";
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export function getArrowByType(value: string, step: number, type: TimePickerType) {
|
|
129
|
-
switch (type) {
|
|
130
|
-
case "minutes":
|
|
131
|
-
return getValidArrowMinuteOrSecond(value, step);
|
|
132
|
-
case "seconds":
|
|
133
|
-
return getValidArrowMinuteOrSecond(value, step);
|
|
134
|
-
case "hours":
|
|
135
|
-
return getValidArrowHour(value, step);
|
|
136
|
-
default:
|
|
137
|
-
return "00";
|
|
138
|
-
}
|
|
139
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "server-cli-only";
|
|
2
|
-
|
|
3
|
-
import { drizzle } from "drizzle-orm/node-postgres";
|
|
4
|
-
import type { Pool } from "pg";
|
|
5
|
-
import type { TDatabaseSchema } from "./types";
|
|
6
|
-
|
|
7
|
-
type InitDatabaseProps<TSchema extends TDatabaseSchema> = {
|
|
8
|
-
schema: TSchema;
|
|
9
|
-
pool: Pool;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export function initDatabase<TSchema extends TDatabaseSchema>({
|
|
13
|
-
schema,
|
|
14
|
-
pool,
|
|
15
|
-
}: InitDatabaseProps<TSchema>) {
|
|
16
|
-
return drizzle({ client: pool, schema, casing: "snake_case" });
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type DatabaseClient<TSchema extends TDatabaseSchema> = ReturnType<
|
|
20
|
-
typeof initDatabase<TSchema>
|
|
21
|
-
>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import "server-cli-only";
|
|
2
|
-
|
|
3
|
-
import { Resend } from "resend";
|
|
4
|
-
|
|
5
|
-
type InitEmailProviderProps = {
|
|
6
|
-
key: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export function initEmailProvider(props: InitEmailProviderProps) {
|
|
10
|
-
return new Resend(props.key);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type EmailClient = ReturnType<typeof initEmailProvider>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { createTableFilters } from "@/modules/data-tables/lib/filters/config";
|
|
3
|
-
import { parseFilterArray, parseFilterBoolean } from "@/modules/data-tables/lib/filters/parsers";
|
|
4
|
-
import { nodeTypeEnum } from "../lib/schema";
|
|
5
|
-
|
|
6
|
-
export const nodesTableFilters = createTableFilters({
|
|
7
|
-
types: parseFilterArray(z.array(z.enum(nodeTypeEnum.enumValues))),
|
|
8
|
-
nodeIds: parseFilterArray(z.array(z.string())),
|
|
9
|
-
isDeleted: parseFilterBoolean(z.boolean()),
|
|
10
|
-
isOrphaned: parseFilterBoolean(z.boolean()),
|
|
11
|
-
hidden: parseFilterBoolean(z.boolean()),
|
|
12
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import "server-cli-only";
|
|
2
|
-
|
|
3
|
-
import type { TDatabaseSchema } from "@/modules/config/entry";
|
|
4
|
-
import { StorageService, type StorageServiceConfig } from "./service.server";
|
|
5
|
-
|
|
6
|
-
export function createStorageClient<TSchema extends TDatabaseSchema>(
|
|
7
|
-
props: StorageServiceConfig<TSchema>,
|
|
8
|
-
) {
|
|
9
|
-
return new StorageService(props);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type StorageClient<TSchema extends TDatabaseSchema> = ReturnType<
|
|
13
|
-
typeof createStorageClient<TSchema>
|
|
14
|
-
>;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { generateDefaultUUID } from "@/modules/config/entry";
|
|
2
|
-
import type { BulkActionSchema } from "@/modules/router/entry";
|
|
3
|
-
import type { PresignFileSchema, SelectNodeSchema, UpdateNodeSchema } from "./validators";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Upload request
|
|
7
|
-
*/
|
|
8
|
-
export type PrepareUploadInput = Omit<UploadFileRequest, "id" | "name" | "size" | "contentType">;
|
|
9
|
-
export type UploadFileRequest = PresignFileSchema & { file: File };
|
|
10
|
-
export type UploadHooks = {
|
|
11
|
-
beforePresign?: (input: UploadFileRequest) => Promise<void> | void;
|
|
12
|
-
afterPresign?: (presignResult: { id: string; presignedUrl: string }) => Promise<void> | void;
|
|
13
|
-
beforeConfirm?: (presignResult: { id: string; presignedUrl: string }) => Promise<void> | void;
|
|
14
|
-
afterConfirm?: (node: SelectNodeSchema) => Promise<void> | void;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Upload client
|
|
19
|
-
*/
|
|
20
|
-
export type UploadClient = {
|
|
21
|
-
prepareUpload: (input: PrepareUploadInput) => UploadFileRequest;
|
|
22
|
-
upload: (input: UploadFileRequest, hooks?: UploadHooks) => Promise<SelectNodeSchema>;
|
|
23
|
-
deleteFiles: (ids: string[]) => Promise<void>;
|
|
24
|
-
updateNode: (id: string, data: UpdateNodeSchema) => Promise<SelectNodeSchema>;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Create upload client
|
|
29
|
-
*/
|
|
30
|
-
type CreateUploadClientProps = {
|
|
31
|
-
endpoints: {
|
|
32
|
-
presign: (input: PresignFileSchema) => Promise<{ id: string; presignedUrl: string }>;
|
|
33
|
-
confirm: (input: { id: string }) => Promise<SelectNodeSchema>;
|
|
34
|
-
deleteNodes: (input: BulkActionSchema) => Promise<void>;
|
|
35
|
-
updateNode: (input: { id: string; data: UpdateNodeSchema }) => Promise<SelectNodeSchema>;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export function createUploadClient(props: CreateUploadClientProps): UploadClient {
|
|
40
|
-
/**
|
|
41
|
-
* Create input schema for the upload method
|
|
42
|
-
* @param {PrepareUploadInput} input
|
|
43
|
-
* @returns {UploadFileRequest}
|
|
44
|
-
*/
|
|
45
|
-
function prepareUpload(input: PrepareUploadInput): UploadFileRequest {
|
|
46
|
-
return {
|
|
47
|
-
...input,
|
|
48
|
-
id: generateDefaultUUID(),
|
|
49
|
-
name: input.file.name,
|
|
50
|
-
size: input.file.size,
|
|
51
|
-
contentType: input.file.type,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Upload file to the server
|
|
57
|
-
* @param {UploadFileRequest} input
|
|
58
|
-
* @returns {Promise<SelectNodeSchema>}
|
|
59
|
-
*/
|
|
60
|
-
async function upload(input: UploadFileRequest, hooks?: UploadHooks): Promise<SelectNodeSchema> {
|
|
61
|
-
try {
|
|
62
|
-
/**
|
|
63
|
-
* Presign
|
|
64
|
-
*/
|
|
65
|
-
await hooks?.beforePresign?.(input);
|
|
66
|
-
const presignResult = await props.endpoints.presign(input);
|
|
67
|
-
await hooks?.afterPresign?.(presignResult);
|
|
68
|
-
/**
|
|
69
|
-
* Upload the file
|
|
70
|
-
*/
|
|
71
|
-
const uploadResponse = await fetch(presignResult.presignedUrl, {
|
|
72
|
-
method: "PUT",
|
|
73
|
-
headers: { "Content-Type": input.file.type },
|
|
74
|
-
body: input.file,
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
if (!uploadResponse.ok) {
|
|
78
|
-
const message = await uploadResponse.text();
|
|
79
|
-
throw new Error(`Upload failed: ${message}`);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Confirm
|
|
84
|
-
*/
|
|
85
|
-
await hooks?.beforeConfirm?.(presignResult);
|
|
86
|
-
const node = await props.endpoints.confirm({ id: presignResult.id });
|
|
87
|
-
await hooks?.afterConfirm?.(node);
|
|
88
|
-
/**
|
|
89
|
-
* Return
|
|
90
|
-
*/
|
|
91
|
-
return node;
|
|
92
|
-
} catch (err) {
|
|
93
|
-
console.error("Upload error: ", err);
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Delete if upload failed
|
|
97
|
-
* */
|
|
98
|
-
try {
|
|
99
|
-
await deleteFiles([input.id]);
|
|
100
|
-
} catch (cleanupErr) {
|
|
101
|
-
console.error("Cleanup delete failed:", cleanupErr);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
throw err;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Delete files
|
|
110
|
-
* @param {string[]} ids
|
|
111
|
-
*/
|
|
112
|
-
async function deleteFiles(ids: string[]) {
|
|
113
|
-
await props.endpoints.deleteNodes({ ids });
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Update node
|
|
118
|
-
* @param {string} id
|
|
119
|
-
* @param {UpdateNodeSchema} data
|
|
120
|
-
*/
|
|
121
|
-
async function updateNode(id: string, data: UpdateNodeSchema) {
|
|
122
|
-
return props.endpoints.updateNode({ id, data });
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Upload client
|
|
127
|
-
*/
|
|
128
|
-
return {
|
|
129
|
-
prepareUpload,
|
|
130
|
-
upload,
|
|
131
|
-
deleteFiles,
|
|
132
|
-
updateNode,
|
|
133
|
-
};
|
|
134
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import "server-cli-only";
|
|
2
|
-
|
|
3
|
-
import { eq } from "drizzle-orm";
|
|
4
|
-
import { connection, type NextRequest } from "next/server";
|
|
5
|
-
import { getSession } from "@/modules/auth/entry.server";
|
|
6
|
-
import type { TulipContext } from "@/modules/config/entry";
|
|
7
|
-
import { type DriveSchema, nodes } from "./schema";
|
|
8
|
-
import { getFileURLSchema } from "./validators";
|
|
9
|
-
|
|
10
|
-
type CreateDriveProxyRouteProps<TSchema extends DriveSchema> = {
|
|
11
|
-
context: TulipContext<TSchema>;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Create drive proxy route
|
|
16
|
-
*/
|
|
17
|
-
export function createDriveProxyRoute<TSchema extends DriveSchema>({
|
|
18
|
-
context,
|
|
19
|
-
}: CreateDriveProxyRouteProps<TSchema>) {
|
|
20
|
-
/**
|
|
21
|
-
* GET: Drive node proxy
|
|
22
|
-
*/
|
|
23
|
-
async function GET(request: NextRequest) {
|
|
24
|
-
// Make endpoint dynamic
|
|
25
|
-
await connection();
|
|
26
|
-
|
|
27
|
-
try {
|
|
28
|
-
// Get the params
|
|
29
|
-
const searchParams = request.nextUrl.searchParams;
|
|
30
|
-
const id = searchParams.get("id");
|
|
31
|
-
if (!id) return Response.json("Missing id", { status: 400 });
|
|
32
|
-
|
|
33
|
-
console.info("Proxying file: ", id);
|
|
34
|
-
|
|
35
|
-
// Get the node
|
|
36
|
-
const [node] = await context.db.select().from(nodes).where(eq(nodes.id, id));
|
|
37
|
-
if (!node) return Response.json("Bestand kon niet worden gevonden", { status: 404 });
|
|
38
|
-
|
|
39
|
-
// If the node is private check if the user is authenticated
|
|
40
|
-
if (node.mode === "private") {
|
|
41
|
-
const session = await getSession(context);
|
|
42
|
-
if (!session) return Response.json("Unauthorized", { status: 401 });
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const variant = searchParams.get("variant") ?? undefined;
|
|
46
|
-
const disposition = searchParams.get("disposition") ?? undefined;
|
|
47
|
-
|
|
48
|
-
// Parse the options
|
|
49
|
-
const options = getFileURLSchema.parse({ variant, disposition });
|
|
50
|
-
|
|
51
|
-
// Get the file url
|
|
52
|
-
const url = await context.storage.getSignedURL(node, options);
|
|
53
|
-
|
|
54
|
-
// Return the file
|
|
55
|
-
return Response.redirect(url, 307);
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.error("error", error);
|
|
58
|
-
return Response.json("Error", { status: 500 });
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return { GET };
|
|
63
|
-
}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { and, eq, sql } from "drizzle-orm";
|
|
2
|
-
import type { QueryResult } from "pg";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { bulkActionSchema } from "@/modules/router/entry";
|
|
5
|
-
import { ServerError } from "@/modules/router/entry.server";
|
|
6
|
-
import { initRPC } from "@/modules/router/handler/init.server";
|
|
7
|
-
import { isFolder } from "./helpers";
|
|
8
|
-
import { type DriveSchema, nodes } from "./schema";
|
|
9
|
-
import {
|
|
10
|
-
createFolderNodeSchema,
|
|
11
|
-
getFileURLSchema,
|
|
12
|
-
getNodesByParentIdSchema,
|
|
13
|
-
type Node,
|
|
14
|
-
presignFileSchema,
|
|
15
|
-
selectNodeSchema,
|
|
16
|
-
selectNodeWithChildrenSchema,
|
|
17
|
-
updateNodeSchema,
|
|
18
|
-
} from "./validators";
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Create Drive base procedures
|
|
22
|
-
*/
|
|
23
|
-
export function createDriveBaseProcedures() {
|
|
24
|
-
const { protectedProcedure } = initRPC<DriveSchema>();
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
/**
|
|
28
|
-
* Get node and its children
|
|
29
|
-
*/
|
|
30
|
-
getNodeById: protectedProcedure
|
|
31
|
-
.input(z.object({ id: z.string(), namespace: z.string() }))
|
|
32
|
-
.output(selectNodeWithChildrenSchema.optional())
|
|
33
|
-
.handler(async ({ context, input }) =>
|
|
34
|
-
context.db.query.nodes.findFirst({
|
|
35
|
-
where: and(eq(nodes.id, input.id), eq(nodes.namespace, input.namespace)),
|
|
36
|
-
with: { children: true },
|
|
37
|
-
}),
|
|
38
|
-
),
|
|
39
|
-
/**
|
|
40
|
-
* Get folders by parent id
|
|
41
|
-
*/
|
|
42
|
-
getNodesByParentId: protectedProcedure
|
|
43
|
-
.input(getNodesByParentIdSchema)
|
|
44
|
-
.output(z.array(selectNodeSchema))
|
|
45
|
-
.handler(async ({ context, input }) => context.storage.getNodesByParentId(input)),
|
|
46
|
-
/**
|
|
47
|
-
* Get parents of a folder
|
|
48
|
-
*/
|
|
49
|
-
getFolderParents: protectedProcedure
|
|
50
|
-
.input(z.object({ id: z.string().nullable(), namespace: z.string() }))
|
|
51
|
-
.handler(async ({ context, input }) => {
|
|
52
|
-
if (!input.id) return [];
|
|
53
|
-
|
|
54
|
-
const startNodeQuery = context.db
|
|
55
|
-
.select({
|
|
56
|
-
id: nodes.id,
|
|
57
|
-
name: nodes.name,
|
|
58
|
-
parentId: nodes.parentId,
|
|
59
|
-
depth: sql<number>`0`.as("depth"),
|
|
60
|
-
})
|
|
61
|
-
.from(nodes)
|
|
62
|
-
.where(and(eq(nodes.id, input.id), eq(nodes.namespace, input.namespace)));
|
|
63
|
-
|
|
64
|
-
const alias = "parent_nodes";
|
|
65
|
-
const parentNodesQueryAlias = startNodeQuery.as(alias);
|
|
66
|
-
const recursiveQueryName = sql.raw(`"${alias}"`);
|
|
67
|
-
|
|
68
|
-
const recursiveQuery = startNodeQuery.unionAll(
|
|
69
|
-
context.db
|
|
70
|
-
.select({
|
|
71
|
-
id: nodes.id,
|
|
72
|
-
name: nodes.name,
|
|
73
|
-
parentId: nodes.parentId,
|
|
74
|
-
depth: sql<number>`${parentNodesQueryAlias.depth} + 1`,
|
|
75
|
-
})
|
|
76
|
-
.from(nodes)
|
|
77
|
-
.innerJoin(recursiveQueryName, eq(nodes.id, parentNodesQueryAlias.parentId)),
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
const result = (await context.db.execute(
|
|
81
|
-
sql`WITH RECURSIVE ${recursiveQueryName} AS ${recursiveQuery} SELECT * FROM ${recursiveQueryName}`,
|
|
82
|
-
)) as QueryResult<Pick<Node, "id" | "name" | "parentId"> & { depth: number }>;
|
|
83
|
-
|
|
84
|
-
return result?.rows?.toSorted((a, b) => Number(b.depth) - Number(a.depth)) ?? [];
|
|
85
|
-
}),
|
|
86
|
-
/**
|
|
87
|
-
* Get presigned url for opening a file
|
|
88
|
-
*/
|
|
89
|
-
getSignedURL: protectedProcedure
|
|
90
|
-
.input(getFileURLSchema.extend({ id: z.string() }))
|
|
91
|
-
.output(z.string().nullable())
|
|
92
|
-
.handler(async ({ context, input: { id, ...options } }) => {
|
|
93
|
-
const [node] = await context.db.select().from(nodes).where(eq(nodes.id, id));
|
|
94
|
-
if (!node) return null;
|
|
95
|
-
|
|
96
|
-
return await context.storage.getSignedURL(node, options);
|
|
97
|
-
}),
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Get presigned url for uploading a file
|
|
101
|
-
*/
|
|
102
|
-
presign: protectedProcedure
|
|
103
|
-
.input(presignFileSchema)
|
|
104
|
-
.output(z.object({ id: z.string(), presignedUrl: z.string() }))
|
|
105
|
-
.handler(async ({ context, input }) => context.storage.presignUpload(input)),
|
|
106
|
-
/**
|
|
107
|
-
* Confirm the upload
|
|
108
|
-
*/
|
|
109
|
-
confirm: protectedProcedure
|
|
110
|
-
.input(z.object({ id: z.string() }))
|
|
111
|
-
.output(selectNodeSchema)
|
|
112
|
-
.handler(async ({ context, input }) => context.storage.confirmUpload(input)),
|
|
113
|
-
/**
|
|
114
|
-
* Create a folder
|
|
115
|
-
*/
|
|
116
|
-
createFolder: protectedProcedure
|
|
117
|
-
.input(createFolderNodeSchema)
|
|
118
|
-
.output(selectNodeSchema)
|
|
119
|
-
.handler(async ({ context, input }) => context.storage.createFolder(input)),
|
|
120
|
-
/**
|
|
121
|
-
* Update node
|
|
122
|
-
*/
|
|
123
|
-
updateNode: protectedProcedure
|
|
124
|
-
.input(z.object({ id: z.string(), data: updateNodeSchema }))
|
|
125
|
-
.output(selectNodeSchema)
|
|
126
|
-
.handler(async ({ context, input }) => context.storage.updateNode(input)),
|
|
127
|
-
/**
|
|
128
|
-
* Change node parent
|
|
129
|
-
*/
|
|
130
|
-
changeParent: protectedProcedure
|
|
131
|
-
.input(z.object({ id: z.string(), parentId: z.string().nullish() }))
|
|
132
|
-
.handler(async ({ context, input }) => {
|
|
133
|
-
const [parent, node] = await Promise.all([
|
|
134
|
-
input.parentId &&
|
|
135
|
-
(await context.db.query.nodes.findFirst({
|
|
136
|
-
where: eq(nodes.id, input.parentId),
|
|
137
|
-
})),
|
|
138
|
-
context.db.query.nodes.findFirst({
|
|
139
|
-
where: eq(nodes.id, input.id),
|
|
140
|
-
}),
|
|
141
|
-
]);
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Validate
|
|
145
|
-
*/
|
|
146
|
-
if (node?.readonly) {
|
|
147
|
-
throw new ServerError("BAD_REQUEST", {
|
|
148
|
-
message: "Deze node is alleen leesbaar en kan niet worden gewijzigd",
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (input.parentId && !parent)
|
|
153
|
-
throw new ServerError("BAD_REQUEST", { message: "Parent not found" });
|
|
154
|
-
if (!node) throw new ServerError("BAD_REQUEST", { message: "Node not found" });
|
|
155
|
-
|
|
156
|
-
if (parent && !isFolder(parent)) {
|
|
157
|
-
throw new ServerError("BAD_REQUEST", { message: "Parent is not a folder" });
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (parent && parent.namespace !== node.namespace) {
|
|
161
|
-
throw new ServerError("BAD_REQUEST", {
|
|
162
|
-
message: "Parent is not in the same namespace",
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Update the parent
|
|
168
|
-
*/
|
|
169
|
-
await context.db
|
|
170
|
-
.update(nodes)
|
|
171
|
-
.set({ parentId: input.parentId })
|
|
172
|
-
.where(eq(nodes.id, input.id));
|
|
173
|
-
}),
|
|
174
|
-
/**
|
|
175
|
-
* Delete nodes
|
|
176
|
-
*/
|
|
177
|
-
deleteNodes: protectedProcedure
|
|
178
|
-
.input(bulkActionSchema)
|
|
179
|
-
.output(z.void())
|
|
180
|
-
.handler(async ({ context, input }) => context.storage.deleteNodes(input)),
|
|
181
|
-
};
|
|
182
|
-
}
|
|
File without changes
|
|
File without changes
|