@frontegg/redux-store 6.103.0-alpha.0 → 6.103.0-alpha.1

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 (71) hide show
  1. package/auth/AcceptInvitationState/index.d.ts +2 -0
  2. package/auth/AccountSettingsState/index.d.ts +2 -0
  3. package/auth/ActivateState/index.d.ts +3 -0
  4. package/auth/ActivateState/saga.js +1 -1
  5. package/auth/ApiTokensState/index.d.ts +2 -0
  6. package/auth/ApiTokensState/saga.js +2 -2
  7. package/auth/CustomLoginState/index.d.ts +2 -0
  8. package/auth/EntitlementsState/index.d.ts +71 -0
  9. package/auth/EntitlementsState/index.js +28 -0
  10. package/auth/EntitlementsState/interfaces.d.ts +9 -0
  11. package/auth/EntitlementsState/interfaces.js +1 -0
  12. package/auth/EntitlementsState/saga.d.ts +9 -0
  13. package/auth/EntitlementsState/saga.js +28 -0
  14. package/auth/EntitlementsState/utils.d.ts +8 -0
  15. package/auth/EntitlementsState/utils.js +8 -0
  16. package/auth/ForgotPasswordState/index.d.ts +2 -0
  17. package/auth/GroupsState/groupsDialogsState.d.ts +12 -0
  18. package/auth/GroupsState/index.d.ts +2 -0
  19. package/auth/GroupsState/saga.js +1 -1
  20. package/auth/ImpersonationState/index.d.ts +2 -0
  21. package/auth/LoginState/index.d.ts +2 -0
  22. package/auth/LoginState/saga.d.ts +2 -2
  23. package/auth/LoginState/saga.js +10 -0
  24. package/auth/MSP/AllAccountsState/allAccountsDialogsState.d.ts +14 -0
  25. package/auth/MSP/AllAccountsState/index.d.ts +2 -0
  26. package/auth/MfaState/index.d.ts +2 -0
  27. package/auth/PasskeysState/index.d.ts +2 -0
  28. package/auth/PasskeysState/saga.js +1 -1
  29. package/auth/ProfileState/index.d.ts +2 -0
  30. package/auth/Provisioning/index.d.ts +2 -0
  31. package/auth/ResetPhoneNumberState/index.d.ts +2 -0
  32. package/auth/RestrictionsState/index.d.ts +15 -0
  33. package/auth/RolesState/index.d.ts +2 -8
  34. package/auth/SSOState/index.d.ts +2 -0
  35. package/auth/SecurityPolicyState/index.d.ts +13 -0
  36. package/auth/SessionsPolicyState/index.d.ts +2 -0
  37. package/auth/SessionsState/index.d.ts +2 -0
  38. package/auth/SignUp/index.d.ts +2 -0
  39. package/auth/SocialLogins/index.d.ts +2 -0
  40. package/auth/TeamState/index.d.ts +2 -0
  41. package/auth/TeamState/saga.js +13 -13
  42. package/auth/TenantsState/index.d.ts +2 -0
  43. package/auth/index.d.ts +4 -0
  44. package/auth/index.js +2 -0
  45. package/auth/initialState.js +3 -1
  46. package/auth/interfaces.d.ts +2 -0
  47. package/auth/reducer.d.ts +4 -1
  48. package/auth/reducer.js +3 -2
  49. package/auth/saga.js +2 -1
  50. package/auth/utils.d.ts +6 -0
  51. package/index.js +1 -1
  52. package/node/auth/ActivateState/saga.js +1 -1
  53. package/node/auth/ApiTokensState/saga.js +2 -2
  54. package/node/auth/EntitlementsState/index.js +51 -0
  55. package/node/auth/EntitlementsState/interfaces.js +5 -0
  56. package/node/auth/EntitlementsState/saga.js +34 -0
  57. package/node/auth/EntitlementsState/utils.js +15 -0
  58. package/node/auth/GroupsState/saga.js +1 -1
  59. package/node/auth/LoginState/saga.js +10 -0
  60. package/node/auth/PasskeysState/saga.js +1 -1
  61. package/node/auth/TeamState/saga.js +13 -13
  62. package/node/auth/index.js +32 -8
  63. package/node/auth/initialState.js +3 -1
  64. package/node/auth/reducer.js +3 -2
  65. package/node/auth/saga.js +8 -7
  66. package/node/index.js +1 -1
  67. package/node/utils/errorHandler.js +11 -3
  68. package/package.json +1 -1
  69. package/toolkit/index.d.ts +1 -1
  70. package/utils/errorHandler.d.ts +1 -0
  71. package/utils/errorHandler.js +9 -2
