@frontegg/js 7.56.0-alpha.0 → 7.57.0-alpha.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.56.0-alpha.0
1
+ /** @license Frontegg v7.57.0-alpha.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.56.0-alpha.0
1
+ /** @license Frontegg v7.57.0-alpha.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.56.0-alpha.0'
8
+ cdnVersion: '7.57.0-alpha.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.56.0-alpha.0",
3
+ "version": "7.57.0-alpha.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.56.0-alpha.0"
9
+ "@frontegg/types": "7.57.0-alpha.0"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -1628,7 +1628,7 @@ __webpack_require__.r(__webpack_exports__);
1628
1628
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1629
1629
  /* harmony export */ });
1630
1630
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1631
- cdnVersion: '7.56.0-alpha.0'
1631
+ cdnVersion: '7.57.0-alpha.0'
1632
1632
  });
1633
1633
 
1634
1634
  /***/ }),
@@ -12484,8 +12484,8 @@ __webpack_require__.r(__webpack_exports__);
12484
12484
  /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "../../node_modules/@babel/runtime/helpers/esm/extends.js");
12485
12485
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/common.js");
12486
12486
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/handlers.js");
12487
+ /* harmony import */ var _helpers_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/helpers */ "../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/helpers/helpers.js");
12487
12488
  /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./state */ "../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/state.js");
12488
- /* harmony import */ var _helpers_timeConvertors__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/timeConvertors */ "../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/helpers/timeConvertors.js");
12489
12489
 
12490
12490
 
12491
12491
  const _excluded = ["callback"],
@@ -12796,15 +12796,22 @@ const _excluded = ["callback"],
12796
12796
  error: null
12797
12797
  });
12798
12798
  try {
12799
- const policy = await api.securityPolicy.getPasswordRotationPolicy();
12800
- const vendorPolicy = await api.securityPolicy.getVendorPasswordRotationPolicy();
12801
- policy.notificationPeriod = (0,_helpers_timeConvertors__WEBPACK_IMPORTED_MODULE_5__.minutesToDays)(policy.notificationPeriod);
12802
- const vendorPolicyInDays = (0,_helpers_timeConvertors__WEBPACK_IMPORTED_MODULE_5__.minutesToDays)(vendorPolicy.rotationPeriod);
12803
- const policyInDays = (0,_helpers_timeConvertors__WEBPACK_IMPORTED_MODULE_5__.minutesToDays)(policy.rotationPeriod);
12804
- policy.rotationPeriod = Math.min(vendorPolicyInDays, policyInDays);
12805
- policy.vendorRotationPeriod = vendorPolicyInDays;
12799
+ const tenantPasswordRotationConfig = await api.securityPolicy.getPasswordRotationPolicy();
12800
+ const vendorPasswordRotationConfig = await api.securityPolicy.getVendorPasswordRotationPolicy();
12801
+ const data = {
12802
+ passwordRotationVendorConfig: vendorPasswordRotationConfig
12803
+ };
12804
+ if (tenantPasswordRotationConfig) {
12805
+ if (vendorPasswordRotationConfig != null && vendorPasswordRotationConfig.isActive) {
12806
+ data.passwordRotationTenantConfig = tenantPasswordRotationConfig != null && tenantPasswordRotationConfig.isActive ? (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, tenantPasswordRotationConfig, {
12807
+ rotationPeriod: (0,_helpers_helpers__WEBPACK_IMPORTED_MODULE_5__.getTenantRotationPeriod)(vendorPasswordRotationConfig.rotationPeriod, tenantPasswordRotationConfig.rotationPeriod)
12808
+ }) : vendorPasswordRotationConfig;
12809
+ } else {
12810
+ data.passwordRotationTenantConfig = tenantPasswordRotationConfig;
12811
+ }
12812
+ }
12806
12813
  setSecurityPolicyPasswordRotationState({
12807
- policy,
12814
+ policy: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, data),
12808
12815
  loading: false
12809
12816
  });
12810
12817
  } catch (e) {
@@ -12919,15 +12926,12 @@ const _excluded = ["callback"],
12919
12926
  error: null
12920
12927
  });
12921
12928
  try {
12922
- const policy = await api.securityPolicy.savePasswordRotationPolicy((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, newSecurityPolicy, {
12923
- notificationPeriod: (0,_helpers_timeConvertors__WEBPACK_IMPORTED_MODULE_5__.daysToMinutes)(newSecurityPolicy.notificationPeriod),
12924
- rotationPeriod: (0,_helpers_timeConvertors__WEBPACK_IMPORTED_MODULE_5__.daysToMinutes)(newSecurityPolicy.rotationPeriod)
12925
- }));
12929
+ await api.securityPolicy.savePasswordRotationPolicy(newSecurityPolicy.passwordRotationTenantConfig || {});
12926
12930
  setSecurityPolicyPasswordRotationState({
12927
12931
  policy: newSecurityPolicy,
12928
12932
  saving: false
12929
12933
  });
12930
- callback == null ? void 0 : callback(policy);
12934
+ callback == null ? void 0 : callback(newSecurityPolicy);
12931
12935
  } catch (e) {
12932
12936
  setSecurityPolicyPasswordRotationState({
12933
12937
  saving: false,
@@ -12977,41 +12981,42 @@ const _excluded = ["callback"],
12977
12981
 
12978
12982
  /***/ }),
12979
12983
 
12980
- /***/ "../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/consts.js":
12981
- /*!************************************************************************************!*\
12982
- !*** ../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/consts.js ***!
12983
- \************************************************************************************/
12984
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
12985
-
12986
- "use strict";
12987
- __webpack_require__.r(__webpack_exports__);
12988
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12989
- /* harmony export */ oneDayInMinutes: () => (/* binding */ oneDayInMinutes)
12990
- /* harmony export */ });
12991
- const oneDayInMinutes = 24 * 60;
12992
-
12993
- /***/ }),
12994
-
12995
- /***/ "../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/helpers/timeConvertors.js":
12996
- /*!****************************************************************************************************!*\
12997
- !*** ../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/helpers/timeConvertors.js ***!
12998
- \****************************************************************************************************/
12984
+ /***/ "../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/helpers/helpers.js":
12985
+ /*!*********************************************************************************************!*\
12986
+ !*** ../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/helpers/helpers.js ***!
12987
+ \*********************************************************************************************/
12999
12988
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
13000
12989
 
13001
12990
  "use strict";
13002
12991
  __webpack_require__.r(__webpack_exports__);
13003
12992
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13004
- /* harmony export */ daysToMinutes: () => (/* binding */ daysToMinutes),
13005
- /* harmony export */ minutesToDays: () => (/* binding */ minutesToDays)
12993
+ /* harmony export */ getTenantRotationPeriod: () => (/* binding */ getTenantRotationPeriod)
13006
12994
  /* harmony export */ });
13007
- /* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../consts */ "../../dist/@frontegg/redux-store/auth/Security/SecurityPolicyState/consts.js");
13008
-
13009
- const minutesToDays = minutes => {
13010
- return Math.floor(minutes / _consts__WEBPACK_IMPORTED_MODULE_0__.oneDayInMinutes);
13011
- };
13012
- const daysToMinutes = days => {
13013
- return days * _consts__WEBPACK_IMPORTED_MODULE_0__.oneDayInMinutes;
13014
- };
12995
+ /**
12996
+ * Calculates the tenant rotation period.
12997
+ *
12998
+ * Returns the minimum of vendor and tenant rotation periods if both are provided.
12999
+ * If only one is provided, returns that one. Returns undefined if neither is provided.
13000
+ * This calculation is made to get the stricter of the two rotation periods.
13001
+ *
13002
+ * @param vendorRotationPeriod - Vendor's rotation period (optional).
13003
+ * @param tenantRotationPeriod - Tenant's rotation period (optional).
13004
+ * @returns The rotation period, or undefined if neither is provided.
13005
+ */
13006
+ function getTenantRotationPeriod(vendorRotationPeriod, tenantRotationPeriod) {
13007
+ const tenantRotationExists = tenantRotationPeriod !== null && tenantRotationPeriod !== undefined;
13008
+ const vendorRotationExists = vendorRotationPeriod !== null && vendorRotationPeriod !== undefined;
13009
+ if (!tenantRotationExists && !vendorRotationExists) {
13010
+ return;
13011
+ }
13012
+ if (!tenantRotationExists) {
13013
+ return vendorRotationPeriod;
13014
+ }
13015
+ if (!vendorRotationExists) {
13016
+ return tenantRotationPeriod;
13017
+ }
13018
+ return Math.min(vendorRotationPeriod, tenantRotationPeriod);
13019
+ }
13015
13020
 
13016
13021
  /***/ }),
13017
13022
 
@@ -18181,7 +18186,7 @@ __webpack_require__.r(__webpack_exports__);
18181
18186
  /* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
18182
18187
  /* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
18183
18188
  /* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
18184
- /** @license Frontegg v7.56.0-alpha.0
18189
+ /** @license Frontegg v7.57.0-alpha.0
18185
18190
  *
18186
18191
  * This source code is licensed under the MIT license found in the
18187
18192
  * LICENSE file in the root directory of this source tree.
@@ -27133,8 +27138,8 @@ __webpack_require__.r(__webpack_exports__);
27133
27138
  /* harmony export */ SecurityPolicyApi: () => (/* binding */ SecurityPolicyApi),
27134
27139
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
27135
27140
  /* harmony export */ });
27136
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../constants */ "../../dist/@frontegg/rest-api/constants.js");
27137
27141
  /* harmony import */ var _BaseApiClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../BaseApiClient */ "../../dist/@frontegg/rest-api/BaseApiClient.js");
27142
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../constants */ "../../dist/@frontegg/rest-api/constants.js");
27138
27143
 
27139
27144
 
27140
27145
  class SecurityPolicyApi extends _BaseApiClient__WEBPACK_IMPORTED_MODULE_0__.BaseApiClient {
@@ -28260,7 +28265,7 @@ __webpack_require__.r(__webpack_exports__);
28260
28265
  /* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
28261
28266
  /* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
28262
28267
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
28263
- /** @license Frontegg v7.56.0-alpha.0
28268
+ /** @license Frontegg v7.57.0-alpha.0
28264
28269
  *
28265
28270
  * This source code is licensed under the MIT license found in the
28266
28271
  * LICENSE file in the root directory of this source tree.
@@ -30890,7 +30895,7 @@ __webpack_require__.r(__webpack_exports__);
30890
30895
  /* harmony export */ });
30891
30896
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
30892
30897
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
30893
- /** @license Frontegg v7.56.0-alpha.0
30898
+ /** @license Frontegg v7.57.0-alpha.0
30894
30899
  *
30895
30900
  * This source code is licensed under the MIT license found in the
30896
30901
  * LICENSE file in the root directory of this source tree.