@frontegg/js 6.191.0-alpha.0 → 6.191.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.
@@ -1,5 +1,5 @@
1
1
  import { EnhancedStore, EntitledToOptions, Entitlement, StepUpOptions, IsSteppedUpOptions } from '@frontegg/redux-store';
2
- import { FronteggAppOptions, FronteggCheckoutDialogOptions, LocalizationsOverrides, LoadEntitlementsCallback, ShowAdminPortalOptions } from '@frontegg/types';
2
+ import { FronteggAppOptions, FronteggCheckoutDialogOptions, LocalizationsOverrides, LoadEntitlementsCallback, ShowAdminPortalOptions, SwitchTenantOptions } from '@frontegg/types';
3
3
  import { IFeatureFlagsAttributes } from '@frontegg/rest-api';
4
4
  import { CustomAttributes } from '@frontegg/entitlements-javascript-commons';
5
5
  declare type FronteggAppContainers = {
@@ -123,6 +123,12 @@ export declare class FronteggApp {
123
123
  * @return true when user is stepped up, false otherwise
124
124
  */
125
125
  isSteppedUp(options?: IsSteppedUpOptions): boolean;
126
+ /**
127
+ * Switch tenant
128
+ * @param payload.tenantId tenant id to switch for
129
+ * @param payload.callback optional callback to be called with true / false for success / failure tenant switching operation
130
+ */
131
+ switchTenant(payload: SwitchTenantOptions): void;
126
132
  close(): void;
127
133
  }
128
134
  export {};
@@ -600,6 +600,20 @@ export var FronteggApp = /*#__PURE__*/function () {
600
600
  user = _ref6.user;
601
601
  return _isSteppedUp(user, options);
602
602
  }
603
+
604
+ /**
605
+ * Switch tenant
606
+ * @param payload.tenantId tenant id to switch for
607
+ * @param payload.callback optional callback to be called with true / false for success / failure tenant switching operation
608
+ */
609
+ }, {
610
+ key: "switchTenant",
611
+ value: function switchTenant(payload) {
612
+ this.store.dispatch({
613
+ type: 'auth/switchTenant',
614
+ payload: payload
615
+ });
616
+ }
603
617
  }, {
604
618
  key: "close",
605
619
  value: function close() {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.191.0-alpha.0
1
+ /** @license Frontegg v6.191.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.
@@ -607,6 +607,20 @@ var FronteggApp = /*#__PURE__*/function () {
607
607
  user = _ref6.user;
608
608
  return (0, _reduxStore.isSteppedUp)(user, options);
609
609
  }
610
+
611
+ /**
612
+ * Switch tenant
613
+ * @param payload.tenantId tenant id to switch for
614
+ * @param payload.callback optional callback to be called with true / false for success / failure tenant switching operation
615
+ */
616
+ }, {
617
+ key: "switchTenant",
618
+ value: function switchTenant(payload) {
619
+ this.store.dispatch({
620
+ type: 'auth/switchTenant',
621
+ payload: payload
622
+ });
623
+ }
610
624
  }, {
611
625
  key: "close",
612
626
  value: function close() {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.191.0-alpha.0
1
+ /** @license Frontegg v6.191.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: '6.191.0-alpha.0'
8
+ cdnVersion: '6.191.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": "6.191.0-alpha.0",
3
+ "version": "6.191.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": "6.191.0-alpha.0"
9
+ "@frontegg/types": "6.191.0"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -939,6 +939,20 @@ var FronteggApp = /*#__PURE__*/function () {
939
939
  user = _ref6.user;
940
940
  return (0,_frontegg_redux_store__WEBPACK_IMPORTED_MODULE_19__.isSteppedUp)(user, options);
941
941
  }
942
+
943
+ /**
944
+ * Switch tenant
945
+ * @param payload.tenantId tenant id to switch for
946
+ * @param payload.callback optional callback to be called with true / false for success / failure tenant switching operation
947
+ */
948
+ }, {
949
+ key: "switchTenant",
950
+ value: function switchTenant(payload) {
951
+ this.store.dispatch({
952
+ type: 'auth/switchTenant',
953
+ payload: payload
954
+ });
955
+ }
942
956
  }, {
943
957
  key: "close",
944
958
  value: function close() {
@@ -1483,7 +1497,7 @@ __webpack_require__.r(__webpack_exports__);
1483
1497
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1484
1498
  /* harmony export */ });
1485
1499
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1486
- cdnVersion: '6.191.0-alpha.0'
1500
+ cdnVersion: '6.191.0'
1487
1501
  });
1488
1502
 
1489
1503
  /***/ }),
@@ -4029,9 +4043,9 @@ function* loadMultipleUsersApplications({
4029
4043
  appIds
4030
4044
  });
4031
4045
  return userIds.reduce((acc, userId) => {
4032
- var _usersAppIds$find, _userAppIds$map$filte, _userAppIds$map;
4046
+ var _usersAppIds$find, _userAppIds$map;
4033
4047
  const userAppIds = (_usersAppIds$find = usersAppIds.find(app => app.userId == userId)) == null ? void 0 : _usersAppIds$find.appIds;
4034
- acc[userId] = [...accountApplications.filter(app => app.accessType === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_6__.ApplicationAccessType.FREE_ACCESS), ...((_userAppIds$map$filte = userAppIds == null ? void 0 : (_userAppIds$map = userAppIds.map(appId => accountApplications.find(app => appId === app.id))) == null ? void 0 : _userAppIds$map.filter(app => !!app)) != null ? _userAppIds$map$filte : [])];
4048
+ acc[userId] = [...accountApplications.filter(app => app.accessType === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_6__.ApplicationAccessType.FREE_ACCESS), ...((_userAppIds$map = userAppIds == null ? void 0 : userAppIds.map(appId => accountApplications.find(app => appId === app.id))) != null ? _userAppIds$map : [])];
4035
4049
  return acc;
4036
4050
  }, {});
4037
4051
  } catch (e) {
@@ -25747,7 +25761,7 @@ __webpack_require__.r(__webpack_exports__);
25747
25761
  /* harmony export */ });
25748
25762
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
25749
25763
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
25750
- /** @license Frontegg v6.191.0-alpha.0
25764
+ /** @license Frontegg v6.191.0
25751
25765
  *
25752
25766
  * This source code is licensed under the MIT license found in the
25753
25767
  * LICENSE file in the root directory of this source tree.