@frontegg/react-hooks 7.78.0-alpha.1 → 7.78.0

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.
Files changed (120) hide show
  1. package/audits/auditLogs.d.ts +3 -2
  2. package/audits/auditLogs.js +9 -8
  3. package/audits/auditsMetadata.d.ts +3 -2
  4. package/audits/auditsMetadata.js +9 -8
  5. package/audits/hooks.d.ts +9 -2
  6. package/audits/hooks.js +14 -10
  7. package/auth/acceptInvitation.d.ts +5 -7
  8. package/auth/acceptInvitation.js +13 -8
  9. package/auth/activateAccount.d.ts +5 -11
  10. package/auth/activateAccount.js +13 -8
  11. package/auth/allAccounts.d.ts +7 -47
  12. package/auth/allAccounts.js +20 -12
  13. package/auth/apiTokens.d.ts +3 -14
  14. package/auth/apiTokens.js +9 -8
  15. package/auth/applications.d.ts +3 -22
  16. package/auth/applications.js +9 -8
  17. package/auth/customLogin.d.ts +3 -9
  18. package/auth/customLogin.js +12 -9
  19. package/auth/entitlements.d.ts +25 -6
  20. package/auth/entitlements.js +73 -41
  21. package/auth/forgotPassword.d.ts +3 -12
  22. package/auth/forgotPassword.js +9 -10
  23. package/auth/groups.d.ts +5 -32
  24. package/auth/groups.js +14 -14
  25. package/auth/impersonate.d.ts +3 -6
  26. package/auth/impersonate.js +8 -8
  27. package/auth/login.d.ts +3 -74
  28. package/auth/login.js +8 -8
  29. package/auth/passkeys.d.ts +3 -10
  30. package/auth/passkeys.js +8 -8
  31. package/auth/passwordRotation.d.ts +3 -4
  32. package/auth/passwordRotation.js +9 -8
  33. package/auth/profile.d.ts +3 -19
  34. package/auth/profile.js +12 -17
  35. package/auth/provisioning.d.ts +3 -20
  36. package/auth/provisioning.js +8 -8
  37. package/auth/resetPhoneNumber.d.ts +3 -8
  38. package/auth/resetPhoneNumber.js +8 -8
  39. package/auth/roles.d.ts +3 -14
  40. package/auth/roles.js +8 -8
  41. package/auth/security/restrictions.d.ts +3 -21
  42. package/auth/security/restrictions.js +19 -20
  43. package/auth/security/securityCenter.d.ts +3 -15
  44. package/auth/security/securityCenter.js +9 -8
  45. package/auth/security/securityPolicy.d.ts +5 -35
  46. package/auth/security/securityPolicy.js +18 -16
  47. package/auth/security/sessionsPolicy.d.ts +3 -7
  48. package/auth/security/sessionsPolicy.js +9 -8
  49. package/auth/sessions.d.ts +3 -12
  50. package/auth/sessions.js +8 -8
  51. package/auth/signup.d.ts +5 -10
  52. package/auth/signup.js +16 -8
  53. package/auth/sms.d.ts +3 -13
  54. package/auth/sms.js +8 -8
  55. package/auth/socialLogin.d.ts +5 -9
  56. package/auth/socialLogin.js +13 -8
  57. package/auth/sso.d.ts +6 -31
  58. package/auth/sso.js +13 -8
  59. package/auth/stepUp.d.ts +14 -15
  60. package/auth/stepUp.js +22 -9
  61. package/auth/team.d.ts +13 -84
  62. package/auth/team.js +23 -12
  63. package/auth/tenants.d.ts +3 -9
  64. package/auth/tenants.js +9 -8
  65. package/auth/unlockAccount.d.ts +5 -6
  66. package/auth/unlockAccount.js +10 -8
  67. package/auth/usernames.d.ts +3 -7
  68. package/auth/usernames.js +8 -8
  69. package/auth/usersEmailsPolicyState.d.ts +5 -5
  70. package/auth/usersEmailsPolicyState.js +10 -8
  71. package/connectivity/hooks.d.ts +3 -41
  72. package/connectivity/hooks.js +9 -8
  73. package/index.js +1 -1
  74. package/node/audits/auditLogs.js +12 -11
  75. package/node/audits/auditsMetadata.js +12 -11
  76. package/node/audits/hooks.js +17 -13
  77. package/node/auth/acceptInvitation.js +13 -11
  78. package/node/auth/activateAccount.js +13 -11
  79. package/node/auth/allAccounts.js +20 -15
  80. package/node/auth/apiTokens.js +12 -11
  81. package/node/auth/applications.js +12 -11
  82. package/node/auth/customLogin.js +15 -11
  83. package/node/auth/entitlements.js +73 -41
  84. package/node/auth/forgotPassword.js +12 -13
  85. package/node/auth/groups.js +17 -17
  86. package/node/auth/impersonate.js +11 -11
  87. package/node/auth/login.js +11 -11
  88. package/node/auth/passkeys.js +11 -11
  89. package/node/auth/passwordRotation.js +12 -11
  90. package/node/auth/profile.js +13 -19
  91. package/node/auth/provisioning.js +11 -11
  92. package/node/auth/resetPhoneNumber.js +11 -11
  93. package/node/auth/roles.js +11 -11
  94. package/node/auth/security/restrictions.js +21 -22
  95. package/node/auth/security/securityCenter.js +12 -11
  96. package/node/auth/security/securityPolicy.js +17 -18
  97. package/node/auth/security/sessionsPolicy.js +12 -11
  98. package/node/auth/sessions.js +11 -11
  99. package/node/auth/signup.js +16 -11
  100. package/node/auth/sms.js +11 -11
  101. package/node/auth/socialLogin.js +13 -11
  102. package/node/auth/sso.js +13 -11
  103. package/node/auth/stepUp.js +24 -11
  104. package/node/auth/team.js +28 -16
  105. package/node/auth/tenants.js +12 -11
  106. package/node/auth/unlockAccount.js +13 -11
  107. package/node/auth/usernames.js +11 -11
  108. package/node/auth/usersEmailsPolicyState.js +13 -11
  109. package/node/connectivity/hooks.js +12 -11
  110. package/node/index.js +1 -1
  111. package/node/subscriptions/hooks.js +115 -86
  112. package/node/vendor/hooks.js +14 -11
  113. package/package.json +3 -3
  114. package/subscriptions/hooks.d.ts +22 -48
  115. package/subscriptions/hooks.js +103 -77
  116. package/vendor/hooks.d.ts +5 -2
  117. package/vendor/hooks.js +14 -8
  118. package/node/useSnapshot/hookFactory.js +0 -32
  119. package/useSnapshot/hookFactory.d.ts +0 -18
  120. package/useSnapshot/hookFactory.js +0 -26
