@frontegg/js 6.102.0 → 6.103.0-alpha.1

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,4 +1,4 @@
1
- import { EnhancedStore } from '@frontegg/redux-store';
1
+ import { EnhancedStore, Entitlements } from '@frontegg/redux-store';
2
2
  import { FronteggAppOptions, FronteggCheckoutDialogOptions, LocalizationsOverrides } from '@frontegg/types';
3
3
  declare type FronteggAppContainers = {
4
4
  adminPortalEl: HTMLElement;
@@ -44,6 +44,11 @@ export declare class FronteggApp {
44
44
  hideAdminPortal(): void;
45
45
  showCheckoutDialog(opts: FronteggCheckoutDialogOptions): Promise<void>;
46
46
  hideCheckoutDialog(): void;
47
+ /**
48
+ @param keys The requested entitlement keys
49
+ @returns Entitlements contain true/false for every key (state of is key entitled)
50
+ */
51
+ getEntitlements(keys: string[]): Entitlements;
47
52
  close(): void;
48
53
  }
49
54
  export {};
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/esm/createClass";
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
- import { createFronteggStore } from '@frontegg/redux-store';
6
+ import { createFronteggStore, getEntitlements as _getEntitlements } from '@frontegg/redux-store';
7
7
  import { Metadata } from '@frontegg/types';
8
8
  import { formatName, restoreSearchParams } from '../utils';
9
9
  import { AppHolder } from '../AppHolder';
@@ -407,6 +407,18 @@ export var FronteggApp = /*#__PURE__*/function () {
407
407
  console.error('Failed to unmount checkout dialog', e);
408
408
  }
409
409
  }
410
+
411
+ /**
412
+ @param keys The requested entitlement keys
413
+ @returns Entitlements contain true/false for every key (state of is key entitled)
414
+ */
415
+ }, {
416
+ key: "getEntitlements",
417
+ value: function getEntitlements(keys) {
418
+ var _this$store$getState$;
419
+ var entitlements = ((_this$store$getState$ = this.store.getState().auth.entitlementsState) == null ? void 0 : _this$store$getState$.entitlements) || {};
420
+ return _getEntitlements(entitlements, keys);
421
+ }
410
422
  }, {
411
423
  key: "close",
412
424
  value: function close() {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.102.0
1
+ /** @license Frontegg v6.103.0-alpha.1
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.
@@ -414,6 +414,18 @@ var FronteggApp = /*#__PURE__*/function () {
414
414
  console.error('Failed to unmount checkout dialog', e);
415
415
  }
416
416
  }
417
+
418
+ /**
419
+ @param keys The requested entitlement keys
420
+ @returns Entitlements contain true/false for every key (state of is key entitled)
421
+ */
422
+ }, {
423
+ key: "getEntitlements",
424
+ value: function getEntitlements(keys) {
425
+ var _this$store$getState$;
426
+ var entitlements = ((_this$store$getState$ = this.store.getState().auth.entitlementsState) == null ? void 0 : _this$store$getState$.entitlements) || {};
427
+ return (0, _reduxStore.getEntitlements)(entitlements, keys);
428
+ }
417
429
  }, {
418
430
  key: "close",
419
431
  value: function close() {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.102.0
1
+ /** @license Frontegg v6.103.0-alpha.1
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.102.0'
8
+ cdnVersion: '6.103.0-alpha.1'
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.102.0",
3
+ "version": "6.103.0-alpha.1",
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.102.0"
9
+ "@frontegg/types": "6.103.0-alpha.1"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [