@frontegg/rest-api 3.1.39 → 3.1.41

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/auth/index.js CHANGED
@@ -12,10 +12,11 @@ import { ContextHolder } from "../ContextHolder";
12
12
  import { Delete, Get, Patch, Post, Put } from "../fetch";
13
13
  import { jwtDecode } from "../jwt";
14
14
  import { LOAD_AUTHORIZATION_FF } from './interfaces';
15
- import { loadEntitlements } from '../entitlements';
15
+ import { loadEntitlements, loadEntitlementsV2 } from '../entitlements';
16
16
  import { ADMIN_PORTAL_ENTITLEMENTS_FF } from '../entitlements/interfaces';
17
17
  import { FeatureFlags } from "../feature-flags";
18
18
  import { executeConditionalPromise, getCurrentUserTenantsFunction, getTabTenantFromSessionStorage, setTabTenantInSessionStorage } from "./utils";
19
+ import { USE_ENTITLEMENTS_V2_ENDPOINT_FF } from "./constants";
19
20
  export async function generateLoginResponse(loginResponse) {
20
21
  if (!loginResponse.accessToken) {
21
22
  return loginResponse;
@@ -724,11 +725,12 @@ export async function getMeV2() {
724
725
  return Get(`${urls.identity.users.v2}/me`);
725
726
  }
726
727
  export async function getMeAndEntitlements() {
728
+ const [useEntitlementsV2] = FeatureFlags.getFeatureFlags([USE_ENTITLEMENTS_V2_ENDPOINT_FF], ContextHolder.getAppName() || '');
727
729
  const actions = [{
728
730
  action: getMeV2,
729
731
  shouldLoad: true
730
732
  }, {
731
- action: loadEntitlements,
733
+ action: useEntitlementsV2 ? loadEntitlementsV2 : loadEntitlements,
732
734
  shouldLoad: shouldLoadEntitlements()
733
735
  }, {
734
736
  action: getUserAuthorization,
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.1.39
1
+ /** @license Frontegg v3.1.41
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.
@@ -377,6 +377,8 @@ var _interfaces2 = require("../entitlements/interfaces");
377
377
 
378
378
  var _featureFlags = require("../feature-flags");
379
379
 
380
+ var _constants2 = require("./constants");
381
+
380
382
  const _excluded = ["type"],
381
383
  _excluded2 = ["type"],
382
384
  _excluded3 = ["type"];
@@ -1239,11 +1241,13 @@ async function getMeV2() {
1239
1241
  }
1240
1242
 
1241
1243
  async function getMeAndEntitlements() {
1244
+ const [useEntitlementsV2] = _featureFlags.FeatureFlags.getFeatureFlags([_constants2.USE_ENTITLEMENTS_V2_ENDPOINT_FF], _ContextHolder.ContextHolder.getAppName() || '');
1245
+
1242
1246
  const actions = [{
1243
1247
  action: getMeV2,
1244
1248
  shouldLoad: true
1245
1249
  }, {
1246
- action: _entitlements.loadEntitlements,
1250
+ action: useEntitlementsV2 ? _entitlements.loadEntitlementsV2 : _entitlements.loadEntitlements,
1247
1251
  shouldLoad: shouldLoadEntitlements()
1248
1252
  }, {
1249
1253
  action: getUserAuthorization,
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.1.39
1
+ /** @license Frontegg v3.1.41
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,11 +1,11 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.1.39",
3
+ "version": "3.1.41",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
7
  "@babel/runtime": "^7.17.2",
8
- "@frontegg/entitlements-javascript-commons": "1.0.0-alpha.13"
8
+ "@frontegg/entitlements-javascript-commons": "1.0.0-alpha.15"
9
9
  },
10
10
  "sideEffects": false,
11
11
  "private": false,