@frontegg/js 7.69.0 → 7.70.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.
@@ -193,6 +193,155 @@ var FronteggApp = /*#__PURE__*/function () {
193
193
  attributes: attributes
194
194
  };
195
195
  };
196
+ this.renderUsersTable = /*#__PURE__*/function () {
197
+ var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(container, props, options) {
198
+ var FronteggAdminPortal;
199
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
200
+ while (1) switch (_context4.prev = _context4.next) {
201
+ case 0:
202
+ _context4.next = 2;
203
+ return _this.loadScript('FronteggAdminPortal');
204
+ case 2:
205
+ FronteggAdminPortal = _context4.sent;
206
+ return _context4.abrupt("return", FronteggAdminPortal.renderUsersTable(container, {
207
+ injector: _this,
208
+ options: _this.options,
209
+ container: container,
210
+ props: props,
211
+ themeOptions: options.themeOptions
212
+ }));
213
+ case 4:
214
+ case "end":
215
+ return _context4.stop();
216
+ }
217
+ }, _callee4);
218
+ }));
219
+ return function (_x, _x2, _x3) {
220
+ return _ref4.apply(this, arguments);
221
+ };
222
+ }();
223
+ this.renderInviteUserDialog = /*#__PURE__*/function () {
224
+ var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(container, props, options) {
225
+ var FronteggAdminPortal;
226
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
227
+ while (1) switch (_context5.prev = _context5.next) {
228
+ case 0:
229
+ _context5.next = 2;
230
+ return _this.loadScript('FronteggAdminPortal');
231
+ case 2:
232
+ FronteggAdminPortal = _context5.sent;
233
+ return _context5.abrupt("return", FronteggAdminPortal.renderInviteUserDialog(container, {
234
+ injector: _this,
235
+ options: _this.options,
236
+ container: container,
237
+ props: props,
238
+ themeOptions: options.themeOptions
239
+ }));
240
+ case 4:
241
+ case "end":
242
+ return _context5.stop();
243
+ }
244
+ }, _callee5);
245
+ }));
246
+ return function (_x4, _x5, _x6) {
247
+ return _ref5.apply(this, arguments);
248
+ };
249
+ }();
250
+ this.renderChangePasswordForm = /*#__PURE__*/function () {
251
+ var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(container, props, options) {
252
+ var FronteggAdminPortal;
253
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
254
+ while (1) switch (_context6.prev = _context6.next) {
255
+ case 0:
256
+ _context6.next = 2;
257
+ return _this.loadScript('FronteggAdminPortal');
258
+ case 2:
259
+ FronteggAdminPortal = _context6.sent;
260
+ return _context6.abrupt("return", FronteggAdminPortal.renderChangePasswordForm(container, {
261
+ injector: _this,
262
+ options: _this.options,
263
+ props: props,
264
+ themeOptions: options.themeOptions
265
+ }));
266
+ case 4:
267
+ case "end":
268
+ return _context6.stop();
269
+ }
270
+ }, _callee6);
271
+ }));
272
+ return function (_x7, _x8, _x9) {
273
+ return _ref6.apply(this, arguments);
274
+ };
275
+ }();
276
+ this.renderProfilePage = /*#__PURE__*/function () {
277
+ var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(container, props, options) {
278
+ var FronteggAdminPortal;
279
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
280
+ while (1) switch (_context7.prev = _context7.next) {
281
+ case 0:
282
+ _context7.next = 2;
283
+ return _this.loadScript('FronteggAdminPortal');
284
+ case 2:
285
+ FronteggAdminPortal = _context7.sent;
286
+ return _context7.abrupt("return", FronteggAdminPortal.renderProfilePage(container, {
287
+ injector: _this,
288
+ options: _this.options,
289
+ props: props,
290
+ themeOptions: options.themeOptions,
291
+ localizations: options.localizations
292
+ }));
293
+ case 4:
294
+ case "end":
295
+ return _context7.stop();
296
+ }
297
+ }, _callee7);
298
+ }));
299
+ return function (_x10, _x11, _x12) {
300
+ return _ref7.apply(this, arguments);
301
+ };
302
+ }();
303
+ this.getUsersTableStore = /*#__PURE__*/function () {
304
+ var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(options) {
305
+ var FronteggAdminPortal;
306
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
307
+ while (1) switch (_context8.prev = _context8.next) {
308
+ case 0:
309
+ _context8.next = 2;
310
+ return _this.loadScript('FronteggAdminPortal');
311
+ case 2:
312
+ FronteggAdminPortal = _context8.sent;
313
+ return _context8.abrupt("return", FronteggAdminPortal.useUsersTableStore(options));
314
+ case 4:
315
+ case "end":
316
+ return _context8.stop();
317
+ }
318
+ }, _callee8);
319
+ }));
320
+ return function (_x13) {
321
+ return _ref8.apply(this, arguments);
322
+ };
323
+ }();
324
+ this.getInviteUserDialogStore = /*#__PURE__*/function () {
325
+ var _ref9 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(options) {
326
+ var FronteggAdminPortal;
327
+ return _regenerator["default"].wrap(function _callee9$(_context9) {
328
+ while (1) switch (_context9.prev = _context9.next) {
329
+ case 0:
330
+ _context9.next = 2;
331
+ return _this.loadScript('FronteggAdminPortal');
332
+ case 2:
333
+ FronteggAdminPortal = _context9.sent;
334
+ return _context9.abrupt("return", FronteggAdminPortal.useInviteUserDialogStore(options));
335
+ case 4:
336
+ case "end":
337
+ return _context9.stop();
338
+ }
339
+ }, _callee9);
340
+ }));
341
+ return function (_x14) {
342
+ return _ref9.apply(this, arguments);
343
+ };
344
+ }();
196
345
  var appName = (0, _utils.formatName)(name);
197
346
  var customElementName = "frontegg-app-".concat(appName);
198
347
  this.iframeRendering = iframeRendering;
@@ -285,9 +434,9 @@ var FronteggApp = /*#__PURE__*/function () {
285
434
  }, {
286
435
  key: "initContainers",
287
436
  value: function () {
288
- var _initContainers = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(elements) {
289
- return _regenerator["default"].wrap(function _callee4$(_context4) {
290
- while (1) switch (_context4.prev = _context4.next) {
437
+ var _initContainers = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(elements) {
438
+ return _regenerator["default"].wrap(function _callee10$(_context10) {
439
+ while (1) switch (_context10.prev = _context10.next) {
291
440
  case 0:
292
441
  this.adminPortalEl = elements.adminPortalEl;
293
442
  this.loginBoxEl = elements.loginBoxEl;
@@ -302,7 +451,7 @@ var FronteggApp = /*#__PURE__*/function () {
302
451
  } catch (e) {
303
452
  console.error('Failed to add frontegg-loading to body classList');
304
453
  }
305
- _context4.next = 9;
454
+ _context10.next = 9;
306
455
  return Promise.all([this.loadFeatureFlags(), this.loadAdminBoxMetadata(), this.requestAuthorize()]);
307
456
  case 9:
308
457
  if (!this.options.previewMode && !this.options.customLoginBox) {
@@ -314,11 +463,11 @@ var FronteggApp = /*#__PURE__*/function () {
314
463
  }
315
464
  case 11:
316
465
  case "end":
317
- return _context4.stop();
466
+ return _context10.stop();
318
467
  }
319
- }, _callee4, this);
468
+ }, _callee10, this);
320
469
  }));
321
- function initContainers(_x) {
470
+ function initContainers(_x15) {
322
471
  return _initContainers.apply(this, arguments);
323
472
  }
324
473
  return initContainers;
@@ -431,15 +580,15 @@ var FronteggApp = /*#__PURE__*/function () {
431
580
  }, {
432
581
  key: "loadLoginBox",
433
582
  value: function () {
434
- var _loadLoginBox = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
583
+ var _loadLoginBox = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
435
584
  var FronteggLoginBox;
436
- return _regenerator["default"].wrap(function _callee5$(_context5) {
437
- while (1) switch (_context5.prev = _context5.next) {
585
+ return _regenerator["default"].wrap(function _callee11$(_context11) {
586
+ while (1) switch (_context11.prev = _context11.next) {
438
587
  case 0:
439
- _context5.next = 2;
588
+ _context11.next = 2;
440
589
  return this.loadScript('FronteggLoginBox');
441
590
  case 2:
442
- FronteggLoginBox = _context5.sent;
591
+ FronteggLoginBox = _context11.sent;
443
592
  FronteggLoginBox.render(this.loginBoxEl, {
444
593
  injector: this,
445
594
  options: this.options
@@ -455,9 +604,9 @@ var FronteggApp = /*#__PURE__*/function () {
455
604
  this.loadingListeners = [];
456
605
  case 7:
457
606
  case "end":
458
- return _context5.stop();
607
+ return _context11.stop();
459
608
  }
460
- }, _callee5, this);
609
+ }, _callee11, this);
461
610
  }));
462
611
  function loadLoginBox() {
463
612
  return _loadLoginBox.apply(this, arguments);
@@ -467,20 +616,20 @@ var FronteggApp = /*#__PURE__*/function () {
467
616
  }, {
468
617
  key: "showAdminPortal",
469
618
  value: function () {
470
- var _showAdminPortal = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(options) {
471
- var _ref4, isMultiApp, _this$queryFeatureFla, _this$queryFeatureFla2, multiAppsFlag, FronteggAdminPortal;
472
- return _regenerator["default"].wrap(function _callee6$(_context6) {
473
- while (1) switch (_context6.prev = _context6.next) {
619
+ var _showAdminPortal = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(options) {
620
+ var _ref10, isMultiApp, _this$queryFeatureFla, _this$queryFeatureFla2, multiAppsFlag, FronteggAdminPortal;
621
+ return _regenerator["default"].wrap(function _callee12$(_context12) {
622
+ while (1) switch (_context12.prev = _context12.next) {
474
623
  case 0:
475
- _ref4 = options != null ? options : {
624
+ _ref10 = options != null ? options : {
476
625
  isMultiApp: false
477
- }, isMultiApp = _ref4.isMultiApp;
626
+ }, isMultiApp = _ref10.isMultiApp;
478
627
  _this$queryFeatureFla = this.queryFeatureFlags(['multi-apps-admin-portal']), _this$queryFeatureFla2 = (0, _slicedToArray2["default"])(_this$queryFeatureFla, 1), multiAppsFlag = _this$queryFeatureFla2[0];
479
628
  FronteggRestApi.ContextHolder["for"](this.name).setRequestSource(FronteggRestApi.RequestSource.AdminPortal);
480
- _context6.next = 5;
629
+ _context12.next = 5;
481
630
  return this.loadScript('FronteggAdminPortal');
482
631
  case 5:
483
- FronteggAdminPortal = _context6.sent;
632
+ FronteggAdminPortal = _context12.sent;
484
633
  this.adminPortalRenderer = FronteggAdminPortal.render(this.adminPortalEl, {
485
634
  injector: this,
486
635
  options: Object.assign({
@@ -489,11 +638,11 @@ var FronteggApp = /*#__PURE__*/function () {
489
638
  });
490
639
  case 7:
491
640
  case "end":
492
- return _context6.stop();
641
+ return _context12.stop();
493
642
  }
494
- }, _callee6, this);
643
+ }, _callee12, this);
495
644
  }));
496
- function showAdminPortal(_x2) {
645
+ function showAdminPortal(_x16) {
497
646
  return _showAdminPortal.apply(this, arguments);
498
647
  }
499
648
  return showAdminPortal;
@@ -532,15 +681,15 @@ var FronteggApp = /*#__PURE__*/function () {
532
681
  }, {
533
682
  key: "showCheckoutDialog",
534
683
  value: function () {
535
- var _showCheckoutDialog = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(opts) {
684
+ var _showCheckoutDialog = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(opts) {
536
685
  var FronteggAdminPortal;
537
- return _regenerator["default"].wrap(function _callee7$(_context7) {
538
- while (1) switch (_context7.prev = _context7.next) {
686
+ return _regenerator["default"].wrap(function _callee13$(_context13) {
687
+ while (1) switch (_context13.prev = _context13.next) {
539
688
  case 0:
540
- _context7.next = 2;
689
+ _context13.next = 2;
541
690
  return this.loadScript('FronteggAdminPortal');
542
691
  case 2:
543
- FronteggAdminPortal = _context7.sent;
692
+ FronteggAdminPortal = _context13.sent;
544
693
  this.checkoutDialogRenderer = FronteggAdminPortal.renderCheckoutDialog(this.checkoutDialogEl, Object.assign({
545
694
  injector: this
546
695
  }, opts, {
@@ -548,11 +697,11 @@ var FronteggApp = /*#__PURE__*/function () {
548
697
  }));
549
698
  case 4:
550
699
  case "end":
551
- return _context7.stop();
700
+ return _context13.stop();
552
701
  }
553
- }, _callee7, this);
702
+ }, _callee13, this);
554
703
  }));
555
- function showCheckoutDialog(_x3) {
704
+ function showCheckoutDialog(_x17) {
556
705
  return _showCheckoutDialog.apply(this, arguments);
557
706
  }
558
707
  return showCheckoutDialog;
@@ -575,11 +724,11 @@ var FronteggApp = /*#__PURE__*/function () {
575
724
  key: "getFeatureEntitlements",
576
725
  value:
577
726
  /**
578
- @param key feature key
579
- @param customAttributes user attributes
580
- @returns if the user is entitled to the given feature. Attaching the justification if not
581
- @throws when entitlement is not enabled via frontegg options
582
- */
727
+ @param key feature key
728
+ @param customAttributes user attributes
729
+ @returns if the user is entitled to the given feature. Attaching the justification if not
730
+ @throws when entitlement is not enabled via frontegg options
731
+ */
583
732
  function getFeatureEntitlements(key, customAttributes) {
584
733
  var _this$getEntitlements = this.getEntitlementsQueryData(customAttributes),
585
734
  entitlements = _this$getEntitlements.entitlements,
@@ -588,11 +737,11 @@ var FronteggApp = /*#__PURE__*/function () {
588
737
  }
589
738
 
590
739
  /**
591
- @param key permission key
592
- @param customAttributes user attributes
593
- @returns if the user is entitled to the given permission. Attaching the justification if not
594
- @throws when entitlement is not enabled via frontegg options
595
- */
740
+ @param key permission key
741
+ @param customAttributes user attributes
742
+ @returns if the user is entitled to the given permission. Attaching the justification if not
743
+ @throws when entitlement is not enabled via frontegg options
744
+ */
596
745
  }, {
597
746
  key: "getPermissionEntitlements",
598
747
  value: function getPermissionEntitlements(key, customAttributes) {
@@ -603,11 +752,11 @@ var FronteggApp = /*#__PURE__*/function () {
603
752
  }
604
753
 
605
754
  /**
606
- @param options - including permission or feature key
607
- @param customAttributes user attributes
608
- @returns if the user is entitled to the given permission or feature. Attaching the justification if not
609
- @throws when entitlement is not enabled via frontegg options
610
- */
755
+ @param options - including permission or feature key
756
+ @param customAttributes user attributes
757
+ @returns if the user is entitled to the given permission or feature. Attaching the justification if not
758
+ @throws when entitlement is not enabled via frontegg options
759
+ */
611
760
  }, {
612
761
  key: "getEntitlements",
613
762
  value: function getEntitlements(options, customAttributes) {
@@ -641,9 +790,9 @@ var FronteggApp = /*#__PURE__*/function () {
641
790
  key: "stepUp",
642
791
  value: function stepUp(options) {
643
792
  var state = this.store.getState();
644
- var _ref5 = (state == null ? void 0 : state.auth) || {},
645
- hostedLoginBox = _ref5.hostedLoginBox,
646
- stepUpUrl = _ref5.routes.stepUpUrl;
793
+ var _ref11 = (state == null ? void 0 : state.auth) || {},
794
+ hostedLoginBox = _ref11.hostedLoginBox,
795
+ stepUpUrl = _ref11.routes.stepUpUrl;
647
796
  if (hostedLoginBox) {
648
797
  this.store.dispatch({
649
798
  type: 'auth/stepUpHostedLogin',
@@ -663,8 +812,8 @@ var FronteggApp = /*#__PURE__*/function () {
663
812
  value: function isSteppedUp() {
664
813
  var _this$store$getState;
665
814
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
666
- var _ref6 = ((_this$store$getState = this.store.getState()) == null ? void 0 : _this$store$getState.auth) || {},
667
- user = _ref6.user;
815
+ var _ref12 = ((_this$store$getState = this.store.getState()) == null ? void 0 : _this$store$getState.auth) || {},
816
+ user = _ref12.user;
668
817
  return (0, FronteggReduxStore.isSteppedUp)(user, options);
669
818
  }
670
819
 
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.69.0
1
+ /** @license Frontegg v7.70.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.
@@ -87,7 +87,7 @@ var initialize = function initialize(options) {
87
87
  var adminBoxShadowEl = adminPortalContainer.attachShadow({
88
88
  mode: 'open'
89
89
  });
90
- var loginBoxShadowEl = loginBoxContainer.attachShadow({
90
+ var loginBoxShadowEl = options.iframeRendering ? loginBoxContainer : loginBoxContainer.attachShadow({
91
91
  mode: 'open'
92
92
  });
93
93
  var checkoutDialogShadowEl = checkoutDialogContainer.attachShadow({
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.69.0'
8
+ cdnVersion: '7.70.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.69.0",
3
+ "version": "7.70.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.69.0"
9
+ "@frontegg/types": "7.70.0"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [