@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,73 @@
|
|
|
1
|
+
import { and, eq, gt, or } from "drizzle-orm";
|
|
2
|
+
import { deleteCookie, getCookie, setCookie } from "hono/cookie";
|
|
3
|
+
import { HTTPException } from "hono/http-exception";
|
|
4
|
+
import { core_admin_permissions, core_admin_sessions } from "../../database/admins";
|
|
5
|
+
import { CONFIG } from "../../lib/config";
|
|
6
|
+
import { UserModel } from "./user";
|
|
7
|
+
export class SessionAdminModel {
|
|
8
|
+
constructor(c){
|
|
9
|
+
this.c = c;
|
|
10
|
+
}
|
|
11
|
+
c;
|
|
12
|
+
async checkIfUserIsAdmin(userId) {
|
|
13
|
+
const user = await new UserModel().getUserById({
|
|
14
|
+
id: userId,
|
|
15
|
+
c: this.c
|
|
16
|
+
});
|
|
17
|
+
if (!user) return false;
|
|
18
|
+
const [permission] = await this.c.get('db').select().from(core_admin_permissions).where(or(eq(core_admin_permissions.userId, user.id), eq(core_admin_permissions.roleId, user.roleId))).limit(1);
|
|
19
|
+
return !!permission;
|
|
20
|
+
}
|
|
21
|
+
async createSessionByUserId(userId) {
|
|
22
|
+
const isAdmin = await this.checkIfUserIsAdmin(userId);
|
|
23
|
+
if (!isAdmin) throw new HTTPException(403);
|
|
24
|
+
// Generate secure random bytes using Web Crypto API
|
|
25
|
+
const randomBytes = new Uint8Array(64);
|
|
26
|
+
crypto.getRandomValues(randomBytes);
|
|
27
|
+
const token = Array.from(randomBytes).map((b)=>b.toString(16).padStart(2, '0')).join('');
|
|
28
|
+
const deviceId = this.c.get('deviceId');
|
|
29
|
+
await this.c.get('db').insert(core_admin_sessions).values({
|
|
30
|
+
token,
|
|
31
|
+
userId,
|
|
32
|
+
expiresAt: new Date(Date.now() + this.c.get('core').authorization.adminCookieExpires),
|
|
33
|
+
deviceId
|
|
34
|
+
});
|
|
35
|
+
setCookie(this.c, this.c.get('core').authorization.adminCookieName, token, {
|
|
36
|
+
httpOnly: true,
|
|
37
|
+
secure: this.c.get('core').authorization.cookieSecure,
|
|
38
|
+
path: '/admin',
|
|
39
|
+
expires: new Date(Date.now() + this.c.get('core').authorization.adminCookieExpires),
|
|
40
|
+
domain: CONFIG.frontend.hostname
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
token,
|
|
44
|
+
deviceId
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async deleteSession() {
|
|
48
|
+
const token = getCookie(this.c, this.c.get('core').authorization.adminCookieName);
|
|
49
|
+
if (!token) return;
|
|
50
|
+
await this.c.get('db').delete(core_admin_sessions).where(eq(core_admin_sessions.token, token));
|
|
51
|
+
deleteCookie(this.c, this.c.get('core').authorization.adminCookieName, {
|
|
52
|
+
path: '/admin'
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async getUser() {
|
|
56
|
+
const { authorization } = this.c.get('core');
|
|
57
|
+
const token = getCookie(this.c, authorization.adminCookieName);
|
|
58
|
+
if (!token) return null;
|
|
59
|
+
const deviceId = this.c.get('deviceId');
|
|
60
|
+
if (!deviceId) return null;
|
|
61
|
+
const [session] = await this.c.get('db').select({
|
|
62
|
+
token: core_admin_sessions.token,
|
|
63
|
+
userId: core_admin_sessions.userId
|
|
64
|
+
}).from(core_admin_sessions).where(and(eq(core_admin_sessions.token, token), eq(core_admin_sessions.deviceId, deviceId), gt(core_admin_sessions.expiresAt, new Date()))).limit(1);
|
|
65
|
+
if (!session) return null;
|
|
66
|
+
const user = await new UserModel().getUserById({
|
|
67
|
+
id: session.userId,
|
|
68
|
+
c: this.c
|
|
69
|
+
});
|
|
70
|
+
if (!user) return null;
|
|
71
|
+
return user;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
2
|
+
export declare class SessionModel {
|
|
3
|
+
constructor(c: Context);
|
|
4
|
+
protected readonly c: Context;
|
|
5
|
+
createSessionByUserId(userId: number): Promise<{
|
|
6
|
+
token: string;
|
|
7
|
+
deviceId: number;
|
|
8
|
+
}>;
|
|
9
|
+
deleteSession(): Promise<void>;
|
|
10
|
+
getUser(): Promise<{
|
|
11
|
+
id: number;
|
|
12
|
+
email: string;
|
|
13
|
+
name: string;
|
|
14
|
+
nameCode: string;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
newsletter: boolean;
|
|
17
|
+
avatarColor: string;
|
|
18
|
+
emailVerified: boolean;
|
|
19
|
+
roleId: number;
|
|
20
|
+
birthday: Date | null;
|
|
21
|
+
} | null>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/api/models/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAUpC,qBAAa,YAAY;gBACX,CAAC,EAAE,OAAO;IAGtB,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;IAExB,qBAAqB,CAAC,MAAM,EAAE,MAAM;;;;IAqCpC,aAAa;IAcb,OAAO;;;;;;;;;;;;CAoCd"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { and, eq, gt } from "drizzle-orm";
|
|
2
|
+
import { deleteCookie, getCookie, setCookie } from "hono/cookie";
|
|
3
|
+
import { core_sessions } from "../../database/sessions";
|
|
4
|
+
import { CONFIG } from "../../lib/config";
|
|
5
|
+
import { UserModel } from "./user";
|
|
6
|
+
export class SessionModel {
|
|
7
|
+
constructor(c){
|
|
8
|
+
this.c = c;
|
|
9
|
+
}
|
|
10
|
+
c;
|
|
11
|
+
async createSessionByUserId(userId) {
|
|
12
|
+
// Generate secure random bytes using Web Crypto API
|
|
13
|
+
const randomBytes = new Uint8Array(64);
|
|
14
|
+
crypto.getRandomValues(randomBytes);
|
|
15
|
+
const token = Array.from(randomBytes).map((b)=>b.toString(16).padStart(2, '0')).join('');
|
|
16
|
+
const deviceId = this.c.get('deviceId');
|
|
17
|
+
await this.c.get('db').insert(core_sessions).values({
|
|
18
|
+
token,
|
|
19
|
+
userId,
|
|
20
|
+
expiresAt: new Date(Date.now() + this.c.get('core').authorization.cookie_expires),
|
|
21
|
+
deviceId
|
|
22
|
+
});
|
|
23
|
+
setCookie(this.c, this.c.get('core').authorization.cookieName, token, {
|
|
24
|
+
httpOnly: true,
|
|
25
|
+
secure: this.c.get('core').authorization.cookieSecure,
|
|
26
|
+
path: '/',
|
|
27
|
+
expires: this.c.get('core').authorization.cookie_expires > 0 ? new Date(Date.now() + this.c.get('core').authorization.cookie_expires) : undefined,
|
|
28
|
+
domain: CONFIG.frontend.hostname
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
token,
|
|
32
|
+
deviceId
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async deleteSession() {
|
|
36
|
+
const token = getCookie(this.c, this.c.get('core').authorization.cookieName);
|
|
37
|
+
if (!token) return;
|
|
38
|
+
await this.c.get('db').delete(core_sessions).where(eq(core_sessions.token, token));
|
|
39
|
+
deleteCookie(this.c, this.c.get('core').authorization.cookieName);
|
|
40
|
+
}
|
|
41
|
+
async getUser() {
|
|
42
|
+
const token = getCookie(this.c, this.c.get('core').authorization.cookieName);
|
|
43
|
+
if (!token) return null;
|
|
44
|
+
const deviceId = this.c.get('deviceId');
|
|
45
|
+
if (!deviceId) return null;
|
|
46
|
+
const [session] = await this.c.get('db').select({
|
|
47
|
+
token: core_sessions.token,
|
|
48
|
+
userId: core_sessions.userId
|
|
49
|
+
}).from(core_sessions).where(and(eq(core_sessions.token, token), eq(core_sessions.deviceId, deviceId), gt(core_sessions.expiresAt, new Date()))).limit(1);
|
|
50
|
+
if (!session || session.token !== token) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const user = await new UserModel().getUserById({
|
|
54
|
+
id: session.userId,
|
|
55
|
+
c: this.c
|
|
56
|
+
});
|
|
57
|
+
if (!user) return null;
|
|
58
|
+
return user;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
2
|
+
export interface SSOApiPlugin {
|
|
3
|
+
fetchToken: (code: string) => Promise<{
|
|
4
|
+
access_token: string;
|
|
5
|
+
token_type: string;
|
|
6
|
+
}>;
|
|
7
|
+
fetchUser: (args: {
|
|
8
|
+
access_token: string;
|
|
9
|
+
token_type: string;
|
|
10
|
+
}) => Promise<{
|
|
11
|
+
email: string;
|
|
12
|
+
id: string;
|
|
13
|
+
username: string;
|
|
14
|
+
}>;
|
|
15
|
+
getUrl: (props: {
|
|
16
|
+
state: string;
|
|
17
|
+
}) => string;
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const getRedirectUri: (code: string) => string;
|
|
22
|
+
export declare class SSOModel {
|
|
23
|
+
constructor(c: Context);
|
|
24
|
+
private readonly c;
|
|
25
|
+
private readonly plugins;
|
|
26
|
+
private readonly signUpUser;
|
|
27
|
+
callback({ code, providerId, state, }: {
|
|
28
|
+
code: string;
|
|
29
|
+
providerId: string;
|
|
30
|
+
state: string;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
userId: number;
|
|
33
|
+
}>;
|
|
34
|
+
encryptState(): Promise<string>;
|
|
35
|
+
getUrl(providerId: string): Promise<string>;
|
|
36
|
+
verifyState(state: string): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=sso.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sso.d.ts","sourceRoot":"","sources":["../../../../src/api/models/sso.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAapC,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,CACV,IAAI,EAAE,MAAM,KACT,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,SAAS,EAAE,CAAC,IAAI,EAAE;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,KAAK,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,MAAM,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,WACqB,CAAC;AAEjE,qBAAa,QAAQ;gBACP,CAAC,EAAE,OAAO;IAKtB,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAU;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IAEzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CA6BzB;IAEI,QAAQ,CAAC,EACb,IAAI,EACJ,UAAU,EACV,KAAK,GACN,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC;QACV,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IA+DI,YAAY;IA2BZ,MAAM,CAAC,UAAU,EAAE,MAAM;IASzB,WAAW,CAAC,KAAK,EAAE,MAAM;CA+BhC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
import { and, eq } from "drizzle-orm";
|
|
3
|
+
import { deleteCookie, getCookie, setCookie } from "hono/cookie";
|
|
4
|
+
import { HTTPException } from "hono/http-exception";
|
|
5
|
+
import { core_users, core_users_sso } from "../../database/users";
|
|
6
|
+
import { CONFIG } from "../../lib/config";
|
|
7
|
+
import { removeSpecialCharacters } from "../../lib/special-characters";
|
|
8
|
+
import { UserModel } from "./user";
|
|
9
|
+
export const getRedirectUri = (code)=>new URL(`${CONFIG.frontend.href}login/sso/${code}`).toString();
|
|
10
|
+
export class SSOModel {
|
|
11
|
+
constructor(c){
|
|
12
|
+
this.c = c;
|
|
13
|
+
this.plugins = c.get('core').authorization.ssoPlugins;
|
|
14
|
+
}
|
|
15
|
+
c;
|
|
16
|
+
plugins;
|
|
17
|
+
signUpUser = async ({ providerId, user, c })=>{
|
|
18
|
+
const data = await new UserModel().signUp({
|
|
19
|
+
email: user.email,
|
|
20
|
+
name: removeSpecialCharacters(user.username, false),
|
|
21
|
+
newsletter: false,
|
|
22
|
+
hashedPassword: undefined
|
|
23
|
+
}, c);
|
|
24
|
+
await c.get('db').insert(core_users_sso).values({
|
|
25
|
+
userId: data.id,
|
|
26
|
+
providerId: providerId,
|
|
27
|
+
providerAccountId: user.id
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
userId: data.id
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
async callback({ code, providerId, state }) {
|
|
34
|
+
await this.verifyState(state);
|
|
35
|
+
const provider = this.plugins.find((p)=>p.id === providerId);
|
|
36
|
+
if (!provider) {
|
|
37
|
+
throw new HTTPException(404);
|
|
38
|
+
}
|
|
39
|
+
const ssoToken = await provider.fetchToken(code);
|
|
40
|
+
const userFromSSO = await provider.fetchUser(ssoToken);
|
|
41
|
+
return await this.c.get('db').transaction(async (tx)=>{
|
|
42
|
+
const [dataSSOFromDb] = await tx.select({
|
|
43
|
+
userId: core_users_sso.userId
|
|
44
|
+
}).from(core_users_sso).leftJoin(core_users, eq(core_users.id, core_users_sso.userId)).where(and(eq(core_users_sso.providerId, providerId), eq(core_users_sso.providerAccountId, userFromSSO.id))).limit(1);
|
|
45
|
+
if (!dataSSOFromDb) {
|
|
46
|
+
const [userWithEmail] = await tx.select({
|
|
47
|
+
id: core_users.id,
|
|
48
|
+
email: core_users.email
|
|
49
|
+
}).from(core_users).where(eq(core_users.email, userFromSSO.email)).limit(1);
|
|
50
|
+
if (!userWithEmail) {
|
|
51
|
+
const signUpUser = await this.signUpUser({
|
|
52
|
+
providerId,
|
|
53
|
+
user: userFromSSO,
|
|
54
|
+
c: this.c
|
|
55
|
+
});
|
|
56
|
+
return signUpUser;
|
|
57
|
+
}
|
|
58
|
+
// If email exists, register SSO
|
|
59
|
+
await tx.insert(core_users_sso).values({
|
|
60
|
+
providerId: providerId,
|
|
61
|
+
providerAccountId: userFromSSO.id,
|
|
62
|
+
userId: userWithEmail.id
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
userId: userWithEmail.id
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
userId: dataSSOFromDb.userId
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
async encryptState() {
|
|
74
|
+
const state = crypto.randomBytes(8).toString('hex');
|
|
75
|
+
const encryptedState = await new Promise((resolve, reject)=>{
|
|
76
|
+
const salt = crypto.randomBytes(4).toString('hex');
|
|
77
|
+
crypto.scrypt(state, salt, 16, (err, derivedKey)=>{
|
|
78
|
+
if (err) reject(err);
|
|
79
|
+
resolve(salt + ':' + derivedKey.toString('hex'));
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
setCookie(this.c, `${this.c.get('core').authorization.cookieName}--state-sso`, encryptedState, {
|
|
83
|
+
httpOnly: true,
|
|
84
|
+
secure: this.c.get('core').authorization.cookieSecure,
|
|
85
|
+
path: '/',
|
|
86
|
+
domain: CONFIG.frontend.hostname
|
|
87
|
+
});
|
|
88
|
+
return state;
|
|
89
|
+
}
|
|
90
|
+
async getUrl(providerId) {
|
|
91
|
+
const provider = this.plugins.find((p)=>p.id === providerId);
|
|
92
|
+
if (!provider) {
|
|
93
|
+
throw new HTTPException(404);
|
|
94
|
+
}
|
|
95
|
+
return provider.getUrl({
|
|
96
|
+
state: await this.encryptState()
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
async verifyState(state) {
|
|
100
|
+
const storedState = getCookie(this.c, `${this.c.get('core').authorization.cookieName}--state-sso`);
|
|
101
|
+
if (!storedState) {
|
|
102
|
+
throw new HTTPException(400, {
|
|
103
|
+
message: 'Invalid state'
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const isValid = await new Promise((resolve, reject)=>{
|
|
107
|
+
const [salt, storedHash] = storedState.split(':');
|
|
108
|
+
crypto.scrypt(state, salt, 16, (err, derivedKey)=>{
|
|
109
|
+
if (err) reject(err);
|
|
110
|
+
resolve(storedHash === derivedKey.toString('hex'));
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
if (!isValid) {
|
|
114
|
+
throw new HTTPException(400, {
|
|
115
|
+
message: 'Invalid state'
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
deleteCookie(this.c, `${this.c.get('core').authorization.cookieName}--state-sso`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
2
|
+
export declare const getUserById: ({ id, c }: {
|
|
3
|
+
c: Context;
|
|
4
|
+
id: number;
|
|
5
|
+
}) => Promise<{
|
|
6
|
+
id: number;
|
|
7
|
+
email: string;
|
|
8
|
+
name: string;
|
|
9
|
+
nameCode: string;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
newsletter: boolean;
|
|
12
|
+
avatarColor: string;
|
|
13
|
+
emailVerified: boolean;
|
|
14
|
+
roleId: number;
|
|
15
|
+
birthday: Date | null;
|
|
16
|
+
} | null>;
|
|
17
|
+
//# sourceMappingURL=get-user-by-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-user-by-id.d.ts","sourceRoot":"","sources":["../../../../../src/api/models/user/get-user-by-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAMpC,eAAO,MAAM,WAAW,GAAU,WAAW;IAAE,CAAC,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;SAqBtE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { eq } from "drizzle-orm";
|
|
2
|
+
import { core_users } from "../../../database/users";
|
|
3
|
+
export const getUserById = async ({ id, c })=>{
|
|
4
|
+
const [user] = await c.get('db').select({
|
|
5
|
+
id: core_users.id,
|
|
6
|
+
email: core_users.email,
|
|
7
|
+
name: core_users.name,
|
|
8
|
+
nameCode: core_users.nameCode,
|
|
9
|
+
createdAt: core_users.createdAt,
|
|
10
|
+
newsletter: core_users.newsletter,
|
|
11
|
+
avatarColor: core_users.avatarColor,
|
|
12
|
+
emailVerified: core_users.emailVerified,
|
|
13
|
+
roleId: core_users.roleId,
|
|
14
|
+
birthday: core_users.birthday
|
|
15
|
+
}).from(core_users).where(eq(core_users.id, id)).limit(1);
|
|
16
|
+
if (!user) return null;
|
|
17
|
+
return user;
|
|
18
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
2
|
+
export declare const signInWithPassword: ({ email, password, c, }: {
|
|
3
|
+
c: Context;
|
|
4
|
+
email: string;
|
|
5
|
+
password: string;
|
|
6
|
+
}) => Promise<{
|
|
7
|
+
id: number;
|
|
8
|
+
email: string;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=sign-in-with-passwords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-in-with-passwords.d.ts","sourceRoot":"","sources":["../../../../../src/api/models/user/sign-in-with-passwords.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AASpC,eAAO,MAAM,kBAAkB,GAAU,yBAItC;IACD,CAAC,EAAE,OAAO,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;;;EA0BA,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { eq } from "drizzle-orm";
|
|
2
|
+
import { HTTPException } from "hono/http-exception";
|
|
3
|
+
import { core_users } from "../../../database/users";
|
|
4
|
+
import { PasswordModel } from "../password";
|
|
5
|
+
export const signInWithPassword = async ({ email, password, c })=>{
|
|
6
|
+
const [user] = await c.get('db').select({
|
|
7
|
+
id: core_users.id,
|
|
8
|
+
email: core_users.email,
|
|
9
|
+
password: core_users.password
|
|
10
|
+
}).from(core_users).where(eq(core_users.email, email)).limit(1);
|
|
11
|
+
if (!user?.password) {
|
|
12
|
+
throw new HTTPException(403);
|
|
13
|
+
}
|
|
14
|
+
const validPassword = await new PasswordModel().verifyPassword(password, user.password);
|
|
15
|
+
if (!validPassword) {
|
|
16
|
+
throw new HTTPException(403);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
id: user.id,
|
|
20
|
+
email: user.email
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Context } from 'hono';
|
|
2
|
+
export declare const signUp: ({ email, name, newsletter, hashedPassword, }: {
|
|
3
|
+
email: string;
|
|
4
|
+
hashedPassword: string | undefined;
|
|
5
|
+
name: string;
|
|
6
|
+
newsletter?: boolean;
|
|
7
|
+
}, c: Context) => Promise<{
|
|
8
|
+
id: number;
|
|
9
|
+
ipAddress: string;
|
|
10
|
+
name: string;
|
|
11
|
+
nameCode: string;
|
|
12
|
+
email: string;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
newsletter: boolean;
|
|
15
|
+
avatarColor: string;
|
|
16
|
+
emailVerified: boolean;
|
|
17
|
+
roleId: number;
|
|
18
|
+
birthday: Date | null;
|
|
19
|
+
language: string;
|
|
20
|
+
}>;
|
|
21
|
+
//# sourceMappingURL=sign-up.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign-up.d.ts","sourceRoot":"","sources":["../../../../../src/api/models/user/sign-up.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAmEpC,eAAO,MAAM,MAAM,GACjB,8CAKG;IACD,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,EACD,GAAG,OAAO;;;;;;;;;;;;;EAwDX,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { and, count, eq, or } from "drizzle-orm";
|
|
2
|
+
import { HTTPException } from "hono/http-exception";
|
|
3
|
+
import { getUserIp } from "../../lib/get-user-ip";
|
|
4
|
+
import { generateAvatarColor } from "../../modules/users/avatar-color";
|
|
5
|
+
import { core_roles } from "../../../database/roles";
|
|
6
|
+
import { core_users } from "../../../database/users";
|
|
7
|
+
import { removeSpecialCharacters } from "../../../lib/special-characters";
|
|
8
|
+
const getDefaultData = async (c)=>{
|
|
9
|
+
const [countUsers] = await c.get('db').select({
|
|
10
|
+
count: count()
|
|
11
|
+
}).from(core_users);
|
|
12
|
+
// If no users, return root group
|
|
13
|
+
if (countUsers.count === 0) {
|
|
14
|
+
const [defaultRole] = await c.get('db').select({
|
|
15
|
+
id: core_roles.id
|
|
16
|
+
}).from(core_roles).where(and(eq(core_roles.default, false), eq(core_roles.root, true))).limit(1);
|
|
17
|
+
if (!defaultRole) {
|
|
18
|
+
throw new HTTPException(400, {
|
|
19
|
+
message: 'Default group not found.'
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
roleId: defaultRole.id,
|
|
24
|
+
emailVerified: true
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const [defaultRole] = await c.get('db').select({
|
|
28
|
+
id: core_roles.id
|
|
29
|
+
}).from(core_roles).where(and(eq(core_roles.default, true), eq(core_roles.root, false))).limit(1);
|
|
30
|
+
if (!defaultRole) {
|
|
31
|
+
throw new HTTPException(400, {
|
|
32
|
+
message: 'Default role not found.'
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
roleId: defaultRole.id,
|
|
37
|
+
// TODO: Handle email verification
|
|
38
|
+
emailVerified: false
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export const signUp = async ({ email, name, newsletter, hashedPassword }, c)=>{
|
|
42
|
+
const convertToNameSEO = removeSpecialCharacters(name);
|
|
43
|
+
const checkIfUserExist = await c.get('db').select({
|
|
44
|
+
email: core_users.email,
|
|
45
|
+
name_code: core_users.nameCode
|
|
46
|
+
}).from(core_users).where(or(eq(core_users.email, email), eq(core_users.nameCode, convertToNameSEO)));
|
|
47
|
+
const findEmail = checkIfUserExist.find((user)=>user.email === email);
|
|
48
|
+
if (findEmail) {
|
|
49
|
+
throw new HTTPException(400, {
|
|
50
|
+
message: 'Email already exists'
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const findName = checkIfUserExist.find((user)=>user.name_code === convertToNameSEO);
|
|
54
|
+
if (findName) {
|
|
55
|
+
throw new HTTPException(400, {
|
|
56
|
+
message: 'Name already exists'
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const { roleId, emailVerified } = await getDefaultData(c);
|
|
60
|
+
const [data] = await c.get('db').insert(core_users).values({
|
|
61
|
+
email,
|
|
62
|
+
name,
|
|
63
|
+
nameCode: convertToNameSEO,
|
|
64
|
+
// TODO: Handle newsletter only if email is allowed
|
|
65
|
+
newsletter,
|
|
66
|
+
password: hashedPassword,
|
|
67
|
+
avatarColor: generateAvatarColor(name),
|
|
68
|
+
roleId,
|
|
69
|
+
emailVerified,
|
|
70
|
+
ipAddress: getUserIp(c)
|
|
71
|
+
}).returning();
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
73
|
+
const { password: _, ...user } = data;
|
|
74
|
+
return user;
|
|
75
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare class UserModel {
|
|
2
|
+
getUserById: ({ id, c }: {
|
|
3
|
+
c: import("hono").Context;
|
|
4
|
+
id: number;
|
|
5
|
+
}) => Promise<{
|
|
6
|
+
id: number;
|
|
7
|
+
email: string;
|
|
8
|
+
name: string;
|
|
9
|
+
nameCode: string;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
newsletter: boolean;
|
|
12
|
+
avatarColor: string;
|
|
13
|
+
emailVerified: boolean;
|
|
14
|
+
roleId: number;
|
|
15
|
+
birthday: Date | null;
|
|
16
|
+
} | null>;
|
|
17
|
+
signInWithPassword: ({ email, password, c, }: {
|
|
18
|
+
c: import("hono").Context;
|
|
19
|
+
email: string;
|
|
20
|
+
password: string;
|
|
21
|
+
}) => Promise<{
|
|
22
|
+
id: number;
|
|
23
|
+
email: string;
|
|
24
|
+
}>;
|
|
25
|
+
signUp: ({ email, name, newsletter, hashedPassword, }: {
|
|
26
|
+
email: string;
|
|
27
|
+
hashedPassword: string | undefined;
|
|
28
|
+
name: string;
|
|
29
|
+
newsletter?: boolean;
|
|
30
|
+
}, c: import("hono").Context) => Promise<{
|
|
31
|
+
id: number;
|
|
32
|
+
ipAddress: string;
|
|
33
|
+
name: string;
|
|
34
|
+
nameCode: string;
|
|
35
|
+
email: string;
|
|
36
|
+
createdAt: Date;
|
|
37
|
+
newsletter: boolean;
|
|
38
|
+
avatarColor: string;
|
|
39
|
+
emailVerified: boolean;
|
|
40
|
+
roleId: number;
|
|
41
|
+
birthday: Date | null;
|
|
42
|
+
language: string;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/api/models/user.ts"],"names":[],"mappings":"AAIA,qBAAa,SAAS;IACpB,WAAW;;;;;;;;;;;;;;cAAe;IAC1B,kBAAkB;;;;;;;OAAsB;IACxC,MAAM;;;;kBAEw7C,CAAC;;;;;;;;;;;;;;OAF/6C;CACjB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getUserById } from "./user/get-user-by-id";
|
|
2
|
+
import { signInWithPassword } from "./user/sign-in-with-passwords";
|
|
3
|
+
import { signUp } from "./user/sign-up";
|
|
4
|
+
export class UserModel {
|
|
5
|
+
getUserById = getUserById;
|
|
6
|
+
signInWithPassword = signInWithPassword;
|
|
7
|
+
signUp = signUp;
|
|
8
|
+
}
|