@frontegg/rest-api 3.1.57 → 3.1.59
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 +8 -1
- package/index.js +1 -1
- package/node/auth/index.js +7 -1
- package/node/index.js +1 -1
- package/package.json +2 -2
package/auth/index.js
CHANGED
|
@@ -724,13 +724,20 @@ export async function getUserAuthorization() {
|
|
|
724
724
|
export async function getMeV2() {
|
|
725
725
|
return Get(`${urls.identity.users.v2}/me`);
|
|
726
726
|
}
|
|
727
|
+
|
|
728
|
+
const noThrowLoadEntitlements = async () => {
|
|
729
|
+
try {
|
|
730
|
+
return await loadEntitlementsV2();
|
|
731
|
+
} catch (e) {}
|
|
732
|
+
};
|
|
733
|
+
|
|
727
734
|
export async function getMeAndEntitlements() {
|
|
728
735
|
const [useEntitlementsV2] = FeatureFlags.getFeatureFlags([USE_ENTITLEMENTS_V2_ENDPOINT_FF], ContextHolder.getAppName() || '');
|
|
729
736
|
const actions = [{
|
|
730
737
|
action: getMeV2,
|
|
731
738
|
shouldLoad: true
|
|
732
739
|
}, {
|
|
733
|
-
action: useEntitlementsV2 ?
|
|
740
|
+
action: useEntitlementsV2 ? noThrowLoadEntitlements : loadEntitlements,
|
|
734
741
|
shouldLoad: shouldLoadEntitlements()
|
|
735
742
|
}, {
|
|
736
743
|
action: getUserAuthorization,
|
package/index.js
CHANGED
package/node/auth/index.js
CHANGED
|
@@ -1242,6 +1242,12 @@ async function getMeV2() {
|
|
|
1242
1242
|
return (0, _fetch.Get)(`${_constants.urls.identity.users.v2}/me`);
|
|
1243
1243
|
}
|
|
1244
1244
|
|
|
1245
|
+
const noThrowLoadEntitlements = async () => {
|
|
1246
|
+
try {
|
|
1247
|
+
return await (0, _entitlements.loadEntitlementsV2)();
|
|
1248
|
+
} catch (e) {}
|
|
1249
|
+
};
|
|
1250
|
+
|
|
1245
1251
|
async function getMeAndEntitlements() {
|
|
1246
1252
|
const [useEntitlementsV2] = _featureFlags.FeatureFlags.getFeatureFlags([_constants2.USE_ENTITLEMENTS_V2_ENDPOINT_FF], _ContextHolder.ContextHolder.getAppName() || '');
|
|
1247
1253
|
|
|
@@ -1249,7 +1255,7 @@ async function getMeAndEntitlements() {
|
|
|
1249
1255
|
action: getMeV2,
|
|
1250
1256
|
shouldLoad: true
|
|
1251
1257
|
}, {
|
|
1252
|
-
action: useEntitlementsV2 ?
|
|
1258
|
+
action: useEntitlementsV2 ? noThrowLoadEntitlements : _entitlements.loadEntitlements,
|
|
1253
1259
|
shouldLoad: shouldLoadEntitlements()
|
|
1254
1260
|
}, {
|
|
1255
1261
|
action: getUserAuthorization,
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/rest-api",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.59",
|
|
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.
|
|
8
|
+
"@frontegg/entitlements-javascript-commons": "1.1.2"
|
|
9
9
|
},
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"private": false,
|