@frontegg/rest-api 3.0.101 → 3.0.103
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/account-settings/index.d.ts +4 -3
- package/account-settings/index.js +10 -6
- package/account-settings/interfaces.d.ts +3 -1
- package/constants.d.ts +1 -0
- package/constants.js +3 -2
- package/index.js +1 -1
- package/node/account-settings/index.js +8 -4
- package/node/constants.js +3 -2
- package/node/index.js +1 -1
- package/node/sub-tenants/index.js +15 -4
- package/node/tenants/index.js +4 -2
- package/package.json +1 -1
- package/sub-tenants/index.d.ts +4 -3
- package/sub-tenants/index.js +13 -4
- package/sub-tenants/interfaces.d.ts +10 -0
- package/tenants/index.d.ts +1 -1
- package/tenants/index.js +4 -2
- package/tenants/interfaces.d.ts +1 -0
- package/users/interfaces.d.ts +1 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { IPublicSettingsResponse, ISettingsResponse, IUpdateSettings } from
|
|
1
|
+
import { IPublicSettingsResponse, ISettingsResponse, IUpdateSettings } from "./interfaces";
|
|
2
|
+
import { UserJwtOptions } from "../interfaces";
|
|
2
3
|
/*** update account settings for tenant.
|
|
3
4
|
* tenantId is caclulated in the backend from context
|
|
4
5
|
* ``authorized user``
|
|
5
6
|
*/
|
|
6
|
-
export declare function updateSettings(body: IUpdateSettings): Promise<ISettingsResponse>;
|
|
7
|
-
export declare function getSettings(): Promise<ISettingsResponse>;
|
|
7
|
+
export declare function updateSettings(body: IUpdateSettings, options?: UserJwtOptions): Promise<ISettingsResponse>;
|
|
8
|
+
export declare function getSettings(options?: UserJwtOptions): Promise<ISettingsResponse>;
|
|
8
9
|
export declare function getPublicSettings(): Promise<IPublicSettingsResponse>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { urls } from
|
|
2
|
-
import {
|
|
3
|
-
export async function updateSettings(body) {
|
|
4
|
-
return Put(urls.tenants.accountSettings.v1, body
|
|
1
|
+
import { urls } from "../constants";
|
|
2
|
+
import { extractHeadersFromOptions, Get, Put } from "../fetch";
|
|
3
|
+
export async function updateSettings(body, options) {
|
|
4
|
+
return Put(urls.tenants.accountSettings.v1, body, {
|
|
5
|
+
headers: extractHeadersFromOptions(options)
|
|
6
|
+
});
|
|
5
7
|
}
|
|
6
|
-
export async function getSettings() {
|
|
7
|
-
return Get(urls.tenants.accountSettings.v1
|
|
8
|
+
export async function getSettings(options) {
|
|
9
|
+
return Get(urls.tenants.accountSettings.v1, {
|
|
10
|
+
headers: extractHeadersFromOptions(options)
|
|
11
|
+
});
|
|
8
12
|
}
|
|
9
13
|
export async function getPublicSettings() {
|
|
10
14
|
return Get(`${urls.tenants.accountSettings.v1}/public`);
|
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
|
@@ -81,7 +81,8 @@ export const urls = {
|
|
|
81
81
|
v1: '/identity/resources/roles/v1'
|
|
82
82
|
},
|
|
83
83
|
subTenants: {
|
|
84
|
-
v1: '/identity/resources/sub-tenants/users/v1'
|
|
84
|
+
v1: '/identity/resources/sub-tenants/users/v1',
|
|
85
|
+
v2: '/identity/resources/sub-tenants/users/v2'
|
|
85
86
|
},
|
|
86
87
|
impersonate: {
|
|
87
88
|
v1: '/identity/resources/impersonation/v1'
|
|
@@ -128,7 +129,7 @@ export const urls = {
|
|
|
128
129
|
}
|
|
129
130
|
},
|
|
130
131
|
subTenants: {
|
|
131
|
-
v1: '/tenants/resources/sub-tenants/
|
|
132
|
+
v1: '/tenants/resources/sub-tenants/v1'
|
|
132
133
|
}
|
|
133
134
|
},
|
|
134
135
|
integrations: {
|
package/index.js
CHANGED
|
@@ -11,12 +11,16 @@ var _constants = require("../constants");
|
|
|
11
11
|
|
|
12
12
|
var _fetch = require("../fetch");
|
|
13
13
|
|
|
14
|
-
async function updateSettings(body) {
|
|
15
|
-
return (0, _fetch.Put)(_constants.urls.tenants.accountSettings.v1, body
|
|
14
|
+
async function updateSettings(body, options) {
|
|
15
|
+
return (0, _fetch.Put)(_constants.urls.tenants.accountSettings.v1, body, {
|
|
16
|
+
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
17
|
+
});
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
async function getSettings() {
|
|
19
|
-
return (0, _fetch.Get)(_constants.urls.tenants.accountSettings.v1
|
|
20
|
+
async function getSettings(options) {
|
|
21
|
+
return (0, _fetch.Get)(_constants.urls.tenants.accountSettings.v1, {
|
|
22
|
+
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
23
|
+
});
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
async function getPublicSettings() {
|
package/node/constants.js
CHANGED
|
@@ -87,7 +87,8 @@ const urls = {
|
|
|
87
87
|
v1: '/identity/resources/roles/v1'
|
|
88
88
|
},
|
|
89
89
|
subTenants: {
|
|
90
|
-
v1: '/identity/resources/sub-tenants/users/v1'
|
|
90
|
+
v1: '/identity/resources/sub-tenants/users/v1',
|
|
91
|
+
v2: '/identity/resources/sub-tenants/users/v2'
|
|
91
92
|
},
|
|
92
93
|
impersonate: {
|
|
93
94
|
v1: '/identity/resources/impersonation/v1'
|
|
@@ -134,7 +135,7 @@ const urls = {
|
|
|
134
135
|
}
|
|
135
136
|
},
|
|
136
137
|
subTenants: {
|
|
137
|
-
v1: '/tenants/resources/sub-tenants/
|
|
138
|
+
v1: '/tenants/resources/sub-tenants/v1'
|
|
138
139
|
}
|
|
139
140
|
},
|
|
140
141
|
integrations: {
|
package/node/index.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.addUserRolesForSubTenants = addUserRolesForSubTenants;
|
|
7
7
|
exports.addUserToTenantAndSubTenants = addUserToTenantAndSubTenants;
|
|
8
|
+
exports.addUsersToSubTenant = addUsersToSubTenant;
|
|
8
9
|
exports.createSubTenant = createSubTenant;
|
|
9
10
|
exports.deleteSubTenant = deleteSubTenant;
|
|
10
11
|
exports.loadAllUsers = loadAllUsers;
|
|
@@ -31,12 +32,16 @@ async function removeUserFromTenantAndSubTenants(body, options) {
|
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
async function addUserRolesForSubTenants(userId, body) {
|
|
35
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body
|
|
35
|
+
async function addUserRolesForSubTenants(userId, body, options) {
|
|
36
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
37
|
+
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
38
|
+
});
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
async function removeUserRolesFromSubTenants(userId, body) {
|
|
39
|
-
return (0, _fetch.Delete)(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body
|
|
41
|
+
async function removeUserRolesFromSubTenants(userId, body, options) {
|
|
42
|
+
return (0, _fetch.Delete)(`${_constants.urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
43
|
+
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
44
|
+
});
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
async function setUserRolesForSubTenants(userId, body, options) {
|
|
@@ -61,4 +66,10 @@ async function updateSubAccountAccess(userId, body, options) {
|
|
|
61
66
|
return (0, _fetch.Put)(`${_constants.urls.identity.subTenants.v1}/${userId}/access`, body, {
|
|
62
67
|
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
63
68
|
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function addUsersToSubTenant(body, options) {
|
|
72
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.subTenants.v2}/`, body, {
|
|
73
|
+
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
74
|
+
});
|
|
64
75
|
}
|
package/node/tenants/index.js
CHANGED
|
@@ -40,6 +40,8 @@ async function getParentTenants(options) {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
async function getTenantsUsersCount(body) {
|
|
44
|
-
return (0, _fetch.Post)(`${_constants.urls.identity.tenants.users.v1}/count`, body
|
|
43
|
+
async function getTenantsUsersCount(body, options) {
|
|
44
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.tenants.users.v1}/count`, body, {
|
|
45
|
+
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
46
|
+
});
|
|
45
47
|
}
|
package/package.json
CHANGED
package/sub-tenants/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { PaginationResult, UserJwtOptions } from "../interfaces";
|
|
2
|
-
import { AddUserToSubTenantsRequest, CreateSubTenantRequest, CreateSubTenantResponse, ILoadAllUsers, ISubTenantUser, RemoveUserFromSubTenantsRequest, UpdateSubAccountAccessRequestDto, UpdateUserRolesForSubTenantsRequestDto } from "./interfaces";
|
|
2
|
+
import { AddUsersToSubTenantRequest, AddUserToSubTenantsRequest, CreateSubTenantRequest, CreateSubTenantResponse, ILoadAllUsers, ISubTenantUser, RemoveUserFromSubTenantsRequest, UpdateSubAccountAccessRequestDto, UpdateUserRolesForSubTenantsRequestDto } from "./interfaces";
|
|
3
3
|
export declare function loadAllUsers(params: ILoadAllUsers): Promise<PaginationResult<ISubTenantUser>>;
|
|
4
4
|
export declare function addUserToTenantAndSubTenants(body: AddUserToSubTenantsRequest): Promise<void>;
|
|
5
5
|
export declare function removeUserFromTenantAndSubTenants(body: RemoveUserFromSubTenantsRequest, options?: UserJwtOptions): Promise<void>;
|
|
6
|
-
export declare function addUserRolesForSubTenants(userId: string, body: UpdateUserRolesForSubTenantsRequestDto): Promise<void>;
|
|
7
|
-
export declare function removeUserRolesFromSubTenants(userId: string, body: UpdateUserRolesForSubTenantsRequestDto): Promise<void>;
|
|
6
|
+
export declare function addUserRolesForSubTenants(userId: string, body: UpdateUserRolesForSubTenantsRequestDto, options?: UserJwtOptions): Promise<void>;
|
|
7
|
+
export declare function removeUserRolesFromSubTenants(userId: string, body: UpdateUserRolesForSubTenantsRequestDto, options?: UserJwtOptions): Promise<void>;
|
|
8
8
|
export declare function setUserRolesForSubTenants(userId: string, body: UpdateUserRolesForSubTenantsRequestDto, options?: UserJwtOptions): Promise<void>;
|
|
9
9
|
export declare function createSubTenant(body: CreateSubTenantRequest, options?: UserJwtOptions): Promise<CreateSubTenantResponse>;
|
|
10
10
|
export declare function deleteSubTenant(tenantId: string, options?: UserJwtOptions): Promise<void>;
|
|
11
11
|
export declare function updateSubAccountAccess(userId: string, body: UpdateSubAccountAccessRequestDto, options?: UserJwtOptions): Promise<void>;
|
|
12
|
+
export declare function addUsersToSubTenant(body: AddUsersToSubTenantRequest, options?: UserJwtOptions): Promise<void>;
|
package/sub-tenants/index.js
CHANGED
|
@@ -11,11 +11,15 @@ export async function removeUserFromTenantAndSubTenants(body, options) {
|
|
|
11
11
|
headers: extractHeadersFromOptions(options)
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
export async function addUserRolesForSubTenants(userId, body) {
|
|
15
|
-
return Post(`${urls.identity.subTenants.v1}/${userId}/roles`, body
|
|
14
|
+
export async function addUserRolesForSubTenants(userId, body, options) {
|
|
15
|
+
return Post(`${urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
16
|
+
headers: extractHeadersFromOptions(options)
|
|
17
|
+
});
|
|
16
18
|
}
|
|
17
|
-
export async function removeUserRolesFromSubTenants(userId, body) {
|
|
18
|
-
return Delete(`${urls.identity.subTenants.v1}/${userId}/roles`, body
|
|
19
|
+
export async function removeUserRolesFromSubTenants(userId, body, options) {
|
|
20
|
+
return Delete(`${urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
21
|
+
headers: extractHeadersFromOptions(options)
|
|
22
|
+
});
|
|
19
23
|
}
|
|
20
24
|
export async function setUserRolesForSubTenants(userId, body, options) {
|
|
21
25
|
return Patch(`${urls.identity.subTenants.v1}/${userId}/roles`, body, {
|
|
@@ -36,4 +40,9 @@ export async function updateSubAccountAccess(userId, body, options) {
|
|
|
36
40
|
return Put(`${urls.identity.subTenants.v1}/${userId}/access`, body, {
|
|
37
41
|
headers: extractHeadersFromOptions(options)
|
|
38
42
|
});
|
|
43
|
+
}
|
|
44
|
+
export async function addUsersToSubTenant(body, options) {
|
|
45
|
+
return Post(`${urls.identity.subTenants.v2}/`, body, {
|
|
46
|
+
headers: extractHeadersFromOptions(options)
|
|
47
|
+
});
|
|
39
48
|
}
|
|
@@ -117,3 +117,13 @@ export interface CreateSubTenantResponse {
|
|
|
117
117
|
export interface UpdateSubAccountAccessRequestDto {
|
|
118
118
|
allowAccess: boolean;
|
|
119
119
|
}
|
|
120
|
+
export interface AddUsersToSubTenantRequestUserDto {
|
|
121
|
+
email: string;
|
|
122
|
+
name?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface AddUsersToSubTenantRequest {
|
|
125
|
+
users: AddUsersToSubTenantRequestUserDto[];
|
|
126
|
+
tenantId: string;
|
|
127
|
+
roleIds?: string[];
|
|
128
|
+
allowSubAccountAccess?: boolean;
|
|
129
|
+
}
|
package/tenants/index.d.ts
CHANGED
|
@@ -31,4 +31,4 @@ 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 getTenantsUsersCount(body: IGetTenantsUserCountRequest): Promise<IGetTenantsUserCountResponse[]>;
|
|
34
|
+
export declare function getTenantsUsersCount(body: IGetTenantsUserCountRequest, options?: UserJwtOptions): Promise<IGetTenantsUserCountResponse[]>;
|
package/tenants/index.js
CHANGED
|
@@ -21,6 +21,8 @@ export async function getParentTenants(options) {
|
|
|
21
21
|
headers: extractHeadersFromOptions(options)
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
export async function getTenantsUsersCount(body) {
|
|
25
|
-
return Post(`${urls.identity.tenants.users.v1}/count`, body
|
|
24
|
+
export async function getTenantsUsersCount(body, options) {
|
|
25
|
+
return Post(`${urls.identity.tenants.users.v1}/count`, body, {
|
|
26
|
+
headers: extractHeadersFromOptions(options)
|
|
27
|
+
});
|
|
26
28
|
}
|
package/tenants/interfaces.d.ts
CHANGED