@frontegg/rest-api 3.0.116 → 3.0.118

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.116
1
+ /** @license Frontegg v3.0.118
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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.116
1
+ /** @license Frontegg v3.0.118
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.
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.getHierarchyMetadata = getHierarchyMetadata;
7
9
  exports.getParentTenants = getParentTenants;
10
+ exports.getParentTenantsById = getParentTenantsById;
8
11
  exports.getSubTenants = getSubTenants;
9
12
  exports.getSubTenantsAsTree = getSubTenantsAsTree;
10
13
  exports.getTenants = getTenants;
@@ -12,6 +15,8 @@ exports.getTenantsUsersCount = getTenantsUsersCount;
12
15
  exports.searchSubTenants = searchSubTenants;
13
16
  exports.switchTenant = switchTenant;
14
17
 
18
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
19
+
15
20
  var _fetch = require("../fetch");
16
21
 
17
22
  var _constants = require("../constants");
@@ -42,6 +47,12 @@ async function getParentTenants(options) {
42
47
  });
43
48
  }
44
49
 
50
+ async function getParentTenantsById(tenantId, options) {
51
+ return (0, _fetch.Get)(`${_constants.urls.tenants.hierarchy.parents.v1}/${tenantId}`, undefined, {
52
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
53
+ });
54
+ }
55
+
45
56
  async function getTenantsUsersCount(body, options) {
46
57
  return (0, _fetch.Post)(`${_constants.urls.identity.tenants.users.v1}/count`, body, {
47
58
  headers: (0, _fetch.extractHeadersFromOptions)(options)
@@ -55,7 +66,9 @@ async function searchSubTenants(params, options) {
55
66
  }
56
67
 
57
68
  async function getHierarchyMetadata(params, options) {
58
- return (0, _fetch.Get)(_constants.urls.tenants.hierarchy.metadata.v2, params, {
69
+ return (0, _fetch.Get)(_constants.urls.tenants.hierarchy.metadata.v2, (0, _extends2.default)({}, params, {
70
+ _tenantIds: params._tenantIds.join(',')
71
+ }), {
59
72
  headers: (0, _fetch.extractHeadersFromOptions)(options)
60
73
  });
61
74
  }
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -7,6 +9,8 @@ exports.GetUserJwt = GetUserJwt;
7
9
  exports.getUsersRoles = getUsersRoles;
8
10
  exports.getUsersV3 = getUsersV3;
9
11
 
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
10
14
  var _fetch = require("../fetch");
11
15
 
12
16
  var _constants = require("../constants");
@@ -22,7 +26,9 @@ async function getUsersV3(queryParams, options) {
22
26
  }
23
27
 
24
28
  async function getUsersRoles(queryParams, options) {
25
- return (0, _fetch.Get)(_constants.urls.identity.users.roles.v3, queryParams, {
29
+ return (0, _fetch.Get)(_constants.urls.identity.users.roles.v3, (0, _extends2.default)({}, queryParams, {
30
+ ids: queryParams.ids.join(',')
31
+ }), {
26
32
  headers: (0, _fetch.extractHeadersFromOptions)(options)
27
33
  });
28
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.116",
3
+ "version": "3.0.118",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -31,6 +31,7 @@ export declare function getSubTenantsAsTree(options?: UserJwtOptions): Promise<I
31
31
  * ``authorized user``
32
32
  */
33
33
  export declare function getParentTenants(options?: UserJwtOptions): Promise<IParentTenant[]>;
34
+ export declare function getParentTenantsById(tenantId: string, options?: UserJwtOptions): Promise<IParentTenant[]>;
34
35
  export declare function getTenantsUsersCount(body: IGetTenantsUserCountRequest, options?: UserJwtOptions): Promise<IGetTenantsUserCountResponse[]>;
35
36
  export declare function searchSubTenants(params: SearchSubTenantsParams, options?: UserJwtOptions): Promise<FronteggPaginationWrapper<SearchSubTenantsResponse>>;
36
37
  export declare function getHierarchyMetadata(params: GetHierarchyMetadataParams, options?: UserJwtOptions): Promise<GetHierarchyMetadataResponse[]>;
package/tenants/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import { extractHeadersFromOptions, Get, Post, Put } from "../fetch";
2
3
  import { urls } from "../constants";
3
4
  export async function switchTenant(body) {
@@ -21,6 +22,11 @@ export async function getParentTenants(options) {
21
22
  headers: extractHeadersFromOptions(options)
22
23
  });
23
24
  }
25
+ export async function getParentTenantsById(tenantId, options) {
26
+ return Get(`${urls.tenants.hierarchy.parents.v1}/${tenantId}`, undefined, {
27
+ headers: extractHeadersFromOptions(options)
28
+ });
29
+ }
24
30
  export async function getTenantsUsersCount(body, options) {
25
31
  return Post(`${urls.identity.tenants.users.v1}/count`, body, {
26
32
  headers: extractHeadersFromOptions(options)
@@ -32,7 +38,9 @@ export async function searchSubTenants(params, options) {
32
38
  });
33
39
  }
34
40
  export async function getHierarchyMetadata(params, options) {
35
- return Get(urls.tenants.hierarchy.metadata.v2, params, {
41
+ return Get(urls.tenants.hierarchy.metadata.v2, _extends({}, params, {
42
+ _tenantIds: params._tenantIds.join(',')
43
+ }), {
36
44
  headers: extractHeadersFromOptions(options)
37
45
  });
38
46
  }
package/users/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import { extractHeadersFromOptions, Get, Post } from "../fetch";
2
3
  import { urls } from "../constants";
3
4
  export async function GetUserJwt(body) {
@@ -9,7 +10,9 @@ export async function getUsersV3(queryParams, options) {
9
10
  });
10
11
  }
11
12
  export async function getUsersRoles(queryParams, options) {
12
- return Get(urls.identity.users.roles.v3, queryParams, {
13
+ return Get(urls.identity.users.roles.v3, _extends({}, queryParams, {
14
+ ids: queryParams.ids.join(',')
15
+ }), {
13
16
  headers: extractHeadersFromOptions(options)
14
17
  });
15
18
  }
@@ -27,7 +27,13 @@ export interface ISearchUserQueryParamsV3 {
27
27
  _order?: PaginationOrderEnum;
28
28
  _includeSubTenants?: boolean;
29
29
  }
30
- export interface IUsersV3Data {
30
+ export interface IBaseUserData {
31
+ id: string;
32
+ email: string;
33
+ name?: string;
34
+ profilePictureUrl?: string;
35
+ }
36
+ export interface IUsersV3Data extends IBaseUserData {
31
37
  sub?: string;
32
38
  verified?: boolean;
33
39
  mfaEnrolled?: boolean;