@frontegg/rest-api 3.0.126 → 3.0.127

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.126
1
+ /** @license Frontegg v3.0.127
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.126
1
+ /** @license Frontegg v3.0.127
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.
@@ -9,6 +9,7 @@ exports.GetUserJwt = GetUserJwt;
9
9
  exports.getCurrentUserTenantsV3 = getCurrentUserTenantsV3;
10
10
  exports.getUsersGroups = getUsersGroups;
11
11
  exports.getUsersRoles = getUsersRoles;
12
+ exports.getUsersV2 = getUsersV2;
12
13
  exports.getUsersV3 = getUsersV3;
13
14
 
14
15
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
@@ -21,6 +22,12 @@ async function GetUserJwt(body) {
21
22
  return (0, _fetch.Post)(`${_constants.urls.identity.users.v3}/me/token`, body);
22
23
  }
23
24
 
25
+ async function getUsersV2(queryParams, options) {
26
+ return (0, _fetch.Get)(_constants.urls.identity.users.v2, queryParams, {
27
+ headers: (0, _fetch.extractHeadersFromOptions)(options)
28
+ });
29
+ }
30
+
24
31
  async function getUsersV3(queryParams, options) {
25
32
  return (0, _fetch.Get)(_constants.urls.identity.users.v3, queryParams, {
26
33
  headers: (0, _fetch.extractHeadersFromOptions)(options)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.126",
3
+ "version": "3.0.127",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
package/users/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { GetCurrentUserTenantsResponse, GetUserGroupsParams, GetUserGroupsResponse, GetUserJwtRequestDto, GetUserJwtResponseDto, GetUserRolesResponse, GetUsersRolesParams, ISearchUserQueryParamsV3, IUsersV3Data } from "./interfaces";
2
- import { FronteggPaginationWrapper, UserJwtOptions } from "../interfaces";
1
+ import { GetCurrentUserTenantsResponse, GetUserGroupsParams, GetUserGroupsResponse, GetUserJwtRequestDto, GetUserJwtResponseDto, GetUserRolesResponse, GetUsersRolesParams, IGetUsersV2Response, ISearchUserQueryParamsV2, ISearchUserQueryParamsV3, IUsersV3Data } from './interfaces';
2
+ import { FronteggPaginationWrapper, UserJwtOptions } from '../interfaces';
3
3
  export declare function GetUserJwt(body: GetUserJwtRequestDto): Promise<GetUserJwtResponseDto>;
4
+ export declare function getUsersV2(queryParams: ISearchUserQueryParamsV2, options?: UserJwtOptions): Promise<FronteggPaginationWrapper<IGetUsersV2Response>>;
4
5
  export declare function getUsersV3(queryParams: ISearchUserQueryParamsV3, options?: UserJwtOptions): Promise<FronteggPaginationWrapper<IUsersV3Data>>;
5
6
  export declare function getUsersRoles(queryParams: GetUsersRolesParams, options?: UserJwtOptions): Promise<GetUserRolesResponse[]>;
6
7
  export declare function getUsersGroups(queryParams: GetUserGroupsParams, options?: UserJwtOptions): Promise<GetUserGroupsResponse[]>;
package/users/index.js CHANGED
@@ -1,9 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { extractHeadersFromOptions, Get, Post } from "../fetch";
3
- import { urls } from "../constants";
2
+ import { extractHeadersFromOptions, Get, Post } from '../fetch';
3
+ import { urls } from '../constants';
4
4
  export async function GetUserJwt(body) {
5
5
  return Post(`${urls.identity.users.v3}/me/token`, body);
6
6
  }
7
+ export async function getUsersV2(queryParams, options) {
8
+ return Get(urls.identity.users.v2, queryParams, {
9
+ headers: extractHeadersFromOptions(options)
10
+ });
11
+ }
7
12
  export async function getUsersV3(queryParams, options) {
8
13
  return Get(urls.identity.users.v3, queryParams, {
9
14
  headers: extractHeadersFromOptions(options)
@@ -1,5 +1,8 @@
1
1
  import { PaginationOrderEnum } from '../interfaces';
2
2
  import { ITenantsResponse } from '../tenants/interfaces';
3
+ import { IRole } from '../roles/interfaces';
4
+ import { ITeamUserPermission, UserManagedByEnum } from '../teams/interfaces';
5
+ import { IGroupResponse } from '../groups/interfaces';
3
6
  export declare enum SortByEnum {
4
7
  createdAt = "createdAt",
5
8
  name = "name",
@@ -18,14 +21,21 @@ export interface GetUserJwtResponseDto {
18
21
  expires: string;
19
22
  expiresIn: number;
20
23
  }
21
- export interface ISearchUserQueryParamsV3 {
24
+ export interface IGetUserQueryParams {
22
25
  _limit?: number;
23
26
  _offset?: number;
24
- _email?: string;
25
- _tenantId?: string;
26
27
  ids?: string;
27
28
  _sortBy?: SortByEnum;
28
29
  _order?: PaginationOrderEnum;
30
+ }
31
+ export interface ISearchUserQueryParamsV2 extends IGetUserQueryParams {
32
+ _filter?: string;
33
+ metadata?: string;
34
+ _includeSubTenants?: boolean;
35
+ }
36
+ export interface ISearchUserQueryParamsV3 extends IGetUserQueryParams {
37
+ _email?: string;
38
+ _tenantId?: string;
29
39
  _includeSubTenants?: boolean;
30
40
  }
31
41
  export interface IBaseUserData {
@@ -34,10 +44,14 @@ export interface IBaseUserData {
34
44
  name?: string;
35
45
  profilePictureUrl?: string;
36
46
  }
37
- export interface IUsersV3Data extends IBaseUserData {
38
- sub?: string;
39
- verified?: boolean;
40
- mfaEnrolled?: boolean;
47
+ export interface IUserTenantData {
48
+ tenantId: string;
49
+ roles: IRole[];
50
+ }
51
+ export interface IBaseGetUserResponse extends IBaseUserData {
52
+ sub: string;
53
+ verified: boolean;
54
+ mfaEnrolled: boolean;
41
55
  mfaBypass?: boolean;
42
56
  phoneNumber?: string;
43
57
  provider?: string;
@@ -45,13 +59,21 @@ export interface IUsersV3Data extends IBaseUserData {
45
59
  tenantIds?: string[];
46
60
  activatedForTenant?: boolean;
47
61
  isLocked?: boolean;
48
- invisible?: boolean;
49
- superUser?: boolean;
62
+ tenants: IUserTenantData[];
63
+ managedBy?: UserManagedByEnum;
64
+ invisible?: true;
65
+ superUser?: true;
50
66
  metadata?: string;
51
67
  createdAt?: Date;
52
68
  lastLogin?: Date;
53
69
  subAccountAccessAllowed?: boolean;
54
70
  }
71
+ export interface IGetUsersV2Response extends IBaseGetUserResponse {
72
+ roles: IRole[];
73
+ permissions: ITeamUserPermission[];
74
+ groups?: Pick<IGroupResponse, 'id' | 'roles'>[];
75
+ }
76
+ export declare type IUsersV3Data = IBaseGetUserResponse;
55
77
  export interface GetUsersRolesParams {
56
78
  ids: string[];
57
79
  }