@frontegg/js 6.185.0-alpha.2 → 6.185.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,4 @@
1
1
  export declare class AdminPortal {
2
2
  static show(name?: string): void;
3
- static showMultiApp(name?: string): void;
4
3
  static hide(name?: string): void;
5
4
  }
@@ -11,14 +11,6 @@ export var AdminPortal = /*#__PURE__*/function () {
11
11
  var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
12
12
  AppHolder.getInstance(name).showAdminPortal();
13
13
  }
14
- }, {
15
- key: "showMultiApp",
16
- value: function showMultiApp() {
17
- var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
18
- AppHolder.getInstance(name).showAdminPortal({
19
- isMultiApp: true
20
- });
21
- }
22
14
  }, {
23
15
  key: "hide",
24
16
  value: function hide() {
@@ -64,9 +64,7 @@ export declare class FronteggApp {
64
64
  logout(): void;
65
65
  loadScript(component: string): Promise<unknown>;
66
66
  loadLoginBox(): Promise<void>;
67
- showAdminPortal(options?: {
68
- isMultiApp?: boolean;
69
- }): Promise<void>;
67
+ showAdminPortal(): Promise<void>;
70
68
  hideAdminPortal(): void;
71
69
  showCheckoutDialog(opts: FronteggCheckoutDialogOptions): Promise<void>;
72
70
  hideCheckoutDialog(): void;
@@ -1,4 +1,3 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
2
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
3
  import _createClass from "@babel/runtime/helpers/esm/createClass";
@@ -7,7 +6,7 @@ import { createFronteggStore, getPermissionEntitlements as _getPermissionEntitle
7
6
  import { Metadata } from '@frontegg/types';
8
7
  import { formatName, restoreSearchParams } from '../utils';
9
8
  import { AppHolder } from '../AppHolder';
10
- import { fetch as FronteggFetch, ContextHolder, USE_ENTITLEMENTS_V2_ENDPOINT_FF } from '@frontegg/rest-api';
9
+ import { fetch as FronteggFetch, ContextHolder } from '@frontegg/rest-api';
11
10
  import { RequestSource } from '@frontegg/rest-api';
12
11
  import * as FronteggRestApi from '@frontegg/rest-api';
13
12
  import * as FronteggTypes from '@frontegg/types';
@@ -160,13 +159,9 @@ export var FronteggApp = /*#__PURE__*/function () {
160
159
  custom: customAttributes,
161
160
  jwt: user
162
161
  };
163
- var _this$queryFeatureFla = _this.queryFeatureFlags([USE_ENTITLEMENTS_V2_ENDPOINT_FF]),
164
- _this$queryFeatureFla2 = _slicedToArray(_this$queryFeatureFla, 1),
165
- useEntitlementsV2 = _this$queryFeatureFla2[0];
166
162
  return {
167
163
  entitlements: entitlements,
168
- attributes: attributes,
169
- isV2: useEntitlementsV2
164
+ attributes: attributes
170
165
  };
171
166
  };
172
167
  var appName = formatName(name);
@@ -404,32 +399,27 @@ export var FronteggApp = /*#__PURE__*/function () {
404
399
  }, {
405
400
  key: "showAdminPortal",
406
401
  value: function () {
407
- var _showAdminPortal = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(options) {
408
- var _ref4, isMultiApp, FronteggAdminPortal;
402
+ var _showAdminPortal = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
403
+ var FronteggAdminPortal;
409
404
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
410
405
  while (1) switch (_context6.prev = _context6.next) {
411
406
  case 0:
412
- _ref4 = options != null ? options : {
413
- isMultiApp: false
414
- }, isMultiApp = _ref4.isMultiApp;
415
407
  FronteggRestApi.ContextHolder.setRequestSource(RequestSource.AdminPortal);
416
- _context6.next = 4;
408
+ _context6.next = 3;
417
409
  return this.loadScript('FronteggAdminPortal');
418
- case 4:
410
+ case 3:
419
411
  FronteggAdminPortal = _context6.sent;
420
412
  this.adminPortalRenderer = FronteggAdminPortal.render(this.adminPortalEl, {
421
413
  injector: this,
422
- options: Object.assign({
423
- isMultiApp: isMultiApp
424
- }, this.options)
414
+ options: this.options
425
415
  });
426
- case 6:
416
+ case 5:
427
417
  case "end":
428
418
  return _context6.stop();
429
419
  }
430
420
  }, _callee6, this);
431
421
  }));
432
- function showAdminPortal(_x2) {
422
+ function showAdminPortal() {
433
423
  return _showAdminPortal.apply(this, arguments);
434
424
  }
435
425
  return showAdminPortal;
@@ -471,7 +461,7 @@ export var FronteggApp = /*#__PURE__*/function () {
471
461
  }
472
462
  }, _callee7, this);
473
463
  }));
