@frontegg/js 7.100.0-alpha.0 → 7.100.0-alpha.2

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.100.0-alpha.0
1
+ /** @license Frontegg v7.100.0-alpha.2
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.100.0-alpha.0
1
+ /** @license Frontegg v7.100.0-alpha.2
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.100.0-alpha.0'
8
+ cdnVersion: '7.100.0-alpha.2'
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.100.0-alpha.0",
3
+ "version": "7.100.0-alpha.2",
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.100.0-alpha.0"
9
+ "@frontegg/types": "7.100.0-alpha.2"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -1839,7 +1839,7 @@ __webpack_require__.r(__webpack_exports__);
1839
1839
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1840
1840
  /* harmony export */ });
1841
1841
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1842
- cdnVersion: '7.100.0-alpha.0'
1842
+ cdnVersion: '7.100.0-alpha.2'
1843
1843
  });
1844
1844
 
1845
1845
  /***/ }),
@@ -10560,23 +10560,6 @@ const _excluded = ["callback", "profilePictureUrl"];
10560
10560
  const resetProfileState = () => {
10561
10561
  (0,_helpers__WEBPACK_IMPORTED_MODULE_2__.deepResetState)(store, ['auth', 'profileState'], _state__WEBPACK_IMPORTED_MODULE_3__.initialState);
10562
10562
  };
10563
-
10564
- /**
10565
- * Helper function to preserve groups from currentUser if profile doesn't have them
10566
- * The authorization API returns merged roles/permissions but may not include groups array
10567
- * @param profileData - User profile data from API (may or may not have groups)
10568
- * @param currentUser - Current user from store (has groups if they were loaded before)
10569
- * @returns Groups array to use (prefers profile.groups if they exist, otherwise currentUser.groups)
10570
- */
10571
- const preserveGroups = (profileData, currentUser) => {
10572
- if (profileData != null && profileData.groups && profileData.groups.length > 0) {
10573
- return profileData.groups;
10574
- }
10575
- if (currentUser != null && currentUser.groups && currentUser.groups.length > 0) {
10576
- return currentUser.groups;
10577
- }
10578
- return profileData == null ? void 0 : profileData.groups;
10579
- };
10580
10563
  const loadProfile = async () => {
10581
10564
  setProfileState({
10582
10565
  loading: true
@@ -10584,10 +10567,7 @@ const _excluded = ["callback", "profilePictureUrl"];
10584
10567
  try {
10585
10568
  const profile = await (0,_helpers__WEBPACK_IMPORTED_MODULE_2__.retry)(api.auth.getMeAndEntitlements, 3, 2000);
10586
10569
  const currentUser = store.auth.user;
10587
- const preservedGroups = preserveGroups(profile, currentUser);
10588
- const mergedUser = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, currentUser, profile, {
10589
- groups: preservedGroups
10590
- });
10570
+ const mergedUser = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, currentUser, profile);
10591
10571
  actions.setUser(mergedUser);
10592
10572
  setProfileState({
10593
10573
  profile,
@@ -10690,17 +10670,14 @@ const _excluded = ["callback", "profilePictureUrl"];
10690
10670
  await api.users.updateUserProfileV2(newProfileData);
10691
10671
  const currentUser = store.auth.user;
10692
10672
  const completeUserData = await (0,_helpers__WEBPACK_IMPORTED_MODULE_2__.retry)(api.auth.getMeAndEntitlements, 3, 2000);
10693
- const preservedGroups = preserveGroups(completeUserData, currentUser);
10694
- const mergedUser = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, currentUser, completeUserData, {
10695
- groups: preservedGroups
10696
- });
10673
+ const mergedUser = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, currentUser, completeUserData);
10697
10674
  actions.setUser(mergedUser);
10698
10675
  actions.setProfileState({
10699
10676
  profile: completeUserData,
10700
10677
  saving: false,
10701
10678
  loading: false
10702
10679
  });
10703
- callback == null ? void 0 : callback(newProfileData);
10680
+ callback == null ? void 0 : callback(completeUserData);
10704
10681
  } catch (e) {
10705
10682
  setProfileState({
10706
10683
  saving: false,
@@ -19834,7 +19811,7 @@ __webpack_require__.r(__webpack_exports__);
19834
19811
  /* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
19835
19812
  /* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
19836
19813
  /* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
19837
- /** @license Frontegg v7.100.0-alpha.0
19814
+ /** @license Frontegg v7.100.0-alpha.2
19838
19815
  *
19839
19816
  * This source code is licensed under the MIT license found in the
19840
19817
  * LICENSE file in the root directory of this source tree.
@@ -30161,7 +30138,7 @@ __webpack_require__.r(__webpack_exports__);
30161
30138
  /* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
30162
30139
  /* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
30163
30140
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
30164
- /** @license Frontegg v7.100.0-alpha.0
30141
+ /** @license Frontegg v7.100.0-alpha.2
30165
30142
  *
30166
30143
  * This source code is licensed under the MIT license found in the
30167
30144
  * LICENSE file in the root directory of this source tree.
@@ -32956,7 +32933,7 @@ __webpack_require__.r(__webpack_exports__);
32956
32933
  /* harmony export */ });
32957
32934
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
32958
32935
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
32959
- /** @license Frontegg v7.100.0-alpha.0
32936
+ /** @license Frontegg v7.100.0-alpha.2
32960
32937
  *
32961
32938
  * This source code is licensed under the MIT license found in the
32962
32939
  * LICENSE file in the root directory of this source tree.