@frontegg/rest-api 3.1.67 → 3.1.69
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/applications/index.d.ts +3 -3
- package/applications/index.js +6 -2
- package/applications/interfaces.d.ts +4 -0
- package/auth/constants.d.ts +0 -4
- package/auth/constants.js +1 -2
- package/auth/index.js +2 -4
- package/auth/interfaces.d.ts +2 -3
- package/auth/interfaces.js +0 -1
- package/entitlements/index.d.ts +0 -9
- package/entitlements/index.js +0 -3
- package/entitlements/interfaces.d.ts +0 -12
- package/index.js +1 -1
- package/node/applications/index.js +6 -2
- package/node/auth/constants.js +2 -4
- package/node/auth/index.js +1 -5
- package/node/auth/interfaces.js +2 -13
- package/node/entitlements/index.js +0 -5
- package/node/index.js +1 -1
- package/node/routers.js +4 -2
- package/package.json +1 -1
- package/routers.d.ts +1 -0
- package/routers.js +2 -1
- package/users/interfaces.d.ts +1 -2
package/applications/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUserApplicationsIdPayload, IUserApplicationsDataPayload, IApplicationsResponse, IAssignUserToApplicationsBody, IUsersApplicationsIdPayload, IUsersOfApplicationsResponse, ITenantApplicationsResponse, IGetUsersOfApplicationsQuery } from "./interfaces";
|
|
1
|
+
import { IUserApplicationsIdPayload, IUserApplicationsDataPayload, IApplicationsResponse, IAssignUserToApplicationsBody, IUsersApplicationsIdPayload, IUsersOfApplicationsResponse, ITenantApplicationsResponse, IGetUsersOfApplicationsQuery, IUsersApplicationsIdsResponse } from "./interfaces";
|
|
2
2
|
/**
|
|
3
3
|
* Get applications id array for single user by user id
|
|
4
4
|
* @param userId - user id to find his applications id array
|
|
@@ -10,7 +10,7 @@ export declare function getUserApplicationsId({ userId }: IUserApplicationsIdPay
|
|
|
10
10
|
* @param userIds - array of all user id's
|
|
11
11
|
* @returns object that maps every user id to his applications id array
|
|
12
12
|
*/
|
|
13
|
-
export declare function getUsersApplicationsId({ userIds }: IUsersApplicationsIdPayload): Promise<
|
|
13
|
+
export declare function getUsersApplicationsId({ userIds }: IUsersApplicationsIdPayload): Promise<IUsersApplicationsIdsResponse[]>;
|
|
14
14
|
/**
|
|
15
15
|
* Get applications data array for specific tenant
|
|
16
16
|
* @returns array of object with tenant id and his applications id array
|
|
@@ -43,4 +43,4 @@ export declare function unassignUserFromApplications(body: IAssignUserToApplicat
|
|
|
43
43
|
* @param appIds - array of applications
|
|
44
44
|
* @returns array of objects with application id and his users array
|
|
45
45
|
*/
|
|
46
|
-
export declare function getUsersOfApplications(
|
|
46
|
+
export declare function getUsersOfApplications({ appIds }: IGetUsersOfApplicationsQuery): Promise<IUsersOfApplicationsResponse[]>;
|
package/applications/index.js
CHANGED
|
@@ -30,6 +30,10 @@ export async function assignUserToApplications(body) {
|
|
|
30
30
|
export async function unassignUserFromApplications(body) {
|
|
31
31
|
return Delete(`${urls.identity.applications.v1}/user-apps`, body);
|
|
32
32
|
}
|
|
33
|
-
export async function getUsersOfApplications(
|
|
34
|
-
|
|
33
|
+
export async function getUsersOfApplications({
|
|
34
|
+
appIds
|
|
35
|
+
}) {
|
|
36
|
+
return Get(`${urls.identity.applications.v1}/apps-users`, {
|
|
37
|
+
appIds: appIds.join(',')
|
|
38
|
+
});
|
|
35
39
|
}
|
package/auth/constants.d.ts
CHANGED
|
@@ -3,7 +3,3 @@ export declare const FRONTEGG_SEPARATE_TABS_BY_TENANT = "FRONTEGG_SEPARATE_TABS_
|
|
|
3
3
|
* use current user tenant v1 feature flag
|
|
4
4
|
*/
|
|
5
5
|
export declare const USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF = "admin_portal_use_current_user_tenants_v1_endpoint";
|
|
6
|
-
/**
|
|
7
|
-
* use entitlements v2 feature flag
|
|
8
|
-
*/
|
|
9
|
-
export declare const USE_ENTITLEMENTS_V2_ENDPOINT_FF = "admin_portal_use_entitlements_v2_endpoint";
|
package/auth/constants.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export const FRONTEGG_SEPARATE_TABS_BY_TENANT = 'FRONTEGG_SEPARATE_TABS_BY_TENANT';
|
|
2
|
-
export const USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF = 'admin_portal_use_current_user_tenants_v1_endpoint';
|
|
3
|
-
export const USE_ENTITLEMENTS_V2_ENDPOINT_FF = 'admin_portal_use_entitlements_v2_endpoint';
|
|
2
|
+
export const USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF = 'admin_portal_use_current_user_tenants_v1_endpoint';
|
package/auth/index.js
CHANGED
|
@@ -12,11 +12,10 @@ 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 {
|
|
15
|
+
import { 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";
|
|
20
19
|
export async function generateLoginResponse(loginResponse) {
|
|
21
20
|
if (!loginResponse.accessToken) {
|
|
22
21
|
return loginResponse;
|
|
@@ -732,12 +731,11 @@ const noThrowLoadEntitlements = async () => {
|
|
|
732
731
|
};
|
|
733
732
|
|
|
734
733
|
export async function getMeAndEntitlements() {
|
|
735
|
-
const [useEntitlementsV2] = FeatureFlags.getFeatureFlags([USE_ENTITLEMENTS_V2_ENDPOINT_FF], ContextHolder.getAppName() || '');
|
|
736
734
|
const actions = [{
|
|
737
735
|
action: getMeV2,
|
|
738
736
|
shouldLoad: true
|
|
739
737
|
}, {
|
|
740
|
-
action:
|
|
738
|
+
action: noThrowLoadEntitlements,
|
|
741
739
|
shouldLoad: shouldLoadEntitlements()
|
|
742
740
|
}, {
|
|
743
741
|
action: getUserAuthorization,
|
package/auth/interfaces.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { UserEntitlementsContext as UserEntitlementsResponseV2 } from "@frontegg/entitlements-javascript-commons";
|
|
2
|
-
import { ITenantsResponse, IUserProfile
|
|
2
|
+
import { ITenantsResponse, IUserProfile } from "..";
|
|
3
3
|
import { AuthStrategyEnum, MachineToMachineAuthStrategy, SocialLoginProviders } from "./enums";
|
|
4
4
|
import { ISamlRolesGroup } from "../teams/interfaces";
|
|
5
5
|
export * from "./secutiry-poilicy/interfaces";
|
|
6
|
-
export { USE_ENTITLEMENTS_V2_ENDPOINT_FF } from './constants';
|
|
7
6
|
export declare type IPreLogin = {
|
|
8
7
|
email: string;
|
|
9
8
|
tenantId?: string;
|
|
@@ -51,7 +50,7 @@ export declare type ILoginResponse = IUserProfile & {
|
|
|
51
50
|
mfaStrategies?: MFAStrategyEnum[];
|
|
52
51
|
mfaDevices?: UserMFADevicesResponse;
|
|
53
52
|
isBreachedPassword?: boolean;
|
|
54
|
-
entitlements?:
|
|
53
|
+
entitlements?: UserEntitlementsResponseV2;
|
|
55
54
|
amr?: string[];
|
|
56
55
|
acr?: string;
|
|
57
56
|
auth_time?: number;
|
package/auth/interfaces.js
CHANGED
package/entitlements/index.d.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import { UserEntitlementsResponse } from './interfaces';
|
|
2
1
|
import { UserEntitlementsContext as UserEntitlementsResponseV2 } from "@frontegg/entitlements-javascript-commons";
|
|
3
|
-
/**
|
|
4
|
-
* Load user entitlements data.
|
|
5
|
-
* Including all user permissions, features and bundles data.
|
|
6
|
-
* Including also isGranted and isEntitled for permissions and features.
|
|
7
|
-
*
|
|
8
|
-
* ``authorized user``
|
|
9
|
-
*/
|
|
10
|
-
export declare function loadEntitlements(): Promise<UserEntitlementsResponse>;
|
|
11
2
|
/**
|
|
12
3
|
* Load user entitlements data v2.
|
|
13
4
|
* Including all user permissions and features data.
|
package/entitlements/index.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API response for user entitlements data.
|
|
3
|
-
* Including all user granted permissions and features data.
|
|
4
|
-
*/
|
|
5
|
-
export interface UserEntitlementsResponse {
|
|
6
|
-
permissions: {
|
|
7
|
-
[permissionKey: string]: Entitlement;
|
|
8
|
-
};
|
|
9
|
-
features: {
|
|
10
|
-
[featureKey: string]: Entitlement;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
1
|
export interface Entitlement {
|
|
14
2
|
isEntitled: boolean;
|
|
15
3
|
justification?: NotEntitledJustification;
|
package/index.js
CHANGED
|
@@ -51,6 +51,10 @@ async function unassignUserFromApplications(body) {
|
|
|
51
51
|
return (0, _fetch.Delete)(`${_constants.urls.identity.applications.v1}/user-apps`, body);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
async function getUsersOfApplications(
|
|
55
|
-
|
|
54
|
+
async function getUsersOfApplications({
|
|
55
|
+
appIds
|
|
56
|
+
}) {
|
|
57
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.applications.v1}/apps-users`, {
|
|
58
|
+
appIds: appIds.join(',')
|
|
59
|
+
});
|
|
56
60
|
}
|
package/node/auth/constants.js
CHANGED
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF = exports.FRONTEGG_SEPARATE_TABS_BY_TENANT = void 0;
|
|
7
7
|
const FRONTEGG_SEPARATE_TABS_BY_TENANT = 'FRONTEGG_SEPARATE_TABS_BY_TENANT';
|
|
8
8
|
exports.FRONTEGG_SEPARATE_TABS_BY_TENANT = FRONTEGG_SEPARATE_TABS_BY_TENANT;
|
|
9
9
|
const USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF = 'admin_portal_use_current_user_tenants_v1_endpoint';
|
|
10
|
-
exports.USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF = USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF;
|
|
11
|
-
const USE_ENTITLEMENTS_V2_ENDPOINT_FF = 'admin_portal_use_entitlements_v2_endpoint';
|
|
12
|
-
exports.USE_ENTITLEMENTS_V2_ENDPOINT_FF = USE_ENTITLEMENTS_V2_ENDPOINT_FF;
|
|
10
|
+
exports.USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF = USE_CURRENT_USER_TENANTS_V1_ENDPOINT_FF;
|
package/node/auth/index.js
CHANGED
|
@@ -386,8 +386,6 @@ var _interfaces2 = require("../entitlements/interfaces");
|
|
|
386
386
|
|
|
387
387
|
var _featureFlags = require("../feature-flags");
|
|
388
388
|
|
|
389
|
-
var _constants2 = require("./constants");
|
|
390
|
-
|
|
391
389
|
const _excluded = ["type"],
|
|
392
390
|
_excluded2 = ["type"],
|
|
393
391
|
_excluded3 = ["type"];
|
|
@@ -1256,13 +1254,11 @@ const noThrowLoadEntitlements = async () => {
|
|
|
1256
1254
|
};
|
|
1257
1255
|
|
|
1258
1256
|
async function getMeAndEntitlements() {
|
|
1259
|
-
const [useEntitlementsV2] = _featureFlags.FeatureFlags.getFeatureFlags([_constants2.USE_ENTITLEMENTS_V2_ENDPOINT_FF], _ContextHolder.ContextHolder.getAppName() || '');
|
|
1260
|
-
|
|
1261
1257
|
const actions = [{
|
|
1262
1258
|
action: getMeV2,
|
|
1263
1259
|
shouldLoad: true
|
|
1264
1260
|
}, {
|
|
1265
|
-
action:
|
|
1261
|
+
action: noThrowLoadEntitlements,
|
|
1266
1262
|
shouldLoad: shouldLoadEntitlements()
|
|
1267
1263
|
}, {
|
|
1268
1264
|
action: getUserAuthorization,
|
package/node/auth/interfaces.js
CHANGED
|
@@ -7,17 +7,9 @@ var _exportNames = {
|
|
|
7
7
|
SecondaryAuthStrategy: true,
|
|
8
8
|
WebAuthnDeviceType: true,
|
|
9
9
|
MFAStrategyEnum: true,
|
|
10
|
-
LOAD_AUTHORIZATION_FF: true
|
|
11
|
-
USE_ENTITLEMENTS_V2_ENDPOINT_FF: true
|
|
10
|
+
LOAD_AUTHORIZATION_FF: true
|
|
12
11
|
};
|
|
13
|
-
exports.SecondaryAuthStrategy = exports.MFAStrategyEnum = exports.LOAD_AUTHORIZATION_FF = void 0;
|
|
14
|
-
Object.defineProperty(exports, "USE_ENTITLEMENTS_V2_ENDPOINT_FF", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () {
|
|
17
|
-
return _constants.USE_ENTITLEMENTS_V2_ENDPOINT_FF;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
exports.WebAuthnDeviceType = void 0;
|
|
12
|
+
exports.WebAuthnDeviceType = exports.SecondaryAuthStrategy = exports.MFAStrategyEnum = exports.LOAD_AUTHORIZATION_FF = void 0;
|
|
21
13
|
|
|
22
14
|
var _interfaces = require("./secutiry-poilicy/interfaces");
|
|
23
15
|
|
|
@@ -32,9 +24,6 @@ Object.keys(_interfaces).forEach(function (key) {
|
|
|
32
24
|
}
|
|
33
25
|
});
|
|
34
26
|
});
|
|
35
|
-
|
|
36
|
-
var _constants = require("./constants");
|
|
37
|
-
|
|
38
27
|
let SecondaryAuthStrategy;
|
|
39
28
|
exports.SecondaryAuthStrategy = SecondaryAuthStrategy;
|
|
40
29
|
|
|
@@ -3,17 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.loadEntitlements = loadEntitlements;
|
|
7
6
|
exports.loadEntitlementsV2 = loadEntitlementsV2;
|
|
8
7
|
|
|
9
8
|
var _constants = require("../constants");
|
|
10
9
|
|
|
11
10
|
var _fetch = require("../fetch");
|
|
12
11
|
|
|
13
|
-
async function loadEntitlements() {
|
|
14
|
-
return (0, _fetch.Get)(_constants.urls.entitlements.v1);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
12
|
async function loadEntitlementsV2() {
|
|
18
13
|
return (0, _fetch.Get)(_constants.urls.entitlements.v2);
|
|
19
14
|
}
|
package/node/index.js
CHANGED
package/node/routers.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.fronteggUsersUrl = exports.fronteggTenantsV3Url = exports.fronteggTenantsUrl = exports.fronteggSilentRefreshTokenUrl = exports.fronteggRefreshTokenUrl = exports.fronteggAuthApiRoutesRegex = void 0;
|
|
6
|
+
exports.fronteggUsersUrl = exports.fronteggTenantsV3Url = exports.fronteggTenantsUrl = exports.fronteggSilentRefreshTokenUrl = exports.fronteggRefreshTokenUrl = exports.fronteggEntitlementsV2Url = exports.fronteggAuthApiRoutesRegex = void 0;
|
|
7
7
|
|
|
8
8
|
var _constants = require("./constants");
|
|
9
9
|
|
|
@@ -18,4 +18,6 @@ exports.fronteggUsersUrl = fronteggUsersUrl;
|
|
|
18
18
|
const fronteggTenantsUrl = `${_constants.urls.identity.users.v2}/me/tenants`;
|
|
19
19
|
exports.fronteggTenantsUrl = fronteggTenantsUrl;
|
|
20
20
|
const fronteggTenantsV3Url = `${_constants.urls.identity.users.v3}/me/tenants`;
|
|
21
|
-
exports.fronteggTenantsV3Url = fronteggTenantsV3Url;
|
|
21
|
+
exports.fronteggTenantsV3Url = fronteggTenantsV3Url;
|
|
22
|
+
const fronteggEntitlementsV2Url = _constants.urls.entitlements.v2;
|
|
23
|
+
exports.fronteggEntitlementsV2Url = fronteggEntitlementsV2Url;
|
package/package.json
CHANGED
package/routers.d.ts
CHANGED
package/routers.js
CHANGED
|
@@ -4,4 +4,5 @@ export const fronteggRefreshTokenUrl = `${urls.identity.auth.v1}/user/token/refr
|
|
|
4
4
|
export const fronteggSilentRefreshTokenUrl = `${urls.oauth.v1}/authorize/silent`;
|
|
5
5
|
export const fronteggUsersUrl = `${urls.identity.users.v2}/me`;
|
|
6
6
|
export const fronteggTenantsUrl = `${urls.identity.users.v2}/me/tenants`;
|
|
7
|
-
export const fronteggTenantsV3Url = `${urls.identity.users.v3}/me/tenants`;
|
|
7
|
+
export const fronteggTenantsV3Url = `${urls.identity.users.v3}/me/tenants`;
|
|
8
|
+
export const fronteggEntitlementsV2Url = urls.entitlements.v2;
|
package/users/interfaces.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { IRole } from '../roles/interfaces';
|
|
|
4
4
|
import { ITeamUserPermission, UserManagedByEnum } from '../teams/interfaces';
|
|
5
5
|
import { IGroupResponse } from '../groups/interfaces';
|
|
6
6
|
import { UserEntitlementsContext as UserEntitlementsResponseV2 } from "@frontegg/entitlements-javascript-commons";
|
|
7
|
-
import { UserEntitlementsResponse } from '../entitlements/interfaces';
|
|
8
7
|
export declare enum SortByEnum {
|
|
9
8
|
createdAt = "createdAt",
|
|
10
9
|
name = "name",
|
|
@@ -77,7 +76,7 @@ export interface IBaseGetUserResponse extends IBaseUserData {
|
|
|
77
76
|
lastLogin?: Date;
|
|
78
77
|
subAccountAccessAllowed?: boolean;
|
|
79
78
|
temporaryExpirationDate?: Date;
|
|
80
|
-
entitlements?:
|
|
79
|
+
entitlements?: UserEntitlementsResponseV2;
|
|
81
80
|
}
|
|
82
81
|
export declare type IUserProfile = IGetUsersV2Response;
|
|
83
82
|
export interface IGetUsersV2Response extends IBaseGetUserResponse {
|