@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.
- package/FronteggApp/FronteggApp.d.ts +22 -16
- package/FronteggApp/FronteggApp.js +202 -53
- package/index.js +1 -1
- package/initialize.js +1 -1
- package/node/FronteggApp/FronteggApp.js +202 -53
- package/node/index.js +1 -1
- package/node/initialize.js +1 -1
- package/node/version.js +1 -1
- package/package.json +2 -2
- package/umd/frontegg.development.js +212 -59
- package/umd/frontegg.production.min.js +1 -1
- package/umd/frontegg.production.min.js.LICENSE.txt +1 -1
- package/version.js +1 -1
|
@@ -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
|
|
289
|
-
return _regenerator["default"].wrap(function
|
|
290
|
-
while (1) switch (
|
|
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
|
-
|
|
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
|
|
466
|
+
return _context10.stop();
|
|
318
467
|
}
|
|
319
|
-
},
|
|
468
|
+
}, _callee10, this);
|
|
320
469
|
}));
|
|
321
|
-
function initContainers(
|
|
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
|
|
583
|
+
var _loadLoginBox = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
|
|
435
584
|
var FronteggLoginBox;
|
|
436
|
-
return _regenerator["default"].wrap(function
|
|
437
|
-
while (1) switch (
|
|
585
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
586
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
438
587
|
case 0:
|
|
439
|
-
|
|
588
|
+
_context11.next = 2;
|
|
440
589
|
return this.loadScript('FronteggLoginBox');
|
|
441
590
|
case 2:
|
|
442
|
-
FronteggLoginBox =
|
|
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
|
|
607
|
+
return _context11.stop();
|
|
459
608
|
}
|
|
460
|
-
},
|
|
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
|
|
471
|
-
var
|
|
472
|
-
return _regenerator["default"].wrap(function
|
|
473
|
-
while (1) switch (
|
|
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
|
-
|
|
624
|
+
_ref10 = options != null ? options : {
|
|
476
625
|
isMultiApp: false
|
|
477
|
-
}, 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
|
-
|
|
629
|
+
_context12.next = 5;
|
|
481
630
|
return this.loadScript('FronteggAdminPortal');
|
|
482
631
|
case 5:
|
|
483
|
-
FronteggAdminPortal =
|
|
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
|
|
641
|
+
return _context12.stop();
|
|
493
642
|
}
|
|
494
|
-
},
|
|
643
|
+
}, _callee12, this);
|
|
495
644
|
}));
|
|
496
|
-
function showAdminPortal(
|
|
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
|
|
684
|
+
var _showCheckoutDialog = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(opts) {
|
|
536
685
|
var FronteggAdminPortal;
|
|
537
|
-
return _regenerator["default"].wrap(function
|
|
538
|
-
while (1) switch (
|
|
686
|
+
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
|
687
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
539
688
|
case 0:
|
|
540
|
-
|
|
689
|
+
_context13.next = 2;
|
|
541
690
|
return this.loadScript('FronteggAdminPortal');
|
|
542
691
|
case 2:
|
|
543
|
-
FronteggAdminPortal =
|
|
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
|
|
700
|
+
return _context13.stop();
|
|
552
701
|
}
|
|
553
|
-
},
|
|
702
|
+
}, _callee13, this);
|
|
554
703
|
}));
|
|
555
|
-
function showCheckoutDialog(
|
|
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
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
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
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
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
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
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
|
|
645
|
-
hostedLoginBox =
|
|
646
|
-
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
|
|
667
|
-
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
package/node/initialize.js
CHANGED
|
@@ -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
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/js",
|
|
3
|
-
"version": "7.
|
|
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.
|
|
9
|
+
"@frontegg/types": "7.70.0"
|
|
10
10
|
},
|
|
11
11
|
"browserslist": {
|
|
12
12
|
"production": [
|