@vitnode/core 1.2.0-canary.52 → 1.2.0-canary.53
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/config/next.config.ts +3 -3
- package/dist/scripts/get-config.d.ts +2 -2
- package/dist/scripts/get-config.d.ts.map +1 -1
- package/dist/scripts/plugin.d.ts.map +1 -1
- package/dist/scripts/prepare-database.d.ts.map +1 -1
- package/dist/scripts/prepare-plugins-files.d.ts.map +1 -1
- package/dist/scripts/scripts.js +4 -4
- package/dist/scripts/shared/file-utils.d.ts.map +1 -1
- package/dist/src/api/adapters/email/nodemailer.d.ts +1 -1
- package/dist/src/api/adapters/email/nodemailer.js +3 -3
- package/dist/src/api/adapters/email/resend.d.ts +1 -1
- package/dist/src/api/adapters/email/resend.js +2 -2
- package/dist/src/api/adapters/sso/discord.d.ts +1 -1
- package/dist/src/api/adapters/sso/discord.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/discord.js +21 -21
- package/dist/src/api/adapters/sso/facebook.d.ts +1 -1
- package/dist/src/api/adapters/sso/facebook.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/facebook.js +23 -23
- package/dist/src/api/adapters/sso/google.d.ts +1 -1
- package/dist/src/api/adapters/sso/google.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/google.js +21 -21
- package/dist/src/api/config.d.ts +3 -3
- package/dist/src/api/config.d.ts.map +1 -1
- package/dist/src/api/config.js +11 -11
- package/dist/src/api/lib/check-plugin-id.js +8 -8
- package/dist/src/api/lib/logger-middleware.d.ts +1 -1
- package/dist/src/api/lib/logger-middleware.js +9 -9
- package/dist/src/api/lib/module.d.ts +2 -2
- package/dist/src/api/lib/plugin.d.ts +2 -2
- package/dist/src/api/lib/plugin.d.ts.map +1 -1
- package/dist/src/api/lib/route.d.ts +2 -2
- package/dist/src/api/lib/route.d.ts.map +1 -1
- package/dist/src/api/lib/route.js +1 -1
- package/dist/src/api/lib/with-pagination.d.ts +7 -7
- package/dist/src/api/lib/with-pagination.d.ts.map +1 -1
- package/dist/src/api/lib/with-pagination.js +37 -24
- package/dist/src/api/middlewares/captcha.middleware.d.ts +1 -1
- package/dist/src/api/middlewares/captcha.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/captcha.middleware.js +14 -13
- package/dist/src/api/middlewares/global.middleware.d.ts +12 -12
- package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/global.middleware.js +29 -28
- package/dist/src/api/middlewares/rate-limiter.middleware.d.ts +3 -3
- package/dist/src/api/middlewares/rate-limiter.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/rate-limiter.middleware.js +4 -4
- package/dist/src/api/models/device.d.ts +1 -1
- package/dist/src/api/models/device.d.ts.map +1 -1
- package/dist/src/api/models/device.js +13 -13
- package/dist/src/api/models/email.d.ts +15 -15
- package/dist/src/api/models/email.d.ts.map +1 -1
- package/dist/src/api/models/email.js +11 -10
- package/dist/src/api/models/password.js +9 -9
- package/dist/src/api/models/session-admin.d.ts +1 -1
- package/dist/src/api/models/session-admin.d.ts.map +1 -1
- package/dist/src/api/models/session-admin.js +19 -19
- package/dist/src/api/models/session.d.ts +1 -1
- package/dist/src/api/models/session.d.ts.map +1 -1
- package/dist/src/api/models/session.js +17 -17
- package/dist/src/api/models/sso.d.ts +1 -1
- package/dist/src/api/models/sso.d.ts.map +1 -1
- package/dist/src/api/models/sso.js +22 -25
- package/dist/src/api/models/user/get-user-by-id.d.ts +1 -1
- package/dist/src/api/models/user/get-user-by-id.d.ts.map +1 -1
- package/dist/src/api/models/user/get-user-by-id.js +1 -1
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts +1 -1
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts.map +1 -1
- package/dist/src/api/models/user/sign-in-with-passwords.js +1 -1
- package/dist/src/api/models/user/sign-up.d.ts +1 -1
- package/dist/src/api/models/user/sign-up.d.ts.map +1 -1
- package/dist/src/api/models/user/sign-up.js +11 -12
- package/dist/src/api/models/user.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.d.ts +3 -3
- package/dist/src/api/modules/admin/admin.module.js +1 -1
- package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts +1 -1
- package/dist/src/api/modules/admin/debug/debug.admin.module.js +1 -1
- package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts +2 -2
- package/dist/src/api/modules/admin/debug/routes/logs.route.js +16 -16
- package/dist/src/api/modules/admin/routes/session.route.d.ts +2 -2
- package/dist/src/api/modules/admin/routes/session.route.js +7 -7
- package/dist/src/api/modules/admin/users/routes/list.route.d.ts +2 -2
- package/dist/src/api/modules/admin/users/routes/list.route.js +12 -12
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts +2 -2
- package/dist/src/api/modules/admin/users/routes/users.route.js +15 -15
- package/dist/src/api/modules/admin/users/users.admin.module.d.ts +1 -1
- package/dist/src/api/modules/admin/users/users.admin.module.js +1 -1
- package/dist/src/api/modules/middleware/middleware.module.d.ts +1 -1
- package/dist/src/api/modules/middleware/middleware.module.js +1 -1
- package/dist/src/api/modules/middleware/route.d.ts +2 -2
- package/dist/src/api/modules/middleware/route.js +12 -12
- package/dist/src/api/modules/users/routes/change-password.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/change-password.route.js +13 -13
- package/dist/src/api/modules/users/routes/reset-passowrd.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/reset-passowrd.route.js +17 -17
- package/dist/src/api/modules/users/routes/session.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/session.route.js +6 -6
- package/dist/src/api/modules/users/routes/sign-in.route.d.ts +3 -3
- package/dist/src/api/modules/users/routes/sign-in.route.js +10 -10
- package/dist/src/api/modules/users/routes/sign-out.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/sign-out.route.js +7 -7
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts +3 -3
- package/dist/src/api/modules/users/routes/sign-up.route.js +14 -14
- package/dist/src/api/modules/users/routes/test.route.d.ts +3 -3
- package/dist/src/api/modules/users/routes/test.route.js +9 -9
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +2 -2
- package/dist/src/api/modules/users/sso/routes/callback.route.js +8 -8
- package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts +2 -2
- package/dist/src/api/modules/users/sso/routes/create-url.route.js +6 -6
- package/dist/src/api/modules/users/sso/sso.module.d.ts +2 -2
- package/dist/src/api/modules/users/sso/sso.module.js +1 -1
- package/dist/src/api/modules/users/users.module.d.ts +12 -12
- package/dist/src/api/modules/users/users.module.js +1 -1
- package/dist/src/app/login/page.d.ts +1 -1
- package/dist/src/app/login/page.js +2 -2
- package/dist/src/app/login/reset-password/page.d.ts +2 -2
- package/dist/src/app/login/reset-password/page.js +2 -2
- package/dist/src/app/register/page.d.ts +1 -1
- package/dist/src/app/register/page.js +2 -2
- package/dist/src/app_admin/core/debug/page.d.ts +1 -1
- package/dist/src/app_admin/core/debug/page.js +8 -8
- package/dist/src/app_admin/core/users/page.d.ts +2 -2
- package/dist/src/app_admin/core/users/page.d.ts.map +1 -1
- package/dist/src/app_admin/core/users/page.js +7 -7
- package/dist/src/components/avatar.d.ts +1 -1
- package/dist/src/components/avatar.js +1 -1
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.d.ts +2 -2
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.js +5 -5
- package/dist/src/components/confirm-action/content.d.ts.map +1 -1
- package/dist/src/components/confirm-action/content.js +3 -4
- package/dist/src/components/date-format.js +8 -8
- package/dist/src/components/form/auto-form.d.ts +16 -16
- package/dist/src/components/form/auto-form.d.ts.map +1 -1
- package/dist/src/components/form/auto-form.js +13 -12
- package/dist/src/components/form/common/desc.js +1 -1
- package/dist/src/components/form/common/label.d.ts +1 -1
- package/dist/src/components/form/common/label.js +1 -1
- package/dist/src/components/form/fields/checkbox.d.ts +2 -2
- package/dist/src/components/form/fields/checkbox.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox-async.d.ts +3 -3
- package/dist/src/components/form/fields/combobox-async.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox-async.js +29 -23
- package/dist/src/components/form/fields/combobox.d.ts +3 -3
- package/dist/src/components/form/fields/combobox.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox.js +6 -7
- package/dist/src/components/form/fields/input.d.ts +2 -2
- package/dist/src/components/form/fields/input.d.ts.map +1 -1
- package/dist/src/components/form/fields/input.js +2 -2
- package/dist/src/components/form/fields/radio-group.d.ts +3 -3
- package/dist/src/components/form/fields/radio-group.d.ts.map +1 -1
- package/dist/src/components/form/fields/radio-group.js +0 -1
- package/dist/src/components/form/fields/select.d.ts +3 -3
- package/dist/src/components/form/fields/select.d.ts.map +1 -1
- package/dist/src/components/form/fields/select.js +2 -3
- package/dist/src/components/form/fields/switch.d.ts +2 -2
- package/dist/src/components/form/fields/switch.d.ts.map +1 -1
- package/dist/src/components/form/fields/textarea.d.ts +3 -3
- package/dist/src/components/form/fields/textarea.d.ts.map +1 -1
- package/dist/src/components/form/fields/textarea.js +1 -2
- package/dist/src/components/i18n-provider.d.ts +2 -2
- package/dist/src/components/i18n-provider.js +3 -3
- package/dist/src/components/logo-vitnode.d.ts.map +1 -1
- package/dist/src/components/logo-vitnode.js +8 -2
- package/dist/src/components/switchers/langs/language-swietcher.d.ts +1 -1
- package/dist/src/components/switchers/langs/language-swietcher.d.ts.map +1 -1
- package/dist/src/components/switchers/langs/language-swietcher.js +3 -3
- package/dist/src/components/switchers/themes/theme-switcher.js +4 -4
- package/dist/src/components/table/content.d.ts +1 -1
- package/dist/src/components/table/content.d.ts.map +1 -1
- package/dist/src/components/table/content.js +5 -5
- package/dist/src/components/table/data-table.d.ts +7 -7
- package/dist/src/components/table/data-table.d.ts.map +1 -1
- package/dist/src/components/table/data-table.js +22 -15
- package/dist/src/components/table/order-table-head.d.ts +4 -4
- package/dist/src/components/table/order-table-head.d.ts.map +1 -1
- package/dist/src/components/table/order-table-head.js +20 -9
- package/dist/src/components/table/pagination.js +19 -19
- package/dist/src/components/ui/accordion.d.ts +2 -2
- package/dist/src/components/ui/accordion.d.ts.map +1 -1
- package/dist/src/components/ui/accordion.js +4 -5
- package/dist/src/components/ui/alert-dialog.d.ts +7 -7
- package/dist/src/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/src/components/ui/alert-dialog.js +12 -12
- package/dist/src/components/ui/alert.d.ts +5 -5
- package/dist/src/components/ui/alert.d.ts.map +1 -1
- package/dist/src/components/ui/alert.js +6 -7
- package/dist/src/components/ui/badge.d.ts +3 -3
- package/dist/src/components/ui/badge.d.ts.map +1 -1
- package/dist/src/components/ui/badge.js +7 -8
- package/dist/src/components/ui/button-client.d.ts +1 -1
- package/dist/src/components/ui/button-client.js +9 -9
- package/dist/src/components/ui/button.d.ts +8 -8
- package/dist/src/components/ui/button.d.ts.map +1 -1
- package/dist/src/components/ui/button.js +13 -14
- package/dist/src/components/ui/card.d.ts +8 -8
- package/dist/src/components/ui/card.js +7 -7
- package/dist/src/components/ui/checkbox.d.ts +2 -2
- package/dist/src/components/ui/checkbox.d.ts.map +1 -1
- package/dist/src/components/ui/checkbox.js +2 -3
- package/dist/src/components/ui/collapsible.d.ts +1 -1
- package/dist/src/components/ui/collapsible.js +1 -1
- package/dist/src/components/ui/command.d.ts +4 -4
- package/dist/src/components/ui/command.d.ts.map +1 -1
- package/dist/src/components/ui/command.js +9 -10
- package/dist/src/components/ui/context-menu.d.ts +4 -4
- package/dist/src/components/ui/context-menu.d.ts.map +1 -1
- package/dist/src/components/ui/context-menu.js +7 -8
- package/dist/src/components/ui/dialog.d.ts +6 -6
- package/dist/src/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/components/ui/dialog.js +16 -16
- package/dist/src/components/ui/drawer.d.ts +4 -4
- package/dist/src/components/ui/drawer.d.ts.map +1 -1
- package/dist/src/components/ui/drawer.js +7 -8
- package/dist/src/components/ui/dropdown-menu.d.ts +4 -4
- package/dist/src/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/src/components/ui/dropdown-menu.js +8 -9
- package/dist/src/components/ui/form.d.ts +10 -10
- package/dist/src/components/ui/form.d.ts.map +1 -1
- package/dist/src/components/ui/form.js +15 -15
- package/dist/src/components/ui/header-content.js +1 -1
- package/dist/src/components/ui/hover-card.d.ts +2 -2
- package/dist/src/components/ui/hover-card.d.ts.map +1 -1
- package/dist/src/components/ui/hover-card.js +3 -4
- package/dist/src/components/ui/input-otp.d.ts +5 -5
- package/dist/src/components/ui/input-otp.d.ts.map +1 -1
- package/dist/src/components/ui/input-otp.js +6 -7
- package/dist/src/components/ui/input.d.ts +2 -2
- package/dist/src/components/ui/input.d.ts.map +1 -1
- package/dist/src/components/ui/input.js +1 -2
- package/dist/src/components/ui/label.d.ts +2 -2
- package/dist/src/components/ui/label.d.ts.map +1 -1
- package/dist/src/components/ui/label.js +2 -3
- package/dist/src/components/ui/loader.js +3 -3
- package/dist/src/components/ui/menubar.d.ts +4 -4
- package/dist/src/components/ui/menubar.d.ts.map +1 -1
- package/dist/src/components/ui/menubar.js +11 -12
- package/dist/src/components/ui/navigation-menu.d.ts +2 -2
- package/dist/src/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/src/components/ui/navigation-menu.js +10 -11
- package/dist/src/components/ui/popover.d.ts +2 -2
- package/dist/src/components/ui/popover.d.ts.map +1 -1
- package/dist/src/components/ui/popover.js +3 -4
- package/dist/src/components/ui/progress.d.ts +2 -2
- package/dist/src/components/ui/progress.d.ts.map +1 -1
- package/dist/src/components/ui/progress.js +2 -3
- package/dist/src/components/ui/radio-group.d.ts +2 -2
- package/dist/src/components/ui/radio-group.d.ts.map +1 -1
- package/dist/src/components/ui/radio-group.js +3 -4
- package/dist/src/components/ui/select.d.ts +3 -3
- package/dist/src/components/ui/select.d.ts.map +1 -1
- package/dist/src/components/ui/select.js +9 -10
- package/dist/src/components/ui/separator.d.ts +2 -2
- package/dist/src/components/ui/separator.d.ts.map +1 -1
- package/dist/src/components/ui/separator.js +3 -4
- package/dist/src/components/ui/sheet.d.ts +5 -5
- package/dist/src/components/ui/sheet.d.ts.map +1 -1
- package/dist/src/components/ui/sheet.js +8 -9
- package/dist/src/components/ui/sidebar.d.ts +31 -31
- package/dist/src/components/ui/sidebar.d.ts.map +1 -1
- package/dist/src/components/ui/sidebar.js +67 -69
- package/dist/src/components/ui/skeleton.d.ts +1 -1
- package/dist/src/components/ui/skeleton.js +1 -1
- package/dist/src/components/ui/slider.d.ts +2 -2
- package/dist/src/components/ui/slider.d.ts.map +1 -1
- package/dist/src/components/ui/slider.js +16 -8
- package/dist/src/components/ui/sonner.d.ts +1 -1
- package/dist/src/components/ui/sonner.d.ts.map +1 -1
- package/dist/src/components/ui/sonner.js +6 -6
- package/dist/src/components/ui/switch.d.ts +2 -2
- package/dist/src/components/ui/switch.d.ts.map +1 -1
- package/dist/src/components/ui/switch.js +3 -4
- package/dist/src/components/ui/table.d.ts +9 -9
- package/dist/src/components/ui/table.d.ts.map +1 -1
- package/dist/src/components/ui/table.js +8 -9
- package/dist/src/components/ui/tabs.d.ts +2 -2
- package/dist/src/components/ui/tabs.d.ts.map +1 -1
- package/dist/src/components/ui/tabs.js +4 -5
- package/dist/src/components/ui/textarea.d.ts +2 -2
- package/dist/src/components/ui/textarea.d.ts.map +1 -1
- package/dist/src/components/ui/textarea.js +1 -2
- package/dist/src/components/ui/toggle-group.d.ts +4 -4
- package/dist/src/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/src/components/ui/toggle-group.js +6 -6
- package/dist/src/components/ui/toggle.d.ts +3 -3
- package/dist/src/components/ui/toggle.d.ts.map +1 -1
- package/dist/src/components/ui/toggle.js +8 -9
- package/dist/src/components/ui/tooltip.d.ts +2 -2
- package/dist/src/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/components/ui/tooltip.js +2 -3
- package/dist/src/config.js +2 -2
- package/dist/src/database/admins.js +10 -10
- package/dist/src/database/languages.js +7 -7
- package/dist/src/database/logs.js +9 -9
- package/dist/src/database/moderators.js +5 -5
- package/dist/src/database/roles.js +1 -1
- package/dist/src/database/sessions.js +6 -6
- package/dist/src/database/users.js +13 -13
- package/dist/src/drizzle.config.d.ts +2 -2
- package/dist/src/drizzle.config.d.ts.map +1 -1
- package/dist/src/drizzle.config.js +19 -12
- package/dist/src/emails/default-template.d.ts +3 -3
- package/dist/src/emails/default-template.d.ts.map +1 -1
- package/dist/src/emails/default-template.js +39 -38
- package/dist/src/emails/reset-password.d.ts +1 -1
- package/dist/src/emails/reset-password.d.ts.map +1 -1
- package/dist/src/emails/reset-password.js +51 -51
- package/dist/src/emails/ui/button.d.ts +2 -2
- package/dist/src/emails/ui/button.js +13 -13
- package/dist/src/emails/ui/card.d.ts +1 -1
- package/dist/src/emails/ui/card.js +6 -6
- package/dist/src/hooks/use-before-unload.js +3 -3
- package/dist/src/hooks/use-captcha.d.ts +2 -2
- package/dist/src/hooks/use-captcha.d.ts.map +1 -1
- package/dist/src/hooks/use-captcha.js +29 -37
- package/dist/src/hooks/use-mobile.d.ts.map +1 -1
- package/dist/src/hooks/use-mobile.js +3 -4
- package/dist/src/lib/api/get-middleware-api.js +4 -4
- package/dist/src/lib/api/get-session-admin-api.js +5 -5
- package/dist/src/lib/api/get-session-api.js +4 -4
- package/dist/src/lib/colors.js +28 -19
- package/dist/src/lib/colors.test.js +60 -60
- package/dist/src/lib/config.js +3 -3
- package/dist/src/lib/fetcher/cookie-from-string-to-object.d.ts.map +1 -1
- package/dist/src/lib/fetcher/cookie-from-string-to-object.js +1 -1
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.js +27 -27
- package/dist/src/lib/fetcher/core.d.ts +5 -5
- package/dist/src/lib/fetcher/core.d.ts.map +1 -1
- package/dist/src/lib/fetcher/core.js +11 -10
- package/dist/src/lib/fetcher/helpers-server.d.ts +1 -1
- package/dist/src/lib/fetcher/helpers-server.js +1 -1
- package/dist/src/lib/fetcher/helpers.test.js +17 -17
- package/dist/src/lib/fetcher/types.d.ts +26 -26
- package/dist/src/lib/fetcher/types.d.ts.map +1 -1
- package/dist/src/lib/fetcher-client.d.ts +4 -4
- package/dist/src/lib/fetcher-client.d.ts.map +1 -1
- package/dist/src/lib/fetcher-client.js +3 -3
- package/dist/src/lib/fetcher.d.ts +5 -5
- package/dist/src/lib/fetcher.d.ts.map +1 -1
- package/dist/src/lib/fetcher.js +4 -4
- package/dist/src/lib/helpers/auto-form.d.ts +3 -3
- package/dist/src/lib/helpers/auto-form.d.ts.map +1 -1
- package/dist/src/lib/helpers/auto-form.js +16 -15
- package/dist/src/lib/helpers/auto-form.test.js +129 -129
- package/dist/src/lib/navigation.d.ts +2 -2
- package/dist/src/lib/navigation.d.ts.map +1 -1
- package/dist/src/lib/plugin.d.ts +3 -3
- package/dist/src/lib/special-characters.js +1 -1
- package/dist/src/lib/special-characters.test.js +36 -36
- package/dist/src/lib/utils.d.ts +1 -1
- package/dist/src/tests/setup.d.ts +1 -1
- package/dist/src/views/admin/layouts/admin-layout.d.ts +1 -1
- package/dist/src/views/admin/layouts/admin-layout.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/admin-layout.js +4 -8
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/item.js +11 -12
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/nav.js +11 -11
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts +1 -1
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/sidebar.js +1 -2
- package/dist/src/views/admin/layouts/sidebar/sign-out.js +1 -1
- package/dist/src/views/admin/layouts/user-bar/client.js +5 -5
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts +1 -1
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/user-bar/user-bar.js +1 -1
- package/dist/src/views/admin/sign-in/sign-in-admin-view.js +1 -1
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +3 -3
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.js +10 -10
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.js +2 -2
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.js +15 -15
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +7 -7
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.js +7 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.js +3 -3
- package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.js +25 -25
- package/dist/src/views/admin/views/core/test.js +43 -43
- package/dist/src/views/admin/views/core/users/users-admin-view.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/users/users-admin-view.js +13 -14
- package/dist/src/views/auth/password-reset/change-password-form/form.js +9 -9
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.d.ts +2 -2
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.js +5 -5
- package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts +2 -2
- package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts.map +1 -1
- package/dist/src/views/auth/password-reset/change-password-form/use-form.js +7 -7
- package/dist/src/views/auth/password-reset/form/form.d.ts +2 -2
- package/dist/src/views/auth/password-reset/form/form.d.ts.map +1 -1
- package/dist/src/views/auth/password-reset/form/form.js +15 -15
- package/dist/src/views/auth/password-reset/form/mutation-api.js +5 -5
- package/dist/src/views/auth/password-reset/form/use-form.d.ts +2 -2
- package/dist/src/views/auth/password-reset/form/use-form.js +7 -7
- package/dist/src/views/auth/password-reset/password-reset-view.js +4 -4
- package/dist/src/views/auth/sign-in/form/form.js +9 -9
- package/dist/src/views/auth/sign-in/form/mutation-api.d.ts +2 -2
- package/dist/src/views/auth/sign-in/form/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/form/mutation-api.js +10 -10
- package/dist/src/views/auth/sign-in/form/use-form.d.ts +2 -2
- package/dist/src/views/auth/sign-in/form/use-form.js +11 -11
- package/dist/src/views/auth/sign-in/sign-in-view.js +5 -5
- package/dist/src/views/auth/sign-up/components/password-input.d.ts +3 -3
- package/dist/src/views/auth/sign-up/components/password-input.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/components/password-input.js +9 -10
- package/dist/src/views/auth/sign-up/email-confirmation-view.js +4 -4
- package/dist/src/views/auth/sign-up/form/form.d.ts +2 -2
- package/dist/src/views/auth/sign-up/form/form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/form.js +18 -18
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts +2 -2
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/mutation-api.js +6 -6
- package/dist/src/views/auth/sign-up/form/use-form.d.ts +2 -2
- package/dist/src/views/auth/sign-up/form/use-form.js +21 -21
- package/dist/src/views/auth/sign-up/sign-up-view.js +5 -5
- package/dist/src/views/auth/sign-up/wrapper.d.ts +1 -1
- package/dist/src/views/auth/sign-up/wrapper.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/wrapper.js +5 -8
- package/dist/src/views/auth/sso/buttons/client.js +4 -4
- package/dist/src/views/auth/sso/buttons/mutation-api.js +5 -5
- package/dist/src/views/auth/sso/buttons/sso-buttons.js +2 -2
- package/dist/src/views/auth/sso/callback/callback-sso-view.js +6 -6
- package/dist/src/views/auth/sso/callback/client/client.d.ts +1 -1
- package/dist/src/views/auth/sso/callback/client/client.d.ts.map +1 -1
- package/dist/src/views/auth/sso/callback/client/client.js +9 -9
- package/dist/src/views/auth/sso/callback/client/mutation-api.js +7 -7
- package/dist/src/views/error/back-button.js +1 -1
- package/dist/src/views/error/error-view.js +4 -4
- package/dist/src/views/error/global-error-view.d.ts +3 -3
- package/dist/src/views/error/global-error-view.d.ts.map +1 -1
- package/dist/src/views/error/global-error-view.js +36 -44
- package/dist/src/views/layouts/provider.d.ts +4 -4
- package/dist/src/views/layouts/provider.d.ts.map +1 -1
- package/dist/src/views/layouts/provider.js +3 -3
- package/dist/src/views/layouts/root-layout.d.ts +3 -3
- package/dist/src/views/layouts/root-layout.d.ts.map +1 -1
- package/dist/src/views/layouts/root-layout.js +1 -2
- package/dist/src/views/layouts/theme/header/header.d.ts +2 -2
- package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -1
- package/dist/src/views/layouts/theme/header/header.js +1 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts +1 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts.map +1 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.js +4 -4
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.js +8 -8
- package/dist/src/views/layouts/theme/header/user/user.js +4 -4
- package/dist/src/views/layouts/theme/layout.d.ts +2 -2
- package/dist/src/views/layouts/theme/layout.js +1 -1
- package/dist/src/vitnode.config.d.ts +16 -16
- package/dist/src/vitnode.config.d.ts.map +1 -1
- package/dist/src/vitnode.config.js +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -5
- package/src/app/login/page.tsx +5 -5
- package/src/app/login/reset-password/page.tsx +5 -5
- package/src/app/login/sso/[providerId]/page.tsx +1 -1
- package/src/app/register/page.tsx +5 -5
- package/src/app_admin/core/debug/page.tsx +14 -14
- package/src/app_admin/core/page.tsx +1 -1
- package/src/app_admin/core/test/page.tsx +1 -1
- package/src/app_admin/core/users/page.tsx +12 -13
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { pgTable } from "drizzle-orm/pg-core";
|
|
2
2
|
import { core_users } from "./users.js";
|
|
3
|
-
export const core_logs = pgTable(
|
|
3
|
+
export const core_logs = pgTable("core_logs", (t)=>({
|
|
4
4
|
id: t.serial().primaryKey(),
|
|
5
5
|
pluginId: t.varchar({
|
|
6
6
|
length: 255
|
|
7
7
|
}).notNull(),
|
|
8
8
|
type: t.varchar({
|
|
9
9
|
enum: [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
"warn",
|
|
11
|
+
"error",
|
|
12
|
+
"debug"
|
|
13
13
|
],
|
|
14
14
|
length: 10
|
|
15
15
|
}).notNull(),
|
|
@@ -20,15 +20,15 @@ export const core_logs = pgTable('core_logs', (t)=>({
|
|
|
20
20
|
}).notNull(),
|
|
21
21
|
method: t.varchar({
|
|
22
22
|
length: 10
|
|
23
|
-
}).notNull().default(
|
|
24
|
-
path: t.text().notNull().default(
|
|
23
|
+
}).notNull().default("GET"),
|
|
24
|
+
path: t.text().notNull().default("localhost"),
|
|
25
25
|
userAgent: t.text(),
|
|
26
26
|
statusCode: t.integer().notNull().default(500),
|
|
27
27
|
userId: t.bigint({
|
|
28
|
-
mode:
|
|
28
|
+
mode: "number"
|
|
29
29
|
}).references(()=>core_users.id, {
|
|
30
|
-
onDelete:
|
|
31
|
-
onUpdate:
|
|
30
|
+
onDelete: "set null",
|
|
31
|
+
onUpdate: "cascade"
|
|
32
32
|
}),
|
|
33
33
|
test123: t.boolean().notNull().default(false)
|
|
34
34
|
})).enableRLS();
|
|
@@ -2,20 +2,20 @@ import { relations } from "drizzle-orm";
|
|
|
2
2
|
import { index, pgTable } from "drizzle-orm/pg-core";
|
|
3
3
|
import { core_roles } from "./roles.js";
|
|
4
4
|
import { core_users } from "./users.js";
|
|
5
|
-
export const core_moderators_permissions = pgTable(
|
|
5
|
+
export const core_moderators_permissions = pgTable("core_moderators_permissions", (t)=>({
|
|
6
6
|
id: t.serial().primaryKey(),
|
|
7
7
|
roleId: t.integer().references(()=>core_roles.id, {
|
|
8
|
-
onDelete:
|
|
8
|
+
onDelete: "cascade"
|
|
9
9
|
}),
|
|
10
10
|
userId: t.integer().references(()=>core_users.id, {
|
|
11
|
-
onDelete:
|
|
11
|
+
onDelete: "cascade"
|
|
12
12
|
}),
|
|
13
13
|
createdAt: t.timestamp().notNull().defaultNow(),
|
|
14
14
|
updatedAt: t.timestamp().notNull().$onUpdate(()=>new Date()),
|
|
15
15
|
protected: t.boolean().notNull().default(false)
|
|
16
16
|
}), (t)=>[
|
|
17
|
-
index(
|
|
18
|
-
index(
|
|
17
|
+
index("core_moderators_permissions_role_id_idx").on(t.roleId),
|
|
18
|
+
index("core_moderators_permissions_user_id_idx").on(t.userId)
|
|
19
19
|
]).enableRLS();
|
|
20
20
|
export const core_moderators_permissions_relations = relations(core_moderators_permissions, ({ one })=>({
|
|
21
21
|
group: one(core_roles, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { pgTable } from "drizzle-orm/pg-core";
|
|
2
|
-
export const core_roles = pgTable(
|
|
2
|
+
export const core_roles = pgTable("core_roles", (t)=>({
|
|
3
3
|
id: t.serial().primaryKey(),
|
|
4
4
|
createdAt: t.timestamp().notNull().defaultNow(),
|
|
5
5
|
updatedAt: t.timestamp().notNull().$onUpdate(()=>new Date()),
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { relations } from "drizzle-orm";
|
|
2
2
|
import { index, pgTable } from "drizzle-orm/pg-core";
|
|
3
3
|
import { core_users } from "./users.js";
|
|
4
|
-
export const core_sessions = pgTable(
|
|
4
|
+
export const core_sessions = pgTable("core_sessions", (t)=>({
|
|
5
5
|
id: t.serial().primaryKey(),
|
|
6
6
|
token: t.varchar({
|
|
7
7
|
length: 255
|
|
8
8
|
}).notNull().unique(),
|
|
9
9
|
userId: t.integer().notNull().references(()=>core_users.id, {
|
|
10
|
-
onDelete:
|
|
10
|
+
onDelete: "cascade"
|
|
11
11
|
}),
|
|
12
12
|
createdAt: t.timestamp().notNull().defaultNow(),
|
|
13
13
|
expiresAt: t.timestamp().notNull(),
|
|
14
14
|
deviceId: t.integer().references(()=>core_sessions_known_devices.id, {
|
|
15
|
-
onDelete:
|
|
15
|
+
onDelete: "cascade"
|
|
16
16
|
}).notNull()
|
|
17
17
|
}), (t)=>[
|
|
18
|
-
index(
|
|
18
|
+
index("core_sessions_user_id_idx").on(t.userId)
|
|
19
19
|
]).enableRLS();
|
|
20
20
|
export const core_sessions_relations = relations(core_sessions, ({ one })=>({
|
|
21
21
|
user: one(core_users, {
|
|
@@ -35,7 +35,7 @@ export const core_sessions_relations = relations(core_sessions, ({ one })=>({
|
|
|
35
35
|
]
|
|
36
36
|
})
|
|
37
37
|
}));
|
|
38
|
-
export const core_sessions_known_devices = pgTable(
|
|
38
|
+
export const core_sessions_known_devices = pgTable("core_sessions_known_devices", (t)=>({
|
|
39
39
|
id: t.serial().primaryKey(),
|
|
40
40
|
publicId: t.varchar({
|
|
41
41
|
length: 32
|
|
@@ -46,7 +46,7 @@ export const core_sessions_known_devices = pgTable('core_sessions_known_devices'
|
|
|
46
46
|
userAgent: t.text().notNull(),
|
|
47
47
|
lastSeen: t.timestamp().notNull().defaultNow()
|
|
48
48
|
}), (t)=>[
|
|
49
|
-
index(
|
|
49
|
+
index("core_sessions_known_devices_ip_address_idx").on(t.ipAddress)
|
|
50
50
|
]).enableRLS();
|
|
51
51
|
export const core_sessions_known_devices_relations = relations(core_sessions_known_devices, ({ one })=>({
|
|
52
52
|
session: one(core_sessions, {
|
|
@@ -2,7 +2,7 @@ import { relations } from "drizzle-orm";
|
|
|
2
2
|
import { index, pgTable } from "drizzle-orm/pg-core";
|
|
3
3
|
import { core_languages } from "./languages.js";
|
|
4
4
|
import { core_roles } from "./roles.js";
|
|
5
|
-
export const core_users = pgTable(
|
|
5
|
+
export const core_users = pgTable("core_users", (t)=>({
|
|
6
6
|
id: t.serial().primaryKey(),
|
|
7
7
|
nameCode: t.varchar({
|
|
8
8
|
length: 255
|
|
@@ -27,13 +27,13 @@ export const core_users = pgTable('core_users', (t)=>({
|
|
|
27
27
|
}).notNull(),
|
|
28
28
|
language: t.varchar({
|
|
29
29
|
length: 32
|
|
30
|
-
}).notNull().default(
|
|
31
|
-
onDelete:
|
|
30
|
+
}).notNull().default("en").references(()=>core_languages.code, {
|
|
31
|
+
onDelete: "set default"
|
|
32
32
|
})
|
|
33
33
|
}), (t)=>[
|
|
34
|
-
index(
|
|
35
|
-
index(
|
|
36
|
-
index(
|
|
34
|
+
index("core_users_name_code_idx").on(t.nameCode),
|
|
35
|
+
index("core_users_name_idx").on(t.name),
|
|
36
|
+
index("core_users_email_idx").on(t.email)
|
|
37
37
|
]).enableRLS();
|
|
38
38
|
export const core_users_relations = relations(core_users, ({ one, many })=>({
|
|
39
39
|
group: one(core_roles, {
|
|
@@ -70,9 +70,9 @@ export const core_users_relations = relations(core_users, ({ one, many })=>({
|
|
|
70
70
|
]
|
|
71
71
|
})
|
|
72
72
|
}));
|
|
73
|
-
export const core_users_sso = pgTable(
|
|
73
|
+
export const core_users_sso = pgTable("core_users_sso", (t)=>({
|
|
74
74
|
userId: t.integer().references(()=>core_users.id, {
|
|
75
|
-
onDelete:
|
|
75
|
+
onDelete: "cascade"
|
|
76
76
|
}).notNull(),
|
|
77
77
|
providerId: t.varchar({
|
|
78
78
|
length: 255
|
|
@@ -83,7 +83,7 @@ export const core_users_sso = pgTable('core_users_sso', (t)=>({
|
|
|
83
83
|
createdAt: t.timestamp().notNull().defaultNow(),
|
|
84
84
|
updatedAt: t.timestamp().notNull().$onUpdate(()=>new Date())
|
|
85
85
|
}), (t)=>[
|
|
86
|
-
index(
|
|
86
|
+
index("core_users_sso_user_id_idx").on(t.userId)
|
|
87
87
|
]).enableRLS();
|
|
88
88
|
export const core_users_sso_relations = relations(core_users_sso, ({ one })=>({
|
|
89
89
|
user: one(core_users, {
|
|
@@ -95,10 +95,10 @@ export const core_users_sso_relations = relations(core_users_sso, ({ one })=>({
|
|
|
95
95
|
]
|
|
96
96
|
})
|
|
97
97
|
}));
|
|
98
|
-
export const core_users_confirm_emails = pgTable(
|
|
98
|
+
export const core_users_confirm_emails = pgTable("core_users_confirm_emails", (t)=>({
|
|
99
99
|
id: t.serial().primaryKey(),
|
|
100
100
|
userId: t.integer().references(()=>core_users.id, {
|
|
101
|
-
onDelete:
|
|
101
|
+
onDelete: "cascade"
|
|
102
102
|
}).notNull(),
|
|
103
103
|
token: t.varchar({
|
|
104
104
|
length: 100
|
|
@@ -119,10 +119,10 @@ export const core_users_confirm_emails_relations = relations(core_users_confirm_
|
|
|
119
119
|
]
|
|
120
120
|
})
|
|
121
121
|
}));
|
|
122
|
-
export const core_users_forgot_password = pgTable(
|
|
122
|
+
export const core_users_forgot_password = pgTable("core_users_forgot_password", (t)=>({
|
|
123
123
|
id: t.serial().primaryKey(),
|
|
124
124
|
userId: t.integer().references(()=>core_users.id, {
|
|
125
|
-
onDelete:
|
|
125
|
+
onDelete: "cascade"
|
|
126
126
|
}).notNull().unique(),
|
|
127
127
|
token: t.varchar({
|
|
128
128
|
length: 100
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Config } from
|
|
2
|
-
import type { VitNodeApiConfig } from
|
|
1
|
+
import type { Config } from "drizzle-kit";
|
|
2
|
+
import type { VitNodeApiConfig } from "./vitnode.config";
|
|
3
3
|
export declare const defineVitNodeDrizzleConfig: ({ vitNodeApiConfig, ...args }: Config & {
|
|
4
4
|
vitNodeApiConfig: VitNodeApiConfig;
|
|
5
5
|
}) => Config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzle.config.d.ts","sourceRoot":"","sources":["../../src/drizzle.config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"drizzle.config.d.ts","sourceRoot":"","sources":["../../src/drizzle.config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,eAAO,MAAM,0BAA0B,GAAI,+BAGxC,MAAM,GAAG;IACV,gBAAgB,EAAE,gBAAgB,CAAC;CACpC,WA8EA,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
1
3
|
import { defineConfig } from "drizzle-kit";
|
|
2
|
-
import { existsSync, readdirSync } from "fs";
|
|
3
|
-
import { join, resolve } from "path";
|
|
4
4
|
export const defineVitNodeDrizzleConfig = ({ vitNodeApiConfig, ...args })=>{
|
|
5
5
|
const pluginId = vitNodeApiConfig.plugins.map((plugin)=>plugin.pluginId);
|
|
6
6
|
const findMonorepoRoot = (startPath)=>{
|
|
7
7
|
let currentPath = startPath;
|
|
8
|
-
while(currentPath !== resolve(currentPath,
|
|
9
|
-
const turboConfigPath = join(currentPath,
|
|
8
|
+
while(currentPath !== resolve(currentPath, "..")){
|
|
9
|
+
const turboConfigPath = join(currentPath, "turbo.json");
|
|
10
10
|
if (existsSync(turboConfigPath)) {
|
|
11
11
|
return currentPath;
|
|
12
12
|
}
|
|
13
|
-
currentPath = resolve(currentPath,
|
|
13
|
+
currentPath = resolve(currentPath, "..");
|
|
14
14
|
}
|
|
15
15
|
return null;
|
|
16
16
|
};
|
|
17
17
|
const checkPluginPath = (basePath, itemId)=>{
|
|
18
|
-
const pluginPath = resolve(basePath,
|
|
18
|
+
const pluginPath = resolve(basePath, "node_modules", itemId, "dist", "src", "database");
|
|
19
19
|
// Check if the plugin path exists
|
|
20
20
|
if (!existsSync(pluginPath)) {
|
|
21
21
|
return null;
|
|
@@ -23,10 +23,10 @@ export const defineVitNodeDrizzleConfig = ({ vitNodeApiConfig, ...args })=>{
|
|
|
23
23
|
// Check if there are any .js files in the directory
|
|
24
24
|
try {
|
|
25
25
|
const files = readdirSync(pluginPath);
|
|
26
|
-
const hasSchemaFiles = files.some((file)=>file.endsWith(
|
|
26
|
+
const hasSchemaFiles = files.some((file)=>file.endsWith(".js"));
|
|
27
27
|
if (!hasSchemaFiles) return null;
|
|
28
28
|
// Return glob pattern for schema files
|
|
29
|
-
return join(pluginPath,
|
|
29
|
+
return join(pluginPath, "*.js").replace(/\\/g, "/");
|
|
30
30
|
} catch {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
@@ -34,7 +34,7 @@ export const defineVitNodeDrizzleConfig = ({ vitNodeApiConfig, ...args })=>{
|
|
|
34
34
|
const cwd = process.cwd();
|
|
35
35
|
const monorepoRoot = findMonorepoRoot(cwd);
|
|
36
36
|
const pluginPaths = [
|
|
37
|
-
|
|
37
|
+
"@vitnode/core",
|
|
38
38
|
...pluginId
|
|
39
39
|
].flatMap((itemId)=>{
|
|
40
40
|
const paths = [];
|
|
@@ -48,12 +48,19 @@ export const defineVitNodeDrizzleConfig = ({ vitNodeApiConfig, ...args })=>{
|
|
|
48
48
|
}
|
|
49
49
|
return paths;
|
|
50
50
|
}).filter((pluginPath)=>pluginPath !== null);
|
|
51
|
+
// Normalize args.schema into an array without nested ternary expressions
|
|
52
|
+
let baseSchemas = [];
|
|
53
|
+
if (Array.isArray(args.schema)) {
|
|
54
|
+
baseSchemas = args.schema;
|
|
55
|
+
} else if (args.schema) {
|
|
56
|
+
baseSchemas = [
|
|
57
|
+
args.schema
|
|
58
|
+
];
|
|
59
|
+
}
|
|
51
60
|
return defineConfig({
|
|
52
61
|
...args,
|
|
53
62
|
schema: [
|
|
54
|
-
...
|
|
55
|
-
args.schema
|
|
56
|
-
] : [],
|
|
63
|
+
...baseSchemas,
|
|
57
64
|
...pluginPaths
|
|
58
65
|
]
|
|
59
66
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type TailwindConfig } from
|
|
2
|
-
import type { EmailModelSendArgs } from
|
|
3
|
-
export interface DefaultTemplateEmailProps extends Pick<EmailModelSendArgs,
|
|
1
|
+
import { type TailwindConfig } from "@react-email/components";
|
|
2
|
+
import type { EmailModelSendArgs } from "../api/models/email";
|
|
3
|
+
export interface DefaultTemplateEmailProps extends Pick<EmailModelSendArgs, "user"> {
|
|
4
4
|
i18n: {
|
|
5
5
|
locale: string;
|
|
6
6
|
messages: Record<string, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-template.d.ts","sourceRoot":"","sources":["../../../src/emails/default-template.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-template.d.ts","sourceRoot":"","sources":["../../../src/emails/default-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,cAAc,EAEpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAsB7D,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACxC,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QAEf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC/B,CAAC;IACF,aAAa,EAAE;QACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,IAAI,CAAC,EAAE;YACL,GAAG,CAAC,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,CAAC;SACf,CAAC;QACF,QAAQ,EAAE;YACR,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,KAAK,EAAE,MAAM,CAAC;YACd,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,cAAc,CAAC;KACjC,CAAC;CACH;AAGD,iBAAwB,oBAAoB,CAAC,EAC3C,QAAQ,EACR,IAAI,EAAE,EAAE,MAAM,EAAE,EAChB,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,GACrE,EAAE,yBAAyB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAwG3D;kBA5GuB,oBAAoB;;;;;;;;;;;;;;;;;;;eAApB,oBAAoB"}
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Body, Container, Head, Html, Img, Link, Preview, Section, Tailwind, Text } from "@react-email/components";
|
|
3
3
|
import { CONFIG } from "../lib/config.js";
|
|
4
|
+
DefaultTemplateEmail.PreviewProps = {
|
|
5
|
+
children: "This is a preview text for the email template.",
|
|
6
|
+
templateProps: {
|
|
7
|
+
metadata: {
|
|
8
|
+
title: "VitNode - Email Template",
|
|
9
|
+
shortTitle: "VitNode",
|
|
10
|
+
url: CONFIG.web.href
|
|
11
|
+
},
|
|
12
|
+
logo: {
|
|
13
|
+
src: "http://localhost:3000/logo_vitnode_dark.png"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
i18n: {
|
|
17
|
+
messages: {},
|
|
18
|
+
locale: "en"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: <needed>
|
|
4
22
|
export default function DefaultTemplateEmail({ children, i18n: { locale }, templateProps: { logo, metadata, previewText, head, tailwindConfig } }) {
|
|
5
23
|
return /*#__PURE__*/ _jsxs(Html, {
|
|
6
24
|
lang: locale,
|
|
@@ -20,25 +38,25 @@ export default function DefaultTemplateEmail({ children, i18n: { locale }, templ
|
|
|
20
38
|
...tailwindConfig?.theme?.extend,
|
|
21
39
|
colors: {
|
|
22
40
|
...tailwindConfig?.theme?.extend?.colors,
|
|
23
|
-
background: tailwindConfig?.theme?.extend?.colors?.[
|
|
24
|
-
foreground: tailwindConfig?.theme?.extend?.colors?.[
|
|
25
|
-
card: tailwindConfig?.theme?.extend?.colors?.[
|
|
26
|
-
|
|
27
|
-
popover: tailwindConfig?.theme?.extend?.colors?.[
|
|
28
|
-
|
|
29
|
-
primary: tailwindConfig?.theme?.extend?.colors?.[
|
|
30
|
-
|
|
31
|
-
secondary: tailwindConfig?.theme?.extend?.colors?.[
|
|
32
|
-
|
|
33
|
-
muted: tailwindConfig?.theme?.extend?.colors?.[
|
|
34
|
-
|
|
35
|
-
accent: tailwindConfig?.theme?.extend?.colors?.[
|
|
36
|
-
|
|
37
|
-
destructive: tailwindConfig?.theme?.extend?.colors?.[
|
|
38
|
-
warn: tailwindConfig?.theme?.extend?.colors?.[
|
|
39
|
-
border: tailwindConfig?.theme?.extend?.colors?.[
|
|
40
|
-
input: tailwindConfig?.theme?.extend?.colors?.[
|
|
41
|
-
ring: tailwindConfig?.theme?.extend?.colors?.[
|
|
41
|
+
background: tailwindConfig?.theme?.extend?.colors?.["background"] ?? "#edf2f8",
|
|
42
|
+
foreground: tailwindConfig?.theme?.extend?.colors?.["foreground"] ?? "#0e1216",
|
|
43
|
+
card: tailwindConfig?.theme?.extend?.colors?.["card"] ?? "#ffffff",
|
|
44
|
+
"card-foreground": tailwindConfig?.theme?.extend?.colors?.["card-foreground"] ?? "#171b1f",
|
|
45
|
+
popover: tailwindConfig?.theme?.extend?.colors?.["popover"] ?? "#ffffff",
|
|
46
|
+
"popover-foreground": tailwindConfig?.theme?.extend?.colors?.["popover-foreground"] ?? "#171b1f",
|
|
47
|
+
primary: tailwindConfig?.theme?.extend?.colors?.["primary"] ?? "#3160c0",
|
|
48
|
+
"primary-foreground": tailwindConfig?.theme?.extend?.colors?.["primary-foreground"] ?? "#fafafa",
|
|
49
|
+
secondary: tailwindConfig?.theme?.extend?.colors?.["secondary"] ?? "#f4f9ff",
|
|
50
|
+
"secondary-foreground": tailwindConfig?.theme?.extend?.colors?.["secondary-foreground"] ?? "#1e2226",
|
|
51
|
+
muted: tailwindConfig?.theme?.extend?.colors?.["muted"] ?? "#eaeff5",
|
|
52
|
+
"muted-foreground": tailwindConfig?.theme?.extend?.colors?.["muted-foreground"] ?? "#686c72",
|
|
53
|
+
accent: tailwindConfig?.theme?.extend?.colors?.["accent"] ?? "#e0e5eb",
|
|
54
|
+
"accent-foreground": tailwindConfig?.theme?.extend?.colors?.["accent-foreground"] ?? "#1e2226",
|
|
55
|
+
destructive: tailwindConfig?.theme?.extend?.colors?.["destructive"] ?? "#de3b3f",
|
|
56
|
+
warn: tailwindConfig?.theme?.extend?.colors?.["warn"] ?? "#906600",
|
|
57
|
+
border: tailwindConfig?.theme?.extend?.colors?.["border"] ?? "#d9dfe4",
|
|
58
|
+
input: tailwindConfig?.theme?.extend?.colors?.["input"] ?? "#d9dfe4",
|
|
59
|
+
ring: tailwindConfig?.theme?.extend?.colors?.["ring"] ?? "#5aa3ec"
|
|
42
60
|
}
|
|
43
61
|
}
|
|
44
62
|
}
|
|
@@ -68,7 +86,7 @@ export default function DefaultTemplateEmail({ children, i18n: { locale }, templ
|
|
|
68
86
|
children: [
|
|
69
87
|
metadata.shortTitle ?? metadata.title,
|
|
70
88
|
" ©",
|
|
71
|
-
|
|
89
|
+
" ",
|
|
72
90
|
new Date().getFullYear()
|
|
73
91
|
]
|
|
74
92
|
})
|
|
@@ -80,20 +98,3 @@ export default function DefaultTemplateEmail({ children, i18n: { locale }, templ
|
|
|
80
98
|
]
|
|
81
99
|
});
|
|
82
100
|
}
|
|
83
|
-
DefaultTemplateEmail.PreviewProps = {
|
|
84
|
-
children: 'This is a preview text for the email template.',
|
|
85
|
-
templateProps: {
|
|
86
|
-
metadata: {
|
|
87
|
-
title: 'VitNode - Email Template',
|
|
88
|
-
shortTitle: 'VitNode',
|
|
89
|
-
url: CONFIG.web.href
|
|
90
|
-
},
|
|
91
|
-
logo: {
|
|
92
|
-
src: 'http://localhost:3000/logo_vitnode_dark.png'
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
i18n: {
|
|
96
|
-
messages: {},
|
|
97
|
-
locale: 'en'
|
|
98
|
-
}
|
|
99
|
-
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-password.d.ts","sourceRoot":"","sources":["../../../src/emails/reset-password.tsx"],"names":[],"mappings":"AAGA,OAA6B,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,oBAAoB,CAAC;AAW5B,UAAU,+BAAgC,SAAQ,yBAAyB;IACzE,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;
|
|
1
|
+
{"version":3,"file":"reset-password.d.ts","sourceRoot":"","sources":["../../../src/emails/reset-password.tsx"],"names":[],"mappings":"AAGA,OAA6B,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,oBAAoB,CAAC;AAW5B,UAAU,+BAAgC,SAAQ,yBAAyB;IACzE,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA0CD,iBAAwB,0BAA0B,CAAC,EACjD,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,+BAA+B,2CAgFjC;kBAvFuB,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAA1B,0BAA0B"}
|
|
@@ -4,14 +4,49 @@ import { createTranslator } from "use-intl";
|
|
|
4
4
|
import DefaultTemplateEmail from "./default-template.js";
|
|
5
5
|
import { EmailButton } from "./ui/button.js";
|
|
6
6
|
import { EmailCard, EmailCardContent, EmailCardDescription, EmailCardFooter, EmailCardHeader, EmailCardTitle } from "./ui/card.js";
|
|
7
|
+
ResetPasswordEmailTemplate.PreviewProps = {
|
|
8
|
+
...DefaultTemplateEmail.PreviewProps,
|
|
9
|
+
resetUrl: "https://example.com/reset-password?token=abc123",
|
|
10
|
+
expiryDate: new Date(Date.now() + 30 * 60 * 1000),
|
|
11
|
+
userIpAddress: "192.168.1.1",
|
|
12
|
+
user: {
|
|
13
|
+
id: 1,
|
|
14
|
+
name: "John Doe",
|
|
15
|
+
email: "john@example.com",
|
|
16
|
+
language: "en",
|
|
17
|
+
nameCode: "john-doe"
|
|
18
|
+
},
|
|
19
|
+
i18n: {
|
|
20
|
+
...DefaultTemplateEmail.PreviewProps.i18n,
|
|
21
|
+
messages: {
|
|
22
|
+
core: {
|
|
23
|
+
auth: {
|
|
24
|
+
reset_password: {
|
|
25
|
+
email: {
|
|
26
|
+
subject: "Reset your password",
|
|
27
|
+
greeting: "Hello {name}!",
|
|
28
|
+
intro: "We received a request to reset your password for your account.",
|
|
29
|
+
button: "Reset Password",
|
|
30
|
+
instructions: "Click the button above to reset your password. This link will expire in 30 minutes for security reasons.",
|
|
31
|
+
no_action: "If you didn't request a password reset, you can safely ignore this email. Your password will remain unchanged.",
|
|
32
|
+
security_note: "For your security, this request was made from IP address: {ip}",
|
|
33
|
+
help: "If you're having trouble with the button above, copy and paste the URL below into your web browser:",
|
|
34
|
+
expire_time: "This link will expire on {date}"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
7
42
|
export default function ResetPasswordEmailTemplate({ i18n, resetUrl, expiryDate, userIpAddress, user, ...props }) {
|
|
8
43
|
const t = createTranslator(i18n);
|
|
9
|
-
const userName = user?.name ??
|
|
44
|
+
const userName = user?.name ?? "there";
|
|
10
45
|
return /*#__PURE__*/ _jsxs(DefaultTemplateEmail, {
|
|
11
46
|
i18n: i18n,
|
|
12
47
|
templateProps: {
|
|
13
48
|
...props.templateProps,
|
|
14
|
-
previewText: t(
|
|
49
|
+
previewText: t("core.auth.reset_password.email.subject")
|
|
15
50
|
},
|
|
16
51
|
user: user,
|
|
17
52
|
children: [
|
|
@@ -20,12 +55,12 @@ export default function ResetPasswordEmailTemplate({ i18n, resetUrl, expiryDate,
|
|
|
20
55
|
/*#__PURE__*/ _jsxs(EmailCardHeader, {
|
|
21
56
|
children: [
|
|
22
57
|
/*#__PURE__*/ _jsx(EmailCardTitle, {
|
|
23
|
-
children: t(
|
|
58
|
+
children: t("core.auth.reset_password.email.greeting", {
|
|
24
59
|
name: userName
|
|
25
60
|
})
|
|
26
61
|
}),
|
|
27
62
|
/*#__PURE__*/ _jsx(EmailCardDescription, {
|
|
28
|
-
children: t(
|
|
63
|
+
children: t("core.auth.reset_password.email.intro")
|
|
29
64
|
})
|
|
30
65
|
]
|
|
31
66
|
}),
|
|
@@ -37,23 +72,23 @@ export default function ResetPasswordEmailTemplate({ i18n, resetUrl, expiryDate,
|
|
|
37
72
|
className: "min-w-[200px]",
|
|
38
73
|
href: resetUrl,
|
|
39
74
|
size: "lg",
|
|
40
|
-
children: t(
|
|
75
|
+
children: t("core.auth.reset_password.email.button")
|
|
41
76
|
})
|
|
42
77
|
}),
|
|
43
78
|
/*#__PURE__*/ _jsx(Text, {
|
|
44
79
|
className: "text-muted-foreground mt-6 text-sm leading-relaxed",
|
|
45
|
-
children: t(
|
|
80
|
+
children: t("core.auth.reset_password.email.instructions")
|
|
46
81
|
}),
|
|
47
82
|
/*#__PURE__*/ _jsx(Text, {
|
|
48
83
|
className: "text-muted-foreground mt-4 text-sm leading-relaxed",
|
|
49
|
-
children: t(
|
|
84
|
+
children: t("core.auth.reset_password.email.expire_time", {
|
|
50
85
|
date: expiryDate.toLocaleString(i18n.locale, {
|
|
51
|
-
year:
|
|
52
|
-
month:
|
|
53
|
-
day:
|
|
54
|
-
hour:
|
|
55
|
-
minute:
|
|
56
|
-
timeZoneName:
|
|
86
|
+
year: "numeric",
|
|
87
|
+
month: "long",
|
|
88
|
+
day: "numeric",
|
|
89
|
+
hour: "2-digit",
|
|
90
|
+
minute: "2-digit",
|
|
91
|
+
timeZoneName: "short"
|
|
57
92
|
})
|
|
58
93
|
})
|
|
59
94
|
})
|
|
@@ -66,11 +101,11 @@ export default function ResetPasswordEmailTemplate({ i18n, resetUrl, expiryDate,
|
|
|
66
101
|
}),
|
|
67
102
|
/*#__PURE__*/ _jsx(Text, {
|
|
68
103
|
className: "text-muted-foreground m-0 text-sm leading-relaxed",
|
|
69
|
-
children: t(
|
|
104
|
+
children: t("core.auth.reset_password.email.no_action")
|
|
70
105
|
}),
|
|
71
106
|
userIpAddress && /*#__PURE__*/ _jsx(Text, {
|
|
72
107
|
className: "text-muted-foreground mt-4 text-xs",
|
|
73
|
-
children: t(
|
|
108
|
+
children: t("core.auth.reset_password.email.security_note", {
|
|
74
109
|
ip: userIpAddress
|
|
75
110
|
})
|
|
76
111
|
})
|
|
@@ -83,7 +118,7 @@ export default function ResetPasswordEmailTemplate({ i18n, resetUrl, expiryDate,
|
|
|
83
118
|
children: [
|
|
84
119
|
/*#__PURE__*/ _jsx(Text, {
|
|
85
120
|
className: "text-muted-foreground text-sm",
|
|
86
|
-
children: t(
|
|
121
|
+
children: t("core.auth.reset_password.email.help")
|
|
87
122
|
}),
|
|
88
123
|
/*#__PURE__*/ _jsx(Link, {
|
|
89
124
|
className: "text-primary break-all text-sm underline",
|
|
@@ -95,38 +130,3 @@ export default function ResetPasswordEmailTemplate({ i18n, resetUrl, expiryDate,
|
|
|
95
130
|
]
|
|
96
131
|
});
|
|
97
132
|
}
|
|
98
|
-
ResetPasswordEmailTemplate.PreviewProps = {
|
|
99
|
-
...DefaultTemplateEmail.PreviewProps,
|
|
100
|
-
resetUrl: 'https://example.com/reset-password?token=abc123',
|
|
101
|
-
expiryDate: new Date(Date.now() + 30 * 60 * 1000),
|
|
102
|
-
userIpAddress: '192.168.1.1',
|
|
103
|
-
user: {
|
|
104
|
-
id: 1,
|
|
105
|
-
name: 'John Doe',
|
|
106
|
-
email: 'john@example.com',
|
|
107
|
-
language: 'en',
|
|
108
|
-
nameCode: 'john-doe'
|
|
109
|
-
},
|
|
110
|
-
i18n: {
|
|
111
|
-
...DefaultTemplateEmail.PreviewProps.i18n,
|
|
112
|
-
messages: {
|
|
113
|
-
core: {
|
|
114
|
-
auth: {
|
|
115
|
-
reset_password: {
|
|
116
|
-
email: {
|
|
117
|
-
subject: 'Reset your password',
|
|
118
|
-
greeting: 'Hello {name}!',
|
|
119
|
-
intro: 'We received a request to reset your password for your account.',
|
|
120
|
-
button: 'Reset Password',
|
|
121
|
-
instructions: 'Click the button above to reset your password. This link will expire in 30 minutes for security reasons.',
|
|
122
|
-
no_action: "If you didn't request a password reset, you can safely ignore this email. Your password will remain unchanged.",
|
|
123
|
-
security_note: 'For your security, this request was made from IP address: {ip}',
|
|
124
|
-
help: "If you're having trouble with the button above, copy and paste the URL below into your web browser:",
|
|
125
|
-
expire_time: 'This link will expire on {date}'
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Button as ButtonReactEmail } from
|
|
2
|
-
import { type VariantProps } from
|
|
1
|
+
import { Button as ButtonReactEmail } from "@react-email/components";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "secondary" | "destructive" | "default" | "destructiveGhost" | "outline" | "ghost" | null | undefined;
|
|
5
5
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
@@ -2,26 +2,26 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Button as ButtonReactEmail } from "@react-email/components";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
|
-
const buttonVariants = cva(
|
|
5
|
+
const buttonVariants = cva("cursor-pointer whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all", {
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
|
-
default:
|
|
9
|
-
destructive:
|
|
10
|
-
destructiveGhost:
|
|
11
|
-
outline:
|
|
12
|
-
secondary:
|
|
13
|
-
ghost:
|
|
14
|
-
link:
|
|
8
|
+
default: "bg-primary text-primary-foreground shadow-xs",
|
|
9
|
+
destructive: "bg-destructive text-white shadow-xs",
|
|
10
|
+
destructiveGhost: "text-destructive",
|
|
11
|
+
outline: "border bg-background shadow-xs",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs",
|
|
13
|
+
ghost: "",
|
|
14
|
+
link: "text-primary underline-offset-4"
|
|
15
15
|
},
|
|
16
16
|
size: {
|
|
17
|
-
default:
|
|
18
|
-
sm:
|
|
19
|
-
lg:
|
|
17
|
+
default: "px-4 py-2",
|
|
18
|
+
sm: "rounded-md gap-1.5 px-3 py-1.5",
|
|
19
|
+
lg: "rounded-md px-6 py-2.5"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
defaultVariants: {
|
|
23
|
-
variant:
|
|
24
|
-
size:
|
|
23
|
+
variant: "default",
|
|
24
|
+
size: "default"
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
export const EmailButton = ({ className, variant, size, ...props })=>{
|