@vitnode/core 1.2.0-canary.51 → 1.2.0-canary.52
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/dist/scripts/scripts.js +2 -2
- package/dist/src/api/middlewares/global.middleware.d.ts +2 -10
- package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
- package/dist/src/api/models/email.d.ts +24 -8
- package/dist/src/api/models/email.d.ts.map +1 -1
- package/dist/src/api/models/email.js +27 -15
- package/dist/src/api/models/password.d.ts +4 -0
- package/dist/src/api/models/password.d.ts.map +1 -1
- package/dist/src/api/models/password.js +8 -0
- package/dist/src/api/models/session-admin.d.ts +1 -0
- package/dist/src/api/models/session-admin.d.ts.map +1 -1
- package/dist/src/api/models/session.d.ts +1 -0
- package/dist/src/api/models/session.d.ts.map +1 -1
- package/dist/src/api/models/sso.d.ts.map +1 -1
- package/dist/src/api/models/sso.js +8 -5
- package/dist/src/api/models/user/get-user-by-id.d.ts +1 -0
- 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 +2 -1
- package/dist/src/api/models/user/sign-up.js +2 -2
- package/dist/src/api/models/user.d.ts +1 -0
- package/dist/src/api/models/user.d.ts.map +1 -1
- package/dist/src/api/modules/users/routes/change-password.route.d.ts +52 -0
- package/dist/src/api/modules/users/routes/change-password.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/change-password.route.js +58 -0
- package/dist/src/api/modules/users/routes/reset-passowrd.route.d.ts +42 -0
- package/dist/src/api/modules/users/routes/reset-passowrd.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/reset-passowrd.route.js +91 -0
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts +6 -0
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts.map +1 -1
- package/dist/src/api/modules/users/routes/sign-up.route.js +6 -0
- package/dist/src/api/modules/users/routes/test.route.d.ts.map +1 -1
- package/dist/src/api/modules/users/routes/test.route.js +0 -6
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +4 -1
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts.map +1 -1
- package/dist/src/api/modules/users/sso/routes/callback.route.js +3 -0
- package/dist/src/api/modules/users/sso/sso.module.d.ts +4 -1
- package/dist/src/api/modules/users/sso/sso.module.d.ts.map +1 -1
- package/dist/src/api/modules/users/users.module.d.ts +93 -1
- package/dist/src/api/modules/users/users.module.d.ts.map +1 -1
- package/dist/src/api/modules/users/users.module.js +5 -1
- package/dist/src/app/login/reset-password/page.d.ts +9 -0
- package/dist/src/app/login/reset-password/page.d.ts.map +1 -0
- package/dist/src/app/login/reset-password/page.js +18 -0
- package/dist/src/components/form/auto-form.d.ts +2 -1
- package/dist/src/components/form/auto-form.d.ts.map +1 -1
- package/dist/src/components/form/auto-form.js +3 -2
- package/dist/src/components/form/common/label.d.ts +3 -1
- package/dist/src/components/form/common/label.d.ts.map +1 -1
- package/dist/src/components/form/common/label.js +14 -4
- package/dist/src/components/form/fields/checkbox.d.ts +1 -1
- package/dist/src/components/form/fields/checkbox.d.ts.map +1 -1
- package/dist/src/components/form/fields/checkbox.js +2 -1
- package/dist/src/components/form/fields/combobox-async.d.ts +1 -1
- package/dist/src/components/form/fields/combobox-async.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox-async.js +2 -1
- package/dist/src/components/form/fields/combobox.d.ts +1 -1
- package/dist/src/components/form/fields/combobox.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox.js +2 -1
- package/dist/src/components/form/fields/input.d.ts +1 -1
- package/dist/src/components/form/fields/input.d.ts.map +1 -1
- package/dist/src/components/form/fields/input.js +2 -1
- package/dist/src/components/form/fields/radio-group.d.ts +1 -1
- package/dist/src/components/form/fields/radio-group.d.ts.map +1 -1
- package/dist/src/components/form/fields/radio-group.js +2 -1
- package/dist/src/components/form/fields/select.d.ts +1 -1
- package/dist/src/components/form/fields/select.d.ts.map +1 -1
- package/dist/src/components/form/fields/select.js +2 -1
- package/dist/src/components/form/fields/switch.d.ts +1 -1
- package/dist/src/components/form/fields/switch.d.ts.map +1 -1
- package/dist/src/components/form/fields/switch.js +2 -1
- package/dist/src/components/form/fields/textarea.d.ts +1 -1
- package/dist/src/components/form/fields/textarea.d.ts.map +1 -1
- package/dist/src/components/form/fields/textarea.js +2 -1
- package/dist/src/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/src/components/ui/alert-dialog.js +1 -2
- package/dist/src/components/ui/alert.d.ts +1 -1
- package/dist/src/components/ui/badge.d.ts +1 -1
- package/dist/src/components/ui/button.d.ts +1 -1
- package/dist/src/components/ui/button.js +1 -1
- package/dist/src/components/ui/card.d.ts +1 -1
- package/dist/src/components/ui/card.d.ts.map +1 -1
- package/dist/src/components/ui/card.js +1 -2
- package/dist/src/components/ui/form.js +1 -1
- package/dist/src/components/ui/popover.d.ts +1 -1
- package/dist/src/components/ui/popover.d.ts.map +1 -1
- package/dist/src/components/ui/popover.js +2 -1
- package/dist/src/components/ui/tooltip.d.ts +1 -1
- package/dist/src/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/components/ui/tooltip.js +6 -7
- package/dist/src/database/users.d.ts +21 -2
- package/dist/src/database/users.d.ts.map +1 -1
- package/dist/src/database/users.js +5 -2
- package/dist/src/emails/default-template.d.ts +34 -22
- package/dist/src/emails/default-template.d.ts.map +1 -1
- package/dist/src/emails/default-template.js +57 -63
- package/dist/src/emails/reset-password.d.ts +56 -0
- package/dist/src/emails/reset-password.d.ts.map +1 -0
- package/dist/src/emails/reset-password.js +132 -0
- package/dist/src/emails/ui/button.d.ts +9 -0
- package/dist/src/emails/ui/button.d.ts.map +1 -0
- package/dist/src/emails/ui/button.js +36 -0
- package/dist/src/emails/ui/card.d.ts +8 -0
- package/dist/src/emails/ui/card.d.ts.map +1 -0
- package/dist/src/emails/ui/card.js +39 -0
- package/dist/src/hooks/use-captcha.d.ts.map +1 -1
- package/dist/src/hooks/use-captcha.js +47 -15
- package/dist/src/lib/fetcher/core.d.ts.map +1 -1
- package/dist/src/lib/fetcher/core.js +6 -1
- package/dist/src/views/admin/sign-in/sign-in-admin-view.js +2 -1
- package/dist/src/views/auth/password-reset/change-password-form/form.d.ts +5 -0
- package/dist/src/views/auth/password-reset/change-password-form/form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/change-password-form/form.js +48 -0
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.d.ts +6 -0
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.js +22 -0
- package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts +11 -0
- package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/change-password-form/use-form.js +36 -0
- package/dist/src/views/auth/password-reset/form/form.d.ts +6 -0
- package/dist/src/views/auth/password-reset/form/form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/form/form.js +104 -0
- package/dist/src/views/auth/password-reset/form/mutation-api.d.ts +7 -0
- package/dist/src/views/auth/password-reset/form/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/form/mutation-api.js +21 -0
- package/dist/src/views/auth/password-reset/form/use-form.d.ts +12 -0
- package/dist/src/views/auth/password-reset/form/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/form/use-form.js +33 -0
- package/dist/src/views/auth/password-reset/password-reset-view.d.ts +7 -0
- package/dist/src/views/auth/password-reset/password-reset-view.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/password-reset-view.js +37 -0
- package/dist/src/views/auth/sign-in/form/form.d.ts +2 -1
- package/dist/src/views/auth/sign-in/form/form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/form/form.js +7 -2
- package/dist/src/views/auth/sign-in/sign-in-view.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/sign-in-view.js +10 -4
- package/dist/src/views/auth/{components → sign-up/components}/password-input.d.ts +2 -2
- package/dist/src/views/auth/sign-up/components/password-input.d.ts.map +1 -0
- package/dist/src/views/auth/{components → sign-up/components}/password-input.js +4 -4
- package/dist/src/views/auth/sign-up/form/form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/form.js +2 -15
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts +1 -1
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/use-form.d.ts +1 -6
- package/dist/src/views/auth/sign-up/form/use-form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/use-form.js +12 -9
- package/dist/src/views/auth/sign-up/sign-up-view.js +1 -1
- package/dist/src/views/auth/sso/callback/callback-sso-view.d.ts.map +1 -1
- package/dist/src/views/auth/sso/callback/callback-sso-view.js +19 -5
- package/dist/src/views/auth/sso/callback/client/client.d.ts +3 -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 +32 -3
- package/dist/src/views/auth/sso/callback/client/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sso/callback/client/mutation-api.js +5 -0
- package/dist/src/views/error/error-view.d.ts +5 -3
- package/dist/src/views/error/error-view.d.ts.map +1 -1
- package/dist/src/views/error/error-view.js +24 -22
- package/dist/src/views/layouts/theme/header/header.js +1 -1
- package/dist/src/vitnode.config.d.ts +3 -0
- package/dist/src/vitnode.config.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +45 -44
- package/src/app/login/reset-password/page.tsx +27 -0
- package/src/locales/en.json +42 -2
- package/dist/src/views/auth/components/password-input.d.ts.map +0 -1
|
@@ -3,26 +3,29 @@ import { toast } from "sonner";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { useWrapperSignUp } from "../wrapper.js";
|
|
5
5
|
import { mutationApi } from "./mutation-api.js";
|
|
6
|
-
export const
|
|
6
|
+
export const usePasswordZodSchema = ()=>{
|
|
7
7
|
const t = useTranslations('core.auth.sign_up');
|
|
8
8
|
const tError = useTranslations('core.global.errors');
|
|
9
9
|
const invalidPassword = t('password.invalid');
|
|
10
|
+
return z.string({
|
|
11
|
+
message: tError('field_required')
|
|
12
|
+
}).regex(/^.{8,}$/, invalidPassword).regex(/[A-Z]/, invalidPassword).regex(/\d/, invalidPassword).regex(/\W|_/, invalidPassword).default('');
|
|
13
|
+
};
|
|
14
|
+
export const useFormSignUp = ()=>{
|
|
15
|
+
const t = useTranslations('core.auth.sign_up');
|
|
16
|
+
const tError = useTranslations('core.global.errors');
|
|
17
|
+
const passwordSchema = usePasswordZodSchema();
|
|
10
18
|
const formSchema = z.object({
|
|
11
19
|
name: z.string({
|
|
12
20
|
message: tError('field_required')
|
|
13
|
-
}).min(3, t('username.min_length')).max(32, t('username.max_length')).default('')
|
|
21
|
+
}).min(3, t('username.min_length')).max(32, t('username.max_length')).default(''),
|
|
14
22
|
// .refine(value => nameRegex.test(value), t('name.invalid'))
|
|
15
23
|
email: z.email({
|
|
16
24
|
message: t('email.invalid')
|
|
17
25
|
}).default('test@test.com'),
|
|
18
|
-
password:
|
|
19
|
-
message: tError('field_required')
|
|
20
|
-
}).regex(/^.{8,}$/, invalidPassword).regex(/[A-Z]/, invalidPassword).regex(/\d/, invalidPassword).regex(/\W|_/, invalidPassword).default(''),
|
|
26
|
+
password: passwordSchema,
|
|
21
27
|
terms: z.boolean().refine((value)=>value, t('terms.required')).default(false),
|
|
22
|
-
newsletter: z.boolean().default(false).optional()
|
|
23
|
-
test: z.object({
|
|
24
|
-
test123: z.string().default('test with default')
|
|
25
|
-
})
|
|
28
|
+
newsletter: z.boolean().default(false).optional()
|
|
26
29
|
});
|
|
27
30
|
const { setShowSendingEmail } = useWrapperSignUp();
|
|
28
31
|
const onSubmit = async (values, form, { captchaToken })=>{
|
|
@@ -51,7 +51,7 @@ export const SignUpView = async ()=>{
|
|
|
51
51
|
className: "text-accent-foreground p-6 text-center text-sm",
|
|
52
52
|
children: t.rich('already_have_account', {
|
|
53
53
|
link: (text)=>/*#__PURE__*/ _jsx(Link, {
|
|
54
|
-
className: "font-semibold",
|
|
54
|
+
className: "text-primary font-semibold",
|
|
55
55
|
href: "/login",
|
|
56
56
|
children: text
|
|
57
57
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback-sso-view.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sso/callback/callback-sso-view.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"callback-sso-view.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sso/callback/callback-sso-view.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,GAAU,uDAGnC;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,qDAwBA,CAAC"}
|
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getTranslations } from "next-intl/server";
|
|
3
|
+
import { I18nProvider } from "../../../../components/i18n-provider.js";
|
|
3
4
|
import { ErrorView } from "../../../error/error-view.js";
|
|
5
|
+
import { getMiddlewareApi } from "../../../../lib/api/get-middleware-api.js";
|
|
4
6
|
import { ClientCallbackSSO } from "./client/client.js";
|
|
5
7
|
export const CallbackSSOView = async ({ providerId, searchParams: { code, error, state } })=>{
|
|
6
|
-
const t = await
|
|
8
|
+
const [t, { sso }] = await Promise.all([
|
|
9
|
+
getTranslations('core.auth.sso'),
|
|
10
|
+
getMiddlewareApi()
|
|
11
|
+
]);
|
|
7
12
|
if (error === 'access_denied') {
|
|
8
13
|
return /*#__PURE__*/ _jsx(ErrorView, {
|
|
9
14
|
code: 403,
|
|
10
15
|
customDescription: t('access_denied')
|
|
11
16
|
});
|
|
12
17
|
}
|
|
13
|
-
return /*#__PURE__*/ _jsx(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
return /*#__PURE__*/ _jsx(I18nProvider, {
|
|
19
|
+
namespaces: [
|
|
20
|
+
'core.auth.sso'
|
|
21
|
+
],
|
|
22
|
+
children: error === 'access_denied' ? /*#__PURE__*/ _jsx(ErrorView, {
|
|
23
|
+
code: 403,
|
|
24
|
+
customDescription: t('access_denied')
|
|
25
|
+
}) : /*#__PURE__*/ _jsx(ClientCallbackSSO, {
|
|
26
|
+
code: code,
|
|
27
|
+
providerId: providerId,
|
|
28
|
+
sso: sso,
|
|
29
|
+
state: state
|
|
30
|
+
})
|
|
17
31
|
});
|
|
18
32
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { getMiddlewareApi } from '../../../../../lib/api/get-middleware-api';
|
|
2
|
+
export declare const ClientCallbackSSO: ({ providerId, code, state, sso, }: {
|
|
2
3
|
code: string;
|
|
3
4
|
providerId: string;
|
|
5
|
+
sso: Awaited<ReturnType<typeof getMiddlewareApi>>["sso"];
|
|
4
6
|
state: string;
|
|
5
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/auth/sso/callback/client/client.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/auth/sso/callback/client/client.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAKlF,eAAO,MAAM,iBAAiB,GAAI,mCAK/B;IACD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACzD,KAAK,EAAE,MAAM,CAAC;CACf,4CAsDA,CAAC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
import { useTranslations } from "next-intl";
|
|
4
5
|
import { Loader } from "../../../../../components/ui/loader.js";
|
|
5
|
-
import { useRouter } from "../../../../../lib/navigation.js";
|
|
6
|
+
import { Link, useRouter } from "../../../../../lib/navigation.js";
|
|
6
7
|
import { ErrorView } from "../../../../error/error-view.js";
|
|
8
|
+
import { Button } from "../../../../../components/ui/button.js";
|
|
7
9
|
import { mutationApi } from "./mutation-api.js";
|
|
8
|
-
export const ClientCallbackSSO = ({ providerId, code, state })=>{
|
|
10
|
+
export const ClientCallbackSSO = ({ providerId, code, state, sso })=>{
|
|
11
|
+
const t = useTranslations('core.auth.sso');
|
|
9
12
|
const { replace } = useRouter();
|
|
10
|
-
const { isError } = useQuery({
|
|
13
|
+
const { isError, error } = useQuery({
|
|
11
14
|
queryKey: [
|
|
12
15
|
'core.auth.sso.callback.sign-up',
|
|
13
16
|
providerId,
|
|
@@ -27,6 +30,32 @@ export const ClientCallbackSSO = ({ providerId, code, state })=>{
|
|
|
27
30
|
},
|
|
28
31
|
retry: false
|
|
29
32
|
});
|
|
33
|
+
const provider = sso.find((p)=>p.id === providerId);
|
|
34
|
+
if (error?.message === 'Email already exists') {
|
|
35
|
+
return /*#__PURE__*/ _jsx(ErrorView, {
|
|
36
|
+
code: 409,
|
|
37
|
+
customActions: /*#__PURE__*/ _jsx(Button, {
|
|
38
|
+
asChild: true,
|
|
39
|
+
size: "lg",
|
|
40
|
+
children: /*#__PURE__*/ _jsx(Link, {
|
|
41
|
+
href: "/login",
|
|
42
|
+
children: t('email_exists.sign_in')
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
45
|
+
customDescription: t.rich('email_exists.desc', {
|
|
46
|
+
provider: ()=>/*#__PURE__*/ _jsx("span", {
|
|
47
|
+
className: "font-semibold",
|
|
48
|
+
children: provider?.name ?? providerId
|
|
49
|
+
})
|
|
50
|
+
}),
|
|
51
|
+
customTitle: t.rich('email_exists.title', {
|
|
52
|
+
provider: ()=>/*#__PURE__*/ _jsx("span", {
|
|
53
|
+
className: "font-semibold",
|
|
54
|
+
children: provider?.name ?? providerId
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
30
59
|
if (isError) {
|
|
31
60
|
return /*#__PURE__*/ _jsx(ErrorView, {
|
|
32
61
|
code: 500
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/auth/sso/callback/client/mutation-api.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,GAAU,8BAI/B;IACD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;;
|
|
1
|
+
{"version":3,"file":"mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/auth/sso/callback/client/mutation-api.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,GAAU,8BAI/B;IACD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;;cA0BA,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export declare const ErrorView: ({ code, customDescription, }: {
|
|
2
|
-
code: 400 | 403 | 404 | 500;
|
|
3
|
-
|
|
1
|
+
export declare const ErrorView: ({ code, customDescription, customTitle, customActions, }: {
|
|
2
|
+
code: 400 | 403 | 404 | 409 | 500;
|
|
3
|
+
customActions?: React.ReactNode;
|
|
4
|
+
customDescription?: React.ReactNode;
|
|
5
|
+
customTitle?: React.ReactNode;
|
|
4
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
7
|
//# sourceMappingURL=error-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-view.d.ts","sourceRoot":"","sources":["../../../../src/views/error/error-view.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS,GAAI,
|
|
1
|
+
{"version":3,"file":"error-view.d.ts","sourceRoot":"","sources":["../../../../src/views/error/error-view.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS,GAAI,0DAKvB;IACD,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAClC,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B,4CAyCA,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ArrowLeft, HomeIcon } from "lucide-react";
|
|
3
3
|
import { useTranslations } from "next-intl";
|
|
4
4
|
import { buttonVariants } from "../../components/ui/button.js";
|
|
5
5
|
import { Link } from "../../lib/navigation.js";
|
|
6
6
|
import { cn } from "../../lib/utils.js";
|
|
7
7
|
import { BackButtonNotFound } from "./back-button.js";
|
|
8
|
-
export const ErrorView = ({ code, customDescription })=>{
|
|
8
|
+
export const ErrorView = ({ code, customDescription, customTitle, customActions })=>{
|
|
9
9
|
const t = useTranslations('core.global');
|
|
10
10
|
return /*#__PURE__*/ _jsx("div", {
|
|
11
11
|
className: "flex flex-col items-center justify-center px-4 py-10 sm:py-20",
|
|
@@ -21,7 +21,7 @@ export const ErrorView = ({ code, customDescription })=>{
|
|
|
21
21
|
}),
|
|
22
22
|
/*#__PURE__*/ _jsx("h2", {
|
|
23
23
|
className: "text-2xl font-medium",
|
|
24
|
-
children: t(`errors.${code}.title`)
|
|
24
|
+
children: customTitle ?? t(`errors.${code}.title`)
|
|
25
25
|
}),
|
|
26
26
|
/*#__PURE__*/ _jsx("p", {
|
|
27
27
|
className: "text-muted-foreground",
|
|
@@ -29,26 +29,28 @@ export const ErrorView = ({ code, customDescription })=>{
|
|
|
29
29
|
})
|
|
30
30
|
]
|
|
31
31
|
}),
|
|
32
|
-
/*#__PURE__*/
|
|
32
|
+
/*#__PURE__*/ _jsx("div", {
|
|
33
33
|
className: "flex flex-col items-center justify-center gap-3 sm:flex-row",
|
|
34
|
-
children:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
34
|
+
children: customActions ?? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ _jsxs(BackButtonNotFound, {
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ _jsx(ArrowLeft, {}),
|
|
39
|
+
t('go_back')
|
|
40
|
+
]
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ _jsxs(Link, {
|
|
43
|
+
className: cn(buttonVariants({
|
|
44
|
+
size: 'lg'
|
|
45
|
+
})),
|
|
46
|
+
href: "/",
|
|
47
|
+
children: [
|
|
48
|
+
/*#__PURE__*/ _jsx(HomeIcon, {}),
|
|
49
|
+
t('back_home')
|
|
50
|
+
]
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
})
|
|
52
54
|
})
|
|
53
55
|
]
|
|
54
56
|
})
|
|
@@ -8,7 +8,7 @@ import { cn } from "../../../../lib/utils.js";
|
|
|
8
8
|
import { UserHeader } from "./user/user.js";
|
|
9
9
|
export const HeaderLayout = ({ logo, className, vitNodeConfig, ...props })=>{
|
|
10
10
|
return /*#__PURE__*/ _jsx("header", {
|
|
11
|
-
className: cn('sticky top-0 z-20 w-full sm:top-2', className),
|
|
11
|
+
className: cn('sticky top-0 z-20 w-full sm:top-2 sm:mb-2', className),
|
|
12
12
|
...props,
|
|
13
13
|
children: /*#__PURE__*/ _jsxs("div", {
|
|
14
14
|
className: "dark:bg-background/75 bg-card/75 container mx-auto flex h-14 items-center border-b px-4 py-2 backdrop-blur sm:rounded-lg sm:border sm:shadow-sm",
|
|
@@ -4,6 +4,7 @@ import type { IRateLimiterOptions } from 'rate-limiter-flexible';
|
|
|
4
4
|
import type { BuildPluginApiReturn } from './api/lib/plugin';
|
|
5
5
|
import type { EmailApiPlugin } from './api/models/email';
|
|
6
6
|
import type { SSOApiPlugin } from './api/models/sso';
|
|
7
|
+
import type { DefaultTemplateEmailProps } from './emails/default-template';
|
|
7
8
|
import type { BuildPluginReturn } from './lib/plugin';
|
|
8
9
|
export interface LocaleConfig {
|
|
9
10
|
code: string;
|
|
@@ -40,6 +41,8 @@ export interface VitNodeApiConfig {
|
|
|
40
41
|
dbProvider: PostgresJsDatabase;
|
|
41
42
|
email?: {
|
|
42
43
|
adapter?: EmailApiPlugin;
|
|
44
|
+
logo?: DefaultTemplateEmailProps['templateProps']['logo'];
|
|
45
|
+
tailwindConfig?: DefaultTemplateEmailProps['templateProps']['tailwindConfig'];
|
|
43
46
|
};
|
|
44
47
|
metadata: {
|
|
45
48
|
shortTitle?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitnode.config.d.ts","sourceRoot":"","sources":["../../src/vitnode.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAA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