@wacht/jsx 0.0.1-alpha.4 → 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.
@@ -1 +1 @@
1
- export declare function AuthFormImage(): import("react/jsx-runtime").JSX.Element | null;
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
- resetPassword: (email: string, otp: string, password: string) => Promise<ApiResult<{}, ErrorInterface>>;
10
- error: Error | null;
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
  };
@@ -3,7 +3,7 @@ export declare const useOrganizationList: () => {
3
3
  organizations: Organization[] | undefined;
4
4
  loading: boolean;
5
5
  error: null;
6
- refetch: import('swr').KeyedMutator<OrganizationMembershipWithOrganization[]>;
6
+ refetch: () => Promise<void>;
7
7
  leaveOrganization: (organization: Organization) => Promise<void>;
8
8
  getOrganizationRoles: (organization: Organization) => Promise<OrganizationRole[]>;
9
9
  getOrganizationMembers: (organization: Organization) => Promise<OrganizationMembership[]>;
@@ -48,7 +48,7 @@ export declare const useActiveOrganization: () => {
48
48
  } | {
49
49
  activeOrganization: Organization | null;
50
50
  loading: boolean;
51
- refetch: import('swr').KeyedMutator<OrganizationMembershipWithOrganization[]>;
51
+ refetch: () => Promise<void>;
52
52
  getRoles: () => Promise<OrganizationRole[]>;
53
53
  updateOrganization: (update: OrganizationUpdate) => Promise<{
54
54
  data: never;
@@ -77,5 +77,5 @@ export declare const useOrganizationMemberships: () => {
77
77
  organizationMemberships: OrganizationMembershipWithOrganization[] | undefined;
78
78
  loading: boolean;
79
79
  error: any;
80
- refetch: import('swr').KeyedMutator<OrganizationMembershipWithOrganization[]>;
80
+ refetch: () => Promise<void>;
81
81
  };
@@ -22,5 +22,6 @@ type UseSessionReturnType = {
22
22
  addNewAccount: () => void;
23
23
  refetch: () => Promise<void>;
24
24
  };
25
+ export declare function clearTokenCache(): void;
25
26
  export declare function useSession(): UseSessionReturnType;
26
27
  export {};
@@ -44,15 +44,7 @@ type SignInOauth = ({ provider, redirectUri, }: {
44
44
  provider: OAuthProvider;
45
45
  redirectUri?: string;
46
46
  }) => Promise<ApiResult<InitSSOResponseType>>;
47
- export declare enum SignInStrategy {
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: SignInStrategy.Username): SignInPlainUsername;
77
- (strategy: SignInStrategy.Email): SignInPlainEmail;
78
- (strategy: SignInStrategy.Phone): SignInPhone;
79
- (strategy: SignInStrategy.EmailOTP): SignInEmailOTP;
80
- (strategy: SignInStrategy.MagicLink): SignInMagicLink;
81
- (strategy: SignInStrategy.Oauth): SignInOauth;
82
- (strategy: SignInStrategy.Generic): SignInGeneric;
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
- [SignInStrategy.Username]: SignInPlainUsername;
112
- [SignInStrategy.Email]: SignInPlainEmail;
113
- [SignInStrategy.Phone]: SignInPhone;
114
- [SignInStrategy.EmailOTP]: SignInEmailOTP;
115
- [SignInStrategy.MagicLink]: SignInMagicLink;
116
- [SignInStrategy.Oauth]: SignInOauth;
117
- [SignInStrategy.Generic]: SignInGeneric;
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;
@@ -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 {};
@@ -3,13 +3,13 @@ export declare const useWorkspaceMemberships: () => {
3
3
  workspaceMemberships: WorkspaceMembership[] | undefined;
4
4
  loading: boolean;
5
5
  error: any;
6
- refetch: import('swr').KeyedMutator<WorkspaceMembership[]>;
6
+ refetch: () => Promise<void>;
7
7
  };
8
8
  export declare const useWorkspaceList: () => {
9
9
  workspaces: WorkspaceWithOrganization[];
10
10
  loading: boolean;
11
11
  error: any;
12
- refetch: import('swr').KeyedMutator<WorkspaceMembership[]>;
12
+ refetch: () => Promise<void>;
13
13
  leaveWorkspace: (id: string, userId: string) => Promise<void>;
14
14
  createWorkspace: (organizationId: string, name: string, image?: File, description?: string) => Promise<Response>;
15
15
  updateWorkspace: (workspace: Workspace, data: {
@@ -31,7 +31,7 @@ export declare const useActiveWorkspace: () => {
31
31
  activeWorkspace: Workspace | null;
32
32
  loading: boolean;
33
33
  error: any;
34
- refetch: import('swr').KeyedMutator<WorkspaceMembership[]>;
34
+ refetch: () => Promise<void>;
35
35
  leave: () => Promise<void>;
36
36
  updateWorkspace: (data: {
37
37
  name?: string;