@wacht/jsx 0.0.1-alpha.5 → 0.0.1-alpha.6
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/components/auth/auth-image.d.ts +1 -1
- package/dist/components/auth/two-factor-method-selector.d.ts +1 -1
- package/dist/hooks/use-forgot-password.d.ts +6 -7
- package/dist/hooks/use-signin.d.ts +15 -23
- package/dist/hooks/use-user.d.ts +6 -1
- package/dist/index.cjs.js +540 -552
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +4337 -4318
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function AuthFormImage(): import("react/jsx-runtime").JSX.Element
|
|
1
|
+
export declare function AuthFormImage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,5 +11,5 @@ interface TwoFactorMethodSelectorProps {
|
|
|
11
11
|
onSelectMethod: (methodId: string) => void;
|
|
12
12
|
onBack?: () => void;
|
|
13
13
|
}
|
|
14
|
-
export declare function TwoFactorMethodSelector({ methods, onSelectMethod, onBack }: TwoFactorMethodSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function TwoFactorMethodSelector({ methods, onSelectMethod, onBack, }: TwoFactorMethodSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ApiResult, ErrorInterface } from '../../../../../../../../lib/types';
|
|
1
|
+
import { ApiResult, ErrorInterface, Session } from '../../../../../../../../lib/types';
|
|
2
2
|
export declare function useForgotPassword(): {
|
|
3
|
-
loading: boolean;
|
|
4
|
-
forgotPassword: (email: string) => Promise<ApiResult<{}, ErrorInterface>>;
|
|
5
3
|
error: Error | null;
|
|
6
|
-
};
|
|
7
|
-
export declare function useResetPassword(): {
|
|
8
4
|
loading: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
forgotPassword: (email: string) => Promise<ApiResult<{}, ErrorInterface>>;
|
|
6
|
+
verifyOtp: (email: string, otp: string) => Promise<ApiResult<{
|
|
7
|
+
token: string;
|
|
8
|
+
}, ErrorInterface>>;
|
|
9
|
+
resetPassword: (token: string, password: string) => Promise<ApiResult<Session, ErrorInterface>>;
|
|
11
10
|
};
|
|
@@ -44,15 +44,7 @@ type SignInOauth = ({ provider, redirectUri, }: {
|
|
|
44
44
|
provider: OAuthProvider;
|
|
45
45
|
redirectUri?: string;
|
|
46
46
|
}) => Promise<ApiResult<InitSSOResponseType>>;
|
|
47
|
-
|
|
48
|
-
Username = "username",
|
|
49
|
-
Email = "email",
|
|
50
|
-
Phone = "phone",
|
|
51
|
-
EmailOTP = "email_otp",
|
|
52
|
-
MagicLink = "magic_link",
|
|
53
|
-
Oauth = "oauth",
|
|
54
|
-
Generic = "generic"
|
|
55
|
-
}
|
|
47
|
+
type SignInStrategy = "username" | "email" | "phone" | "email_otp" | "magic_link" | "oauth" | "generic";
|
|
56
48
|
type EmailOTPVerificationParams = {
|
|
57
49
|
strategy: "email_otp";
|
|
58
50
|
redirectUri?: string;
|
|
@@ -73,13 +65,13 @@ type PrepareVerificationResponse = {
|
|
|
73
65
|
verification_method?: string;
|
|
74
66
|
};
|
|
75
67
|
type CreateSignInStrategyResult = {
|
|
76
|
-
(strategy:
|
|
77
|
-
(strategy:
|
|
78
|
-
(strategy:
|
|
79
|
-
(strategy:
|
|
80
|
-
(strategy:
|
|
81
|
-
(strategy:
|
|
82
|
-
(strategy:
|
|
68
|
+
(strategy: "username"): SignInPlainUsername;
|
|
69
|
+
(strategy: "email"): SignInPlainEmail;
|
|
70
|
+
(strategy: "phone"): SignInPhone;
|
|
71
|
+
(strategy: "email_otp"): SignInEmailOTP;
|
|
72
|
+
(strategy: "magic_link"): SignInMagicLink;
|
|
73
|
+
(strategy: "oauth"): SignInOauth;
|
|
74
|
+
(strategy: "generic"): SignInGeneric;
|
|
83
75
|
};
|
|
84
76
|
type SignIn = {
|
|
85
77
|
createStrategy: CreateSignInStrategyResult;
|
|
@@ -108,13 +100,13 @@ type InitSSOResponseType = {
|
|
|
108
100
|
};
|
|
109
101
|
export declare function useSignIn(): UseSignInReturnType;
|
|
110
102
|
type SignInFunction<T extends SignInStrategy> = {
|
|
111
|
-
[
|
|
112
|
-
[
|
|
113
|
-
[
|
|
114
|
-
[
|
|
115
|
-
[
|
|
116
|
-
[
|
|
117
|
-
[
|
|
103
|
+
["username"]: SignInPlainUsername;
|
|
104
|
+
["email"]: SignInPlainEmail;
|
|
105
|
+
["phone"]: SignInPhone;
|
|
106
|
+
["email_otp"]: SignInEmailOTP;
|
|
107
|
+
["magic_link"]: SignInMagicLink;
|
|
108
|
+
["oauth"]: SignInOauth;
|
|
109
|
+
["generic"]: SignInGeneric;
|
|
118
110
|
}[T];
|
|
119
111
|
export type UseSignInWithStrategyReturnType<T extends SignInStrategy> = {
|
|
120
112
|
loading: true;
|
package/dist/hooks/use-user.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export declare function useUser(): {
|
|
|
58
58
|
regenerateBackupCodes: () => Promise<string[]>;
|
|
59
59
|
updateProfilePicture: (file: File) => Promise<import('@wacht/types').ApiResult<unknown>>;
|
|
60
60
|
disconnectSocialConnection: (id: string) => Promise<import('@wacht/types').ApiResult<unknown>>;
|
|
61
|
-
connectSocialAccount: ({ provider, redirectUri }: {
|
|
61
|
+
connectSocialAccount: ({ provider, redirectUri, }: {
|
|
62
62
|
provider: string;
|
|
63
63
|
redirectUri?: string;
|
|
64
64
|
}) => Promise<import('@wacht/types').ApiResult<{
|
|
@@ -75,4 +75,9 @@ export declare function useUserSignins(): {
|
|
|
75
75
|
refetch: import('swr').KeyedMutator<SignIn[]>;
|
|
76
76
|
loading: boolean;
|
|
77
77
|
};
|
|
78
|
+
export declare function useActiveTenancy(): {
|
|
79
|
+
loading: boolean;
|
|
80
|
+
orgMembership: import('@wacht/types').OrganizationMembershipWithOrganization | null | undefined;
|
|
81
|
+
workspaceMembership: import('@wacht/types').WorkspaceMembership | null | undefined;
|
|
82
|
+
};
|
|
78
83
|
export {};
|