@frontegg/js 7.124.0 → 7.125.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.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.124.0
1
+ /** @license Frontegg v7.125.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/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.124.0
1
+ /** @license Frontegg v7.125.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/node/version.js CHANGED
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _default = {
8
- cdnVersion: '7.124.0'
8
+ cdnVersion: '7.125.0'
9
9
  };
10
10
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@frontegg/js",
3
- "version": "7.124.0",
3
+ "version": "7.125.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/types": "7.124.0"
9
+ "@frontegg/types": "7.125.0"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -1927,7 +1927,7 @@ __webpack_require__.r(__webpack_exports__);
1927
1927
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1928
1928
  /* harmony export */ });
1929
1929
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1930
- cdnVersion: '7.124.0'
1930
+ cdnVersion: '7.125.0'
1931
1931
  });
1932
1932
 
1933
1933
  /***/ }),
@@ -4437,7 +4437,8 @@ const _excluded = ["callback"];
4437
4437
  const sendPasswordRecoveryEmail = async () => {
4438
4438
  const {
4439
4439
  identifier,
4440
- identifierType
4440
+ identifierType,
4441
+ recaptchaToken
4441
4442
  } = store.auth.forgotPasswordState;
4442
4443
  setForgotPasswordState({
4443
4444
  loading: true
@@ -4445,7 +4446,8 @@ const _excluded = ["callback"];
4445
4446
  try {
4446
4447
  await api.auth.resetPasswordViaEmail({
4447
4448
  identifier,
4448
- identifierType
4449
+ identifierType,
4450
+ recaptchaToken
4449
4451
  });
4450
4452
  setForgotPasswordState({
4451
4453
  loading: false,
@@ -4526,7 +4528,8 @@ const _excluded = ["callback"];
4526
4528
  loading: true,
4527
4529
  error: undefined,
4528
4530
  identifier: payload.identifier,
4529
- identifierType: payload.identifierType
4531
+ identifierType: payload.identifierType,
4532
+ recaptchaToken: payload.recaptchaToken
4530
4533
  });
4531
4534
  try {
4532
4535
  const strategies = await api.auth.getPasswordRecoveryStrategies();
@@ -14350,6 +14353,7 @@ const _excluded = ["callback"],
14350
14353
 
14351
14354
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((store, api, sharedActions) => {
14352
14355
  const actions = sharedActions;
14356
+ let pendingRoleAssignmentPolicyRequest = null;
14353
14357
 
14354
14358
  /**
14355
14359
  * @protected
@@ -14443,6 +14447,9 @@ const _excluded = ["callback"],
14443
14447
  const setSecurityPolicyAuthStrategyPublicState = state => {
14444
14448
  Object.assign(store.auth.securityPolicyState.publicAuthStrategyPolicy, state);
14445
14449
  };
14450
+ const setRoleAssignmentPolicyState = state => {
14451
+ Object.assign(store.auth.securityPolicyState.roleAssignmentPolicy, state);
14452
+ };
14446
14453
  const resetSecurityPolicyState = () => {
14447
14454
  (0,_helpers__WEBPACK_IMPORTED_MODULE_2__.deepResetState)(store, ['auth', 'securityPolicyState'], _state__WEBPACK_IMPORTED_MODULE_3__.initialState);
14448
14455
  };
@@ -14495,6 +14502,34 @@ const _excluded = ["callback"],
14495
14502
  });
14496
14503
  }
14497
14504
  };
14505
+ const loadRoleAssignmentPolicy = async payload => {
14506
+ // Several role pickers can mount at once, all before the first response lands.
14507
+ // Share the in-flight request so they do not each trigger their own call.
14508
+ if (pendingRoleAssignmentPolicyRequest) {
14509
+ return pendingRoleAssignmentPolicyRequest;
14510
+ }
14511
+ setRoleAssignmentPolicyState({
14512
+ loading: true,
14513
+ error: null
14514
+ });
14515
+ pendingRoleAssignmentPolicyRequest = (async () => {
14516
+ try {
14517
+ const policy = await (0,_helpers__WEBPACK_IMPORTED_MODULE_2__.retryIfNeeded)(() => api.auth.getRoleAssignmentPolicy(), payload == null ? void 0 : payload.retryConfig);
14518
+ setRoleAssignmentPolicyState({
14519
+ policy,
14520
+ loading: false
14521
+ });
14522
+ } catch (e) {
14523
+ setRoleAssignmentPolicyState({
14524
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.errorHandler)(e),
14525
+ loading: false
14526
+ });
14527
+ } finally {
14528
+ pendingRoleAssignmentPolicyRequest = null;
14529
+ }
14530
+ })();
14531
+ return pendingRoleAssignmentPolicyRequest;
14532
+ };
14498
14533
  const loadVendorPasswordConfig = async payload => {
14499
14534
  setSecurityPolicyPasswordState({
14500
14535
  loading: true,
@@ -14809,10 +14844,12 @@ const _excluded = ["callback"],
14809
14844
  resetSecurityPolicyState,
14810
14845
  setSecurityPolicyPasswordState,
14811
14846
  setSecurityPolicyAuthStrategyPublicState,
14847
+ setRoleAssignmentPolicyState,
14812
14848
  // actions
14813
14849
  loadSecurityPolicy,
14814
14850
  loadGlobalSecurityPolicy,
14815
14851
  loadPublicSecurityPolicy,
14852
+ loadRoleAssignmentPolicy,
14816
14853
  loadVendorPasswordConfig,
14817
14854
  loadSecurityPolicyMfa,
14818
14855
  loadSecurityPolicyVendorMfa,
@@ -14894,6 +14931,9 @@ const initialState = {
14894
14931
  publicPolicy: {
14895
14932
  loading: false
14896
14933
  },
14934
+ roleAssignmentPolicy: {
14935
+ loading: false
14936
+ },
14897
14937
  vendorMfaPolicy: {
14898
14938
  loading: true
14899
14939
  },
@@ -21092,7 +21132,7 @@ __webpack_require__.r(__webpack_exports__);
21092
21132
  /* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
21093
21133
  /* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
21094
21134
  /* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
21095
- /** @license Frontegg v7.124.0
21135
+ /** @license Frontegg v7.125.0
21096
21136
  *
21097
21137
  * This source code is licensed under the MIT license found in the
21098
21138
  * LICENSE file in the root directory of this source tree.
@@ -23514,7 +23554,7 @@ const _excluded = ["callback"],
23514
23554
 
23515
23555
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((store, api, actions) => {
23516
23556
  const originalActions = (0,_auth_Security_SecurityPolicyState__WEBPACK_IMPORTED_MODULE_2__["default"])(store, api, actions);
23517
- const mockedActions = (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.mockActionsExpect)(originalActions, ['setSecurityPolicyState', 'setSecurityPolicyGlobalState', 'setSecurityPolicyPublicState', 'setSecurityPolicyMfaState', 'setSecurityPolicyVendorMfaState', 'setSecurityPolicyLockoutState', 'setSecurityPolicyVendorLockoutState', 'setSecurityPolicyCaptchaState', 'setSecurityPolicyPasswordHistoryState', 'setSecurityPolicyVendorPasswordHistoryState', 'resetSecurityPolicyState', 'setSecurityPolicyPasswordState', 'setSecurityPolicyAuthStrategyPublicState']);
23557
+ const mockedActions = (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.mockActionsExpect)(originalActions, ['setSecurityPolicyState', 'setSecurityPolicyGlobalState', 'setSecurityPolicyPublicState', 'setSecurityPolicyMfaState', 'setSecurityPolicyVendorMfaState', 'setSecurityPolicyLockoutState', 'setSecurityPolicyVendorLockoutState', 'setSecurityPolicyCaptchaState', 'setSecurityPolicyPasswordHistoryState', 'setSecurityPolicyVendorPasswordHistoryState', 'resetSecurityPolicyState', 'setSecurityPolicyPasswordState', 'setSecurityPolicyAuthStrategyPublicState', 'setRoleAssignmentPolicyState']);
23518
23558
  mockedActions.loadSecurityPolicy = async () => {
23519
23559
  mockedActions.setSecurityPolicyGlobalState({
23520
23560
  loading: true,
@@ -23544,6 +23584,25 @@ const _excluded = ["callback"],
23544
23584
  });
23545
23585
  }
23546
23586
  };
23587
+ mockedActions.loadRoleAssignmentPolicy = async () => {
23588
+ mockedActions.setRoleAssignmentPolicyState({
23589
+ loading: true,
23590
+ error: null
23591
+ });
23592
+ try {
23593
+ mockedActions.setRoleAssignmentPolicyState({
23594
+ policy: {
23595
+ restrictEqualLevelRoleAssignment: false
23596
+ },
23597
+ loading: false
23598
+ });
23599
+ } catch (e) {
23600
+ mockedActions.setRoleAssignmentPolicyState({
23601
+ error: (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.errorHandler)(e),
23602
+ loading: false
23603
+ });
23604
+ }
23605
+ };
23547
23606
  mockedActions.saveSecurityPolicyMfa = async payload => {
23548
23607
  var _newSecurityPolicy$id;
23549
23608
  const {
@@ -24720,6 +24779,7 @@ const publicSecurityPolicy = {
24720
24779
  allowNotVerifiedUsersLogin: false,
24721
24780
  apiTokensEnabled: true,
24722
24781
  forcePermissions: false,
24782
+ restrictEqualLevelRoleAssignment: false,
24723
24783
  authStrategy: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_1__.AuthStrategyEnum.EmailAndPassword,
24724
24784
  machineToMachineAuthStrategy: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_1__.MachineToMachineAuthStrategy.ClientCredentials
24725
24785
  };
@@ -30083,6 +30143,9 @@ class AuthenticationApi extends _BaseApiClient__WEBPACK_IMPORTED_MODULE_6__.Base
30083
30143
  this.getVendorConfig = async () => {
30084
30144
  return this.get(`${_constants__WEBPACK_IMPORTED_MODULE_11__.urls.identity.configurations.v1}/public`);
30085
30145
  };
30146
+ this.getRoleAssignmentPolicy = async () => {
30147
+ return this.get(`${_constants__WEBPACK_IMPORTED_MODULE_11__.urls.identity.configurations.v1}/role-assignment-policy`);
30148
+ };
30086
30149
  this.signUp = async (signUpUrl, body) => {
30087
30150
  const {
30088
30151
  shouldActivate,
@@ -31788,7 +31851,7 @@ __webpack_require__.r(__webpack_exports__);
31788
31851
  /* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
31789
31852
  /* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
31790
31853
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
31791
- /** @license Frontegg v7.124.0
31854
+ /** @license Frontegg v7.125.0
31792
31855
  *
31793
31856
  * This source code is licensed under the MIT license found in the
31794
31857
  * LICENSE file in the root directory of this source tree.
@@ -34630,7 +34693,7 @@ __webpack_require__.r(__webpack_exports__);
34630
34693
  /* harmony export */ });
34631
34694
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
34632
34695
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
34633
- /** @license Frontegg v7.124.0
34696
+ /** @license Frontegg v7.125.0
34634
34697
  *
34635
34698
  * This source code is licensed under the MIT license found in the
34636
34699
  * LICENSE file in the root directory of this source tree.