@frontegg/js 7.68.0-alpha.1 → 7.68.0-alpha.3
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 +19 -15
- package/FronteggApp/FronteggApp.js +160 -53
- package/index.js +1 -1
- package/initialize.js +1 -1
- package/node/FronteggApp/FronteggApp.js +160 -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 +173 -64
- package/umd/frontegg.production.min.js +1 -1
- package/umd/frontegg.production.min.js.LICENSE.txt +1 -1
- package/version.js +1 -1
|
@@ -97,25 +97,25 @@ export declare class FronteggApp {
|
|
|
97
97
|
*/
|
|
98
98
|
private getEntitlementsQueryData;
|
|
99
99
|
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
@param key feature key
|
|
101
|
+
@param customAttributes user attributes
|
|
102
|
+
@returns if the user is entitled to the given feature. Attaching the justification if not
|
|
103
|
+
@throws when entitlement is not enabled via frontegg options
|
|
104
|
+
*/
|
|
105
105
|
getFeatureEntitlements(key: string, customAttributes?: CustomAttributes): Entitlement;
|
|
106
106
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
@param key permission key
|
|
108
|
+
@param customAttributes user attributes
|
|
109
|
+
@returns if the user is entitled to the given permission. Attaching the justification if not
|
|
110
|
+
@throws when entitlement is not enabled via frontegg options
|
|
111
|
+
*/
|
|
112
112
|
getPermissionEntitlements(key: string, customAttributes?: CustomAttributes): Entitlement;
|
|
113
113
|
/**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
@param options - including permission or feature key
|
|
115
|
+
@param customAttributes user attributes
|
|
116
|
+
@returns if the user is entitled to the given permission or feature. Attaching the justification if not
|
|
117
|
+
@throws when entitlement is not enabled via frontegg options
|
|
118
|
+
*/
|
|
119
119
|
getEntitlements(options: EntitledToOptions, customAttributes?: CustomAttributes): Entitlement;
|
|
120
120
|
/**
|
|
121
121
|
* Load entitlements
|
|
@@ -139,5 +139,9 @@ export declare class FronteggApp {
|
|
|
139
139
|
*/
|
|
140
140
|
switchTenant(payload: SwitchTenantOptions): void;
|
|
141
141
|
close(): void;
|
|
142
|
+
renderUsersTable: (container: HTMLElement, props: any, options: any) => Promise<any>;
|
|
143
|
+
renderInviteUserDialog: (container: HTMLElement, props: any, options: any) => Promise<any>;
|
|
144
|
+
renderChangePasswordForm: (container: HTMLElement, props: any, options: any) => Promise<any>;
|
|
145
|
+
renderProfilePage: (container: HTMLElement, props: any, options: any) => Promise<any>;
|
|
142
146
|
}
|
|
143
147
|
export {};
|
|
@@ -186,6 +186,113 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
186
186
|
attributes: attributes
|
|
187
187
|
};
|
|
188
188
|
};
|
|
189
|
+
this.renderUsersTable = /*#__PURE__*/function () {
|
|
190
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(container, props, options) {
|
|
191
|
+
var FronteggAdminPortal;
|
|
192
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
193
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
194
|
+
case 0:
|
|
195
|
+
_context4.next = 2;
|
|
196
|
+
return _this.loadScript('FronteggAdminPortal');
|
|
197
|
+
case 2:
|
|
198
|
+
FronteggAdminPortal = _context4.sent;
|
|
199
|
+
return _context4.abrupt("return", FronteggAdminPortal.renderUsersTable(container, {
|
|
200
|
+
injector: _this,
|
|
201
|
+
options: _this.options,
|
|
202
|
+
container: container,
|
|
203
|
+
props: props,
|
|
204
|
+
themeOptions: options.themeOptions
|
|
205
|
+
}));
|
|
206
|
+
case 4:
|
|
207
|
+
case "end":
|
|
208
|
+
return _context4.stop();
|
|
209
|
+
}
|
|
210
|
+
}, _callee4);
|
|
211
|
+
}));
|
|
212
|
+
return function (_x, _x2, _x3) {
|
|
213
|
+
return _ref4.apply(this, arguments);
|
|
214
|
+
};
|
|
215
|
+
}();
|
|
216
|
+
this.renderInviteUserDialog = /*#__PURE__*/function () {
|
|
217
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(container, props, options) {
|
|
218
|
+
var FronteggAdminPortal;
|
|
219
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
220
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
221
|
+
case 0:
|
|
222
|
+
_context5.next = 2;
|
|
223
|
+
return _this.loadScript('FronteggAdminPortal');
|
|
224
|
+
case 2:
|
|
225
|
+
FronteggAdminPortal = _context5.sent;
|
|
226
|
+
return _context5.abrupt("return", FronteggAdminPortal.renderInviteUserDialog(container, {
|
|
227
|
+
injector: _this,
|
|
228
|
+
options: _this.options,
|
|
229
|
+
container: container,
|
|
230
|
+
props: props,
|
|
231
|
+
themeOptions: options.themeOptions
|
|
232
|
+
}));
|
|
233
|
+
case 4:
|
|
234
|
+
case "end":
|
|
235
|
+
return _context5.stop();
|
|
236
|
+
}
|
|
237
|
+
}, _callee5);
|
|
238
|
+
}));
|
|
239
|
+
return function (_x4, _x5, _x6) {
|
|
240
|
+
return _ref5.apply(this, arguments);
|
|
241
|
+
};
|
|
242
|
+
}();
|
|
243
|
+
this.renderChangePasswordForm = /*#__PURE__*/function () {
|
|
244
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(container, props, options) {
|
|
245
|
+
var FronteggAdminPortal;
|
|
246
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
247
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
248
|
+
case 0:
|
|
249
|
+
_context6.next = 2;
|
|
250
|
+
return _this.loadScript('FronteggAdminPortal');
|
|
251
|
+
case 2:
|
|
252
|
+
FronteggAdminPortal = _context6.sent;
|
|
253
|
+
return _context6.abrupt("return", FronteggAdminPortal.renderChangePasswordForm(container, {
|
|
254
|
+
injector: _this,
|
|
255
|
+
options: _this.options,
|
|
256
|
+
props: props,
|
|
257
|
+
themeOptions: options.themeOptions
|
|
258
|
+
}));
|
|
259
|
+
case 4:
|
|
260
|
+
case "end":
|
|
261
|
+
return _context6.stop();
|
|
262
|
+
}
|
|
263
|
+
}, _callee6);
|
|
264
|
+
}));
|
|
265
|
+
return function (_x7, _x8, _x9) {
|
|
266
|
+
return _ref6.apply(this, arguments);
|
|
267
|
+
};
|
|
268
|
+
}();
|
|
269
|
+
this.renderProfilePage = /*#__PURE__*/function () {
|
|
270
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(container, props, options) {
|
|
271
|
+
var FronteggAdminPortal;
|
|
272
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
273
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
274
|
+
case 0:
|
|
275
|
+
_context7.next = 2;
|
|
276
|
+
return _this.loadScript('FronteggAdminPortal');
|
|
277
|
+
case 2:
|
|
278
|
+
FronteggAdminPortal = _context7.sent;
|
|
279
|
+
return _context7.abrupt("return", FronteggAdminPortal.renderProfilePage(container, {
|
|
280
|
+
injector: _this,
|
|
281
|
+
options: _this.options,
|
|
282
|
+
props: props,
|
|
283
|
+
themeOptions: options.themeOptions,
|
|
284
|
+
localizations: options.localizations
|
|
285
|
+
}));
|
|
286
|
+
case 4:
|
|
287
|
+
case "end":
|
|
288
|
+
return _context7.stop();
|
|
289
|
+
}
|
|
290
|
+
}, _callee7);
|
|
291
|
+
}));
|
|
292
|
+
return function (_x10, _x11, _x12) {
|
|
293
|
+
return _ref7.apply(this, arguments);
|
|
294
|
+
};
|
|
295
|
+
}();
|
|
189
296
|
var appName = formatName(name);
|
|
190
297
|
var customElementName = "frontegg-app-".concat(appName);
|
|
191
298
|
this.iframeRendering = iframeRendering;
|
|
@@ -278,9 +385,9 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
278
385
|
}, {
|
|
279
386
|
key: "initContainers",
|
|
280
387
|
value: function () {
|
|
281
|
-
var _initContainers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
282
|
-
return _regeneratorRuntime.wrap(function
|
|
283
|
-
while (1) switch (
|
|
388
|
+
var _initContainers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(elements) {
|
|
389
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
390
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
284
391
|
case 0:
|
|
285
392
|
this.adminPortalEl = elements.adminPortalEl;
|
|
286
393
|
this.loginBoxEl = elements.loginBoxEl;
|
|
@@ -295,7 +402,7 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
295
402
|
} catch (e) {
|
|
296
403
|
console.error('Failed to add frontegg-loading to body classList');
|
|
297
404
|
}
|
|
298
|
-
|
|
405
|
+
_context8.next = 9;
|
|
299
406
|
return Promise.all([this.loadFeatureFlags(), this.loadAdminBoxMetadata(), this.requestAuthorize()]);
|
|
300
407
|
case 9:
|
|
301
408
|
if (!this.options.previewMode && !this.options.customLoginBox) {
|
|
@@ -307,11 +414,11 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
307
414
|
}
|
|
308
415
|
case 11:
|
|
309
416
|
case "end":
|
|
310
|
-
return
|
|
417
|
+
return _context8.stop();
|
|
311
418
|
}
|
|
312
|
-
},
|
|
419
|
+
}, _callee8, this);
|
|
313
420
|
}));
|
|
314
|
-
function initContainers(
|
|
421
|
+
function initContainers(_x13) {
|
|
315
422
|
return _initContainers.apply(this, arguments);
|
|
316
423
|
}
|
|
317
424
|
return initContainers;
|
|
@@ -424,15 +531,15 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
424
531
|
}, {
|
|
425
532
|
key: "loadLoginBox",
|
|
426
533
|
value: function () {
|
|
427
|
-
var _loadLoginBox = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
534
|
+
var _loadLoginBox = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
428
535
|
var FronteggLoginBox;
|
|
429
|
-
return _regeneratorRuntime.wrap(function
|
|
430
|
-
while (1) switch (
|
|
536
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
537
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
431
538
|
case 0:
|
|
432
|
-
|
|
539
|
+
_context9.next = 2;
|
|
433
540
|
return this.loadScript('FronteggLoginBox');
|
|
434
541
|
case 2:
|
|
435
|
-
FronteggLoginBox =
|
|
542
|
+
FronteggLoginBox = _context9.sent;
|
|
436
543
|
FronteggLoginBox.render(this.loginBoxEl, {
|
|
437
544
|
injector: this,
|
|
438
545
|
options: this.options
|
|
@@ -448,9 +555,9 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
448
555
|
this.loadingListeners = [];
|
|
449
556
|
case 7:
|
|
450
557
|
case "end":
|
|
451
|
-
return
|
|
558
|
+
return _context9.stop();
|
|
452
559
|
}
|
|
453
|
-
},
|
|
560
|
+
}, _callee9, this);
|
|
454
561
|
}));
|
|
455
562
|
function loadLoginBox() {
|
|
456
563
|
return _loadLoginBox.apply(this, arguments);
|
|
@@ -460,20 +567,20 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
460
567
|
}, {
|
|
461
568
|
key: "showAdminPortal",
|
|
462
569
|
value: function () {
|
|
463
|
-
var _showAdminPortal = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
464
|
-
var
|
|
465
|
-
return _regeneratorRuntime.wrap(function
|
|
466
|
-
while (1) switch (
|
|
570
|
+
var _showAdminPortal = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(options) {
|
|
571
|
+
var _ref8, isMultiApp, _this$queryFeatureFla, _this$queryFeatureFla2, multiAppsFlag, FronteggAdminPortal;
|
|
572
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
573
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
467
574
|
case 0:
|
|
468
|
-
|
|
575
|
+
_ref8 = options != null ? options : {
|
|
469
576
|
isMultiApp: false
|
|
470
|
-
}, isMultiApp =
|
|
577
|
+
}, isMultiApp = _ref8.isMultiApp;
|
|
471
578
|
_this$queryFeatureFla = this.queryFeatureFlags(['multi-apps-admin-portal']), _this$queryFeatureFla2 = _slicedToArray(_this$queryFeatureFla, 1), multiAppsFlag = _this$queryFeatureFla2[0];
|
|
472
579
|
ContextHolder["for"](this.name).setRequestSource(RequestSource.AdminPortal);
|
|
473
|
-
|
|
580
|
+
_context10.next = 5;
|
|
474
581
|
return this.loadScript('FronteggAdminPortal');
|
|
475
582
|
case 5:
|
|
476
|
-
FronteggAdminPortal =
|
|
583
|
+
FronteggAdminPortal = _context10.sent;
|
|
477
584
|
this.adminPortalRenderer = FronteggAdminPortal.render(this.adminPortalEl, {
|
|
478
585
|
injector: this,
|
|
479
586
|
options: Object.assign({
|
|
@@ -482,11 +589,11 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
482
589
|
});
|
|
483
590
|
case 7:
|
|
484
591
|
case "end":
|
|
485
|
-
return
|
|
592
|
+
return _context10.stop();
|
|
486
593
|
}
|
|
487
|
-
},
|
|
594
|
+
}, _callee10, this);
|
|
488
595
|
}));
|
|
489
|
-
function showAdminPortal(
|
|
596
|
+
function showAdminPortal(_x14) {
|
|
490
597
|
return _showAdminPortal.apply(this, arguments);
|
|
491
598
|
}
|
|
492
599
|
return showAdminPortal;
|
|
@@ -525,15 +632,15 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
525
632
|
}, {
|
|
526
633
|
key: "showCheckoutDialog",
|
|
527
634
|
value: function () {
|
|
528
|
-
var _showCheckoutDialog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
635
|
+
var _showCheckoutDialog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(opts) {
|
|
529
636
|
var FronteggAdminPortal;
|
|
530
|
-
return _regeneratorRuntime.wrap(function
|
|
531
|
-
while (1) switch (
|
|
637
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
638
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
532
639
|
case 0:
|
|
533
|
-
|
|
640
|
+
_context11.next = 2;
|
|
534
641
|
return this.loadScript('FronteggAdminPortal');
|
|
535
642
|
case 2:
|
|
536
|
-
FronteggAdminPortal =
|
|
643
|
+
FronteggAdminPortal = _context11.sent;
|
|
537
644
|
this.checkoutDialogRenderer = FronteggAdminPortal.renderCheckoutDialog(this.checkoutDialogEl, Object.assign({
|
|
538
645
|
injector: this
|
|
539
646
|
}, opts, {
|
|
@@ -541,11 +648,11 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
541
648
|
}));
|
|
542
649
|
case 4:
|
|
543
650
|
case "end":
|
|
544
|
-
return
|
|
651
|
+
return _context11.stop();
|
|
545
652
|
}
|
|
546
|
-
},
|
|
653
|
+
}, _callee11, this);
|
|
547
654
|
}));
|
|
548
|
-
function showCheckoutDialog(
|
|
655
|
+
function showCheckoutDialog(_x15) {
|
|
549
656
|
return _showCheckoutDialog.apply(this, arguments);
|
|
550
657
|
}
|
|
551
658
|
return showCheckoutDialog;
|
|
@@ -568,11 +675,11 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
568
675
|
key: "getFeatureEntitlements",
|
|
569
676
|
value:
|
|
570
677
|
/**
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
678
|
+
@param key feature key
|
|
679
|
+
@param customAttributes user attributes
|
|
680
|
+
@returns if the user is entitled to the given feature. Attaching the justification if not
|
|
681
|
+
@throws when entitlement is not enabled via frontegg options
|
|
682
|
+
*/
|
|
576
683
|
function getFeatureEntitlements(key, customAttributes) {
|
|
577
684
|
var _this$getEntitlements = this.getEntitlementsQueryData(customAttributes),
|
|
578
685
|
entitlements = _this$getEntitlements.entitlements,
|
|
@@ -581,11 +688,11 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
581
688
|
}
|
|
582
689
|
|
|
583
690
|
/**
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
691
|
+
@param key permission key
|
|
692
|
+
@param customAttributes user attributes
|
|
693
|
+
@returns if the user is entitled to the given permission. Attaching the justification if not
|
|
694
|
+
@throws when entitlement is not enabled via frontegg options
|
|
695
|
+
*/
|
|
589
696
|
}, {
|
|
590
697
|
key: "getPermissionEntitlements",
|
|
591
698
|
value: function getPermissionEntitlements(key, customAttributes) {
|
|
@@ -596,11 +703,11 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
596
703
|
}
|
|
597
704
|
|
|
598
705
|
/**
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
706
|
+
@param options - including permission or feature key
|
|
707
|
+
@param customAttributes user attributes
|
|
708
|
+
@returns if the user is entitled to the given permission or feature. Attaching the justification if not
|
|
709
|
+
@throws when entitlement is not enabled via frontegg options
|
|
710
|
+
*/
|
|
604
711
|
}, {
|
|
605
712
|
key: "getEntitlements",
|
|
606
713
|
value: function getEntitlements(options, customAttributes) {
|
|
@@ -634,9 +741,9 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
634
741
|
key: "stepUp",
|
|
635
742
|
value: function stepUp(options) {
|
|
636
743
|
var state = this.store.getState();
|
|
637
|
-
var
|
|
638
|
-
hostedLoginBox =
|
|
639
|
-
stepUpUrl =
|
|
744
|
+
var _ref9 = (state == null ? void 0 : state.auth) || {},
|
|
745
|
+
hostedLoginBox = _ref9.hostedLoginBox,
|
|
746
|
+
stepUpUrl = _ref9.routes.stepUpUrl;
|
|
640
747
|
if (hostedLoginBox) {
|
|
641
748
|
this.store.dispatch({
|
|
642
749
|
type: 'auth/stepUpHostedLogin',
|
|
@@ -656,8 +763,8 @@ export var FronteggApp = /*#__PURE__*/function () {
|
|
|
656
763
|
value: function isSteppedUp() {
|
|
657
764
|
var _this$store$getState;
|
|
658
765
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
659
|
-
var
|
|
660
|
-
user =
|
|
766
|
+
var _ref10 = ((_this$store$getState = this.store.getState()) == null ? void 0 : _this$store$getState.auth) || {},
|
|
767
|
+
user = _ref10.user;
|
|
661
768
|
return _isSteppedUp(user, options);
|
|
662
769
|
}
|
|
663
770
|
|
package/index.js
CHANGED
package/initialize.js
CHANGED
|
@@ -80,7 +80,7 @@ export var initialize = function initialize(options) {
|
|
|
80
80
|
var adminBoxShadowEl = adminPortalContainer.attachShadow({
|
|
81
81
|
mode: 'open'
|
|
82
82
|
});
|
|
83
|
-
var loginBoxShadowEl = loginBoxContainer.attachShadow({
|
|
83
|
+
var loginBoxShadowEl = options.iframeRendering ? loginBoxContainer : loginBoxContainer.attachShadow({
|
|
84
84
|
mode: 'open'
|
|
85
85
|
});
|
|
86
86
|
var checkoutDialogShadowEl = checkoutDialogContainer.attachShadow({
|