@frontegg/js 6.100.0-alpha.2 → 6.100.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,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 } from '../utils';
9
9
  import { AppHolder } from '../AppHolder';
@@ -404,6 +404,18 @@ export var FronteggApp = /*#__PURE__*/function () {
404
404
  console.error('Failed to unmount checkout dialog', e);
405
405
  }
406
406
  }
407
+
408
+ /**
409
+ @param keys The requested entitlement keys
410
+ @returns Entitlements contain true/false for every key (state of is key entitled)
411
+ */
412
+ }, {
413
+ key: "getEntitlements",
414
+ value: function getEntitlements(keys) {
415
+ var _this$store$getState$;
416
+ var entitlements = ((_this$store$getState$ = this.store.getState().auth.entitlementsState) == null ? void 0 : _this$store$getState$.entitlements) || {};
417
+ return _getEntitlements(entitlements, keys);
418
+ }
407
419
  }, {
408
420
  key: "close",
409
421
  value: function close() {
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.100.0-alpha.2
1
+ /** @license Frontegg v6.100.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.
@@ -411,6 +411,18 @@ var FronteggApp = /*#__PURE__*/function () {
411
411
  console.error('Failed to unmount checkout dialog', e);
412
412
  }
413
413
  }
414
+
415
+ /**
416
+ @param keys The requested entitlement keys
417
+ @returns Entitlements contain true/false for every key (state of is key entitled)
418
+ */
419
+ }, {
420
+ key: "getEntitlements",
421
+ value: function getEntitlements(keys) {
422
+ var _this$store$getState$;
423
+ var entitlements = ((_this$store$getState$ = this.store.getState().auth.entitlementsState) == null ? void 0 : _this$store$getState$.entitlements) || {};
424
+ return (0, _reduxStore.getEntitlements)(entitlements, keys);
425
+ }
414
426
  }, {
415
427
  key: "close",
416
428
  value: function close() {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.100.0-alpha.2
1
+ /** @license Frontegg v6.100.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.100.0-alpha.2'
8
+ cdnVersion: '6.100.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.100.0-alpha.2",
3
+ "version": "6.100.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.100.0-alpha.2"
9
+ "@frontegg/types": "6.100.0"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [