@frontegg/redux-store 6.50.0 → 6.51.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 (47) hide show
  1. package/auth/AcceptInvitationState/index.d.ts +2 -0
  2. package/auth/AccountSettingsState/index.d.ts +2 -8
  3. package/auth/ActivateState/index.d.ts +15 -0
  4. package/auth/ApiTokensState/index.d.ts +2 -0
  5. package/auth/ForgotPasswordState/index.d.ts +2 -0
  6. package/auth/LoginState/index.d.ts +2 -0
  7. package/auth/MfaState/index.d.ts +2 -0
  8. package/auth/ProfileState/index.d.ts +2 -0
  9. package/auth/Provisioning/index.d.ts +110 -0
  10. package/auth/Provisioning/index.js +37 -0
  11. package/auth/Provisioning/interfaces.d.ts +6 -0
  12. package/auth/Provisioning/interfaces.js +1 -0
  13. package/auth/Provisioning/saga.d.ts +1 -0
  14. package/auth/Provisioning/saga.js +132 -0
  15. package/auth/ResetPhoneNumberState/index.d.ts +2 -0
  16. package/auth/RestrictionsState/index.d.ts +3 -0
  17. package/auth/RestrictionsState/saga.js +18 -11
  18. package/auth/RolesState/index.d.ts +2 -0
  19. package/auth/SSOState/index.d.ts +2 -0
  20. package/auth/SecurityPolicyState/index.d.ts +11 -0
  21. package/auth/SessionsPolicyState/index.d.ts +2 -0
  22. package/auth/SessionsState/index.d.ts +2 -0
  23. package/auth/SignUp/index.d.ts +2 -0
  24. package/auth/SocialLogins/index.d.ts +2 -0
  25. package/auth/TeamState/index.d.ts +2 -0
  26. package/auth/TenantsState/index.d.ts +2 -0
  27. package/auth/index.d.ts +12 -0
  28. package/auth/index.js +2 -0
  29. package/auth/initialState.js +3 -1
  30. package/auth/interfaces.d.ts +2 -0
  31. package/auth/reducer.d.ts +12 -1
  32. package/auth/reducer.js +3 -2
  33. package/auth/saga.js +2 -1
  34. package/auth/utils.d.ts +4 -0
  35. package/index.js +1 -1
  36. package/interfaces.d.ts +3 -0
  37. package/node/auth/Provisioning/index.js +49 -0
  38. package/node/auth/Provisioning/interfaces.js +5 -0
  39. package/node/auth/Provisioning/saga.js +144 -0
  40. package/node/auth/RestrictionsState/saga.js +19 -11
  41. package/node/auth/index.js +28 -0
  42. package/node/auth/initialState.js +4 -1
  43. package/node/auth/reducer.js +4 -2
  44. package/node/auth/saga.js +3 -1
  45. package/node/index.js +1 -1
  46. package/package.json +2 -2
  47. package/toolkit/index.d.ts +1 -1
@@ -18,6 +18,8 @@ var _restApi = require("@frontegg/rest-api");
18
18
 
19
19
  var _reducer = require("../reducer");
20
20
 
21
+ var _uuid = require("uuid");
22
+
21
23
  var _constants = require("../../constants");
22
24
 
23
25
  var _dummy = require("../dummy");
@@ -494,7 +496,7 @@ function* checkIfUserIpValidMock() {
494
496
  }
495
497
 
