@leancodepl/kratos 9.6.3 → 9.6.4
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/package.json +2 -2
- package/src/lib/flows/login/chooseMethodForm/usePasswordForm.d.ts +6 -0
- package/src/lib/flows/login/secondFactorEmailForm/useCodeForm.d.ts +4 -0
- package/src/lib/flows/login/secondFactorForm/useTotpForm.d.ts +4 -0
- package/src/lib/flows/recovery/codeForm/useCodeForm.d.ts +4 -0
- package/src/lib/flows/recovery/emailForm/useEmailForm.d.ts +4 -0
- package/src/lib/flows/registration/chooseMethodForm/useChooseMethodForm.d.ts +6 -0
- package/src/lib/flows/registration/traitsForm/useTraitsForm.d.ts +4 -0
- package/src/lib/flows/settings/newPasswordForm/useNewPasswordForm.d.ts +6 -0
- package/src/lib/flows/settings/totpForm/useTotpForm.d.ts +4 -0
- package/src/lib/flows/settings/traitsForm/useTraitsForm.d.ts +4 -0
- package/src/lib/flows/verification/emailVerificationForm/useEmailVerificationForm.d.ts +4 -0
- package/src/lib/hooks/useFormErrors.d.ts +1 -1
- package/src/lib/utils/form.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leancodepl/kratos",
|
|
3
|
-
"version": "9.6.
|
|
3
|
+
"version": "9.6.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"node": ">=18.0.0"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@leancodepl/utils": "9.6.
|
|
13
|
+
"@leancodepl/utils": "9.6.4",
|
|
14
14
|
"@radix-ui/react-slot": ">=1.0.0",
|
|
15
15
|
"@tanstack/react-form": ">=1.0.0",
|
|
16
16
|
"@tanstack/react-query": ">=5.0.0"
|
|
@@ -27,6 +27,12 @@ export declare function usePasswordForm({ onError, onLoginSuccess }: UsePassword
|
|
|
27
27
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
28
28
|
identifier: string;
|
|
29
29
|
password: string;
|
|
30
|
+
}> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
|
|
31
|
+
identifier: string;
|
|
32
|
+
password: string;
|
|
33
|
+
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
34
|
+
identifier: string;
|
|
35
|
+
password: string;
|
|
30
36
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
31
37
|
identifier: string;
|
|
32
38
|
password: string;
|
|
@@ -19,6 +19,10 @@ export declare function useCodeForm({ onError, onLoginSuccess }: UseCodeFormProp
|
|
|
19
19
|
code: string;
|
|
20
20
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
21
21
|
code: string;
|
|
22
|
+
}> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
|
|
23
|
+
code: string;
|
|
24
|
+
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
25
|
+
code: string;
|
|
22
26
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
23
27
|
code: string;
|
|
24
28
|
}> | undefined, unknown>;
|
|
@@ -19,6 +19,10 @@ export declare function useTotpForm({ onError, onLoginSuccess }: UseTotpFormProp
|
|
|
19
19
|
totp_code: string;
|
|
20
20
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
21
21
|
totp_code: string;
|
|
22
|
+
}> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
|
|
23
|
+
totp_code: string;
|
|
24
|
+
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
25
|
+
totp_code: string;
|
|
22
26
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
23
27
|
totp_code: string;
|
|
24
28
|
}> | undefined, unknown>;
|
|
@@ -18,6 +18,10 @@ export declare function useCodeForm({ onError }: UseCodeFormProps): import("@tan
|
|
|
18
18
|
code: string;
|
|
19
19
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
20
20
|
code: string;
|
|
21
|
+
}> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
|
|
22
|
+
code: string;
|
|
23
|
+
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
24
|
+
code: string;
|
|
21
25
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
22
26
|
code: string;
|
|
23
27
|
}> | undefined, unknown>;
|
|
@@ -18,6 +18,10 @@ export declare function useEmailForm({ onError }: UseEmailFormProps): import("@t
|
|
|
18
18
|
email: string;
|
|
19
19
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
20
20
|
email: string;
|
|
21
|
+
}> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
|
|
22
|
+
email: string;
|
|
23
|
+
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
24
|
+
email: string;
|
|
21
25
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
22
26
|
email: string;
|
|
23
27
|
}> | undefined, unknown>;
|
|
@@ -28,6 +28,12 @@ export declare function useChooseMethodForm<TTraitsConfig extends TraitsConfig>(
|
|
|
28
28
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
29
29
|
password: string;
|
|
30
30
|
password_confirmation: string;
|
|
31
|
+
}> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
|
|
32
|
+
password: string;
|
|
33
|
+
password_confirmation: string;
|
|
34
|
+
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
35
|
+
password: string;
|
|
36
|
+
password_confirmation: string;
|
|
31
37
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
32
38
|
password: string;
|
|
33
39
|
password_confirmation: string;
|
|
@@ -21,6 +21,10 @@ export declare function useTraitsForm<TTraitsConfig extends TraitsConfig>({ trai
|
|
|
21
21
|
traits: Record<string, string | boolean>;
|
|
22
22
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
23
23
|
traits: Record<string, string | boolean>;
|
|
24
|
+
}> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
|
|
25
|
+
traits: Record<string, string | boolean>;
|
|
26
|
+
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
27
|
+
traits: Record<string, string | boolean>;
|
|
24
28
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
25
29
|
traits: Record<string, string | boolean>;
|
|
26
30
|
}> | undefined, unknown>;
|
|
@@ -28,6 +28,12 @@ export declare function useNewPasswordForm<TTraitsConfig extends TraitsConfig>({
|
|
|
28
28
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
29
29
|
password: string;
|
|
30
30
|
password_confirmation: string;
|
|
31
|
+
}> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
|
|
32
|
+
password: string;
|
|
33
|
+
password_confirmation: string;
|
|
34
|
+
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
35
|
+
password: string;
|
|
36
|
+
password_confirmation: string;
|
|
31
37
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
32
38
|
password: string;
|
|
33
39
|
password_confirmation: string;
|
|
@@ -20,6 +20,10 @@ export declare function useTotpForm<TTraitsConfig extends TraitsConfig>({ onErro
|
|
|
20
20
|
code: string;
|
|
21
21
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
22
22
|
code: string;
|
|
23
|
+
}> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
|
|
24
|
+
code: string;
|
|
25
|
+
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
26
|
+
code: string;
|
|
23
27
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
24
28
|
code: string;
|
|
25
29
|
}> | undefined, unknown>;
|
|
@@ -21,6 +21,10 @@ export declare function useTraitsForm<TTraitsConfig extends TraitsConfig>({ trai
|
|
|
21
21
|
traits: Record<string, boolean | string>;
|
|
22
22
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
23
23
|
traits: Record<string, boolean | string>;
|
|
24
|
+
}> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
|
|
25
|
+
traits: Record<string, boolean | string>;
|
|
26
|
+
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
27
|
+
traits: Record<string, boolean | string>;
|
|
24
28
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
25
29
|
traits: Record<string, boolean | string>;
|
|
26
30
|
}> | undefined, unknown>;
|
|
@@ -19,6 +19,10 @@ export declare function useEmailVerificationForm({ onError, onVerificationSucces
|
|
|
19
19
|
code: string;
|
|
20
20
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
21
21
|
code: string;
|
|
22
|
+
}> | undefined, import("@tanstack/react-form").FormValidateOrFn<{
|
|
23
|
+
code: string;
|
|
24
|
+
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
25
|
+
code: string;
|
|
22
26
|
}> | undefined, import("@tanstack/react-form").FormAsyncValidateOrFn<{
|
|
23
27
|
code: string;
|
|
24
28
|
}> | undefined, unknown>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FormApi, FormAsyncValidateOrFn, FormValidateOrFn } from "@tanstack/react-form";
|
|
2
|
-
export declare function useFormErrors<TFields extends Record<string, unknown>>(form: FormApi<TFields, FormValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, unknown>): import("../utils").AuthError[];
|
|
2
|
+
export declare function useFormErrors<TFields extends Record<string, unknown>>(form: FormApi<TFields, FormValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, unknown>): import("../utils").AuthError[];
|
package/src/lib/utils/form.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export type FlattenObjectKeys<T extends Record<string, unknown>, Key = keyof T>
|
|
|
9
9
|
export type TraitValue<TTrait extends string> = `traits.${TTrait}` extends "traits" | `traits.${string}` ? DeepRecord<{
|
|
10
10
|
traits: Record<string, boolean | string>;
|
|
11
11
|
}>[`traits.${TTrait}`] : never;
|
|
12
|
-
export declare const handleOnSubmitErrors: <TFields extends Record<string, unknown>, TResponse extends LoginFlow | RegistrationFlow | VerificationFlow>(response: TResponse, formApi: FormApi<TFields, FormValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, unknown>, onError?: OnFlowError<Extract<DeepKeys<TFields>, FlattenObjectKeys<TFields>>>) => void;
|
|
12
|
+
export declare const handleOnSubmitErrors: <TFields extends Record<string, unknown>, TResponse extends LoginFlow | RegistrationFlow | VerificationFlow>(response: TResponse, formApi: FormApi<TFields, FormValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, FormAsyncValidateOrFn<TFields> | undefined, unknown>, onError?: OnFlowError<Extract<DeepKeys<TFields>, FlattenObjectKeys<TFields>>>) => void;
|