@@ -1,10 +1,9 @@
1
- // forgotPasswordHooks.ts
2
-
3
- import { createSliceHooks } from '../useSnapshot/hookFactory';
4
- export const {
5
- useSliceState: useForgotPasswordState,
6
- useSliceActions: useForgotPasswordActions
7
- } = createSliceHooks({
8
- getState: s => s.auth.forgotPasswordState,
9
- getActions: a => a.auth.forgotPasswordActions
10
- });
1
+ import { useStore } from '../FronteggStoreContext';
2
+ import { useSnapshot } from '../useSnapshot';
3
+ export function useForgotPasswordState() {
4
+ const state = useStore().store.auth.forgotPasswordState;
5
+ return useSnapshot(state);
6
+ }
7
+ export const useForgotPasswordActions = () => {
8
+ return useStore().stateActions.auth.forgotPasswordActions;
9
+ };
package/auth/groups.d.ts CHANGED
@@ -1,32 +1,5 @@
1
- import type { GroupsState, GroupsDialogsState } from '@frontegg/redux-store';
2
- export declare const useGroupsState: <S = GroupsState>(selector?: (s: GroupsState) => S) => S, useGroupsActions: () => {
3
- setUsersGroupsLoader: (payload: import("@frontegg/redux-store").GroupsStateIndicator) => void;
4
- setUsersGroupsError: (payload: import("@frontegg/redux-store").GroupsStateIndicator) => void;
5
- setGroupsState: (payload: Partial<GroupsState>) => void;
6
- resetUsersGroupsState: () => void;
7
- loadGroups: (payload?: import("@frontegg/redux-store").WithRetryConfig<{}>) => Promise<void>;
8
- getGroupById: (payload: import("@frontegg/redux-store").IGroupsStateActionsPayloads["getGroupById"]) => Promise<void>;
9
- createGroup: (payload: import("@frontegg/redux-store").IGroupsStateActionsPayloads["createGroup"]) => Promise<void>;
10
- updateGroup: (payload: import("@frontegg/redux-store").IGroupsStateActionsPayloads["updateGroup"]) => Promise<void>;
11
- deleteGroup: (payload: import("@frontegg/redux-store").IGroupsStateActionsPayloads["deleteGroup"]) => Promise<void>;
12
- addRolesToGroup: (payload: import("@frontegg/redux-store").IGroupsStateActionsPayloads["addRolesToGroup"]) => Promise<void>;
13
- deleteRolesFromGroup: (payload: import("@frontegg/redux-store").IGroupsStateActionsPayloads["deleteRolesFromGroup"]) => Promise<void>;
14
- addUsersToGroup: (payload: import("@frontegg/redux-store").IGroupsStateActionsPayloads["addUsersToGroup"]) => Promise<void>;
15
- deleteUsersFromGroup: (payload: import("@frontegg/redux-store").IGroupsStateActionsPayloads["deleteUsersFromGroup"]) => Promise<void>;
16
- getGroupConfiguration: (payload?: import("@frontegg/redux-store").WithRetryConfig<{}>) => Promise<void>;
17
- updateGroupConfiguration: (payload: import("@frontegg/redux-store").IGroupsStateActionsPayloads["updateGroupConfiguration"]) => Promise<void>;
18
- getTeamUsers: (payload: import("@frontegg/redux-store").IGroupsStateActionsPayloads["getTeamUsers"]) => Promise<void>;
19
- }, useGroupsDialogsState: () => GroupsDialogsState, useGroupsDialogsActions: () => {
20
- setGroupsDialogsState: (payload: Partial<GroupsDialogsState>) => void;
21
- resetGroupsDialogsState: () => void;
22
- openAddGroupDialog: () => void;
23
- closeAddGroupDialog: () => void;
24
- openAddMembersToGroupDialog: () => void;
25
- closeAddMembersToGroupDialog: () => void;
26
- openEditGroupDialog: (payload: Partial<Pick<import("@frontegg/redux-store").EditGroupDialogState, "group">>) => void;
27
- closeEditGroupDialog: () => void;
28
- openDeleteGroupDialog: (payload: Partial<Pick<import("@frontegg/redux-store").EditGroupDialogState, "group">>) => void;
29
- closeDeleteGroupDialog: () => void;
30
- openDeleteMemberFromGroupDialog: (payload: Pick<import("@frontegg/redux-store").DeleteMemberFromGroupDialogState, "userId" | "email">) => void;
31
- closeDeleteMemberFromGroupDialog: () => void;
32
- };
1
+ import { GroupsState, GroupsActions, GroupsDialogsState, GroupsDialogsActions } from '@frontegg/redux-store';
2
+ export declare function useGroupsState(): GroupsState;
3
+ export declare const useGroupsActions: () => GroupsActions;
4
+ export declare function useGroupsDialogsState(): GroupsDialogsState;
5
+ export declare const useGroupsDialogsActions: () => GroupsDialogsActions;
package/auth/groups.js CHANGED
@@ -1,14 +1,14 @@
1
- // groupsHooks.ts
2
-
3
- import { createSliceHooks } from '../useSnapshot/hookFactory';
4
- export const {
5
- useSliceState: useGroupsState,
6
- useSliceActions: useGroupsActions,
7
- useSliceDialogsState: useGroupsDialogsState,
8
- useSliceDialogsActions: useGroupsDialogsActions
9
- } = createSliceHooks({
10
- getState: s => s.auth.groupsState,
11
- getActions: a => a.auth.groupsActions,
12
- getDialogsState: s => s.auth.groupsDialogsState,
13
- getDialogsActions: a => a.auth.groupsDialogsActions
14
- });
1
+ import { useStore } from '../FronteggStoreContext';
2
+ import { useSnapshot } from '../useSnapshot';
3
+ export function useGroupsState() {
4
+ return useSnapshot(useStore().store.auth.groupsState);
5
+ }
6
+ export const useGroupsActions = () => {
7
+ return useStore().stateActions.auth.groupsActions;
8
+ };
9
+ export function useGroupsDialogsState() {
10
+ return useSnapshot(useStore().store.auth.groupsDialogsState);
11
+ }
12
+ export const useGroupsDialogsActions = () => {
13
+ return useStore().stateActions.auth.groupsDialogsActions;
14
+ };
@@ -1,6 +1,3 @@
1
- import type { ImpersonateState } from '@frontegg/redux-store';
2
- export declare const useImpersonateState: <S = ImpersonateState>(selector?: (s: ImpersonateState) => S) => S, useImpersonateActions: () => {
3
- setImpersonateState: (state: Partial<ImpersonateState>) => void;
4
- resetImpersonateState: () => void;
5
- impersonate: (_payload: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").IImpersonatePayload>) => Promise<void>;
6
- };
1
+ import { ImpersonateState, ImpersonateActions } from '@frontegg/redux-store';
2
+ export declare function useImpersonateState(): ImpersonateState;
3
+ export declare const useImpersonateActions: () => ImpersonateActions;
@@ -1,8 +1,8 @@
1
- import { createSliceHooks } from '../useSnapshot/hookFactory';
2
- export const {
3
- useSliceState: useImpersonateState,
4
- useSliceActions: useImpersonateActions
5
- } = createSliceHooks({
6
- getState: s => s.auth.impersonateState,
7
- getActions: a => a.auth.impersonateActions
8
- });
1
+ import { useSnapshot } from '../useSnapshot';
2
+ import { useStore } from '../FronteggStoreContext';
3
+ export function useImpersonateState() {
4
+ return useSnapshot(useStore().store.auth.impersonateState);
5
+ }
6
+ export const useImpersonateActions = () => {
7
+ return useStore().stateActions.auth.impersonateActions;
8
+ };
package/auth/login.d.ts CHANGED
@@ -1,74 +1,3 @@
1
- import type { LoginState } from '@frontegg/redux-store';
2
- export declare const useLoginState: <S = LoginState>(selector?: (s: LoginState) => S) => S, useLoginActions: () => {
3
- preVerifyMFAWebAuthn: ({ callback, deviceId, ...payload }: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").WithDeviceId<import("dist/@frontegg/rest-api").IPreVerifyMFA>, import("@frontegg/redux-store").IPreVerifyMFAWebAuthNForLoginResponse>, setLoadingAction: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").SetLoadingAction) => Promise<void>;
4
- verifyMFAWebAuthn: ({ callback, deviceId, ...payload }: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").IVerifyMFAWebAuthnPayload, setLoadingAction: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").SetLoadingAction, isStepUp: boolean) => Promise<void>;
5
- preVerifyMFAWebAuthnForLogin: (payload: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").WithDeviceId<import("dist/@frontegg/rest-api").IPreVerifyMFA>, import("@frontegg/redux-store").IPreVerifyMFAWebAuthNForLoginResponse>) => Promise<void>;
6
- verifyMFAWebAuthnForLogin: (payload: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").IVerifyMFAWebAuthnPayload) => Promise<void>;
7
- preVerifyMFASMS: ({ callback, deviceId, ...payload }: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").WithDeviceId<import("dist/@frontegg/rest-api").IPreVerifyMFA>>, setLoadingAction: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").SetLoadingAction) => Promise<void>;
8
- verifyMFASMS: ({ callback, deviceId, ...payload }: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").WithDeviceId<import("dist/@frontegg/rest-api").IVerifyMFASMS>>, setLoadingAction: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").SetLoadingAction, isStepUp?: boolean) => Promise<void>;
9
- preVerifyMFASMSForLogin: (payload: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").WithDeviceId<import("dist/@frontegg/rest-api").IPreVerifyMFA>>) => Promise<void>;
10
- verifyMFASMSForLogin: (payload: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").WithDeviceId<import("dist/@frontegg/rest-api").IVerifyMFASMS>>) => Promise<void>;
11
- preVerifyMFAEmailCode: ({ callback, ...payload }: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IPreVerifyMFA>, setLoadingAction?: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").SetLoadingAction) => Promise<void>;
12
- verifyMFAEmailCode: ({ callback, ...payload }: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IVerifyMFAEmailCode>, setLoadingAction?: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").SetLoadingAction) => Promise<void>;
13
- preVerifyMFAEmailCodeForLogin: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IPreVerifyMFA>) => Promise<void>;
14
- verifyMFAEmailCodeForLogin: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IVerifyMFAEmailCode>) => Promise<void>;
15
- mfaWithAuthenticator: ({ callback, ...loginWithMfaPayload }: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").ILoginWithMfa>, setLoadingAction: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").SetLoadingAction, isStepUp: boolean) => Promise<void>;
16
- loginWithMfa: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").ILoginWithMfa>) => Promise<void>;
17
- getMfaRequiredState: (user: import("dist/@frontegg/redux-store/auth/interfaces").User | any, retryConfig?: import("dist/@frontegg/redux-store/interfaces").RetryConfig, shouldContinueWhenFailing?: boolean, emailFromSignup?: string) => Promise<Partial<import("@frontegg/redux-store").AuthState> & {
18
- mfaState: Partial<import("@frontegg/redux-store").MFAState>;
19
- loginState: Partial<LoginState>;
20
- }>;
21
- postHandleVerifyMFAResponseForStepUp: () => Promise<void>;
22
- postHandleVerifyMFAResponseForLogin: (isAuthenticated: boolean, user: import("dist/@frontegg/rest-api").ILoginResponse) => Promise<void>;
23
- handleVerifyMFAResponse: (payload: import("dist/@frontegg/rest-api").ILoginResponseV3, isStepUp?: boolean) => Promise<void>;
24
- getFeatureFlags: (flags: string[]) => Promise<boolean[]>;
25
- afterAuthNavigationUtil: (resetStateAction: (() => void) | (() => Promise<void>), options?: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").AfterAuthNavigationUtilOptions) => Promise<void>;
26
- afterAuthNavigation: (payload?: Pick<import("@frontegg/redux-store").AfterAuthNavigationUtilOptions, "preventRedirectUrlOriginCleaning">) => Promise<void>;
27
- afterStepUpAuthNavigation: () => Promise<void>;
28
- afterAuthenticationStateUpdate: ({ user, tenants, activeTenant }: import("dist/@frontegg/rest-api").ILoginResponseV3, additionalUpdate?: Partial<import("@frontegg/redux-store").AuthState>) => void;
29
- requestHostedLoginAuthorize: (additionalParams?: Record<string, string>) => Promise<void>;
30
- requestHostedLoginAuthorizeV2: (payload?: {
31
- additionalParams?: Record<string, string>;
32
- shouldRedirectToLogin?: boolean;
33
- firstTime?: boolean;
34
- loginDirectAction?: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").LoginDirectAction;
35
- }) => Promise<void>;
36
- __requestHostedLoginAuthorize: (additionalParams?: Record<string, string>) => Promise<void>;
37
- __requestHostedLoginSilentAuthorize: () => Promise<void>;
38
- handleHostedLoginCallback: (payload: import("dist/@frontegg/redux-store/auth/LoginState/interfaces").HostedLoginCallback) => Promise<void>;
39
- setLoginState: (state: Partial<LoginState>) => void;
40
- resetLoginState: () => void;
41
- requestAuthorize: (firstTime?: boolean) => Promise<void>;
42
- requestAuthorizeSSR: (payload: import("@frontegg/redux-store").FronteggNextJSSession) => Promise<void>;
43
- preLogin: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IPreLogin & {
44
- recaptchaToken?: string;
45
- invitationToken?: string;
46
- }, void>) => Promise<void>;
47
- postLogin: (payload: import("dist/@frontegg/rest-api").IPostLogin) => Promise<void>;
48
- login: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").ILogin>) => Promise<void>;
49
- logout: (payload?: () => void) => Promise<void>;
50
- silentLogout: (payload?: import("@frontegg/redux-store").WithCallback<{
51
- callbackTimeout?: number;
52
- }>) => Promise<void>;
53
- recoverMfa: (payload: import("@frontegg/redux-store").IRecoverMFATokenPayload) => Promise<void>;
54
- quickSmsPasswordlessPreLogin: (_payload: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").IQuickSmsPasswordlessPreLoginPayload>) => Promise<void>;
55
- changePhoneNumberWithVerification: (_payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IChangePhoneNumberWithVerification>) => Promise<void>;
56
- verifyChangePhoneNumber: (_payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IVerifyChangePhoneNumber>) => Promise<void>;
57
- passwordlessPreLogin: (_payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IPasswordlessPreLogin, void>) => Promise<void>;
58
- passwordlessPostLogin: (_payload: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").IPasswordlessPostLoginPayload>) => Promise<void>;
59
- verifyInviteToken: (payload: import("dist/@frontegg/rest-api").IVerifyInviteToken) => Promise<void>;
60
- webAuthnPrelogin: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IWebAuthnPreLogin, import("dist/@frontegg/rest-api").IWebAuthnPreLoginResponse | null>) => Promise<void>;
61
- webAuthnPostLogin: (payload: import("@frontegg/redux-store").IWebAuthnPostLoginPayload) => Promise<void>;
62
- webAuthnCreateNewDeviceSession: (payload: import("@frontegg/redux-store").WithCallback<{}, import("dist/@frontegg/rest-api").ICreateNewDeviceSessionResponse | null>) => Promise<void>;
63
- webAuthnVerifyNewDeviceSession: (payload: import("@frontegg/redux-store").IVerifyNewWebAuthnDevicePayload) => Promise<void>;
64
- getUserIP: (payload: import("@frontegg/redux-store").WithCallback<{}, import("@frontegg/redux-store").UserIPData | boolean>) => Promise<void>;
65
- preEnrollMFAWebAuthnForLogin: (_payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IPreEnrollMFA, import("@frontegg/redux-store").IPreEnrollMFAWebAuthNForLoginResponse>) => Promise<void>;
66
- enrollMFAWebAuthnForLogin: (_payload: import("@frontegg/redux-store").IEnrollMFAWebAuthnPayload) => Promise<void>;
67
- enrollMFAAuthenticatorAppForLogin: (_payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IEnrollMFAAuthenticatorApp>) => Promise<void>;
68
- preEnrollMFASMSForLogin: (_payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IPreEnrollMFASMS>) => Promise<void>;
69
- enrollMFASMSForLogin: (_payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IEnrollMFASMS>) => Promise<void>;
70
- handleEnrollMFAResponse: (payload: import("dist/@frontegg/rest-api").ILoginResponseV3) => Promise<void>;
71
- resetBreachedPassword: (payload: import("dist/@frontegg/rest-api").IForgotPassword) => Promise<void>;
72
- refreshTokenForSocialLogins: () => Promise<void>;
73
- __refreshToken: () => Promise<void>;
74
- };
1
+ import type { LoginState, LoginActions } from '@frontegg/redux-store';
2
+ export declare function useLoginState(): LoginState;
3
+ export declare const useLoginActions: () => LoginActions;
package/auth/login.js CHANGED
@@ -1,8 +1,8 @@
1
- import { createSliceHooks } from '../useSnapshot/hookFactory';
2
- export const {
3
- useSliceState: useLoginState,
4
- useSliceActions: useLoginActions
5
- } = createSliceHooks({
6
- getState: s => s.auth.loginState,
7
- getActions: a => a.auth.loginActions
8
- });
1
+ import { useSnapshot } from '../useSnapshot';
2
+ import { useStore } from '../FronteggStoreContext';
3
+ export function useLoginState() {
4
+ return useSnapshot(useStore().store.auth.loginState);
5
+ }
6
+ export const useLoginActions = () => {
7
+ return useStore().stateActions.auth.loginActions;
8
+ };
@@ -1,10 +1,3 @@
1
- import type { PasskeysState } from '@frontegg/redux-store';
2
- export declare const usePasskeysState: <S = PasskeysState>(selector?: (s: PasskeysState) => S) => S, usePasskeysActions: () => {
3
- setPasskeysState: (payload: Partial<PasskeysState>) => void;
4
- resetPasskeysState: () => void;
5
- loadWebAuthnDevices: () => Promise<void>;
6
- deleteWebAuthnDevice: (_payload: import("@frontegg/redux-store").WithCallback<{
7
- deviceId: string;
8
- }>) => Promise<void>;
9
- __shouldShowPromptPasskeys: () => Promise<boolean>;
10
- };
1
+ import type { PasskeysActions, PasskeysState } from '@frontegg/redux-store';
2
+ export declare function usePasskeysState(): PasskeysState;
3
+ export declare const usePasskeysActions: () => PasskeysActions;
package/auth/passkeys.js CHANGED
@@ -1,8 +1,8 @@
1
- import { createSliceHooks } from '../useSnapshot/hookFactory';
2
- export const {
3
- useSliceState: usePasskeysState,
4
- useSliceActions: usePasskeysActions
5
- } = createSliceHooks({
6
- getState: s => s.auth.passkeysState,
7
- getActions: a => a.auth.passkeysActions
8
- });
1
+ import { useSnapshot } from '../useSnapshot';
2
+ import { useStore } from '../FronteggStoreContext';
3
+ export function usePasskeysState() {
4
+ return useSnapshot(useStore().store.auth.passkeysState);
5
+ }
6
+ export const usePasskeysActions = () => {
7
+ return useStore().stateActions.auth.passkeysActions;
8
+ };
@@ -1,4 +1,3 @@
1
- import type { PasswordRotationState } from '@frontegg/redux-store';
2
- export declare const usePasswordRotationState: <S = PasswordRotationState>(selector?: (s: PasswordRotationState) => S) => S, usePasswordRotationActions: () => {
3
- setStep: (step: import("@frontegg/redux-store").PasswordRotationStep) => void;
4
- };
1
+ import { PasswordRotationState, PasswordRotationActions } from '@frontegg/redux-store';
2
+ export declare function usePasswordRotationState(): PasswordRotationState;
3
+ export declare const usePasswordRotationActions: () => PasswordRotationActions;
@@ -1,8 +1,9 @@
1
- import { createSliceHooks } from '../useSnapshot/hookFactory';
2
- export const {
3
- useSliceState: usePasswordRotationState,
4
- useSliceActions: usePasswordRotationActions
5
- } = createSliceHooks({
6
- getState: s => s.auth.passwordRotationState,
7
- getActions: a => a.auth.passwordRotationActions
8
- });
1
+ import { useStore } from '../FronteggStoreContext';
2
+ import { useSnapshot } from '../useSnapshot';
3
+ export function usePasswordRotationState() {
4
+ const state = useStore().store.auth.passwordRotationState;
5
+ return useSnapshot(state);
6
+ }
7
+ export const usePasswordRotationActions = () => {
8
+ return useStore().stateActions.auth.passwordRotationActions;
9
+ };
package/auth/profile.d.ts CHANGED
@@ -1,20 +1,4 @@
1
- import type { ProfileState } from '@frontegg/redux-store';
2
- export declare const useProfileState: <S = ProfileState>(selector?: (s: ProfileState) => S) => S, useProfileActions: () => {
3
- setProfileState: (state: Partial<ProfileState>) => void;
4
- resetProfileState: () => void;
5
- loadProfile: () => Promise<void>;
6
- saveProfile: (_payload: import("@frontegg/redux-store").SaveProfilePayload) => Promise<void>;
7
- changePassword: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IChangePassword>) => Promise<void>;
8
- updateEmail: (payload: import("@frontegg/redux-store").WithCallback<{
9
- email: string;
10
- }, boolean>) => Promise<void>;
11
- verifyEmail: (payload: import("@frontegg/redux-store").WithCallback<{
12
- email: string;
13
- code: string;
14
- }, boolean>) => Promise<void>;
15
- };
16
- export declare const useReloadProfileIfNeeded: () => void;
17
- /**
18
- * @deprecated use `useReloadProfileIfNeeded` instead
19
- */
1
+ import type { ProfileActions, ProfileState } from '@frontegg/redux-store';
2
+ export declare function useProfileState(): ProfileState;
3
+ export declare const useProfileActions: () => ProfileActions;
20
4
  export declare const reloadProfileIfNeeded: () => void;