496
498
  function* saveIpRestrictionMock(_ref5) {
497
- var _ipRestrictionsState$4, _ipRestrictionsState$5;
499
+ var _ipRestrictionsState$4, _ipRestrictionsState$5, _newRestriction$isAct;
498
500
 
499
501
  let {
500
502
  payload: {
@@ -507,17 +509,18 @@ function* saveIpRestrictionMock(_ref5) {
507
509
  error: null
508
510
  }));
509
511
  const ipRestrictionsState = yield selectIpRestrictionsState();
512
+ const filteredRestrictions = ipRestrictionsState.data.restrictions.filter(r => r.ip !== newRestriction.ip);
510
513
  yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
511
514
  data: {
512
515
  config: (_ipRestrictionsState$4 = (_ipRestrictionsState$5 = ipRestrictionsState.data) == null ? void 0 : _ipRestrictionsState$5.config) != null ? _ipRestrictionsState$4 : {
513
516
  isActive: false,
514
517
  strategy: _restApi.RestrictionType.ALLOW
515
518
  },
516
- restrictions: [...ipRestrictionsState.data.restrictions, (0, _extends2.default)({}, newRestriction, {
519
+ restrictions: [...filteredRestrictions, (0, _extends2.default)({}, newRestriction, {
517
520
  createdAt: new Date(),
518
521
  updatedAt: new Date(),
519
- id: '123',
520
- isActive: true,
522
+ id: (0, _uuid.v4)(),
523
+ isActive: (_newRestriction$isAct = newRestriction.isActive) != null ? _newRestriction$isAct : true,
521
524
  strategy: ipRestrictionsState.data.config.strategy
522
525
  })]
523
526
  },
@@ -533,20 +536,23 @@ function* saveIpRestrictionMock(_ref5) {
533
536
  }
534
537
 
535
538
  function* saveIpRestrictionsConfigMock(_ref6) {
539
+ var _ipRestrictionsState$6, _ipRestrictionsState$7, _ipRestrictionsState$8;
540
+
536
541
  let {
537
542
  payload: {
538
543
  callback
539
544
  }
540
545
  } = _ref6,
541
546
  config = (0, _objectWithoutPropertiesLoose2.default)(_ref6.payload, _excluded6);
547
+ const ipRestrictionsState = yield selectIpRestrictionsState();
542
548
  yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
543
549
  saving: true,
544
550
  error: null
545
551
  }));
546
552
  yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
547
553
  data: {
548
- config,
549
- restrictions: _dummy.dummyIps.filter(ip => ip.strategy === config.strategy)
554
+ config: (0, _extends2.default)({}, (_ipRestrictionsState$6 = ipRestrictionsState.data) == null ? void 0 : _ipRestrictionsState$6.config, config),
555
+ restrictions: (_ipRestrictionsState$7 = (_ipRestrictionsState$8 = ipRestrictionsState.data) == null ? void 0 : _ipRestrictionsState$8.restrictions) != null ? _ipRestrictionsState$7 : []
550
556
  },
551
557
  pagination: {
552
558
  _filter: _restApi.RestrictionType.ALLOW,
@@ -565,10 +571,11 @@ function* saveIpRestrictionsConfigMock(_ref6) {
565
571
 
566
572
  function* deleteIpRestrictionMock({
567
573
  payload: {
568
- id
574
+ id,
575
+ callback
569
576
  }
570
577
  }) {
571
- var _ipRestrictionsState$6;
578
+ var _ipRestrictionsState$9;
572
579
 
573
580
  yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
574
581
  saving: true,
@@ -577,7 +584,7 @@ function* deleteIpRestrictionMock({
577
584
  const ipRestrictionsState = yield selectIpRestrictionsState();
578
585
  yield (0, _effects.put)(_reducer.actions.setIpRestrictionsState({
579
586
  data: {
580
- config: ((_ipRestrictionsState$6 = ipRestrictionsState.data) == null ? void 0 : _ipRestrictionsState$6.config) || {
587
+ config: ((_ipRestrictionsState$9 = ipRestrictionsState.data) == null ? void 0 : _ipRestrictionsState$9.config) || {
581
588
  isActive: false,
582
589
  strategy: _restApi.RestrictionType.ALLOW
583
590
  },
@@ -589,8 +596,10 @@ function* deleteIpRestrictionMock({
589
596
  _offset: 0
590
597
  },
591
598
  totalPages: 1,
592
- saving: false
599
+ saving: false,
600
+ error: null
593
601
  }));
602
+ callback == null ? void 0 : callback(true);
594
603
  }
595
604
 
596
605
  function* addCurrentUserIpAndActivateMock({
@@ -628,7 +637,6 @@ function* loadEmailDomainRestrictionsMock() {
628
637
  loading: true,
629
638
  error: null
630
639
  }));
631
- yield (0, _utils.delay)();
632
640
  yield (0, _effects.put)(_reducer.actions.setEmailDomainRestrictionsState({
633
641
  loading: false,
634
642
  data: {
@@ -602,6 +602,34 @@ Object.keys(_interfaces20).forEach(function (key) {
602
602
  }
603
603
  });
604
604
  });
605
+
606
+ var _Provisioning = require("./Provisioning");
607
+
608
+ Object.keys(_Provisioning).forEach(function (key) {
609
+ if (key === "default" || key === "__esModule") return;
610
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
611
+ if (key in exports && exports[key] === _Provisioning[key]) return;
612
+ Object.defineProperty(exports, key, {
613
+ enumerable: true,
614
+ get: function () {
615
+ return _Provisioning[key];
616
+ }
617
+ });
618
+ });
619
+
620
+ var _interfaces21 = require("./Provisioning/interfaces");
621
+
622
+ Object.keys(_interfaces21).forEach(function (key) {
623
+ if (key === "default" || key === "__esModule") return;
624
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
625
+ if (key in exports && exports[key] === _interfaces21[key]) return;
626
+ Object.defineProperty(exports, key, {
627
+ enumerable: true,
628
+ get: function () {
629
+ return _interfaces21[key];
630
+ }
631
+ });
632
+ });
605
633
  // export types
606
634
  // export store
607
635
  var _default = {
@@ -47,6 +47,8 @@ var _SessionsPolicyState = require("./SessionsPolicyState");
47
47
 
48
48
  var _RestrictionsState = require("./RestrictionsState");
49
49
 
50
+ var _Provisioning = require("./Provisioning");
51
+
50
52
  const reinitializeState = {
51
53
  isAuthenticated: false,
52
54
  isLoading: true,
@@ -70,7 +72,8 @@ const reinitializeState = {
70
72
  resetPhoneNumberState: _ResetPhoneNumberState.resetPhoneNumberState,
71
73
  sessionsState: _SessionsState.sessionsState,
72
74
  sessionsPolicyState: _SessionsPolicyState.sessionsPolicyState,
73
- restrictionsState: _RestrictionsState.restrictionsState
75
+ restrictionsState: _RestrictionsState.restrictionsState,
76
+ provisioningState: _Provisioning.provisioningState
74
77
  };
75
78
  exports.reinitializeState = reinitializeState;
76
79
  const initialState = (0, _extends2.default)({
@@ -55,6 +55,8 @@ var _SessionsPolicyState = require("./SessionsPolicyState");
55
55
 
56
56
  var _RestrictionsState = require("./RestrictionsState");
57
57
 
58
+ var _Provisioning = require("./Provisioning");
59
+
58
60
  const {
59
61
  reducer,
60
62
  actions: sliceActions
@@ -67,8 +69,8 @@ const {
67
69
  payload
68
70
  }) => (0, _extends2.default)({}, state, payload),
69
71
  setUser: (0, _utils.typeReducer)('user')
70
- }, _LoginState.loginReducers, _SocialLogins.socialLoginsReducer, _ActivateState.activateAccountReducers, _AcceptInvitationState.acceptInvitationReducers, _ForgotPasswordState.forgotPasswordReducers, _ResetPhoneNumberState.resetPhoneNumberReducers, _SignUp.signUpReducers, _ProfileState.profileReducers, _SSOState.ssoReducers, _MfaState.mfaReducers, _TeamState.teamReducers, _ApiTokensState.apiTokensReducers, _SecurityPolicyState.securityPolicyReducers, _AccountSettingsState.accountSettingsReducers, _TenantsState.tenantsReducers, _RolesState.rolesReducers, _SessionsState.sessionsReducers, _SessionsPolicyState.sessionsPolicyReducers, _RestrictionsState.restrictionsReducers)
72
+ }, _LoginState.loginReducers, _SocialLogins.socialLoginsReducer, _ActivateState.activateAccountReducers, _AcceptInvitationState.acceptInvitationReducers, _ForgotPasswordState.forgotPasswordReducers, _ResetPhoneNumberState.resetPhoneNumberReducers, _SignUp.signUpReducers, _ProfileState.profileReducers, _SSOState.ssoReducers, _MfaState.mfaReducers, _TeamState.teamReducers, _ApiTokensState.apiTokensReducers, _SecurityPolicyState.securityPolicyReducers, _AccountSettingsState.accountSettingsReducers, _TenantsState.tenantsReducers, _RolesState.rolesReducers, _SessionsState.sessionsReducers, _SessionsPolicyState.sessionsPolicyReducers, _RestrictionsState.restrictionsReducers, _Provisioning.provisioningReducers)
71
73
  });
72
74
  exports.reducer = reducer;
73
- const actions = (0, _extends2.default)({}, sliceActions, _LoginState.loginActions, _SocialLogins.socialLoginsActions, _ActivateState.activateAccountActions, _AcceptInvitationState.acceptInvitationActions, _ForgotPasswordState.forgotPasswordActions, _ResetPhoneNumberState.resetPhoneNumberActions, _SignUp.signUpActions, _ProfileState.profileActions, _SSOState.ssoActions, _MfaState.mfaActions, _TeamState.teamActions, _ApiTokensState.apiTokensActions, _SecurityPolicyState.securityPolicyActions, _AccountSettingsState.accountSettingsActions, _TenantsState.tenantsActions, _RolesState.rolesActions, _SessionsState.sessionsActions, _SessionsPolicyState.sessionsPolicyActions, _RestrictionsState.restrictionsActions);
75
+ const actions = (0, _extends2.default)({}, sliceActions, _LoginState.loginActions, _SocialLogins.socialLoginsActions, _ActivateState.activateAccountActions, _AcceptInvitationState.acceptInvitationActions, _ForgotPasswordState.forgotPasswordActions, _ResetPhoneNumberState.resetPhoneNumberActions, _SignUp.signUpActions, _ProfileState.profileActions, _SSOState.ssoActions, _MfaState.mfaActions, _TeamState.teamActions, _ApiTokensState.apiTokensActions, _SecurityPolicyState.securityPolicyActions, _AccountSettingsState.accountSettingsActions, _TenantsState.tenantsActions, _RolesState.rolesActions, _SessionsState.sessionsActions, _SessionsPolicyState.sessionsPolicyActions, _RestrictionsState.restrictionsActions, _Provisioning.provisioningActions);
74
76
  exports.actions = actions;
package/node/auth/saga.js CHANGED
@@ -48,8 +48,10 @@ var _saga19 = require("./SessionsPolicyState/saga");
48
48
 
49
49
  var _saga20 = require("./RestrictionsState/saga");
50
50
 
51
+ var _saga21 = require("./Provisioning/saga");
52
+
51
53
  function* sagas() {
52
- yield (0, _effects.all)([(0, _effects.call)(_saga8.loginSagas), (0, _effects.call)(_saga6.activateSagas), (0, _effects.call)(_saga7.acceptInvitationSagas), (0, _effects.call)(_saga5.forgotPasswordSagas), (0, _effects.call)(_saga17.resetPhoneNumberSagas), (0, _effects.call)(_saga.ssoSagas), (0, _effects.call)(_saga2.ssoSagas), (0, _effects.call)(_saga3.profileSagas), (0, _effects.call)(_saga4.mfaSagas), (0, _effects.call)(_saga9.teamSagas), (0, _effects.call)(_saga10.socialLoginsSaga), (0, _effects.call)(_saga11.signUpSaga), (0, _effects.call)(_saga12.apiTokensSaga), (0, _effects.call)(_saga13.securityPolicySagas), (0, _effects.call)(_saga14.accountSettingsSaga), (0, _effects.call)(_saga15.tenantsSagas), (0, _effects.call)(_saga16.rolesSagas), (0, _effects.call)(_saga18.sessionsSaga), (0, _effects.call)(_saga19.sessionsPolicySaga), (0, _effects.call)(_saga20.restrictionsSagas)]);
54
+ yield (0, _effects.all)([(0, _effects.call)(_saga8.loginSagas), (0, _effects.call)(_saga6.activateSagas), (0, _effects.call)(_saga7.acceptInvitationSagas), (0, _effects.call)(_saga5.forgotPasswordSagas), (0, _effects.call)(_saga17.resetPhoneNumberSagas), (0, _effects.call)(_saga.ssoSagas), (0, _effects.call)(_saga2.ssoSagas), (0, _effects.call)(_saga3.profileSagas), (0, _effects.call)(_saga4.mfaSagas), (0, _effects.call)(_saga9.teamSagas), (0, _effects.call)(_saga10.socialLoginsSaga), (0, _effects.call)(_saga11.signUpSaga), (0, _effects.call)(_saga12.apiTokensSaga), (0, _effects.call)(_saga13.securityPolicySagas), (0, _effects.call)(_saga14.accountSettingsSaga), (0, _effects.call)(_saga15.tenantsSagas), (0, _effects.call)(_saga16.rolesSagas), (0, _effects.call)(_saga18.sessionsSaga), (0, _effects.call)(_saga19.sessionsPolicySaga), (0, _effects.call)(_saga20.restrictionsSagas), (0, _effects.call)(_saga21.provisionSagas)]);
53
55
  }
54
56
 
55
57
  function* mockSagas() {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.50.0
1
+ /** @license Frontegg v6.51.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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
- "version": "6.50.0",
3
+ "version": "6.51.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.49",
9
+ "@frontegg/rest-api": "^3.0.51",
10
10
  "@reduxjs/toolkit": "^1.8.5",
11
11
  "redux-saga": "^1.2.1",
12
12
  "uuid": "^8.3.2"
@@ -15,7 +15,7 @@ export interface RootState {
15
15
  urlStrategy: 'hash' | 'path';
16
16
  previewMode?: boolean;
17
17
  }
18
- export declare const createFronteggStore: (rootInitialState: InitialState, storeHolder?: any, previewMode?: boolean, authInitialState?: (Partial<Pick<AuthState, "user" | "error" | "onRedirectTo" | "isAuthenticated" | "userIp" | "isLoading" | "keepSessionAlive" | "isSSOAuth" | "ssoACS" | "loginState" | "activateState" | "acceptInvitationState" | "forgotPasswordState" | "resetPhoneNumberState" | "ssoState" | "profileState" | "mfaState" | "teamState" | "socialLoginState" | "signUpState" | "apiTokensState" | "securityPolicyState" | "restrictionsState" | "accountSettingsState" | "tenantsState" | "rolesState" | "sessionsState" | "hostedLoginBox" | "disableSilentRefresh" | "sessionsPolicyState" | "header" | "loaderComponent">> & {
18
+ export declare const createFronteggStore: (rootInitialState: InitialState, storeHolder?: any, previewMode?: boolean, authInitialState?: (Partial<Pick<AuthState, "user" | "error" | "onRedirectTo" | "isAuthenticated" | "userIp" | "isLoading" | "keepSessionAlive" | "isSSOAuth" | "ssoACS" | "loginState" | "activateState" | "acceptInvitationState" | "forgotPasswordState" | "resetPhoneNumberState" | "ssoState" | "profileState" | "mfaState" | "teamState" | "socialLoginState" | "signUpState" | "apiTokensState" | "securityPolicyState" | "restrictionsState" | "provisioningState" | "accountSettingsState" | "tenantsState" | "rolesState" | "sessionsState" | "hostedLoginBox" | "disableSilentRefresh" | "sessionsPolicyState" | "header" | "loaderComponent">> & {
19
19
  routes?: Partial<AuthPageRoutes> | undefined;
20
20
  }) | undefined, overrideInitialState?: Partial<{
21
21
  auth: Partial<Omit<AuthState, 'routes'>> & {