@vitnode/core 1.2.0-canary.10 → 1.2.0-canary.11
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/README.md +16 -0
- package/package.json +19 -2
- package/dist/emails/my-email.d.ts +0 -2
- package/dist/emails/my-email.d.ts.map +0 -1
- package/dist/scripts/get-config.d.ts +0 -3
- package/dist/scripts/get-config.d.ts.map +0 -1
- package/dist/scripts/plugin.d.ts +0 -4
- package/dist/scripts/plugin.d.ts.map +0 -1
- package/dist/scripts/prepare-database.d.ts +0 -7
- package/dist/scripts/prepare-database.d.ts.map +0 -1
- package/dist/scripts/prepare-plugins-files.d.ts +0 -2
- package/dist/scripts/prepare-plugins-files.d.ts.map +0 -1
- package/dist/scripts/run-interactive-shell-command.d.ts +0 -2
- package/dist/scripts/run-interactive-shell-command.d.ts.map +0 -1
- package/dist/scripts/scripts.d.ts +0 -3
- package/dist/scripts/scripts.d.ts.map +0 -1
- package/dist/scripts/shared/file-utils.d.ts +0 -14
- package/dist/scripts/shared/file-utils.d.ts.map +0 -1
- package/dist/src/api/config.d.ts +0 -24
- package/dist/src/api/config.d.ts.map +0 -1
- package/dist/src/api/config.js +0 -50
- package/dist/src/api/lib/check-plugin-id.d.ts +0 -15
- package/dist/src/api/lib/check-plugin-id.d.ts.map +0 -1
- package/dist/src/api/lib/check-plugin-id.js +0 -15
- package/dist/src/api/lib/get-user-ip.d.ts +0 -3
- package/dist/src/api/lib/get-user-ip.d.ts.map +0 -1
- package/dist/src/api/lib/get-user-ip.js +0 -8
- package/dist/src/api/lib/module.d.ts +0 -23
- package/dist/src/api/lib/module.d.ts.map +0 -1
- package/dist/src/api/lib/module.js +0 -21
- package/dist/src/api/lib/plugin.d.ts +0 -11
- package/dist/src/api/lib/plugin.d.ts.map +0 -1
- package/dist/src/api/lib/plugin.js +0 -14
- package/dist/src/api/lib/route.d.ts +0 -26
- package/dist/src/api/lib/route.d.ts.map +0 -1
- package/dist/src/api/lib/route.js +0 -23
- package/dist/src/api/lib/with-pagination.d.ts +0 -72
- package/dist/src/api/lib/with-pagination.d.ts.map +0 -1
- package/dist/src/api/lib/with-pagination.js +0 -70
- package/dist/src/api/middlewares/global/global.d.ts +0 -66
- package/dist/src/api/middlewares/global/global.d.ts.map +0 -1
- package/dist/src/api/middlewares/global/global.js +0 -47
- package/dist/src/api/models/device.d.ts +0 -10
- package/dist/src/api/models/device.d.ts.map +0 -1
- package/dist/src/api/models/device.js +0 -54
- package/dist/src/api/models/email.d.ts +0 -22
- package/dist/src/api/models/email.d.ts.map +0 -1
- package/dist/src/api/models/email.js +0 -30
- package/dist/src/api/models/password.d.ts +0 -5
- package/dist/src/api/models/password.d.ts.map +0 -1
- package/dist/src/api/models/password.js +0 -21
- package/dist/src/api/models/session-admin.d.ts +0 -24
- package/dist/src/api/models/session-admin.d.ts.map +0 -1
- package/dist/src/api/models/session-admin.js +0 -73
- package/dist/src/api/models/session.d.ts +0 -23
- package/dist/src/api/models/session.d.ts.map +0 -1
- package/dist/src/api/models/session.js +0 -60
- package/dist/src/api/models/sso.d.ts +0 -38
- package/dist/src/api/models/sso.d.ts.map +0 -1
- package/dist/src/api/models/sso.js +0 -120
- package/dist/src/api/models/user/get-user-by-id.d.ts +0 -17
- package/dist/src/api/models/user/get-user-by-id.d.ts.map +0 -1
- package/dist/src/api/models/user/get-user-by-id.js +0 -18
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts +0 -10
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts.map +0 -1
- package/dist/src/api/models/user/sign-in-with-passwords.js +0 -22
- package/dist/src/api/models/user/sign-up.d.ts +0 -21
- package/dist/src/api/models/user/sign-up.d.ts.map +0 -1
- package/dist/src/api/models/user/sign-up.js +0 -75
- package/dist/src/api/models/user.d.ts +0 -45
- package/dist/src/api/models/user.d.ts.map +0 -1
- package/dist/src/api/models/user.js +0 -8
- package/dist/src/api/modules/admin/admin.module.d.ts +0 -294
- package/dist/src/api/modules/admin/admin.module.d.ts.map +0 -1
- package/dist/src/api/modules/admin/admin.module.js +0 -14
- package/dist/src/api/modules/admin/routes/session.route.d.ts +0 -108
- package/dist/src/api/modules/admin/routes/session.route.d.ts.map +0 -1
- package/dist/src/api/modules/admin/routes/session.route.js +0 -51
- package/dist/src/api/modules/admin/users/routes/list.route.d.ts +0 -190
- package/dist/src/api/modules/admin/users/routes/list.route.d.ts.map +0 -1
- package/dist/src/api/modules/admin/users/routes/list.route.js +0 -79
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts +0 -193
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts.map +0 -1
- package/dist/src/api/modules/admin/users/routes/users.route.js +0 -84
- package/dist/src/api/modules/admin/users/users.admin.module.d.ts +0 -189
- package/dist/src/api/modules/admin/users/users.admin.module.d.ts.map +0 -1
- package/dist/src/api/modules/admin/users/users.admin.module.js +0 -10
- package/dist/src/api/modules/middleware/middleware.module.d.ts +0 -52
- package/dist/src/api/modules/middleware/middleware.module.d.ts.map +0 -1
- package/dist/src/api/modules/middleware/middleware.module.js +0 -10
- package/dist/src/api/modules/middleware/route.d.ts +0 -53
- package/dist/src/api/modules/middleware/route.d.ts.map +0 -1
- package/dist/src/api/modules/middleware/route.js +0 -39
- package/dist/src/api/modules/users/avatar-color.d.ts +0 -2
- package/dist/src/api/modules/users/avatar-color.d.ts.map +0 -1
- package/dist/src/api/modules/users/avatar-color.js +0 -43
- package/dist/src/api/modules/users/routes/session.route.d.ts +0 -103
- package/dist/src/api/modules/users/routes/session.route.d.ts.map +0 -1
- package/dist/src/api/modules/users/routes/session.route.js +0 -46
- package/dist/src/api/modules/users/routes/sign-in.route.d.ts +0 -88
- package/dist/src/api/modules/users/routes/sign-in.route.d.ts.map +0 -1
- package/dist/src/api/modules/users/routes/sign-in.route.js +0 -71
- package/dist/src/api/modules/users/routes/sign-out.route.d.ts +0 -47
- package/dist/src/api/modules/users/routes/sign-out.route.d.ts.map +0 -1
- package/dist/src/api/modules/users/routes/sign-out.route.js +0 -43
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts +0 -89
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts.map +0 -1
- package/dist/src/api/modules/users/routes/sign-up.route.js +0 -60
- package/dist/src/api/modules/users/routes/test.route.d.ts +0 -31
- package/dist/src/api/modules/users/routes/test.route.d.ts.map +0 -1
- package/dist/src/api/modules/users/routes/test.route.js +0 -32
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +0 -78
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts.map +0 -1
- package/dist/src/api/modules/users/sso/routes/callback.route.js +0 -49
- package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts +0 -51
- package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts.map +0 -1
- package/dist/src/api/modules/users/sso/routes/create-url.route.js +0 -36
- package/dist/src/api/modules/users/sso/sso.module.d.ts +0 -125
- package/dist/src/api/modules/users/sso/sso.module.d.ts.map +0 -1
- package/dist/src/api/modules/users/sso/sso.module.js +0 -12
- package/dist/src/api/modules/users/users.module.d.ts +0 -439
- package/dist/src/api/modules/users/users.module.d.ts.map +0 -1
- package/dist/src/api/modules/users/users.module.js +0 -22
- package/dist/src/api/plugin.d.ts +0 -2
- package/dist/src/api/plugin.d.ts.map +0 -1
- package/dist/src/api/plugin.js +0 -13
- package/dist/src/api/plugins/email/nodemailer.d.ts +0 -10
- package/dist/src/api/plugins/email/nodemailer.d.ts.map +0 -1
- package/dist/src/api/plugins/email/nodemailer.js +0 -30
- package/dist/src/api/plugins/email/resend.d.ts +0 -6
- package/dist/src/api/plugins/email/resend.d.ts.map +0 -1
- package/dist/src/api/plugins/email/resend.js +0 -21
- package/dist/src/api/plugins/sso/discord.d.ts +0 -6
- package/dist/src/api/plugins/sso/discord.d.ts.map +0 -1
- package/dist/src/api/plugins/sso/discord.js +0 -77
- package/dist/src/api/plugins/sso/facebook.d.ts +0 -6
- package/dist/src/api/plugins/sso/facebook.d.ts.map +0 -1
- package/dist/src/api/plugins/sso/facebook.js +0 -76
- package/dist/src/api/plugins/sso/google.d.ts +0 -6
- package/dist/src/api/plugins/sso/google.d.ts.map +0 -1
- package/dist/src/api/plugins/sso/google.js +0 -87
- package/dist/src/app/login/page.d.ts +0 -6
- package/dist/src/app/login/page.d.ts.map +0 -1
- package/dist/src/app/login/page.js +0 -15
- package/dist/src/app/login/sso/[providerId]/page.d.ts +0 -7
- package/dist/src/app/login/sso/[providerId]/page.d.ts.map +0 -1
- package/dist/src/app/login/sso/[providerId]/page.js +0 -10
- package/dist/src/app/register/page.d.ts +0 -6
- package/dist/src/app/register/page.d.ts.map +0 -1
- package/dist/src/app/register/page.js +0 -15
- package/dist/src/app_admin/core/page.d.ts +0 -2
- package/dist/src/app_admin/core/page.d.ts.map +0 -1
- package/dist/src/app_admin/core/page.js +0 -5
- package/dist/src/app_admin/core/test/page.d.ts +0 -2
- package/dist/src/app_admin/core/test/page.d.ts.map +0 -1
- package/dist/src/app_admin/core/test/page.js +0 -5
- package/dist/src/app_admin/core/users/page.d.ts +0 -6
- package/dist/src/app_admin/core/users/page.d.ts.map +0 -1
- package/dist/src/app_admin/core/users/page.js +0 -35
- package/dist/src/components/avatar.d.ts +0 -10
- package/dist/src/components/avatar.d.ts.map +0 -1
- package/dist/src/components/avatar.js +0 -14
- package/dist/src/components/date-format.d.ts +0 -5
- package/dist/src/components/date-format.d.ts.map +0 -1
- package/dist/src/components/date-format.js +0 -38
- package/dist/src/components/form/auto-form.d.ts +0 -12
- package/dist/src/components/form/auto-form.d.ts.map +0 -1
- package/dist/src/components/form/auto-form.js +0 -57
- package/dist/src/components/form/common/desc.d.ts +0 -2
- package/dist/src/components/form/common/desc.d.ts.map +0 -1
- package/dist/src/components/form/common/desc.js +0 -9
- package/dist/src/components/form/common/label.d.ts +0 -3
- package/dist/src/components/form/common/label.d.ts.map +0 -1
- package/dist/src/components/form/common/label.js +0 -8
- package/dist/src/components/form/fields/checkbox.d.ts +0 -8
- package/dist/src/components/form/fields/checkbox.d.ts.map +0 -1
- package/dist/src/components/form/fields/checkbox.js +0 -35
- package/dist/src/components/form/fields/combobox.d.ts +0 -14
- package/dist/src/components/form/fields/combobox.d.ts.map +0 -1
- package/dist/src/components/form/fields/combobox.js +0 -88
- package/dist/src/components/form/fields/input.d.ts +0 -9
- package/dist/src/components/form/fields/input.d.ts.map +0 -1
- package/dist/src/components/form/fields/input.js +0 -34
- package/dist/src/components/form/fields/item.d.ts +0 -14
- package/dist/src/components/form/fields/item.d.ts.map +0 -1
- package/dist/src/components/form/fields/item.js +0 -22
- package/dist/src/components/form/fields/radio-group.d.ts +0 -13
- package/dist/src/components/form/fields/radio-group.d.ts.map +0 -1
- package/dist/src/components/form/fields/radio-group.js +0 -51
- package/dist/src/components/form/fields/select.d.ts +0 -14
- package/dist/src/components/form/fields/select.d.ts.map +0 -1
- package/dist/src/components/form/fields/select.js +0 -59
- package/dist/src/components/form/fields/switch.d.ts +0 -8
- package/dist/src/components/form/fields/switch.d.ts.map +0 -1
- package/dist/src/components/form/fields/switch.js +0 -35
- package/dist/src/components/form/fields/textarea.d.ts +0 -9
- package/dist/src/components/form/fields/textarea.d.ts.map +0 -1
- package/dist/src/components/form/fields/textarea.js +0 -34
- package/dist/src/components/i18n-provider.d.ts +0 -7
- package/dist/src/components/i18n-provider.d.ts.map +0 -1
- package/dist/src/components/i18n-provider.js +0 -43
- package/dist/src/components/logo-vitnode.d.ts +0 -4
- package/dist/src/components/logo-vitnode.d.ts.map +0 -1
- package/dist/src/components/logo-vitnode.js +0 -113
- package/dist/src/components/switchers/theme-switcher.d.ts +0 -2
- package/dist/src/components/switchers/theme-switcher.d.ts.map +0 -1
- package/dist/src/components/switchers/theme-switcher.js +0 -25
- package/dist/src/components/table/content.d.ts +0 -3
- package/dist/src/components/table/content.d.ts.map +0 -1
- package/dist/src/components/table/content.js +0 -84
- package/dist/src/components/table/data-table.d.ts +0 -37
- package/dist/src/components/table/data-table.d.ts.map +0 -1
- package/dist/src/components/table/data-table.js +0 -69
- package/dist/src/components/table/order-table-head.d.ts +0 -7
- package/dist/src/components/table/order-table-head.d.ts.map +0 -1
- package/dist/src/components/table/order-table-head.js +0 -39
- package/dist/src/components/table/pagination.d.ts +0 -11
- package/dist/src/components/table/pagination.d.ts.map +0 -1
- package/dist/src/components/table/pagination.js +0 -122
- package/dist/src/components/ui/accordion.d.ts +0 -8
- package/dist/src/components/ui/accordion.d.ts.map +0 -1
- package/dist/src/components/ui/accordion.js +0 -47
- package/dist/src/components/ui/alert-dialog.d.ts +0 -15
- package/dist/src/components/ui/alert-dialog.d.ts.map +0 -1
- package/dist/src/components/ui/alert-dialog.js +0 -86
- package/dist/src/components/ui/alert.d.ts +0 -10
- package/dist/src/components/ui/alert.d.ts.map +0 -1
- package/dist/src/components/ui/alert.js +0 -40
- package/dist/src/components/ui/badge.d.ts +0 -10
- package/dist/src/components/ui/badge.d.ts.map +0 -1
- package/dist/src/components/ui/badge.js +0 -29
- package/dist/src/components/ui/button.d.ts +0 -13
- package/dist/src/components/ui/button.d.ts.map +0 -1
- package/dist/src/components/ui/button.js +0 -66
- package/dist/src/components/ui/card.d.ts +0 -10
- package/dist/src/components/ui/card.d.ts.map +0 -1
- package/dist/src/components/ui/card.js +0 -53
- package/dist/src/components/ui/checkbox.d.ts +0 -5
- package/dist/src/components/ui/checkbox.d.ts.map +0 -1
- package/dist/src/components/ui/checkbox.js +0 -21
- package/dist/src/components/ui/collapsible.d.ts +0 -6
- package/dist/src/components/ui/collapsible.d.ts.map +0 -1
- package/dist/src/components/ui/collapsible.js +0 -22
- package/dist/src/components/ui/command.d.ts +0 -19
- package/dist/src/components/ui/command.d.ts.map +0 -1
- package/dist/src/components/ui/command.js +0 -99
- package/dist/src/components/ui/context-menu.d.ts +0 -26
- package/dist/src/components/ui/context-menu.d.ts.map +0 -1
- package/dist/src/components/ui/context-menu.js +0 -141
- package/dist/src/components/ui/dialog.d.ts +0 -23
- package/dist/src/components/ui/dialog.d.ts.map +0 -1
- package/dist/src/components/ui/dialog.js +0 -181
- package/dist/src/components/ui/drawer.d.ts +0 -14
- package/dist/src/components/ui/drawer.d.ts.map +0 -1
- package/dist/src/components/ui/drawer.js +0 -84
- package/dist/src/components/ui/dropdown-menu.d.ts +0 -26
- package/dist/src/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/src/components/ui/dropdown-menu.js +0 -142
- package/dist/src/components/ui/form.d.ts +0 -33
- package/dist/src/components/ui/form.d.ts.map +0 -1
- package/dist/src/components/ui/form.js +0 -142
- package/dist/src/components/ui/header-content.d.ts +0 -17
- package/dist/src/components/ui/header-content.d.ts.map +0 -1
- package/dist/src/components/ui/header-content.js +0 -30
- package/dist/src/components/ui/hover-card.d.ts +0 -7
- package/dist/src/components/ui/hover-card.d.ts.map +0 -1
- package/dist/src/components/ui/hover-card.js +0 -30
- package/dist/src/components/ui/input-otp.d.ts +0 -12
- package/dist/src/components/ui/input-otp.d.ts.map +0 -1
- package/dist/src/components/ui/input-otp.js +0 -49
- package/dist/src/components/ui/input.d.ts +0 -4
- package/dist/src/components/ui/input.d.ts.map +0 -1
- package/dist/src/components/ui/input.js +0 -12
- package/dist/src/components/ui/label.d.ts +0 -5
- package/dist/src/components/ui/label.d.ts.map +0 -1
- package/dist/src/components/ui/label.js +0 -13
- package/dist/src/components/ui/loader.d.ts +0 -5
- package/dist/src/components/ui/loader.d.ts.map +0 -1
- package/dist/src/components/ui/loader.js +0 -16
- package/dist/src/components/ui/menubar.d.ts +0 -27
- package/dist/src/components/ui/menubar.d.ts.map +0 -1
- package/dist/src/components/ui/menubar.js +0 -152
- package/dist/src/components/ui/navigation-menu.d.ts +0 -15
- package/dist/src/components/ui/navigation-menu.d.ts.map +0 -1
- package/dist/src/components/ui/navigation-menu.js +0 -83
- package/dist/src/components/ui/popover.d.ts +0 -8
- package/dist/src/components/ui/popover.d.ts.map +0 -1
- package/dist/src/components/ui/popover.js +0 -35
- package/dist/src/components/ui/progress.d.ts +0 -5
- package/dist/src/components/ui/progress.d.ts.map +0 -1
- package/dist/src/components/ui/progress.js +0 -20
- package/dist/src/components/ui/radio-group.d.ts +0 -6
- package/dist/src/components/ui/radio-group.d.ts.map +0 -1
- package/dist/src/components/ui/radio-group.js +0 -28
- package/dist/src/components/ui/select.d.ts +0 -16
- package/dist/src/components/ui/select.d.ts.map +0 -1
- package/dist/src/components/ui/select.js +0 -114
- package/dist/src/components/ui/separator.d.ts +0 -5
- package/dist/src/components/ui/separator.d.ts.map +0 -1
- package/dist/src/components/ui/separator.js +0 -15
- package/dist/src/components/ui/sheet.d.ts +0 -14
- package/dist/src/components/ui/sheet.d.ts.map +0 -1
- package/dist/src/components/ui/sheet.js +0 -93
- package/dist/src/components/ui/sidebar.d.ts +0 -70
- package/dist/src/components/ui/sidebar.d.ts.map +0 -1
- package/dist/src/components/ui/sidebar.js +0 -437
- package/dist/src/components/ui/skeleton.d.ts +0 -3
- package/dist/src/components/ui/skeleton.d.ts.map +0 -1
- package/dist/src/components/ui/skeleton.js +0 -10
- package/dist/src/components/ui/slider.d.ts +0 -5
- package/dist/src/components/ui/slider.d.ts.map +0 -1
- package/dist/src/components/ui/slider.js +0 -42
- package/dist/src/components/ui/sonner.d.ts +0 -4
- package/dist/src/components/ui/sonner.d.ts.map +0 -1
- package/dist/src/components/ui/sonner.js +0 -26
- package/dist/src/components/ui/switch.d.ts +0 -5
- package/dist/src/components/ui/switch.d.ts.map +0 -1
- package/dist/src/components/ui/switch.js +0 -17
- package/dist/src/components/ui/table.d.ts +0 -11
- package/dist/src/components/ui/table.d.ts.map +0 -1
- package/dist/src/components/ui/table.js +0 -64
- package/dist/src/components/ui/tabs.d.ts +0 -8
- package/dist/src/components/ui/tabs.d.ts.map +0 -1
- package/dist/src/components/ui/tabs.js +0 -34
- package/dist/src/components/ui/textarea.d.ts +0 -4
- package/dist/src/components/ui/textarea.d.ts.map +0 -1
- package/dist/src/components/ui/textarea.js +0 -11
- package/dist/src/components/ui/toggle-group.d.ts +0 -8
- package/dist/src/components/ui/toggle-group.d.ts.map +0 -1
- package/dist/src/components/ui/toggle-group.js +0 -41
- package/dist/src/components/ui/toggle.d.ts +0 -10
- package/dist/src/components/ui/toggle.d.ts.map +0 -1
- package/dist/src/components/ui/toggle.js +0 -35
- package/dist/src/components/ui/tooltip.d.ts +0 -8
- package/dist/src/components/ui/tooltip.d.ts.map +0 -1
- package/dist/src/components/ui/tooltip.js +0 -43
- package/dist/src/components/ui/unsaved-changes-dialog.d.ts +0 -1
- package/dist/src/components/ui/unsaved-changes-dialog.d.ts.map +0 -1
- package/dist/src/config.d.ts +0 -5
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/config.js +0 -4
- package/dist/src/database/admins.d.ts +0 -246
- package/dist/src/database/admins.d.ts.map +0 -1
- package/dist/src/database/admins.js +0 -74
- package/dist/src/database/languages.d.ts +0 -321
- package/dist/src/database/languages.d.ts.map +0 -1
- package/dist/src/database/languages.js +0 -52
- package/dist/src/database/moderators.d.ts +0 -114
- package/dist/src/database/moderators.d.ts.map +0 -1
- package/dist/src/database/moderators.js +0 -37
- package/dist/src/database/roles.d.ts +0 -146
- package/dist/src/database/roles.d.ts.map +0 -1
- package/dist/src/database/roles.js +0 -13
- package/dist/src/database/sessions.d.ts +0 -196
- package/dist/src/database/sessions.d.ts.map +0 -1
- package/dist/src/database/sessions.js +0 -57
- package/dist/src/database/users.d.ts +0 -562
- package/dist/src/database/users.d.ts.map +0 -1
- package/dist/src/database/users.js +0 -142
- package/dist/src/drizzle.config.d.ts +0 -6
- package/dist/src/drizzle.config.d.ts.map +0 -1
- package/dist/src/drizzle.config.js +0 -37
- package/dist/src/hooks/use-before-unload-with-dialog.d.ts +0 -1
- package/dist/src/hooks/use-before-unload-with-dialog.d.ts.map +0 -1
- package/dist/src/hooks/use-before-unload.d.ts +0 -2
- package/dist/src/hooks/use-before-unload.d.ts.map +0 -1
- package/dist/src/hooks/use-before-unload.js +0 -30
- package/dist/src/hooks/use-mobile.d.ts +0 -2
- package/dist/src/hooks/use-mobile.d.ts.map +0 -1
- package/dist/src/hooks/use-mobile.js +0 -15
- package/dist/src/hooks/use-unsaved-changes.d.ts +0 -1
- package/dist/src/hooks/use-unsaved-changes.d.ts.map +0 -1
- package/dist/src/lib/api/get-middleware-api.d.ts +0 -8
- package/dist/src/lib/api/get-middleware-api.d.ts.map +0 -1
- package/dist/src/lib/api/get-middleware-api.js +0 -13
- package/dist/src/lib/api/get-session-admin-api.d.ts +0 -16
- package/dist/src/lib/api/get-session-admin-api.d.ts.map +0 -1
- package/dist/src/lib/api/get-session-admin-api.js +0 -19
- package/dist/src/lib/api/get-session-api.d.ts +0 -17
- package/dist/src/lib/api/get-session-api.d.ts.map +0 -1
- package/dist/src/lib/api/get-session-api.js +0 -14
- package/dist/src/lib/colors.d.ts +0 -23
- package/dist/src/lib/colors.d.ts.map +0 -1
- package/dist/src/lib/colors.js +0 -131
- package/dist/src/lib/colors.test.d.ts +0 -2
- package/dist/src/lib/colors.test.d.ts.map +0 -1
- package/dist/src/lib/colors.test.js +0 -173
- package/dist/src/lib/config.d.ts +0 -6
- package/dist/src/lib/config.d.ts.map +0 -1
- package/dist/src/lib/config.js +0 -15
- package/dist/src/lib/fetcher/cookie-from-string-to-object.d.ts +0 -10
- package/dist/src/lib/fetcher/cookie-from-string-to-object.d.ts.map +0 -1
- package/dist/src/lib/fetcher/cookie-from-string-to-object.js +0 -12
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.d.ts +0 -2
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.d.ts.map +0 -1
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.js +0 -78
- package/dist/src/lib/fetcher/fetcher.d.ts +0 -9
- package/dist/src/lib/fetcher/fetcher.d.ts.map +0 -1
- package/dist/src/lib/fetcher/helpers.d.ts +0 -3
- package/dist/src/lib/fetcher/helpers.d.ts.map +0 -1
- package/dist/src/lib/fetcher/helpers.js +0 -33
- package/dist/src/lib/fetcher/helpers.test.d.ts +0 -2
- package/dist/src/lib/fetcher/helpers.test.d.ts.map +0 -1
- package/dist/src/lib/fetcher/helpers.test.js +0 -37
- package/dist/src/lib/fetcher/index.d.ts +0 -34
- package/dist/src/lib/fetcher/index.d.ts.map +0 -1
- package/dist/src/lib/fetcher/types.d.ts +0 -120
- package/dist/src/lib/fetcher/types.d.ts.map +0 -1
- package/dist/src/lib/fetcher/types.js +0 -1
- package/dist/src/lib/fetcher.d.ts +0 -9
- package/dist/src/lib/fetcher.d.ts.map +0 -1
- package/dist/src/lib/fetcher.js +0 -47
- package/dist/src/lib/helpers/auto-form.d.ts +0 -10
- package/dist/src/lib/helpers/auto-form.d.ts.map +0 -1
- package/dist/src/lib/helpers/auto-form.js +0 -82
- package/dist/src/lib/helpers/auto-form.test.d.ts +0 -2
- package/dist/src/lib/helpers/auto-form.test.d.ts.map +0 -1
- package/dist/src/lib/helpers/auto-form.test.js +0 -126
- package/dist/src/lib/navigation.d.ts +0 -339
- package/dist/src/lib/navigation.d.ts.map +0 -1
- package/dist/src/lib/navigation.js +0 -11
- package/dist/src/lib/plugin.d.ts +0 -15
- package/dist/src/lib/plugin.d.ts.map +0 -1
- package/dist/src/lib/plugin.js +0 -3
- package/dist/src/lib/special-characters.d.ts +0 -3
- package/dist/src/lib/special-characters.d.ts.map +0 -1
- package/dist/src/lib/special-characters.js +0 -4
- package/dist/src/lib/special-characters.test.d.ts +0 -2
- package/dist/src/lib/special-characters.test.d.ts.map +0 -1
- package/dist/src/lib/special-characters.test.js +0 -56
- package/dist/src/lib/utils.d.ts +0 -3
- package/dist/src/lib/utils.d.ts.map +0 -1
- package/dist/src/lib/utils.js +0 -5
- package/dist/src/tests/setup.d.ts +0 -2
- package/dist/src/tests/setup.d.ts.map +0 -1
- package/dist/src/tests/setup.js +0 -6
- package/dist/src/views/admin/layouts/admin-layout.d.ts +0 -8
- package/dist/src/views/admin/layouts/admin-layout.d.ts.map +0 -1
- package/dist/src/views/admin/layouts/admin-layout.js +0 -70
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts +0 -11
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +0 -1
- package/dist/src/views/admin/layouts/sidebar/nav/item.js +0 -70
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts +0 -10
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts.map +0 -1
- package/dist/src/views/admin/layouts/sidebar/nav/nav.js +0 -49
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts +0 -3
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts.map +0 -1
- package/dist/src/views/admin/layouts/sidebar/sidebar.js +0 -30
- package/dist/src/views/admin/layouts/sidebar/sign-out.d.ts +0 -4
- package/dist/src/views/admin/layouts/sidebar/sign-out.d.ts.map +0 -1
- package/dist/src/views/admin/layouts/sidebar/sign-out.js +0 -14
- package/dist/src/views/admin/layouts/user-bar/client.d.ts +0 -7
- package/dist/src/views/admin/layouts/user-bar/client.d.ts.map +0 -1
- package/dist/src/views/admin/layouts/user-bar/client.js +0 -61
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts +0 -3
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts.map +0 -1
- package/dist/src/views/admin/layouts/user-bar/user-bar.js +0 -31
- package/dist/src/views/admin/sign-in/sign-in-admin-view.d.ts +0 -2
- package/dist/src/views/admin/sign-in/sign-in-admin-view.d.ts.map +0 -1
- package/dist/src/views/admin/sign-in/sign-in-admin-view.js +0 -26
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.d.ts +0 -2
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.d.ts.map +0 -1
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +0 -44
- package/dist/src/views/admin/views/core/test.d.ts +0 -2
- package/dist/src/views/admin/views/core/test.d.ts.map +0 -1
- package/dist/src/views/admin/views/core/test.js +0 -146
- package/dist/src/views/admin/views/core/users/users-admin-view.d.ts +0 -4
- package/dist/src/views/admin/views/core/users/users-admin-view.d.ts.map +0 -1
- package/dist/src/views/admin/views/core/users/users-admin-view.js +0 -90
- package/dist/src/views/auth/components/password-input.d.ts +0 -4
- package/dist/src/views/auth/components/password-input.d.ts.map +0 -1
- package/dist/src/views/auth/components/password-input.js +0 -89
- package/dist/src/views/auth/sign-in/form/form.d.ts +0 -4
- package/dist/src/views/auth/sign-in/form/form.d.ts.map +0 -1
- package/dist/src/views/auth/sign-in/form/form.js +0 -59
- package/dist/src/views/auth/sign-in/form/hooks/mutation-api.d.ts +0 -10
- package/dist/src/views/auth/sign-in/form/hooks/mutation-api.d.ts.map +0 -1
- package/dist/src/views/auth/sign-in/form/hooks/mutation-api.js +0 -33
- package/dist/src/views/auth/sign-in/form/hooks/use-form.d.ts +0 -27
- package/dist/src/views/auth/sign-in/form/hooks/use-form.d.ts.map +0 -1
- package/dist/src/views/auth/sign-in/form/hooks/use-form.js +0 -38
- package/dist/src/views/auth/sign-in/sign-in-view.d.ts +0 -2
- package/dist/src/views/auth/sign-in/sign-in-view.d.ts.map +0 -1
- package/dist/src/views/auth/sign-in/sign-in-view.js +0 -55
- package/dist/src/views/auth/sign-up/form/form.d.ts +0 -4
- package/dist/src/views/auth/sign-up/form/form.d.ts.map +0 -1
- package/dist/src/views/auth/sign-up/form/form.js +0 -88
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.d.ts +0 -6
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.d.ts.map +0 -1
- package/dist/src/views/auth/sign-up/form/hooks/mutation-api.js +0 -18
- package/dist/src/views/auth/sign-up/form/hooks/use-form.d.ts +0 -61
- package/dist/src/views/auth/sign-up/form/hooks/use-form.d.ts.map +0 -1
- package/dist/src/views/auth/sign-up/form/hooks/use-form.js +0 -57
- package/dist/src/views/auth/sign-up/sign-up-view.d.ts +0 -2
- package/dist/src/views/auth/sign-up/sign-up-view.d.ts.map +0 -1
- package/dist/src/views/auth/sign-up/sign-up-view.js +0 -61
- package/dist/src/views/auth/sso/buttons/client.d.ts +0 -5
- package/dist/src/views/auth/sso/buttons/client.d.ts.map +0 -1
- package/dist/src/views/auth/sso/buttons/client.js +0 -22
- package/dist/src/views/auth/sso/buttons/mutation-api.d.ts +0 -4
- package/dist/src/views/auth/sso/buttons/mutation-api.d.ts.map +0 -1
- package/dist/src/views/auth/sso/buttons/mutation-api.js +0 -24
- package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts +0 -3
- package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts.map +0 -1
- package/dist/src/views/auth/sso/buttons/sso-buttons.js +0 -51
- package/dist/src/views/auth/sso/callback/callback-sso-view.d.ts +0 -5
- package/dist/src/views/auth/sso/callback/callback-sso-view.d.ts.map +0 -1
- package/dist/src/views/auth/sso/callback/callback-sso-view.js +0 -18
- package/dist/src/views/auth/sso/callback/client/client.d.ts +0 -6
- package/dist/src/views/auth/sso/callback/client/client.d.ts.map +0 -1
- package/dist/src/views/auth/sso/callback/client/client.js +0 -39
- package/dist/src/views/auth/sso/callback/client/mutation-api.d.ts +0 -8
- package/dist/src/views/auth/sso/callback/client/mutation-api.d.ts.map +0 -1
- package/dist/src/views/auth/sso/callback/client/mutation-api.js +0 -27
- package/dist/src/views/error/back-button.d.ts +0 -5
- package/dist/src/views/error/back-button.d.ts.map +0 -1
- package/dist/src/views/error/back-button.js +0 -14
- package/dist/src/views/error/error-view.d.ts +0 -5
- package/dist/src/views/error/error-view.d.ts.map +0 -1
- package/dist/src/views/error/error-view.js +0 -56
- package/dist/src/views/error/global-error-view.d.ts +0 -6
- package/dist/src/views/error/global-error-view.d.ts.map +0 -1
- package/dist/src/views/error/global-error-view.js +0 -57
- package/dist/src/views/layouts/provider.d.ts +0 -11
- package/dist/src/views/layouts/provider.d.ts.map +0 -1
- package/dist/src/views/layouts/provider.js +0 -43
- package/dist/src/views/layouts/root-layout.d.ts +0 -16
- package/dist/src/views/layouts/root-layout.d.ts.map +0 -1
- package/dist/src/views/layouts/root-layout.js +0 -38
- package/dist/src/views/layouts/theme/header/header.d.ts +0 -4
- package/dist/src/views/layouts/theme/header/header.d.ts.map +0 -1
- package/dist/src/views/layouts/theme/header/header.js +0 -32
- package/dist/src/views/layouts/theme/header/user/auth/auth.d.ts +0 -2
- package/dist/src/views/layouts/theme/header/user/auth/auth.d.ts.map +0 -1
- package/dist/src/views/layouts/theme/header/user/auth/auth.js +0 -33
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts +0 -5
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts.map +0 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.js +0 -47
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.d.ts +0 -4
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.d.ts.map +0 -1
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.js +0 -27
- package/dist/src/views/layouts/theme/header/user/user.d.ts +0 -2
- package/dist/src/views/layouts/theme/header/user/user.d.ts.map +0 -1
- package/dist/src/views/layouts/theme/header/user/user.js +0 -34
- package/dist/src/views/layouts/theme/layout.d.ts +0 -5
- package/dist/src/views/layouts/theme/layout.d.ts.map +0 -1
- package/dist/src/views/layouts/theme/layout.js +0 -15
- package/dist/src/vitnode.config.d.ts +0 -50
- package/dist/src/vitnode.config.d.ts.map +0 -1
- package/dist/src/vitnode.config.js +0 -39
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/tsup.config.d.ts +0 -3
- package/dist/tsup.config.d.ts.map +0 -1
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resend.d.ts","sourceRoot":"","sources":["../../../../../src/api/plugins/email/resend.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,iBAAiB,GAAI,mBAG/B;IACD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B,KAAG,cAqBH,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Resend } from "resend";
|
|
2
|
-
export const ResendEmailPlugin = ({ apiKey, from })=>{
|
|
3
|
-
return {
|
|
4
|
-
sendEmail: async ({ to, subject, replyTo, metadata, html })=>{
|
|
5
|
-
if (!apiKey || !from) {
|
|
6
|
-
throw new Error('Missing Resend configuration');
|
|
7
|
-
}
|
|
8
|
-
const resend = new Resend(apiKey);
|
|
9
|
-
const { error } = await resend.emails.send({
|
|
10
|
-
from: `${metadata.shortTitle ?? metadata.title} <${from}>`,
|
|
11
|
-
to,
|
|
12
|
-
subject,
|
|
13
|
-
replyTo,
|
|
14
|
-
html
|
|
15
|
-
});
|
|
16
|
-
if (error) {
|
|
17
|
-
throw new Error(`[${error.name}]: ${error.message}`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discord.d.ts","sourceRoot":"","sources":["../../../../../src/api/plugins/sso/discord.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIrD,eAAO,MAAM,mBAAmB,GAAI,6BAGjC;IACD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,KAAG,YAoFH,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { HTTPException } from "hono/http-exception";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { getRedirectUri } from "../../models/sso";
|
|
4
|
-
export const DiscordSSOApiPlugin = ({ clientId = '', clientSecret = '' })=>{
|
|
5
|
-
const id = 'discord';
|
|
6
|
-
const redirectUri = getRedirectUri(id);
|
|
7
|
-
const userSchema = z.object({
|
|
8
|
-
id: z.string(),
|
|
9
|
-
email: z.string(),
|
|
10
|
-
username: z.string()
|
|
11
|
-
});
|
|
12
|
-
const tokenSchema = z.object({
|
|
13
|
-
access_token: z.string(),
|
|
14
|
-
token_type: z.string()
|
|
15
|
-
});
|
|
16
|
-
return {
|
|
17
|
-
fetchToken: async (code)=>{
|
|
18
|
-
if (!clientId || !clientSecret) {
|
|
19
|
-
throw new Error('Missing Discord client ID or secret');
|
|
20
|
-
}
|
|
21
|
-
const res = await fetch('https://discord.com/api/oauth2/token', {
|
|
22
|
-
method: 'POST',
|
|
23
|
-
headers: {
|
|
24
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
25
|
-
Accept: 'application/json'
|
|
26
|
-
},
|
|
27
|
-
body: new URLSearchParams({
|
|
28
|
-
code,
|
|
29
|
-
redirect_uri: redirectUri,
|
|
30
|
-
grant_type: 'authorization_code',
|
|
31
|
-
client_id: clientId,
|
|
32
|
-
client_secret: clientSecret
|
|
33
|
-
})
|
|
34
|
-
});
|
|
35
|
-
if (!res.ok) {
|
|
36
|
-
throw new HTTPException(+res.status.toString(), {
|
|
37
|
-
message: 'Internal error requesting token'
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
const { data, error } = tokenSchema.safeParse(await res.json());
|
|
41
|
-
if (error || !data) {
|
|
42
|
-
throw new HTTPException(400, {
|
|
43
|
-
message: 'Invalid token response'
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return data;
|
|
47
|
-
},
|
|
48
|
-
fetchUser: async ({ token_type, access_token })=>{
|
|
49
|
-
const res = await fetch('https://discord.com/api/users/@me', {
|
|
50
|
-
headers: {
|
|
51
|
-
Authorization: `${token_type} ${access_token}`
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
const { data, error } = userSchema.safeParse(await res.json());
|
|
55
|
-
if (error || !data) {
|
|
56
|
-
throw new HTTPException(400, {
|
|
57
|
-
message: 'Invalid user response'
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return data;
|
|
61
|
-
},
|
|
62
|
-
getUrl: ({ state })=>{
|
|
63
|
-
if (!clientId) {
|
|
64
|
-
throw new Error('Missing Discord client ID');
|
|
65
|
-
}
|
|
66
|
-
const url = new URL('https://discord.com/oauth2/authorize');
|
|
67
|
-
url.searchParams.set('client_id', clientId);
|
|
68
|
-
url.searchParams.set('redirect_uri', redirectUri);
|
|
69
|
-
url.searchParams.set('response_type', 'code');
|
|
70
|
-
url.searchParams.set('scope', 'identify email');
|
|
71
|
-
url.searchParams.set('state', state);
|
|
72
|
-
return url.toString();
|
|
73
|
-
},
|
|
74
|
-
id,
|
|
75
|
-
name: 'Discord'
|
|
76
|
-
};
|
|
77
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"facebook.d.ts","sourceRoot":"","sources":["../../../../../src/api/plugins/sso/facebook.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIrD,eAAO,MAAM,oBAAoB,GAAI,6BAGlC;IACD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,KAAG,YAwFH,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { HTTPException } from "hono/http-exception";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { getRedirectUri } from "../../models/sso";
|
|
4
|
-
export const FacebookSSOApiPlugin = ({ clientId, clientSecret })=>{
|
|
5
|
-
const id = 'facebook';
|
|
6
|
-
const redirectUri = getRedirectUri(id);
|
|
7
|
-
const tokenSchema = z.object({
|
|
8
|
-
access_token: z.string(),
|
|
9
|
-
token_type: z.string()
|
|
10
|
-
});
|
|
11
|
-
const userSchema = z.object({
|
|
12
|
-
id: z.string(),
|
|
13
|
-
name: z.string(),
|
|
14
|
-
email: z.string()
|
|
15
|
-
});
|
|
16
|
-
return {
|
|
17
|
-
id,
|
|
18
|
-
name: 'Facebook',
|
|
19
|
-
fetchToken: async (code)=>{
|
|
20
|
-
if (!clientId || !clientSecret) {
|
|
21
|
-
throw new Error('Missing Facebook client ID or secret');
|
|
22
|
-
}
|
|
23
|
-
const url = new URL('https://graph.facebook.com/v22.0/oauth/access_token');
|
|
24
|
-
url.searchParams.set('code', code);
|
|
25
|
-
url.searchParams.set('redirect_uri', redirectUri);
|
|
26
|
-
url.searchParams.set('client_id', clientId);
|
|
27
|
-
url.searchParams.set('client_secret', clientSecret);
|
|
28
|
-
const res = await fetch(url.toString());
|
|
29
|
-
if (!res.ok) {
|
|
30
|
-
throw new HTTPException(+res.status.toString(), {
|
|
31
|
-
message: 'Internal error requesting token'
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
const { data, error } = tokenSchema.safeParse(await res.json());
|
|
35
|
-
if (error || !data) {
|
|
36
|
-
throw new HTTPException(400, {
|
|
37
|
-
message: 'Invalid token response'
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return data;
|
|
41
|
-
},
|
|
42
|
-
fetchUser: async ({ access_token })=>{
|
|
43
|
-
const url = new URL('https://graph.facebook.com/v22.0/me');
|
|
44
|
-
url.searchParams.set('fields', 'id,name,email');
|
|
45
|
-
url.searchParams.set('access_token', access_token);
|
|
46
|
-
const res = await fetch(url.toString());
|
|
47
|
-
if (!res.ok) {
|
|
48
|
-
throw new HTTPException(+res.status.toString(), {
|
|
49
|
-
message: 'Internal error requesting user'
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
const { data: userData, error: userError } = userSchema.safeParse(await res.json());
|
|
53
|
-
if (userError || !userData) {
|
|
54
|
-
throw new HTTPException(400, {
|
|
55
|
-
message: 'Invalid user response'
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
...userData,
|
|
60
|
-
username: userData.name
|
|
61
|
-
};
|
|
62
|
-
},
|
|
63
|
-
getUrl: ({ state })=>{
|
|
64
|
-
if (!clientId) {
|
|
65
|
-
throw new Error('Missing Facebook client ID');
|
|
66
|
-
}
|
|
67
|
-
const url = new URL('https://www.facebook.com/v22.0/dialog/oauth');
|
|
68
|
-
url.searchParams.set('client_id', clientId);
|
|
69
|
-
url.searchParams.set('redirect_uri', redirectUri);
|
|
70
|
-
url.searchParams.set('scope', 'public_profile,email');
|
|
71
|
-
url.searchParams.set('response_type', 'code');
|
|
72
|
-
url.searchParams.set('state', state);
|
|
73
|
-
return url.toString();
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../../../../../src/api/plugins/sso/google.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIrD,eAAO,MAAM,kBAAkB,GAAI,6BAGhC;IACD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,KAAG,YA+FH,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { HTTPException } from "hono/http-exception";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { getRedirectUri } from "../../models/sso";
|
|
4
|
-
export const GoogleSSOApiPlugin = ({ clientId, clientSecret })=>{
|
|
5
|
-
const id = 'google';
|
|
6
|
-
const redirectUri = getRedirectUri(id);
|
|
7
|
-
const tokenSchema = z.object({
|
|
8
|
-
access_token: z.string(),
|
|
9
|
-
token_type: z.string()
|
|
10
|
-
});
|
|
11
|
-
const userSchema = z.object({
|
|
12
|
-
id: z.string(),
|
|
13
|
-
email: z.string(),
|
|
14
|
-
name: z.string(),
|
|
15
|
-
verified_email: z.boolean()
|
|
16
|
-
});
|
|
17
|
-
return {
|
|
18
|
-
id,
|
|
19
|
-
name: 'Google',
|
|
20
|
-
fetchToken: async (code)=>{
|
|
21
|
-
if (!clientId || !clientSecret) {
|
|
22
|
-
throw new Error('Missing Google client ID or secret');
|
|
23
|
-
}
|
|
24
|
-
const res = await fetch('https://oauth2.googleapis.com/token', {
|
|
25
|
-
method: 'POST',
|
|
26
|
-
headers: {
|
|
27
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
28
|
-
Accept: 'application/json'
|
|
29
|
-
},
|
|
30
|
-
body: new URLSearchParams({
|
|
31
|
-
code,
|
|
32
|
-
redirect_uri: redirectUri,
|
|
33
|
-
grant_type: 'authorization_code',
|
|
34
|
-
client_id: clientId,
|
|
35
|
-
client_secret: clientSecret
|
|
36
|
-
})
|
|
37
|
-
});
|
|
38
|
-
if (!res.ok) {
|
|
39
|
-
throw new HTTPException(+res.status.toString(), {
|
|
40
|
-
message: 'Internal error requesting token'
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
const { data, error } = tokenSchema.safeParse(await res.json());
|
|
44
|
-
if (error || !data) {
|
|
45
|
-
throw new HTTPException(400, {
|
|
46
|
-
message: 'Invalid token response'
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return data;
|
|
50
|
-
},
|
|
51
|
-
fetchUser: async ({ token_type, access_token })=>{
|
|
52
|
-
const res = await fetch('https://www.googleapis.com/oauth2/v1/userinfo', {
|
|
53
|
-
headers: {
|
|
54
|
-
Authorization: `${token_type} ${access_token}`
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
const dataFromRes = await res.json();
|
|
58
|
-
const { data, error } = userSchema.safeParse(dataFromRes);
|
|
59
|
-
if (error || !data) {
|
|
60
|
-
throw new HTTPException(400, {
|
|
61
|
-
message: 'Invalid user response'
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
if (!data.verified_email) {
|
|
65
|
-
throw new HTTPException(400, {
|
|
66
|
-
message: 'Email not verified'
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
...data,
|
|
71
|
-
username: data.name
|
|
72
|
-
};
|
|
73
|
-
},
|
|
74
|
-
getUrl: ({ state })=>{
|
|
75
|
-
if (!clientId) {
|
|
76
|
-
throw new Error('Missing Google client ID');
|
|
77
|
-
}
|
|
78
|
-
const url = new URL('https://accounts.google.com/o/oauth2/auth');
|
|
79
|
-
url.searchParams.set('client_id', clientId);
|
|
80
|
-
url.searchParams.set('redirect_uri', redirectUri);
|
|
81
|
-
url.searchParams.set('response_type', 'code');
|
|
82
|
-
url.searchParams.set('scope', 'openid profile email');
|
|
83
|
-
url.searchParams.set('state', state);
|
|
84
|
-
return url.toString();
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../src/app/login/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAMhD,eAAO,MAAM,gBAAgB,GAAU,aAEpC;IACD,MAAM,EAAE,MAAM,CAAC;CAChB,KAAG,OAAO,CAAC,QAAQ,CAMnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,IAAI,4CAE3B"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getTranslations } from "next-intl/server";
|
|
3
|
-
import { SignInView } from "../../views/auth/sign-in/sign-in-view";
|
|
4
|
-
export const generateMetadata = async ({ locale })=>{
|
|
5
|
-
const t = await getTranslations({
|
|
6
|
-
locale,
|
|
7
|
-
namespace: 'core.global'
|
|
8
|
-
});
|
|
9
|
-
return {
|
|
10
|
-
title: t('login')
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default function Page() {
|
|
14
|
-
return /*#__PURE__*/ _jsx(SignInView, {});
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../../src/app/login/sso/[providerId]/page.tsx"],"names":[],"mappings":"AAEA,wBAA8B,IAAI,CAAC,EACjC,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxC,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC/C,oDAUA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { CallbackSSOView } from "../../../../views/auth/sso/callback/callback-sso-view";
|
|
3
|
-
export default async function Page({ params, searchParams }) {
|
|
4
|
-
const { providerId } = await params;
|
|
5
|
-
const currentSearchParams = await searchParams;
|
|
6
|
-
return /*#__PURE__*/ _jsx(CallbackSSOView, {
|
|
7
|
-
providerId: providerId,
|
|
8
|
-
searchParams: currentSearchParams
|
|
9
|
-
});
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../src/app/register/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAMhD,eAAO,MAAM,gBAAgB,GAAU,aAEpC;IACD,MAAM,EAAE,MAAM,CAAC;CAChB,KAAG,OAAO,CAAC,QAAQ,CAMnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,IAAI,4CAE3B"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getTranslations } from "next-intl/server";
|
|
3
|
-
import { SignUpView } from "../../views/auth/sign-up/sign-up-view";
|
|
4
|
-
export const generateMetadata = async ({ locale })=>{
|
|
5
|
-
const t = await getTranslations({
|
|
6
|
-
locale,
|
|
7
|
-
namespace: 'core.global'
|
|
8
|
-
});
|
|
9
|
-
return {
|
|
10
|
-
title: t('register')
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default function Page() {
|
|
14
|
-
return /*#__PURE__*/ _jsx(SignUpView, {});
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../src/app_admin/core/page.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,IAAI,4CAE3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/core/test/page.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,IAAI,4CAE3B"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Metadata } from 'next/dist/types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { UsersAdminView } from '../../../views/admin/views/core/users/users-admin-view';
|
|
4
|
-
export declare const generateMetadata: () => Promise<Metadata>;
|
|
5
|
-
export default function Page(props: React.ComponentProps<typeof UsersAdminView>): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
6
|
-
//# sourceMappingURL=page.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/core/users/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,QAAQ,CAMzD,CAAC;AAEF,wBAA8B,IAAI,CAChC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,oDAgBnD"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getTranslations } from "next-intl/server";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { DataTableSkeleton } from "../../../components/table/data-table";
|
|
5
|
-
import { HeaderContent } from "../../../components/ui/header-content";
|
|
6
|
-
import { UsersAdminView } from "../../../views/admin/views/core/users/users-admin-view";
|
|
7
|
-
export const generateMetadata = async ()=>{
|
|
8
|
-
const t = await getTranslations('admin.global.nav.users');
|
|
9
|
-
return {
|
|
10
|
-
title: t('list')
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default async function Page(props) {
|
|
14
|
-
const [t, tNav] = await Promise.all([
|
|
15
|
-
getTranslations('admin.user.list'),
|
|
16
|
-
getTranslations('admin.global.nav.users')
|
|
17
|
-
]);
|
|
18
|
-
return /*#__PURE__*/ _jsxs("div", {
|
|
19
|
-
className: "container mx-auto p-4",
|
|
20
|
-
children: [
|
|
21
|
-
/*#__PURE__*/ _jsx(HeaderContent, {
|
|
22
|
-
desc: t('desc'),
|
|
23
|
-
h1: tNav('list')
|
|
24
|
-
}),
|
|
25
|
-
/*#__PURE__*/ _jsx(React.Suspense, {
|
|
26
|
-
fallback: /*#__PURE__*/ _jsx(DataTableSkeleton, {
|
|
27
|
-
columns: 2
|
|
28
|
-
}),
|
|
29
|
-
children: /*#__PURE__*/ _jsx(UsersAdminView, {
|
|
30
|
-
...props
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
]
|
|
34
|
-
});
|
|
35
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import Image from 'next/image';
|
|
2
|
-
export declare const Avatar: ({ user: { avatarColor, name }, className, size, ...props }: Omit<React.ComponentProps<typeof Image>, "alt" | "height" | "src" | "width"> & {
|
|
3
|
-
size: number;
|
|
4
|
-
user: {
|
|
5
|
-
avatarColor: string;
|
|
6
|
-
name: string;
|
|
7
|
-
nameCode: string;
|
|
8
|
-
};
|
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAS/B,eAAO,MAAM,MAAM,GAAI,4DAKpB,IAAI,CACL,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,EAClC,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CACnC,GAAG;IACF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/D,4CAWA,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import Image from "next/image";
|
|
3
|
-
import { cn } from "../lib/utils";
|
|
4
|
-
const generateLetterPhoto = (letter, color)=>`data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" style="background:#${color}"><g><text text-anchor="middle" dy=".35em" x="512" y="512" fill="#ffffff" font-size="700" font-family="-apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif">${letter.toLocaleUpperCase()}</text></g></svg>`)}`;
|
|
5
|
-
export const Avatar = ({ user: { avatarColor, name }, className, size, ...props })=>{
|
|
6
|
-
return /*#__PURE__*/ _jsx(Image, {
|
|
7
|
-
alt: name,
|
|
8
|
-
className: cn('rounded-full object-cover', className),
|
|
9
|
-
height: size,
|
|
10
|
-
src: generateLetterPhoto(name.slice(0, 1), avatarColor),
|
|
11
|
-
width: size,
|
|
12
|
-
...props
|
|
13
|
-
});
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-format.d.ts","sourceRoot":"","sources":["../../../src/components/date-format.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,GAAI,2BAGxB;IACD,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,qDAmCA,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useFormatter, useNow } from "next-intl";
|
|
4
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
|
|
5
|
-
export const DateFormat = ({ date, updateInterval })=>{
|
|
6
|
-
const dateToFormat = typeof date === 'string' ? new Date(date) : date;
|
|
7
|
-
const format = useFormatter();
|
|
8
|
-
const now = useNow({
|
|
9
|
-
updateInterval: updateInterval ?? // Update it every 1 minute if the date is from today, otherwise don't update
|
|
10
|
-
(new Date().getTime() - dateToFormat.getTime() < 86400000 ? 60000 : 0)
|
|
11
|
-
});
|
|
12
|
-
const fullDate = format.dateTime(dateToFormat, {
|
|
13
|
-
year: dateToFormat.getFullYear() === now.getFullYear() ? undefined : 'numeric',
|
|
14
|
-
month: 'short',
|
|
15
|
-
day: 'numeric',
|
|
16
|
-
hour: 'numeric',
|
|
17
|
-
minute: 'numeric'
|
|
18
|
-
});
|
|
19
|
-
// When date is < 7 days
|
|
20
|
-
if (now.getTime() - dateToFormat.getTime() < 604800000) {
|
|
21
|
-
return /*#__PURE__*/ _jsx(TooltipProvider, {
|
|
22
|
-
children: /*#__PURE__*/ _jsxs(Tooltip, {
|
|
23
|
-
children: [
|
|
24
|
-
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
25
|
-
asChild: true,
|
|
26
|
-
children: /*#__PURE__*/ _jsx("span", {
|
|
27
|
-
children: format.relativeTime(dateToFormat, now)
|
|
28
|
-
})
|
|
29
|
-
}),
|
|
30
|
-
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
31
|
-
children: fullDate
|
|
32
|
-
})
|
|
33
|
-
]
|
|
34
|
-
})
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return fullDate;
|
|
38
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Mode, UseFormReturn } from 'react-hook-form';
|
|
2
|
-
import type { z } from 'zod';
|
|
3
|
-
import type { ItemAutoFormProps } from './fields/item';
|
|
4
|
-
import { Button } from '../ui/button';
|
|
5
|
-
export declare function AutoForm<T extends z.ZodEffects<z.ZodObject<z.ZodRawShape>> | z.ZodObject<z.ZodRawShape>, TContext = unknown>({ formSchema, onSubmit: onSubmitProp, fields, submitButtonProps, mode, ...props }: Omit<React.ComponentProps<'form'>, 'onSubmit'> & {
|
|
6
|
-
fields: ItemAutoFormProps<T>[];
|
|
7
|
-
formSchema: T;
|
|
8
|
-
mode?: Mode;
|
|
9
|
-
onSubmit?: (values: z.infer<T>, form: UseFormReturn<z.infer<T>>) => Promise<void> | void;
|
|
10
|
-
submitButtonProps?: Omit<React.ComponentProps<typeof Button>, 'isLoading' | 'type'>;
|
|
11
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
//# sourceMappingURL=auto-form.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto-form.d.ts","sourceRoot":"","sources":["../../../../src/components/form/auto-form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,IAAI,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQ7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAKtC,wBAAgB,QAAQ,CACtB,CAAC,SACG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,GACxC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,EAC9B,QAAQ,GAAG,OAAO,EAClB,EACA,UAAU,EACV,QAAQ,EAAE,YAAY,EACtB,MAAM,EACN,iBAAiB,EACjB,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IAClD,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,UAAU,EAAE,CAAC,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,CACT,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAClB,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAC5B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC1B,iBAAiB,CAAC,EAAE,IAAI,CACtB,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EACnC,WAAW,GAAG,MAAM,CACrB,CAAC;CACH,2CAgDA"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
4
|
-
import { useTranslations } from "next-intl";
|
|
5
|
-
import { useForm } from "react-hook-form";
|
|
6
|
-
import { getDefaultValues, getObjectFormSchema } from "../../lib/helpers/auto-form";
|
|
7
|
-
import { Button } from "../ui/button";
|
|
8
|
-
import { DialogClose, DialogFooter, useDialog } from "../ui/dialog";
|
|
9
|
-
import { Form } from "../ui/form";
|
|
10
|
-
import { ItemAutoForm } from "./fields/item";
|
|
11
|
-
export function AutoForm({ formSchema, onSubmit: onSubmitProp, fields, submitButtonProps, mode, ...props }) {
|
|
12
|
-
const { setIsDirty } = useDialog();
|
|
13
|
-
const objectFormSchema = getObjectFormSchema(formSchema);
|
|
14
|
-
const defaultValues = getDefaultValues(objectFormSchema);
|
|
15
|
-
const t = useTranslations('core.global');
|
|
16
|
-
const form = useForm({
|
|
17
|
-
resolver: zodResolver(formSchema),
|
|
18
|
-
defaultValues,
|
|
19
|
-
mode
|
|
20
|
-
});
|
|
21
|
-
const onSubmit = async (values)=>{
|
|
22
|
-
const parsedValues = formSchema.safeParse(values);
|
|
23
|
-
if (parsedValues.success) {
|
|
24
|
-
await onSubmitProp?.(parsedValues.data, form);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const submitButton = /*#__PURE__*/ _jsx(Button, {
|
|
28
|
-
disabled: !form.formState.isValid || form.formState.isSubmitting,
|
|
29
|
-
isLoading: form.formState.isSubmitting,
|
|
30
|
-
...submitButtonProps,
|
|
31
|
-
type: "submit",
|
|
32
|
-
children: submitButtonProps?.children ?? t('submit')
|
|
33
|
-
});
|
|
34
|
-
return /*#__PURE__*/ _jsxs(Form, {
|
|
35
|
-
form: form,
|
|
36
|
-
onSubmit: onSubmit,
|
|
37
|
-
...props,
|
|
38
|
-
children: [
|
|
39
|
-
fields.map((field)=>/*#__PURE__*/ _jsx(ItemAutoForm, {
|
|
40
|
-
formSchema: formSchema,
|
|
41
|
-
...field
|
|
42
|
-
}, field.id)),
|
|
43
|
-
setIsDirty ? /*#__PURE__*/ _jsxs(DialogFooter, {
|
|
44
|
-
children: [
|
|
45
|
-
/*#__PURE__*/ _jsx(DialogClose, {
|
|
46
|
-
asChild: true,
|
|
47
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
48
|
-
variant: "outline",
|
|
49
|
-
children: t('cancel')
|
|
50
|
-
})
|
|
51
|
-
}),
|
|
52
|
-
submitButton
|
|
53
|
-
]
|
|
54
|
-
}) : submitButton
|
|
55
|
-
]
|
|
56
|
-
});
|
|
57
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"desc.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/common/desc.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,GAAI,mCAI1B,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,4CAM3B,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../../lib/utils";
|
|
3
|
-
export const AutoFormDesc = ({ children, className, ...props })=>{
|
|
4
|
-
return /*#__PURE__*/ _jsx("p", {
|
|
5
|
-
className: cn('text-muted-foreground text-sm', className),
|
|
6
|
-
...props,
|
|
7
|
-
children: children
|
|
8
|
-
});
|
|
9
|
-
};
|