@frontegg/rest-api 3.1.65 → 3.1.67
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 +22 -3
- package/applications/index.js +16 -5
- package/applications/interfaces.d.ts +12 -1
- package/constants.d.ts +3 -0
- package/constants.js +4 -1
- package/index.js +1 -1
- package/node/applications/index.js +22 -5
- package/node/constants.js +4 -1
- package/node/index.js +1 -1
- package/package.json +1 -1
package/applications/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUserApplicationsIdPayload, IUserApplicationsDataPayload, IApplicationsResponse, IAssignUserToApplicationsBody, IUsersApplicationsIdPayload } from "./interfaces";
|
|
1
|
+
import { IUserApplicationsIdPayload, IUserApplicationsDataPayload, IApplicationsResponse, IAssignUserToApplicationsBody, IUsersApplicationsIdPayload, IUsersOfApplicationsResponse, ITenantApplicationsResponse, IGetUsersOfApplicationsQuery } 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
|
|
@@ -11,12 +11,17 @@ export declare function getUserApplicationsId({ userId }: IUserApplicationsIdPay
|
|
|
11
11
|
* @returns object that maps every user id to his applications id array
|
|
12
12
|
*/
|
|
13
13
|
export declare function getUsersApplicationsId({ userIds }: IUsersApplicationsIdPayload): Promise<Record<string, string[]>>;
|
|
14
|
+
/**
|
|
15
|
+
* Get applications data array for specific tenant
|
|
16
|
+
* @returns array of object with tenant id and his applications id array
|
|
17
|
+
*/
|
|
18
|
+
export declare function getTenantsApplications(): Promise<ITenantApplicationsResponse[]>;
|
|
14
19
|
/**
|
|
15
20
|
* Get applications data by array of application ids
|
|
16
21
|
* @param appIds - array of application ids
|
|
17
|
-
* @returns
|
|
22
|
+
* @returns array of application data
|
|
18
23
|
*/
|
|
19
|
-
export declare function
|
|
24
|
+
export declare function getApplicationsData({ appIds, includeFreeAccess }: IUserApplicationsDataPayload): Promise<IApplicationsResponse[]>;
|
|
20
25
|
/**
|
|
21
26
|
* Assign user to multiple applications
|
|
22
27
|
* @param appIds - string[]
|
|
@@ -25,3 +30,17 @@ export declare function getUserApplicationsData({ appIds }: IUserApplicationsDat
|
|
|
25
30
|
* @returns void
|
|
26
31
|
*/
|
|
27
32
|
export declare function assignUserToApplications(body: IAssignUserToApplicationsBody): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Unassign user from multiple applications
|
|
35
|
+
* @param appIds - string[]
|
|
36
|
+
* @param tenantId - string
|
|
37
|
+
* @param userId - string
|
|
38
|
+
* @returns void
|
|
39
|
+
*/
|
|
40
|
+
export declare function unassignUserFromApplications(body: IAssignUserToApplicationsBody): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Get users array for each application for array of applications
|
|
43
|
+
* @param appIds - array of applications
|
|
44
|
+
* @returns array of objects with application id and his users array
|
|
45
|
+
*/
|
|
46
|
+
export declare function getUsersOfApplications(query: IGetUsersOfApplicationsQuery): Promise<IUsersOfApplicationsResponse[]>;
|
package/applications/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { urls } from "../constants";
|
|
2
|
-
import { Post, Get } from "../fetch";
|
|
2
|
+
import { Post, Get, Delete } from "../fetch";
|
|
3
3
|
export async function getUserApplicationsId({
|
|
4
4
|
userId
|
|
5
5
|
}) {
|
|
@@ -12,13 +12,24 @@ export async function getUsersApplicationsId({
|
|
|
12
12
|
userIds: userIds.join(',')
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
export async function
|
|
16
|
-
|
|
15
|
+
export async function getTenantsApplications() {
|
|
16
|
+
return Get(urls.applications.tenant.v1);
|
|
17
|
+
}
|
|
18
|
+
export async function getApplicationsData({
|
|
19
|
+
appIds,
|
|
20
|
+
includeFreeAccess = true
|
|
17
21
|
}) {
|
|
18
22
|
return Get(urls.applications.v1, {
|
|
19
|
-
ids: appIds.join(',')
|
|
23
|
+
ids: appIds.join(','),
|
|
24
|
+
_includeFreeAccess: includeFreeAccess
|
|
20
25
|
});
|
|
21
26
|
}
|
|
22
27
|
export async function assignUserToApplications(body) {
|
|
23
|
-
return Post(`${urls.identity.applications.v1}/user
|
|
28
|
+
return Post(`${urls.identity.applications.v1}/apps-user`, body);
|
|
29
|
+
}
|
|
30
|
+
export async function unassignUserFromApplications(body) {
|
|
31
|
+
return Delete(`${urls.identity.applications.v1}/user-apps`, body);
|
|
32
|
+
}
|
|
33
|
+
export async function getUsersOfApplications(query) {
|
|
34
|
+
return Get(`${urls.identity.applications.v1}/apps-users`, query);
|
|
24
35
|
}
|
|
@@ -4,9 +4,16 @@ export declare type IUserApplicationsIdPayload = {
|
|
|
4
4
|
export declare type IUsersApplicationsIdPayload = {
|
|
5
5
|
userIds: string[];
|
|
6
6
|
};
|
|
7
|
-
export declare type
|
|
7
|
+
export declare type IGetUsersOfApplicationsQuery = {
|
|
8
8
|
appIds: string[];
|
|
9
9
|
};
|
|
10
|
+
export declare type IUserApplicationsDataPayload = IGetUsersOfApplicationsQuery & {
|
|
11
|
+
includeFreeAccess?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare type IUsersOfApplicationsResponse = {
|
|
14
|
+
appId: string;
|
|
15
|
+
userIds: string[];
|
|
16
|
+
};
|
|
10
17
|
export declare type IAssignUserToApplicationsBody = {
|
|
11
18
|
userId: string;
|
|
12
19
|
tenantId: string;
|
|
@@ -32,3 +39,7 @@ export declare type IApplicationsResponse = {
|
|
|
32
39
|
description: string;
|
|
33
40
|
integrationFinishedAt: string;
|
|
34
41
|
};
|
|
42
|
+
export declare type ITenantApplicationsResponse = {
|
|
43
|
+
tenantId: string;
|
|
44
|
+
appIds?: string[];
|
|
45
|
+
};
|
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
|
@@ -270,7 +270,10 @@ export const urls = {
|
|
|
270
270
|
}
|
|
271
271
|
},
|
|
272
272
|
applications: {
|
|
273
|
-
v1: '/applications/resources/applications/v1'
|
|
273
|
+
v1: '/applications/resources/applications/v1',
|
|
274
|
+
tenant: {
|
|
275
|
+
v1: '/applications/resources/applications/tenant-assignments/v1'
|
|
276
|
+
}
|
|
274
277
|
}
|
|
275
278
|
};
|
|
276
279
|
export const GENERIC_ERROR_MESSAGE = `We're facing some difficulties, Please try again`;
|
package/index.js
CHANGED
|
@@ -4,9 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.assignUserToApplications = assignUserToApplications;
|
|
7
|
-
exports.
|
|
7
|
+
exports.getApplicationsData = getApplicationsData;
|
|
8
|
+
exports.getTenantsApplications = getTenantsApplications;
|
|
8
9
|
exports.getUserApplicationsId = getUserApplicationsId;
|
|
9
10
|
exports.getUsersApplicationsId = getUsersApplicationsId;
|
|
11
|
+
exports.getUsersOfApplications = getUsersOfApplications;
|
|
12
|
+
exports.unassignUserFromApplications = unassignUserFromApplications;
|
|
10
13
|
|
|
11
14
|
var _constants = require("../constants");
|
|
12
15
|
|
|
@@ -26,14 +29,28 @@ async function getUsersApplicationsId({
|
|
|
26
29
|
});
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
async function
|
|
30
|
-
|
|
32
|
+
async function getTenantsApplications() {
|
|
33
|
+
return (0, _fetch.Get)(_constants.urls.applications.tenant.v1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async function getApplicationsData({
|
|
37
|
+
appIds,
|
|
38
|
+
includeFreeAccess = true
|
|
31
39
|
}) {
|
|
32
40
|
return (0, _fetch.Get)(_constants.urls.applications.v1, {
|
|
33
|
-
ids: appIds.join(',')
|
|
41
|
+
ids: appIds.join(','),
|
|
42
|
+
_includeFreeAccess: includeFreeAccess
|
|
34
43
|
});
|
|
35
44
|
}
|
|
36
45
|
|
|
37
46
|
async function assignUserToApplications(body) {
|
|
38
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.applications.v1}/user
|
|
47
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.applications.v1}/apps-user`, body);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function unassignUserFromApplications(body) {
|
|
51
|
+
return (0, _fetch.Delete)(`${_constants.urls.identity.applications.v1}/user-apps`, body);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function getUsersOfApplications(query) {
|
|
55
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.applications.v1}/apps-users`, query);
|
|
39
56
|
}
|
package/node/constants.js
CHANGED
|
@@ -276,7 +276,10 @@ const urls = {
|
|
|
276
276
|
}
|
|
277
277
|
},
|
|
278
278
|
applications: {
|
|
279
|
-
v1: '/applications/resources/applications/v1'
|
|
279
|
+
v1: '/applications/resources/applications/v1',
|
|
280
|
+
tenant: {
|
|
281
|
+
v1: '/applications/resources/applications/tenant-assignments/v1'
|
|
282
|
+
}
|
|
280
283
|
}
|
|
281
284
|
};
|
|
282
285
|
exports.urls = urls;
|
package/node/index.js
CHANGED