@frontegg/rest-api 3.1.59 → 3.1.61
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 +1 -0
- package/constants.js +2 -1
- package/index.js +1 -1
- package/node/constants.js +2 -1
- package/node/index.js +1 -1
- package/node/roles/index.js +5 -0
- package/node/roles/interfaces.js +10 -1
- package/package.json +1 -1
- package/roles/index.d.ts +6 -1
- package/roles/index.js +3 -0
- package/roles/interfaces.d.ts +12 -1
- package/roles/interfaces.js +7 -1
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
package/index.js
CHANGED
package/node/constants.js
CHANGED
package/node/index.js
CHANGED
package/node/roles/index.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.addRole = addRole;
|
|
9
|
+
exports.addRoleV2 = addRoleV2;
|
|
9
10
|
exports.attachPermissionToRoles = attachPermissionToRoles;
|
|
10
11
|
exports.attachPermissionsToRole = attachPermissionsToRole;
|
|
11
12
|
exports.deleteRole = deleteRole;
|
|
@@ -68,4 +69,8 @@ async function attachPermissionToRoles(_ref3) {
|
|
|
68
69
|
|
|
69
70
|
async function getPermissionCategories() {
|
|
70
71
|
return (0, _fetch.Get)(`${_constants.urls.identity.permissions.v1}/categories`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function addRoleV2(body) {
|
|
75
|
+
return (0, _fetch.Post)(_constants.urls.identity.roles.v2, body);
|
|
71
76
|
}
|
package/node/roles/interfaces.js
CHANGED
|
@@ -2,4 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
});
|
|
5
|
+
});
|
|
6
|
+
exports.PermissionAssignmentTypeEnum = void 0;
|
|
7
|
+
let PermissionAssignmentTypeEnum;
|
|
8
|
+
exports.PermissionAssignmentTypeEnum = PermissionAssignmentTypeEnum;
|
|
9
|
+
|
|
10
|
+
(function (PermissionAssignmentTypeEnum) {
|
|
11
|
+
PermissionAssignmentTypeEnum["NEVER"] = "NEVER";
|
|
12
|
+
PermissionAssignmentTypeEnum["ALWAYS"] = "ALWAYS";
|
|
13
|
+
PermissionAssignmentTypeEnum["ASSIGNABLE"] = "ASSIGNABLE";
|
|
14
|
+
})(PermissionAssignmentTypeEnum || (exports.PermissionAssignmentTypeEnum = PermissionAssignmentTypeEnum = {}));
|
package/package.json
CHANGED
package/roles/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRole, IRolePermission, IRolePermissionCategory, IAddRole, IDeleteRole, IUpdateRole, IAttachPermissionsToRole, IAttachPermissionToRoles } from './interfaces';
|
|
1
|
+
import { IRole, IRolePermission, IRolePermissionCategory, IAddRole, IDeleteRole, IUpdateRole, IAttachPermissionsToRole, IAttachPermissionToRoles, IAddRoleV2 } from './interfaces';
|
|
2
2
|
/**
|
|
3
3
|
* Gets tenant related roles
|
|
4
4
|
*/
|
|
@@ -32,3 +32,8 @@ export declare function attachPermissionToRoles({ permissionId, ...body }: IAtta
|
|
|
32
32
|
* Gets all vendor categories including the permissions
|
|
33
33
|
*/
|
|
34
34
|
export declare function getPermissionCategories(): Promise<IRolePermissionCategory[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Adds tenant related roles v2
|
|
37
|
+
* @param body: IAddRoleV2
|
|
38
|
+
*/
|
|
39
|
+
export declare function addRoleV2(body: IAddRoleV2): Promise<IRole>;
|
package/roles/index.js
CHANGED
|
@@ -44,4 +44,7 @@ export async function attachPermissionToRoles(_ref3) {
|
|
|
44
44
|
}
|
|
45
45
|
export async function getPermissionCategories() {
|
|
46
46
|
return Get(`${urls.identity.permissions.v1}/categories`);
|
|
47
|
+
}
|
|
48
|
+
export async function addRoleV2(body) {
|
|
49
|
+
return Post(urls.identity.roles.v2, body);
|
|
47
50
|
}
|
package/roles/interfaces.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export declare enum PermissionAssignmentTypeEnum {
|
|
2
|
+
NEVER = "NEVER",
|
|
3
|
+
ALWAYS = "ALWAYS",
|
|
4
|
+
ASSIGNABLE = "ASSIGNABLE"
|
|
5
|
+
}
|
|
1
6
|
export declare type IRole = {
|
|
2
7
|
id: string;
|
|
3
8
|
key: string;
|
|
@@ -7,6 +12,7 @@ export declare type IRole = {
|
|
|
7
12
|
permissions: string[];
|
|
8
13
|
tenantId?: string;
|
|
9
14
|
vendorId: string;
|
|
15
|
+
level?: number;
|
|
10
16
|
createdAt: Date;
|
|
11
17
|
updatedAt: Date;
|
|
12
18
|
};
|
|
@@ -19,6 +25,7 @@ export declare type IRolePermission = {
|
|
|
19
25
|
fePermission: boolean;
|
|
20
26
|
createdAt: Date;
|
|
21
27
|
updatedAt: Date;
|
|
28
|
+
assignmentType?: PermissionAssignmentTypeEnum;
|
|
22
29
|
};
|
|
23
30
|
export declare type IRolePermissionCategory = {
|
|
24
31
|
id: string;
|
|
@@ -29,7 +36,7 @@ export declare type IRolePermissionCategory = {
|
|
|
29
36
|
createdAt: Date;
|
|
30
37
|
updatedAt: Date;
|
|
31
38
|
};
|
|
32
|
-
export declare type
|
|
39
|
+
export declare type IAddRoleBase = {
|
|
33
40
|
key: string;
|
|
34
41
|
name: string;
|
|
35
42
|
description: string;
|
|
@@ -37,6 +44,10 @@ export declare type IAddRole = {
|
|
|
37
44
|
level: number;
|
|
38
45
|
permissions: string[];
|
|
39
46
|
};
|
|
47
|
+
export declare type IAddRole = IAddRoleBase;
|
|
48
|
+
export declare type IAddRoleV2 = IAddRoleBase & {
|
|
49
|
+
baseRoleId: string;
|
|
50
|
+
};
|
|
40
51
|
export declare type IUpdateRole = {
|
|
41
52
|
roleId: string;
|
|
42
53
|
key?: string;
|
package/roles/interfaces.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export let PermissionAssignmentTypeEnum;
|
|
2
|
+
|
|
3
|
+
(function (PermissionAssignmentTypeEnum) {
|
|
4
|
+
PermissionAssignmentTypeEnum["NEVER"] = "NEVER";
|
|
5
|
+
PermissionAssignmentTypeEnum["ALWAYS"] = "ALWAYS";
|
|
6
|
+
PermissionAssignmentTypeEnum["ASSIGNABLE"] = "ASSIGNABLE";
|
|
7
|
+
})(PermissionAssignmentTypeEnum || (PermissionAssignmentTypeEnum = {}));
|