package/auth/profile.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { useEffect } from 'react';
2
- import { createSliceHooks } from '../useSnapshot/hookFactory';
3
- export const {
4
- useSliceState: useProfileState,
5
- useSliceActions: useProfileActions
6
- } = createSliceHooks({
7
- getState: s => s.auth.profileState,
8
- getActions: a => a.auth.profileActions
9
- });
10
- export const useReloadProfileIfNeeded = () => {
2
+ import { useSnapshot } from '../useSnapshot';
3
+ import { useStore } from '../FronteggStoreContext';
4
+ export function useProfileState() {
5
+ return useSnapshot(useStore().store.auth.profileState);
6
+ }
7
+ export const useProfileActions = () => {
8
+ return useStore().stateActions.auth.profileActions;
9
+ };
10
+ export const reloadProfileIfNeeded = () => {
11
11
  const {
12
12
  loading
13
13
  } = useProfileState();
@@ -15,11 +15,6 @@ export const useReloadProfileIfNeeded = () => {
15
15
  loadProfile
16
16
  } = useProfileActions();
17
17
  useEffect(() => {
18
- if (!loading) loadProfile();
19
- }, [loading, loadProfile]);
20
- };
21
-
22
- /**
23
- * @deprecated use `useReloadProfileIfNeeded` instead
24
- */
25
- export const reloadProfileIfNeeded = useReloadProfileIfNeeded;
18
+ !loading && loadProfile();
19
+ }, []);
20
+ };
@@ -1,20 +1,3 @@
1
- import type { ProvisioningState } from '@frontegg/redux-store';
2
- export declare const useProvisioningState: <S = ProvisioningState>(selector?: (s: ProvisioningState) => S) => S, useProvisioningActions: () => {
3
- setProvisioningState: (state: Partial<ProvisioningState>) => void;
4
- resetProvisioningState: () => void;
5
- __loadCountForConnection: (connection: import("dist/@frontegg/rest-api").Scim2ConnectionConfigResponse, retryConfig?: import("@frontegg/redux-store").RetryConfig) => Promise<{
6
- count: number;
7
- id: string;
8
- connectionName: string;
9
- source: import("dist/@frontegg/rest-api").ScimConnectionSource;
10
- syncToUserManagement: boolean;
11
- createdAt: Date;
12
- lastSync?: Date | null;
13
- }>;
14
- loadProvisionConnections: (payload?: import("@frontegg/redux-store").WithRetryConfig<{}>) => Promise<void>;
15
- createProvisionConnection: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").Scim2CreateConnectionConfigRequest, import("dist/@frontegg/rest-api").Scim2CreateConnectionConfigResponse>) => Promise<void>;
16
- deleteProvisionConnection: (payload: import("@frontegg/redux-store").WithCallback<import("@frontegg/redux-store").WithId & {
17
- deleteAll: boolean;
18
- }>) => Promise<void>;
19
- updateProvisionConnection: (payload: import("@frontegg/redux-store").WithId<import("dist/@frontegg/rest-api").Scim2PatchConnectionConfigRequest>) => Promise<void>;
20
- };
1
+ import type { ProvisioningActions, ProvisioningState } from '@frontegg/redux-store';
2
+ export declare function useProvisioningState(): ProvisioningState;
3
+ export declare const useProvisioningActions: () => ProvisioningActions;
@@ -1,8 +1,8 @@
1
- import { createSliceHooks } from '../useSnapshot/hookFactory';
2
- export const {
3
- useSliceState: useProvisioningState,
4
- useSliceActions: useProvisioningActions
5
- } = createSliceHooks({
6
- getState: s => s.auth.provisioningState,
7
- getActions: a => a.auth.provisioningActions
8
- });
1
+ import { useSnapshot } from '../useSnapshot';
2
+ import { useStore } from '../FronteggStoreContext';
3
+ export function useProvisioningState() {
4
+ return useSnapshot(useStore().store.auth.provisioningState);
5
+ }
6
+ export const useProvisioningActions = () => {
7
+ return useStore().stateActions.auth.provisioningActions;
8
+ };
@@ -1,8 +1,3 @@
1
- import type { ResetPhoneNumberState } from '@frontegg/redux-store';
2
- export declare const useResetPhoneNumberState: <S = ResetPhoneNumberState>(selector?: (s: ResetPhoneNumberState) => S) => S, useResetPhoneNumberActions: () => {
3
- setResetPhoneNumberState: (state: Partial<ResetPhoneNumberState>) => void;
4
- resetResetPhoneNumberState: () => void;
5
- resetPhoneNumber: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IResetPhoneNumber>) => Promise<void>;
6
- verifyResetPhoneNumber: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IVerifyResetPhoneNumber>) => Promise<void>;
7
- changePhoneNumber: (payload: import("@frontegg/redux-store").ChangePhoneNumberPayload) => Promise<void>;
8
- };
1
+ import type { ResetPhoneNumberState, ResetPhoneNumberActions } from '@frontegg/redux-store';
2
+ export declare function useResetPhoneNumberState(): ResetPhoneNumberState;
3
+ export declare const useResetPhoneNumberActions: () => ResetPhoneNumberActions;
@@ -1,8 +1,8 @@
1
- import { createSliceHooks } from '../useSnapshot/hookFactory';
2
- export const {
3
- useSliceState: useResetPhoneNumberState,
4
- useSliceActions: useResetPhoneNumberActions
5
- } = createSliceHooks({
6
- getState: s => s.auth.resetPhoneNumberState,
7
- getActions: a => a.auth.resetPhoneNumberActions
8
- });
1
+ import { useSnapshot } from '../useSnapshot';
2
+ import { useStore } from '../FronteggStoreContext';
3
+ export function useResetPhoneNumberState() {
4
+ return useSnapshot(useStore().store.auth.resetPhoneNumberState);
5
+ }
6
+ export const useResetPhoneNumberActions = () => {
7
+ return useStore().stateActions.auth.resetPhoneNumberActions;
8
+ };
package/auth/roles.d.ts CHANGED
@@ -1,14 +1,3 @@
1
- import type { RolesState } from '@frontegg/redux-store';
2
- export declare const useRolesState: <S = RolesState>(selector?: (s: RolesState) => S) => S, useRolesActions: () => {
3
- setRolesState: (state: Partial<RolesState>) => void;
4
- setRolesStateLoader: (payload: import("@frontegg/redux-store").RolesStateIndicator) => void;
5
- setRolesStateError: (payload: import("@frontegg/redux-store").RolesStateIndicator) => void;
6
- resetRolesState: () => void;
7
- loadRolesAndPermissions: (payload?: import("@frontegg/redux-store").WithRetryConfig<import("@frontegg/redux-store").WithSilentLoad<{}>>) => Promise<void>;
8
- addRole: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IAddRole, import("dist/@frontegg/rest-api").IRole>) => Promise<void>;
9
- addRoleV2: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IAddRoleV2, import("dist/@frontegg/rest-api").IRole>) => Promise<void>;
10
- updateRole: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IUpdateRole, import("dist/@frontegg/rest-api").IRole>) => Promise<void>;
11
- deleteRole: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IDeleteRole>) => Promise<void>;
12
- attachPermissionsToRole: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IAttachPermissionsToRole, import("dist/@frontegg/rest-api").IRole>) => Promise<void>;
13
- attachPermissionToRoles: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IAttachPermissionToRoles>) => Promise<void>;
14
- };
1
+ import type { RolesActions, RolesState } from '@frontegg/redux-store';
2
+ export declare function useRolesState(): RolesState;
3
+ export declare const useRolesActions: () => RolesActions;
package/auth/roles.js CHANGED
@@ -1,8 +1,8 @@
1
- import { createSliceHooks } from '../useSnapshot/hookFactory';
2
- export const {
3
- useSliceState: useRolesState,
4
- useSliceActions: useRolesActions
5
- } = createSliceHooks({
6
- getState: s => s.auth.rolesState,
7
- getActions: a => a.auth.rolesActions
8
- });
1
+ import { useSnapshot } from '../useSnapshot';
2
+ import { useStore } from '../FronteggStoreContext';
3
+ export function useRolesState() {
4
+ return useSnapshot(useStore().store.auth.rolesState);
5
+ }
6
+ export const useRolesActions = () => {
7
+ return useStore().stateActions.auth.rolesActions;
8
+ };
@@ -1,24 +1,6 @@
1
- import type { RestrictionsState } from '@frontegg/redux-store';
2
- export declare const useRestrictionsState: <S = RestrictionsState>(selector?: (s: RestrictionsState) => S) => S, useRestrictionsActions: () => {
3
- setRestrictionsState: (state: Partial<RestrictionsState>) => void;
4
- setIpRestrictionsState: (state: Partial<import("@frontegg/redux-store").IPRestrictionsState>) => void;
5
- setEmailDomainRestrictionsState: (state: Partial<import("@frontegg/redux-store").EmailDomainRestrictionsState>) => void;
6
- __securityCenterSagaWrapper: <T>(action: T) => T;
7
- loadIpRestrictions: () => Promise<void>;
8
- saveIpRestriction: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").CreateIpRestriction>) => Promise<void>;
9
- saveIpRestrictionsConfig: (payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IPRestrictionsConfig>) => Promise<void>;
10
- deleteIpRestriction: (payload: import("@frontegg/redux-store").WithCallback<{
11
- id: string;
12
- }>) => Promise<void>;
13
- checkIfUserIpValid: () => Promise<void>;
14
- addCurrentUserIpAndActivate: (payload: import("@frontegg/redux-store").WithCallback) => Promise<void>;
15
- loadEmailDomainRestrictions: () => Promise<void>;
16
- saveEmailDomainRestriction: (payload: import("@frontegg/redux-store").SaveEmailDomainRestrictionsPayload) => Promise<void>;
17
- saveEmailDomainRestrictionsConfig: (payload: import("@frontegg/redux-store").SaveEmailDomainRestrictionConfigPayload) => Promise<void>;
18
- deleteEmailDomainRestriction: (payload: {
19
- id: string;
20
- }) => Promise<void>;
21
- };
1
+ import { RestrictionsActions, RestrictionsState } from '@frontegg/redux-store';
2
+ export declare function useRestrictionsState(): RestrictionsState;
3
+ export declare const useRestrictionsActions: () => RestrictionsActions;
22
4
  export declare const useIpRestrictions: () => {
23
5
  loading: boolean;
24
6
  saving: boolean | undefined;
@@ -1,16 +1,14 @@
1
1
  import { useEffect } from 'react';
2
- import { createSliceHooks } from '../../useSnapshot/hookFactory';
3
- export const {
4
- useSliceState: useRestrictionsState,
5
- useSliceActions: useRestrictionsActions
6
- } = createSliceHooks({
7
- getState: s => s.auth.restrictionsState,
8
- getActions: a => a.auth.restrictionsActions
9
- });
2
+ import { useStore } from '../../FronteggStoreContext';
3
+ import { useSnapshot } from '../../useSnapshot';
4
+ export function useRestrictionsState() {
5
+ const state = useStore().store.auth.restrictionsState;
6
+ return useSnapshot(state);
7
+ }
8
+ export const useRestrictionsActions = () => {
9
+ return useStore().stateActions.auth.restrictionsActions;
10
+ };
10
11
  export const useIpRestrictions = () => {
11
- const {
12
- ipRestrictions
13
- } = useRestrictionsState();
14
12
  const {
15
13
  loading,
16
14
  data,
@@ -19,13 +17,15 @@ export const useIpRestrictions = () => {
19
17
  pagination,
20
18
  totalPages,
21
19
  userIpValid
22
- } = ipRestrictions;
20
+ } = useRestrictionsState().ipRestrictions;
23
21
  const {
24
22
  loadIpRestrictions
25
23
  } = useRestrictionsActions();
26
24
  useEffect(() => {
27
- if (!data && !loading) loadIpRestrictions();
28
- }, [data, loading, loadIpRestrictions]);
25
+ if (!data && !loading) {
26
+ loadIpRestrictions();
27
+ }
28
+ }, [loadIpRestrictions, data, loading]);
29
29
  return {
30
30
  loading,
31
31
  saving,
@@ -37,21 +37,20 @@ export const useIpRestrictions = () => {
37
37
  };
38
38
  };