474
- function showCheckoutDialog(_x3) {
464
+ function showCheckoutDialog(_x2) {
475
465
  return _showCheckoutDialog.apply(this, arguments);
476
466
  }
477
467
  return showCheckoutDialog;
@@ -502,9 +492,8 @@ export var FronteggApp = /*#__PURE__*/function () {
502
492
  function getFeatureEntitlements(key, customAttributes) {
503
493
  var _this$getEntitlements = this.getEntitlementsQueryData(customAttributes),
504
494
  entitlements = _this$getEntitlements.entitlements,
505
- attributes = _this$getEntitlements.attributes,
506
- isV2 = _this$getEntitlements.isV2;
507
- return _getFeatureEntitlements(entitlements, key, attributes, isV2);
495
+ attributes = _this$getEntitlements.attributes;
496
+ return _getFeatureEntitlements(entitlements, key, attributes);
508
497
  }
509
498
 
510
499
  /**
@@ -518,9 +507,8 @@ export var FronteggApp = /*#__PURE__*/function () {
518
507
  value: function getPermissionEntitlements(key, customAttributes) {
519
508
  var _this$getEntitlements2 = this.getEntitlementsQueryData(customAttributes),
520
509
  entitlements = _this$getEntitlements2.entitlements,
521
- attributes = _this$getEntitlements2.attributes,
522
- isV2 = _this$getEntitlements2.isV2;
523
- return _getPermissionEntitlements(entitlements, key, attributes, isV2);
510
+ attributes = _this$getEntitlements2.attributes;
511
+ return _getPermissionEntitlements(entitlements, key, attributes);
524
512
  }
525
513
 
526
514
  /**
@@ -562,9 +550,9 @@ export var FronteggApp = /*#__PURE__*/function () {
562
550
  key: "stepUp",
563
551
  value: function stepUp(options) {
564
552
  var state = this.store.getState();
565
- var _ref5 = (state == null ? void 0 : state.auth) || {},
566
- hostedLoginBox = _ref5.hostedLoginBox,
567
- stepUpUrl = _ref5.routes.stepUpUrl;
553
+ var _ref4 = (state == null ? void 0 : state.auth) || {},
554
+ hostedLoginBox = _ref4.hostedLoginBox,
555
+ stepUpUrl = _ref4.routes.stepUpUrl;
568
556
  if (hostedLoginBox) {
569
557
  this.store.dispatch({
570
558
  type: 'auth/stepUpHostedLogin',
@@ -584,8 +572,8 @@ export var FronteggApp = /*#__PURE__*/function () {
584
572
  value: function isSteppedUp() {
585
573
  var _this$store$getState;
586
574
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
587
- var _ref6 = ((_this$store$getState = this.store.getState()) == null ? void 0 : _this$store$getState.auth) || {},
588
- user = _ref6.user;
575
+ var _ref5 = ((_this$store$getState = this.store.getState()) == null ? void 0 : _this$store$getState.auth) || {},
576
+ user = _ref5.user;
589
577
  return _isSteppedUp(user, options);
590
578
  }
591
579
  }, {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.185.0-alpha.2
1
+ /** @license Frontegg v6.185.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.
@@ -18,14 +18,6 @@ var AdminPortal = /*#__PURE__*/function () {
18
18
  var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
19
19
  _AppHolder.AppHolder.getInstance(name).showAdminPortal();
20
20
  }
21
- }, {
22
- key: "showMultiApp",
23
- value: function showMultiApp() {
24
- var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
25
- _AppHolder.AppHolder.getInstance(name).showAdminPortal({
26
- isMultiApp: true
27
- });
28
- }
29
21
  }, {
30
22
  key: "hide",
31
23
  value: function hide() {
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.FronteggApp = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
12
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -167,13 +166,9 @@ var FronteggApp = /*#__PURE__*/function () {
167
166
  custom: customAttributes,
168
167
  jwt: user
169
168
  };
170
- var _this$queryFeatureFla = _this.queryFeatureFlags([FronteggRestApi.USE_ENTITLEMENTS_V2_ENDPOINT_FF]),
171
- _this$queryFeatureFla2 = (0, _slicedToArray2["default"])(_this$queryFeatureFla, 1),
172
- useEntitlementsV2 = _this$queryFeatureFla2[0];
173
169
  return {
174
170
  entitlements: entitlements,
175
- attributes: attributes,
176
- isV2: useEntitlementsV2
171
+ attributes: attributes
177
172
  };
178
173
  };
179
174
  var appName = (0, _utils.formatName)(name);
@@ -411,32 +406,27 @@ var FronteggApp = /*#__PURE__*/function () {
411
406
  }, {
412
407
  key: "showAdminPortal",
413
408
  value: function () {
414
- var _showAdminPortal = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(options) {
415
- var _ref4, isMultiApp, FronteggAdminPortal;
409
+ var _showAdminPortal = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
410
+ var FronteggAdminPortal;
416
411
  return _regenerator["default"].wrap(function _callee6$(_context6) {
417
412
  while (1) switch (_context6.prev = _context6.next) {
418
413
  case 0:
419
- _ref4 = options != null ? options : {
420
- isMultiApp: false
421
- }, isMultiApp = _ref4.isMultiApp;
422
414
  FronteggRestApi.ContextHolder.setRequestSource(FronteggRestApi.RequestSource.AdminPortal);
423
- _context6.next = 4;
415
+ _context6.next = 3;
424
416
  return this.loadScript('FronteggAdminPortal');
425
- case 4:
417
+ case 3:
426
418
  FronteggAdminPortal = _context6.sent;
427
419
  this.adminPortalRenderer = FronteggAdminPortal.render(this.adminPortalEl, {
428
420
  injector: this,
429
- options: Object.assign({
430
- isMultiApp: isMultiApp
431
- }, this.options)
421
+ options: this.options
432
422
  });
433
- case 6:
423
+ case 5:
434
424
  case "end":
435
425
  return _context6.stop();
436
426
  }
437
427
  }, _callee6, this);
438
428
  }));
439
- function showAdminPortal(_x2) {
429
+ function showAdminPortal() {
440
430
  return _showAdminPortal.apply(this, arguments);
441
431
  }
442
432
  return showAdminPortal;
@@ -478,7 +468,7 @@ var FronteggApp = /*#__PURE__*/function () {
478
468
  }
479
469
  }, _callee7, this);
480
470
  }));
481
- function showCheckoutDialog(_x3) {
471
+ function showCheckoutDialog(_x2) {
482
472
  return _showCheckoutDialog.apply(this, arguments);
483
473
  }
484
474
  return showCheckoutDialog;
@@ -509,9 +499,8 @@ var FronteggApp = /*#__PURE__*/function () {
509
499
  function getFeatureEntitlements(key, customAttributes) {
510
500
  var _this$getEntitlements = this.getEntitlementsQueryData(customAttributes),
511
501
  entitlements = _this$getEntitlements.entitlements,
512
- attributes = _this$getEntitlements.attributes,
513
- isV2 = _this$getEntitlements.isV2;
514
- return (0, _reduxStore.getFeatureEntitlements)(entitlements, key, attributes, isV2);
502
+ attributes = _this$getEntitlements.attributes;
503
+ return (0, _reduxStore.getFeatureEntitlements)(entitlements, key, attributes);
515
504
  }
516
505
 
517
506
  /**
@@ -525,9 +514,8 @@ var FronteggApp = /*#__PURE__*/function () {
525
514
  value: function getPermissionEntitlements(key, customAttributes) {
526
515
  var _this$getEntitlements2 = this.getEntitlementsQueryData(customAttributes),
527
516
  entitlements = _this$getEntitlements2.entitlements,
528
- attributes = _this$getEntitlements2.attributes,
529
- isV2 = _this$getEntitlements2.isV2;
530
- return (0, _reduxStore.getPermissionEntitlements)(entitlements, key, attributes, isV2);
517
+ attributes = _this$getEntitlements2.attributes;
518
+ return (0, _reduxStore.getPermissionEntitlements)(entitlements, key, attributes);
531
519
  }
532
520
 
533
521
  /**
@@ -569,9 +557,9 @@ var FronteggApp = /*#__PURE__*/function () {
569
557
  key: "stepUp",
570
558
  value: function stepUp(options) {
571
559
  var state = this.store.getState();
572
- var _ref5 = (state == null ? void 0 : state.auth) || {},
573
- hostedLoginBox = _ref5.hostedLoginBox,
574
- stepUpUrl = _ref5.routes.stepUpUrl;
560
+ var _ref4 = (state == null ? void 0 : state.auth) || {},
561
+ hostedLoginBox = _ref4.hostedLoginBox,
562
+ stepUpUrl = _ref4.routes.stepUpUrl;
575
563
  if (hostedLoginBox) {
576
564
  this.store.dispatch({
577
565
  type: 'auth/stepUpHostedLogin',
@@ -591,8 +579,8 @@ var FronteggApp = /*#__PURE__*/function () {
591
579
  value: function isSteppedUp() {
592
580
  var _this$store$getState;
593
581
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
594
- var _ref6 = ((_this$store$getState = this.store.getState()) == null ? void 0 : _this$store$getState.auth) || {},
595
- user = _ref6.user;
582
+ var _ref5 = ((_this$store$getState = this.store.getState()) == null ? void 0 : _this$store$getState.auth) || {},
583
+ user = _ref5.user;
596
584
  return (0, _reduxStore.isSteppedUp)(user, options);
597
585
  }
598
586
  }, {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.185.0-alpha.2
1
+ /** @license Frontegg v6.185.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.185.0-alpha.2'
8
+ cdnVersion: '6.185.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.185.0-alpha.2",
3
+ "version": "6.185.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.185.0-alpha.2"
9
+ "@frontegg/types": "6.185.0"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [