@frontegg/redux-store 6.119.0 → 6.121.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 (69) 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/ApiTokensState/index.d.ts +2 -0
  5. package/auth/CustomLoginState/index.d.ts +2 -0
  6. package/auth/CustomLoginState/saga.js +4 -4
  7. package/auth/EntitlementsState/index.d.ts +1 -0
  8. package/auth/ForgotPasswordState/index.d.ts +2 -0
  9. package/auth/GroupsState/groupsDialogsState.d.ts +12 -0
  10. package/auth/GroupsState/index.d.ts +2 -0
  11. package/auth/ImpersonationState/index.d.ts +2 -0
  12. package/auth/LoginState/index.d.ts +2 -0
  13. package/auth/LoginState/saga.js +1 -2
  14. package/auth/MSP/AllAccountsState/allAccountsDialogsState.d.ts +14 -0
  15. package/auth/MSP/AllAccountsState/index.d.ts +3 -0
  16. package/auth/MfaState/index.d.ts +2 -0
  17. package/auth/PasskeysState/index.d.ts +2 -0
  18. package/auth/ProfileState/index.d.ts +3 -1
  19. package/auth/ProfileState/saga.js +2 -1
  20. package/auth/Provisioning/index.d.ts +2 -0
  21. package/auth/ResetPhoneNumberState/index.d.ts +2 -0
  22. package/auth/RestrictionsState/index.d.ts +6 -12
  23. package/auth/RolesState/index.d.ts +2 -0
  24. package/auth/SSOState/index.d.ts +2 -0
  25. package/auth/SecurityCenterState/index.d.ts +141 -0
  26. package/auth/SecurityCenterState/index.js +35 -0
  27. package/auth/SecurityCenterState/interfaces.d.ts +10 -0
  28. package/auth/SecurityCenterState/interfaces.js +1 -0
  29. package/auth/SecurityCenterState/saga.d.ts +16 -0
  30. package/auth/SecurityCenterState/saga.js +61 -0
  31. package/auth/SecurityCenterState/types.d.ts +8 -0
  32. package/auth/SecurityCenterState/types.js +5 -0
  33. package/auth/SecurityPolicyState/index.d.ts +13 -0
  34. package/auth/SessionsPolicyState/index.d.ts +2 -0
  35. package/auth/SessionsState/index.d.ts +2 -0
  36. package/auth/SignUp/index.d.ts +2 -0
  37. package/auth/SocialLogins/index.d.ts +2 -0
  38. package/auth/TeamState/index.d.ts +2 -0
  39. package/auth/TenantsState/index.d.ts +2 -0
  40. package/auth/dummy.d.ts +2 -2
  41. package/auth/dummy.js +6 -5
  42. package/auth/index.d.ts +9 -1
  43. package/auth/index.js +2 -0
  44. package/auth/interfaces.d.ts +2 -0
  45. package/auth/interfaces.js +0 -2
  46. package/auth/reducer.d.ts +9 -2
  47. package/auth/reducer.js +3 -2
  48. package/auth/utils.d.ts +6 -0
  49. package/index.js +1 -1
  50. package/interfaces.d.ts +3 -0
  51. package/node/auth/CustomLoginState/saga.js +4 -4
  52. package/node/auth/LoginState/saga.js +1 -2
  53. package/node/auth/ProfileState/saga.js +2 -1
  54. package/node/auth/SecurityCenterState/index.js +42 -0
  55. package/node/auth/SecurityCenterState/interfaces.js +5 -0
  56. package/node/auth/SecurityCenterState/saga.js +69 -0
  57. package/node/auth/SecurityCenterState/types.js +12 -0
  58. package/node/auth/dummy.js +6 -5
  59. package/node/auth/index.js +28 -4
  60. package/node/auth/interfaces.js +0 -1
  61. package/node/auth/reducer.js +3 -2
  62. package/node/index.js +1 -1
  63. package/node/toolkit/index.js +13 -14
  64. package/package.json +2 -2
  65. package/toolkit/index.d.ts +2 -2
  66. package/toolkit/index.js +2 -2
  67. /package/node/toolkit/{redux-saga.js → redux-saga-tools.js} +0 -0
  68. /package/toolkit/{redux-saga.d.ts → redux-saga-tools.d.ts} +0 -0
  69. /package/toolkit/{redux-saga.js → redux-saga-tools.js} +0 -0
package/auth/reducer.d.ts CHANGED
@@ -26,8 +26,11 @@ import { CustomLoginActions } from './CustomLoginState';
26
26
  import { AllAccountsActions } from './MSP/AllAccountsState';
27
27
  import { AllAccountsDialogsActions } from './MSP/AllAccountsState/allAccountsDialogsState';
28
28
  import { EntitlementsActions } from './EntitlementsState';
29
+ import { SecurityCenterActions } from './SecurityCenterState';
29
30
  declare const reducer: import("redux").Reducer<AuthState, import("redux").AnyAction>;
