@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,439 @@
|
|
|
1
|
+
export declare const usersModule: import("../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "users", [{
|
|
2
|
+
handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/session", {}>) => Promise<Response & import("hono").TypedResponse<{
|
|
3
|
+
user: {
|
|
4
|
+
isAdmin: boolean;
|
|
5
|
+
avatarColor: string;
|
|
6
|
+
birthday: string | null;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
email: string;
|
|
9
|
+
emailVerified: boolean;
|
|
10
|
+
id: number;
|
|
11
|
+
name: string;
|
|
12
|
+
nameCode: string;
|
|
13
|
+
newsletter: boolean;
|
|
14
|
+
roleId: number;
|
|
15
|
+
} | null;
|
|
16
|
+
}, 200, "json">>;
|
|
17
|
+
pluginId: "@vitnode/core";
|
|
18
|
+
route: {
|
|
19
|
+
method: "get";
|
|
20
|
+
description: string;
|
|
21
|
+
path: "/session";
|
|
22
|
+
responses: {
|
|
23
|
+
200: {
|
|
24
|
+
content: {
|
|
25
|
+
'application/json': {
|
|
26
|
+
schema: import("zod").ZodObject<{
|
|
27
|
+
user: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
28
|
+
id: import("zod").ZodNumber;
|
|
29
|
+
email: import("zod").ZodString;
|
|
30
|
+
name: import("zod").ZodString;
|
|
31
|
+
nameCode: import("zod").ZodString;
|
|
32
|
+
createdAt: import("zod").ZodDate;
|
|
33
|
+
newsletter: import("zod").ZodBoolean;
|
|
34
|
+
avatarColor: import("zod").ZodString;
|
|
35
|
+
emailVerified: import("zod").ZodBoolean;
|
|
36
|
+
roleId: import("zod").ZodNumber;
|
|
37
|
+
birthday: import("zod").ZodNullable<import("zod").ZodDate>;
|
|
38
|
+
isAdmin: import("zod").ZodBoolean;
|
|
39
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
40
|
+
id: number;
|
|
41
|
+
name: string;
|
|
42
|
+
nameCode: string;
|
|
43
|
+
email: string;
|
|
44
|
+
createdAt: Date;
|
|
45
|
+
newsletter: boolean;
|
|
46
|
+
avatarColor: string;
|
|
47
|
+
emailVerified: boolean;
|
|
48
|
+
roleId: number;
|
|
49
|
+
birthday: Date | null;
|
|
50
|
+
isAdmin: boolean;
|
|
51
|
+
}, {
|
|
52
|
+
id: number;
|
|
53
|
+
name: string;
|
|
54
|
+
nameCode: string;
|
|
55
|
+
email: string;
|
|
56
|
+
createdAt: Date;
|
|
57
|
+
newsletter: boolean;
|
|
58
|
+
avatarColor: string;
|
|
59
|
+
emailVerified: boolean;
|
|
60
|
+
roleId: number;
|
|
61
|
+
birthday: Date | null;
|
|
62
|
+
isAdmin: boolean;
|
|
63
|
+
}>>;
|
|
64
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
65
|
+
user: {
|
|
66
|
+
id: number;
|
|
67
|
+
name: string;
|
|
68
|
+
nameCode: string;
|
|
69
|
+
email: string;
|
|
70
|
+
createdAt: Date;
|
|
71
|
+
newsletter: boolean;
|
|
72
|
+
avatarColor: string;
|
|
73
|
+
emailVerified: boolean;
|
|
74
|
+
roleId: number;
|
|
75
|
+
birthday: Date | null;
|
|
76
|
+
isAdmin: boolean;
|
|
77
|
+
} | null;
|
|
78
|
+
}, {
|
|
79
|
+
user: {
|
|
80
|
+
id: number;
|
|
81
|
+
name: string;
|
|
82
|
+
nameCode: string;
|
|
83
|
+
email: string;
|
|
84
|
+
createdAt: Date;
|
|
85
|
+
newsletter: boolean;
|
|
86
|
+
avatarColor: string;
|
|
87
|
+
emailVerified: boolean;
|
|
88
|
+
roleId: number;
|
|
89
|
+
birthday: Date | null;
|
|
90
|
+
isAdmin: boolean;
|
|
91
|
+
} | null;
|
|
92
|
+
}>;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
} & {
|
|
99
|
+
getRoutingPath: () => "/session";
|
|
100
|
+
};
|
|
101
|
+
}, {
|
|
102
|
+
handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/sign_in", {
|
|
103
|
+
in: {
|
|
104
|
+
json: {
|
|
105
|
+
email: string;
|
|
106
|
+
password: string;
|
|
107
|
+
isAdmin?: boolean | undefined;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
out: {
|
|
111
|
+
json: {
|
|
112
|
+
email: string;
|
|
113
|
+
password: string;
|
|
114
|
+
isAdmin?: boolean | undefined;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
}>) => Promise<Response & import("hono").TypedResponse<{
|
|
118
|
+
id: number;
|
|
119
|
+
token: string;
|
|
120
|
+
}, 201, "json">>;
|
|
121
|
+
pluginId: "@vitnode/core";
|
|
122
|
+
route: {
|
|
123
|
+
method: "post";
|
|
124
|
+
description: string;
|
|
125
|
+
path: "/sign_in";
|
|
126
|
+
request: {
|
|
127
|
+
body: {
|
|
128
|
+
required: true;
|
|
129
|
+
content: {
|
|
130
|
+
'application/json': {
|
|
131
|
+
schema: import("zod").ZodObject<{
|
|
132
|
+
email: import("zod").ZodString;
|
|
133
|
+
password: import("zod").ZodString;
|
|
134
|
+
isAdmin: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
135
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
136
|
+
email: string;
|
|
137
|
+
password: string;
|
|
138
|
+
isAdmin?: boolean | undefined;
|
|
139
|
+
}, {
|
|
140
|
+
email: string;
|
|
141
|
+
password: string;
|
|
142
|
+
isAdmin?: boolean | undefined;
|
|
143
|
+
}>;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
responses: {
|
|
149
|
+
403: {
|
|
150
|
+
description: string;
|
|
151
|
+
};
|
|
152
|
+
201: {
|
|
153
|
+
content: {
|
|
154
|
+
'application/json': {
|
|
155
|
+
schema: import("zod").ZodObject<{
|
|
156
|
+
id: import("zod").ZodNumber;
|
|
157
|
+
token: import("zod").ZodString;
|
|
158
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
159
|
+
id: number;
|
|
160
|
+
token: string;
|
|
161
|
+
}, {
|
|
162
|
+
id: number;
|
|
163
|
+
token: string;
|
|
164
|
+
}>;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
description: string;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
} & {
|
|
171
|
+
getRoutingPath: () => "/sign_in";
|
|
172
|
+
};
|
|
173
|
+
}, {
|
|
174
|
+
handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/sign_out", {
|
|
175
|
+
in: {
|
|
176
|
+
json: {
|
|
177
|
+
isAdmin?: boolean | undefined;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
out: {
|
|
181
|
+
json: {
|
|
182
|
+
isAdmin?: boolean | undefined;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
}>) => Promise<Response & import("hono").TypedResponse<{}, 200 | 403, "json">>;
|
|
186
|
+
pluginId: "@vitnode/core";
|
|
187
|
+
route: {
|
|
188
|
+
method: "delete";
|
|
189
|
+
description: string;
|
|
190
|
+
path: "/sign_out";
|
|
191
|
+
request: {
|
|
192
|
+
body: {
|
|
193
|
+
content: {
|
|
194
|
+
'application/json': {
|
|
195
|
+
schema: import("zod").ZodObject<{
|
|
196
|
+
isAdmin: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
197
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
198
|
+
isAdmin?: boolean | undefined;
|
|
199
|
+
}, {
|
|
200
|
+
isAdmin?: boolean | undefined;
|
|
201
|
+
}>;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
responses: {
|
|
207
|
+
200: {
|
|
208
|
+
description: string;
|
|
209
|
+
};
|
|
210
|
+
403: {
|
|
211
|
+
description: string;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
} & {
|
|
215
|
+
getRoutingPath: () => "/sign_out";
|
|
216
|
+
};
|
|
217
|
+
}, {
|
|
218
|
+
handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/sign_up", {
|
|
219
|
+
in: {
|
|
220
|
+
json: {
|
|
221
|
+
name: string;
|
|
222
|
+
email: string;
|
|
223
|
+
password: string;
|
|
224
|
+
newsletter?: boolean | undefined;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
out: {
|
|
228
|
+
json: {
|
|
229
|
+
name: string;
|
|
230
|
+
email: string;
|
|
231
|
+
password: string;
|
|
232
|
+
newsletter?: boolean | undefined;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
}>) => Promise<Response & import("hono").TypedResponse<{
|
|
236
|
+
id: number;
|
|
237
|
+
}, 200, "json">>;
|
|
238
|
+
pluginId: "@vitnode/core";
|
|
239
|
+
route: {
|
|
240
|
+
method: "post";
|
|
241
|
+
description: string;
|
|
242
|
+
path: "/sign_up";
|
|
243
|
+
request: {
|
|
244
|
+
body: {
|
|
245
|
+
required: true;
|
|
246
|
+
content: {
|
|
247
|
+
'application/json': {
|
|
248
|
+
schema: import("zod").ZodObject<{
|
|
249
|
+
email: import("zod").ZodString;
|
|
250
|
+
name: import("zod").ZodEffects<import("zod").ZodString, string, string>;
|
|
251
|
+
password: import("zod").ZodString;
|
|
252
|
+
newsletter: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
|
|
253
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
254
|
+
name: string;
|
|
255
|
+
email: string;
|
|
256
|
+
password: string;
|
|
257
|
+
newsletter?: boolean | undefined;
|
|
258
|
+
}, {
|
|
259
|
+
name: string;
|
|
260
|
+
email: string;
|
|
261
|
+
password: string;
|
|
262
|
+
newsletter?: boolean | undefined;
|
|
263
|
+
}>;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
responses: {
|
|
269
|
+
200: {
|
|
270
|
+
content: {
|
|
271
|
+
'application/json': {
|
|
272
|
+
schema: import("zod").ZodObject<{
|
|
273
|
+
id: import("zod").ZodNumber;
|
|
274
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
275
|
+
id: number;
|
|
276
|
+
}, {
|
|
277
|
+
id: number;
|
|
278
|
+
}>;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
description: string;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
} & {
|
|
285
|
+
getRoutingPath: () => "/sign_up";
|
|
286
|
+
};
|
|
287
|
+
}, {
|
|
288
|
+
handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/test", {}>) => Response & import("hono").TypedResponse<"test", 200 | 201, "text">;
|
|
289
|
+
pluginId: "@vitnode/core";
|
|
290
|
+
route: {
|
|
291
|
+
method: "get";
|
|
292
|
+
description: string;
|
|
293
|
+
path: "/test";
|
|
294
|
+
responses: {
|
|
295
|
+
200: {
|
|
296
|
+
content: {
|
|
297
|
+
'text/plain': {
|
|
298
|
+
schema: import("zod").ZodString;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
description: string;
|
|
302
|
+
};
|
|
303
|
+
201: {
|
|
304
|
+
content: {
|
|
305
|
+
'text/plain': {
|
|
306
|
+
schema: import("zod").ZodString;
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
description: string;
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
} & {
|
|
313
|
+
getRoutingPath: () => "/test";
|
|
314
|
+
};
|
|
315
|
+
}], import("../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "sso", [{
|
|
316
|
+
handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/:providerId/callback", {
|
|
317
|
+
in: {
|
|
318
|
+
param: {
|
|
319
|
+
providerId: string;
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
out: {
|
|
323
|
+
param: {
|
|
324
|
+
providerId: string;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
} & {
|
|
328
|
+
in: {
|
|
329
|
+
query: {
|
|
330
|
+
code: string;
|
|
331
|
+
state: string;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
out: {
|
|
335
|
+
query: {
|
|
336
|
+
code: string;
|
|
337
|
+
state: string;
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
}>) => Promise<Response & import("hono").TypedResponse<{
|
|
341
|
+
id: number;
|
|
342
|
+
token: string;
|
|
343
|
+
}, 200, "json">>;
|
|
344
|
+
pluginId: "@vitnode/core";
|
|
345
|
+
route: {
|
|
346
|
+
method: "get";
|
|
347
|
+
description: string;
|
|
348
|
+
path: "/{providerId}/callback";
|
|
349
|
+
request: {
|
|
350
|
+
params: import("zod").ZodObject<{
|
|
351
|
+
providerId: import("zod").ZodString;
|
|
352
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
353
|
+
providerId: string;
|
|
354
|
+
}, {
|
|
355
|
+
providerId: string;
|
|
356
|
+
}>;
|
|
357
|
+
query: import("zod").ZodObject<{
|
|
358
|
+
code: import("zod").ZodString;
|
|
359
|
+
state: import("zod").ZodString;
|
|
360
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
361
|
+
code: string;
|
|
362
|
+
state: string;
|
|
363
|
+
}, {
|
|
364
|
+
code: string;
|
|
365
|
+
state: string;
|
|
366
|
+
}>;
|
|
367
|
+
};
|
|
368
|
+
responses: {
|
|
369
|
+
200: {
|
|
370
|
+
content: {
|
|
371
|
+
'application/json': {
|
|
372
|
+
schema: import("zod").ZodObject<{
|
|
373
|
+
id: import("zod").ZodNumber;
|
|
374
|
+
token: import("zod").ZodString;
|
|
375
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
376
|
+
id: number;
|
|
377
|
+
token: string;
|
|
378
|
+
}, {
|
|
379
|
+
id: number;
|
|
380
|
+
token: string;
|
|
381
|
+
}>;
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
description: string;
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
} & {
|
|
388
|
+
getRoutingPath: () => "/:providerId/callback";
|
|
389
|
+
};
|
|
390
|
+
}, {
|
|
391
|
+
handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/:providerId", {
|
|
392
|
+
in: {
|
|
393
|
+
param: {
|
|
394
|
+
providerId: string;
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
out: {
|
|
398
|
+
param: {
|
|
399
|
+
providerId: string;
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
}>) => Promise<Response & import("hono").TypedResponse<{
|
|
403
|
+
url: string;
|
|
404
|
+
}, 200, "json">>;
|
|
405
|
+
pluginId: "@vitnode/core";
|
|
406
|
+
route: {
|
|
407
|
+
method: "post";
|
|
408
|
+
description: string;
|
|
409
|
+
path: "/{providerId}";
|
|
410
|
+
request: {
|
|
411
|
+
params: import("zod").ZodObject<{
|
|
412
|
+
providerId: import("zod").ZodString;
|
|
413
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
414
|
+
providerId: string;
|
|
415
|
+
}, {
|
|
416
|
+
providerId: string;
|
|
417
|
+
}>;
|
|
418
|
+
};
|
|
419
|
+
responses: {
|
|
420
|
+
200: {
|
|
421
|
+
content: {
|
|
422
|
+
'application/json': {
|
|
423
|
+
schema: import("zod").ZodObject<{
|
|
424
|
+
url: import("zod").ZodString;
|
|
425
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
426
|
+
url: string;
|
|
427
|
+
}, {
|
|
428
|
+
url: string;
|
|
429
|
+
}>;
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
description: string;
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
} & {
|
|
436
|
+
getRoutingPath: () => "/:providerId";
|
|
437
|
+
};
|
|
438
|
+
}], 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>>[]>[]>[]>;
|
|
439
|
+
//# sourceMappingURL=users.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.module.d.ts","sourceRoot":"","sources":["../../../../../src/api/modules/users/users.module.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mQAKtB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { buildModule } from "../../lib/module";
|
|
2
|
+
import { CONFIG_PLUGIN } from "../../../config";
|
|
3
|
+
import { sessionRoute } from "./routes/session.route";
|
|
4
|
+
import { signInRoute } from "./routes/sign-in.route";
|
|
5
|
+
import { signOutRoute } from "./routes/sign-out.route";
|
|
6
|
+
import { signUpRoute } from "./routes/sign-up.route";
|
|
7
|
+
import { testRoute } from "./routes/test.route";
|
|
8
|
+
import { ssoUserModule } from "./sso/sso.module";
|
|
9
|
+
export const usersModule = buildModule({
|
|
10
|
+
...CONFIG_PLUGIN,
|
|
11
|
+
name: 'users',
|
|
12
|
+
routes: [
|
|
13
|
+
sessionRoute,
|
|
14
|
+
signInRoute,
|
|
15
|
+
signOutRoute,
|
|
16
|
+
signUpRoute,
|
|
17
|
+
testRoute
|
|
18
|
+
],
|
|
19
|
+
modules: [
|
|
20
|
+
ssoUserModule
|
|
21
|
+
]
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/api/plugin.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,qBAAqB,6CAGhC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CONFIG_PLUGIN } from "../config";
|
|
2
|
+
import { buildApiPlugin } from "./lib/plugin";
|
|
3
|
+
import { adminModule } from "./modules/admin/admin.module";
|
|
4
|
+
import { middlewareModule } from "./modules/middleware/middleware.module";
|
|
5
|
+
import { usersModule } from "./modules/users/users.module";
|
|
6
|
+
export const newBuildPluginApiCore = buildApiPlugin({
|
|
7
|
+
...CONFIG_PLUGIN,
|
|
8
|
+
modules: [
|
|
9
|
+
middlewareModule,
|
|
10
|
+
usersModule,
|
|
11
|
+
adminModule
|
|
12
|
+
]
|
|
13
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EmailApiPlugin } from '../../../api/models/email';
|
|
2
|
+
export declare const NodemailerEmailPlugin: ({ host, port, secure, user, password, from, }: {
|
|
3
|
+
from: string | undefined;
|
|
4
|
+
host: string | undefined;
|
|
5
|
+
password: string | undefined;
|
|
6
|
+
port?: number;
|
|
7
|
+
secure?: boolean;
|
|
8
|
+
user: string | undefined;
|
|
9
|
+
}) => EmailApiPlugin;
|
|
10
|
+
//# sourceMappingURL=nodemailer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodemailer.d.ts","sourceRoot":"","sources":["../../../../../src/api/plugins/email/nodemailer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,qBAAqB,GAAI,+CAOnC;IACD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B,KAAG,cAiCH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createTransport } from "nodemailer";
|
|
2
|
+
export const NodemailerEmailPlugin = ({ host = '', port = 587, secure = false, user = '', password = '', from = '' })=>{
|
|
3
|
+
return {
|
|
4
|
+
sendEmail: async ({ metadata, to, subject, html, replyTo })=>{
|
|
5
|
+
if (!host || !user || !password || !from) {
|
|
6
|
+
throw new Error('Missing nodemailer configuration');
|
|
7
|
+
}
|
|
8
|
+
const transporter = createTransport({
|
|
9
|
+
host,
|
|
10
|
+
port,
|
|
11
|
+
secure,
|
|
12
|
+
auth: {
|
|
13
|
+
user,
|
|
14
|
+
pass: password
|
|
15
|
+
}
|
|
16
|
+
}, {
|
|
17
|
+
from: {
|
|
18
|
+
name: metadata.shortTitle ?? metadata.title,
|
|
19
|
+
address: from
|
|
20
|
+
},
|
|
21
|
+
replyTo
|
|
22
|
+
});
|
|
23
|
+
await transporter.sendMail({
|
|
24
|
+
to,
|
|
25
|
+
subject,
|
|
26
|
+
html
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resend.d.ts","sourceRoot":"","sources":["../../../../../src/api/plugins/email/resend.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,iBAAiB,GAAI,mBAG/B;IACD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B,KAAG,cAqBH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Resend } from "resend";
|
|
2
|
+
export const ResendEmailPlugin = ({ apiKey, from })=>{
|
|
3
|
+
return {
|
|
4
|
+
sendEmail: async ({ to, subject, replyTo, metadata, html })=>{
|
|
5
|
+
if (!apiKey || !from) {
|
|
6
|
+
throw new Error('Missing Resend configuration');
|
|
7
|
+
}
|
|
8
|
+
const resend = new Resend(apiKey);
|
|
9
|
+
const { error } = await resend.emails.send({
|
|
10
|
+
from: `${metadata.shortTitle ?? metadata.title} <${from}>`,
|
|
11
|
+
to,
|
|
12
|
+
subject,
|
|
13
|
+
replyTo,
|
|
14
|
+
html
|
|
15
|
+
});
|
|
16
|
+
if (error) {
|
|
17
|
+
throw new Error(`[${error.name}]: ${error.message}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discord.d.ts","sourceRoot":"","sources":["../../../../../src/api/plugins/sso/discord.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIrD,eAAO,MAAM,mBAAmB,GAAI,6BAGjC;IACD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,KAAG,YAoFH,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { HTTPException } from "hono/http-exception";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { getRedirectUri } from "../../models/sso";
|
|
4
|
+
export const DiscordSSOApiPlugin = ({ clientId = '', clientSecret = '' })=>{
|
|
5
|
+
const id = 'discord';
|
|
6
|
+
const redirectUri = getRedirectUri(id);
|
|
7
|
+
const userSchema = z.object({
|
|
8
|
+
id: z.string(),
|
|
9
|
+
email: z.string(),
|
|
10
|
+
username: z.string()
|
|
11
|
+
});
|
|
12
|
+
const tokenSchema = z.object({
|
|
13
|
+
access_token: z.string(),
|
|
14
|
+
token_type: z.string()
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
fetchToken: async (code)=>{
|
|
18
|
+
if (!clientId || !clientSecret) {
|
|
19
|
+
throw new Error('Missing Discord client ID or secret');
|
|
20
|
+
}
|
|
21
|
+
const res = await fetch('https://discord.com/api/oauth2/token', {
|
|
22
|
+
method: 'POST',
|
|
23
|
+
headers: {
|
|
24
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
25
|
+
Accept: 'application/json'
|
|
26
|
+
},
|
|
27
|
+
body: new URLSearchParams({
|
|
28
|
+
code,
|
|
29
|
+
redirect_uri: redirectUri,
|
|
30
|
+
grant_type: 'authorization_code',
|
|
31
|
+
client_id: clientId,
|
|
32
|
+
client_secret: clientSecret
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
if (!res.ok) {
|
|
36
|
+
throw new HTTPException(+res.status.toString(), {
|
|
37
|
+
message: 'Internal error requesting token'
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const { data, error } = tokenSchema.safeParse(await res.json());
|
|
41
|
+
if (error || !data) {
|
|
42
|
+
throw new HTTPException(400, {
|
|
43
|
+
message: 'Invalid token response'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return data;
|
|
47
|
+
},
|
|
48
|
+
fetchUser: async ({ token_type, access_token })=>{
|
|
49
|
+
const res = await fetch('https://discord.com/api/users/@me', {
|
|
50
|
+
headers: {
|
|
51
|
+
Authorization: `${token_type} ${access_token}`
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const { data, error } = userSchema.safeParse(await res.json());
|
|
55
|
+
if (error || !data) {
|
|
56
|
+
throw new HTTPException(400, {
|
|
57
|
+
message: 'Invalid user response'
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return data;
|
|
61
|
+
},
|
|
62
|
+
getUrl: ({ state })=>{
|
|
63
|
+
if (!clientId) {
|
|
64
|
+
throw new Error('Missing Discord client ID');
|
|
65
|
+
}
|
|
66
|
+
const url = new URL('https://discord.com/oauth2/authorize');
|
|
67
|
+
url.searchParams.set('client_id', clientId);
|
|
68
|
+
url.searchParams.set('redirect_uri', redirectUri);
|
|
69
|
+
url.searchParams.set('response_type', 'code');
|
|
70
|
+
url.searchParams.set('scope', 'identify email');
|
|
71
|
+
url.searchParams.set('state', state);
|
|
72
|
+
return url.toString();
|
|
73
|
+
},
|
|
74
|
+
id,
|
|
75
|
+
name: 'Discord'
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"facebook.d.ts","sourceRoot":"","sources":["../../../../../src/api/plugins/sso/facebook.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIrD,eAAO,MAAM,oBAAoB,GAAI,6BAGlC;IACD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,KAAG,YAwFH,CAAC"}
|