@frontegg/rest-api 3.0.114 → 3.0.116

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
@@ -12,6 +12,9 @@ export declare const urls: {
12
12
  v1: string;
13
13
  v2: string;
14
14
  v3: string;
15
+ roles: {
16
+ v3: string;
17
+ };
15
18
  apiTokens: {
16
19
  v1: string;
17
20
  };
@@ -128,6 +131,9 @@ export declare const urls: {
128
131
  v1: string;
129
132
  };
130
133
  v2: string;
134
+ metadata: {
135
+ v2: string;
136
+ };
131
137
  };
132
138
  subTenants: {
133
139
  v1: string;
package/constants.js CHANGED
@@ -12,6 +12,9 @@ export const urls = {
12
12
  v1: '/identity/resources/users/v1',
13
13
  v2: '/identity/resources/users/v2',
14
14
  v3: '/identity/resources/users/v3',
15
+ roles: {
16
+ v3: '/identity/resources/users/v3/roles'
17
+ },
15
18
  apiTokens: {
16
19
  v1: '/identity/resources/users/api-tokens/v1'
17
20
  },
@@ -127,7 +130,10 @@ export const urls = {
127
130
  parents: {
128
131
  v1: '/tenants/resources/hierarchy/v1/parents'
129
132
  },
130
- v2: '/tenants/resources/hierarchy/v2'
133
+ v2: '/tenants/resources/hierarchy/v2',
134
+ metadata: {
135
+ v2: '/tenants/resources/hierarchy/v2/metadata'
136
+ }
131
137
  },
132
138
  subTenants: {
133
139
  v1: '/tenants/resources/sub-tenants/v1'
@@ -222,7 +228,7 @@ export const urls = {
222
228
  temp: '/directory/resources/scim/temp'
223
229
  },
224
230
  entitlements: {
225
- v1: '/entitlements/check/v1'
231
+ v1: '/entitlements/api/v1/user-entitlements'
226
232
  }
227
233
  };
228
234
  export const GENERIC_ERROR_MESSAGE = `We're facing some difficulties, Please try again`;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.114
1
+ /** @license Frontegg v3.0.116
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
@@ -18,6 +18,9 @@ const urls = {
18
18
  v1: '/identity/resources/users/v1',
19
19
  v2: '/identity/resources/users/v2',
20
20
  v3: '/identity/resources/users/v3',
21
+ roles: {
22
+ v3: '/identity/resources/users/v3/roles'
23
+ },
21
24
  apiTokens: {
22
25
  v1: '/identity/resources/users/api-tokens/v1'
23
26
  },
@@ -133,7 +136,10 @@ const urls = {
133
136
  parents: {
134
137
  v1: '/tenants/resources/hierarchy/v1/parents'
135
138
  },
136
- v2: '/tenants/resources/hierarchy/v2'
139
+ v2: '/tenants/resources/hierarchy/v2',
140
+ metadata: {
141
+ v2: '/tenants/resources/hierarchy/v2/metadata'
142
+ }
137
143
  },
138
144
  subTenants: {
139
145
  v1: '/tenants/resources/sub-tenants/v1'
@@ -228,7 +234,7 @@ const urls = {
228
234
  temp: '/directory/resources/scim/temp'
229
235
  },
230
236
  entitlements: {
231
- v1: '/entitlements/check/v1'
237
+ v1: '/entitlements/api/v1/user-entitlements'
232
238
  }
233
239
  };
234
240
  exports.urls = urls;
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.114
1
+ /** @license Frontegg v3.0.116
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.
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.getHierarchyMetadata = getHierarchyMetadata;
6
7
  exports.getParentTenants = getParentTenants;
7
8
  exports.getSubTenants = getSubTenants;
8
9
  exports.getSubTenantsAsTree = getSubTenantsAsTree;
@@ -51,4 +52,10 @@ async function searchSubTenants(params, options) {
51
52
  return (0, _fetch.Get)(_constants.urls.tenants.hierarchy.v2, params, {
52
53
  headers: (0, _fetch.extractHeadersFromOptions)(options)
53
54
  });
55
+ }
56
+
57
+ async function getHierarchyMetadata(params, options) {
58
+ return (0, _fetch.Get)(_constants.urls.tenants.hierarchy.metadata.v2, params, {
59
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
60
+ });
54
61
  }
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.GetUserJwt = GetUserJwt;
7
+ exports.getUsersRoles = getUsersRoles;
7
8
  exports.getUsersV3 = getUsersV3;
8
9
 
9
10
  var _fetch = require("../fetch");
@@ -18,4 +19,10 @@ async function getUsersV3(queryParams, options) {
18
19
  return (0, _fetch.Get)(_constants.urls.identity.users.v3, queryParams, {
19
20
  headers: (0, _fetch.extractHeadersFromOptions)(options)
20
21
  });
22
+ }
23
+
24
+ async function getUsersRoles(queryParams, options) {
25
+ return (0, _fetch.Get)(_constants.urls.identity.users.roles.v3, queryParams, {
26
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
27
+ });
21
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.114",
3
+ "version": "3.0.116",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -1,4 +1,4 @@
1
- import { IGetTenantsUserCountRequest, IGetTenantsUserCountResponse, IParentTenant, ISubTenant, ISubTenantTree, ISwitchTenant, ITenantsResponse, SearchSubTenantsParams, SearchSubTenantsResponse } from "./interfaces";
1
+ import { GetHierarchyMetadataParams, GetHierarchyMetadataResponse, IGetTenantsUserCountRequest, IGetTenantsUserCountResponse, IParentTenant, ISubTenant, ISubTenantTree, ISwitchTenant, ITenantsResponse, SearchSubTenantsParams, SearchSubTenantsResponse } from "./interfaces";
2
2
  import { FronteggPaginationWrapper, UserJwtOptions } from "../interfaces";
3
3
  /**
4
4
  * switch logged in user to specific tenant by providing tenantId.
@@ -33,3 +33,4 @@ export declare function getSubTenantsAsTree(options?: UserJwtOptions): Promise<I
33
33
  export declare function getParentTenants(options?: UserJwtOptions): Promise<IParentTenant[]>;
34
34
  export declare function getTenantsUsersCount(body: IGetTenantsUserCountRequest, options?: UserJwtOptions): Promise<IGetTenantsUserCountResponse[]>;
35
35
  export declare function searchSubTenants(params: SearchSubTenantsParams, options?: UserJwtOptions): Promise<FronteggPaginationWrapper<SearchSubTenantsResponse>>;
36
+ export declare function getHierarchyMetadata(params: GetHierarchyMetadataParams, options?: UserJwtOptions): Promise<GetHierarchyMetadataResponse[]>;
package/tenants/index.js CHANGED
@@ -30,4 +30,9 @@ export async function searchSubTenants(params, options) {
30
30
  return Get(urls.tenants.hierarchy.v2, params, {
31
31
  headers: extractHeadersFromOptions(options)
32
32
  });
33
+ }
34
+ export async function getHierarchyMetadata(params, options) {
35
+ return Get(urls.tenants.hierarchy.metadata.v2, params, {
36
+ headers: extractHeadersFromOptions(options)
37
+ });
33
38
  }
@@ -93,8 +93,20 @@ export interface SearchSubTenantsParams {
93
93
  _sortBy?: TenantSortByEnum;
94
94
  _order?: PaginationOrderEnum;
95
95
  }
96
+ export interface SearchSubTenantMetadata {
97
+ isParent?: boolean;
98
+ }
96
99
  export interface SearchSubTenantsResponse {
97
100
  tenantId: string;
98
101
  name: string;
99
102
  createdAt: Date;
103
+ metadata: SearchSubTenantMetadata;
104
+ }
105
+ export interface GetHierarchyMetadataParams {
106
+ _tenantIds: string[];
107
+ }
108
+ export interface GetHierarchyMetadataResponse {
109
+ tenantId: string;
110
+ totalSubTenants: number;
111
+ isParent: boolean;
100
112
  }
package/users/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { GetUserJwtRequestDto, GetUserJwtResponseDto, ISearchUserQueryParamsV3, IUsersV3Data } from "./interfaces";
1
+ import { GetUserJwtRequestDto, GetUserJwtResponseDto, GetUserRolesResponse, GetUsersRolesParams, ISearchUserQueryParamsV3, IUsersV3Data } from "./interfaces";
2
2
  import { FronteggPaginationWrapper, UserJwtOptions } from "../interfaces";
3
3
  export declare function GetUserJwt(body: GetUserJwtRequestDto): Promise<GetUserJwtResponseDto>;
4
4
  export declare function getUsersV3(queryParams: ISearchUserQueryParamsV3, options?: UserJwtOptions): Promise<FronteggPaginationWrapper<IUsersV3Data>>;
5
+ export declare function getUsersRoles(queryParams: GetUsersRolesParams, options?: UserJwtOptions): Promise<GetUserRolesResponse[]>;
package/users/index.js CHANGED
@@ -7,4 +7,9 @@ export async function getUsersV3(queryParams, options) {
7
7
  return Get(urls.identity.users.v3, queryParams, {
8
8
  headers: extractHeadersFromOptions(options)
9
9
  });
10
+ }
11
+ export async function getUsersRoles(queryParams, options) {
12
+ return Get(urls.identity.users.roles.v3, queryParams, {
13
+ headers: extractHeadersFromOptions(options)
14
+ });
10
15
  }
@@ -45,3 +45,12 @@ export interface IUsersV3Data {
45
45
  lastLogin?: Date;
46
46
  subAccountAccessAllowed?: boolean;
47
47
  }
48
+ export interface GetUsersRolesParams {
49
+ ids: string[];
50
+ }
51
+ export interface GetUserRolesResponse {
52
+ vendorId: string;
53
+ tenantId: string;
54
+ userId: string;
55
+ roleIds: string[];
56
+ }