30
31
  declare const actions: {
32
+ getRecommendations: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
33
+ getInsights: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
31
34
  loadAccounts: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").SearchSubTenantsParams & {
32
35
  _links?: import("@frontegg/rest-api").FronteggPaginationLinks | undefined;
33
36
  } & import("./MSP/AllAccountsState").TUserJwtPayload, boolean>], import("..").WithCallback<import("@frontegg/rest-api").SearchSubTenantsParams & {
@@ -400,7 +403,7 @@ declare const actions: {
400
403
  loadTenantMetadata: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
401
404
  updateTenantMetadata: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<Partial<import(".").UpdateTenantMetadataRequest>, boolean>], import("..").WithCallback<Partial<import(".").UpdateTenantMetadataRequest>, boolean>, string, never, never>;
402
405
  loadProfile: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
403
- saveProfile: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("..").WithCallback<import("@frontegg/rest-api").IUserProfile, import("@frontegg/rest-api").IUserProfile>>], Partial<import("..").WithCallback<import("@frontegg/rest-api").IUserProfile, import("@frontegg/rest-api").IUserProfile>>, string, never, never>;
406
+ saveProfile: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("..").WithCallback<import("@frontegg/rest-api").IGetUsersV2Response, import("@frontegg/rest-api").IGetUsersV2Response>>], Partial<import("..").WithCallback<import("@frontegg/rest-api").IGetUsersV2Response, import("@frontegg/rest-api").IGetUsersV2Response>>, string, never, never>;
404
407
  changePassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IChangePassword, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IChangePassword, boolean>, string, never, never>;
405
408
  signUpUser: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").ISignUpUserPayload], import(".").ISignUpUserPayload, string, never, never>;
406
409
  resetSignUpStateSoft: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
@@ -483,6 +486,10 @@ declare const actions: {
483
486
  preVerifyMFAEmailCode: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IPreVerifyMFA, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IPreVerifyMFA, boolean>, string, never, never>;
484
487
  verifyMFAEmailCode: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IVerifyMFAEmailCode, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IVerifyMFAEmailCode, boolean>, string, never, never>;
485
488
  resetBreachedPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IForgotPassword], import("@frontegg/rest-api").IForgotPassword, string, never, never>;
489
+ setSecurityCenterState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import(".").SecurityCenterState>], Partial<import(".").SecurityCenterState>, string, never, never>;
490
+ resetSecurityCenterState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
491
+ setSecurityCenterStateLoader: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./SecurityCenterState/types").SecurityCenterStateIndicator], import("./SecurityCenterState/types").SecurityCenterStateIndicator, string, never, never>;
492
+ setSecurityCenterStateError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./SecurityCenterState/types").SecurityCenterStateIndicator], import("./SecurityCenterState/types").SecurityCenterStateIndicator, string, never, never>;
486
493
  setEntitlementsState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import(".").EntitlementsState>], Partial<import(".").EntitlementsState>, string, never, never>;
487
494
  setAllAccountDialogsState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./MSP/AllAccountsState").IAllAccountsDialogsState>], Partial<import("./MSP/AllAccountsState").IAllAccountsDialogsState>, string, never, never>;
488
495
  resetAllAccountDialogsState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
@@ -687,5 +694,5 @@ export declare type RootActions = {
687
694
  resetState: () => void;
688
695
  setUser: (user: User) => void;
689
696
  };
690
- export declare type AuthActions = RootActions & LoginActions & SocialLoginActions & ActivateAccountActions & ImpersonateActions & AcceptInvitationActions & ForgotPasswordActions & ResetPhoneNumberActions & SignUpActions & ProfileActions & CustomLoginActions & SSOActions & MfaActions & TeamActions & GroupsActions & GroupsDialogsActions & ApiTokensActions & SecurityPolicyActions & AccountSettingsActions & TenantsActions & RolesActions & SessionsActions & RestrictionsActions & ProvisioningActions & PasskeysActions & AllAccountsActions & AllAccountsDialogsActions & EntitlementsActions;
697
+ export declare type AuthActions = RootActions & LoginActions & SocialLoginActions & ActivateAccountActions & ImpersonateActions & AcceptInvitationActions & ForgotPasswordActions & ResetPhoneNumberActions & SignUpActions & ProfileActions & CustomLoginActions & SSOActions & MfaActions & TeamActions & GroupsActions & GroupsDialogsActions & ApiTokensActions & SecurityPolicyActions & AccountSettingsActions & TenantsActions & RolesActions & SessionsActions & RestrictionsActions & ProvisioningActions & PasskeysActions & AllAccountsActions & AllAccountsDialogsActions & EntitlementsActions & SecurityCenterActions;
691
698
  export { reducer, actions };
package/auth/reducer.js CHANGED
@@ -31,6 +31,7 @@ import { customLoginActions, customLoginReducers } from './CustomLoginState';
31
31
  import { allAccountsActions, allAccountsReducers } from './MSP/AllAccountsState';
32
32
  import { allAccountsDialogsReducers } from './MSP/AllAccountsState/allAccountsDialogsState';
33
33
  import { entitlementsActions, entitlementsReducers } from './EntitlementsState';
34
+ import { securityCenterActions, securityCenterReducers } from './SecurityCenterState';
34
35
  const {
35
36
  reducer,
36
37
  actions: sliceActions
@@ -43,7 +44,7 @@ const {
43
44
  payload
44
45
  }) => _extends({}, state, payload),
45
46
  setUser: typeReducer('user')
