@frontegg/rest-api 3.1.59 → 3.1.60

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 CHANGED
@@ -105,6 +105,7 @@ export declare const urls: {
105
105
  };
106
106
  roles: {
107
107
  v1: string;
108
+ v2: string;
108
109
  };
109
110
  subTenants: {
110
111
  v1: string;
package/constants.js CHANGED
@@ -104,7 +104,8 @@ export const urls = {
104
104
  }
105
105
  },
106
106
  roles: {
107
- v1: '/identity/resources/roles/v1'
107
+ v1: '/identity/resources/roles/v1',
108
+ v2: '/identity/resources/roles/v2'
108
109
  },
109
110
  subTenants: {
110
111
  v1: '/identity/resources/sub-tenants/users/v1',
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.1.59
1
+ /** @license Frontegg v3.1.60
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/node/constants.js CHANGED
@@ -110,7 +110,8 @@ const urls = {
110
110
  }
111
111
  },
112
112
  roles: {
113
- v1: '/identity/resources/roles/v1'
113
+ v1: '/identity/resources/roles/v1',
114
+ v2: '/identity/resources/roles/v2'
114
115
  },
115
116
  subTenants: {
116
117
  v1: '/identity/resources/sub-tenants/users/v1',
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.1.59
1
+ /** @license Frontegg v3.1.60
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.1.59",
3
+ "version": "3.1.60",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
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
  }
@@ -7,6 +7,7 @@ export declare type IRole = {
7
7
  permissions: string[];
8
8
  tenantId?: string;
9
9
  vendorId: string;
10
+ level?: number;
10
11
  createdAt: Date;
11
12
  updatedAt: Date;
12
13
  };
@@ -29,7 +30,7 @@ export declare type IRolePermissionCategory = {
29
30
  createdAt: Date;
30
31
  updatedAt: Date;
31
32
  };
32
- export declare type IAddRole = {
33
+ export declare type IAddRoleBase = {
33
34
  key: string;
34
35
  name: string;
35
36
  description: string;
@@ -37,6 +38,10 @@ export declare type IAddRole = {
37
38
  level: number;
38
39
  permissions: string[];
39
40
  };
41
+ export declare type IAddRole = IAddRoleBase;
42
+ export declare type IAddRoleV2 = IAddRoleBase & {
43
+ baseRoleId: string;
44
+ };
40
45
  export declare type IUpdateRole = {
41
46
  roleId: string;
42
47
  key?: string;