@frontegg/rest-api 3.0.80 → 3.0.82

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
@@ -84,12 +84,8 @@ export declare const urls: {
84
84
  v1: string;
85
85
  };
86
86
  v1: string;
87
- roles: {
88
- v1: string;
89
- };
90
- users: {
91
- v1: string;
92
- };
87
+ roles: string;
88
+ users: string;
93
89
  };
94
90
  };
95
91
  team: {
package/constants.js CHANGED
@@ -84,12 +84,8 @@ export const urls = {
84
84
  v1: '/identity/resources/groups/v1/config'
85
85
  },
86
86
  v1: '/identity/resources/groups/v1',
87
- roles: {
88
- v1: '/identity/resources/groups/v1/roles'
89
- },
90
- users: {
91
- v1: '/identity/resources/groups/v1/users'
92
- }
87
+ roles: '/roles',
88
+ users: '/users'
93
89
  }
94
90
  },
95
91
  team: {
@@ -0,0 +1,5 @@
1
+ export declare enum GroupRelations {
2
+ roles = "roles",
3
+ users = "users",
4
+ rolesAndUsers = "rolesAndUsers"
5
+ }
@@ -0,0 +1,7 @@
1
+ export let GroupRelations;
2
+
3
+ (function (GroupRelations) {
4
+ GroupRelations["roles"] = "roles";
5
+ GroupRelations["users"] = "users";
6
+ GroupRelations["rolesAndUsers"] = "rolesAndUsers";
7
+ })(GroupRelations || (GroupRelations = {}));
package/groups/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { ICreateGroup, ICreateGroupResponse, IGetGroup, IGroupConfigResponse, IGroupResponse, IUpdateGroup, IUpdateGroupConfig, IUpdateGroupRoles, IUpdateGroupUsers } from "./interfaces";
1
+ import { ICreateGroup, ICreateGroupResponse, IGetGroup, IGetGroupQueryOptions, IGroupConfigResponse, IGroupResponse, IUpdateGroup, IUpdateGroupConfig, IUpdateGroupRoles, IUpdateGroupUsers } from "./interfaces";
2
2
  /**
3
3
  * Get group by given id
4
4
  */
5
- export declare function getGroupById({ groupId, }: IGetGroup): Promise<IGroupResponse>;
5
+ export declare function getGroupById({ groupId, }: IGetGroup, query?: IGetGroupQueryOptions): Promise<IGroupResponse>;
6
6
  /**
7
7
  * Get all tenant groups
8
8
  */
9
- export declare function getGroups(): Promise<IGroupResponse[]>;
9
+ export declare function getGroups(query?: IGetGroupQueryOptions): Promise<IGroupResponse[]>;
10
10
  /**
11
11
  * Create new group
12
12
  */
@@ -22,19 +22,19 @@ export declare function deleteGroup(groupId: string): Promise<void>;
22
22
  /**
23
23
  * Add roles to existing group
24
24
  */
25
- export declare function addRolesToGroup(body: IUpdateGroupRoles): Promise<void>;
25
+ export declare function addRolesToGroup(groupId: string, body: IUpdateGroupRoles): Promise<void>;
26
26
  /**
27
27
  * Delete roles from existing group
28
28
  */
29
- export declare function deleteRolesFromGroup(body: IUpdateGroupRoles): Promise<void>;
29
+ export declare function deleteRolesFromGroup(groupId: string, body: IUpdateGroupRoles): Promise<void>;
30
30
  /**
31
31
  * Add users to existing group
32
32
  */
33
- export declare function addUsersToGroup(body: IUpdateGroupUsers): Promise<void>;
33
+ export declare function addUsersToGroup(groupId: string, body: IUpdateGroupUsers): Promise<void>;
34
34
  /**
35
35
  * Delete users from existing group
36
36
  */
37
- export declare function deleteUsersFromGroup(body: IUpdateGroupUsers): Promise<void>;
37
+ export declare function deleteUsersFromGroup(groupId: string, body: IUpdateGroupUsers): Promise<void>;
38
38
  /**
39
39
  * Get or create default groups configuration
40
40
  */
package/groups/index.js CHANGED
@@ -1,14 +1,15 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
3
  const _excluded = ["groupId"];
3
4
  import { urls } from "../constants";
4
5
  import { Delete, Get, Patch, Post } from "../fetch";
5
6
  export async function getGroupById({
6
7
  groupId
7
- }) {
8
- return Get(`${urls.identity.groups.v1}/${groupId}`);
8
+ }, query) {
9
+ return Get(`${urls.identity.groups.v1}/${groupId}`, _extends({}, query));
9
10
  }
