@frontegg/rest-api 3.0.135 → 3.0.136

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,7 +1,9 @@
1
- import { EntitlementsResponse } from './interfaces';
1
+ import { UserEntitlementsResponse } from './interfaces';
2
2
  /**
3
- * Load entitlements on/off values map by keys
3
+ * Load user entitlements data.
4
+ * Including all user permissions, features and bundles data.
5
+ * Including also isGranted and isEntitled for permissions and features.
4
6
  *
5
7
  * ``authorized user``
6
8
  */
7
- export declare function loadEntitlements(): Promise<EntitlementsResponse>;
9
+ export declare function loadEntitlements(): Promise<UserEntitlementsResponse>;
@@ -1,6 +1,21 @@
1
1
  /**
2
- * Load entitlements on/off values map by keys API response
2
+ * API response for user entitlements data.
3
+ * Including all user granted permissions and features data.
3
4
  */
4
- export interface EntitlementsResponse {
5
- [key: string]: boolean;
5
+ export interface UserEntitlementsResponse {
6
+ permissions: {
7
+ [permissionKey: string]: Entitlement;
8
+ };
9
+ features: {
10
+ [featureKey: string]: Entitlement;
11
+ };
12
+ }
13
+ export interface Entitlement {
14
+ isEntitled: boolean;
15
+ notEntitledReason?: NotEntitledReason;
16
+ }
17
+ export declare enum NotEntitledReason {
18
+ MISSING_PERMISSION = "MISSING_PERMISSION",
19
+ MISSING_FEATURE = "MISSING_FEATURE",
20
+ BUNDLE_EXPIRED = "BUNDLE_EXPIRED"
6
21
  }
@@ -1 +1,7 @@
1
- export {};
1
+ export let NotEntitledReason;
2
+
3
+ (function (NotEntitledReason) {
4
+ NotEntitledReason["MISSING_PERMISSION"] = "MISSING_PERMISSION";
5
+ NotEntitledReason["MISSING_FEATURE"] = "MISSING_FEATURE";
6
+ NotEntitledReason["BUNDLE_EXPIRED"] = "BUNDLE_EXPIRED";
7
+ })(NotEntitledReason || (NotEntitledReason = {}));
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.135
1
+ /** @license Frontegg v3.0.136
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.
@@ -2,4 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- });
5
+ });
6
+ exports.NotEntitledReason = void 0;
7
+ let NotEntitledReason;
8
+ exports.NotEntitledReason = NotEntitledReason;
9
+
10
+ (function (NotEntitledReason) {
11
+ NotEntitledReason["MISSING_PERMISSION"] = "MISSING_PERMISSION";
12
+ NotEntitledReason["MISSING_FEATURE"] = "MISSING_FEATURE";
13
+ NotEntitledReason["BUNDLE_EXPIRED"] = "BUNDLE_EXPIRED";
14
+ })(NotEntitledReason || (exports.NotEntitledReason = NotEntitledReason = {}));
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.135
1
+ /** @license Frontegg v3.0.136
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.135",
3
+ "version": "3.0.136",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {