@frontegg/rest-api 3.0.80 → 3.0.81
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/constants.d.ts +2 -6
- package/constants.js +2 -6
- package/groups/enums.d.ts +5 -0
- package/groups/enums.js +7 -0
- package/groups/index.d.ts +7 -7
- package/groups/index.js +13 -12
- package/groups/interfaces.d.ts +5 -6
- package/index.js +1 -1
- package/node/constants.js +2 -6
- package/node/groups/enums.js +14 -0
- package/node/groups/index.js +14 -12
- package/node/index.js +1 -1
- package/package.json +1 -1
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
|
@@ -84,12 +84,8 @@ export const urls = {
|
|
|
84
84
|
v1: '/identity/resources/groups/v1/config'
|
|
85
85
|
},
|
|
86
86
|
v1: '/identity/resources/groups/v1',
|
|
87
|
-
roles:
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
users: {
|
|
91
|
-
v1: '/identity/resources/groups/v1/users'
|
|
92
|
-
}
|
|
87
|
+
roles: '/roles',
|
|
88
|
+
users: '/users'
|
|
93
89
|
}
|
|
94
90
|
},
|
|
95
91
|
team: {
|
package/groups/enums.js
ADDED
package/groups/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ICreateGroup, ICreateGroupResponse, IGetGroup, IGroupConfigResponse, IGroupResponse, IUpdateGroup, IUpdateGroupConfig, IUpdateGroupRoles, IUpdateGroupUsers } from "./interfaces";
|
|
1
|
+
import { ICreateGroup, ICreateGroupResponse, IGetGroup, IGetGroupQueryOptions, IGroupConfigResponse, IGroupResponse, IUpdateGroup, IUpdateGroupConfig, IUpdateGroupRoles, IUpdateGroupUsers } from "./interfaces";
|
|
2
2
|
/**
|
|
3
3
|
* Get group by given id
|
|
4
4
|
*/
|
|
5
|
-
export declare function getGroupById({ groupId, }: IGetGroup): Promise<IGroupResponse>;
|
|
5
|
+
export declare function getGroupById({ groupId, }: IGetGroup, query?: IGetGroupQueryOptions): Promise<IGroupResponse>;
|
|
6
6
|
/**
|
|
7
7
|
* Get all tenant groups
|
|
8
8
|
*/
|
|
9
|
-
export declare function getGroups(): Promise<IGroupResponse[]>;
|
|
9
|
+
export declare function getGroups(query?: IGetGroupQueryOptions): Promise<IGroupResponse[]>;
|
|
10
10
|
/**
|
|
11
11
|
* Create new group
|
|
12
12
|
*/
|
|
@@ -22,19 +22,19 @@ export declare function deleteGroup(groupId: string): Promise<void>;
|
|
|
22
22
|
/**
|
|
23
23
|
* Add roles to existing group
|
|
24
24
|
*/
|
|
25
|
-
export declare function addRolesToGroup(body: IUpdateGroupRoles): Promise<void>;
|
|
25
|
+
export declare function addRolesToGroup(groupId: string, body: IUpdateGroupRoles): Promise<void>;
|
|
26
26
|
/**
|
|
27
27
|
* Delete roles from existing group
|
|
28
28
|
*/
|
|
29
|
-
export declare function deleteRolesFromGroup(body: IUpdateGroupRoles): Promise<void>;
|
|
29
|
+
export declare function deleteRolesFromGroup(groupId: string, body: IUpdateGroupRoles): Promise<void>;
|
|
30
30
|
/**
|
|
31
31
|
* Add users to existing group
|
|
32
32
|
*/
|
|
33
|
-
export declare function addUsersToGroup(body: IUpdateGroupUsers): Promise<void>;
|
|
33
|
+
export declare function addUsersToGroup(groupId: string, body: IUpdateGroupUsers): Promise<void>;
|
|
34
34
|
/**
|
|
35
35
|
* Delete users from existing group
|
|
36
36
|
*/
|
|
37
|
-
export declare function deleteUsersFromGroup(body: IUpdateGroupUsers): Promise<void>;
|
|
37
|
+
export declare function deleteUsersFromGroup(groupId: string, body: IUpdateGroupUsers): Promise<void>;
|
|
38
38
|
/**
|
|
39
39
|
* Get or create default groups configuration
|
|
40
40
|
*/
|
package/groups/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
3
|
const _excluded = ["groupId"];
|
|
3
4
|
import { urls } from "../constants";
|
|
4
5
|
import { Delete, Get, Patch, Post } from "../fetch";
|
|
5
6
|
export async function getGroupById({
|
|
6
7
|
groupId
|
|
7
|
-
}) {
|
|
8
|
-
return Get(`${urls.identity.groups.v1}/${groupId}
|
|
8
|
+
}, query) {
|
|
9
|
+
return Get(`${urls.identity.groups.v1}/${groupId}`, _extends({}, query));
|
|
9
10
|
}
|
|
10
|
-
export async function getGroups() {
|
|
11
|
-
return Get(`${urls.identity.groups.v1}
|
|
11
|
+
export async function getGroups(query) {
|
|
12
|
+
return Get(`${urls.identity.groups.v1}`, _extends({}, query));
|
|
12
13
|
}
|
|
13
14
|
export async function createGroup(body) {
|
|
14
15
|
return Post(`${urls.identity.groups.v1}`, body);
|
|
@@ -24,17 +25,17 @@ export async function updateGroup(_ref) {
|
|
|
24
25
|
export async function deleteGroup(groupId) {
|
|
25
26
|
return Delete(`${urls.identity.groups.v1}/${groupId}`);
|
|
26
27
|
}
|
|
27
|
-
export async function addRolesToGroup(body) {
|
|
28
|
-
return Post(`${urls.identity.groups.
|
|
28
|
+
export async function addRolesToGroup(groupId, body) {
|
|
29
|
+
return Post(`${urls.identity.groups.v1}/${groupId}/${urls.identity.groups.roles}`, body);
|
|
29
30
|
}
|
|
30
|
-
export async function deleteRolesFromGroup(body) {
|
|
31
|
-
return Delete(`${urls.identity.groups.
|
|
31
|
+
export async function deleteRolesFromGroup(groupId, body) {
|
|
32
|
+
return Delete(`${urls.identity.groups.v1}/${groupId}/${urls.identity.groups.roles}`, body);
|
|
32
33
|
}
|
|
33
|
-
export async function addUsersToGroup(body) {
|
|
34
|
-
return Post(`${urls.identity.groups.
|
|
34
|
+
export async function addUsersToGroup(groupId, body) {
|
|
35
|
+
return Post(`${urls.identity.groups.v1}/${groupId}/${urls.identity.groups.users}`, body);
|
|
35
36
|
}
|
|
36
|
-
export async function deleteUsersFromGroup(body) {
|
|
37
|
-
return Delete(`${urls.identity.groups.
|
|
37
|
+
export async function deleteUsersFromGroup(groupId, body) {
|
|
38
|
+
return Delete(`${urls.identity.groups.v1}/${groupId}/${urls.identity.groups.users}`, body);
|
|
38
39
|
}
|
|
39
40
|
export async function getGroupConfiguration() {
|
|
40
41
|
return Get(`${urls.identity.groups.configurations.v1}`);
|
package/groups/interfaces.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IRole } from "../roles/interfaces";
|
|
2
|
+
import { GroupRelations } from "./enums";
|
|
2
3
|
export declare type IGetGroup = {
|
|
3
4
|
groupId: string;
|
|
4
5
|
};
|
|
@@ -6,12 +7,9 @@ export declare type IGroupUser = {
|
|
|
6
7
|
id: string;
|
|
7
8
|
email: string;
|
|
8
9
|
name: string;
|
|
9
|
-
phoneNumber?: string;
|
|
10
|
-
profileImage?: string;
|
|
11
10
|
profilePictureUrl: string | null;
|
|
12
|
-
tenantId: string;
|
|
13
|
-
tenantIds: string[];
|
|
14
11
|
activatedForTenant?: boolean;
|
|
12
|
+
createdAt: Date;
|
|
15
13
|
};
|
|
16
14
|
export declare type IGroupResponse = {
|
|
17
15
|
id: string;
|
|
@@ -51,10 +49,11 @@ export declare type IGroupConfigResponse = {
|
|
|
51
49
|
rolesEnabled: boolean;
|
|
52
50
|
};
|
|
53
51
|
export declare type IUpdateGroupRoles = {
|
|
54
|
-
groupId: string;
|
|
55
52
|
roleIds: string[];
|
|
56
53
|
};
|
|
57
54
|
export declare type IUpdateGroupUsers = {
|
|
58
|
-
groupId: string;
|
|
59
55
|
userIds: string[];
|
|
60
56
|
};
|
|
57
|
+
export declare type IGetGroupQueryOptions = {
|
|
58
|
+
_groupsRelations?: GroupRelations;
|
|
59
|
+
};
|
package/index.js
CHANGED
package/node/constants.js
CHANGED
|
@@ -90,12 +90,8 @@ const urls = {
|
|
|
90
90
|
v1: '/identity/resources/groups/v1/config'
|
|
91
91
|
},
|
|
92
92
|
v1: '/identity/resources/groups/v1',
|
|
93
|
-
roles:
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
users: {
|
|
97
|
-
v1: '/identity/resources/groups/v1/users'
|
|
98
|
-
}
|
|
93
|
+
roles: '/roles',
|
|
94
|
+
users: '/users'
|
|
99
95
|
}
|
|
100
96
|
},
|
|
101
97
|
team: {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GroupRelations = void 0;
|
|
7
|
+
let GroupRelations;
|
|
8
|
+
exports.GroupRelations = GroupRelations;
|
|
9
|
+
|
|
10
|
+
(function (GroupRelations) {
|
|
11
|
+
GroupRelations["roles"] = "roles";
|
|
12
|
+
GroupRelations["users"] = "users";
|
|
13
|
+
GroupRelations["rolesAndUsers"] = "rolesAndUsers";
|
|
14
|
+
})(GroupRelations || (exports.GroupRelations = GroupRelations = {}));
|
package/node/groups/index.js
CHANGED
|
@@ -19,6 +19,8 @@ exports.updateGroupConfiguration = updateGroupConfiguration;
|
|
|
19
19
|
|
|
20
20
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
21
21
|
|
|
22
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
23
|
+
|
|
22
24
|
var _constants = require("../constants");
|
|
23
25
|
|
|
24
26
|
var _fetch = require("../fetch");
|
|
@@ -27,12 +29,12 @@ const _excluded = ["groupId"];
|
|
|
27
29
|
|
|
28
30
|
async function getGroupById({
|
|
29
31
|
groupId
|
|
30
|
-
}) {
|
|
31
|
-
return (0, _fetch.Get)(`${_constants.urls.identity.groups.v1}/${groupId}
|
|
32
|
+
}, query) {
|
|
33
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.groups.v1}/${groupId}`, (0, _extends2.default)({}, query));
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
async function getGroups() {
|
|
35
|
-
return (0, _fetch.Get)(`${_constants.urls.identity.groups.v1}
|
|
36
|
+
async function getGroups(query) {
|
|
37
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.groups.v1}`, (0, _extends2.default)({}, query));
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
async function createGroup(body) {
|
|
@@ -51,20 +53,20 @@ async function deleteGroup(groupId) {
|
|
|
51
53
|
return (0, _fetch.Delete)(`${_constants.urls.identity.groups.v1}/${groupId}`);
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
async function addRolesToGroup(body) {
|
|
55
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.groups.
|
|
56
|
+
async function addRolesToGroup(groupId, body) {
|
|
57
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.groups.v1}/${groupId}/${_constants.urls.identity.groups.roles}`, body);
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
async function deleteRolesFromGroup(body) {
|
|
59
|
-
return (0, _fetch.Delete)(`${_constants.urls.identity.groups.
|
|
60
|
+
async function deleteRolesFromGroup(groupId, body) {
|
|
61
|
+
return (0, _fetch.Delete)(`${_constants.urls.identity.groups.v1}/${groupId}/${_constants.urls.identity.groups.roles}`, body);
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
async function addUsersToGroup(body) {
|
|
63
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.groups.
|
|
64
|
+
async function addUsersToGroup(groupId, body) {
|
|
65
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.groups.v1}/${groupId}/${_constants.urls.identity.groups.users}`, body);
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
async function deleteUsersFromGroup(body) {
|
|
67
|
-
return (0, _fetch.Delete)(`${_constants.urls.identity.groups.
|
|
68
|
+
async function deleteUsersFromGroup(groupId, body) {
|
|
69
|
+
return (0, _fetch.Delete)(`${_constants.urls.identity.groups.v1}/${groupId}/${_constants.urls.identity.groups.users}`, body);
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
async function getGroupConfiguration() {
|
package/node/index.js
CHANGED