@tulip-systems/core 0.2.1 → 0.4.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/dist/auth/client.d.ts +3 -1
- package/dist/auth/client.js +4 -2
- package/dist/auth/server.d.ts +2 -2
- package/dist/auth/server.js +3 -3
- package/dist/auth.d.ts +2 -1
- package/dist/auth.js +3 -2
- package/dist/commands/client.d.ts +4 -4
- package/dist/commands/client.js +4 -4
- package/dist/components/client.d.ts +5 -3
- package/dist/components/client.js +6 -4
- package/dist/components/common/icons.d.ts +5 -2
- package/dist/components/common/icons.d.ts.map +1 -1
- package/dist/components/common/icons.js +4 -1
- package/dist/components/common/icons.js.map +1 -1
- package/dist/components/common/status.d.ts +3 -3
- package/dist/components/editor/components/content.client.d.ts +2 -2
- package/dist/components/editor/components/fixed-menu.client.d.ts +2 -2
- package/dist/components/editor/context.client.d.ts +2 -2
- package/dist/components/editor/index.client.d.ts +2 -2
- package/dist/components/editor/preview.client.d.ts +2 -2
- package/dist/components/header/back-button.client.d.ts +2 -2
- package/dist/components/header/bottom-bar.client.d.ts +5 -5
- package/dist/components/header/bottom-bar.client.d.ts.map +1 -1
- package/dist/components/header/bottom-bar.client.js.map +1 -1
- package/dist/components/header/breadcrumbs.client.d.ts +7 -7
- package/dist/components/header/breadcrumbs.client.js +1 -1
- package/dist/components/header/header.client.d.ts +2 -2
- package/dist/components/header/mobile-nav-switcher.client.d.ts +2 -2
- package/dist/components/header/top-bar.client.d.ts +4 -4
- package/dist/components/layouts/admin-content.client.d.ts +13 -0
- package/dist/components/layouts/admin-content.client.d.ts.map +1 -0
- package/dist/components/layouts/admin-layout.d.ts +8 -0
- package/dist/components/layouts/admin-layout.d.ts.map +1 -0
- package/dist/components/layouts/admin-layout.js +15 -0
- package/dist/components/layouts/admin-layout.js.map +1 -0
- package/dist/components/layouts/admin-loading.d.ts +3 -3
- package/dist/components/layouts/admin-loading.d.ts.map +1 -1
- package/dist/components/layouts/admin-loading.js +2 -2
- package/dist/components/layouts/admin-loading.js.map +1 -1
- package/dist/components/layouts/empty-page.d.ts +4 -4
- package/dist/components/layouts/list-layout.d.ts +2 -2
- package/dist/components/layouts/not-found-page.d.ts +4 -3
- package/dist/components/layouts/not-found-page.d.ts.map +1 -1
- package/dist/components/layouts/not-found-page.js +8 -2
- package/dist/components/layouts/not-found-page.js.map +1 -1
- package/dist/components/layouts/not-found-section.js +1 -1
- package/dist/components/layouts/not-found-section.js.map +1 -1
- package/dist/components/layouts/providers.client.d.ts +2 -2
- package/dist/components/layouts/root-layout.server.d.ts +2 -2
- package/dist/components/layouts/root-layout.server.d.ts.map +1 -1
- package/dist/components/layouts/root-loading.d.ts +7 -0
- package/dist/components/layouts/root-loading.d.ts.map +1 -0
- package/dist/components/layouts/root-loading.js +14 -0
- package/dist/components/layouts/root-loading.js.map +1 -0
- package/dist/components/layouts/tab-layout.d.ts +2 -2
- package/dist/components/lists/data-list.d.ts +5 -5
- package/dist/components/lists/data-stack.d.ts +8 -8
- package/dist/components/{layouts → navigation}/admin-sidebar-header.client.js +8 -9
- package/dist/components/navigation/admin-sidebar-header.client.js.map +1 -0
- package/dist/components/navigation/admin-sidebar-paths.client.d.ts +81 -0
- package/dist/components/navigation/admin-sidebar-paths.client.d.ts.map +1 -0
- package/dist/components/navigation/admin-sidebar-paths.client.js +143 -0
- package/dist/components/navigation/admin-sidebar-paths.client.js.map +1 -0
- package/dist/components/navigation/admin-sidebar-skeleton.js +31 -0
- package/dist/components/navigation/admin-sidebar-skeleton.js.map +1 -0
- package/dist/components/server.d.ts +1 -1
- package/dist/components/server.js +1 -1
- package/dist/components/ui/accordion.d.ts +5 -5
- package/dist/components/ui/alert-dialog.d.ts +12 -12
- package/dist/components/ui/alert.d.ts +6 -6
- package/dist/components/ui/aspect-ratio.d.ts +2 -2
- package/dist/components/ui/avatar.client.d.ts +4 -4
- package/dist/components/ui/badge.d.ts +4 -4
- package/dist/components/ui/breadcrumb.d.ts +8 -8
- package/dist/components/ui/button.d.ts +4 -4
- package/dist/components/ui/calendar.d.ts +2 -2
- package/dist/components/ui/card.d.ts +7 -7
- package/dist/components/ui/carousel.d.ts +6 -6
- package/dist/components/ui/chart.client.d.ts +5 -5
- package/dist/components/ui/checkbox.d.ts +2 -2
- package/dist/components/ui/collapsible.client.d.ts +4 -4
- package/dist/components/ui/color-picker.client.d.ts +2 -2
- package/dist/components/ui/combobox-dropdown.client.d.ts +2 -2
- package/dist/components/ui/combobox.client.d.ts +2 -2
- package/dist/components/ui/command.d.ts +10 -10
- package/dist/components/ui/context-menu.d.ts +16 -16
- package/dist/components/ui/dialog.client.d.ts +11 -11
- package/dist/components/ui/drawer.client.d.ts +11 -11
- package/dist/components/ui/dropdown-menu.d.ts +16 -16
- package/dist/components/ui/form.client.d.ts +8 -8
- package/dist/components/ui/hover-card.client.d.ts +4 -4
- package/dist/components/ui/input.d.ts +2 -2
- package/dist/components/ui/label.d.ts +2 -2
- package/dist/components/ui/navigation-menu.d.ts +11 -11
- package/dist/components/ui/pagination.d.ts +8 -8
- package/dist/components/ui/popover.d.ts +5 -5
- package/dist/components/ui/progress.client.d.ts +2 -2
- package/dist/components/ui/radio-group.d.ts +3 -3
- package/dist/components/ui/resizable.client.d.ts +4 -4
- package/dist/components/ui/scroll-area.d.ts +3 -3
- package/dist/components/ui/select.client.d.ts +11 -11
- package/dist/components/ui/separator.d.ts +2 -2
- package/dist/components/ui/sheet.client.d.ts +9 -9
- package/dist/components/ui/sidebar.client.d.ts +24 -24
- package/dist/components/ui/sidebar.client.js +1 -1
- package/dist/components/ui/skeleton.d.ts +2 -2
- package/dist/components/ui/slider.d.ts +2 -2
- package/dist/components/ui/sonner.client.d.ts +2 -2
- package/dist/components/ui/sonner.client.js +1 -1
- package/dist/components/ui/spinner.js +63 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/tabs.d.ts +5 -5
- package/dist/components/ui/textarea.d.ts +2 -2
- package/dist/components/ui/time-input.client.d.ts +2 -2
- package/dist/components/ui/toggle-group.client.d.ts +3 -3
- package/dist/components/ui/toggle.d.ts +4 -4
- package/dist/components/ui/tooltip.client.d.ts +5 -5
- package/dist/components/ui/tree.client.d.ts +5 -5
- package/dist/components/ui/tree.client.d.ts.map +1 -1
- package/dist/components.d.ts +6 -5
- package/dist/components.js +8 -7
- package/dist/config/server.d.ts +2 -3
- package/dist/config/server.js +3 -4
- package/dist/config.d.ts +3 -2
- package/dist/config.js +2 -1
- package/dist/lib/client.js +1 -1
- package/dist/lib/hooks/use-action.d.ts +2 -2
- package/dist/modules/auth/components/allowed.client.js +1 -1
- package/dist/modules/auth/components/allowed.client.js.map +1 -1
- package/dist/modules/auth/components/auth-layout.server.d.ts +3 -4
- package/dist/modules/auth/components/auth-layout.server.d.ts.map +1 -1
- package/dist/modules/auth/components/auth-layout.server.js +1 -4
- package/dist/modules/auth/components/auth-layout.server.js.map +1 -1
- package/dist/modules/auth/components/auth-loading.d.ts +7 -0
- package/dist/modules/auth/components/auth-loading.d.ts.map +1 -0
- package/dist/modules/auth/components/auth-loading.js +18 -0
- package/dist/modules/auth/components/auth-loading.js.map +1 -0
- package/dist/modules/auth/components/forget-password-page.client.js +2 -2
- package/dist/modules/auth/components/guard.client.js +16 -0
- package/dist/modules/auth/components/guard.client.js.map +1 -0
- package/dist/modules/auth/components/login-page.client.d.ts +1 -5
- package/dist/modules/auth/components/login-page.client.d.ts.map +1 -1
- package/dist/modules/auth/components/login-page.client.js +41 -31
- package/dist/modules/auth/components/login-page.client.js.map +1 -1
- package/dist/modules/auth/components/reset-password-page.client.js +3 -3
- package/dist/modules/auth/components/update-password-command.d.ts +1 -1
- package/dist/modules/auth/components/update-password-command.js +1 -1
- package/dist/modules/auth/handler/client.client.d.ts +48 -48
- package/dist/modules/auth/handler/client.client.d.ts.map +1 -1
- package/dist/modules/auth/handler/proxy.server.d.ts +13 -0
- package/dist/modules/auth/handler/proxy.server.d.ts.map +1 -0
- package/dist/modules/auth/handler/proxy.server.js +22 -0
- package/dist/modules/auth/handler/proxy.server.js.map +1 -0
- package/dist/modules/auth/handler/server.server.js +3 -1
- package/dist/modules/auth/handler/server.server.js.map +1 -1
- package/dist/modules/auth/hooks/use-permission.d.ts +26 -0
- package/dist/modules/auth/hooks/use-permission.d.ts.map +1 -0
- package/dist/modules/auth/hooks/{use-permission.client.js → use-permission.js} +5 -3
- package/dist/modules/auth/hooks/use-permission.js.map +1 -0
- package/dist/modules/auth/hooks/use-session.d.ts +34 -0
- package/dist/modules/auth/hooks/use-session.d.ts.map +1 -0
- package/dist/modules/auth/hooks/use-session.js +21 -0
- package/dist/modules/auth/hooks/use-session.js.map +1 -0
- package/dist/modules/auth/lib/helpers.server.d.ts +2 -2
- package/dist/modules/auth/lib/helpers.server.d.ts.map +1 -1
- package/dist/modules/auth/lib/helpers.server.js +3 -6
- package/dist/modules/auth/lib/helpers.server.js.map +1 -1
- package/dist/modules/auth/lib/validators.d.ts +4 -4
- package/dist/modules/auth/lib/validators.d.ts.map +1 -1
- package/dist/modules/auth/lib/validators.js +1 -1
- package/dist/modules/auth/lib/validators.js.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.d.ts +11 -11
- package/dist/modules/commands/components/alert-dialog-command.client.js +1 -1
- package/dist/modules/commands/components/click-command.client.d.ts +2 -2
- package/dist/modules/commands/components/command-trigger.client.d.ts +4 -4
- package/dist/modules/commands/components/command-trigger.client.js +1 -1
- package/dist/modules/commands/components/dialog-command.client.d.ts +8 -8
- package/dist/modules/commands/components/dialog-command.client.js +1 -1
- package/dist/modules/commands/components/dropdown-command.client.d.ts +5 -5
- package/dist/modules/commands/components/empty-command.client.d.ts +2 -2
- package/dist/modules/commands/components/form-dialog-command.client.d.ts +12 -12
- package/dist/modules/commands/components/form-dialog-command.client.js +1 -1
- package/dist/modules/commands/hooks/use-command-action.client.js +1 -1
- package/dist/modules/commands/hooks/use-command-menu.client.js +1 -1
- package/dist/modules/commands/hooks/use-command-menu.client.js.map +1 -1
- package/dist/modules/commands/menus/context-menu.client.d.ts +2 -2
- package/dist/modules/commands/menus/dropdown-menu.client.d.ts +8 -4
- package/dist/modules/commands/menus/dropdown-menu.client.d.ts.map +1 -1
- package/dist/modules/commands/menus/dropdown-menu.client.js +9 -1
- package/dist/modules/commands/menus/dropdown-menu.client.js.map +1 -1
- package/dist/modules/commands/menus/inline-menu.client.d.ts +8 -4
- package/dist/modules/commands/menus/inline-menu.client.d.ts.map +1 -1
- package/dist/modules/commands/menus/inline-menu.client.js +12 -1
- package/dist/modules/commands/menus/inline-menu.client.js.map +1 -1
- package/dist/modules/commands/menus/responsive-menu.client.d.ts +2 -1
- package/dist/modules/commands/menus/responsive-menu.client.d.ts.map +1 -1
- package/dist/modules/commands/menus/responsive-menu.client.js +6 -3
- package/dist/modules/commands/menus/responsive-menu.client.js.map +1 -1
- package/dist/modules/commands/utils/archive-command.client.d.ts +3 -3
- package/dist/modules/commands/utils/delete-command.client.d.ts +2 -2
- package/dist/modules/commands/utils/send-mail-command.client.d.ts +2 -2
- package/dist/modules/commands/utils/send-mail-command.client.d.ts.map +1 -1
- package/dist/modules/commands/utils/send-mail-command.client.js +3 -3
- package/dist/modules/config/db/helpers.d.ts +5 -5
- package/dist/modules/config/db/helpers.d.ts.map +1 -1
- package/dist/modules/config/lib/config.server.d.ts +0 -2
- package/dist/modules/config/lib/config.server.d.ts.map +1 -1
- package/dist/modules/config/lib/config.server.js.map +1 -1
- package/dist/modules/config/lib/resolve.server.d.ts +192 -190
- package/dist/modules/config/lib/resolve.server.d.ts.map +1 -1
- package/dist/modules/config/paths/helpers.d.ts +11 -0
- package/dist/modules/config/paths/helpers.d.ts.map +1 -0
- package/dist/modules/config/paths/helpers.js +9 -0
- package/dist/modules/config/paths/helpers.js.map +1 -0
- package/dist/modules/config/paths/types.d.ts +8 -37
- package/dist/modules/config/paths/types.d.ts.map +1 -1
- package/dist/modules/config/router/client.server.d.ts +4 -4
- package/dist/modules/config/router/client.server.d.ts.map +1 -1
- package/dist/modules/config/router/context.server.d.ts +194 -192
- package/dist/modules/config/router/context.server.d.ts.map +1 -1
- package/dist/modules/config/router/init.server.d.ts +200 -198
- package/dist/modules/config/router/init.server.d.ts.map +1 -1
- package/dist/modules/data-tables/components/cell/common.client.d.ts +5 -5
- package/dist/modules/data-tables/components/cell/common.client.d.ts.map +1 -1
- package/dist/modules/data-tables/components/column-header.d.ts +2 -2
- package/dist/modules/data-tables/components/filters/combobox.client.d.ts +2 -2
- package/dist/modules/data-tables/components/filters/combobox.client.d.ts.map +1 -1
- package/dist/modules/data-tables/components/filters/combobox.client.js +1 -1
- package/dist/modules/data-tables/components/filters/combobox.client.js.map +1 -1
- package/dist/modules/data-tables/components/filters/slider.client.d.ts +2 -2
- package/dist/modules/data-tables/components/filters/slider.client.d.ts.map +1 -1
- package/dist/modules/data-tables/components/header.d.ts +4 -4
- package/dist/modules/data-tables/components/layout.d.ts +2 -2
- package/dist/modules/data-tables/components/search-input.client.d.ts +2 -2
- package/dist/modules/data-tables/components/search-input.client.d.ts.map +1 -1
- package/dist/modules/data-tables/components/skeleton.d.ts +2 -2
- package/dist/modules/data-tables/components/table.d.ts +7 -7
- package/dist/modules/data-tables/components/toolbar.d.ts +3 -3
- package/dist/modules/data-tables/hooks/use-context.client.d.ts +2 -2
- package/dist/modules/data-tables/hooks/use-context.client.d.ts.map +1 -1
- package/dist/modules/data-tables/lib/filters/resolvers.d.ts +1 -1
- package/dist/modules/data-tables/lib/filters/resolvers.d.ts.map +1 -1
- package/dist/modules/data-tables/lib/search-params.d.ts +5 -5
- package/dist/modules/data-tables/lib/search-params.d.ts.map +1 -1
- package/dist/modules/data-tables/lib/types.d.ts +1 -1
- package/dist/modules/data-tables/tables/data-table/components/table.d.ts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.ts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.ts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.ts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.ts.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.ts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.ts +3 -3
- package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.ts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.ts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/table.d.ts +2 -2
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.ts +2 -2
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.js +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/use-input.client.js +1 -1
- package/dist/modules/data-tables/tables/inline-table/hooks/use-input.client.js.map +1 -1
- package/dist/modules/inline-edit/components/combobox-dropdown.client.d.ts +2 -2
- package/dist/modules/inline-edit/components/combobox-dropdown.client.d.ts.map +1 -1
- package/dist/modules/inline-edit/components/combobox.client.d.ts +2 -2
- package/dist/modules/inline-edit/components/combobox.client.d.ts.map +1 -1
- package/dist/modules/inline-edit/components/date-input.client.d.ts +2 -2
- package/dist/modules/inline-edit/components/date-input.client.js +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.d.ts +2 -2
- package/dist/modules/inline-edit/components/editor.client.d.ts +2 -2
- package/dist/modules/inline-edit/components/input-toggle.client.d.ts +2 -2
- package/dist/modules/inline-edit/components/input.client.d.ts +3 -3
- package/dist/modules/inline-edit/components/richtext.client.d.ts +2 -2
- package/dist/modules/inline-edit/components/select.client.d.ts +6 -6
- package/dist/modules/inline-edit/components/switch.client.d.ts +2 -2
- package/dist/modules/inline-edit/components/toggle.client.d.ts +2 -2
- package/dist/modules/inline-edit/hooks/context.client.d.ts +2 -2
- package/dist/modules/inline-edit/hooks/use-inline.client.js +1 -1
- package/dist/modules/inline-edit/hooks/use-inline.client.js.map +1 -1
- package/dist/modules/uploads/components/button.client.d.ts +2 -2
- package/dist/modules/uploads/components/button.client.d.ts.map +1 -1
- package/dist/modules/uploads/components/images/grid.client.d.ts +2 -2
- package/dist/modules/uploads/components/images/grid.client.d.ts.map +1 -1
- package/dist/modules/uploads/components/images/grid.client.js +1 -1
- package/dist/modules/uploads/components/images/input.client.d.ts +2 -2
- package/dist/modules/uploads/components/images/input.client.d.ts.map +1 -1
- package/dist/modules/uploads/components/preview-dialog.client.d.ts +2 -2
- package/dist/modules/uploads/components/preview-dialog.client.d.ts.map +1 -1
- package/dist/modules/uploads/components/zone.client.d.ts +2 -2
- package/dist/modules/uploads/components/zone.client.d.ts.map +1 -1
- package/dist/modules/uploads/hooks/use-upload-image.client.js +1 -1
- package/dist/modules/uploads/lib/proxy.server.d.ts +1 -1
- package/dist/modules/uploads/lib/proxy.server.js +4 -4
- package/dist/modules/uploads/lib/route.server.d.ts +1 -1
- package/dist/modules/uploads/lib/route.server.js +2 -2
- package/dist/modules/uploads/lib/router.server.d.ts +965 -965
- package/dist/modules/uploads/lib/router.server.d.ts.map +1 -1
- package/dist/modules/uploads/lib/router.server.js +2 -2
- package/dist/modules/uploads/lib/schema.d.ts +61 -61
- package/dist/modules/uploads/lib/validators.d.ts +56 -56
- package/dist/modules/uploads/lib/validators.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/components/common/icons.tsx +6 -0
- package/src/components/entry.client.ts +6 -0
- package/src/components/entry.server.ts +1 -1
- package/src/components/entry.ts +1 -0
- package/src/components/header/bottom-bar.client.tsx +2 -2
- package/src/components/layouts/admin-layout.tsx +13 -0
- package/src/components/layouts/admin-loading.tsx +1 -1
- package/src/components/layouts/not-found-page.tsx +9 -1
- package/src/components/layouts/not-found-section.tsx +10 -5
- package/src/components/layouts/root-loading.tsx +9 -0
- package/src/components/{layouts → navigation}/admin-sidebar-header.client.tsx +11 -6
- package/src/components/navigation/admin-sidebar-paths.client.tsx +190 -0
- package/src/components/navigation/admin-sidebar-skeleton.tsx +44 -0
- package/src/components/navigation/admin-sidebar.client.tsx +123 -0
- package/src/components/ui/spinner.tsx +51 -0
- package/src/modules/auth/components/allowed.client.tsx +1 -1
- package/src/modules/auth/components/auth-layout.server.tsx +2 -10
- package/src/modules/auth/components/auth-loading.tsx +11 -0
- package/src/modules/auth/components/guard.client.tsx +12 -0
- package/src/modules/auth/components/login-page.client.tsx +45 -37
- package/src/modules/auth/entry.client.ts +2 -0
- package/src/modules/auth/entry.server.ts +1 -1
- package/src/modules/auth/entry.ts +1 -0
- package/src/modules/auth/handler/proxy.server.ts +28 -0
- package/src/modules/auth/handler/server.server.ts +5 -0
- package/src/modules/auth/hooks/{use-permission.client.ts → use-permission.ts} +4 -2
- package/src/modules/auth/hooks/use-session.ts +18 -0
- package/src/modules/auth/lib/helpers.server.ts +1 -5
- package/src/modules/auth/lib/validators.ts +1 -1
- package/src/modules/commands/hooks/use-command-menu.client.tsx +6 -7
- package/src/modules/commands/menus/dropdown-menu.client.tsx +11 -2
- package/src/modules/commands/menus/inline-menu.client.tsx +14 -1
- package/src/modules/commands/menus/responsive-menu.client.tsx +11 -2
- package/src/modules/config/entry.server.ts +1 -2
- package/src/modules/config/entry.ts +3 -0
- package/src/modules/config/lib/config.server.ts +1 -2
- package/src/modules/config/lib/router.server.ts +64 -0
- package/src/modules/config/paths/helpers.ts +6 -0
- package/src/modules/config/paths/types.ts +26 -38
- package/src/modules/data-tables/components/filters/combobox.client.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/hooks/use-input.client.ts +1 -1
- package/src/modules/inline-edit/hooks/use-inline.client.tsx +1 -1
- package/dist/components/layouts/admin-layout.server.d.ts +0 -14
- package/dist/components/layouts/admin-layout.server.d.ts.map +0 -1
- package/dist/components/layouts/admin-layout.server.js +0 -26
- package/dist/components/layouts/admin-layout.server.js.map +0 -1
- package/dist/components/layouts/admin-sidebar-context.client.js +0 -28
- package/dist/components/layouts/admin-sidebar-context.client.js.map +0 -1
- package/dist/components/layouts/admin-sidebar-header.client.js.map +0 -1
- package/dist/components/layouts/admin-sidebar.client.js +0 -51
- package/dist/components/layouts/admin-sidebar.client.js.map +0 -1
- package/dist/modules/auth/components/allowed.server.d.ts +0 -23
- package/dist/modules/auth/components/allowed.server.d.ts.map +0 -1
- package/dist/modules/auth/components/allowed.server.js +0 -24
- package/dist/modules/auth/components/allowed.server.js.map +0 -1
- package/dist/modules/auth/hooks/use-permission.client.js.map +0 -1
- package/dist/modules/config/paths/create.server.d.ts +0 -14
- package/dist/modules/config/paths/create.server.d.ts.map +0 -1
- package/dist/modules/config/paths/create.server.js +0 -12
- package/dist/modules/config/paths/create.server.js.map +0 -1
- package/dist/modules/config/paths/get.server.js +0 -47
- package/dist/modules/config/paths/get.server.js.map +0 -1
- package/src/components/layouts/admin-layout.server.tsx +0 -31
- package/src/components/layouts/admin-sidebar-context.client.tsx +0 -34
- package/src/components/layouts/admin-sidebar.client.tsx +0 -88
- package/src/modules/auth/components/allowed.server.tsx +0 -41
- package/src/modules/config/paths/create.server.ts +0 -10
- package/src/modules/config/paths/get.server.ts +0 -69
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.client.d.ts","names":[],"sources":["../../../../src/modules/auth/handler/client.client.ts"],"sourcesContent":[],"mappings":";;;;;cAiBa;;;;;
|
|
1
|
+
{"version":3,"file":"client.client.d.ts","names":[],"sources":["../../../../src/modules/auth/handler/client.client.ts"],"sourcesContent":[],"mappings":";;;;;cAiBa;;;;;MAAA,OAEX,CAAA,EAAA,YAAA,GAAA,YAAA,GAAA;QAAA,MAAA,EAAA,kBAAA,GAAA,YAAA,GAAA,0BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAC60E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAAkmH,kBAAA,CAAA;;;;;;;;;;;;;;;;;eAA7lE;;eAAuE,eAAA;;;;;YAAsW;kBAAgD;;;WAAoH;eAA4C;;qBAA6F;cAA6C;;0BAAA,kBAAA,CAAuF,oBAAA;;;;;qBAAA,kBAAA,CAAA;;;;;;;;;;;;;;;;;;;;+BAA+iC,YAAA;;cAAA,kBAAA,CAA0G,gBAAA,UAAA,cAAA;kBAAA,kBAAA,CAAsG,gBAAA;;;;sBAAyK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAHrmM,UAAA,UAAoB;KAEpB,aAAA,UAAuB,UAAA,CAAW,MAAA,CAAO"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/auth/handler/proxy.server.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Create auth proxy
|
|
7
|
+
*/
|
|
8
|
+
declare function createAuthProxy(props: {
|
|
9
|
+
publicRoutes: string[];
|
|
10
|
+
}): (req: NextRequest) => NextResponse<unknown>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { createAuthProxy };
|
|
13
|
+
//# sourceMappingURL=proxy.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.server.d.ts","names":[],"sources":["../../../../src/modules/auth/handler/proxy.server.ts"],"sourcesContent":[],"mappings":";;;;;;AAQA;AAA+B,iBAAf,eAAA,CAAe,KAAA,EAAA;cAChB,EAAA,MAAA,EAAA;QAAW,EAAX,WAAW,EAAA,GAAA,YAAA,CAAA,OAAA,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { authCookiePrefix } from "./server.server.js";
|
|
2
|
+
import { getSessionCookie } from "better-auth/cookies";
|
|
3
|
+
import { NextResponse } from "next/server";
|
|
4
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
5
|
+
|
|
6
|
+
//#region src/modules/auth/handler/proxy.server.ts
|
|
7
|
+
/**
|
|
8
|
+
* Create auth proxy
|
|
9
|
+
*/
|
|
10
|
+
function createAuthProxy(props) {
|
|
11
|
+
return (req) => {
|
|
12
|
+
const pathname = req.nextUrl.pathname;
|
|
13
|
+
const isPublicRoute = props.publicRoutes.some((route) => new URLPattern({ pathname: route }).test({ pathname }));
|
|
14
|
+
const sessionCookie = getSessionCookie(req, { cookiePrefix: authCookiePrefix });
|
|
15
|
+
if (!isPublicRoute && !sessionCookie) return NextResponse.redirect(new URL("/auth/login", req.nextUrl));
|
|
16
|
+
return NextResponse.next();
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { createAuthProxy };
|
|
22
|
+
//# sourceMappingURL=proxy.server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.server.js","names":[],"sources":["../../../../src/modules/auth/handler/proxy.server.ts"],"sourcesContent":["import { getSessionCookie } from \"better-auth/cookies\";\nimport { NextRequest, NextResponse } from \"next/server\";\nimport { URLPattern } from \"urlpattern-polyfill\";\nimport { authCookiePrefix } from \"./server.server\";\n\n/**\n * Create auth proxy\n */\nexport function createAuthProxy(props: { publicRoutes: string[] }) {\n return (req: NextRequest) => {\n // 1. Check if the current route is protected or public\n const pathname = req.nextUrl.pathname;\n\n const isPublicRoute = props.publicRoutes.some((route) =>\n new URLPattern({ pathname: route }).test({ pathname }),\n );\n\n // 2. Check if a session cookie is present\n const sessionCookie = getSessionCookie(req, { cookiePrefix: authCookiePrefix });\n\n // 3. Redirect to /auth/login if the user is not authenticated\n if (!isPublicRoute && !sessionCookie) {\n return NextResponse.redirect(new URL(\"/auth/login\", req.nextUrl));\n }\n\n return NextResponse.next();\n };\n}\n"],"mappings":";;;;;;;;;AAQA,SAAgB,gBAAgB,OAAmC;AACjE,SAAQ,QAAqB;EAE3B,MAAM,WAAW,IAAI,QAAQ;EAE7B,MAAM,gBAAgB,MAAM,aAAa,MAAM,UAC7C,IAAI,WAAW,EAAE,UAAU,OAAO,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,CACvD;EAGD,MAAM,gBAAgB,iBAAiB,KAAK,EAAE,cAAc,kBAAkB,CAAC;AAG/E,MAAI,CAAC,iBAAiB,CAAC,cACrB,QAAO,aAAa,SAAS,IAAI,IAAI,eAAe,IAAI,QAAQ,CAAC;AAGnE,SAAO,aAAa,MAAM"}
|
|
@@ -7,7 +7,9 @@ import { nextCookies } from "better-auth/next-js";
|
|
|
7
7
|
import { admin, emailOTP } from "better-auth/plugins";
|
|
8
8
|
|
|
9
9
|
//#region src/modules/auth/handler/server.server.ts
|
|
10
|
+
const authCookiePrefix = "tulip";
|
|
10
11
|
const createServerAuth = (config) => betterAuth({
|
|
12
|
+
advanced: { cookiePrefix: authCookiePrefix },
|
|
11
13
|
database: drizzleAdapter(config.db, {
|
|
12
14
|
provider: "pg",
|
|
13
15
|
schema: config.schema,
|
|
@@ -57,5 +59,5 @@ const createServerAuth = (config) => betterAuth({
|
|
|
57
59
|
});
|
|
58
60
|
|
|
59
61
|
//#endregion
|
|
60
|
-
export { createServerAuth };
|
|
62
|
+
export { authCookiePrefix, createServerAuth };
|
|
61
63
|
//# sourceMappingURL=server.server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.server.js","names":["ForgetPasswordEmail"],"sources":["../../../../src/modules/auth/handler/server.server.ts"],"sourcesContent":["import \"server-cli-only\";\n\nimport ForgetPasswordEmail from \"@/components/emails/forget-password-email\";\nimport { url } from \"@/lib/utils/url\";\nimport { TDatabaseSchema } from \"@/modules/config/db/types\";\nimport { TulipConfig } from \"@/modules/config/lib/config.server\";\nimport { betterAuth } from \"better-auth\";\nimport { drizzleAdapter } from \"better-auth/adapters/drizzle\";\nimport { nextCookies } from \"better-auth/next-js\";\nimport { admin, emailOTP } from \"better-auth/plugins\";\nimport { Resend } from \"resend\";\n\ntype CreateServerAuthParams<TSchema extends TDatabaseSchema> = Pick<\n TulipConfig<TSchema>,\n \"email\" | \"auth\"\n> & {\n db: Parameters<typeof drizzleAdapter>[0];\n schema: Parameters<typeof drizzleAdapter>[1][\"schema\"];\n resend: Resend;\n};\n\nexport const createServerAuth = <TSchema extends TDatabaseSchema>(\n config: CreateServerAuthParams<TSchema>,\n) =>\n betterAuth({\n database: drizzleAdapter(config.db, {\n provider: \"pg\",\n schema: config.schema,\n usePlural: true,\n }),\n emailAndPassword: {\n enabled: true,\n },\n user: {\n changeEmail: {\n enabled: true,\n },\n additionalFields: {\n firstName: {\n type: \"string\",\n required: true,\n input: true,\n },\n lastName: {\n type: \"string\",\n required: true,\n input: true,\n },\n },\n },\n plugins: [\n nextCookies(),\n admin({\n ...config.auth,\n adminRoles: [\"admin\", \"developer\"],\n }),\n emailOTP({\n sendVerificationOTP: async ({ email, otp, type }) => {\n /**\n * Send a forget password mail\n */\n if (type === \"forget-password\") {\n const searchParams = new URLSearchParams();\n searchParams.set(\"email\", email);\n searchParams.set(\"otp\", otp);\n\n const resetPasswordHref = url(`/auth/reset-password?${searchParams.toString()}`);\n\n const result = await config.resend.emails.send({\n from: config.email.from,\n to: email,\n subject: \"Wachtwoord herstellen\",\n react: ForgetPasswordEmail({ resetPasswordHref }),\n });\n if (result.error) throw new Error(result.error.message);\n }\n },\n }),\n ],\n });\n\nexport type ServerAuth = ReturnType<typeof createServerAuth>;\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"server.server.js","names":["ForgetPasswordEmail"],"sources":["../../../../src/modules/auth/handler/server.server.ts"],"sourcesContent":["import \"server-cli-only\";\n\nimport ForgetPasswordEmail from \"@/components/emails/forget-password-email\";\nimport { url } from \"@/lib/utils/url\";\nimport { TDatabaseSchema } from \"@/modules/config/db/types\";\nimport { TulipConfig } from \"@/modules/config/lib/config.server\";\nimport { betterAuth } from \"better-auth\";\nimport { drizzleAdapter } from \"better-auth/adapters/drizzle\";\nimport { nextCookies } from \"better-auth/next-js\";\nimport { admin, emailOTP } from \"better-auth/plugins\";\nimport { Resend } from \"resend\";\n\nexport const authCookiePrefix = \"tulip\";\n\ntype CreateServerAuthParams<TSchema extends TDatabaseSchema> = Pick<\n TulipConfig<TSchema>,\n \"email\" | \"auth\"\n> & {\n db: Parameters<typeof drizzleAdapter>[0];\n schema: Parameters<typeof drizzleAdapter>[1][\"schema\"];\n resend: Resend;\n};\n\nexport const createServerAuth = <TSchema extends TDatabaseSchema>(\n config: CreateServerAuthParams<TSchema>,\n) =>\n betterAuth({\n advanced: {\n cookiePrefix: authCookiePrefix,\n },\n database: drizzleAdapter(config.db, {\n provider: \"pg\",\n schema: config.schema,\n usePlural: true,\n }),\n emailAndPassword: {\n enabled: true,\n },\n user: {\n changeEmail: {\n enabled: true,\n },\n additionalFields: {\n firstName: {\n type: \"string\",\n required: true,\n input: true,\n },\n lastName: {\n type: \"string\",\n required: true,\n input: true,\n },\n },\n },\n plugins: [\n nextCookies(),\n admin({\n ...config.auth,\n adminRoles: [\"admin\", \"developer\"],\n }),\n emailOTP({\n sendVerificationOTP: async ({ email, otp, type }) => {\n /**\n * Send a forget password mail\n */\n if (type === \"forget-password\") {\n const searchParams = new URLSearchParams();\n searchParams.set(\"email\", email);\n searchParams.set(\"otp\", otp);\n\n const resetPasswordHref = url(`/auth/reset-password?${searchParams.toString()}`);\n\n const result = await config.resend.emails.send({\n from: config.email.from,\n to: email,\n subject: \"Wachtwoord herstellen\",\n react: ForgetPasswordEmail({ resetPasswordHref }),\n });\n if (result.error) throw new Error(result.error.message);\n }\n },\n }),\n ],\n });\n\nexport type ServerAuth = ReturnType<typeof createServerAuth>;\n"],"mappings":";;;;;;;;;AAYA,MAAa,mBAAmB;AAWhC,MAAa,oBACX,WAEA,WAAW;CACT,UAAU,EACR,cAAc,kBACf;CACD,UAAU,eAAe,OAAO,IAAI;EAClC,UAAU;EACV,QAAQ,OAAO;EACf,WAAW;EACZ,CAAC;CACF,kBAAkB,EAChB,SAAS,MACV;CACD,MAAM;EACJ,aAAa,EACX,SAAS,MACV;EACD,kBAAkB;GAChB,WAAW;IACT,MAAM;IACN,UAAU;IACV,OAAO;IACR;GACD,UAAU;IACR,MAAM;IACN,UAAU;IACV,OAAO;IACR;GACF;EACF;CACD,SAAS;EACP,aAAa;EACb,MAAM;GACJ,GAAG,OAAO;GACV,YAAY,CAAC,SAAS,YAAY;GACnC,CAAC;EACF,SAAS,EACP,qBAAqB,OAAO,EAAE,OAAO,KAAK,WAAW;;;;AAInD,OAAI,SAAS,mBAAmB;IAC9B,MAAM,eAAe,IAAI,iBAAiB;AAC1C,iBAAa,IAAI,SAAS,MAAM;AAChC,iBAAa,IAAI,OAAO,IAAI;IAE5B,MAAM,oBAAoB,IAAI,wBAAwB,aAAa,UAAU,GAAG;IAEhF,MAAM,SAAS,MAAM,OAAO,OAAO,OAAO,KAAK;KAC7C,MAAM,OAAO,MAAM;KACnB,IAAI;KACJ,SAAS;KACT,OAAOA,8BAAoB,EAAE,mBAAmB,CAAC;KAClD,CAAC;AACF,QAAI,OAAO,MAAO,OAAM,IAAI,MAAM,OAAO,MAAM,QAAQ;;KAG5D,CAAC;EACH;CACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Permission } from "../lib/permissions.js";
|
|
2
|
+
import * as _tanstack_react_query0 from "@tanstack/react-query";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/auth/hooks/use-permission.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* UsePermission
|
|
7
|
+
*/
|
|
8
|
+
declare function usePermission(permission?: Permission): {
|
|
9
|
+
data: null;
|
|
10
|
+
errors: _tanstack_react_query0.UseSuspenseQueryResult<{
|
|
11
|
+
permission: Permission;
|
|
12
|
+
success: boolean;
|
|
13
|
+
}, Error>[];
|
|
14
|
+
} | {
|
|
15
|
+
data: {
|
|
16
|
+
success: boolean;
|
|
17
|
+
values: {
|
|
18
|
+
permission: Permission;
|
|
19
|
+
success: boolean;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
22
|
+
errors: null;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { usePermission };
|
|
26
|
+
//# sourceMappingURL=use-permission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-permission.d.ts","names":[],"sources":["../../../../src/modules/auth/hooks/use-permission.ts"],"sourcesContent":[],"mappings":";;;;;;;AAWgB,iBAAA,aAAA,CAAa,UAAA,CAAA,EAAc,UAAd,CAAA,EAAA;EAAA,IAAA,EAAA,IAAA;QAAc,+CAAA,CAAA"}
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
import { authClient } from "../handler/client.client.js";
|
|
5
|
+
import { useSession } from "./use-session.js";
|
|
5
6
|
import { useSuspenseQueries } from "@tanstack/react-query";
|
|
6
7
|
|
|
7
|
-
//#region src/modules/auth/hooks/use-permission.
|
|
8
|
+
//#region src/modules/auth/hooks/use-permission.ts
|
|
8
9
|
/**
|
|
9
10
|
* UsePermission
|
|
10
11
|
*/
|
|
11
12
|
function usePermission(permission) {
|
|
13
|
+
const sessionQuery = useSession();
|
|
12
14
|
return useSuspenseQueries({
|
|
13
15
|
queries: Object.entries(permission ?? {}).flatMap(([resource, permissions]) => permissions.map((permission$1) => [resource, permission$1])).map((key) => ({
|
|
14
16
|
queryKey: ["permission", ...key],
|
|
15
17
|
queryFn: async () => {
|
|
16
18
|
const permission$1 = { [key[0]?.toString()]: [key[1]] };
|
|
17
|
-
const userId =
|
|
19
|
+
const userId = sessionQuery.data?.user.id;
|
|
18
20
|
const { data, error } = await authClient.admin.hasPermission({
|
|
19
21
|
permission: permission$1,
|
|
20
22
|
userId
|
|
@@ -49,4 +51,4 @@ function usePermission(permission) {
|
|
|
49
51
|
|
|
50
52
|
//#endregion
|
|
51
53
|
export { usePermission };
|
|
52
|
-
//# sourceMappingURL=use-permission.
|
|
54
|
+
//# sourceMappingURL=use-permission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-permission.js","names":["permission","permission: Permission"],"sources":["../../../../src/modules/auth/hooks/use-permission.ts"],"sourcesContent":["\"use client\";\n\nimport { useSuspenseQueries } from \"@tanstack/react-query\";\nimport { LiteralString } from \"better-auth\";\nimport { authClient } from \"../handler/client.client\";\nimport { type Permission } from \"../lib/permissions\";\nimport { useSession } from \"./use-session\";\n\n/**\n * UsePermission\n */\nexport function usePermission(permission?: Permission) {\n const sessionQuery = useSession();\n\n const keys = Object.entries(permission ?? {}).flatMap(([resource, permissions]) =>\n permissions.map((permission) => [resource, permission] as const),\n );\n\n return useSuspenseQueries({\n queries: keys.map((key) => ({\n queryKey: [\"permission\", ...key],\n queryFn: async () => {\n const resource = key[0]?.toString() as string;\n const permission: Permission = { [resource]: [key[1]] as LiteralString[] };\n\n const userId = sessionQuery.data?.user.id;\n\n const { data, error } = await authClient.admin.hasPermission({ permission, userId });\n if (error) {\n console.error(error);\n throw error;\n }\n\n return {\n permission,\n success: data.success,\n };\n },\n })),\n combine: (results) => {\n const errors = results.filter(({ error }) => error);\n if (errors.length) return { data: null, errors };\n\n const values = results.map(({ data }) => data);\n const success = results.every(({ data }) => data.success);\n\n return { data: { success, values }, errors: null };\n },\n });\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,cAAc,YAAyB;CACrD,MAAM,eAAe,YAAY;AAMjC,QAAO,mBAAmB;EACxB,SALW,OAAO,QAAQ,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,iBAChE,YAAY,KAAK,iBAAe,CAAC,UAAUA,aAAW,CAAU,CACjE,CAGe,KAAK,SAAS;GAC1B,UAAU,CAAC,cAAc,GAAG,IAAI;GAChC,SAAS,YAAY;IAEnB,MAAMC,eAAyB,GADd,IAAI,IAAI,UAAU,GACU,CAAC,IAAI,GAAG,EAAqB;IAE1E,MAAM,SAAS,aAAa,MAAM,KAAK;IAEvC,MAAM,EAAE,MAAM,UAAU,MAAM,WAAW,MAAM,cAAc;KAAE;KAAY;KAAQ,CAAC;AACpF,QAAI,OAAO;AACT,aAAQ,MAAM,MAAM;AACpB,WAAM;;AAGR,WAAO;KACL;KACA,SAAS,KAAK;KACf;;GAEJ,EAAE;EACH,UAAU,YAAY;GACpB,MAAM,SAAS,QAAQ,QAAQ,EAAE,YAAY,MAAM;AACnD,OAAI,OAAO,OAAQ,QAAO;IAAE,MAAM;IAAM;IAAQ;GAEhD,MAAM,SAAS,QAAQ,KAAK,EAAE,WAAW,KAAK;AAG9C,UAAO;IAAE,MAAM;KAAE,SAFD,QAAQ,OAAO,EAAE,WAAW,KAAK,QAAQ;KAE/B;KAAQ;IAAE,QAAQ;IAAM;;EAErD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as _tanstack_react_query0 from "@tanstack/react-query";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/auth/hooks/use-session.d.ts
|
|
4
|
+
declare function useSession(): _tanstack_react_query0.UseSuspenseQueryResult<{
|
|
5
|
+
user: {
|
|
6
|
+
id: string;
|
|
7
|
+
createdAt: Date;
|
|
8
|
+
updatedAt: Date;
|
|
9
|
+
email: string;
|
|
10
|
+
emailVerified: boolean;
|
|
11
|
+
name: string;
|
|
12
|
+
image?: string | null | undefined;
|
|
13
|
+
banned: boolean | null | undefined;
|
|
14
|
+
role?: string | null | undefined;
|
|
15
|
+
banReason?: string | null | undefined;
|
|
16
|
+
banExpires?: Date | null | undefined;
|
|
17
|
+
firstName: string;
|
|
18
|
+
lastName: string;
|
|
19
|
+
};
|
|
20
|
+
session: {
|
|
21
|
+
id: string;
|
|
22
|
+
createdAt: Date;
|
|
23
|
+
updatedAt: Date;
|
|
24
|
+
userId: string;
|
|
25
|
+
expiresAt: Date;
|
|
26
|
+
token: string;
|
|
27
|
+
ipAddress?: string | null | undefined;
|
|
28
|
+
userAgent?: string | null | undefined;
|
|
29
|
+
impersonatedBy?: string | null | undefined;
|
|
30
|
+
};
|
|
31
|
+
} | null, Error>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { useSession };
|
|
34
|
+
//# sourceMappingURL=use-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-session.d.ts","names":[],"sources":["../../../../src/modules/auth/hooks/use-session.ts"],"sourcesContent":[],"mappings":";;;iBAKgB,UAAA,CAAA,0BAAU;;;IAAV,SAAU,MAAA;IAAA,SAAA,MAAA;;;;;;;;4BAAA,GAAA,SAAA;IAAA,SAAA,EAAA,MAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { authClient } from "../handler/client.client.js";
|
|
5
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
6
|
+
|
|
7
|
+
//#region src/modules/auth/hooks/use-session.ts
|
|
8
|
+
function useSession() {
|
|
9
|
+
return useSuspenseQuery({
|
|
10
|
+
queryKey: ["session"],
|
|
11
|
+
queryFn: async () => {
|
|
12
|
+
const session = await authClient.getSession();
|
|
13
|
+
if (session.error) throw session.error;
|
|
14
|
+
return session.data;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { useSession };
|
|
21
|
+
//# sourceMappingURL=use-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-session.js","names":[],"sources":["../../../../src/modules/auth/hooks/use-session.ts"],"sourcesContent":["\"use client\";\n\nimport { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { authClient } from \"../entry.client\";\n\nexport function useSession() {\n const session = useSuspenseQuery({\n queryKey: [\"session\"],\n queryFn: async () => {\n const session = await authClient.getSession();\n if (session.error) throw session.error;\n\n return session.data;\n },\n });\n\n return session;\n}\n"],"mappings":";;;;;;;AAKA,SAAgB,aAAa;AAW3B,QAVgB,iBAAiB;EAC/B,UAAU,CAAC,UAAU;EACrB,SAAS,YAAY;GACnB,MAAM,UAAU,MAAM,WAAW,YAAY;AAC7C,OAAI,QAAQ,MAAO,OAAM,QAAQ;AAEjC,UAAO,QAAQ;;EAElB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { CreateUserSchema, UpdateUserSchema } from "./validators.js";
|
|
1
2
|
import { TDatabaseSchema } from "../../config/db/types.js";
|
|
2
3
|
import { GetTulipReturn } from "../../config/lib/resolve.server.js";
|
|
3
|
-
import { CreateUserSchema, UpdateUserSchema } from "./validators.js";
|
|
4
4
|
import "server-cli-only";
|
|
5
5
|
import * as better_auth_plugins0 from "better-auth/plugins";
|
|
6
6
|
|
|
@@ -37,7 +37,7 @@ declare function getSession<TSchema extends TDatabaseSchema>({
|
|
|
37
37
|
banReason?: string | null | undefined;
|
|
38
38
|
banExpires?: Date | null | undefined;
|
|
39
39
|
};
|
|
40
|
-
}>;
|
|
40
|
+
} | null>;
|
|
41
41
|
/**
|
|
42
42
|
* Create a user
|
|
43
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.server.d.ts","names":[],"sources":["../../../../src/modules/auth/lib/helpers.server.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"helpers.server.d.ts","names":[],"sources":["../../../../src/modules/auth/lib/helpers.server.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAasB,iBAAA,UAAU,CAAA,gBAAiB,eAAjB,CAAA,CAAA;EAAA;AAAA,CAAA,E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from "../db/schema.js";
|
|
3
|
-
import {
|
|
4
|
-
import "server-cli-only";
|
|
2
|
+
import { ServerError } from "../../config/router/error.server.js";
|
|
5
3
|
import { eq } from "drizzle-orm";
|
|
4
|
+
import "server-cli-only";
|
|
6
5
|
import { headers } from "next/headers";
|
|
7
6
|
|
|
8
7
|
//#region src/modules/auth/lib/helpers.server.ts
|
|
@@ -10,9 +9,7 @@ import { headers } from "next/headers";
|
|
|
10
9
|
* Get the session
|
|
11
10
|
*/
|
|
12
11
|
async function getSession({ auth }) {
|
|
13
|
-
|
|
14
|
-
if (!session) redirect("/auth/login");
|
|
15
|
-
return session;
|
|
12
|
+
return auth.api.getSession({ headers: await headers() });
|
|
16
13
|
}
|
|
17
14
|
/**
|
|
18
15
|
* Create a user
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.server.js","names":[],"sources":["../../../../src/modules/auth/lib/helpers.server.ts"],"sourcesContent":["import \"server-cli-only\";\n\nimport { type TDatabaseSchema } from \"@/modules/config/db/types\";\nimport { GetTulipReturn } from \"@/modules/config/lib/resolve.server\";\nimport { ServerError } from \"@/modules/config/router/error.server\";\nimport { eq } from \"drizzle-orm\";\nimport { headers } from \"next/headers\";\nimport {
|
|
1
|
+
{"version":3,"file":"helpers.server.js","names":[],"sources":["../../../../src/modules/auth/lib/helpers.server.ts"],"sourcesContent":["import \"server-cli-only\";\n\nimport { type TDatabaseSchema } from \"@/modules/config/db/types\";\nimport { GetTulipReturn } from \"@/modules/config/lib/resolve.server\";\nimport { ServerError } from \"@/modules/config/router/error.server\";\nimport { eq } from \"drizzle-orm\";\nimport { headers } from \"next/headers\";\nimport { users } from \"../entry\";\nimport { CreateUserSchema, UpdateUserSchema } from \"./validators\";\n\n/**\n * Get the session\n */\nexport async function getSession<TSchema extends TDatabaseSchema>({\n auth,\n}: Pick<GetTulipReturn<TSchema>, \"auth\">) {\n return auth.api.getSession({ headers: await headers() });\n}\n\n/**\n * Create a user\n */\nexport function createUser<TSchema extends TDatabaseSchema>(\n { auth, headers }: GetTulipReturn<TSchema> & { headers: Headers },\n { body }: { body: CreateUserSchema },\n) {\n const { firstName, lastName } = body;\n\n return auth.api.createUser({\n headers,\n body: {\n ...body,\n name: `${firstName} ${lastName}`,\n data: { firstName, lastName },\n },\n });\n}\n\n/**\n * Update a user\n */\n\nexport async function updateUser<TSchema extends TDatabaseSchema>(\n { db }: GetTulipReturn<TSchema>,\n { userId, body }: { userId: string; body: Partial<UpdateUserSchema> },\n) {\n const [result] = await db.update(users).set(body).where(eq(users.id, userId)).returning();\n if (!result) {\n throw new ServerError(\"INTERNAL_SERVER_ERROR\", {\n message: \"Gebruiker kon niet worden aangemaakt\",\n });\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;AAaA,eAAsB,WAA4C,EAChE,QACwC;AACxC,QAAO,KAAK,IAAI,WAAW,EAAE,SAAS,MAAM,SAAS,EAAE,CAAC;;;;;AAM1D,SAAgB,WACd,EAAE,MAAM,sBACR,EAAE,QACF;CACA,MAAM,EAAE,WAAW,aAAa;AAEhC,QAAO,KAAK,IAAI,WAAW;EACzB;EACA,MAAM;GACJ,GAAG;GACH,MAAM,GAAG,UAAU,GAAG;GACtB,MAAM;IAAE;IAAW;IAAU;GAC9B;EACF,CAAC;;;;;AAOJ,eAAsB,WACpB,EAAE,MACF,EAAE,QAAQ,QACV;CACA,MAAM,CAAC,UAAU,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,WAAW;AACzF,KAAI,CAAC,OACH,OAAM,IAAI,YAAY,yBAAyB,EAC7C,SAAS,wCACV,CAAC;AAGJ,QAAO"}
|
|
@@ -31,22 +31,22 @@ declare const forgotPasswordSchema: z$1.ZodObject<{
|
|
|
31
31
|
* Create user schema
|
|
32
32
|
*/
|
|
33
33
|
declare const createUserSchema: z$1.ZodObject<{
|
|
34
|
-
email: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<string, string>>;
|
|
35
34
|
image: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
35
|
+
email: z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<string, string>>;
|
|
36
36
|
firstName: z$1.ZodString;
|
|
37
37
|
lastName: z$1.ZodString;
|
|
38
38
|
password: z$1.ZodString;
|
|
39
|
-
role: z$1.ZodString
|
|
39
|
+
role: z$1.ZodDefault<z$1.ZodString>;
|
|
40
40
|
}, z$1.core.$strip>;
|
|
41
41
|
type CreateUserSchema = z$1.infer<typeof createUserSchema>;
|
|
42
42
|
/**
|
|
43
43
|
* Update user schema
|
|
44
44
|
*/
|
|
45
45
|
declare const updateUserSchema: z$1.ZodObject<{
|
|
46
|
-
|
|
46
|
+
image: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
|
|
47
47
|
firstName: z$1.ZodString;
|
|
48
48
|
lastName: z$1.ZodString;
|
|
49
|
-
|
|
49
|
+
email: z$1.ZodString;
|
|
50
50
|
}, {
|
|
51
51
|
out: {};
|
|
52
52
|
in: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","names":[],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;AAKa,KALD,IAAA,GAcV,OAdwB,KAAA,CAAM,YAc9B;;;;cATW,aAAW,GAAA,CAAA;OAAA,cAAA;EAAA,QAAA,eAAA;AAcxB,CAAA,iBAAa,CAAA;;;;cAAA,qBAAmB,GAAA,CAAA;UAAA,eAAA;EAAA,oBAAA,eAAA;AAmBhC,CAAA,iBAAa,CAAA;;;;AAAoB,cAApB,oBAAoB,EAAA,GAAA,CAAA,SAAA,CAAA;EAAA,KAAA,cAAA;AAUjC,CAAA,iBAAa,CAAA;;;;cAAA,kBAAgB,GAAA,CAAA;;;;;;;;KAajB,gBAAA,GAAmB,GAAA,CAAE,aAAa
|
|
1
|
+
{"version":3,"file":"validators.d.ts","names":[],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":[],"mappings":";;;;;;;AAQA;AAKa,KALD,IAAA,GAcV,OAdwB,KAAA,CAAM,YAc9B;;;;cATW,aAAW,GAAA,CAAA;OAAA,cAAA;EAAA,QAAA,eAAA;AAcxB,CAAA,iBAAa,CAAA;;;;cAAA,qBAAmB,GAAA,CAAA;UAAA,eAAA;EAAA,oBAAA,eAAA;AAmBhC,CAAA,iBAAa,CAAA;;;;AAAoB,cAApB,oBAAoB,EAAA,GAAA,CAAA,SAAA,CAAA;EAAA,KAAA,cAAA;AAUjC,CAAA,iBAAa,CAAA;;;;cAAA,kBAAgB,GAAA,CAAA;;;;;;;;KAajB,gBAAA,GAAmB,GAAA,CAAE,aAAa;;;;AAAlC,cAKC,gBALe,EAKC,GAAA,CAAA,SALD,CAAA;EAAA,KAAA,iBAAA,gBAAA,cAAA,CAAA,CAAA;WAAkB,eAAA;UAAb,eAAA;EAAK,KAAA,eAAA;AAKtC,CAAA,EAAA;EAKE,GAAA,EAAA,CAAA,CAAA;;;KAEU,gBAAA,GAAmB,GAAA,CAAE,aAAa;;;;AAPjB,cAYhB,oBAZgB,EAYI,GAAA,CAAA,SAZJ,CAAA;EAAA,QAAA,eAAA;AAO7B,CAAA,iBAAY,CAAA;AAAgB,KAShB,oBAAA,GAAuB,GAAA,CAAE,KATT,CAAA,OASsB,oBATtB,CAAA"}
|
|
@@ -35,7 +35,7 @@ const createUserSchema = userSchema.pick({
|
|
|
35
35
|
firstName: z$1.string().min(2, { message: "Voornaam moet langer zijn dan 2 karakters" }).max(50, { message: "Voornaam mag niet langer zijn dan 50 karakters" }),
|
|
36
36
|
lastName: z$1.string().min(2, { message: "Achternaam moet langer zijn dan 2 karakters" }).max(50, { message: "Achternaam mag niet langer zijn dan 50 karakters" }),
|
|
37
37
|
password: z$1.string().min(6, { message: "Wachtwoord moet minimaal 6 karakters hebben" }),
|
|
38
|
-
role: z$1.string()
|
|
38
|
+
role: z$1.string().default("user")
|
|
39
39
|
});
|
|
40
40
|
/**
|
|
41
41
|
* Update user schema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","names":["z"],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":["import { userSchema } from \"better-auth/db\";\nimport { createInsertSchema } from \"drizzle-zod\";\nimport { z } from \"zod\";\nimport { users } from \"../db/schema\";\n\n/**\n * User type\n */\nexport type User = typeof users.$inferSelect;\n\n/**\n * Login schema\n */\nexport const loginSchema = z.object({\n email: z\n .email({ message: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Reset password schema\n */\nexport const resetPasswordSchema = z\n .object({\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n passwordConfirmation: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n })\n .refine((data) => data.password === data.passwordConfirmation, {\n message: \"Wachtwoorden komen niet overeen\",\n path: [\"passwordConfirmation\"],\n });\n\n/**\n * Forgot password schema\n */\nexport const forgotPasswordSchema = z.object({\n email: z\n .email({ error: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Create user schema\n */\nexport const createUserSchema = userSchema.pick({ email: true, image: true }).extend({\n firstName: z\n .string()\n .min(2, { message: \"Voornaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Voornaam mag niet langer zijn dan 50 karakters\" }),\n lastName: z\n .string()\n .min(2, { message: \"Achternaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Achternaam mag niet langer zijn dan 50 karakters\" }),\n password: z.string().min(6, { message: \"Wachtwoord moet minimaal 6 karakters hebben\" }),\n role: z.string(),\n});\n\nexport type CreateUserSchema = z.infer<typeof createUserSchema>;\n\n/**\n * Update user schema\n */\nexport const updateUserSchema = createInsertSchema(users).pick({\n firstName: true,\n lastName: true,\n email: true,\n image: true,\n});\n\nexport type UpdateUserSchema = z.infer<typeof updateUserSchema>;\n\n/**\n * Update password input validation\n */\nexport const updatePasswordSchema = z.object({\n password: z.string().min(6, { message: \"Wachtwoord moet minimaal 6 karakters hebben\" }),\n});\n\nexport type UpdatePasswordSchema = z.infer<typeof updatePasswordSchema>;\n"],"mappings":";;;;;;;;;AAaA,MAAa,cAAcA,IAAE,OAAO;CAClC,OAAOA,IACJ,MAAM,EAAE,SAAS,0CAA0C,CAAC,CAC5D,IAAI,GAAG,EAAE,SAAS,0CAA0C,CAAC,CAC7D,IAAI,IAAI,EAAE,SAAS,+CAA+C,CAAC;CACtE,UAAUA,IACP,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC5E,CAAC;;;;AAKF,MAAa,sBAAsBA,IAChC,OAAO;CACN,UAAUA,IACP,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC3E,sBAAsBA,IACnB,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC5E,CAAC,CACD,QAAQ,SAAS,KAAK,aAAa,KAAK,sBAAsB;CAC7D,SAAS;CACT,MAAM,CAAC,uBAAuB;CAC/B,CAAC;;;;AAKJ,MAAa,uBAAuBA,IAAE,OAAO,EAC3C,OAAOA,IACJ,MAAM,EAAE,OAAO,0CAA0C,CAAC,CAC1D,IAAI,GAAG,EAAE,SAAS,0CAA0C,CAAC,CAC7D,IAAI,IAAI,EAAE,SAAS,+CAA+C,CAAC,EACvE,CAAC;;;;AAKF,MAAa,mBAAmB,WAAW,KAAK;CAAE,OAAO;CAAM,OAAO;CAAM,CAAC,CAAC,OAAO;CACnF,WAAWA,IACR,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,6CAA6C,CAAC,CAChE,IAAI,IAAI,EAAE,SAAS,kDAAkD,CAAC;CACzE,UAAUA,IACP,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,IAAI,IAAI,EAAE,SAAS,oDAAoD,CAAC;CAC3E,UAAUA,IAAE,QAAQ,CAAC,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC;CACvF,MAAMA,IAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"validators.js","names":["z"],"sources":["../../../../src/modules/auth/lib/validators.ts"],"sourcesContent":["import { userSchema } from \"better-auth/db\";\nimport { createInsertSchema } from \"drizzle-zod\";\nimport { z } from \"zod\";\nimport { users } from \"../db/schema\";\n\n/**\n * User type\n */\nexport type User = typeof users.$inferSelect;\n\n/**\n * Login schema\n */\nexport const loginSchema = z.object({\n email: z\n .email({ message: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Reset password schema\n */\nexport const resetPasswordSchema = z\n .object({\n password: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n passwordConfirmation: z\n .string()\n .min(2, { message: \"Wachtwoord moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Wachtwoord mag niet langer zijn dan 50 karakters\" }),\n })\n .refine((data) => data.password === data.passwordConfirmation, {\n message: \"Wachtwoorden komen niet overeen\",\n path: [\"passwordConfirmation\"],\n });\n\n/**\n * Forgot password schema\n */\nexport const forgotPasswordSchema = z.object({\n email: z\n .email({ error: \"Email moet een geldig email adres zijn\" })\n .min(2, { message: \"Email moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Email mag niet langer zijn dan 50 karakters\" }),\n});\n\n/**\n * Create user schema\n */\nexport const createUserSchema = userSchema.pick({ email: true, image: true }).extend({\n firstName: z\n .string()\n .min(2, { message: \"Voornaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Voornaam mag niet langer zijn dan 50 karakters\" }),\n lastName: z\n .string()\n .min(2, { message: \"Achternaam moet langer zijn dan 2 karakters\" })\n .max(50, { message: \"Achternaam mag niet langer zijn dan 50 karakters\" }),\n password: z.string().min(6, { message: \"Wachtwoord moet minimaal 6 karakters hebben\" }),\n role: z.string().default(\"user\"),\n});\n\nexport type CreateUserSchema = z.infer<typeof createUserSchema>;\n\n/**\n * Update user schema\n */\nexport const updateUserSchema = createInsertSchema(users).pick({\n firstName: true,\n lastName: true,\n email: true,\n image: true,\n});\n\nexport type UpdateUserSchema = z.infer<typeof updateUserSchema>;\n\n/**\n * Update password input validation\n */\nexport const updatePasswordSchema = z.object({\n password: z.string().min(6, { message: \"Wachtwoord moet minimaal 6 karakters hebben\" }),\n});\n\nexport type UpdatePasswordSchema = z.infer<typeof updatePasswordSchema>;\n"],"mappings":";;;;;;;;;AAaA,MAAa,cAAcA,IAAE,OAAO;CAClC,OAAOA,IACJ,MAAM,EAAE,SAAS,0CAA0C,CAAC,CAC5D,IAAI,GAAG,EAAE,SAAS,0CAA0C,CAAC,CAC7D,IAAI,IAAI,EAAE,SAAS,+CAA+C,CAAC;CACtE,UAAUA,IACP,QAAQ,CACR,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,CAClE,I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,CAAC,IAAI,GAAG,EAAE,SAAS,+CAA+C,CAAC,EACxF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CommandAction } from "../hooks/use-command-action.client.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime54 from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { AlertDialogCancelProps, AlertDialogContentProps, AlertDialogProps } from "@radix-ui/react-alert-dialog";
|
|
5
4
|
import { Keys } from "react-hotkeys-hook";
|
|
5
|
+
import { AlertDialogCancelProps, AlertDialogContentProps, AlertDialogProps } from "@radix-ui/react-alert-dialog";
|
|
6
6
|
|
|
7
7
|
//#region src/modules/commands/components/alert-dialog-command.client.d.ts
|
|
8
8
|
/**
|
|
@@ -11,7 +11,7 @@ import { Keys } from "react-hotkeys-hook";
|
|
|
11
11
|
declare function CommandAlertDialog({
|
|
12
12
|
children,
|
|
13
13
|
...props
|
|
14
|
-
}: AlertDialogProps):
|
|
14
|
+
}: AlertDialogProps): react_jsx_runtime54.JSX.Element;
|
|
15
15
|
/**
|
|
16
16
|
* CommandAlertDialogTrigger
|
|
17
17
|
*/
|
|
@@ -28,49 +28,49 @@ declare function CommandAlertDialogTrigger({
|
|
|
28
28
|
children,
|
|
29
29
|
disabled,
|
|
30
30
|
...props
|
|
31
|
-
}: CommandAlertDialogTriggerProps):
|
|
31
|
+
}: CommandAlertDialogTriggerProps): react_jsx_runtime54.JSX.Element | undefined;
|
|
32
32
|
/**
|
|
33
33
|
* CommandAlertDialogContent
|
|
34
34
|
*/
|
|
35
35
|
declare function CommandAlertDialogContent({
|
|
36
36
|
children,
|
|
37
37
|
...props
|
|
38
|
-
}: AlertDialogContentProps):
|
|
38
|
+
}: AlertDialogContentProps): react_jsx_runtime54.JSX.Element;
|
|
39
39
|
/**
|
|
40
40
|
* CommandAlertDialogHeader
|
|
41
41
|
*/
|
|
42
42
|
declare function CommandAlertDialogHeader({
|
|
43
43
|
children,
|
|
44
44
|
...props
|
|
45
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
45
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime54.JSX.Element;
|
|
46
46
|
/**
|
|
47
47
|
* CommandAlertDialogTitle
|
|
48
48
|
*/
|
|
49
49
|
declare function CommandAlertDialogTitle({
|
|
50
50
|
children,
|
|
51
51
|
...props
|
|
52
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
52
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime54.JSX.Element;
|
|
53
53
|
/**
|
|
54
54
|
* CommandAlertDialogDescription
|
|
55
55
|
*/
|
|
56
56
|
declare function CommandAlertDialogDescription({
|
|
57
57
|
children,
|
|
58
58
|
...props
|
|
59
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
59
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime54.JSX.Element;
|
|
60
60
|
/**
|
|
61
61
|
* CommandAlertDialogFooter
|
|
62
62
|
*/
|
|
63
63
|
declare function CommandAlertDialogFooter({
|
|
64
64
|
children,
|
|
65
65
|
...props
|
|
66
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
66
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime54.JSX.Element;
|
|
67
67
|
/**
|
|
68
68
|
* CommandAlertDialogCancel
|
|
69
69
|
*/
|
|
70
70
|
declare function CommandAlertDialogCancel({
|
|
71
71
|
children,
|
|
72
72
|
...props
|
|
73
|
-
}: AlertDialogCancelProps):
|
|
73
|
+
}: AlertDialogCancelProps): react_jsx_runtime54.JSX.Element;
|
|
74
74
|
/**
|
|
75
75
|
* CommandAlertDialogAction
|
|
76
76
|
*/
|
|
@@ -87,7 +87,7 @@ declare function CommandAlertDialogAction({
|
|
|
87
87
|
children,
|
|
88
88
|
disabled,
|
|
89
89
|
...props
|
|
90
|
-
}: CommandAlertDialogActionProps):
|
|
90
|
+
}: CommandAlertDialogActionProps): react_jsx_runtime54.JSX.Element;
|
|
91
91
|
//#endregion
|
|
92
92
|
export { CommandAlertDialog, CommandAlertDialogAction, CommandAlertDialogCancel, CommandAlertDialogContent, CommandAlertDialogDescription, CommandAlertDialogFooter, CommandAlertDialogHeader, CommandAlertDialogTitle, CommandAlertDialogTrigger };
|
|
93
93
|
//# sourceMappingURL=alert-dialog-command.client.d.ts.map
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
import { Icons } from "../../../components/common/icons.js";
|
|
5
5
|
import { cn } from "../../../lib/utils/cn.js";
|
|
6
6
|
import { buttonVariants } from "../../../components/ui/button.js";
|
|
7
|
-
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../../../components/ui/alert-dialog.js";
|
|
8
7
|
import { ContextMenuItem } from "../../../components/ui/context-menu.js";
|
|
9
8
|
import { DropdownMenuItem } from "../../../components/ui/dropdown-menu.js";
|
|
10
9
|
import { useCommand } from "../hooks/context.client.js";
|
|
11
10
|
import { useCommandAction } from "../hooks/use-command-action.client.js";
|
|
12
11
|
import { CommandTrigger } from "./command-trigger.client.js";
|
|
12
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../../../components/ui/alert-dialog.js";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import React from "react";
|
|
15
15
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandAction } from "../hooks/use-command-action.client.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime63 from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Keys } from "react-hotkeys-hook";
|
|
5
5
|
|
|
@@ -21,7 +21,7 @@ declare function CommandClick({
|
|
|
21
21
|
hotkey,
|
|
22
22
|
disabled,
|
|
23
23
|
...props
|
|
24
|
-
}: CommandClickProps):
|
|
24
|
+
}: CommandClickProps): react_jsx_runtime63.JSX.Element | null;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { CommandClick, CommandClickProps };
|
|
27
27
|
//# sourceMappingURL=click-command.client.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime64 from "react/jsx-runtime";
|
|
2
2
|
import * as react0 from "react";
|
|
3
3
|
import { PropsWithChildren } from "react";
|
|
4
4
|
|
|
@@ -18,17 +18,17 @@ declare function CommandTrigger({
|
|
|
18
18
|
children
|
|
19
19
|
}: PropsWithChildren<{
|
|
20
20
|
label?: string;
|
|
21
|
-
}>):
|
|
21
|
+
}>): react_jsx_runtime64.JSX.Element;
|
|
22
22
|
/**
|
|
23
23
|
* Command label
|
|
24
24
|
*/
|
|
25
|
-
declare function CommandLabel():
|
|
25
|
+
declare function CommandLabel(): react_jsx_runtime64.JSX.Element | null;
|
|
26
26
|
/**
|
|
27
27
|
* Command icon
|
|
28
28
|
*/
|
|
29
29
|
declare function CommandIcon({
|
|
30
30
|
children
|
|
31
|
-
}: PropsWithChildren):
|
|
31
|
+
}: PropsWithChildren): react_jsx_runtime64.JSX.Element;
|
|
32
32
|
//#endregion
|
|
33
33
|
export { CommandIcon, CommandLabel, CommandTrigger, CommandTriggerContext };
|
|
34
34
|
//# sourceMappingURL=command-trigger.client.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../../components/ui/tooltip.client.js";
|
|
5
4
|
import { useCommand } from "../hooks/context.client.js";
|
|
5
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../../components/ui/tooltip.client.js";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { createContext, useContext } from "react";
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime67 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { DialogContentProps, DialogProps } from "@radix-ui/react-dialog";
|
|
4
4
|
import { Keys } from "react-hotkeys-hook";
|
|
@@ -10,7 +10,7 @@ import { Keys } from "react-hotkeys-hook";
|
|
|
10
10
|
declare function CommandDialog({
|
|
11
11
|
children,
|
|
12
12
|
...props
|
|
13
|
-
}: DialogProps):
|
|
13
|
+
}: DialogProps): react_jsx_runtime67.JSX.Element;
|
|
14
14
|
/**
|
|
15
15
|
* CommandDialogTrigger
|
|
16
16
|
*/
|
|
@@ -27,42 +27,42 @@ declare function CommandDialogTrigger({
|
|
|
27
27
|
children,
|
|
28
28
|
disabled,
|
|
29
29
|
...props
|
|
30
|
-
}: CommandDialogTriggerProps):
|
|
30
|
+
}: CommandDialogTriggerProps): react_jsx_runtime67.JSX.Element | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* CommandDialogContent
|
|
33
33
|
*/
|
|
34
34
|
declare function CommandDialogContent({
|
|
35
35
|
children,
|
|
36
36
|
...props
|
|
37
|
-
}: DialogContentProps):
|
|
37
|
+
}: DialogContentProps): react_jsx_runtime67.JSX.Element;
|
|
38
38
|
/**
|
|
39
39
|
* CommandDialogHeader
|
|
40
40
|
*/
|
|
41
41
|
declare function CommandDialogHeader({
|
|
42
42
|
children,
|
|
43
43
|
...props
|
|
44
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
44
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime67.JSX.Element;
|
|
45
45
|
/**
|
|
46
46
|
* CommandDialogTitle
|
|
47
47
|
*/
|
|
48
48
|
declare function CommandDialogTitle({
|
|
49
49
|
children,
|
|
50
50
|
...props
|
|
51
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
51
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime67.JSX.Element;
|
|
52
52
|
/**
|
|
53
53
|
* CommandDialogDescription
|
|
54
54
|
*/
|
|
55
55
|
declare function CommandDialogDescription({
|
|
56
56
|
children,
|
|
57
57
|
...props
|
|
58
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
58
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime67.JSX.Element;
|
|
59
59
|
/**
|
|
60
60
|
* CommandDialogFooter
|
|
61
61
|
*/
|
|
62
62
|
declare function CommandDialogFooter({
|
|
63
63
|
children,
|
|
64
64
|
...props
|
|
65
|
-
}: React.HTMLAttributes<HTMLElement>):
|
|
65
|
+
}: React.HTMLAttributes<HTMLElement>): react_jsx_runtime67.JSX.Element;
|
|
66
66
|
//#endregion
|
|
67
67
|
export { CommandDialog, CommandDialogContent, CommandDialogDescription, CommandDialogFooter, CommandDialogHeader, CommandDialogTitle, CommandDialogTrigger };
|
|
68
68
|
//# sourceMappingURL=dialog-command.client.d.ts.map
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "../../../lib/utils/cn.js";
|
|
5
5
|
import { buttonVariants } from "../../../components/ui/button.js";
|
|
6
|
-
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "../../../components/ui/dialog.client.js";
|
|
7
6
|
import { ContextMenuItem } from "../../../components/ui/context-menu.js";
|
|
7
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "../../../components/ui/dialog.client.js";
|
|
8
8
|
import { DropdownMenuItem } from "../../../components/ui/dropdown-menu.js";
|
|
9
9
|
import { useCommand } from "../hooks/context.client.js";
|
|
10
10
|
import { CommandTrigger } from "./command-trigger.client.js";
|