10
- export async function getGroups() {
11
- return Get(`${urls.identity.groups.v1}`);
11
+ export async function getGroups(query) {
12
+ return Get(`${urls.identity.groups.v1}`, _extends({}, query));
12
13
  }
13
14
  export async function createGroup(body) {
14
15
  return Post(`${urls.identity.groups.v1}`, body);
@@ -24,17 +25,17 @@ export async function updateGroup(_ref) {
24
25
  export async function deleteGroup(groupId) {
25
26
  return Delete(`${urls.identity.groups.v1}/${groupId}`);
26
27
  }
27
- export async function addRolesToGroup(body) {
28
- return Post(`${urls.identity.groups.roles.v1}`, body);
28
+ export async function addRolesToGroup(groupId, body) {
29
+ return Post(`${urls.identity.groups.v1}/${groupId}/${urls.identity.groups.roles}`, body);
29
30
  }
30
- export async function deleteRolesFromGroup(body) {
31
- return Delete(`${urls.identity.groups.roles.v1}`, body);
31
+ export async function deleteRolesFromGroup(groupId, body) {
32
+ return Delete(`${urls.identity.groups.v1}/${groupId}/${urls.identity.groups.roles}`, body);
32
33
  }
33
- export async function addUsersToGroup(body) {
34
- return Post(`${urls.identity.groups.users.v1}`, body);
34
+ export async function addUsersToGroup(groupId, body) {
35
+ return Post(`${urls.identity.groups.v1}/${groupId}/${urls.identity.groups.users}`, body);
35
36
  }
36
- export async function deleteUsersFromGroup(body) {
37
- return Delete(`${urls.identity.groups.users.v1}`, body);
37
+ export async function deleteUsersFromGroup(groupId, body) {
38
+ return Delete(`${urls.identity.groups.v1}/${groupId}/${urls.identity.groups.users}`, body);
38
39
  }
39
40
  export async function getGroupConfiguration() {
40
41
  return Get(`${urls.identity.groups.configurations.v1}`);
@@ -1,4 +1,5 @@
1
1
  import { IRole } from "../roles/interfaces";
2
+ import { GroupRelations } from "./enums";
2
3
  export declare type IGetGroup = {
3
4
  groupId: string;
4
5
  };
@@ -6,12 +7,9 @@ export declare type IGroupUser = {
6
7
  id: string;
7
8
  email: string;
8
9
  name: string;
9
- phoneNumber?: string;
10
- profileImage?: string;
11
10
  profilePictureUrl: string | null;
12
- tenantId: string;
13
- tenantIds: string[];
14
11
  activatedForTenant?: boolean;
12
+ createdAt: Date;
15
13
  };
16
14
  export declare type IGroupResponse = {
17
15
  id: string;
@@ -51,10 +49,11 @@ export declare type IGroupConfigResponse = {
51
49
  rolesEnabled: boolean;
52
50
  };
53
51
  export declare type IUpdateGroupRoles = {
54
- groupId: string;
55
52
  roleIds: string[];
56
53
  };
57
54
  export declare type IUpdateGroupUsers = {
58
- groupId: string;
59
55
  userIds: string[];
60
56
  };
57
+ export declare type IGetGroupQueryOptions = {
58
+ _groupsRelations?: GroupRelations;
59
+ };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.80
1
+ /** @license Frontegg v3.0.82
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
@@ -90,12 +90,8 @@ const urls = {
90
90
  v1: '/identity/resources/groups/v1/config'
91
91
  },
92
92
  v1: '/identity/resources/groups/v1',
93
- roles: {
94
- v1: '/identity/resources/groups/v1/roles'
95
- },
96
- users: {
97
- v1: '/identity/resources/groups/v1/users'
98
- }
93
+ roles: '/roles',
94
+ users: '/users'
99
95
  }
100
96
  },
101
97
  team: {
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.GroupRelations = void 0;
7
+ let GroupRelations;
8
+ exports.GroupRelations = GroupRelations;
9
+
10
+ (function (GroupRelations) {
11
+ GroupRelations["roles"] = "roles";
12
+ GroupRelations["users"] = "users";
13
+ GroupRelations["rolesAndUsers"] = "rolesAndUsers";
14
+ })(GroupRelations || (exports.GroupRelations = GroupRelations = {}));
@@ -19,6 +19,8 @@ exports.updateGroupConfiguration = updateGroupConfiguration;
19
19
 
20
20
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
21
21
 
22
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
23
+
22
24
  var _constants = require("../constants");
23
25
 
24
26
  var _fetch = require("../fetch");
@@ -27,12 +29,12 @@ const _excluded = ["groupId"];
27
29
 
28
30
  async function getGroupById({
29
31
  groupId
30
- }) {
31
- return (0, _fetch.Get)(`${_constants.urls.identity.groups.v1}/${groupId}`);
32
+ }, query) {
33
+ return (0, _fetch.Get)(`${_constants.urls.identity.groups.v1}/${groupId}`, (0, _extends2.default)({}, query));
32
34
  }
33
35
 
34
- async function getGroups() {
35
- return (0, _fetch.Get)(`${_constants.urls.identity.groups.v1}`);
36
+ async function getGroups(query) {
37
+ return (0, _fetch.Get)(`${_constants.urls.identity.groups.v1}`, (0, _extends2.default)({}, query));
36
38
  }
37
39
 
38
40
  async function createGroup(body) {
@@ -51,20 +53,20 @@ async function deleteGroup(groupId) {
51
53
  return (0, _fetch.Delete)(`${_constants.urls.identity.groups.v1}/${groupId}`);
52
54
  }
53
55
 
54
- async function addRolesToGroup(body) {
55
- return (0, _fetch.Post)(`${_constants.urls.identity.groups.roles.v1}`, body);
56
+ async function addRolesToGroup(groupId, body) {
57
+ return (0, _fetch.Post)(`${_constants.urls.identity.groups.v1}/${groupId}/${_constants.urls.identity.groups.roles}`, body);
56
58
  }
57
59
 
58
- async function deleteRolesFromGroup(body) {
59
- return (0, _fetch.Delete)(`${_constants.urls.identity.groups.roles.v1}`, body);
60
+ async function deleteRolesFromGroup(groupId, body) {
61
+ return (0, _fetch.Delete)(`${_constants.urls.identity.groups.v1}/${groupId}/${_constants.urls.identity.groups.roles}`, body);
60
62
  }
61
63
 
62
- async function addUsersToGroup(body) {
63
- return (0, _fetch.Post)(`${_constants.urls.identity.groups.users.v1}`, body);
64
+ async function addUsersToGroup(groupId, body) {
65
+ return (0, _fetch.Post)(`${_constants.urls.identity.groups.v1}/${groupId}/${_constants.urls.identity.groups.users}`, body);
64
66
  }
65
67
 
66
- async function deleteUsersFromGroup(body) {
67
- return (0, _fetch.Delete)(`${_constants.urls.identity.groups.users.v1}`, body);
68
+ async function deleteUsersFromGroup(groupId, body) {
69
+ return (0, _fetch.Delete)(`${_constants.urls.identity.groups.v1}/${groupId}/${_constants.urls.identity.groups.users}`, body);
68
70
  }
69
71
 
70
72
  async function getGroupConfiguration() {
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v3.0.80
1
+ /** @license Frontegg v3.0.82
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/rest-api",
3
- "version": "3.0.80",
3
+ "version": "3.0.82",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -39,6 +39,10 @@ export interface ITenantsResponseV2 extends ITenantsResponse {
39
39
  annualRevenue?: number;
40
40
  yearFounded?: number;
41
41
  totalFunding?: string;
42
+ hasCustomLogin?: boolean;
43
+ loginUrl?: string;
44
+ applicationUrl?: string;
45
+ alias?: string;
42
46
  }
43
47
  export interface ISubTenant {
44
48
  tenantId: string;