@vitnode/core 1.2.0-canary.52 → 1.2.0-canary.54
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 +0 -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 +3 -3
- package/dist/scripts/shared/file-utils.d.ts.map +1 -1
- package/dist/src/api/adapters/cron/node-cron.adapter.d.ts +3 -0
- package/dist/src/api/adapters/cron/node-cron.adapter.d.ts.map +1 -0
- package/dist/src/api/adapters/cron/node-cron.adapter.js +11 -0
- 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 +30 -18
- package/dist/src/api/lib/check-plugin-id.js +8 -8
- package/dist/src/api/lib/cron.d.ts +18 -0
- package/dist/src/api/lib/cron.d.ts.map +1 -0
- package/dist/src/api/lib/cron.js +22 -0
- 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 +6 -3
- package/dist/src/api/lib/module.d.ts.map +1 -1
- package/dist/src/api/lib/module.js +3 -2
- package/dist/src/api/lib/plugin.d.ts +4 -2
- package/dist/src/api/lib/plugin.d.ts.map +1 -1
- package/dist/src/api/lib/plugin.js +9 -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/cron-auth.middleware.d.ts +3 -0
- package/dist/src/api/middlewares/cron-auth.middleware.d.ts.map +1 -0
- package/dist/src/api/middlewares/cron-auth.middleware.js +19 -0
- package/dist/src/api/middlewares/global.middleware.d.ts +18 -12
- package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/global.middleware.js +46 -34
- 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 +2 -2
- 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 +1 -1
- package/dist/src/api/models/user.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.d.ts +166 -4
- package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.js +7 -4
- package/dist/src/api/modules/admin/advanced/advanced.admin.module.d.ts +164 -0
- package/dist/src/api/modules/admin/advanced/advanced.admin.module.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/advanced.admin.module.js +11 -0
- package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.d.ts +164 -0
- package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.js +12 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/get.route.d.ts +98 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/get.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/get.route.js +66 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/run.route.d.ts +70 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/run.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/run.route.js +95 -0
- 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 +2 -2
- 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 +17 -17
- package/dist/src/api/modules/admin/routes/session.route.d.ts +2 -2
- package/dist/src/api/modules/admin/routes/session.route.js +8 -8
- 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 +13 -13
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts +5 -5
- package/dist/src/api/modules/admin/users/routes/users.route.js +16 -16
- 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 +2 -2
- package/dist/src/api/modules/cron/cron/clean.cron.d.ts +2 -0
- package/dist/src/api/modules/cron/cron/clean.cron.d.ts.map +1 -0
- package/dist/src/api/modules/cron/cron/clean.cron.js +24 -0
- package/dist/src/api/modules/cron/cron.module.d.ts +26 -0
- package/dist/src/api/modules/cron/cron.module.d.ts.map +1 -0
- package/dist/src/api/modules/cron/cron.module.js +14 -0
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts +36 -0
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts.map +1 -0
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.js +72 -0
- package/dist/src/api/modules/cron/routes/cron.route.d.ts +27 -0
- package/dist/src/api/modules/cron/routes/cron.route.d.ts.map +1 -0
- package/dist/src/api/modules/cron/routes/cron.route.js +95 -0
- package/dist/src/api/modules/middleware/middleware.module.d.ts +1 -1
- package/dist/src/api/modules/middleware/middleware.module.js +2 -2
- package/dist/src/api/modules/middleware/route.d.ts +2 -2
- package/dist/src/api/modules/middleware/route.js +13 -13
- 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 +14 -14
- 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 +18 -18
- package/dist/src/api/modules/users/routes/session.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/session.route.js +7 -7
- 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 +11 -11
- 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 +8 -8
- 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 +15 -15
- package/dist/src/api/modules/users/routes/test.route.d.ts +3 -3
- package/dist/src/api/modules/users/routes/test.route.js +10 -10
- 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 +9 -9
- 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 +7 -7
- package/dist/src/api/modules/users/sso/sso.module.d.ts +2 -2
- package/dist/src/api/modules/users/sso/sso.module.js +2 -2
- package/dist/src/api/modules/users/users.module.d.ts +12 -12
- package/dist/src/api/modules/users/users.module.js +2 -2
- package/dist/src/api/plugin.d.ts.map +1 -1
- package/dist/src/api/plugin.js +4 -2
- 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/advanced/cron/page.d.ts +11 -0
- package/dist/src/app_admin/core/advanced/cron/page.d.ts.map +1 -0
- package/dist/src/app_admin/core/advanced/cron/page.js +42 -0
- 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 → language-switcher.d.ts} +2 -2
- package/dist/src/components/switchers/langs/language-switcher.d.ts.map +1 -0
- package/dist/src/components/switchers/langs/{language-swietcher.js → language-switcher.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/tiptap/extension.d.ts +4 -0
- package/dist/src/components/tiptap/extension.d.ts.map +1 -0
- package/dist/src/components/tiptap/extension.js +26 -0
- package/dist/src/components/tiptap/toolbar/actions/bold-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/bold-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/bold-action.js +39 -0
- package/dist/src/components/tiptap/toolbar/actions/headings-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/headings-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/headings-action.js +94 -0
- package/dist/src/components/tiptap/toolbar/actions/italic-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/italic-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/italic-action.js +38 -0
- package/dist/src/components/tiptap/toolbar/actions/list-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/list-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/list-action.js +60 -0
- package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.js +59 -0
- package/dist/src/components/tiptap/toolbar/actions/underline-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/underline-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/underline-action.js +38 -0
- package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.js +63 -0
- package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.d.ts +4 -0
- package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.js +11 -0
- package/dist/src/components/tiptap/toolbar/tiptap-toolbar.d.ts +5 -0
- package/dist/src/components/tiptap/toolbar/tiptap-toolbar.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/tiptap-toolbar.js +35 -0
- package/dist/src/components/tiptap/toolbar/use-toolbar-editor.d.ts +9 -0
- package/dist/src/components/tiptap/toolbar/use-toolbar-editor.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/use-toolbar-editor.js +5 -0
- 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.d.ts.map +1 -1
- package/dist/src/components/ui/button-client.js +10 -10
- 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 +14 -15
- 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/editor-content.d.ts +4 -0
- package/dist/src/components/ui/editor-content.d.ts.map +1 -0
- package/dist/src/components/ui/editor-content.js +10 -0
- package/dist/src/components/ui/editor.d.ts +6 -0
- package/dist/src/components/ui/editor.d.ts.map +1 -0
- package/dist/src/components/ui/editor.js +35 -0
- 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 +78 -80
- 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 +6 -3
- package/dist/src/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/components/ui/tooltip.js +20 -5
- package/dist/src/config.js +2 -2
- package/dist/src/database/admins.js +10 -10
- package/dist/src/database/cron.d.ts +171 -0
- package/dist/src/database/cron.d.ts.map +1 -0
- package/dist/src/database/cron.js +22 -0
- 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.d.ts +2 -2
- package/dist/src/database/users.js +14 -14
- 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-next-cron-run-date.d.ts +2 -0
- package/dist/src/lib/api/get-next-cron-run-date.d.ts.map +1 -0
- package/dist/src/lib/api/get-next-cron-run-date.js +14 -0
- package/dist/src/lib/api/get-next-cron-run-date.test.d.ts +2 -0
- package/dist/src/lib/api/get-next-cron-run-date.test.d.ts.map +1 -0
- package/dist/src/lib/api/get-next-cron-run-date.test.js +55 -0
- 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/api/should-cron-job-run.d.ts +2 -0
- package/dist/src/lib/api/should-cron-job-run.d.ts.map +1 -0
- package/dist/src/lib/api/should-cron-job-run.js +16 -0
- package/dist/src/lib/api/should-cron-job-run.test.d.ts +2 -0
- package/dist/src/lib/api/should-cron-job-run.test.d.ts.map +1 -0
- package/dist/src/lib/api/should-cron-job-run.test.js +213 -0
- package/dist/src/lib/colors.js +28 -19
- package/dist/src/lib/colors.test.js +60 -60
- package/dist/src/lib/config.d.ts +1 -0
- package/dist/src/lib/config.d.ts.map +1 -1
- package/dist/src/lib/config.js +8 -6
- package/dist/src/lib/ctrl-or-command-character.d.ts +2 -0
- package/dist/src/lib/ctrl-or-command-character.d.ts.map +1 -0
- package/dist/src/lib/ctrl-or-command-character.js +9 -0
- 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 +3 -3
- 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 +5 -9
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/item.js +8 -12
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/nav.js +23 -12
- 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/advanced/cron/cron-table-view.d.ts +5 -0
- package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.js +97 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.d.ts +4 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.js +23 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.d.ts +4 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.js +37 -0
- 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.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +16 -25
- 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.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/test.js +134 -124
- 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 +2 -2
- 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 +18 -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 +32 -29
- 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/advanced/cron/page.tsx +41 -0
- 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
- package/src/locales/en.json +43 -0
- package/src/tiptap.css +20 -0
- package/dist/src/components/switchers/langs/language-swietcher.d.ts.map +0 -1
|
@@ -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 })=>{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Section, Text } from
|
|
1
|
+
import { Section, Text } from "@react-email/components";
|
|
2
2
|
export declare const EmailCard: ({ className, ...props }: React.ComponentProps<typeof Section>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const EmailCardHeader: ({ className, ...props }: React.ComponentProps<typeof Section>) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const EmailCardTitle: ({ className, ...props }: React.ComponentProps<typeof Text>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,37 +3,37 @@ import { Section, Text } from "@react-email/components";
|
|
|
3
3
|
import { cn } from "../../lib/utils.js";
|
|
4
4
|
export const EmailCard = ({ className, ...props })=>{
|
|
5
5
|
return /*#__PURE__*/ _jsx(Section, {
|
|
6
|
-
className: cn(
|
|
6
|
+
className: cn("bg-card text-card-foreground border-border rounded-xl border border-solid py-6 shadow-sm", className),
|
|
7
7
|
...props
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
export const EmailCardHeader = ({ className, ...props })=>{
|
|
11
11
|
return /*#__PURE__*/ _jsx(Section, {
|
|
12
|
-
className: cn(
|
|
12
|
+
className: cn("mb-6 px-6", className),
|
|
13
13
|
...props
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
export const EmailCardTitle = ({ className, ...props })=>{
|
|
17
17
|
return /*#__PURE__*/ _jsx(Text, {
|
|
18
|
-
className: cn(
|
|
18
|
+
className: cn("text-xl font-semibold leading-[0]", className),
|
|
19
19
|
...props
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
export const EmailCardDescription = ({ className, ...props })=>{
|
|
23
23
|
return /*#__PURE__*/ _jsx(Text, {
|
|
24
|
-
className: cn(
|
|
24
|
+
className: cn("text-muted-foreground m-0 text-sm", className),
|
|
25
25
|
...props
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
28
|
export const EmailCardContent = ({ className, ...props })=>{
|
|
29
29
|
return /*#__PURE__*/ _jsx(Section, {
|
|
30
|
-
className: cn(
|
|
30
|
+
className: cn("px-6", className),
|
|
31
31
|
...props
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
export const EmailCardFooter = ({ className, ...props })=>{
|
|
35
35
|
return /*#__PURE__*/ _jsx(Section, {
|
|
36
|
-
className: cn(
|
|
36
|
+
className: cn("mt-6 px-6", className),
|
|
37
37
|
...props
|
|
38
38
|
});
|
|
39
39
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export const useBeforeUnload = (enabled = true, message)=>{
|
|
3
3
|
const handler = React.useCallback((event)=>{
|
|
4
|
-
const finalEnabled = typeof enabled ===
|
|
4
|
+
const finalEnabled = typeof enabled === "function" ? enabled() : true;
|
|
5
5
|
if (!finalEnabled) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
@@ -19,9 +19,9 @@ export const useBeforeUnload = (enabled = true, message)=>{
|
|
|
19
19
|
if (!enabled) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
window.addEventListener(
|
|
22
|
+
window.addEventListener("beforeunload", handler);
|
|
23
23
|
return ()=>{
|
|
24
|
-
window.removeEventListener(
|
|
24
|
+
window.removeEventListener("beforeunload", handler);
|
|
25
25
|
};
|
|
26
26
|
}, [
|
|
27
27
|
enabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { z } from
|
|
2
|
-
import type { routeMiddlewareSchema } from
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { routeMiddlewareSchema } from "../api/modules/middleware/route";
|
|
3
3
|
export declare const useCaptcha: (captcha: z.infer<typeof routeMiddlewareSchema>["captcha"]) => {
|
|
4
4
|
isReady: boolean;
|
|
5
5
|
onReset: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-captcha.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-captcha.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-captcha.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-captcha.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAI7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,eAAO,MAAM,UAAU,GACrB,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC,SAAS,CAAC;;;oBA4G9B,OAAO,CAAC,MAAM,CAAC;CA4B3C,CAAC"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noConsole: <no needed> */ import { useLocale, useTranslations } from "next-intl";
|
|
2
2
|
import { useTheme } from "next-themes";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { toast } from "sonner";
|
|
5
5
|
import { usePathname } from "../lib/navigation.js";
|
|
6
6
|
export const useCaptcha = (captcha)=>{
|
|
7
|
-
const t = useTranslations(
|
|
7
|
+
const t = useTranslations("core.global.errors");
|
|
8
8
|
const locale = useLocale();
|
|
9
9
|
const { resolvedTheme } = useTheme();
|
|
10
10
|
const [isReady, setIsReady] = React.useState(false);
|
|
11
|
-
const [token, setToken] = React.useState(
|
|
11
|
+
const [token, setToken] = React.useState("");
|
|
12
12
|
const pathname = usePathname();
|
|
13
13
|
const handleLoaded = ()=>{
|
|
14
14
|
if (!captcha) return;
|
|
15
|
-
const elementId =
|
|
16
|
-
if (captcha.type ===
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15
|
+
const elementId = "vitnode_captcha";
|
|
16
|
+
if (captcha.type === "cloudflare_turnstile") {
|
|
18
17
|
// @ts-expect-error
|
|
19
18
|
window.turnstile.render(`#${elementId}`, {
|
|
20
19
|
sitekey: captcha.siteKey,
|
|
@@ -26,7 +25,7 @@ export const useCaptcha = (captcha)=>{
|
|
|
26
25
|
setIsReady(true);
|
|
27
26
|
},
|
|
28
27
|
// Optional: Add more callbacks for a better user experience
|
|
29
|
-
|
|
28
|
+
"expired-callback": ()=>{
|
|
30
29
|
onReset();
|
|
31
30
|
}
|
|
32
31
|
});
|
|
@@ -36,10 +35,11 @@ export const useCaptcha = (captcha)=>{
|
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
37
|
const handleError = ()=>{
|
|
39
|
-
toast.error(t(
|
|
40
|
-
description: t(
|
|
38
|
+
toast.error(t("title"), {
|
|
39
|
+
description: t("captcha_internal_error")
|
|
41
40
|
});
|
|
42
41
|
};
|
|
42
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: <needed>
|
|
43
43
|
React.useEffect(()=>{
|
|
44
44
|
if (!captcha) {
|
|
45
45
|
// If no captcha is required, consider it "ready"
|
|
@@ -48,30 +48,30 @@ export const useCaptcha = (captcha)=>{
|
|
|
48
48
|
}
|
|
49
49
|
// Reset state on captcha type change
|
|
50
50
|
setIsReady(false);
|
|
51
|
-
setToken(
|
|
51
|
+
setToken("");
|
|
52
52
|
const googleCaptchaDomain = `https://www.google.com/recaptcha/api.js?hl=${locale}`;
|
|
53
|
-
const script = document.createElement(
|
|
54
|
-
if (captcha.type ===
|
|
55
|
-
script.src =
|
|
56
|
-
} else if (captcha.type ===
|
|
53
|
+
const script = document.createElement("script");
|
|
54
|
+
if (captcha.type === "cloudflare_turnstile") {
|
|
55
|
+
script.src = "https://challenges.cloudflare.com/turnstile/v0/api.js";
|
|
56
|
+
} else if (captcha.type === "recaptcha_v3") {
|
|
57
57
|
script.src = `${googleCaptchaDomain}&render=${captcha.siteKey}`;
|
|
58
58
|
}
|
|
59
59
|
if (!script.src) return;
|
|
60
60
|
script.async = true;
|
|
61
61
|
script.defer = true;
|
|
62
62
|
document.body.appendChild(script);
|
|
63
|
-
script.addEventListener(
|
|
64
|
-
script.addEventListener(
|
|
63
|
+
script.addEventListener("load", handleLoaded);
|
|
64
|
+
script.addEventListener("error", handleError);
|
|
65
65
|
return ()=>{
|
|
66
|
-
script.removeEventListener(
|
|
67
|
-
script.removeEventListener(
|
|
66
|
+
script.removeEventListener("load", handleLoaded);
|
|
67
|
+
script.removeEventListener("error", handleError);
|
|
68
68
|
if (document.body.contains(script)) {
|
|
69
69
|
document.body.removeChild(script);
|
|
70
70
|
}
|
|
71
71
|
// Clean up the captcha widget if it exists
|
|
72
|
-
const widget = document.getElementById(
|
|
72
|
+
const widget = document.getElementById("vitnode_captcha");
|
|
73
73
|
if (widget) {
|
|
74
|
-
widget.innerHTML =
|
|
74
|
+
widget.innerHTML = "";
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
}, [
|
|
@@ -82,36 +82,28 @@ export const useCaptcha = (captcha)=>{
|
|
|
82
82
|
]);
|
|
83
83
|
const onReset = ()=>{
|
|
84
84
|
if (!captcha) return;
|
|
85
|
-
if (captcha.type ===
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
85
|
+
if (captcha.type === "cloudflare_turnstile" && window.turnstile) {
|
|
87
86
|
// @ts-expect-error
|
|
88
|
-
|
|
89
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
90
|
-
// @ts-expect-error
|
|
91
|
-
window.turnstile.reset();
|
|
92
|
-
}
|
|
87
|
+
window.turnstile.reset();
|
|
93
88
|
}
|
|
94
|
-
setToken(
|
|
89
|
+
setToken("");
|
|
95
90
|
setIsReady(false);
|
|
96
91
|
};
|
|
97
92
|
const getToken = async ()=>{
|
|
98
|
-
if (!captcha) return
|
|
99
|
-
if (captcha.type ===
|
|
100
|
-
return new Promise((resolve)=>{
|
|
101
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
93
|
+
if (!captcha) return "";
|
|
94
|
+
if (captcha.type === "recaptcha_v3") {
|
|
95
|
+
return await new Promise((resolve)=>{
|
|
102
96
|
// @ts-expect-error
|
|
103
97
|
window.grecaptcha.ready(async ()=>{
|
|
104
98
|
try {
|
|
105
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
106
99
|
// @ts-expect-error
|
|
107
100
|
const token = await window.grecaptcha.execute(captcha.siteKey, {
|
|
108
|
-
action:
|
|
101
|
+
action: "submit"
|
|
109
102
|
});
|
|
110
103
|
resolve(token);
|
|
111
104
|
} catch (error) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
resolve('');
|
|
105
|
+
console.error("Captcha error", error);
|
|
106
|
+
resolve("");
|
|
115
107
|
}
|
|
116
108
|
});
|
|
117
109
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,YAiB1B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
const MOBILE_BREAKPOINT = 768;
|
|
3
3
|
export function useIsMobile() {
|
|
4
4
|
const [isMobile, setIsMobile] = React.useState(undefined);
|
|
@@ -7,10 +7,9 @@ export function useIsMobile() {
|
|
|
7
7
|
const onChange = ()=>{
|
|
8
8
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
9
9
|
};
|
|
10
|
-
mql.addEventListener(
|
|
11
|
-
// eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect
|
|
10
|
+
mql.addEventListener("change", onChange);
|
|
12
11
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
13
|
-
return ()=>mql.removeEventListener(
|
|
12
|
+
return ()=>mql.removeEventListener("change", onChange);
|
|
14
13
|
}, []);
|
|
15
14
|
return !!isMobile;
|
|
16
15
|
}
|
|
@@ -2,11 +2,11 @@ import { middlewareModule } from "../../api/modules/middleware/middleware.module
|
|
|
2
2
|
import { fetcher } from "../fetcher.js";
|
|
3
3
|
export const getMiddlewareApi = async ()=>{
|
|
4
4
|
const res = await fetcher(middlewareModule, {
|
|
5
|
-
path:
|
|
6
|
-
method:
|
|
7
|
-
module:
|
|
5
|
+
path: "/",
|
|
6
|
+
method: "get",
|
|
7
|
+
module: "middleware",
|
|
8
8
|
options: {
|
|
9
|
-
cache:
|
|
9
|
+
cache: "force-cache"
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
return await res.json();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-next-cron-run-date.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/get-next-cron-run-date.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,EAChB,SAAS,IAAI,GAAG,IAAI,KACnB,IAAI,GAAG,IAgBT,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import cronParser from "cron-parser";
|
|
2
|
+
export const getNextCronRunDate = (schedule, lastRun)=>{
|
|
3
|
+
try {
|
|
4
|
+
const options = {
|
|
5
|
+
currentDate: lastRun || new Date(0)
|
|
6
|
+
};
|
|
7
|
+
const interval = cronParser.parse(schedule, options);
|
|
8
|
+
return interval.next().toDate();
|
|
9
|
+
} catch (err) {
|
|
10
|
+
// biome-ignore lint/suspicious/noConsole: needed for cron job monitoring
|
|
11
|
+
console.error(`\x1b[34m[VitNode]\x1b[0m \x1b[38;5;208mError parsing schedule for nextRun\x1b[0m: ${schedule}`, err);
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-next-cron-run-date.test.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/get-next-cron-run-date.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { getNextCronRunDate } from "./get-next-cron-run-date.js";
|
|
3
|
+
describe("getNextCronRunDate", ()=>{
|
|
4
|
+
it("should return the next run date for a valid cron schedule with lastRun null", ()=>{
|
|
5
|
+
const schedule = "0 0 * * *"; // Daily at midnight
|
|
6
|
+
const lastRun = null;
|
|
7
|
+
const result = getNextCronRunDate(schedule, lastRun);
|
|
8
|
+
expect(result).toBeInstanceOf(Date);
|
|
9
|
+
if (result) {
|
|
10
|
+
expect(result.getHours()).toBe(0);
|
|
11
|
+
expect(result.getMinutes()).toBe(0);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
it("should return the next run date for a valid cron schedule with lastRun provided", ()=>{
|
|
15
|
+
const schedule = "0 0 * * *"; // Daily at midnight
|
|
16
|
+
const lastRun = new Date("2023-01-01T12:00:00Z");
|
|
17
|
+
const result = getNextCronRunDate(schedule, lastRun);
|
|
18
|
+
expect(result).toBeInstanceOf(Date);
|
|
19
|
+
if (result) {
|
|
20
|
+
expect(result.getHours()).toBe(0);
|
|
21
|
+
expect(result.getMinutes()).toBe(0);
|
|
22
|
+
expect(result.getTime()).toBeGreaterThan(lastRun.getTime());
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
it("should return null for an invalid cron schedule", ()=>{
|
|
26
|
+
const schedule = "invalid cron";
|
|
27
|
+
const lastRun = null;
|
|
28
|
+
const consoleSpy = vi.spyOn(console, "error").mockImplementation(()=>{});
|
|
29
|
+
const result = getNextCronRunDate(schedule, lastRun);
|
|
30
|
+
expect(result).toBeNull();
|
|
31
|
+
expect(consoleSpy).toHaveBeenCalledWith(expect.stringContaining("[VitNode]"), expect.any(Error));
|
|
32
|
+
consoleSpy.mockRestore();
|
|
33
|
+
});
|
|
34
|
+
it("should handle cron schedules with specific times", ()=>{
|
|
35
|
+
const schedule = "30 14 * * 1"; // Every Monday at 14:30
|
|
36
|
+
const lastRun = new Date("2023-01-01T10:00:00Z"); // Sunday
|
|
37
|
+
const result = getNextCronRunDate(schedule, lastRun);
|
|
38
|
+
expect(result).toBeInstanceOf(Date);
|
|
39
|
+
if (result) {
|
|
40
|
+
expect(result.getDay()).toBe(1); // Monday
|
|
41
|
+
expect(result.getHours()).toBe(14);
|
|
42
|
+
expect(result.getMinutes()).toBe(30);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
it("should return null when cron parsing throws an error", ()=>{
|
|
46
|
+
// This test assumes cron-parser can throw for certain invalid inputs
|
|
47
|
+
const schedule = "99 99 99 99 99"; // Invalid cron with out-of-range values
|
|
48
|
+
const lastRun = null;
|
|
49
|
+
const consoleSpy = vi.spyOn(console, "error").mockImplementation(()=>{});
|
|
50
|
+
const result = getNextCronRunDate(schedule, lastRun);
|
|
51
|
+
expect(result).toBeNull();
|
|
52
|
+
expect(consoleSpy).toHaveBeenCalled();
|
|
53
|
+
consoleSpy.mockRestore();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -3,15 +3,15 @@ import { fetcher } from "../fetcher.js";
|
|
|
3
3
|
import { redirect } from "../navigation.js";
|
|
4
4
|
export const getSessionAdminApi = async ()=>{
|
|
5
5
|
const res = await fetcher(adminModule, {
|
|
6
|
-
path:
|
|
7
|
-
method:
|
|
8
|
-
module:
|
|
6
|
+
path: "/session",
|
|
7
|
+
method: "get",
|
|
8
|
+
module: "admin",
|
|
9
9
|
options: {
|
|
10
|
-
cache:
|
|
10
|
+
cache: "force-cache"
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
if (res.status !== 200) {
|
|
14
|
-
await redirect(
|
|
14
|
+
await redirect("/admin");
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
const data = await res.json();
|
|
@@ -2,11 +2,11 @@ import { usersModule } from "../../api/modules/users/users.module.js";
|
|
|
2
2
|
import { fetcher } from "../fetcher.js";
|
|
3
3
|
export const getSessionApi = async ()=>{
|
|
4
4
|
const res = await fetcher(usersModule, {
|
|
5
|
-
path:
|
|
6
|
-
method:
|
|
7
|
-
module:
|
|
5
|
+
path: "/session",
|
|
6
|
+
method: "get",
|
|
7
|
+
module: "users",
|
|
8
8
|
options: {
|
|
9
|
-
cache:
|
|
9
|
+
cache: "force-cache"
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
const data = await res.json();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"should-cron-job-run.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/should-cron-job-run.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,GAC3B,UAAU,MAAM,EAChB,SAAS,IAAI,GAAG,IAAI,KACnB,OAmBF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import cronParser from "cron-parser";
|
|
2
|
+
export const shouldCronJobRun = (schedule, lastRun)=>{
|
|
3
|
+
try {
|
|
4
|
+
const now = new Date();
|
|
5
|
+
const options = {
|
|
6
|
+
currentDate: lastRun || new Date(0)
|
|
7
|
+
};
|
|
8
|
+
const interval = cronParser.parse(schedule, options);
|
|
9
|
+
const nextScheduledRun = interval.next().toDate();
|
|
10
|
+
return nextScheduledRun <= now;
|
|
11
|
+
} catch (err) {
|
|
12
|
+
// biome-ignore lint/suspicious/noConsole: needed for cron job monitoring
|
|
13
|
+
console.error(`\x1b[34m[VitNode]\x1b[0m \x1b[38;5;208mError parsing schedule\x1b[0m: ${schedule}`, err);
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"should-cron-job-run.test.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/should-cron-job-run.test.ts"],"names":[],"mappings":""}
|