39
39
  export const useEmailDomainRestrictions = () => {
40
- const {
41
- emailDomainRestrictions
42
- } = useRestrictionsState();
43
40
  const {
44
41
  loading,
45
42
  data,
46
43
  saving,
47
44
  error
48
- } = emailDomainRestrictions;
45
+ } = useRestrictionsState().emailDomainRestrictions;
49
46
  const {
50
47
  loadEmailDomainRestrictions
51
48
  } = useRestrictionsActions();
52
49
  useEffect(() => {
53
- if (!data && !loading) loadEmailDomainRestrictions();
54
- }, [data, loading, loadEmailDomainRestrictions]);
50
+ if (!data && !loading) {
51
+ loadEmailDomainRestrictions();
52
+ }
53
+ }, [loadEmailDomainRestrictions, data, loading]);
55
54
  return {
56
55
  loading,
57
56
  saving,
@@ -1,15 +1,3 @@
1
- import type { SecurityCenterState } from '@frontegg/redux-store';
2
- export declare const useSecurityCenterState: <S = SecurityCenterState>(selector?: (s: SecurityCenterState) => S) => S, useSecurityCenterActions: () => {
3
- setSecurityCenterState: (state: Partial<SecurityCenterState>) => void;
4
- resetSecurityCenterState: () => void;
5
- setSecurityCenterStateLoader: (payload: import("@frontegg/redux-store").SecurityCenterStateIndicator) => void;
6
- setSecurityCenterStateError: (payload: import("@frontegg/redux-store").SecurityCenterStateIndicator) => void;
7
- loadRecommendations: (payload?: import("@frontegg/redux-store").WithRetryConfig<{}>) => Promise<void>;
8
- loadInsights: (payload?: import("@frontegg/redux-store").WithRetryConfig<{}>) => Promise<void>;
9
- sendResetBreachedPasswordEmail: (_payload: import("@frontegg/redux-store").WithCallback<import("dist/@frontegg/rest-api").IForgotPassword>) => Promise<void>;
10
- sendBulkResetBreachedPasswordEmails: (payload: import("@frontegg/redux-store").WithCallback) => Promise<void>;
11
- loadBreachedPasswordUsers: (payload: import("dist/@frontegg/rest-api").ISearchUserQueryParamsV3) => Promise<void>;
12
- loadUnenrolledMfaUsers: (payload: import("dist/@frontegg/rest-api").ISearchUserQueryParamsV3) => Promise<void>;
13
- loadInactiveUsers: (payload: import("dist/@frontegg/rest-api").ISearchUserQueryParamsV3) => Promise<void>;
14
- markSecurityCenterStateAsChanged: (changed?: boolean) => void;
15
- };
1
+ import type { SecurityCenterActions, SecurityCenterState } from '@frontegg/redux-store';
2
+ export declare function useSecurityCenterState(): SecurityCenterState;
3
+ export declare const useSecurityCenterActions: () => SecurityCenterActions;
@@ -1,8 +1,9 @@
1
- import { createSliceHooks } from '../../useSnapshot/hookFactory';
2
- export const {
3
- useSliceState: useSecurityCenterState,
4
- useSliceActions: useSecurityCenterActions
5
- } = createSliceHooks({
6
- getState: s => s.auth.securityCenterState,
7
- getActions: a => a.auth.securityCenterActions
8
- });
1
+ import { useStore } from '../../FronteggStoreContext';
2
+ import { useSnapshot } from '../../useSnapshot';
3
+ export function useSecurityCenterState() {
4
+ const state = useStore().store.auth.securityCenterState;
5
+ return useSnapshot(state);
6
+ }
7
+ export const useSecurityCenterActions = () => {
8
+ return useStore().stateActions.auth.securityCenterActions;
9
+ };