@vitnode/core 1.2.0-canary.10
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.md +21 -0
- package/dist/emails/my-email.d.ts +2 -0
- package/dist/emails/my-email.d.ts.map +1 -0
- package/dist/scripts/get-config.d.ts +3 -0
- package/dist/scripts/get-config.d.ts.map +1 -0
- package/dist/scripts/plugin.d.ts +4 -0
- package/dist/scripts/plugin.d.ts.map +1 -0
- package/dist/scripts/prepare-database.d.ts +7 -0
- package/dist/scripts/prepare-database.d.ts.map +1 -0
- package/dist/scripts/prepare-plugins-files.d.ts +2 -0
- package/dist/scripts/prepare-plugins-files.d.ts.map +1 -0
- package/dist/scripts/run-interactive-shell-command.d.ts +2 -0
- package/dist/scripts/run-interactive-shell-command.d.ts.map +1 -0
- package/dist/scripts/scripts.d.ts +3 -0
- package/dist/scripts/scripts.d.ts.map +1 -0
- package/dist/scripts/scripts.js +21 -0
- package/dist/scripts/shared/file-utils.d.ts +14 -0
- package/dist/scripts/shared/file-utils.d.ts.map +1 -0
- package/dist/src/api/config.d.ts +24 -0
- package/dist/src/api/config.d.ts.map +1 -0
- package/dist/src/api/config.js +50 -0
- package/dist/src/api/lib/check-plugin-id.d.ts +15 -0
- package/dist/src/api/lib/check-plugin-id.d.ts.map +1 -0
- package/dist/src/api/lib/check-plugin-id.js +15 -0
- package/dist/src/api/lib/get-user-ip.d.ts +3 -0
- package/dist/src/api/lib/get-user-ip.d.ts.map +1 -0
- package/dist/src/api/lib/get-user-ip.js +8 -0
- package/dist/src/api/lib/module.d.ts +23 -0
- package/dist/src/api/lib/module.d.ts.map +1 -0
- package/dist/src/api/lib/module.js +21 -0
- package/dist/src/api/lib/plugin.d.ts +11 -0
- package/dist/src/api/lib/plugin.d.ts.map +1 -0
- package/dist/src/api/lib/plugin.js +14 -0
- package/dist/src/api/lib/route.d.ts +26 -0
- package/dist/src/api/lib/route.d.ts.map +1 -0
- package/dist/src/api/lib/route.js +23 -0
- package/dist/src/api/lib/with-pagination.d.ts +72 -0
- package/dist/src/api/lib/with-pagination.d.ts.map +1 -0
- package/dist/src/api/lib/with-pagination.js +70 -0
- package/dist/src/api/middlewares/global/global.d.ts +66 -0
- package/dist/src/api/middlewares/global/global.d.ts.map +1 -0
- package/dist/src/api/middlewares/global/global.js +47 -0
- package/dist/src/api/models/device.d.ts +10 -0
- package/dist/src/api/models/device.d.ts.map +1 -0
- package/dist/src/api/models/device.js +54 -0
- package/dist/src/api/models/email.d.ts +22 -0
- package/dist/src/api/models/email.d.ts.map +1 -0
- package/dist/src/api/models/email.js +30 -0
- package/dist/src/api/models/password.d.ts +5 -0
- package/dist/src/api/models/password.d.ts.map +1 -0
- package/dist/src/api/models/password.js +21 -0
- package/dist/src/api/models/session-admin.d.ts +24 -0
- package/dist/src/api/models/session-admin.d.ts.map +1 -0
- package/dist/src/api/models/session-admin.js +73 -0
- package/dist/src/api/models/session.d.ts +23 -0
- package/dist/src/api/models/session.d.ts.map +1 -0
- package/dist/src/api/models/session.js +60 -0
- package/dist/src/api/models/sso.d.ts +38 -0
- package/dist/src/api/models/sso.d.ts.map +1 -0
- package/dist/src/api/models/sso.js +120 -0
- package/dist/src/api/models/user/get-user-by-id.d.ts +17 -0
- package/dist/src/api/models/user/get-user-by-id.d.ts.map +1 -0
- package/dist/src/api/models/user/get-user-by-id.js +18 -0
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts +10 -0
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts.map +1 -0
- package/dist/src/api/models/user/sign-in-with-passwords.js +22 -0
- package/dist/src/api/models/user/sign-up.d.ts +21 -0
- package/dist/src/api/models/user/sign-up.d.ts.map +1 -0
- package/dist/src/api/models/user/sign-up.js +75 -0
- package/dist/src/api/models/user.d.ts +45 -0
- package/dist/src/api/models/user.d.ts.map +1 -0
- package/dist/src/api/models/user.js +8 -0
- package/dist/src/api/modules/admin/admin.module.d.ts +294 -0
- package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -0
- package/dist/src/api/modules/admin/admin.module.js +14 -0
- package/dist/src/api/modules/admin/routes/session.route.d.ts +108 -0
- package/dist/src/api/modules/admin/routes/session.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/routes/session.route.js +51 -0
- package/dist/src/api/modules/admin/users/routes/list.route.d.ts +190 -0
- package/dist/src/api/modules/admin/users/routes/list.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/users/routes/list.route.js +79 -0
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts +193 -0
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/users/routes/users.route.js +84 -0
- package/dist/src/api/modules/admin/users/users.admin.module.d.ts +189 -0
- package/dist/src/api/modules/admin/users/users.admin.module.d.ts.map +1 -0
- package/dist/src/api/modules/admin/users/users.admin.module.js +10 -0
- package/dist/src/api/modules/middleware/middleware.module.d.ts +52 -0
- package/dist/src/api/modules/middleware/middleware.module.d.ts.map +1 -0
- package/dist/src/api/modules/middleware/middleware.module.js +10 -0
- package/dist/src/api/modules/middleware/route.d.ts +53 -0
- package/dist/src/api/modules/middleware/route.d.ts.map +1 -0
- package/dist/src/api/modules/middleware/route.js +39 -0
- package/dist/src/api/modules/users/avatar-color.d.ts +2 -0
- package/dist/src/api/modules/users/avatar-color.d.ts.map +1 -0
- package/dist/src/api/modules/users/avatar-color.js +43 -0
- package/dist/src/api/modules/users/routes/session.route.d.ts +103 -0
- package/dist/src/api/modules/users/routes/session.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/session.route.js +46 -0
- package/dist/src/api/modules/users/routes/sign-in.route.d.ts +88 -0
- package/dist/src/api/modules/users/routes/sign-in.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/sign-in.route.js +71 -0
- package/dist/src/api/modules/users/routes/sign-out.route.d.ts +47 -0
- package/dist/src/api/modules/users/routes/sign-out.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/sign-out.route.js +43 -0
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts +89 -0
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/sign-up.route.js +60 -0
- package/dist/src/api/modules/users/routes/test.route.d.ts +31 -0
- package/dist/src/api/modules/users/routes/test.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/test.route.js +32 -0
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +78 -0
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/sso/routes/callback.route.js +49 -0
- package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts +51 -0
- package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/sso/routes/create-url.route.js +36 -0
- package/dist/src/api/modules/users/sso/sso.module.d.ts +125 -0
- package/dist/src/api/modules/users/sso/sso.module.d.ts.map +1 -0
- package/dist/src/api/modules/users/sso/sso.module.js +12 -0
- package/dist/src/api/modules/users/users.module.d.ts +439 -0
- package/dist/src/api/modules/users/users.module.d.ts.map +1 -0
- package/dist/src/api/modules/users/users.module.js +22 -0
- package/dist/src/api/plugin.d.ts +2 -0
- package/dist/src/api/plugin.d.ts.map +1 -0
- package/dist/src/api/plugin.js +13 -0
- package/dist/src/api/plugins/email/nodemailer.d.ts +10 -0
- package/dist/src/api/plugins/email/nodemailer.d.ts.map +1 -0
- package/dist/src/api/plugins/email/nodemailer.js +30 -0
- package/dist/src/api/plugins/email/resend.d.ts +6 -0
- package/dist/src/api/plugins/email/resend.d.ts.map +1 -0
- package/dist/src/api/plugins/email/resend.js +21 -0
- package/dist/src/api/plugins/sso/discord.d.ts +6 -0
- package/dist/src/api/plugins/sso/discord.d.ts.map +1 -0
- package/dist/src/api/plugins/sso/discord.js +77 -0
- package/dist/src/api/plugins/sso/facebook.d.ts +6 -0
- package/dist/src/api/plugins/sso/facebook.d.ts.map +1 -0
- package/dist/src/api/plugins/sso/facebook.js +76 -0
- package/dist/src/api/plugins/sso/google.d.ts +6 -0
- package/dist/src/api/plugins/sso/google.d.ts.map +1 -0
- package/dist/src/api/plugins/sso/google.js +87 -0
- package/dist/src/app/login/page.d.ts +6 -0
- package/dist/src/app/login/page.d.ts.map +1 -0
- package/dist/src/app/login/page.js +15 -0
- package/dist/src/app/login/sso/[providerId]/page.d.ts +7 -0
- package/dist/src/app/login/sso/[providerId]/page.d.ts.map +1 -0
- package/dist/src/app/login/sso/[providerId]/page.js +10 -0
- package/dist/src/app/register/page.d.ts +6 -0
- package/dist/src/app/register/page.d.ts.map +1 -0
- package/dist/src/app/register/page.js +15 -0
- package/dist/src/app_admin/core/page.d.ts +2 -0
- package/dist/src/app_admin/core/page.d.ts.map +1 -0
- package/dist/src/app_admin/core/page.js +5 -0
- package/dist/src/app_admin/core/test/page.d.ts +2 -0
- package/dist/src/app_admin/core/test/page.d.ts.map +1 -0
- package/dist/src/app_admin/core/test/page.js +5 -0
- package/dist/src/app_admin/core/users/page.d.ts +6 -0
- package/dist/src/app_admin/core/users/page.d.ts.map +1 -0
- package/dist/src/app_admin/core/users/page.js +35 -0
- package/dist/src/components/avatar.d.ts +10 -0
- package/dist/src/components/avatar.d.ts.map +1 -0
- package/dist/src/components/avatar.js +14 -0
- package/dist/src/components/date-format.d.ts +5 -0
- package/dist/src/components/date-format.d.ts.map +1 -0
- package/dist/src/components/date-format.js +38 -0
- package/dist/src/components/form/auto-form.d.ts +12 -0
- package/dist/src/components/form/auto-form.d.ts.map +1 -0
- package/dist/src/components/form/auto-form.js +57 -0
- package/dist/src/components/form/common/desc.d.ts +2 -0
- package/dist/src/components/form/common/desc.d.ts.map +1 -0
- package/dist/src/components/form/common/desc.js +9 -0
- package/dist/src/components/form/common/label.d.ts +3 -0
- package/dist/src/components/form/common/label.d.ts.map +1 -0
- package/dist/src/components/form/common/label.js +8 -0
- package/dist/src/components/form/fields/checkbox.d.ts +8 -0
- package/dist/src/components/form/fields/checkbox.d.ts.map +1 -0
- package/dist/src/components/form/fields/checkbox.js +35 -0
- package/dist/src/components/form/fields/combobox.d.ts +14 -0
- package/dist/src/components/form/fields/combobox.d.ts.map +1 -0
- package/dist/src/components/form/fields/combobox.js +88 -0
- package/dist/src/components/form/fields/input.d.ts +9 -0
- package/dist/src/components/form/fields/input.d.ts.map +1 -0
- package/dist/src/components/form/fields/input.js +34 -0
- package/dist/src/components/form/fields/item.d.ts +14 -0
- package/dist/src/components/form/fields/item.d.ts.map +1 -0
- package/dist/src/components/form/fields/item.js +22 -0
- package/dist/src/components/form/fields/radio-group.d.ts +13 -0
- package/dist/src/components/form/fields/radio-group.d.ts.map +1 -0
- package/dist/src/components/form/fields/radio-group.js +51 -0
- package/dist/src/components/form/fields/select.d.ts +14 -0
- package/dist/src/components/form/fields/select.d.ts.map +1 -0
- package/dist/src/components/form/fields/select.js +59 -0
- package/dist/src/components/form/fields/switch.d.ts +8 -0
- package/dist/src/components/form/fields/switch.d.ts.map +1 -0
- package/dist/src/components/form/fields/switch.js +35 -0
- package/dist/src/components/form/fields/textarea.d.ts +9 -0
- package/dist/src/components/form/fields/textarea.d.ts.map +1 -0
- package/dist/src/components/form/fields/textarea.js +34 -0
- package/dist/src/components/i18n-provider.d.ts +7 -0
- package/dist/src/components/i18n-provider.d.ts.map +1 -0
- package/dist/src/components/i18n-provider.js +43 -0
- package/dist/src/components/logo-vitnode.d.ts +4 -0
- package/dist/src/components/logo-vitnode.d.ts.map +1 -0
- package/dist/src/components/logo-vitnode.js +113 -0
- package/dist/src/components/switchers/theme-switcher.d.ts +2 -0
- package/dist/src/components/switchers/theme-switcher.d.ts.map +1 -0
- package/dist/src/components/switchers/theme-switcher.js +25 -0
- package/dist/src/components/table/content.d.ts +3 -0
- package/dist/src/components/table/content.d.ts.map +1 -0
- package/dist/src/components/table/content.js +84 -0
- package/dist/src/components/table/data-table.d.ts +37 -0
- package/dist/src/components/table/data-table.d.ts.map +1 -0
- package/dist/src/components/table/data-table.js +69 -0
- package/dist/src/components/table/order-table-head.d.ts +7 -0
- package/dist/src/components/table/order-table-head.d.ts.map +1 -0
- package/dist/src/components/table/order-table-head.js +39 -0
- package/dist/src/components/table/pagination.d.ts +11 -0
- package/dist/src/components/table/pagination.d.ts.map +1 -0
- package/dist/src/components/table/pagination.js +122 -0
- package/dist/src/components/ui/accordion.d.ts +8 -0
- package/dist/src/components/ui/accordion.d.ts.map +1 -0
- package/dist/src/components/ui/accordion.js +47 -0
- package/dist/src/components/ui/alert-dialog.d.ts +15 -0
- package/dist/src/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/src/components/ui/alert-dialog.js +86 -0
- package/dist/src/components/ui/alert.d.ts +10 -0
- package/dist/src/components/ui/alert.d.ts.map +1 -0
- package/dist/src/components/ui/alert.js +40 -0
- package/dist/src/components/ui/badge.d.ts +10 -0
- package/dist/src/components/ui/badge.d.ts.map +1 -0
- package/dist/src/components/ui/badge.js +29 -0
- package/dist/src/components/ui/button.d.ts +13 -0
- package/dist/src/components/ui/button.d.ts.map +1 -0
- package/dist/src/components/ui/button.js +66 -0
- package/dist/src/components/ui/card.d.ts +10 -0
- package/dist/src/components/ui/card.d.ts.map +1 -0
- package/dist/src/components/ui/card.js +53 -0
- package/dist/src/components/ui/checkbox.d.ts +5 -0
- package/dist/src/components/ui/checkbox.d.ts.map +1 -0
- package/dist/src/components/ui/checkbox.js +21 -0
- package/dist/src/components/ui/collapsible.d.ts +6 -0
- package/dist/src/components/ui/collapsible.d.ts.map +1 -0
- package/dist/src/components/ui/collapsible.js +22 -0
- package/dist/src/components/ui/command.d.ts +19 -0
- package/dist/src/components/ui/command.d.ts.map +1 -0
- package/dist/src/components/ui/command.js +99 -0
- package/dist/src/components/ui/context-menu.d.ts +26 -0
- package/dist/src/components/ui/context-menu.d.ts.map +1 -0
- package/dist/src/components/ui/context-menu.js +141 -0
- package/dist/src/components/ui/dialog.d.ts +23 -0
- package/dist/src/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/components/ui/dialog.js +181 -0
- package/dist/src/components/ui/drawer.d.ts +14 -0
- package/dist/src/components/ui/drawer.d.ts.map +1 -0
- package/dist/src/components/ui/drawer.js +84 -0
- package/dist/src/components/ui/dropdown-menu.d.ts +26 -0
- package/dist/src/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/src/components/ui/dropdown-menu.js +142 -0
- package/dist/src/components/ui/form.d.ts +33 -0
- package/dist/src/components/ui/form.d.ts.map +1 -0
- package/dist/src/components/ui/form.js +142 -0
- package/dist/src/components/ui/header-content.d.ts +17 -0
- package/dist/src/components/ui/header-content.d.ts.map +1 -0
- package/dist/src/components/ui/header-content.js +30 -0
- package/dist/src/components/ui/hover-card.d.ts +7 -0
- package/dist/src/components/ui/hover-card.d.ts.map +1 -0
- package/dist/src/components/ui/hover-card.js +30 -0
- package/dist/src/components/ui/input-otp.d.ts +12 -0
- package/dist/src/components/ui/input-otp.d.ts.map +1 -0
- package/dist/src/components/ui/input-otp.js +49 -0
- package/dist/src/components/ui/input.d.ts +4 -0
- package/dist/src/components/ui/input.d.ts.map +1 -0
- package/dist/src/components/ui/input.js +12 -0
- package/dist/src/components/ui/label.d.ts +5 -0
- package/dist/src/components/ui/label.d.ts.map +1 -0
- package/dist/src/components/ui/label.js +13 -0
- package/dist/src/components/ui/loader.d.ts +5 -0
- package/dist/src/components/ui/loader.d.ts.map +1 -0
- package/dist/src/components/ui/loader.js +16 -0
- package/dist/src/components/ui/menubar.d.ts +27 -0
- package/dist/src/components/ui/menubar.d.ts.map +1 -0
- package/dist/src/components/ui/menubar.js +152 -0
- package/dist/src/components/ui/navigation-menu.d.ts +15 -0
- package/dist/src/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/src/components/ui/navigation-menu.js +83 -0
- package/dist/src/components/ui/popover.d.ts +8 -0
- package/dist/src/components/ui/popover.d.ts.map +1 -0
- package/dist/src/components/ui/popover.js +35 -0
- package/dist/src/components/ui/progress.d.ts +5 -0
- package/dist/src/components/ui/progress.d.ts.map +1 -0
- package/dist/src/components/ui/progress.js +20 -0
- package/dist/src/components/ui/radio-group.d.ts +6 -0
- package/dist/src/components/ui/radio-group.d.ts.map +1 -0
- package/dist/src/components/ui/radio-group.js +28 -0
- package/dist/src/components/ui/select.d.ts +16 -0
- package/dist/src/components/ui/select.d.ts.map +1 -0
- package/dist/src/components/ui/select.js +114 -0
- package/dist/src/components/ui/separator.d.ts +5 -0
- package/dist/src/components/ui/separator.d.ts.map +1 -0
- package/dist/src/components/ui/separator.js +15 -0
- package/dist/src/components/ui/sheet.d.ts +14 -0
- package/dist/src/components/ui/sheet.d.ts.map +1 -0
- package/dist/src/components/ui/sheet.js +93 -0
- package/dist/src/components/ui/sidebar.d.ts +70 -0
- package/dist/src/components/ui/sidebar.d.ts.map +1 -0
- package/dist/src/components/ui/sidebar.js +437 -0
- package/dist/src/components/ui/skeleton.d.ts +3 -0
- package/dist/src/components/ui/skeleton.d.ts.map +1 -0
- package/dist/src/components/ui/skeleton.js +10 -0
- package/dist/src/components/ui/slider.d.ts +5 -0
- package/dist/src/components/ui/slider.d.ts.map +1 -0
- package/dist/src/components/ui/slider.js +42 -0
- package/dist/src/components/ui/sonner.d.ts +4 -0
- package/dist/src/components/ui/sonner.d.ts.map +1 -0
- package/dist/src/components/ui/sonner.js +26 -0
- package/dist/src/components/ui/switch.d.ts +5 -0
- package/dist/src/components/ui/switch.d.ts.map +1 -0
- package/dist/src/components/ui/switch.js +17 -0
- package/dist/src/components/ui/table.d.ts +11 -0
- package/dist/src/components/ui/table.d.ts.map +1 -0
- package/dist/src/components/ui/table.js +64 -0
- package/dist/src/components/ui/tabs.d.ts +8 -0
- package/dist/src/components/ui/tabs.d.ts.map +1 -0
- package/dist/src/components/ui/tabs.js +34 -0
- package/dist/src/components/ui/textarea.d.ts +4 -0
- package/dist/src/components/ui/textarea.d.ts.map +1 -0
- package/dist/src/components/ui/textarea.js +11 -0
- package/dist/src/components/ui/toggle-group.d.ts +8 -0
- package/dist/src/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/src/components/ui/toggle-group.js +41 -0
- package/dist/src/components/ui/toggle.d.ts +10 -0
- package/dist/src/components/ui/toggle.d.ts.map +1 -0
- package/dist/src/components/ui/toggle.js +35 -0
- package/dist/src/components/ui/tooltip.d.ts +8 -0
- package/dist/src/components/ui/tooltip.d.ts.map +1 -0
- package/dist/src/components/ui/tooltip.js +43 -0
- package/dist/src/components/ui/unsaved-changes-dialog.d.ts +1 -0
- package/dist/src/components/ui/unsaved-changes-dialog.d.ts.map +1 -0
- package/dist/src/config.d.ts +5 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +4 -0
- package/dist/src/database/admins.d.ts +246 -0
- package/dist/src/database/admins.d.ts.map +1 -0
- package/dist/src/database/admins.js +74 -0
- package/dist/src/database/languages.d.ts +321 -0
- package/dist/src/database/languages.d.ts.map +1 -0
- package/dist/src/database/languages.js +52 -0
- package/dist/src/database/moderators.d.ts +114 -0
- package/dist/src/database/moderators.d.ts.map +1 -0
- package/dist/src/database/moderators.js +37 -0
- package/dist/src/database/roles.d.ts +146 -0
- package/dist/src/database/roles.d.ts.map +1 -0
- package/dist/src/database/roles.js +13 -0
- package/dist/src/database/sessions.d.ts +196 -0
- package/dist/src/database/sessions.d.ts.map +1 -0
- package/dist/src/database/sessions.js +57 -0
- package/dist/src/database/users.d.ts +562 -0
- package/dist/src/database/users.d.ts.map +1 -0
- package/dist/src/database/users.js +142 -0
- package/dist/src/drizzle.config.d.ts +6 -0
- package/dist/src/drizzle.config.d.ts.map +1 -0
- package/dist/src/drizzle.config.js +37 -0
- package/dist/src/hooks/use-before-unload-with-dialog.d.ts +1 -0
- package/dist/src/hooks/use-before-unload-with-dialog.d.ts.map +1 -0
- package/dist/src/hooks/use-before-unload.d.ts +2 -0
- package/dist/src/hooks/use-before-unload.d.ts.map +1 -0
- package/dist/src/hooks/use-before-unload.js +30 -0
- package/dist/src/hooks/use-mobile.d.ts +2 -0
- package/dist/src/hooks/use-mobile.d.ts.map +1 -0
- package/dist/src/hooks/use-mobile.js +15 -0
- package/dist/src/hooks/use-unsaved-changes.d.ts +1 -0
- package/dist/src/hooks/use-unsaved-changes.d.ts.map +1 -0
- package/dist/src/lib/api/get-middleware-api.d.ts +8 -0
- package/dist/src/lib/api/get-middleware-api.d.ts.map +1 -0
- package/dist/src/lib/api/get-middleware-api.js +13 -0
- package/dist/src/lib/api/get-session-admin-api.d.ts +16 -0
- package/dist/src/lib/api/get-session-admin-api.d.ts.map +1 -0
- package/dist/src/lib/api/get-session-admin-api.js +19 -0
- package/dist/src/lib/api/get-session-api.d.ts +17 -0
- package/dist/src/lib/api/get-session-api.d.ts.map +1 -0
- package/dist/src/lib/api/get-session-api.js +14 -0
- package/dist/src/lib/colors.d.ts +23 -0
- package/dist/src/lib/colors.d.ts.map +1 -0
- package/dist/src/lib/colors.js +131 -0
- package/dist/src/lib/colors.test.d.ts +2 -0
- package/dist/src/lib/colors.test.d.ts.map +1 -0
- package/dist/src/lib/colors.test.js +173 -0
- package/dist/src/lib/config.d.ts +6 -0
- package/dist/src/lib/config.d.ts.map +1 -0
- package/dist/src/lib/config.js +15 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.d.ts +10 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.d.ts.map +1 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.js +12 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.d.ts +2 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.d.ts.map +1 -0
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.js +78 -0
- package/dist/src/lib/fetcher/fetcher.d.ts +9 -0
- package/dist/src/lib/fetcher/fetcher.d.ts.map +1 -0
- package/dist/src/lib/fetcher/helpers.d.ts +3 -0
- package/dist/src/lib/fetcher/helpers.d.ts.map +1 -0
- package/dist/src/lib/fetcher/helpers.js +33 -0
- package/dist/src/lib/fetcher/helpers.test.d.ts +2 -0
- package/dist/src/lib/fetcher/helpers.test.d.ts.map +1 -0
- package/dist/src/lib/fetcher/helpers.test.js +37 -0
- package/dist/src/lib/fetcher/index.d.ts +34 -0
- package/dist/src/lib/fetcher/index.d.ts.map +1 -0
- package/dist/src/lib/fetcher/types.d.ts +120 -0
- package/dist/src/lib/fetcher/types.d.ts.map +1 -0
- package/dist/src/lib/fetcher/types.js +1 -0
- package/dist/src/lib/fetcher.d.ts +9 -0
- package/dist/src/lib/fetcher.d.ts.map +1 -0
- package/dist/src/lib/fetcher.js +47 -0
- package/dist/src/lib/helpers/auto-form.d.ts +10 -0
- package/dist/src/lib/helpers/auto-form.d.ts.map +1 -0
- package/dist/src/lib/helpers/auto-form.js +82 -0
- package/dist/src/lib/helpers/auto-form.test.d.ts +2 -0
- package/dist/src/lib/helpers/auto-form.test.d.ts.map +1 -0
- package/dist/src/lib/helpers/auto-form.test.js +126 -0
- package/dist/src/lib/navigation.d.ts +339 -0
- package/dist/src/lib/navigation.d.ts.map +1 -0
- package/dist/src/lib/navigation.js +11 -0
- package/dist/src/lib/plugin.d.ts +15 -0
- package/dist/src/lib/plugin.d.ts.map +1 -0
- package/dist/src/lib/plugin.js +3 -0
- package/dist/src/lib/special-characters.d.ts +3 -0
- package/dist/src/lib/special-characters.d.ts.map +1 -0
- package/dist/src/lib/special-characters.js +4 -0
- package/dist/src/lib/special-characters.test.d.ts +2 -0
- package/dist/src/lib/special-characters.test.d.ts.map +1 -0
- package/dist/src/lib/special-characters.test.js +56 -0
- package/dist/src/lib/utils.d.ts +3 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/lib/utils.js +5 -0
- package/dist/src/tests/setup.d.ts +2 -0
- package/dist/src/tests/setup.d.ts.map +1 -0
- package/dist/src/tests/setup.js +6 -0
- package/dist/src/views/admin/layouts/admin-layout.d.ts +8 -0
- package/dist/src/views/admin/layouts/admin-layout.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/admin-layout.js +70 -0
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts +11 -0
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/sidebar/nav/item.js +70 -0
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts +10 -0
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/sidebar/nav/nav.js +49 -0
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts +3 -0
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/sidebar/sidebar.js +30 -0
- package/dist/src/views/admin/layouts/sidebar/sign-out.d.ts +4 -0
- package/dist/src/views/admin/layouts/sidebar/sign-out.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/sidebar/sign-out.js +14 -0
- package/dist/src/views/admin/layouts/user-bar/client.d.ts +7 -0
- package/dist/src/views/admin/layouts/user-bar/client.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/user-bar/client.js +61 -0
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts +3 -0
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts.map +1 -0
- package/dist/src/views/admin/layouts/user-bar/user-bar.js +31 -0
- package/dist/src/views/admin/sign-in/sign-in-admin-view.d.ts +2 -0
- package/dist/src/views/admin/sign-in/sign-in-admin-view.d.ts.map +1 -0
- package/dist/src/views/admin/sign-in/sign-in-admin-view.js +26 -0
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.d.ts +2 -0
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +44 -0
- package/dist/src/views/admin/views/core/test.d.ts +2 -0
- package/dist/src/views/admin/views/core/test.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/test.js +146 -0
- package/dist/src/views/admin/views/core/users/users-admin-view.d.ts +4 -0
- package/dist/src/views/admin/views/core/users/users-admin-view.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/users/users-admin-view.js +90 -0
- package/dist/src/views/auth/components/password-input.d.ts +4 -0
- package/dist/src/views/auth/components/password-input.d.ts.map +1 -0
- package/dist/src/views/auth/components/password-input.js +89 -0
- package/dist/src/views/auth/sign-in/form/form.d.ts +4 -0
- package/dist/src/views/auth/sign-in/form/form.d.ts.map +1 -0
- package/dist/src/views/auth/sign-in/form/form.js +59 -0
- package/dist/src/views/auth/sign-in/form/hooks/mutation-api.d.ts +10 -0
- package/dist/src/views/auth/sign-in/form/hooks/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/sign-in/form/hooks/mutation-api.js +33 -0
- package/dist/src/views/auth/sign-in/form/hooks/use-form.d.ts +27 -0
- package/dist/src/views/auth/sign-in/form/hooks/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/sign-in/form/hooks/use-form.js +38 -0
- package/dist/src/views/auth/sign-in/sign-in-view.d.ts +2 -0
- package/dist/src/views/auth/sign-in/sign-in-view.d.ts.map +1 -0
- package/dist/src/views/auth/sign-in/sign-in-view.js +55 -0
- package/dist/src/views/auth/sign-up/form/form.d.ts +4 -0
- package/dist/src/views/auth/sign-up/form/form.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/form/form.js +88 -0
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.d.ts +6 -0
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.js +18 -0
- package/dist/src/views/auth/sign-up/form/hooks/use-form.d.ts +61 -0
- package/dist/src/views/auth/sign-up/form/hooks/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/form/hooks/use-form.js +57 -0
- package/dist/src/views/auth/sign-up/sign-up-view.d.ts +2 -0
- package/dist/src/views/auth/sign-up/sign-up-view.d.ts.map +1 -0
- package/dist/src/views/auth/sign-up/sign-up-view.js +61 -0
- package/dist/src/views/auth/sso/buttons/client.d.ts +5 -0
- package/dist/src/views/auth/sso/buttons/client.d.ts.map +1 -0
- package/dist/src/views/auth/sso/buttons/client.js +22 -0
- package/dist/src/views/auth/sso/buttons/mutation-api.d.ts +4 -0
- package/dist/src/views/auth/sso/buttons/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/sso/buttons/mutation-api.js +24 -0
- package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts +3 -0
- package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts.map +1 -0
- package/dist/src/views/auth/sso/buttons/sso-buttons.js +51 -0
- package/dist/src/views/auth/sso/callback/callback-sso-view.d.ts +5 -0
- package/dist/src/views/auth/sso/callback/callback-sso-view.d.ts.map +1 -0
- package/dist/src/views/auth/sso/callback/callback-sso-view.js +18 -0
- package/dist/src/views/auth/sso/callback/client/client.d.ts +6 -0
- package/dist/src/views/auth/sso/callback/client/client.d.ts.map +1 -0
- package/dist/src/views/auth/sso/callback/client/client.js +39 -0
- package/dist/src/views/auth/sso/callback/client/mutation-api.d.ts +8 -0
- package/dist/src/views/auth/sso/callback/client/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/sso/callback/client/mutation-api.js +27 -0
- package/dist/src/views/error/back-button.d.ts +5 -0
- package/dist/src/views/error/back-button.d.ts.map +1 -0
- package/dist/src/views/error/back-button.js +14 -0
- package/dist/src/views/error/error-view.d.ts +5 -0
- package/dist/src/views/error/error-view.d.ts.map +1 -0
- package/dist/src/views/error/error-view.js +56 -0
- package/dist/src/views/error/global-error-view.d.ts +6 -0
- package/dist/src/views/error/global-error-view.d.ts.map +1 -0
- package/dist/src/views/error/global-error-view.js +57 -0
- package/dist/src/views/layouts/provider.d.ts +11 -0
- package/dist/src/views/layouts/provider.d.ts.map +1 -0
- package/dist/src/views/layouts/provider.js +43 -0
- package/dist/src/views/layouts/root-layout.d.ts +16 -0
- package/dist/src/views/layouts/root-layout.d.ts.map +1 -0
- package/dist/src/views/layouts/root-layout.js +38 -0
- package/dist/src/views/layouts/theme/header/header.d.ts +4 -0
- package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/header/header.js +32 -0
- package/dist/src/views/layouts/theme/header/user/auth/auth.d.ts +2 -0
- package/dist/src/views/layouts/theme/header/user/auth/auth.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/header/user/auth/auth.js +33 -0
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts +5 -0
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/header/user/auth/client.js +47 -0
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.d.ts +4 -0
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.js +27 -0
- package/dist/src/views/layouts/theme/header/user/user.d.ts +2 -0
- package/dist/src/views/layouts/theme/header/user/user.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/header/user/user.js +34 -0
- package/dist/src/views/layouts/theme/layout.d.ts +5 -0
- package/dist/src/views/layouts/theme/layout.d.ts.map +1 -0
- package/dist/src/views/layouts/theme/layout.js +15 -0
- package/dist/src/vitnode.config.d.ts +50 -0
- package/dist/src/vitnode.config.d.ts.map +1 -0
- package/dist/src/vitnode.config.js +39 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/package.json +94 -0
- package/src/app/login/page.tsx +21 -0
- package/src/app/login/sso/[providerId]/page.tsx +19 -0
- package/src/app/register/page.tsx +21 -0
- package/src/app_admin/core/page.tsx +5 -0
- package/src/app_admin/core/test/page.tsx +5 -0
- package/src/app_admin/core/users/page.tsx +35 -0
- package/src/database/admins.ts +87 -0
- package/src/database/languages.ts +54 -0
- package/src/database/moderators.ts +42 -0
- package/src/database/roles.ts +15 -0
- package/src/database/sessions.ts +59 -0
- package/src/database/users.ts +142 -0
- package/src/locales/en.json +156 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
import { buildRoute } from "../../../../lib/route";
|
|
3
|
+
import { withPagination, zodPaginationPageInfo, zodPaginationQuery } from "../../../../lib/with-pagination";
|
|
4
|
+
import { CONFIG_PLUGIN } from "../../../../../config";
|
|
5
|
+
import { core_users } from "../../../../../database/users";
|
|
6
|
+
export const listUsersAdminRoute = buildRoute({
|
|
7
|
+
...CONFIG_PLUGIN,
|
|
8
|
+
route: {
|
|
9
|
+
method: 'get',
|
|
10
|
+
description: 'Get list of all users',
|
|
11
|
+
path: '/list',
|
|
12
|
+
request: {
|
|
13
|
+
query: zodPaginationQuery.extend({
|
|
14
|
+
order: z.enum([
|
|
15
|
+
'asc',
|
|
16
|
+
'desc'
|
|
17
|
+
]).optional(),
|
|
18
|
+
orderBy: z.enum([
|
|
19
|
+
'name',
|
|
20
|
+
'createdAt'
|
|
21
|
+
]).optional()
|
|
22
|
+
})
|
|
23
|
+
},
|
|
24
|
+
responses: {
|
|
25
|
+
200: {
|
|
26
|
+
content: {
|
|
27
|
+
'application/json': {
|
|
28
|
+
schema: z.object({
|
|
29
|
+
edges: z.array(z.object({
|
|
30
|
+
id: z.number(),
|
|
31
|
+
name: z.string(),
|
|
32
|
+
email: z.string(),
|
|
33
|
+
nameCode: z.string(),
|
|
34
|
+
createdAt: z.date(),
|
|
35
|
+
newsletter: z.boolean(),
|
|
36
|
+
avatarColor: z.string(),
|
|
37
|
+
emailVerified: z.boolean(),
|
|
38
|
+
roleId: z.number(),
|
|
39
|
+
birthday: z.date().nullable(),
|
|
40
|
+
language: z.string()
|
|
41
|
+
})),
|
|
42
|
+
pageInfo: zodPaginationPageInfo
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
description: 'List of users'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
handler: async (c)=>{
|
|
51
|
+
const query = c.req.valid('query');
|
|
52
|
+
const data = await withPagination({
|
|
53
|
+
params: {
|
|
54
|
+
query
|
|
55
|
+
},
|
|
56
|
+
primaryCursor: core_users.id,
|
|
57
|
+
query: async ({ limit, where, orderBy })=>await c.get('db').select({
|
|
58
|
+
id: core_users.id,
|
|
59
|
+
name: core_users.name,
|
|
60
|
+
email: core_users.email,
|
|
61
|
+
nameCode: core_users.nameCode,
|
|
62
|
+
createdAt: core_users.createdAt,
|
|
63
|
+
newsletter: core_users.newsletter,
|
|
64
|
+
avatarColor: core_users.avatarColor,
|
|
65
|
+
emailVerified: core_users.emailVerified,
|
|
66
|
+
roleId: core_users.roleId,
|
|
67
|
+
birthday: core_users.birthday,
|
|
68
|
+
language: core_users.language
|
|
69
|
+
}).from(core_users).where(where).orderBy(orderBy).limit(limit),
|
|
70
|
+
table: core_users,
|
|
71
|
+
orderBy: {
|
|
72
|
+
column: query.orderBy ? core_users[query.orderBy] : core_users.createdAt,
|
|
73
|
+
order: query.order ?? 'desc'
|
|
74
|
+
},
|
|
75
|
+
c
|
|
76
|
+
});
|
|
77
|
+
return c.json(data);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { z } from '@hono/zod-openapi';
|
|
2
|
+
export declare const usersAdminRoute: {
|
|
3
|
+
handler: (c: import("hono").Context<import("../../../../middlewares/global/global").EnvVitNode, "/list", {
|
|
4
|
+
in: {
|
|
5
|
+
query: {
|
|
6
|
+
orderBy?: "id" | "name" | "email" | "createdAt" | undefined;
|
|
7
|
+
cursor?: string | undefined;
|
|
8
|
+
order?: "asc" | "desc" | undefined;
|
|
9
|
+
first?: string | undefined;
|
|
10
|
+
last?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
out: {
|
|
14
|
+
query: {
|
|
15
|
+
orderBy?: "id" | "name" | "email" | "createdAt" | undefined;
|
|
16
|
+
cursor?: string | undefined;
|
|
17
|
+
order?: "asc" | "desc" | undefined;
|
|
18
|
+
first?: string | undefined;
|
|
19
|
+
last?: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}>) => Promise<Response & import("hono").TypedResponse<{
|
|
23
|
+
edges: {
|
|
24
|
+
id: number;
|
|
25
|
+
name: string;
|
|
26
|
+
email: string;
|
|
27
|
+
nameCode: string;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
newsletter: boolean;
|
|
30
|
+
avatarColor: string;
|
|
31
|
+
emailVerified: boolean;
|
|
32
|
+
roleId: number;
|
|
33
|
+
birthday: string | null;
|
|
34
|
+
language: string;
|
|
35
|
+
}[];
|
|
36
|
+
pageInfo: {
|
|
37
|
+
count: number;
|
|
38
|
+
endCursor: null | number;
|
|
39
|
+
hasNextPage: boolean;
|
|
40
|
+
hasPreviousPage: boolean;
|
|
41
|
+
startCursor: null | number;
|
|
42
|
+
totalCount: number;
|
|
43
|
+
};
|
|
44
|
+
}, 200 | 403, "json">>;
|
|
45
|
+
pluginId: "@vitnode/core";
|
|
46
|
+
route: {
|
|
47
|
+
method: "get";
|
|
48
|
+
description: string;
|
|
49
|
+
path: "/list";
|
|
50
|
+
request: {
|
|
51
|
+
query: z.ZodObject<{
|
|
52
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
53
|
+
first: z.ZodOptional<z.ZodString>;
|
|
54
|
+
last: z.ZodOptional<z.ZodString>;
|
|
55
|
+
} & {
|
|
56
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
57
|
+
orderBy: z.ZodOptional<z.ZodEnum<["id", "name", "email", "createdAt"]>>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
orderBy?: "id" | "name" | "email" | "createdAt" | undefined;
|
|
60
|
+
cursor?: string | undefined;
|
|
61
|
+
order?: "asc" | "desc" | undefined;
|
|
62
|
+
first?: string | undefined;
|
|
63
|
+
last?: string | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
orderBy?: "id" | "name" | "email" | "createdAt" | undefined;
|
|
66
|
+
cursor?: string | undefined;
|
|
67
|
+
order?: "asc" | "desc" | undefined;
|
|
68
|
+
first?: string | undefined;
|
|
69
|
+
last?: string | undefined;
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
72
|
+
responses: {
|
|
73
|
+
200: {
|
|
74
|
+
content: {
|
|
75
|
+
'application/json': {
|
|
76
|
+
schema: z.ZodObject<{
|
|
77
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
78
|
+
id: z.ZodNumber;
|
|
79
|
+
name: z.ZodString;
|
|
80
|
+
email: z.ZodString;
|
|
81
|
+
nameCode: z.ZodString;
|
|
82
|
+
createdAt: z.ZodDate;
|
|
83
|
+
newsletter: z.ZodBoolean;
|
|
84
|
+
avatarColor: z.ZodString;
|
|
85
|
+
emailVerified: z.ZodBoolean;
|
|
86
|
+
roleId: z.ZodNumber;
|
|
87
|
+
birthday: z.ZodNullable<z.ZodDate>;
|
|
88
|
+
language: z.ZodString;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
id: number;
|
|
91
|
+
name: string;
|
|
92
|
+
nameCode: string;
|
|
93
|
+
email: string;
|
|
94
|
+
createdAt: Date;
|
|
95
|
+
newsletter: boolean;
|
|
96
|
+
avatarColor: string;
|
|
97
|
+
emailVerified: boolean;
|
|
98
|
+
roleId: number;
|
|
99
|
+
birthday: Date | null;
|
|
100
|
+
language: string;
|
|
101
|
+
}, {
|
|
102
|
+
id: number;
|
|
103
|
+
name: string;
|
|
104
|
+
nameCode: string;
|
|
105
|
+
email: string;
|
|
106
|
+
createdAt: Date;
|
|
107
|
+
newsletter: boolean;
|
|
108
|
+
avatarColor: string;
|
|
109
|
+
emailVerified: boolean;
|
|
110
|
+
roleId: number;
|
|
111
|
+
birthday: Date | null;
|
|
112
|
+
language: string;
|
|
113
|
+
}>, "many">;
|
|
114
|
+
pageInfo: z.ZodObject<{
|
|
115
|
+
totalCount: z.ZodNumber;
|
|
116
|
+
count: z.ZodNumber;
|
|
117
|
+
hasNextPage: z.ZodBoolean;
|
|
118
|
+
hasPreviousPage: z.ZodBoolean;
|
|
119
|
+
startCursor: z.ZodNullable<z.ZodNumber>;
|
|
120
|
+
endCursor: z.ZodNullable<z.ZodNumber>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
count: number;
|
|
123
|
+
totalCount: number;
|
|
124
|
+
hasNextPage: boolean;
|
|
125
|
+
hasPreviousPage: boolean;
|
|
126
|
+
startCursor: number | null;
|
|
127
|
+
endCursor: number | null;
|
|
128
|
+
}, {
|
|
129
|
+
count: number;
|
|
130
|
+
totalCount: number;
|
|
131
|
+
hasNextPage: boolean;
|
|
132
|
+
hasPreviousPage: boolean;
|
|
133
|
+
startCursor: number | null;
|
|
134
|
+
endCursor: number | null;
|
|
135
|
+
}>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
edges: {
|
|
138
|
+
id: number;
|
|
139
|
+
name: string;
|
|
140
|
+
nameCode: string;
|
|
141
|
+
email: string;
|
|
142
|
+
createdAt: Date;
|
|
143
|
+
newsletter: boolean;
|
|
144
|
+
avatarColor: string;
|
|
145
|
+
emailVerified: boolean;
|
|
146
|
+
roleId: number;
|
|
147
|
+
birthday: Date | null;
|
|
148
|
+
language: string;
|
|
149
|
+
}[];
|
|
150
|
+
pageInfo: {
|
|
151
|
+
count: number;
|
|
152
|
+
totalCount: number;
|
|
153
|
+
hasNextPage: boolean;
|
|
154
|
+
hasPreviousPage: boolean;
|
|
155
|
+
startCursor: number | null;
|
|
156
|
+
endCursor: number | null;
|
|
157
|
+
};
|
|
158
|
+
}, {
|
|
159
|
+
edges: {
|
|
160
|
+
id: number;
|
|
161
|
+
name: string;
|
|
162
|
+
nameCode: string;
|
|
163
|
+
email: string;
|
|
164
|
+
createdAt: Date;
|
|
165
|
+
newsletter: boolean;
|
|
166
|
+
avatarColor: string;
|
|
167
|
+
emailVerified: boolean;
|
|
168
|
+
roleId: number;
|
|
169
|
+
birthday: Date | null;
|
|
170
|
+
language: string;
|
|
171
|
+
}[];
|
|
172
|
+
pageInfo: {
|
|
173
|
+
count: number;
|
|
174
|
+
totalCount: number;
|
|
175
|
+
hasNextPage: boolean;
|
|
176
|
+
hasPreviousPage: boolean;
|
|
177
|
+
startCursor: number | null;
|
|
178
|
+
endCursor: number | null;
|
|
179
|
+
};
|
|
180
|
+
}>;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
description: string;
|
|
184
|
+
};
|
|
185
|
+
403: {
|
|
186
|
+
description: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
} & {
|
|
190
|
+
getRoutingPath: () => "/list";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=users.route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.route.d.ts","sourceRoot":"","sources":["../../../../../../../src/api/modules/admin/users/routes/users.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAWtC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkF1B,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
import { buildRoute } from "../../../../lib/route";
|
|
3
|
+
import { withPagination, zodPaginationPageInfo, zodPaginationQuery } from "../../../../lib/with-pagination";
|
|
4
|
+
import { CONFIG_PLUGIN } from "../../../../../config";
|
|
5
|
+
import { core_users } from "../../../../../database/users";
|
|
6
|
+
export const usersAdminRoute = buildRoute({
|
|
7
|
+
...CONFIG_PLUGIN,
|
|
8
|
+
route: {
|
|
9
|
+
method: 'get',
|
|
10
|
+
description: 'Get list of all users (Admin only)',
|
|
11
|
+
path: '/list',
|
|
12
|
+
request: {
|
|
13
|
+
query: zodPaginationQuery.extend({
|
|
14
|
+
order: z.enum([
|
|
15
|
+
'asc',
|
|
16
|
+
'desc'
|
|
17
|
+
]).optional(),
|
|
18
|
+
orderBy: z.enum([
|
|
19
|
+
'id',
|
|
20
|
+
'name',
|
|
21
|
+
'email',
|
|
22
|
+
'createdAt'
|
|
23
|
+
]).optional()
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
responses: {
|
|
27
|
+
200: {
|
|
28
|
+
content: {
|
|
29
|
+
'application/json': {
|
|
30
|
+
schema: z.object({
|
|
31
|
+
edges: z.array(z.object({
|
|
32
|
+
id: z.number(),
|
|
33
|
+
name: z.string(),
|
|
34
|
+
email: z.string(),
|
|
35
|
+
nameCode: z.string(),
|
|
36
|
+
createdAt: z.date(),
|
|
37
|
+
newsletter: z.boolean(),
|
|
38
|
+
avatarColor: z.string(),
|
|
39
|
+
emailVerified: z.boolean(),
|
|
40
|
+
roleId: z.number(),
|
|
41
|
+
birthday: z.date().nullable(),
|
|
42
|
+
language: z.string()
|
|
43
|
+
})),
|
|
44
|
+
pageInfo: zodPaginationPageInfo
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
description: 'List of users'
|
|
49
|
+
},
|
|
50
|
+
403: {
|
|
51
|
+
description: 'Access Denied'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
handler: async (c)=>{
|
|
56
|
+
const query = c.req.valid('query');
|
|
57
|
+
const data = await withPagination({
|
|
58
|
+
params: {
|
|
59
|
+
query
|
|
60
|
+
},
|
|
61
|
+
primaryCursor: core_users.id,
|
|
62
|
+
query: async ({ limit, where, orderBy })=>await c.get('db').select({
|
|
63
|
+
id: core_users.id,
|
|
64
|
+
name: core_users.name,
|
|
65
|
+
email: core_users.email,
|
|
66
|
+
nameCode: core_users.nameCode,
|
|
67
|
+
createdAt: core_users.createdAt,
|
|
68
|
+
newsletter: core_users.newsletter,
|
|
69
|
+
avatarColor: core_users.avatarColor,
|
|
70
|
+
emailVerified: core_users.emailVerified,
|
|
71
|
+
roleId: core_users.roleId,
|
|
72
|
+
birthday: core_users.birthday,
|
|
73
|
+
language: core_users.language
|
|
74
|
+
}).from(core_users).where(where).orderBy(orderBy).limit(limit),
|
|
75
|
+
table: core_users,
|
|
76
|
+
orderBy: {
|
|
77
|
+
column: query.orderBy ? core_users[query.orderBy] : core_users.createdAt,
|
|
78
|
+
order: query.order ?? 'desc'
|
|
79
|
+
},
|
|
80
|
+
c
|
|
81
|
+
});
|
|
82
|
+
return c.json(data);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
export declare const usersAdminModule: import("../../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "users", [{
|
|
2
|
+
handler: (c: import("hono").Context<import("../../../middlewares/global/global").EnvVitNode, "/list", {
|
|
3
|
+
in: {
|
|
4
|
+
query: {
|
|
5
|
+
orderBy?: "name" | "createdAt" | undefined;
|
|
6
|
+
cursor?: string | undefined;
|
|
7
|
+
order?: "asc" | "desc" | undefined;
|
|
8
|
+
first?: string | undefined;
|
|
9
|
+
last?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
out: {
|
|
13
|
+
query: {
|
|
14
|
+
orderBy?: "name" | "createdAt" | undefined;
|
|
15
|
+
cursor?: string | undefined;
|
|
16
|
+
order?: "asc" | "desc" | undefined;
|
|
17
|
+
first?: string | undefined;
|
|
18
|
+
last?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}>) => Promise<Response & import("hono").TypedResponse<{
|
|
22
|
+
edges: {
|
|
23
|
+
id: number;
|
|
24
|
+
name: string;
|
|
25
|
+
email: string;
|
|
26
|
+
nameCode: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
newsletter: boolean;
|
|
29
|
+
avatarColor: string;
|
|
30
|
+
emailVerified: boolean;
|
|
31
|
+
roleId: number;
|
|
32
|
+
birthday: string | null;
|
|
33
|
+
language: string;
|
|
34
|
+
}[];
|
|
35
|
+
pageInfo: {
|
|
36
|
+
count: number;
|
|
37
|
+
endCursor: null | number;
|
|
38
|
+
hasNextPage: boolean;
|
|
39
|
+
hasPreviousPage: boolean;
|
|
40
|
+
startCursor: null | number;
|
|
41
|
+
totalCount: number;
|
|
42
|
+
};
|
|
43
|
+
}, 200, "json">>;
|
|
44
|
+
pluginId: "@vitnode/core";
|
|
45
|
+
route: {
|
|
46
|
+
method: "get";
|
|
47
|
+
description: string;
|
|
48
|
+
path: "/list";
|
|
49
|
+
request: {
|
|
50
|
+
query: import("zod").ZodObject<{
|
|
51
|
+
cursor: import("zod").ZodOptional<import("zod").ZodString>;
|
|
52
|
+
first: import("zod").ZodOptional<import("zod").ZodString>;
|
|
53
|
+
last: import("zod").ZodOptional<import("zod").ZodString>;
|
|
54
|
+
} & {
|
|
55
|
+
order: import("zod").ZodOptional<import("zod").ZodEnum<["asc", "desc"]>>;
|
|
56
|
+
orderBy: import("zod").ZodOptional<import("zod").ZodEnum<["name", "createdAt"]>>;
|
|
57
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
58
|
+
orderBy?: "name" | "createdAt" | undefined;
|
|
59
|
+
cursor?: string | undefined;
|
|
60
|
+
order?: "asc" | "desc" | undefined;
|
|
61
|
+
first?: string | undefined;
|
|
62
|
+
last?: string | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
orderBy?: "name" | "createdAt" | undefined;
|
|
65
|
+
cursor?: string | undefined;
|
|
66
|
+
order?: "asc" | "desc" | undefined;
|
|
67
|
+
first?: string | undefined;
|
|
68
|
+
last?: string | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
};
|
|
71
|
+
responses: {
|
|
72
|
+
200: {
|
|
73
|
+
content: {
|
|
74
|
+
'application/json': {
|
|
75
|
+
schema: import("zod").ZodObject<{
|
|
76
|
+
edges: import("zod").ZodArray<import("zod").ZodObject<{
|
|
77
|
+
id: import("zod").ZodNumber;
|
|
78
|
+
name: import("zod").ZodString;
|
|
79
|
+
email: import("zod").ZodString;
|
|
80
|
+
nameCode: import("zod").ZodString;
|
|
81
|
+
createdAt: import("zod").ZodDate;
|
|
82
|
+
newsletter: import("zod").ZodBoolean;
|
|
83
|
+
avatarColor: import("zod").ZodString;
|
|
84
|
+
emailVerified: import("zod").ZodBoolean;
|
|
85
|
+
roleId: import("zod").ZodNumber;
|
|
86
|
+
birthday: import("zod").ZodNullable<import("zod").ZodDate>;
|
|
87
|
+
language: import("zod").ZodString;
|
|
88
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
89
|
+
id: number;
|
|
90
|
+
name: string;
|
|
91
|
+
nameCode: string;
|
|
92
|
+
email: string;
|
|
93
|
+
createdAt: Date;
|
|
94
|
+
newsletter: boolean;
|
|
95
|
+
avatarColor: string;
|
|
96
|
+
emailVerified: boolean;
|
|
97
|
+
roleId: number;
|
|
98
|
+
birthday: Date | null;
|
|
99
|
+
language: string;
|
|
100
|
+
}, {
|
|
101
|
+
id: number;
|
|
102
|
+
name: string;
|
|
103
|
+
nameCode: string;
|
|
104
|
+
email: string;
|
|
105
|
+
createdAt: Date;
|
|
106
|
+
newsletter: boolean;
|
|
107
|
+
avatarColor: string;
|
|
108
|
+
emailVerified: boolean;
|
|
109
|
+
roleId: number;
|
|
110
|
+
birthday: Date | null;
|
|
111
|
+
language: string;
|
|
112
|
+
}>, "many">;
|
|
113
|
+
pageInfo: import("zod").ZodObject<{
|
|
114
|
+
totalCount: import("zod").ZodNumber;
|
|
115
|
+
count: import("zod").ZodNumber;
|
|
116
|
+
hasNextPage: import("zod").ZodBoolean;
|
|
117
|
+
hasPreviousPage: import("zod").ZodBoolean;
|
|
118
|
+
startCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
119
|
+
endCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
120
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
121
|
+
count: number;
|
|
122
|
+
totalCount: number;
|
|
123
|
+
hasNextPage: boolean;
|
|
124
|
+
hasPreviousPage: boolean;
|
|
125
|
+
startCursor: number | null;
|
|
126
|
+
endCursor: number | null;
|
|
127
|
+
}, {
|
|
128
|
+
count: number;
|
|
129
|
+
totalCount: number;
|
|
130
|
+
hasNextPage: boolean;
|
|
131
|
+
hasPreviousPage: boolean;
|
|
132
|
+
startCursor: number | null;
|
|
133
|
+
endCursor: number | null;
|
|
134
|
+
}>;
|
|
135
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
136
|
+
edges: {
|
|
137
|
+
id: number;
|
|
138
|
+
name: string;
|
|
139
|
+
nameCode: string;
|
|
140
|
+
email: string;
|
|
141
|
+
createdAt: Date;
|
|
142
|
+
newsletter: boolean;
|
|
143
|
+
avatarColor: string;
|
|
144
|
+
emailVerified: boolean;
|
|
145
|
+
roleId: number;
|
|
146
|
+
birthday: Date | null;
|
|
147
|
+
language: string;
|
|
148
|
+
}[];
|
|
149
|
+
pageInfo: {
|
|
150
|
+
count: number;
|
|
151
|
+
totalCount: number;
|
|
152
|
+
hasNextPage: boolean;
|
|
153
|
+
hasPreviousPage: boolean;
|
|
154
|
+
startCursor: number | null;
|
|
155
|
+
endCursor: number | null;
|
|
156
|
+
};
|
|
157
|
+
}, {
|
|
158
|
+
edges: {
|
|
159
|
+
id: number;
|
|
160
|
+
name: string;
|
|
161
|
+
nameCode: string;
|
|
162
|
+
email: string;
|
|
163
|
+
createdAt: Date;
|
|
164
|
+
newsletter: boolean;
|
|
165
|
+
avatarColor: string;
|
|
166
|
+
emailVerified: boolean;
|
|
167
|
+
roleId: number;
|
|
168
|
+
birthday: Date | null;
|
|
169
|
+
language: string;
|
|
170
|
+
}[];
|
|
171
|
+
pageInfo: {
|
|
172
|
+
count: number;
|
|
173
|
+
totalCount: number;
|
|
174
|
+
hasNextPage: boolean;
|
|
175
|
+
hasPreviousPage: boolean;
|
|
176
|
+
startCursor: number | null;
|
|
177
|
+
endCursor: number | null;
|
|
178
|
+
};
|
|
179
|
+
}>;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
description: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
} & {
|
|
186
|
+
getRoutingPath: () => "/list";
|
|
187
|
+
};
|
|
188
|
+
}], import("../../../../api/lib/module").BaseBuildModuleReturn<"@vitnode/core", string, import("../../../lib/route").Route<"@vitnode/core", import("@hono/zod-openapi").RouteConfig, import("@hono/zod-openapi").RouteHandler<import("@hono/zod-openapi").RouteConfig>>[]>[]>;
|
|
189
|
+
//# sourceMappingURL=users.admin.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.admin.module.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/admin/users/users.admin.module.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mQAI3B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { buildModule } from "../../../lib/module";
|
|
2
|
+
import { CONFIG_PLUGIN } from "../../../../config";
|
|
3
|
+
import { listUsersAdminRoute } from "./routes/list.route";
|
|
4
|
+
export const usersAdminModule = buildModule({
|
|
5
|
+
...CONFIG_PLUGIN,
|
|
6
|
+
name: 'users',
|
|
7
|
+
routes: [
|
|
8
|
+
listUsersAdminRoute
|
|
9
|
+
]
|
|
10
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const middlewareModule: import("../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "middleware", [{
|
|
2
|
+
handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/", {}>) => Response & import("hono").TypedResponse<{
|
|
3
|
+
isEmail: boolean;
|
|
4
|
+
sso: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}[];
|
|
8
|
+
}, 200, "json">;
|
|
9
|
+
pluginId: "@vitnode/core";
|
|
10
|
+
route: {
|
|
11
|
+
path: "/";
|
|
12
|
+
method: "get";
|
|
13
|
+
description: string;
|
|
14
|
+
responses: {
|
|
15
|
+
200: {
|
|
16
|
+
content: {
|
|
17
|
+
'application/json': {
|
|
18
|
+
schema: import("zod").ZodObject<{
|
|
19
|
+
sso: import("zod").ZodArray<import("zod").ZodObject<{
|
|
20
|
+
id: import("zod").ZodString;
|
|
21
|
+
name: import("zod").ZodString;
|
|
22
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
}, {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
}>, "many">;
|
|
29
|
+
isEmail: import("zod").ZodBoolean;
|
|
30
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
31
|
+
sso: {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}[];
|
|
35
|
+
isEmail: boolean;
|
|
36
|
+
}, {
|
|
37
|
+
sso: {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
}[];
|
|
41
|
+
isEmail: boolean;
|
|
42
|
+
}>;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
} & {
|
|
49
|
+
getRoutingPath: () => "/";
|
|
50
|
+
};
|
|
51
|
+
}], import("../../../api/lib/module").BaseBuildModuleReturn<"@vitnode/core", string, import("../../lib/route").Route<"@vitnode/core", import("@hono/zod-openapi").RouteConfig, import("@hono/zod-openapi").RouteHandler<import("@hono/zod-openapi").RouteConfig>>[]>[]>;
|
|
52
|
+
//# sourceMappingURL=middleware.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.module.d.ts","sourceRoot":"","sources":["../../../../../src/api/modules/middleware/middleware.module.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gQAI3B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { buildModule } from "../../lib/module";
|
|
2
|
+
import { CONFIG_PLUGIN } from "../../../config";
|
|
3
|
+
import { routeMiddleware } from "./route";
|
|
4
|
+
export const middlewareModule = buildModule({
|
|
5
|
+
...CONFIG_PLUGIN,
|
|
6
|
+
name: 'middleware',
|
|
7
|
+
routes: [
|
|
8
|
+
routeMiddleware
|
|
9
|
+
]
|
|
10
|
+
});
|