46
- }, loginReducers, socialLoginsReducer, activateAccountReducers, impersonateReducers, acceptInvitationReducers, forgotPasswordReducers, resetPhoneNumberReducers, signUpReducers, profileReducers, customLoginReducers, ssoReducers, mfaReducers, teamReducers, groupsReducers, groupsDialogsReducers, apiTokensReducers, securityPolicyReducers, accountSettingsReducers, tenantsReducers, rolesReducers, sessionsReducers, sessionsPolicyReducers, restrictionsReducers, provisioningReducers, passkeysReducers, allAccountsReducers, allAccountsDialogsReducers, entitlementsReducers)
47
+ }, loginReducers, socialLoginsReducer, activateAccountReducers, impersonateReducers, acceptInvitationReducers, forgotPasswordReducers, resetPhoneNumberReducers, signUpReducers, profileReducers, customLoginReducers, ssoReducers, mfaReducers, teamReducers, groupsReducers, groupsDialogsReducers, apiTokensReducers, securityPolicyReducers, accountSettingsReducers, tenantsReducers, rolesReducers, sessionsReducers, sessionsPolicyReducers, restrictionsReducers, provisioningReducers, passkeysReducers, allAccountsReducers, allAccountsDialogsReducers, entitlementsReducers, securityCenterReducers)
47
48
  });
48
- const actions = _extends({}, sliceActions, loginActions, socialLoginsActions, activateAccountActions, acceptInvitationActions, forgotPasswordActions, resetPhoneNumberActions, signUpActions, profileActions, customLoginActions, ssoActions, mfaActions, teamActions, groupsActions, groupsDialogsActions, apiTokensActions, securityPolicyActions, accountSettingsActions, tenantsActions, rolesActions, sessionsActions, sessionsPolicyActions, restrictionsActions, provisioningActions, entitlementsActions, impersonateActions, passkeysActions, allAccountsActions);
49
+ const actions = _extends({}, sliceActions, loginActions, socialLoginsActions, activateAccountActions, acceptInvitationActions, forgotPasswordActions, resetPhoneNumberActions, signUpActions, profileActions, customLoginActions, ssoActions, mfaActions, teamActions, groupsActions, groupsDialogsActions, apiTokensActions, securityPolicyActions, accountSettingsActions, tenantsActions, rolesActions, sessionsActions, sessionsPolicyActions, restrictionsActions, provisioningActions, entitlementsActions, impersonateActions, passkeysActions, allAccountsActions, securityCenterActions);
49
50
  export { reducer, actions };