@@ -49,6 +49,7 @@ declare const reducers: {
49
49
  customLoginState?: import("..").CustomLoginState | undefined;
50
50
  allAccountsState?: import("..").IAllAccountsState | undefined;
51
51
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
52
+ entitlementsState?: import("..").EntitlementsState | undefined;
52
53
  routes: import("..").AuthPageRoutes;
53
54
  header?: any;
54
55
  loaderComponent?: any;
@@ -94,6 +95,7 @@ declare const reducers: {
94
95
  customLoginState?: import("..").CustomLoginState | undefined;
95
96
  allAccountsState?: import("..").IAllAccountsState | undefined;
96
97
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
98
+ entitlementsState?: import("..").EntitlementsState | undefined;
97
99
  routes: import("..").AuthPageRoutes;
98
100
  header?: any;
99
101
  loaderComponent?: any;
@@ -50,6 +50,7 @@ declare const reducers: {
50
50
  customLoginState?: import("..").CustomLoginState | undefined;
51
51
  allAccountsState?: import("..").IAllAccountsState | undefined;
52
52
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
53
+ entitlementsState?: import("..").EntitlementsState | undefined;
53
54
  routes: import("..").AuthPageRoutes;
54
55
  header?: any;
55
56
  loaderComponent?: any;
@@ -95,6 +96,7 @@ declare const reducers: {
95
96
  customLoginState?: import("..").CustomLoginState | undefined;
96
97
  allAccountsState?: import("..").IAllAccountsState | undefined;
97
98
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
99
+ entitlementsState?: import("..").EntitlementsState | undefined;
98
100
  routes: import("..").AuthPageRoutes;
99
101
  header?: any;
100
102
  loaderComponent?: any;
@@ -50,6 +50,7 @@ declare const reducers: {
50
50
  customLoginState?: import("..").CustomLoginState | undefined;
51
51
  allAccountsState?: import("..").IAllAccountsState | undefined;
52
52
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
53
+ entitlementsState?: import("..").EntitlementsState | undefined;
53
54
  routes: import("..").AuthPageRoutes;
54
55
  header?: any;
55
56
  loaderComponent?: any;
@@ -95,6 +96,7 @@ declare const reducers: {
95
96
  customLoginState?: import("..").CustomLoginState | undefined;
96
97
  allAccountsState?: import("..").IAllAccountsState | undefined;
97
98
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
99
+ entitlementsState?: import("..").EntitlementsState | undefined;
98
100
  routes: import("..").AuthPageRoutes;
99
101
  header?: any;
100
102
  loaderComponent?: any;
@@ -146,6 +148,7 @@ declare const reducers: {
146
148
  customLoginState?: import("..").CustomLoginState | undefined;
147
149
  allAccountsState?: import("..").IAllAccountsState | undefined;
148
150
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
151
+ entitlementsState?: import("..").EntitlementsState | undefined;
149
152
  routes: import("..").AuthPageRoutes;
150
153
  header?: any;
151
154
  loaderComponent?: any;
@@ -173,7 +173,7 @@ function* resendActivationEmailFunction({
173
173
  key: TeamStateKeys.RESEND_ACTIVATE_LINK,
174
174
  value: errorHandler(e)
175
175
  }));
176
- callback == null ? void 0 : callback(null, e.message);
176
+ callback == null ? void 0 : callback(null, e);
177
177
  }
178
178
  yield put(actions.setTeamLoader({
179
179
  key: TeamStateKeys.RESEND_ACTIVATE_LINK,
@@ -67,6 +67,7 @@ declare const reducers: {
67
67
  customLoginState?: import("..").CustomLoginState | undefined;
68
68
  allAccountsState?: import("..").IAllAccountsState | undefined;
69
69
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
70
+ entitlementsState?: import("..").EntitlementsState | undefined;
70
71
  routes: import("..").AuthPageRoutes;
71
72
  header?: any;
72
73
  loaderComponent?: any;
@@ -112,6 +113,7 @@ declare const reducers: {
112
113
  customLoginState?: import("..").CustomLoginState | undefined;
113
114
  allAccountsState?: import("..").IAllAccountsState | undefined;
114
115
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
116
+ entitlementsState?: import("..").EntitlementsState | undefined;
115
117
  routes: import("..").AuthPageRoutes;
116
118
  header?: any;
117
119
  loaderComponent?: any;
@@ -65,7 +65,7 @@ function* addUserApiToken({
65
65
  key: ApiStateKeys.ADD_API_TOKEN,
66
66
  value: false
67
67
  }));
68
- callback == null ? void 0 : callback(null, e.message);
68
+ callback == null ? void 0 : callback(null, e);
69
69
  }
70
70
  }
71
71
  function* addTenantApiToken({
@@ -130,7 +130,7 @@ function* addTenantApiToken({
130
130
  key: ApiStateKeys.ADD_API_TOKEN,
131
131
  value: false
132
132
  }));
133
- callback == null ? void 0 : callback(null, e.message);
133
+ callback == null ? void 0 : callback(null, e);
134
134
  }
135
135
  }
136
136
  function* deleteUserApiToken({
@@ -49,6 +49,7 @@ declare const reducers: {
49
49
  customLoginState?: CustomLoginState | undefined;
50
50
  allAccountsState?: import("..").IAllAccountsState | undefined;
51
51
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
52
+ entitlementsState?: import("..").EntitlementsState | undefined;
52
53
  routes: import("..").AuthPageRoutes;
53
54
  header?: any;
54
55
  loaderComponent?: any;
@@ -94,6 +95,7 @@ declare const reducers: {
94
95
  customLoginState?: CustomLoginState | undefined;
95
96
  allAccountsState?: import("..").IAllAccountsState | undefined;
96
97
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
98
+ entitlementsState?: import("..").EntitlementsState | undefined;
97
99
  routes: import("..").AuthPageRoutes;
98
100
  header?: any;
99
101
  loaderComponent?: any;
@@ -0,0 +1,71 @@
1
+ import { EntitlementsState } from './interfaces';
2
+ declare const entitlementsState: EntitlementsState;
3
+ declare const reducers: {
4
+ setEntitlementsState: {
5
+ prepare: (payload: Partial<EntitlementsState>) => {
6
+ payload: Partial<EntitlementsState>;
7
+ };
8
+ reducer: (state: import("..").AuthState, { payload }: {
9
+ payload: Partial<EntitlementsState>;
10
+ type: string;
11
+ }) => {
12
+ onRedirectTo: (path: string, opts?: import("@frontegg/rest-api").RedirectOptions | undefined) => void;
13
+ error?: any;
14
+ isAuthenticated: boolean;
15
+ userIp?: string | undefined;
16
+ isLoading: boolean;
17
+ keepSessionAlive?: boolean | undefined;
18
+ user?: import("..").User | null | undefined;
19
+ isSSOAuth: boolean;
20
+ ssoACS?: string | undefined;
21
+ includeQueryParam?: boolean | undefined;
22
+ loginState: import("..").LoginState;
23
+ activateState: import("..").ActivateAccountState;
24
+ acceptInvitationState: import("..").AcceptInvitationState;
25
+ forgotPasswordState: import("..").ForgotPasswordState;
26
+ resetPhoneNumberState: import("..").ResetPhoneNumberState;
27
+ ssoState: import("..").SSOState;
28
+ profileState: import("..").ProfileState;
29
+ mfaState: import("..").MFAState;
30
+ teamState: import("..").TeamState;
31
+ groupsState: import("..").GroupsState;
32
+ groupsDialogsState: import("..").GroupsDialogsState;
33
+ socialLoginState: import("..").SocialLoginState;
34
+ signUpState: import("..").SignUpState;
35
+ apiTokensState: import("..").ApiTokensState;
36
+ securityPolicyState: import("..").SecurityPolicyState;
37
+ restrictionsState: import("..").RestrictionsState;
38
+ provisioningState: import("..").ProvisioningState;
39
+ accountSettingsState: import("..").AccountSettingsState;
40
+ tenantsState: import("..").TenantsState;
41
+ rolesState: import("..").RolesState;
42
+ sessionsState: import("..").SessionsState;
43
+ hostedLoginBox?: boolean | undefined;
44
+ disableSilentRefresh?: boolean | undefined;
45
+ sessionsPolicyState: import("..").SessionsPolicyState;
46
+ impersonateState?: import("..").ImpersonateState | undefined;
47
+ passkeysState?: import("..").PasskeysState | undefined;
48
+ customLoginState?: import("..").CustomLoginState | undefined;
49
+ allAccountsState?: import("..").IAllAccountsState | undefined;
50
+ allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
51
+ entitlementsState?: EntitlementsState | undefined;
52
+ routes: import("..").AuthPageRoutes;
53
+ header?: any;
54
+ loaderComponent?: any;
55
+ };
56
+ };
57
+ };
58
+ declare const actions: {
59
+ loadEntitlements: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
60
+ };
61
+ /**
62
+ * To be used for actions types after dispatch, and should contains
63
+ * the reducers and actions as standalone function
64
+ */
65
+ declare type DispatchedActions = {
66
+ setEntitlementsState: (state: Partial<EntitlementsState>) => void;
67
+ loadEntitlements: () => void;
68
+ };
69
+ export declare type EntitlementsActions = DispatchedActions;
70
+ export { entitlementsState, reducers as entitlementsReducers, actions as entitlementsActions };
71
+ export * from './utils';
@@ -0,0 +1,28 @@
1
+ import { createAction } from '@reduxjs/toolkit';
2
+ import { typeReducerForKey } from '../utils';
3
+ import { authStoreName } from '../../constants';
4
+ const entitlementsState = {
5
+ entitlements: undefined,
6
+ loading: false,
7
+ error: undefined
8
+ };
9
+ const reducers = {
10
+ setEntitlementsState: typeReducerForKey('entitlementsState')
11
+ };
12
+ const actions = {
13
+ loadEntitlements: createAction(`${authStoreName}/loadEntitlements`)
14
+ };
15
+
16
+ /**
17
+ * To be used for actions types after dispatch, and should contains
18
+ * the reducers and actions as standalone function
19
+ */
20
+
21
+ // noinspection JSUnusedLocalSymbols
22
+ /**
23
+ * if you see error in matcher that's mean the DispatchAction does not
24
+ * contains the same functions in reducers and actions
25
+ */
26
+ const Matcher = {};
27
+ export { entitlementsState, reducers as entitlementsReducers, actions as entitlementsActions };
28
+ export * from './utils';
@@ -0,0 +1,9 @@
1
+ import { WithStatus } from '../../interfaces';
2
+ import { EntitlementsResponse } from '@frontegg/rest-api';
3
+ export declare type EntitlementsState = WithStatus & {
4
+ entitlements: EntitlementsResponse | undefined;
5
+ };
6
+ export interface Entitlement {
7
+ isEntitled: boolean;
8
+ }
9
+ export declare type Entitlements = Entitlement[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { EntitlementsResponse } from '@frontegg/rest-api';
2
+ /**
3
+ Load entitlements list
4
+ */
5
+ export declare function loadEntitlements(): Generator<import("redux-saga/effects").PutEffect<{
6
+ payload: Partial<import("./interfaces").EntitlementsState>;
7
+ type: string;
8
+ }> | import("redux-saga/effects").CallEffect<EntitlementsResponse>, void, EntitlementsResponse>;
9
+ export declare function entitlementsSagas(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
@@ -0,0 +1,28 @@
1
+ import { call, put, takeLeading } from 'redux-saga/effects';
2
+ import { api } from '@frontegg/rest-api';
3
+ import { actions } from '../reducer';
4
+
5
+ /**
6
+ Load entitlements list
7
+ */
8
+ export function* loadEntitlements() {
9
+ yield put(actions.setEntitlementsState({
10
+ loading: true,
11
+ error: null
12
+ }));
13
+ try {
14
+ const entitlements = yield call(api.entitlements.loadEntitlements);
15
+ yield put(actions.setEntitlementsState({
16
+ entitlements,
17
+ loading: false
18
+ }));
19
+ } catch (e) {
20
+ yield put(actions.setEntitlementsState({
21
+ error: e.message,
22
+ loading: false
23
+ }));
24
+ }
25
+ }
26
+ export function* entitlementsSagas() {
27
+ yield takeLeading(actions.loadEntitlements, loadEntitlements);
28
+ }
@@ -0,0 +1,8 @@
1
+ import { EntitlementsResponse } from '@frontegg/rest-api';
2
+ import { Entitlements } from './interfaces';
3
+ /**
4
+ @param entitlementsByKey
5
+ @param keys The requested entitlement keys
6
+ @returns Entitlements contain true/false for every key (state of is key entitled)
7
+ */
8
+ export declare const getEntitlements: (entitlementsByKey: EntitlementsResponse, keys: string[]) => Entitlements;
@@ -0,0 +1,8 @@
1
+ /**
2
+ @param entitlementsByKey
3
+ @param keys The requested entitlement keys
4
+ @returns Entitlements contain true/false for every key (state of is key entitled)
5
+ */
6
+ export const getEntitlements = (entitlementsByKey, keys) => keys.reduce((result, key) => [...result, {
7
+ isEntitled: entitlementsByKey[key] || false
8
+ }], []);
@@ -49,6 +49,7 @@ declare const reducers: {
49
49
  customLoginState?: import("..").CustomLoginState | undefined;
50
50
  allAccountsState?: import("..").IAllAccountsState | undefined;
51
51
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
52
+ entitlementsState?: import("..").EntitlementsState | undefined;
52
53
  routes: import("..").AuthPageRoutes;
53
54
  header?: any;
54
55
  loaderComponent?: any;
@@ -94,6 +95,7 @@ declare const reducers: {
94
95
  customLoginState?: import("..").CustomLoginState | undefined;
95
96
  allAccountsState?: import("..").IAllAccountsState | undefined;
96
97
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
98
+ entitlementsState?: import("..").EntitlementsState | undefined;
97
99
  routes: import("..").AuthPageRoutes;
98
100
  header?: any;
99
101
  loaderComponent?: any;
@@ -48,6 +48,7 @@ declare const reducers: {
48
48
  customLoginState?: import("..").CustomLoginState | undefined;
49
49
  allAccountsState?: import("..").IAllAccountsState | undefined;
50
50
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
51
+ entitlementsState?: import("..").EntitlementsState | undefined;
51
52
  routes: import("..").AuthPageRoutes;
52
53
  header?: any;
53
54
  loaderComponent?: any;
@@ -93,6 +94,7 @@ declare const reducers: {
93
94
  customLoginState?: import("..").CustomLoginState | undefined;
94
95
  allAccountsState?: import("..").IAllAccountsState | undefined;
95
96
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
97
+ entitlementsState?: import("..").EntitlementsState | undefined;
96
98
  routes: import("..").AuthPageRoutes;
97
99
  header?: any;
98
100
  loaderComponent?: any;
@@ -137,6 +139,7 @@ declare const reducers: {
137
139
  customLoginState?: import("..").CustomLoginState | undefined;
138
140
  allAccountsState?: import("..").IAllAccountsState | undefined;
139
141
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
142
+ entitlementsState?: import("..").EntitlementsState | undefined;
140
143
  routes: import("..").AuthPageRoutes;
141
144
  header?: any;
142
145
  loaderComponent?: any;
@@ -181,6 +184,7 @@ declare const reducers: {
181
184
  customLoginState?: import("..").CustomLoginState | undefined;
182
185
  allAccountsState?: import("..").IAllAccountsState | undefined;
183
186
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
187
+ entitlementsState?: import("..").EntitlementsState | undefined;
184
188
  routes: import("..").AuthPageRoutes;
185
189
  header?: any;
186
190
  loaderComponent?: any;
@@ -232,6 +236,7 @@ declare const reducers: {
232
236
  customLoginState?: import("..").CustomLoginState | undefined;
233
237
  allAccountsState?: import("..").IAllAccountsState | undefined;
234
238
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
239
+ entitlementsState?: import("..").EntitlementsState | undefined;
235
240
  routes: import("..").AuthPageRoutes;
236
241
  header?: any;
237
242
  loaderComponent?: any;
@@ -277,6 +282,7 @@ declare const reducers: {
277
282
  customLoginState?: import("..").CustomLoginState | undefined;
278
283
  allAccountsState?: import("..").IAllAccountsState | undefined;
279
284
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
285
+ entitlementsState?: import("..").EntitlementsState | undefined;
280
286
  routes: import("..").AuthPageRoutes;
281
287
  header?: any;
282
288
  loaderComponent?: any;
@@ -349,6 +355,7 @@ declare const reducers: {
349
355
  customLoginState?: import("..").CustomLoginState | undefined;
350
356
  allAccountsState?: import("..").IAllAccountsState | undefined;
351
357
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
358
+ entitlementsState?: import("..").EntitlementsState | undefined;
352
359
  routes: import("..").AuthPageRoutes;
353
360
  header?: any;
354
361
  loaderComponent?: any;
@@ -394,6 +401,7 @@ declare const reducers: {
394
401
  customLoginState?: import("..").CustomLoginState | undefined;
395
402
  allAccountsState?: import("..").IAllAccountsState | undefined;
396
403
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
404
+ entitlementsState?: import("..").EntitlementsState | undefined;
397
405
  routes: import("..").AuthPageRoutes;
398
406
  header?: any;
399
407
  loaderComponent?: any;
@@ -438,6 +446,7 @@ declare const reducers: {
438
446
  customLoginState?: import("..").CustomLoginState | undefined;
439
447
  allAccountsState?: import("..").IAllAccountsState | undefined;
440
448
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
449
+ entitlementsState?: import("..").EntitlementsState | undefined;
441
450
  routes: import("..").AuthPageRoutes;
442
451
  header?: any;
443
452
  loaderComponent?: any;
@@ -482,6 +491,7 @@ declare const reducers: {
482
491
  customLoginState?: import("..").CustomLoginState | undefined;
483
492
  allAccountsState?: import("..").IAllAccountsState | undefined;
484
493
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
494
+ entitlementsState?: import("..").EntitlementsState | undefined;
485
495
  routes: import("..").AuthPageRoutes;
486
496
  header?: any;
487
497
  loaderComponent?: any;
@@ -533,6 +543,7 @@ declare const reducers: {
533
543
  customLoginState?: import("..").CustomLoginState | undefined;
534
544
  allAccountsState?: import("..").IAllAccountsState | undefined;
535
545
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
546
+ entitlementsState?: import("..").EntitlementsState | undefined;
536
547
  routes: import("..").AuthPageRoutes;
537
548
  header?: any;
538
549
  loaderComponent?: any;
@@ -578,6 +589,7 @@ declare const reducers: {
578
589
  customLoginState?: import("..").CustomLoginState | undefined;
579
590
  allAccountsState?: import("..").IAllAccountsState | undefined;
580
591
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
592
+ entitlementsState?: import("..").EntitlementsState | undefined;
581
593
  routes: import("..").AuthPageRoutes;
582
594
  header?: any;
583
595
  loaderComponent?: any;
@@ -66,6 +66,7 @@ declare const reducers: {
66
66
  customLoginState?: import("..").CustomLoginState | undefined;
67
67
  allAccountsState?: import("..").IAllAccountsState | undefined;
68
68
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
69
+ entitlementsState?: import("..").EntitlementsState | undefined;
69
70
  routes: import("..").AuthPageRoutes;
70
71
  header?: any;
71
72
  loaderComponent?: any;
@@ -111,6 +112,7 @@ declare const reducers: {
111
112
  customLoginState?: import("..").CustomLoginState | undefined;
112
113
  allAccountsState?: import("..").IAllAccountsState | undefined;
113
114
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
115
+ entitlementsState?: import("..").EntitlementsState | undefined;
114
116
  routes: import("..").AuthPageRoutes;
115
117
  header?: any;
116
118
  loaderComponent?: any;
@@ -198,7 +198,7 @@ function* deleteGroupSaga({
198
198
  key,
199
199
  value: errorHandler(e)
200
200
  }));
201
- payload == null ? void 0 : (_payload$callback6 = payload.callback) == null ? void 0 : _payload$callback6.call(payload, false, e.message);
201
+ payload == null ? void 0 : (_payload$callback6 = payload.callback) == null ? void 0 : _payload$callback6.call(payload, false, e);
202
202
  } finally {
203
203
  yield put(actions.setUsersGroupsLoader({
204
204
  key,
@@ -49,6 +49,7 @@ declare const reducers: {
49
49
  customLoginState?: import("..").CustomLoginState | undefined;
50
50
  allAccountsState?: import("..").IAllAccountsState | undefined;
51
51
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
52
+ entitlementsState?: import("..").EntitlementsState | undefined;
52
53
  routes: import("..").AuthPageRoutes;
53
54
  header?: any;
54
55
  loaderComponent?: any;
@@ -94,6 +95,7 @@ declare const reducers: {
94
95
  customLoginState?: import("..").CustomLoginState | undefined;
95
96
  allAccountsState?: import("..").IAllAccountsState | undefined;
96
97
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
98
+ entitlementsState?: import("..").EntitlementsState | undefined;
97
99
  routes: import("..").AuthPageRoutes;
98
100
  header?: any;
99
101
  loaderComponent?: any;
@@ -51,6 +51,7 @@ declare const reducers: {
51
51
  customLoginState?: import("..").CustomLoginState | undefined;
52
52
  allAccountsState?: import("..").IAllAccountsState | undefined;
53
53
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
54
+ entitlementsState?: import("..").EntitlementsState | undefined;
54
55
  routes: import("..").AuthPageRoutes;
55
56
  header?: any;
56
57
  loaderComponent?: any;
@@ -96,6 +97,7 @@ declare const reducers: {
96
97
  customLoginState?: import("..").CustomLoginState | undefined;
97
98
  allAccountsState?: import("..").IAllAccountsState | undefined;
98
99
  allAccountsDialogsState?: import("..").IAllAccountsDialogsState | undefined;
100
+ entitlementsState?: import("..").EntitlementsState | undefined;
99
101
  routes: import("..").AuthPageRoutes;
100
102
  header?: any;
101
103
  loaderComponent?: any;
@@ -50,8 +50,8 @@ export declare function getMfaRequiredState(user: any): Generator<import("redux-
50
50
  isAllowedToRemember: any;
51
51
  mfaDeviceExpiration: any;
52
52
  }>;
53
- export declare function refreshToken(): Generator<import("redux-saga/effects").SelectEffect | CallEffect<any>, void, AuthState>;
54
- export declare function refreshTokenForSocialLogins(): Generator<import("redux-saga/effects").SelectEffect | CallEffect<any>, void, AuthState>;
53
+ export declare function refreshToken(): Generator<import("redux-saga/effects").SelectEffect | Generator<CallEffect<boolean[]> | CallEffect<void>, void, boolean[]> | CallEffect<any>, void, AuthState>;
54
+ export declare function refreshTokenForSocialLogins(): Generator<import("redux-saga/effects").SelectEffect | Generator<CallEffect<boolean[]> | CallEffect<void>, void, boolean[]> | CallEffect<any>, void, AuthState>;
55
55
  export declare function shouldShowPromptPasskeys(): Generator<import("redux-saga/effects").SelectEffect | CallEffect<boolean[]> | CallEffect<IWebAuthnDevices> | import("redux-saga/effects").PutEffect<{
56
56
  payload: Partial<import("../..").PasskeysState>;
57
57
  type: string;
@@ -37,12 +37,14 @@ import { getPasskeysVendorPolicy } from '../PasskeysState/helpers';
37
37
  import { getPathAndSearchParamsFromUrl, getRedirectUrl, getSearchParamsFromUrl } from './utils';
38
38
  import { getPublicSettings } from '@frontegg/rest-api/account-settings';
39
39
  import { errorHandler } from '../../utils';
40
+ import { loadEntitlements } from '../EntitlementsState/saga';
40
41
  const authStrategyLoginStepMap = {
41
42
  [AuthStrategyEnum.Code]: LoginStep.loginWithOtc,
42
43
  [AuthStrategyEnum.EmailAndPassword]: LoginStep.loginWithPassword,
43
44
  [AuthStrategyEnum.MagicLink]: LoginStep.magicLinkPreLoginSuccess,
44
45
  [AuthStrategyEnum.SmsCode]: LoginStep.loginWithSmsOtc
45
46
  };
47
+ const ADMIN_PORTAL_ENTITLEMENTS_FF = 'admin_portal_entitlements';
46
48
  export function* afterAuthNavigation() {
47
49
  const onRedirectTo = ContextHolder.onRedirectTo;
48
50
  const {
@@ -224,6 +226,12 @@ function* shouldNevigateToRegisterQuickLogin(user) {
224
226
  const quickLoginToRegister = (_ref = localStorage.getItem('register-quick-login')) != null ? _ref : loginState.quickLoginToRegister;
225
227
  return quickLoginToRegister && localStorage.getItem(`${user.id}-${quickLoginToRegister}`) !== 'true' && !window.location.pathname.endsWith(routes.logoutUrl);
226
228
  }
229
+ function* handleLoadEntitlements() {
230
+ const [isEntitlementsFFOn] = yield call(getFeatureFlags, [ADMIN_PORTAL_ENTITLEMENTS_FF]);
231
+ if (isEntitlementsFFOn) {
232
+ yield call(loadEntitlements);
233
+ }
234
+ }
227
235
  export function* refreshToken() {
228
236
  const {
229
237
  hostedLoginBox
@@ -233,6 +241,7 @@ export function* refreshToken() {
233
241
  } else {
234
242
  yield call(refreshTokenEmbedded);
235
243
  }
244
+ yield handleLoadEntitlements();
236
245
  }
237
246
  export function* refreshTokenForSocialLogins() {
238
247
  const {
@@ -243,6 +252,7 @@ export function* refreshTokenForSocialLogins() {
243
252
  } else {
244
253
  yield call(refreshTokenEmbeddedSocialLogins);
245
254
  }
255
+ yield handleLoadEntitlements();
246
256
  }
247
257
  function* refreshTokenHosted() {
248
258
  const {
@@ -49,6 +49,7 @@ declare const reducers: {
49
49
  customLoginState?: import("../..").CustomLoginState | undefined;
50
50
  allAccountsState?: import("./types").IAllAccountsState | undefined;
51
51
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
52
+ entitlementsState?: import("../..").EntitlementsState | undefined;
52
53
  routes: import("../..").AuthPageRoutes;
53
54
  header?: any;
54
55
  loaderComponent?: any;
@@ -94,6 +95,7 @@ declare const reducers: {
94
95
  customLoginState?: import("../..").CustomLoginState | undefined;
95
96
  allAccountsState?: import("./types").IAllAccountsState | undefined;
96
97
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
98
+ entitlementsState?: import("../..").EntitlementsState | undefined;
97
99
  routes: import("../..").AuthPageRoutes;
98
100
  header?: any;
99
101
  loaderComponent?: any;
@@ -145,6 +147,7 @@ declare const reducers: {
145
147
  customLoginState?: import("../..").CustomLoginState | undefined;
146
148
  allAccountsState?: import("./types").IAllAccountsState | undefined;
147
149
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
150
+ entitlementsState?: import("../..").EntitlementsState | undefined;
148
151
  routes: import("../..").AuthPageRoutes;
149
152
  header?: any;
150
153
  loaderComponent?: any;
@@ -190,6 +193,7 @@ declare const reducers: {
190
193
  customLoginState?: import("../..").CustomLoginState | undefined;
191
194
  allAccountsState?: import("./types").IAllAccountsState | undefined;
192
195
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
196
+ entitlementsState?: import("../..").EntitlementsState | undefined;
193
197
  routes: import("../..").AuthPageRoutes;
194
198
  header?: any;
195
199
  loaderComponent?: any;
@@ -241,6 +245,7 @@ declare const reducers: {
241
245
  customLoginState?: import("../..").CustomLoginState | undefined;
242
246
  allAccountsState?: import("./types").IAllAccountsState | undefined;
243
247
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
248
+ entitlementsState?: import("../..").EntitlementsState | undefined;
244
249
  routes: import("../..").AuthPageRoutes;
245
250
  header?: any;
246
251
  loaderComponent?: any;
@@ -286,6 +291,7 @@ declare const reducers: {
286
291
  customLoginState?: import("../..").CustomLoginState | undefined;
287
292
  allAccountsState?: import("./types").IAllAccountsState | undefined;
288
293
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
294
+ entitlementsState?: import("../..").EntitlementsState | undefined;
289
295
  routes: import("../..").AuthPageRoutes;
290
296
  header?: any;
291
297
  loaderComponent?: any;
@@ -337,6 +343,7 @@ declare const reducers: {
337
343
  customLoginState?: import("../..").CustomLoginState | undefined;
338
344
  allAccountsState?: import("./types").IAllAccountsState | undefined;
339
345
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
346
+ entitlementsState?: import("../..").EntitlementsState | undefined;
340
347
  routes: import("../..").AuthPageRoutes;
341
348
  header?: any;
342
349
  loaderComponent?: any;
@@ -382,6 +389,7 @@ declare const reducers: {
382
389
  customLoginState?: import("../..").CustomLoginState | undefined;
383
390
  allAccountsState?: import("./types").IAllAccountsState | undefined;
384
391
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
392
+ entitlementsState?: import("../..").EntitlementsState | undefined;
385
393
  routes: import("../..").AuthPageRoutes;
386
394
  header?: any;
387
395
  loaderComponent?: any;
@@ -433,6 +441,7 @@ declare const reducers: {
433
441
  customLoginState?: import("../..").CustomLoginState | undefined;
434
442
  allAccountsState?: import("./types").IAllAccountsState | undefined;
435
443
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
444
+ entitlementsState?: import("../..").EntitlementsState | undefined;
436
445
  routes: import("../..").AuthPageRoutes;
437
446
  header?: any;
438
447
  loaderComponent?: any;
@@ -478,6 +487,7 @@ declare const reducers: {
478
487
  customLoginState?: import("../..").CustomLoginState | undefined;
479
488
  allAccountsState?: import("./types").IAllAccountsState | undefined;
480
489
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
490
+ entitlementsState?: import("../..").EntitlementsState | undefined;
481
491
  routes: import("../..").AuthPageRoutes;
482
492
  header?: any;
483
493
  loaderComponent?: any;
@@ -529,6 +539,7 @@ declare const reducers: {
529
539
  customLoginState?: import("../..").CustomLoginState | undefined;
530
540
  allAccountsState?: import("./types").IAllAccountsState | undefined;
531
541
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
542
+ entitlementsState?: import("../..").EntitlementsState | undefined;
532
543
  routes: import("../..").AuthPageRoutes;
533
544
  header?: any;
534
545
  loaderComponent?: any;
@@ -574,6 +585,7 @@ declare const reducers: {
574
585
  customLoginState?: import("../..").CustomLoginState | undefined;
575
586
  allAccountsState?: import("./types").IAllAccountsState | undefined;
576
587
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
588
+ entitlementsState?: import("../..").EntitlementsState | undefined;
577
589
  routes: import("../..").AuthPageRoutes;
578
590
  header?: any;
579
591
  loaderComponent?: any;
@@ -625,6 +637,7 @@ declare const reducers: {
625
637
  customLoginState?: import("../..").CustomLoginState | undefined;
626
638
  allAccountsState?: import("./types").IAllAccountsState | undefined;
627
639
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
640
+ entitlementsState?: import("../..").EntitlementsState | undefined;
628
641
  routes: import("../..").AuthPageRoutes;
629
642
  header?: any;
630
643
  loaderComponent?: any;
@@ -670,6 +683,7 @@ declare const reducers: {
670
683
  customLoginState?: import("../..").CustomLoginState | undefined;
671
684
  allAccountsState?: import("./types").IAllAccountsState | undefined;
672
685
  allAccountsDialogsState?: IAllAccountsDialogsState | undefined;
686
+ entitlementsState?: import("../..").EntitlementsState | undefined;
673
687
  routes: import("../..").AuthPageRoutes;
674
688
  header?: any;
675
689
  loaderComponent?: any;
@@ -68,6 +68,7 @@ declare const reducers: {
68
68
  customLoginState?: import("../..").CustomLoginState | undefined;
69
69
  allAccountsState?: IAllAccountsState | undefined;
70
70
  allAccountsDialogsState?: import("./types").IAllAccountsDialogsState | undefined;
71
+ entitlementsState?: import("../..").EntitlementsState | undefined;
71
72
  routes: import("../..").AuthPageRoutes;
72
73
  header?: any;
73
74
  loaderComponent?: any;
@@ -113,6 +114,7 @@ declare const reducers: {
113
114
  customLoginState?: import("../..").CustomLoginState | undefined;
114
115
  allAccountsState?: IAllAccountsState | undefined;
115
116
  allAccountsDialogsState?: import("./types").IAllAccountsDialogsState | undefined;
117
+ entitlementsState?: import("../..").EntitlementsState | undefined;
116
118
  routes: import("../..").AuthPageRoutes;
117
119
  header?: any;
118
120
  loaderComponent?: any;