@frontegg/rest-api 3.1.74-alpha.9437937621 → 3.1.74
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/ContextHolder/index.d.ts +27 -108
- package/ContextHolder/index.js +50 -155
- package/account-settings/index.d.ts +7 -19
- package/account-settings/index.js +13 -23
- package/applications/index.d.ts +44 -49
- package/applications/index.js +37 -51
- package/audits/index.d.ts +15 -27
- package/audits/index.js +17 -27
- package/auth/index.d.ts +768 -817
- package/auth/index.js +721 -902
- package/auth/secutiry-poilicy/index.d.ts +102 -58
- package/auth/secutiry-poilicy/index.js +90 -122
- package/auth/utils.d.ts +2 -2
- package/auth/utils.js +8 -9
- package/connectivity/index.d.ts +26 -125
- package/connectivity/index.js +114 -147
- package/directory/index.d.ts +22 -31
- package/directory/index.js +15 -27
- package/entitlements/index.d.ts +8 -14
- package/entitlements/index.js +4 -12
- package/feature-flags/index.d.ts +2 -8
- package/feature-flags/index.js +8 -16
- package/fetch.d.ts +24 -0
- package/fetch.js +265 -0
- package/groups/index.d.ts +49 -73
- package/groups/index.js +45 -64
- package/impersonate/index.d.ts +6 -15
- package/impersonate/index.js +5 -13
- package/index.d.ts +108 -154
- package/index.js +78 -109
- package/interfaces.d.ts +0 -10
- package/metadata/index.d.ts +7 -67
- package/metadata/index.js +32 -52
- package/node/ContextHolder/index.js +50 -155
- package/node/account-settings/index.js +16 -27
- package/node/applications/index.js +44 -51
- package/node/audits/index.js +20 -31
- package/node/auth/index.js +1035 -768
- package/node/auth/secutiry-poilicy/index.js +136 -125
- package/node/auth/utils.js +7 -9
- package/node/connectivity/index.js +187 -148
- package/node/directory/index.js +20 -29
- package/node/entitlements/index.js +5 -18
- package/node/feature-flags/index.js +9 -21
- package/node/fetch.js +306 -0
- package/node/groups/index.js +63 -65
- package/node/impersonate/index.js +5 -18
- package/node/index.js +71 -116
- package/node/metadata/index.js +52 -61
- package/node/notifications/index.js +27 -37
- package/node/reports/index.js +70 -78
- package/node/roles/index.js +51 -56
- package/node/security-center/index.js +9 -21
- package/node/sub-tenants/index.js +89 -90
- package/node/subscriptions/index.js +107 -79
- package/node/subscriptions/invoices.js +17 -25
- package/node/subscriptions/managedSubscriptions.js +27 -32
- package/node/subscriptions/paymentMethods.js +20 -27
- package/node/subscriptions/paymentProviders.js +6 -15
- package/node/subscriptions/plans.js +9 -17
- package/node/subscriptions/providers/index.js +18 -0
- package/node/subscriptions/providers/stripe/index.js +21 -26
- package/node/subscriptions/subscriptions.js +27 -32
- package/node/subscriptions/summaries.js +6 -15
- package/node/subscriptions/tenantConfiguration.js +9 -17
- package/node/subscriptions/vendorPublicConfigurations.js +6 -15
- package/node/teams/index.js +138 -130
- package/node/tenants/index.js +60 -65
- package/node/user-phone-numbers/index.js +24 -32
- package/node/users/index.js +53 -58
- package/node/vendor/index.js +6 -17
- package/notifications/index.d.ts +16 -22
- package/notifications/index.js +22 -33
- package/package.json +1 -1
- package/reports/index.d.ts +44 -50
- package/reports/index.js +62 -75
- package/roles/index.d.ts +38 -44
- package/roles/index.js +41 -57
- package/security-center/index.d.ts +2 -14
- package/security-center/index.js +6 -15
- package/sub-tenants/index.d.ts +15 -57
- package/sub-tenants/index.js +68 -88
- package/subscriptions/index.d.ts +11 -56
- package/subscriptions/index.js +11 -68
- package/subscriptions/invoices.d.ts +13 -16
- package/subscriptions/invoices.js +14 -24
- package/subscriptions/managedSubscriptions.d.ts +15 -18
- package/subscriptions/managedSubscriptions.js +22 -33
- package/subscriptions/paymentMethods.d.ts +13 -16
- package/subscriptions/paymentMethods.js +17 -26
- package/subscriptions/paymentProviders.d.ts +5 -8
- package/subscriptions/paymentProviders.js +4 -11
- package/subscriptions/plans.d.ts +8 -11
- package/subscriptions/plans.js +6 -14
- package/subscriptions/providers/index.d.ts +1 -0
- package/subscriptions/providers/index.js +1 -0
- package/subscriptions/providers/stripe/index.d.ts +21 -24
- package/subscriptions/providers/stripe/index.js +16 -27
- package/subscriptions/subscriptions.d.ts +21 -24
- package/subscriptions/subscriptions.js +22 -33
- package/subscriptions/summaries.d.ts +4 -7
- package/subscriptions/summaries.js +3 -10
- package/subscriptions/tenantConfiguration.d.ts +3 -6
- package/subscriptions/tenantConfiguration.js +7 -15
- package/subscriptions/vendorPublicConfigurations.d.ts +2 -5
- package/subscriptions/vendorPublicConfigurations.js +4 -11
- package/teams/index.d.ts +131 -35
- package/teams/index.js +93 -122
- package/tenants/index.d.ts +37 -25
- package/tenants/index.js +46 -62
- package/user-phone-numbers/index.d.ts +26 -32
- package/user-phone-numbers/index.js +19 -32
- package/users/index.d.ts +15 -21
- package/users/index.js +44 -60
- package/vendor/index.d.ts +6 -12
- package/vendor/index.js +4 -11
- package/BaseApiClient.d.ts +0 -16
- package/BaseApiClient.js +0 -39
- package/FetchClient.d.ts +0 -42
- package/FetchClient.js +0 -308
- package/node/BaseApiClient.js +0 -49
- package/node/FetchClient.js +0 -326
package/teams/index.js
CHANGED
|
@@ -1,125 +1,96 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { Get, Post, Put, Delete, Patch } from '../fetch';
|
|
2
3
|
import { urls } from '../constants';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this.getInviteLinkConfiguration = async () => {
|
|
94
|
-
return this.get(urls.identity.tenants.invites.configuration.v1);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
this.loadAvailableRoles = async () => {
|
|
98
|
-
return this.get(urls.team.roles.v1);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
this.loadAvailablePermissions = async () => {
|
|
102
|
-
return this.get(urls.identity.permissions.v1);
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
this.loadStats = async () => {
|
|
106
|
-
return this.get(`${urls.team.stats.v1}/members`);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
this.resendActivationLink = async body => {
|
|
110
|
-
return this.post(`${urls.team.members.v1}/${body.userId}/resendActivationEmail`, {});
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
this.resendInvitationLink = async body => {
|
|
114
|
-
return this.post(urls.identity.users.v2, _extends({}, body, {
|
|
115
|
-
provider: 'local'
|
|
116
|
-
}));
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
this.resendInvitationLinkToAllTenants = async body => {
|
|
120
|
-
return this.post(urls.identity.users.invitation.resendAll.v1, _extends({}, body));
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
4
|
+
export async function getProfile(params) {
|
|
5
|
+
return Get(`${urls.identity.users.v2}/me`, params != null ? params : {
|
|
6
|
+
addRoles: true
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export async function updateProfile(body) {
|
|
10
|
+
return Put(`${urls.identity.users.v2}/me`, body);
|
|
11
|
+
}
|
|
12
|
+
export async function updateProfileImage(body) {
|
|
13
|
+
return Put(`${urls.team.profile.v1}/me/image/v1`, body, {
|
|
14
|
+
responseType: 'plain',
|
|
15
|
+
contentType: undefined
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export async function changePassword(body) {
|
|
19
|
+
return Post(`${urls.identity.users.v1}/passwords/change`, body);
|
|
20
|
+
}
|
|
21
|
+
export async function loadUsers(params) {
|
|
22
|
+
var _params$sort, _params$sort$0$id, _params$sort2, _params$sort2$, _params$sort3, _params$sort3$;
|
|
23
|
+
|
|
24
|
+
const filters = (params.filter || []).reduce((p, n) => _extends({}, p, {
|
|
25
|
+
[n.id]: n.value
|
|
26
|
+
}), {});
|
|
27
|
+
const sorts = (_params$sort = params.sort) != null && _params$sort.length ? {
|
|
28
|
+
sortBy: (_params$sort$0$id = (_params$sort2 = params.sort) == null ? void 0 : (_params$sort2$ = _params$sort2[0]) == null ? void 0 : _params$sort2$.id) != null ? _params$sort$0$id : 'name',
|
|
29
|
+
sortDirection: (_params$sort3 = params.sort) != null && (_params$sort3$ = _params$sort3[0]) != null && _params$sort3$.desc ? 'desc' : 'asc'
|
|
30
|
+
} : null;
|
|
31
|
+
return Get(urls.team.members.v1, _extends({
|
|
32
|
+
pageOffset: params.pageOffset,
|
|
33
|
+
pageSize: params.pageSize
|
|
34
|
+
}, filters, sorts));
|
|
35
|
+
}
|
|
36
|
+
export async function addUser(body) {
|
|
37
|
+
return Post(urls.identity.users.v2, _extends({}, body, {
|
|
38
|
+
provider: 'local'
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
export async function deleteUser(body) {
|
|
42
|
+
return Delete(`${urls.team.members.v1}/${body.userId}`);
|
|
43
|
+
}
|
|
44
|
+
export async function updateUser(body) {
|
|
45
|
+
return Put(urls.team.members.v1, body);
|
|
46
|
+
}
|
|
47
|
+
export async function updateUserExpirationTime(body) {
|
|
48
|
+
const {
|
|
49
|
+
userId,
|
|
50
|
+
expirationInSeconds
|
|
51
|
+
} = body;
|
|
52
|
+
return Put(`${urls.identity.users.temporary.v1}/${userId}`, {
|
|
53
|
+
expirationInSeconds
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export async function setPermanentUser(userId) {
|
|
57
|
+
return Delete(`${urls.identity.users.temporary.v1}/${userId}`);
|
|
58
|
+
}
|
|
59
|
+
export async function getTemporaryUserConfiguration() {
|
|
60
|
+
return Get(urls.identity.users.temporary.configuration.v1);
|
|
61
|
+
}
|
|
62
|
+
export async function createInviteUserLink(body) {
|
|
63
|
+
return Post(urls.identity.tenants.invites.user.v1, _extends({}, body));
|
|
64
|
+
}
|
|
65
|
+
export async function updateInviteUserLink(body) {
|
|
66
|
+
return Patch(urls.identity.tenants.invites.user.v1, _extends({}, body));
|
|
67
|
+
}
|
|
68
|
+
export async function deleteInviteUserLink() {
|
|
69
|
+
return Delete(urls.identity.tenants.invites.user.v1);
|
|
70
|
+
}
|
|
71
|
+
export async function getInviteUserLink() {
|
|
72
|
+
return Get(urls.identity.tenants.invites.user.v1);
|
|
73
|
+
}
|
|
74
|
+
export async function getInviteLinkConfiguration() {
|
|
75
|
+
return Get(urls.identity.tenants.invites.configuration.v1);
|
|
76
|
+
}
|
|
77
|
+
export async function loadAvailableRoles() {
|
|
78
|
+
return Get(urls.team.roles.v1);
|
|
79
|
+
}
|
|
80
|
+
export async function loadAvailablePermissions() {
|
|
81
|
+
return Get(urls.identity.permissions.v1);
|
|
82
|
+
}
|
|
83
|
+
export async function loadStats() {
|
|
84
|
+
return Get(`${urls.team.stats.v1}/members`);
|
|
85
|
+
}
|
|
86
|
+
export async function resendActivationLink(body) {
|
|
87
|
+
return Post(`${urls.team.members.v1}/${body.userId}/resendActivationEmail`, {});
|
|
88
|
+
}
|
|
89
|
+
export async function resendInvitationLink(body) {
|
|
90
|
+
return Post(urls.identity.users.v2, _extends({}, body, {
|
|
91
|
+
provider: 'local'
|
|
92
|
+
}));
|
|
124
93
|
}
|
|
125
|
-
export
|
|
94
|
+
export async function resendInvitationLinkToAllTenants(body) {
|
|
95
|
+
return Post(urls.identity.users.invitation.resendAll.v1, _extends({}, body));
|
|
96
|
+
}
|
package/tenants/index.d.ts
CHANGED
|
@@ -1,25 +1,37 @@
|
|
|
1
|
-
import { GetHierarchyMetadataParams, GetHierarchyMetadataResponse, IGetTenantsUserCountRequest, IGetTenantsUserCountResponse, IParentTenant, ISubTenant, ISubTenantTree, ISwitchTenant, ITenantsResponse, SearchSubTenantsParams, SearchSubTenantsResponse } from
|
|
2
|
-
import { FronteggPaginationWrapper, UserJwtOptions } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { GetHierarchyMetadataParams, GetHierarchyMetadataResponse, IGetTenantsUserCountRequest, IGetTenantsUserCountResponse, IParentTenant, ISubTenant, ISubTenantTree, ISwitchTenant, ITenantsResponse, SearchSubTenantsParams, SearchSubTenantsResponse } from "./interfaces";
|
|
2
|
+
import { FronteggPaginationWrapper, UserJwtOptions } from "../interfaces";
|
|
3
|
+
/**
|
|
4
|
+
* switch logged in user to specific tenant by providing tenantId.
|
|
5
|
+
*
|
|
6
|
+
* @throws exception if invalid tenantId.
|
|
7
|
+
* ``authorized user``
|
|
8
|
+
*/
|
|
9
|
+
export declare function switchTenant(body: ISwitchTenant): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* retrieve logged in user's available tenants.
|
|
12
|
+
*
|
|
13
|
+
* ``authorized user``
|
|
14
|
+
*/
|
|
15
|
+
export declare function getTenants(): Promise<ITenantsResponse[]>;
|
|
16
|
+
/**
|
|
17
|
+
* retrieve logged in user's available sub tenants.
|
|
18
|
+
*
|
|
19
|
+
* ``authorized user``
|
|
20
|
+
*/
|
|
21
|
+
export declare function getSubTenants(options?: UserJwtOptions): Promise<ISubTenant>;
|
|
22
|
+
/**
|
|
23
|
+
* retrieve logged in user's available sub tenants as a tree.
|
|
24
|
+
*
|
|
25
|
+
* ``authorized user``
|
|
26
|
+
*/
|
|
27
|
+
export declare function getSubTenantsAsTree(options?: UserJwtOptions): Promise<ISubTenantTree>;
|
|
28
|
+
/**
|
|
29
|
+
* retrieve logged in user's available parent tenants.
|
|
30
|
+
*
|
|
31
|
+
* ``authorized user``
|
|
32
|
+
*/
|
|
33
|
+
export declare function getParentTenants(options?: UserJwtOptions): Promise<IParentTenant[]>;
|
|
34
|
+
export declare function getParentTenantsById(tenantId: string, options?: UserJwtOptions): Promise<IParentTenant[]>;
|
|
35
|
+
export declare function getTenantsUsersCount(body: IGetTenantsUserCountRequest, options?: UserJwtOptions): Promise<IGetTenantsUserCountResponse[]>;
|
|
36
|
+
export declare function searchSubTenants(params: SearchSubTenantsParams, options?: UserJwtOptions): Promise<FronteggPaginationWrapper<SearchSubTenantsResponse>>;
|
|
37
|
+
export declare function getHierarchyMetadata(params: GetHierarchyMetadataParams, options?: UserJwtOptions): Promise<GetHierarchyMetadataResponse[]>;
|
package/tenants/index.js
CHANGED
|
@@ -1,68 +1,52 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import {
|
|
2
|
+
import { extractHeadersFromOptions, Get, Post, Put } from "../fetch";
|
|
3
|
+
import { urls } from "../constants";
|
|
3
4
|
import { setTabTenantInSessionStorage } from '../auth/utils';
|
|
4
5
|
import { ContextHolder } from '../ContextHolder';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
super(appName);
|
|
9
|
-
|
|
10
|
-
this.switchTenant = async body => {
|
|
11
|
-
if (ContextHolder.for(this.appName).isSessionPerTenantEnabled()) {
|
|
12
|
-
setTabTenantInSessionStorage(body.tenantId);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return this.put(`${urls.identity.users.v1}/tenant`, body);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
this.getTenants = async () => {
|
|
19
|
-
return this.get(`${urls.identity.users.v2}/me/tenants`);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
this.getSubTenants = async options => {
|
|
23
|
-
return this.get(urls.tenants.hierarchy.v1, undefined, {
|
|
24
|
-
headers: this.extractHeadersFromOptions(options)
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
this.getSubTenantsAsTree = async options => {
|
|
29
|
-
return this.get(urls.tenants.hierarchy.tree.v1, undefined, {
|
|
30
|
-
headers: this.extractHeadersFromOptions(options)
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
this.getParentTenants = async options => {
|
|
35
|
-
return this.get(urls.tenants.hierarchy.parents.v1, undefined, {
|
|
36
|
-
headers: this.extractHeadersFromOptions(options)
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
this.getParentTenantsById = async (tenantId, options) => {
|
|
41
|
-
return this.get(`${urls.tenants.hierarchy.parents.v1}/${tenantId}`, undefined, {
|
|
42
|
-
headers: this.extractHeadersFromOptions(options)
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
this.getTenantsUsersCount = async (body, options) => {
|
|
47
|
-
return this.post(`${urls.identity.tenants.users.v1}/count`, body, {
|
|
48
|
-
headers: this.extractHeadersFromOptions(options)
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
this.searchSubTenants = async (params, options) => {
|
|
53
|
-
return this.get(urls.tenants.hierarchy.v2, params, {
|
|
54
|
-
headers: this.extractHeadersFromOptions(options)
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
this.getHierarchyMetadata = async (params, options) => {
|
|
59
|
-
return this.get(urls.tenants.hierarchy.metadata.v2, _extends({}, params, {
|
|
60
|
-
_tenantIds: params._tenantIds.join(',')
|
|
61
|
-
}), {
|
|
62
|
-
headers: this.extractHeadersFromOptions(options)
|
|
63
|
-
});
|
|
64
|
-
};
|
|
6
|
+
export async function switchTenant(body) {
|
|
7
|
+
if (ContextHolder.isSessionPerTenantEnabled()) {
|
|
8
|
+
setTabTenantInSessionStorage(body.tenantId);
|
|
65
9
|
}
|
|
66
10
|
|
|
11
|
+
return Put(`${urls.identity.users.v1}/tenant`, body);
|
|
12
|
+
}
|
|
13
|
+
export async function getTenants() {
|
|
14
|
+
return Get(`${urls.identity.users.v2}/me/tenants`);
|
|
15
|
+
}
|
|
16
|
+
export async function getSubTenants(options) {
|
|
17
|
+
return Get(urls.tenants.hierarchy.v1, undefined, {
|
|
18
|
+
headers: extractHeadersFromOptions(options)
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export async function getSubTenantsAsTree(options) {
|
|
22
|
+
return Get(urls.tenants.hierarchy.tree.v1, undefined, {
|
|
23
|
+
headers: extractHeadersFromOptions(options)
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export async function getParentTenants(options) {
|
|
27
|
+
return Get(urls.tenants.hierarchy.parents.v1, undefined, {
|
|
28
|
+
headers: extractHeadersFromOptions(options)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export async function getParentTenantsById(tenantId, options) {
|
|
32
|
+
return Get(`${urls.tenants.hierarchy.parents.v1}/${tenantId}`, undefined, {
|
|
33
|
+
headers: extractHeadersFromOptions(options)
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export async function getTenantsUsersCount(body, options) {
|
|
37
|
+
return Post(`${urls.identity.tenants.users.v1}/count`, body, {
|
|
38
|
+
headers: extractHeadersFromOptions(options)
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export async function searchSubTenants(params, options) {
|
|
42
|
+
return Get(urls.tenants.hierarchy.v2, params, {
|
|
43
|
+
headers: extractHeadersFromOptions(options)
|
|
44
|
+
});
|
|
67
45
|
}
|
|
68
|
-
export
|
|
46
|
+
export async function getHierarchyMetadata(params, options) {
|
|
47
|
+
return Get(urls.tenants.hierarchy.metadata.v2, _extends({}, params, {
|
|
48
|
+
_tenantIds: params._tenantIds.join(',')
|
|
49
|
+
}), {
|
|
50
|
+
headers: extractHeadersFromOptions(options)
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -1,32 +1,26 @@
|
|
|
1
|
-
import { FronteggPaginationWrapper } from
|
|
2
|
-
import { ICreatePhoneNumberResponse, IDeletePhoneNumberResponse, IGetPhoneNumbersQueryParams, IPhoneNumber, IPreVerifyPhoneNumber, IPreVerifyPhoneNumberResponse, IUpdatePhoneNumber, IVerifyPhoneNumber } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* Verify delete phone number
|
|
28
|
-
*/
|
|
29
|
-
verifyDeletePhoneNumber: (phoneId: string, body: IVerifyPhoneNumber) => Promise<void>;
|
|
30
|
-
}
|
|
31
|
-
declare const _default: PhoneNumbersApi;
|
|
32
|
-
export default _default;
|
|
1
|
+
import { FronteggPaginationWrapper } from "../interfaces";
|
|
2
|
+
import { ICreatePhoneNumberResponse, IDeletePhoneNumberResponse, IGetPhoneNumbersQueryParams, IPhoneNumber, IPreVerifyPhoneNumber, IPreVerifyPhoneNumberResponse, IUpdatePhoneNumber, IVerifyPhoneNumber } from "./interfaces";
|
|
3
|
+
/**
|
|
4
|
+
* Get phone numbers of user
|
|
5
|
+
*/
|
|
6
|
+
export declare function getUserPhoneNumbers(queryParams: IGetPhoneNumbersQueryParams): Promise<FronteggPaginationWrapper<IPhoneNumber>>;
|
|
7
|
+
/**
|
|
8
|
+
* Create new phone number for user, by default otc will be sent with this request
|
|
9
|
+
*/
|
|
10
|
+
export declare function createPhoneNumber(body: IUpdatePhoneNumber): Promise<ICreatePhoneNumberResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* Delete existing phone number for user
|
|
13
|
+
*/
|
|
14
|
+
export declare function deletePhoneNumber(phoneId: string): Promise<IDeletePhoneNumberResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Pre verify phone number, used before verify to send OTC to user
|
|
17
|
+
*/
|
|
18
|
+
export declare function preVerifyPhoneNumber(body: IPreVerifyPhoneNumber): Promise<IPreVerifyPhoneNumberResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Verify phone number
|
|
21
|
+
*/
|
|
22
|
+
export declare function verifyPhoneNumber(body: IVerifyPhoneNumber): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Verify delete phone number
|
|
25
|
+
*/
|
|
26
|
+
export declare function verifyDeletePhoneNumber(phoneId: string, body: IVerifyPhoneNumber): Promise<void>;
|
|
@@ -1,33 +1,20 @@
|
|
|
1
|
-
import { urls } from
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
super(appName);
|
|
6
|
-
|
|
7
|
-
this.getUserPhoneNumbers = async queryParams => {
|
|
8
|
-
return this.get(`${urls.identity.phoneNumbers.v1}`, queryParams);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
this.createPhoneNumber = async body => {
|
|
12
|
-
return this.post(`${urls.identity.phoneNumbers.v1}`, body);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
this.deletePhoneNumber = async phoneId => {
|
|
16
|
-
return this.delete(`${urls.identity.phoneNumbers.v1}/${phoneId}`);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
this.preVerifyPhoneNumber = async body => {
|
|
20
|
-
return this.post(`${urls.identity.phoneNumbers.v1}/preverify`, body);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
this.verifyPhoneNumber = async body => {
|
|
24
|
-
return this.post(`${urls.identity.phoneNumbers.v1}/verify`, body);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
this.verifyDeletePhoneNumber = async (phoneId, body) => {
|
|
28
|
-
return this.post(`${urls.identity.phoneNumbers.v1}/${phoneId}/delete/verify`, body);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
1
|
+
import { urls } from "../constants";
|
|
2
|
+
import { Delete, Get, Post } from "../fetch";
|
|
3
|
+
export async function getUserPhoneNumbers(queryParams) {
|
|
4
|
+
return Get(`${urls.identity.phoneNumbers.v1}`, queryParams);
|
|
32
5
|
}
|
|
33
|
-
export
|
|
6
|
+
export async function createPhoneNumber(body) {
|
|
7
|
+
return Post(`${urls.identity.phoneNumbers.v1}`, body);
|
|
8
|
+
}
|
|
9
|
+
export async function deletePhoneNumber(phoneId) {
|
|
10
|
+
return Delete(`${urls.identity.phoneNumbers.v1}/${phoneId}`);
|
|
11
|
+
}
|
|
12
|
+
export async function preVerifyPhoneNumber(body) {
|
|
13
|
+
return Post(`${urls.identity.phoneNumbers.v1}/preverify`, body);
|
|
14
|
+
}
|
|
15
|
+
export async function verifyPhoneNumber(body) {
|
|
16
|
+
return Post(`${urls.identity.phoneNumbers.v1}/verify`, body);
|
|
17
|
+
}
|
|
18
|
+
export async function verifyDeletePhoneNumber(phoneId, body) {
|
|
19
|
+
return Post(`${urls.identity.phoneNumbers.v1}/${phoneId}/delete/verify`, body);
|
|
20
|
+
}
|
package/users/index.d.ts
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { GetCurrentUserTenantsResponse, GetUserGroupsParams, GetUserGroupsResponse, GetUserJwtRequestDto, GetUserJwtResponseDto, GetUserRolesResponse, GetUsersRolesParams, IGetUsersV2Response, ISearchUserQueryParamsV2, ISearchUserQueryParamsV3, IUpdateUserDto, IUserProfile, IUsersV3Data } from './interfaces';
|
|
2
2
|
import { FronteggPaginationWrapper, UserJwtOptions } from '../interfaces';
|
|
3
|
-
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
getCurrentUserTenantsV1: (options?: UserJwtOptions | undefined) => Promise<GetCurrentUserTenantsResponse>;
|
|
19
|
-
sendResetBreachedPasswordEmails: () => Promise<void>;
|
|
20
|
-
updateUserProfileV2: (body: Partial<IUpdateUserDto>) => Promise<IUserProfile>;
|
|
21
|
-
}
|
|
22
|
-
declare const _default: UsersApi;
|
|
23
|
-
export default _default;
|
|
3
|
+
export declare function GetUserJwt(body: GetUserJwtRequestDto): Promise<GetUserJwtResponseDto>;
|
|
4
|
+
export declare function getUsersV2(queryParams: ISearchUserQueryParamsV2, options?: UserJwtOptions): Promise<FronteggPaginationWrapper<IGetUsersV2Response>>;
|
|
5
|
+
export declare function getUsersV3(queryParams: ISearchUserQueryParamsV3, options?: UserJwtOptions): Promise<FronteggPaginationWrapper<IUsersV3Data>>;
|
|
6
|
+
export declare function getUsersRoles(queryParams: GetUsersRolesParams, options?: UserJwtOptions): Promise<GetUserRolesResponse[]>;
|
|
7
|
+
export declare function getUsersGroups(queryParams: GetUserGroupsParams, options?: UserJwtOptions): Promise<GetUserGroupsResponse[]>;
|
|
8
|
+
/**
|
|
9
|
+
* get user tenant and user tenants by user active tenant
|
|
10
|
+
*/
|
|
11
|
+
export declare function getCurrentUserTenantsV3(options?: UserJwtOptions): Promise<GetCurrentUserTenantsResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* get user tenant and user tenants by context tenant
|
|
14
|
+
*/
|
|
15
|
+
export declare function getCurrentUserTenantsV1(options?: UserJwtOptions): Promise<GetCurrentUserTenantsResponse>;
|
|
16
|
+
export declare function sendResetBreachedPasswordEmails(): Promise<void>;
|
|
17
|
+
export declare function updateUserProfileV2(body: Partial<IUpdateUserDto>): Promise<IUserProfile>;
|