package/auth/utils.d.ts CHANGED
@@ -41,6 +41,7 @@ export declare const resetStateByKey: <T>(key: keyof AuthState, initialState: Pa
41
41
  allAccountsState?: import(".").IAllAccountsState | undefined;
42
42
  allAccountsDialogsState?: import(".").IAllAccountsDialogsState | undefined;
43
43
  entitlementsState?: import(".").EntitlementsState | undefined;
44
+ securityCenterState?: import(".").SecurityCenterState | undefined;
44
45
  routes: import("./interfaces").AuthPageRoutes;
45
46
  header?: any;
46
47
  loaderComponent?: any;
@@ -89,6 +90,7 @@ export declare const typeReducer: <T>(key: keyof AuthState) => (state: AuthState
89
90
  allAccountsState?: import(".").IAllAccountsState | undefined;
90
91
  allAccountsDialogsState?: import(".").IAllAccountsDialogsState | undefined;
91
92
  entitlementsState?: import(".").EntitlementsState | undefined;
93
+ securityCenterState?: import(".").SecurityCenterState | undefined;
92
94
  routes: import("./interfaces").AuthPageRoutes;
93
95
  header?: any;
94
96
  loaderComponent?: any;
@@ -141,6 +143,7 @@ export declare const typeReducerForKey: <T>(key: keyof AuthState) => {
141
143
  allAccountsState?: import(".").IAllAccountsState | undefined;
142
144
  allAccountsDialogsState?: import(".").IAllAccountsDialogsState | undefined;
143
145
  entitlementsState?: import(".").EntitlementsState | undefined;
146
+ securityCenterState?: import(".").SecurityCenterState | undefined;
144
147
  routes: import("./interfaces").AuthPageRoutes;
145
148
  header?: any;
146
149
  loaderComponent?: any;
@@ -194,6 +197,7 @@ export declare const typeReducerNestedKey: <T, K>(key: keyof AuthState, nestedKe
194
197
  allAccountsState?: import(".").IAllAccountsState | undefined;
195
198
  allAccountsDialogsState?: import(".").IAllAccountsDialogsState | undefined;
196
199
  entitlementsState?: import(".").EntitlementsState | undefined;
200
+ securityCenterState?: import(".").SecurityCenterState | undefined;
197
201
  routes: import("./interfaces").AuthPageRoutes;
198
202
  header?: any;
199
203
  loaderComponent?: any;
@@ -271,6 +275,7 @@ export declare const dialogStateForKey: <T, K>(key: keyof AuthState, dialogKey:
271
275
  allAccountsState?: import(".").IAllAccountsState | undefined;
272
276
  allAccountsDialogsState?: import(".").IAllAccountsDialogsState | undefined;
273
277
  entitlementsState?: import(".").EntitlementsState | undefined;
278
+ securityCenterState?: import(".").SecurityCenterState | undefined;
274
279
  routes: import("./interfaces").AuthPageRoutes;
275
280
  header?: any;
276
281
  loaderComponent?: any;
@@ -317,6 +322,7 @@ export declare const dialogStateForKeyWithoutPayload: <T, K>(key: keyof AuthStat
317
322
  allAccountsState?: import(".").IAllAccountsState | undefined;
318
323
  allAccountsDialogsState?: import(".").IAllAccountsDialogsState | undefined;
319
324
  entitlementsState?: import(".").EntitlementsState | undefined;
325
+ securityCenterState?: import(".").SecurityCenterState | undefined;
320
326
  routes: import("./interfaces").AuthPageRoutes;
321
327
  header?: any;
322
328
  loaderComponent?: any;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.119.0
1
+ /** @license Frontegg v6.121.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/interfaces.d.ts CHANGED
@@ -13,6 +13,9 @@ export declare type WithId<T = {}> = T & {
13
13
  export declare type LoaderIndicatorState<T extends string> = Partial<{
14
14
  [key in T]: string | boolean;
15
15
  }>;
16
+ export declare type ErrorsIndicatorState<T extends string> = Partial<{
17
+ [key in T]: string | boolean;
18
+ }>;
16
19
  export declare type WithSilentLoad<T> = T & {
17
20
  silentLoading?: boolean;
18
21
  };
@@ -8,7 +8,7 @@ exports.customLoginSagas = customLoginSagas;
8
8
  exports.customLoginSagasMock = customLoginSagasMock;
9
9
  exports.loadTenantMetadata = loadTenantMetadata;
10
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
- var _metadata = require("@frontegg/rest-api/metadata");
11
+ var _restApi = require("@frontegg/rest-api");
12
12
  var _effects = require("redux-saga/effects");
13
13
  var _reducer = require("../reducer");
14
14
  var _utils = require("../utils");
@@ -21,7 +21,7 @@ function* loadTenantMetadata() {
21
21
  loading: true
22
22
  }));
23
23
  try {
24
- const tenantMetadata = yield (0, _effects.call)(_metadata.getAdminBoxMetadata);
24
+ const tenantMetadata = yield (0, _effects.call)(_restApi.api.metadata.getAdminBoxMetadata);
25
25
  yield (0, _effects.put)(_reducer.actions.setCustomLoginState({
26
26
  tenantMetadata,
27
27
  loading: false
@@ -49,10 +49,10 @@ function* updateTenantMetadata(_ref) {
49
49
  if (requestActions.length === 0) {
50
50
  throw new Error('No changes to update');
51
51
  }
52
- yield (0, _effects.call)(_metadata.updateAdminBoxMetadata, {
52
+ yield (0, _effects.call)(_restApi.api.metadata.updateAdminBoxMetadata, {
53
53
  actions: requestActions
54
54
  });
55
- const tenantMetadata = yield (0, _effects.call)(_metadata.getAdminBoxMetadata);
55
+ const tenantMetadata = yield (0, _effects.call)(_restApi.api.metadata.getAdminBoxMetadata);
56
56
  yield (0, _effects.put)(_reducer.actions.setCustomLoginState({
57
57
  tenantMetadata,
58
58
  saving: false
@@ -33,7 +33,6 @@ var _utils = require("../utils");
33
33
  var _saga3 = require("../SecurityPolicyState/saga");
34
34
  var _helpers2 = require("../PasskeysState/helpers");
35
35
  var _utils2 = require("./utils");
36
- var _accountSettings = require("@frontegg/rest-api/account-settings");
37
36
  var _utils3 = require("../../utils");
38
37
  var _saga4 = require("../EntitlementsState/saga");
39
38
  var _consts = require("./consts");
@@ -473,7 +472,7 @@ function* loadCustomLoginRoutes() {
473
472
  const {
474
473
  applicationUrl,
475
474
  loginUrl
476
- } = yield (0, _effects.call)(_accountSettings.getPublicSettings);
475
+ } = yield (0, _effects.call)(_restApi.api.accountSettings.getPublicSettings);
477
476
  if (applicationUrl && loginUrl) {
478
477
  var _getSearchParamsFromU;
479
478
  const searchParams = (_getSearchParamsFromU = (0, _utils2.getSearchParamsFromUrl)(applicationUrl)) != null ? _getSearchParamsFromU : '';
@@ -68,7 +68,8 @@ function* saveProfile(_ref) {
68
68
  const newProfileData = (0, _extends2.default)({}, oldProfileData, payload, {
69
69
  profilePictureUrl: newProfilePictureUrl
70
70
  });
71
- const profile = yield (0, _effects.call)(_restApi.api.teams.updateProfile, newProfileData);
71
+ //TODO: change the payload type to IUpdateUserProfile which is the right type to send, currently we send more data then actually needed.
72
+ const profile = yield (0, _effects.call)(_restApi.api.users.updateUserProfileV2, newProfileData);
72
73
  const currentUser = yield (0, _effects.select)(state => state.auth.user);
73
74
  yield (0, _effects.put)(_reducer.actions.setUser((0, _extends2.default)({}, currentUser, profile)));
74
75
  yield (0, _effects.put)(_reducer.actions.setProfileState({
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.securityCenterState = exports.securityCenterReducers = exports.securityCenterActions = void 0;
7
+ var _toolkit = require("@reduxjs/toolkit");
8
+ var _constants = require("../../constants");
9
+ var _utils = require("../utils");
10
+ const securityCenterState = {
11
+ loaders: {},
12
+ errors: {},
13
+ recommendations: [],
14
+ insights: [],
15
+ score: 0
16
+ };
17
+ exports.securityCenterState = securityCenterState;
18
+ const reducers = {
19
+ setSecurityCenterState: (0, _utils.typeReducerForKey)('securityCenterState'),
20
+ resetSecurityCenterState: (0, _utils.resetStateByKey)('securityCenterState', {
21
+ securityCenterState
22
+ }),
23
+ setSecurityCenterStateLoader: (0, _utils.loadersReducerForKey)('securityCenterState'),
24
+ setSecurityCenterStateError: (0, _utils.errorsReducerForKey)('securityCenterState')
25
+ };
26
+ exports.securityCenterReducers = reducers;
27
+ const actions = {
28
+ getRecommendations: (0, _toolkit.createAction)(`${_constants.authStoreName}/getRecommendations`),
29
+ getInsights: (0, _toolkit.createAction)(`${_constants.authStoreName}/getInsights`)
30
+ };
31
+
32
+ /**
33
+ * To be used for actions types after dispatch, and should contains
34
+ * the reducers and actions as standalone function
35
+ */
36
+ exports.securityCenterActions = actions;
37
+ // noinspection JSUnusedLocalSymbols
38
+ /**
39
+ * if you see error in matcher that's mean the DispatchAction does not
40
+ * contains the same functions in reducers and actions
41
+ */
42
+ const Matcher = {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getInsights = getInsights;
7
+ exports.getRecommendations = getRecommendations;
8
+ exports.securityCenterSagas = securityCenterSagas;
9
+ var _effects = require("redux-saga/effects");
10
+ var _reducer = require("../reducer");
11
+ var _utils = require("../../utils");
12
+ var _restApi = require("@frontegg/rest-api");
13
+ var _types = require("./types");
14
+ function* getRecommendations() {
15
+ const key = _types.SecurityCenterStateKeys.RECOMMENDATIONS;
16
+ yield (0, _effects.put)(_reducer.actions.setSecurityCenterStateLoader({
17
+ key,
18
+ value: true
19
+ }));
20
+ try {
21
+ const {
22
+ recommendations,
23
+ scoring
24
+ } = yield (0, _effects.call)(_restApi.api.securityCenter.getRecommendations);
25
+ yield (0, _effects.put)(_reducer.actions.setSecurityCenterState({
26
+ recommendations: recommendations.items,
27
+ score: scoring.score
28
+ }));
29
+ } catch (e) {
30
+ yield (0, _effects.put)(_reducer.actions.setSecurityCenterStateError({
31
+ key,
32
+ value: (0, _utils.errorHandler)(e)
33
+ }));
34
+ } finally {
35
+ yield (0, _effects.put)(_reducer.actions.setSecurityCenterStateLoader({
36
+ key,
37
+ value: false
38
+ }));
39
+ }
40
+ }
41
+ function* getInsights() {
42
+ const key = _types.SecurityCenterStateKeys.INSIGHTS;
43
+ yield (0, _effects.put)(_reducer.actions.setSecurityCenterStateLoader({
44
+ key,
45
+ value: true
46
+ }));
47
+ try {
48
+ const {
49
+ insights
50
+ } = yield (0, _effects.call)(_restApi.api.securityCenter.getInsights);
51
+ yield (0, _effects.put)(_reducer.actions.setSecurityCenterState({
52
+ insights: insights.items
53
+ }));
54
+ } catch (e) {
55
+ yield (0, _effects.put)(_reducer.actions.setSecurityCenterStateError({
56
+ key,
57
+ value: (0, _utils.errorHandler)(e)
58
+ }));
59
+ } finally {
60
+ yield (0, _effects.put)(_reducer.actions.setSecurityCenterStateLoader({
61
+ key,
62
+ value: false
63
+ }));
64
+ }
65
+ }
66
+ function* securityCenterSagas() {
67
+ yield (0, _effects.takeEvery)(_reducer.actions.getRecommendations, getRecommendations);
68
+ yield (0, _effects.takeEvery)(_reducer.actions.getInsights, getInsights);
69
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SecurityCenterStateKeys = void 0;
7
+ let SecurityCenterStateKeys;
8
+ exports.SecurityCenterStateKeys = SecurityCenterStateKeys;
9
+ (function (SecurityCenterStateKeys) {
10
+ SecurityCenterStateKeys["RECOMMENDATIONS"] = "recommendations";
11
+ SecurityCenterStateKeys["INSIGHTS"] = "insights";
12
+ })(SecurityCenterStateKeys || (exports.SecurityCenterStateKeys = SecurityCenterStateKeys = {}));
@@ -62,19 +62,21 @@ const rolePermissionDemo = [{
62
62
  id: 'adminPermissionId',
63
63
  key: 'fe.*',
64
64
  name: 'General Admin',
65
- description: undefined,
65
+ description: 'description',
66
66
  categoryId: 'category',
67
67
  fePermission: true,
68
68
  createdAt: new Date(),
69
- updatedAt: new Date()
69
+ updatedAt: new Date(),
70
+ roleIds: []
70
71
  }];
71
72
  exports.rolePermissionDemo = rolePermissionDemo;
72
73
  const userProfileDemo = {
74
+ sub: '',
75
+ tenants: [],
73
76
  id: 'testId',
74
77
  name: 'Demo User Name',
75
78
  email: 'demo-user@frontegg.com',
76
79
  mfaEnrolled: true,
77
- profileImage: undefined,
78
80
  profilePictureUrl: 'https://www.gravatar.com/avatar/42b2ad2bad6fc9b9db5086dfcf8072ac?d=https://ui-avatars.com/api/fe/128/random?t=1617261890875?t=1617261917434',
79
81
  roles: roleDemo,
80
82
  permissions: rolePermissionDemo,
@@ -89,8 +91,7 @@ const userProfileDemo = {
89
91
  country: 'Israel'
90
92
  }
91
93
  }),
92
- roleIds: undefined,
93
- verified: undefined
94
+ verified: false
94
95
  };
95
96
  exports.userProfileDemo = userProfileDemo;
96
97
  const userDemo = (0, _extends2.default)({}, userProfileDemo, {
@@ -652,6 +652,30 @@ Object.keys(_interfaces25).forEach(function (key) {
652
652
  }
653
653
  });
654
654
  });
655
+ var _SecurityCenterState = require("./SecurityCenterState");
656
+ Object.keys(_SecurityCenterState).forEach(function (key) {
657
+ if (key === "default" || key === "__esModule") return;
658
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
659
+ if (key in exports && exports[key] === _SecurityCenterState[key]) return;
660
+ Object.defineProperty(exports, key, {
661
+ enumerable: true,
662
+ get: function () {
663
+ return _SecurityCenterState[key];
664
+ }
665
+ });
666
+ });
667
+ var _interfaces26 = require("./SecurityCenterState/interfaces");
668
+ Object.keys(_interfaces26).forEach(function (key) {
669
+ if (key === "default" || key === "__esModule") return;
670
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
671
+ if (key in exports && exports[key] === _interfaces26[key]) return;
672
+ Object.defineProperty(exports, key, {
673
+ enumerable: true,
674
+ get: function () {
675
+ return _interfaces26[key];
676
+ }
677
+ });
678
+ });
655
679
  var _CustomLoginState = require("./CustomLoginState");
656
680
  Object.keys(_CustomLoginState).forEach(function (key) {
657
681
  if (key === "default" || key === "__esModule") return;
@@ -664,15 +688,15 @@ Object.keys(_CustomLoginState).forEach(function (key) {
664
688
  }
665
689
  });
666
690
  });
667
- var _interfaces26 = require("./CustomLoginState/interfaces");
668
- Object.keys(_interfaces26).forEach(function (key) {
691
+ var _interfaces27 = require("./CustomLoginState/interfaces");
692
+ Object.keys(_interfaces27).forEach(function (key) {
669
693
  if (key === "default" || key === "__esModule") return;
670
694
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
671
- if (key in exports && exports[key] === _interfaces26[key]) return;
695
+ if (key in exports && exports[key] === _interfaces27[key]) return;
672
696
  Object.defineProperty(exports, key, {
673
697
  enumerable: true,
674
698
  get: function () {
675
- return _interfaces26[key];
699
+ return _interfaces27[key];
676
700
  }
677
701
  });
678
702
  });
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UserVeirifedOriginTypes = exports.AuthenticationTypes = exports.AdminPortalPagesForEvents = exports.AdminPortalPages = void 0;
7
- //TODO: move act and subAccountAccessAllowed to IUserProfile in rest-api
8
7
  let UserVeirifedOriginTypes;
9
8
  exports.UserVeirifedOriginTypes = UserVeirifedOriginTypes;
10
9
  (function (UserVeirifedOriginTypes) {
@@ -38,6 +38,7 @@ var _CustomLoginState = require("./CustomLoginState");
38
38
  var _AllAccountsState = require("./MSP/AllAccountsState");
39
39
  var _allAccountsDialogsState = require("./MSP/AllAccountsState/allAccountsDialogsState");
40
40
  var _EntitlementsState = require("./EntitlementsState");
41
+ var _SecurityCenterState = require("./SecurityCenterState");
41
42
  const {
42
43
  reducer,
43
44
  actions: sliceActions
@@ -50,8 +51,8 @@ const {
50
51
  payload
51
52
  }) => (0, _extends2.default)({}, state, payload),
52
53
  setUser: (0, _utils.typeReducer)('user')
53
- }, _LoginState.loginReducers, _SocialLogins.socialLoginsReducer, _ActivateState.activateAccountReducers, _ImpersonationState.impersonateReducers, _AcceptInvitationState.acceptInvitationReducers, _ForgotPasswordState.forgotPasswordReducers, _ResetPhoneNumberState.resetPhoneNumberReducers, _SignUp.signUpReducers, _ProfileState.profileReducers, _CustomLoginState.customLoginReducers, _SSOState.ssoReducers, _MfaState.mfaReducers, _TeamState.teamReducers, _GroupsState.groupsReducers, _groupsDialogsState.groupsDialogsReducers, _ApiTokensState.apiTokensReducers, _SecurityPolicyState.securityPolicyReducers, _AccountSettingsState.accountSettingsReducers, _TenantsState.tenantsReducers, _RolesState.rolesReducers, _SessionsState.sessionsReducers, _SessionsPolicyState.sessionsPolicyReducers, _RestrictionsState.restrictionsReducers, _Provisioning.provisioningReducers, _PasskeysState.passkeysReducers, _AllAccountsState.allAccountsReducers, _allAccountsDialogsState.allAccountsDialogsReducers, _EntitlementsState.entitlementsReducers)
54
+ }, _LoginState.loginReducers, _SocialLogins.socialLoginsReducer, _ActivateState.activateAccountReducers, _ImpersonationState.impersonateReducers, _AcceptInvitationState.acceptInvitationReducers, _ForgotPasswordState.forgotPasswordReducers, _ResetPhoneNumberState.resetPhoneNumberReducers, _SignUp.signUpReducers, _ProfileState.profileReducers, _CustomLoginState.customLoginReducers, _SSOState.ssoReducers, _MfaState.mfaReducers, _TeamState.teamReducers, _GroupsState.groupsReducers, _groupsDialogsState.groupsDialogsReducers, _ApiTokensState.apiTokensReducers, _SecurityPolicyState.securityPolicyReducers, _AccountSettingsState.accountSettingsReducers, _TenantsState.tenantsReducers, _RolesState.rolesReducers, _SessionsState.sessionsReducers, _SessionsPolicyState.sessionsPolicyReducers, _RestrictionsState.restrictionsReducers, _Provisioning.provisioningReducers, _PasskeysState.passkeysReducers, _AllAccountsState.allAccountsReducers, _allAccountsDialogsState.allAccountsDialogsReducers, _EntitlementsState.entitlementsReducers, _SecurityCenterState.securityCenterReducers)
54
55
  });
55
56
  exports.reducer = reducer;
56
- const actions = (0, _extends2.default)({}, sliceActions, _LoginState.loginActions, _SocialLogins.socialLoginsActions, _ActivateState.activateAccountActions, _AcceptInvitationState.acceptInvitationActions, _ForgotPasswordState.forgotPasswordActions, _ResetPhoneNumberState.resetPhoneNumberActions, _SignUp.signUpActions, _ProfileState.profileActions, _CustomLoginState.customLoginActions, _SSOState.ssoActions, _MfaState.mfaActions, _TeamState.teamActions, _GroupsState.groupsActions, _groupsDialogsState.groupsDialogsActions, _ApiTokensState.apiTokensActions, _SecurityPolicyState.securityPolicyActions, _AccountSettingsState.accountSettingsActions, _TenantsState.tenantsActions, _RolesState.rolesActions, _SessionsState.sessionsActions, _SessionsPolicyState.sessionsPolicyActions, _RestrictionsState.restrictionsActions, _Provisioning.provisioningActions, _EntitlementsState.entitlementsActions, _ImpersonationState.impersonateActions, _PasskeysState.passkeysActions, _AllAccountsState.allAccountsActions);
57
+ const actions = (0, _extends2.default)({}, sliceActions, _LoginState.loginActions, _SocialLogins.socialLoginsActions, _ActivateState.activateAccountActions, _AcceptInvitationState.acceptInvitationActions, _ForgotPasswordState.forgotPasswordActions, _ResetPhoneNumberState.resetPhoneNumberActions, _SignUp.signUpActions, _ProfileState.profileActions, _CustomLoginState.customLoginActions, _SSOState.ssoActions, _MfaState.mfaActions, _TeamState.teamActions, _GroupsState.groupsActions, _groupsDialogsState.groupsDialogsActions, _ApiTokensState.apiTokensActions, _SecurityPolicyState.securityPolicyActions, _AccountSettingsState.accountSettingsActions, _TenantsState.tenantsActions, _RolesState.rolesActions, _SessionsState.sessionsActions, _SessionsPolicyState.sessionsPolicyActions, _RestrictionsState.restrictionsActions, _Provisioning.provisioningActions, _EntitlementsState.entitlementsActions, _ImpersonationState.impersonateActions, _PasskeysState.passkeysActions, _AllAccountsState.allAccountsActions, _SecurityCenterState.securityCenterActions);
57
58
  exports.actions = actions;
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.119.0
1
+ /** @license Frontegg v6.121.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -18,7 +18,18 @@ exports.createFronteggStore = void 0;
18
18
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
19
19
  var _auth = _interopRequireWildcard(require("../auth"));
20
20
  var _toolkit = require("@reduxjs/toolkit");
21
- var _reduxSaga = _interopRequireDefault(require("redux-saga"));
21
+ var _reduxSagaTools = require("./redux-saga-tools");
22
+ Object.keys(_reduxSagaTools).forEach(function (key) {
23
+ if (key === "default" || key === "__esModule") return;
24
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
25
+ if (key in exports && exports[key] === _reduxSagaTools[key]) return;
26
+ Object.defineProperty(exports, key, {
27
+ enumerable: true,
28
+ get: function () {
29
+ return _reduxSagaTools[key];
30
+ }
31
+ });
32
+ });
22
33
  var _effects = require("redux-saga/effects");
23
34
  var _restApi = require("@frontegg/rest-api");
24
35
  var _audits = _interopRequireDefault(require("../audits"));
@@ -38,18 +49,6 @@ Object.keys(_redux).forEach(function (key) {
38
49
  }
39
50
  });
40
51
  });
41
- var _reduxSaga2 = require("./redux-saga");
42
- Object.keys(_reduxSaga2).forEach(function (key) {
43
- if (key === "default" || key === "__esModule") return;
44
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
45
- if (key in exports && exports[key] === _reduxSaga2[key]) return;
46
- Object.defineProperty(exports, key, {
47
- enumerable: true,
48
- get: function () {
49
- return _reduxSaga2[key];
50
- }
51
- });
52
- });
53
52
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
54
53
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
55
54
  const initialState = {
@@ -93,7 +92,7 @@ const createFronteggStore = (rootInitialState, storeHolder, previewMode = false,
93
92
  if (!previewMode && !builderMode) {
94
93
  _restApi.ContextHolder.setContext(rootInitialState.context);
95
94
  }
96
- const sagaMiddleware = (0, _reduxSaga.default)();
95
+ const sagaMiddleware = (0, _reduxSagaTools.createSagaMiddleware)();
97
96
  const middleware = [...(0, _toolkit.getDefaultMiddleware)({
98
97
  thunk: false,
99
98
  immutableCheck: false,
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
- "version": "6.119.0",
3
+ "version": "6.121.0",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",
7
7
  "dependencies": {
8
8
  "@babel/runtime": "^7.18.6",
9
- "@frontegg/rest-api": "3.0.136",
9
+ "@frontegg/rest-api": "3.1.5",
10
10
  "@reduxjs/toolkit": "1.8.5",
11
11
  "fast-deep-equal": "3.1.3",
12
12
  "redux-saga": "^1.2.1",
@@ -4,7 +4,7 @@ import { AuditsState } from '../audits';
4
4
  import { OldAuditsState } from '../audits/backward-compatibility';
5
5
  import { EnhancedStore } from './redux-types';
6
6
  export * from './redux';
7
- export * from './redux-saga';
7
+ export * from './redux-saga-tools';
8
8
  declare type InitialState = {
9
9
  context: ContextOptions;
10
10
  appName: string;
@@ -17,7 +17,7 @@ export interface RootState {
17
17
  previewMode?: boolean;
18
18
  appName: string;
19
19
  }
20
- export declare const createFronteggStore: (rootInitialState: InitialState, storeHolder?: any, previewMode?: boolean, authInitialState?: (Partial<Pick<AuthState, "user" | "error" | "onRedirectTo" | "isAuthenticated" | "userIp" | "isLoading" | "keepSessionAlive" | "isSSOAuth" | "ssoACS" | "includeQueryParam" | "loginState" | "activateState" | "acceptInvitationState" | "forgotPasswordState" | "resetPhoneNumberState" | "ssoState" | "profileState" | "mfaState" | "teamState" | "groupsState" | "groupsDialogsState" | "socialLoginState" | "signUpState" | "apiTokensState" | "securityPolicyState" | "restrictionsState" | "provisioningState" | "accountSettingsState" | "tenantsState" | "rolesState" | "sessionsState" | "hostedLoginBox" | "disableSilentRefresh" | "sessionsPolicyState" | "impersonateState" | "passkeysState" | "customLoginState" | "allAccountsState" | "allAccountsDialogsState" | "entitlementsState" | "header" | "loaderComponent">> & {
20
+ export declare const createFronteggStore: (rootInitialState: InitialState, storeHolder?: any, previewMode?: boolean, authInitialState?: (Partial<Pick<AuthState, "user" | "error" | "onRedirectTo" | "isAuthenticated" | "userIp" | "isLoading" | "keepSessionAlive" | "isSSOAuth" | "ssoACS" | "includeQueryParam" | "loginState" | "activateState" | "acceptInvitationState" | "forgotPasswordState" | "resetPhoneNumberState" | "ssoState" | "profileState" | "mfaState" | "teamState" | "groupsState" | "groupsDialogsState" | "socialLoginState" | "signUpState" | "apiTokensState" | "securityPolicyState" | "restrictionsState" | "provisioningState" | "accountSettingsState" | "tenantsState" | "rolesState" | "sessionsState" | "hostedLoginBox" | "disableSilentRefresh" | "sessionsPolicyState" | "impersonateState" | "passkeysState" | "customLoginState" | "allAccountsState" | "allAccountsDialogsState" | "entitlementsState" | "securityCenterState" | "header" | "loaderComponent">> & {
21
21
  routes?: Partial<AuthPageRoutes> | undefined;
22
22
  }) | undefined, overrideInitialState?: Partial<{
23
23
  auth: Partial<Omit<AuthState, 'routes'>> & {
package/toolkit/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { authActions } from '../auth';
3
3
  import { configureStore, getDefaultMiddleware, combineReducers, createSlice } from '@reduxjs/toolkit';
4
- import createSagaMiddleware from 'redux-saga';
4
+ import { createSagaMiddleware } from './redux-saga-tools';
5
5
  import { all, call } from 'redux-saga/effects';
6
6
  import { ContextHolder } from '@frontegg/rest-api';
7
7
  import authStore from '../auth';
@@ -11,7 +11,7 @@ import connectivityStore from '../connectivity';
11
11
  import subscriptionsStore from '../subscriptions';
12
12
  import vendorStore from '../vendor';
13
13
  export * from './redux';
14
- export * from './redux-saga';
14
+ export * from './redux-saga-tools';
15
15
  export { bindActionCreators } from '@reduxjs/toolkit';
16
16
  const initialState = {
17
17
  context: undefined,
File without changes