@frontegg/js 7.93.0 → 7.94.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.93.0
1
+ /** @license Frontegg v7.94.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.93.0
1
+ /** @license Frontegg v7.94.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.93.0'
8
+ cdnVersion: '7.94.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.93.0",
3
+ "version": "7.94.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.93.0"
9
+ "@frontegg/types": "7.94.0"
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.93.0'
1842
+ cdnVersion: '7.94.0'
1843
1843
  });
1844
1844
 
1845
1845
  /***/ }),
@@ -16019,32 +16019,45 @@ const _excluded = ["callback", "appIds"],
16019
16019
  const {
16020
16020
  shouldLoadRoles = true,
16021
16021
  shouldLoadApps,
16022
+ shouldLoadEmails = false,
16022
16023
  retryConfig
16023
16024
  } = options;
16024
16025
 
16025
- // Get user IDs for fetching roles and groups
16026
+ // Get user IDs for fetching roles and groups and emails
16026
16027
  const userIds = users.map(user => user.id);
16027
16028
 
16028
- // Fetch roles, permissions, user roles, user groups, and all groups in parallel
16029
+ // Fetch roles, permissions, user roles, user groups, user emails, and all groups in parallel
16029
16030
  const [{
16030
16031
  items: userUsernames
16032
+ }, {
16033
+ items: userPhoneNumbers
16031
16034
  }, {
16032
16035
  items: roles
16033
- }, permissions, userRoles, userGroups, groups] = await Promise.all([userIds.length > 0 ? api.users.getUsersUsernames({
16036
+ }, permissions, userRoles, userGroups, {
16037
+ items: userEmails
16038
+ }, groups] = await Promise.all([userIds.length > 0 ? api.users.getUsersUsernames({
16034
16039
  userIds
16035
16040
  }) : {
16036
16041
  items: []
16042
+ }, userIds.length > 0 ? api.userPhoneNumbers.getUsersPhoneNumberV2({
16043
+ userIds: userIds.join(',')
16044
+ }) : {
16045
+ items: []
16037
16046
  }, api.teams.loadAvailableRoles(), api.teams.loadAvailablePermissions(), userIds.length > 0 ? api.users.getUsersRoles({
16038
16047
  ids: userIds
16039
16048
  }) : [], userIds.length > 0 ? api.users.getUsersGroups({
16040
16049
  ids: userIds
16041
- }) : [], __getGroupsForUsers(retryConfig), shouldLoadRoles ? loadRoles({
16050
+ }) : [], shouldLoadEmails && userIds.length > 0 ? api.usersEmails.getUsersEmailsV1({
16051
+ userIds: userIds.join(',')
16052
+ }) : {
16053
+ items: []
16054
+ }, __getGroupsForUsers(retryConfig), shouldLoadRoles ? loadRoles({
16042
16055
  retryConfig
16043
16056
  }) : undefined]);
16044
16057
 
16045
16058
  // Map user roles and groups to users
16046
16059
  const usersWithRolesAndGroups = users.map(user => {
16047
- var _userUsernames$find;
16060
+ var _userUsernames$find, _userPhoneNumbers$fin, _userEmailsForUser$fi;
16048
16061
  // Find user's role IDs
16049
16062
  const userRoleData = userRoles.find(ur => ur.userId === user.id);
16050
16063
  const userRoleIds = (userRoleData == null ? void 0 : userRoleData.roleIds) || [];
@@ -16057,12 +16070,28 @@ const _excluded = ["callback", "appIds"],
16057
16070
 
16058
16071
  // Find user's username
16059
16072
  const userUsername = userUsernames == null ? void 0 : (_userUsernames$find = userUsernames.find(username => username.userId === user.id)) == null ? void 0 : _userUsernames$find.username;
16073
+ // Find user's phone number
16074
+ const userPhoneNumber = userPhoneNumbers == null ? void 0 : (_userPhoneNumbers$fin = userPhoneNumbers.find(phone => phone.userId === user.id)) == null ? void 0 : _userPhoneNumbers$fin.phoneNumber;
16075
+ // Find user's emails - get all emails for the user and identify primary
16076
+ const userEmailsForUser = (userEmails == null ? void 0 : userEmails.filter(email => email.userId === user.id)) || [];
16077
+ const primaryEmail = (_userEmailsForUser$fi = userEmailsForUser.find(email => email.isPrimary)) == null ? void 0 : _userEmailsForUser$fi.email;
16078
+ const allEmails = userEmailsForUser.map(email => ({
16079
+ email: email.email,
16080
+ isPrimary: email.isPrimary
16081
+ }));
16060
16082
  if (!user.name) {
16061
16083
  user.name = userUsername;
16062
16084
  }
16063
16085
 
16064
16086
  //@ts-ignore
16065
16087
  return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, user, {
16088
+ username: userUsername,
16089
+ phoneNumber: userPhoneNumber
16090
+ }, shouldLoadEmails && primaryEmail ? {
16091
+ email: primaryEmail
16092
+ } : {}, shouldLoadEmails && allEmails.length > 0 ? {
16093
+ emails: allEmails
16094
+ } : {}, {
16066
16095
  roles: userRolesFull,
16067
16096
  roleIds: userRoleIds,
16068
16097
  groups: userGroupsFull,
@@ -16134,6 +16163,7 @@ const _excluded = ["callback", "appIds"],
16134
16163
  const {
16135
16164
  silentLoading,
16136
16165
  callback,
16166
+ shouldLoadEmails = false,
16137
16167
  retryConfig
16138
16168
  } = payload;
16139
16169
  const teamState = store.auth.teamState;
@@ -16183,6 +16213,7 @@ const _excluded = ["callback", "appIds"],
16183
16213
  } = await __enrichUsersWithRolesGroupsAndPermissions(users, {
16184
16214
  shouldLoadRoles,
16185
16215
  shouldLoadApps,
16216
+ shouldLoadEmails,
16186
16217
  retryConfig
16187
16218
  });
16188
16219
  __setUsersStateAndCallback(enrichedUsers, roles, permissions, response._metadata.totalPages, response._metadata.totalItems, callback);
@@ -16382,6 +16413,7 @@ const _excluded = ["callback", "appIds"],
16382
16413
  callback,
16383
16414
  shouldLoadRoles = true,
16384
16415
  shouldLoadApps,
16416
+ shouldLoadEmails = false,
16385
16417
  retryConfig
16386
16418
  } = payload;
16387
16419
  const teamState = store.auth.teamState;
@@ -16423,6 +16455,7 @@ const _excluded = ["callback", "appIds"],
16423
16455
  } = await __enrichUsersWithRolesGroupsAndPermissions(users, {
16424
16456
  shouldLoadRoles,
16425
16457
  shouldLoadApps,
16458
+ shouldLoadEmails,
16426
16459
  retryConfig
16427
16460
  });
16428
16461
  __setUsersStateAndCallback(enrichedUsers, roles, permissions, totalPages, totalItems, callback);
@@ -16814,7 +16847,8 @@ const _excluded = ["callback", "appIds"],
16814
16847
  const {
16815
16848
  _phoneNumber,
16816
16849
  shouldLoadRoles = true,
16817
- shouldLoadApps
16850
+ shouldLoadApps,
16851
+ shouldLoadEmails = false
16818
16852
  } = payload;
16819
16853
  return __loadUsersBySearchCriteria(payload, (pageOffset, pageSize) => api.userPhoneNumbers.getUsersPhoneNumberV2({
16820
16854
  _phoneNumber,
@@ -16826,7 +16860,8 @@ const _excluded = ["callback", "appIds"],
16826
16860
  const {
16827
16861
  _usernamePrefix,
16828
16862
  shouldLoadRoles = true,
16829
- shouldLoadApps
16863
+ shouldLoadApps,
16864
+ shouldLoadEmails = false
16830
16865
  } = payload;
16831
16866
  return __loadUsersBySearchCriteria(payload, (pageOffset, pageSize) => api.usernames.getUsernamesV1({
16832
16867
  _usernamePrefix,
@@ -16838,7 +16873,8 @@ const _excluded = ["callback", "appIds"],
16838
16873
  const {
16839
16874
  _email,
16840
16875
  shouldLoadRoles = true,
16841
- shouldLoadApps
16876
+ shouldLoadApps,
16877
+ shouldLoadEmails = false
16842
16878
  } = payload;
16843
16879
  return __loadUsersBySearchCriteria(payload, (pageOffset, pageSize) => api.usersEmails.getUsersEmailsV1({
16844
16880
  _email,
@@ -19746,7 +19782,7 @@ __webpack_require__.r(__webpack_exports__);
19746
19782
  /* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
19747
19783
  /* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
19748
19784
  /* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
19749
- /** @license Frontegg v7.93.0
19785
+ /** @license Frontegg v7.94.0
19750
19786
  *
19751
19787
  * This source code is licensed under the MIT license found in the
19752
19788
  * LICENSE file in the root directory of this source tree.
@@ -30071,7 +30107,7 @@ __webpack_require__.r(__webpack_exports__);
30071
30107
  /* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
30072
30108
  /* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
30073
30109
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
30074
- /** @license Frontegg v7.93.0
30110
+ /** @license Frontegg v7.94.0
30075
30111
  *
30076
30112
  * This source code is licensed under the MIT license found in the
30077
30113
  * LICENSE file in the root directory of this source tree.
@@ -32736,13 +32772,15 @@ let AccountPageFields;
32736
32772
  })(AccountPageFields || (AccountPageFields = {}));
32737
32773
  let UsersTableColumns;
32738
32774
  (function (UsersTableColumns) {
32739
- UsersTableColumns["User"] = "user";
32740
- UsersTableColumns["Applications"] = "applications";
32775
+ UsersTableColumns["FullName"] = "fullName";
32776
+ UsersTableColumns["Email"] = "email";
32741
32777
  UsersTableColumns["Groups"] = "groups";
32742
32778
  UsersTableColumns["Roles"] = "roles";
32743
- UsersTableColumns["JoinedAt"] = "joinedAt";
32779
+ UsersTableColumns["Status"] = "status";
32744
32780
  UsersTableColumns["LastSeen"] = "lastSeen";
32745
32781
  UsersTableColumns["ManagedBy"] = "managedBy";
32782
+ UsersTableColumns["Username"] = "username";
32783
+ UsersTableColumns["PhoneNumber"] = "phoneNumber";
32746
32784
  })(UsersTableColumns || (UsersTableColumns = {}));
32747
32785
  let SubscriptionsPageFields;
32748
32786
  (function (SubscriptionsPageFields) {
@@ -32806,6 +32844,7 @@ __webpack_require__.r(__webpack_exports__);
32806
32844
  /* harmony export */ SignupFields: () => (/* reexport safe */ _LoginBoxTheme__WEBPACK_IMPORTED_MODULE_0__.SignupFields),
32807
32845
  /* harmony export */ SubscriptionsPageFields: () => (/* reexport safe */ _fieldsAppearanceConsts__WEBPACK_IMPORTED_MODULE_1__.SubscriptionsPageFields),
32808
32846
  /* harmony export */ UsersTableColumns: () => (/* reexport safe */ _fieldsAppearanceConsts__WEBPACK_IMPORTED_MODULE_1__.UsersTableColumns),
32847
+ /* harmony export */ columnVisibility: () => (/* binding */ columnVisibility),
32809
32848
  /* harmony export */ fieldAppearance: () => (/* binding */ fieldAppearance),
32810
32849
  /* harmony export */ tabAppearance: () => (/* binding */ tabAppearance)
32811
32850
  /* harmony export */ });
@@ -32825,6 +32864,10 @@ const tabAppearance = {
32825
32864
  hidden: 'hidden',
32826
32865
  edit: 'edit'
32827
32866
  };
32867
+ const columnVisibility = {
32868
+ hidden: 'hidden',
32869
+ always: 'always'
32870
+ };
32828
32871
 
32829
32872
  /***/ }),
32830
32873
 
@@ -32853,12 +32896,13 @@ __webpack_require__.r(__webpack_exports__);
32853
32896
  /* harmony export */ SubscriptionsPageFields: () => (/* reexport safe */ _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__.SubscriptionsPageFields),
32854
32897
  /* harmony export */ UsersTableColumns: () => (/* reexport safe */ _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__.UsersTableColumns),
32855
32898
  /* harmony export */ alpha: () => (/* reexport safe */ _Metadata__WEBPACK_IMPORTED_MODULE_1__.alpha),
32899
+ /* harmony export */ columnVisibility: () => (/* reexport safe */ _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__.columnVisibility),
32856
32900
  /* harmony export */ fieldAppearance: () => (/* reexport safe */ _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__.fieldAppearance),
32857
32901
  /* harmony export */ tabAppearance: () => (/* reexport safe */ _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__.tabAppearance)
32858
32902
  /* harmony export */ });
32859
32903
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
32860
32904
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
32861
- /** @license Frontegg v7.93.0
32905
+ /** @license Frontegg v7.94.0
32862
32906
  *
32863
32907
  * This source code is licensed under the MIT license found in the
32864
32908
  * LICENSE file in the root directory of this source tree.