@frontegg/rest-api 3.1.76-alpha.9502349697 → 3.1.76-alpha.9762981322
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 +30 -108
- package/ContextHolder/index.js +57 -153
- 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 +27 -126
- 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 +57 -153
- 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 -69
- 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 -58
- 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/metadata/index.js
CHANGED
|
@@ -1,58 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export class MetadataApi extends BaseApiClient {
|
|
3
|
-
constructor(appName) {
|
|
4
|
-
super(appName);
|
|
1
|
+
import { Get, Post } from '../fetch';
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
async function getMetadata(body) {
|
|
4
|
+
var _data$rows, _data$rows2;
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
this.getAdminBoxMetadata = async () => {
|
|
15
|
-
return this.get('/metadata/admin-box');
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
this.updateAdminBoxMetadata = async body => {
|
|
19
|
-
return this.post('/metadata/admin-box', body);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
this.getIpMetadata = async ip => {
|
|
23
|
-
const data = await this.get(`/metadata/ip/${ip}`);
|
|
24
|
-
if (data) return data;
|
|
25
|
-
throw new Error(`ip metadata not found`);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
this.getCurrentUserIpMetadata = async () => {
|
|
29
|
-
const data = await this.get(`/metadata/ipme`);
|
|
30
|
-
if (data) return data;
|
|
31
|
-
throw new Error(`ip metadata not found`);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
this.getNotificationsMetadata = async () => {
|
|
35
|
-
return this.getMetadata({
|
|
36
|
-
entityName: 'notifications'
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
this.getSamlMetadata = async () => {
|
|
41
|
-
return this.getMetadata({
|
|
42
|
-
entityName: 'saml'
|
|
43
|
-
});
|
|
44
|
-
};
|
|
6
|
+
const data = await Get('/metadata', body);
|
|
7
|
+
if (data != null && (_data$rows = data.rows) != null && _data$rows[0]) return data == null ? void 0 : (_data$rows2 = data.rows) == null ? void 0 : _data$rows2[0];
|
|
8
|
+
throw new Error(`metadata not found: ${body.entityName}`);
|
|
9
|
+
}
|
|
45
10
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
11
|
+
export async function getAdminBoxMetadata() {
|
|
12
|
+
return Get('/metadata/admin-box');
|
|
13
|
+
}
|
|
14
|
+
export async function updateAdminBoxMetadata(body) {
|
|
15
|
+
return Post('/metadata/admin-box', body);
|
|
16
|
+
}
|
|
51
17
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
18
|
+
async function getIpMetadata(ip) {
|
|
19
|
+
const data = await Get(`/metadata/ip/${ip}`);
|
|
20
|
+
if (data) return data;
|
|
21
|
+
throw new Error(`ip metadata not found`);
|
|
22
|
+
}
|
|
56
23
|
|
|
24
|
+
export async function getCurrentUserIpMetadata() {
|
|
25
|
+
const data = await Get(`/metadata/ipme`);
|
|
26
|
+
if (data) return data;
|
|
27
|
+
throw new Error(`ip metadata not found`);
|
|
57
28
|
}
|
|
58
|
-
export
|
|
29
|
+
export const getNotificationsMetadata = async () => getMetadata({
|
|
30
|
+
entityName: 'notifications'
|
|
31
|
+
});
|
|
32
|
+
export const getSamlMetadata = async () => getMetadata({
|
|
33
|
+
entityName: 'saml'
|
|
34
|
+
});
|
|
35
|
+
export const getAuditsMetadata = async () => getMetadata({
|
|
36
|
+
entityName: 'audits'
|
|
37
|
+
});
|
|
38
|
+
export const getIpAdressMetadata = async ip => getIpMetadata(ip);
|
|
@@ -19,219 +19,123 @@ class ContextHolder {
|
|
|
19
19
|
this.entitlementsOptions = null;
|
|
20
20
|
this.appName = null;
|
|
21
21
|
this.sessionContext = void 0;
|
|
22
|
-
|
|
23
|
-
this.setContext = context => {
|
|
24
|
-
this.context = context;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
this.setAccessToken = accessToken => {
|
|
28
|
-
this.accessToken = accessToken;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
this.setUser = user => {
|
|
32
|
-
this.user = user;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
this.setRequestSource = requestSource => {
|
|
36
|
-
this.requestSource = requestSource;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
this.setOnRedirectTo = onRedirectTo => {
|
|
40
|
-
this.onRedirectTo = onRedirectTo;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
this.setLogout = logout => {
|
|
44
|
-
this.logout = logout;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
this.setEntitlementsOptions = entitlementsOptions => {
|
|
48
|
-
this.entitlementsOptions = entitlementsOptions;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
this.setSessionContext = sessionContext => {
|
|
52
|
-
this.sessionContext = sessionContext;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
this.setAppName = appName => {
|
|
56
|
-
this.appName = appName;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
this.getContext = () => {
|
|
60
|
-
var _this$context;
|
|
61
|
-
|
|
62
|
-
return (_this$context = this.context) != null ? _this$context : {
|
|
63
|
-
baseUrl: window.location.href,
|
|
64
|
-
tokenResolver: () => 'my-authentication-token',
|
|
65
|
-
logLevel: 'error'
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
this.getAccessToken = () => {
|
|
70
|
-
return this.accessToken;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
this.getRequestSource = () => {
|
|
74
|
-
return this.requestSource;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
this.getUser = () => {
|
|
78
|
-
return this.user;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
this.shouldLoadEntitlements = () => {
|
|
82
|
-
var _this$entitlementsOpt;
|
|
83
|
-
|
|
84
|
-
return ((_this$entitlementsOpt = this.entitlementsOptions) == null ? void 0 : _this$entitlementsOpt.enabled) || false;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
this.isSessionPerTenantEnabled = () => {
|
|
88
|
-
var _this$sessionContext;
|
|
89
|
-
|
|
90
|
-
return ((_this$sessionContext = this.sessionContext) == null ? void 0 : _this$sessionContext.enableSessionPerTenant) || false;
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
this.getAppName = () => {
|
|
94
|
-
return this.appName;
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
static default() {
|
|
99
|
-
return ContextHolder.getInstance(DEFAULT_APP_NAME);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
static for(appName) {
|
|
103
|
-
return ContextHolder.getInstance(appName);
|
|
22
|
+
this.basename = null;
|
|
104
23
|
}
|
|
105
24
|
|
|
106
|
-
static getInstance(
|
|
107
|
-
if (!ContextHolder.
|
|
108
|
-
ContextHolder.
|
|
25
|
+
static getInstance() {
|
|
26
|
+
if (!ContextHolder.instance) {
|
|
27
|
+
ContextHolder.instance = new ContextHolder();
|
|
109
28
|
}
|
|
110
29
|
|
|
111
|
-
|
|
112
|
-
return ContextHolder._apps[appName];
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
ContextHolder._apps[appName] = new ContextHolder();
|
|
116
|
-
return ContextHolder._apps[appName];
|
|
30
|
+
return ContextHolder.instance;
|
|
117
31
|
}
|
|
118
32
|
|
|
119
|
-
static
|
|
120
|
-
ContextHolder.
|
|
121
|
-
ContextHolder._apps[appName].appName = appName;
|
|
122
|
-
return ContextHolder._apps[appName];
|
|
33
|
+
static setContext(context) {
|
|
34
|
+
ContextHolder.getInstance().context = context;
|
|
123
35
|
}
|
|
124
36
|
|
|
125
|
-
static
|
|
126
|
-
ContextHolder.
|
|
37
|
+
static setAccessToken(accessToken) {
|
|
38
|
+
ContextHolder.getInstance().accessToken = accessToken;
|
|
127
39
|
}
|
|
128
40
|
|
|
129
|
-
static
|
|
130
|
-
ContextHolder.
|
|
41
|
+
static setUser(user) {
|
|
42
|
+
ContextHolder.getInstance().user = user;
|
|
131
43
|
}
|
|
132
44
|
|
|
133
|
-
static
|
|
134
|
-
ContextHolder.
|
|
45
|
+
static setBasename(basename) {
|
|
46
|
+
ContextHolder.getInstance().basename = basename;
|
|
135
47
|
}
|
|
136
48
|
|
|
137
|
-
static setRequestSource(requestSource
|
|
138
|
-
ContextHolder.
|
|
49
|
+
static setRequestSource(requestSource) {
|
|
50
|
+
ContextHolder.getInstance().requestSource = requestSource;
|
|
139
51
|
}
|
|
140
52
|
|
|
141
|
-
static setOnRedirectTo(onRedirectTo
|
|
142
|
-
ContextHolder.
|
|
53
|
+
static setOnRedirectTo(onRedirectTo) {
|
|
54
|
+
ContextHolder.getInstance().onRedirectTo = onRedirectTo;
|
|
143
55
|
}
|
|
144
56
|
|
|
145
|
-
static setLogout(logout, logoutUrl
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
context.logout = callback => {
|
|
57
|
+
static setLogout(logout, logoutUrl) {
|
|
58
|
+
ContextHolder.getInstance().logout = callback => {
|
|
149
59
|
if (!callback) {
|
|
150
|
-
|
|
60
|
+
ContextHolder.onRedirectTo(logoutUrl);
|
|
151
61
|
} else {
|
|
152
62
|
logout(callback);
|
|
153
63
|
}
|
|
154
64
|
};
|
|
155
65
|
}
|
|
156
66
|
|
|
157
|
-
static setEntitlementsOptions(entitlementsOptions
|
|
158
|
-
ContextHolder.
|
|
67
|
+
static setEntitlementsOptions(entitlementsOptions) {
|
|
68
|
+
ContextHolder.getInstance().entitlementsOptions = entitlementsOptions;
|
|
159
69
|
}
|
|
160
70
|
|
|
161
|
-
static setSessionContext(sessionContext
|
|
162
|
-
ContextHolder.
|
|
71
|
+
static setSessionContext(sessionContext) {
|
|
72
|
+
const instance = ContextHolder.getInstance();
|
|
73
|
+
instance.sessionContext = sessionContext;
|
|
163
74
|
}
|
|
164
75
|
|
|
165
76
|
static setAppName(appName) {
|
|
166
|
-
ContextHolder.
|
|
77
|
+
ContextHolder.getInstance().appName = appName;
|
|
167
78
|
}
|
|
168
79
|
|
|
169
|
-
static getContext(
|
|
170
|
-
var _ContextHolder$
|
|
80
|
+
static getContext() {
|
|
81
|
+
var _ContextHolder$getIns;
|
|
171
82
|
|
|
172
|
-
return (_ContextHolder$
|
|
83
|
+
return (_ContextHolder$getIns = ContextHolder.getInstance().context) != null ? _ContextHolder$getIns : {
|
|
173
84
|
baseUrl: window.location.href,
|
|
174
85
|
tokenResolver: () => 'my-authentication-token',
|
|
175
86
|
logLevel: 'error'
|
|
176
87
|
};
|
|
177
88
|
}
|
|
178
89
|
|
|
179
|
-
static getAccessToken(
|
|
180
|
-
return ContextHolder.
|
|
90
|
+
static getAccessToken() {
|
|
91
|
+
return ContextHolder.getInstance().accessToken;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
static getRequestSource() {
|
|
95
|
+
return ContextHolder.getInstance().requestSource;
|
|
181
96
|
}
|
|
182
97
|
|
|
183
|
-
static
|
|
184
|
-
return ContextHolder.
|
|
98
|
+
static getUser() {
|
|
99
|
+
return ContextHolder.getInstance().user;
|
|
185
100
|
}
|
|
186
101
|
|
|
187
|
-
static
|
|
188
|
-
return ContextHolder.
|
|
102
|
+
static getBasename() {
|
|
103
|
+
return ContextHolder.getInstance().basename;
|
|
189
104
|
}
|
|
190
105
|
|
|
191
|
-
static onRedirectTo(path, opts
|
|
192
|
-
return ContextHolder.
|
|
106
|
+
static onRedirectTo(path, opts) {
|
|
107
|
+
return ContextHolder.getInstance().onRedirectTo(path, opts);
|
|
193
108
|
}
|
|
194
109
|
|
|
195
|
-
static logout(callback
|
|
196
|
-
return ContextHolder.
|
|
110
|
+
static logout(callback) {
|
|
111
|
+
return ContextHolder.getInstance().logout(callback);
|
|
197
112
|
}
|
|
198
113
|
|
|
199
|
-
static shouldLoadEntitlements(
|
|
200
|
-
var _ContextHolder$
|
|
114
|
+
static shouldLoadEntitlements() {
|
|
115
|
+
var _ContextHolder$getIns2;
|
|
201
116
|
|
|
202
|
-
return ((_ContextHolder$
|
|
117
|
+
return ((_ContextHolder$getIns2 = ContextHolder.getInstance().entitlementsOptions) == null ? void 0 : _ContextHolder$getIns2.enabled) || false;
|
|
203
118
|
}
|
|
204
119
|
|
|
205
|
-
static isSessionPerTenantEnabled(
|
|
206
|
-
var _ContextHolder$
|
|
120
|
+
static isSessionPerTenantEnabled() {
|
|
121
|
+
var _ContextHolder$getIns3;
|
|
207
122
|
|
|
208
|
-
return ((_ContextHolder$
|
|
123
|
+
return ((_ContextHolder$getIns3 = ContextHolder.getInstance().sessionContext) == null ? void 0 : _ContextHolder$getIns3.enableSessionPerTenant) || false;
|
|
209
124
|
}
|
|
210
125
|
|
|
211
|
-
static getAppName(
|
|
212
|
-
return ContextHolder.
|
|
126
|
+
static getAppName() {
|
|
127
|
+
return ContextHolder.getInstance().appName;
|
|
213
128
|
}
|
|
214
129
|
|
|
215
130
|
}
|
|
216
131
|
|
|
217
132
|
exports.ContextHolder = ContextHolder;
|
|
218
|
-
ContextHolder.
|
|
219
|
-
const DEFAULT_APP_NAME = 'default';
|
|
133
|
+
ContextHolder.instance = void 0;
|
|
220
134
|
const FronteggContext = {
|
|
221
|
-
getContext: () => ContextHolder.getContext(
|
|
222
|
-
getAccessToken: () => ContextHolder.getAccessToken(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
onRedirectTo: (path, opts) => ContextHolder.onRedirectTo(path, opts, DEFAULT_APP_NAME),
|
|
227
|
-
setOnRedirectTo: onRedirectTo => ContextHolder.setOnRedirectTo(onRedirectTo, DEFAULT_APP_NAME),
|
|
228
|
-
logout: callback => ContextHolder.logout(callback, DEFAULT_APP_NAME),
|
|
229
|
-
getRequestSource: () => ContextHolder.getRequestSource(DEFAULT_APP_NAME),
|
|
230
|
-
setRequestSource: requestSource => ContextHolder.setRequestSource(requestSource, DEFAULT_APP_NAME),
|
|
231
|
-
isSessionPerTenantEnabled: () => ContextHolder.isSessionPerTenantEnabled(DEFAULT_APP_NAME),
|
|
232
|
-
shouldLoadEntitlements: () => ContextHolder.shouldLoadEntitlements(DEFAULT_APP_NAME),
|
|
233
|
-
getAppName: () => ContextHolder.getAppName(DEFAULT_APP_NAME),
|
|
234
|
-
setEntitlementsOptions: entitlementsOptions => ContextHolder.setEntitlementsOptions(entitlementsOptions, DEFAULT_APP_NAME),
|
|
235
|
-
setSessionContext: sessionContext => ContextHolder.setSessionContext(sessionContext, DEFAULT_APP_NAME)
|
|
135
|
+
getContext: () => ContextHolder.getContext(),
|
|
136
|
+
getAccessToken: () => ContextHolder.getAccessToken(),
|
|
137
|
+
getUser: () => ContextHolder.getUser(),
|
|
138
|
+
onRedirectTo: (path, opts) => ContextHolder.onRedirectTo(path, opts),
|
|
139
|
+
logout: callback => ContextHolder.logout(callback)
|
|
236
140
|
};
|
|
237
141
|
exports.FronteggContext = FronteggContext;
|
|
@@ -3,37 +3,26 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getPublicSettings = getPublicSettings;
|
|
7
|
+
exports.getSettings = getSettings;
|
|
8
|
+
exports.updateSettings = updateSettings;
|
|
7
9
|
|
|
8
10
|
var _constants = require("../constants");
|
|
9
11
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
class AccountSettingsApi extends _BaseApiClient.BaseApiClient {
|
|
13
|
-
constructor(appName) {
|
|
14
|
-
super(appName);
|
|
15
|
-
|
|
16
|
-
this.updateSettings = async (body, options) => {
|
|
17
|
-
return this.put(_constants.urls.tenants.accountSettings.v1, body, {
|
|
18
|
-
headers: this.extractHeadersFromOptions(options)
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
this.getSettings = async options => {
|
|
23
|
-
return this.get(_constants.urls.tenants.accountSettings.v1, undefined, {
|
|
24
|
-
headers: this.extractHeadersFromOptions(options)
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
this.getPublicSettings = async () => {
|
|
29
|
-
return this.get(`${_constants.urls.tenants.accountSettings.v1}/public`);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
12
|
+
var _fetch = require("../fetch");
|
|
32
13
|
|
|
14
|
+
async function updateSettings(body, options) {
|
|
15
|
+
return (0, _fetch.Put)(_constants.urls.tenants.accountSettings.v1, body, {
|
|
16
|
+
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
17
|
+
});
|
|
33
18
|
}
|
|
34
19
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
async function getSettings(options) {
|
|
21
|
+
return (0, _fetch.Get)(_constants.urls.tenants.accountSettings.v1, undefined, {
|
|
22
|
+
headers: (0, _fetch.extractHeadersFromOptions)(options)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
38
25
|
|
|
39
|
-
|
|
26
|
+
async function getPublicSettings() {
|
|
27
|
+
return (0, _fetch.Get)(`${_constants.urls.tenants.accountSettings.v1}/public`);
|
|
28
|
+
}
|
|
@@ -3,65 +3,58 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.assignUserToApplications = assignUserToApplications;
|
|
7
|
+
exports.getApplicationsData = getApplicationsData;
|
|
8
|
+
exports.getTenantsApplications = getTenantsApplications;
|
|
9
|
+
exports.getUserApplicationsId = getUserApplicationsId;
|
|
10
|
+
exports.getUsersApplicationsId = getUsersApplicationsId;
|
|
11
|
+
exports.getUsersOfApplications = getUsersOfApplications;
|
|
12
|
+
exports.unassignUserFromApplications = unassignUserFromApplications;
|
|
7
13
|
|
|
8
14
|
var _constants = require("../constants");
|
|
9
15
|
|
|
10
|
-
var
|
|
16
|
+
var _fetch = require("../fetch");
|
|
11
17
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
userId
|
|
18
|
-
}) => {
|
|
19
|
-
return this.get(`${_constants.urls.identity.applications.v1}/${userId}/apps`);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
this.getUsersApplicationsId = async ({
|
|
23
|
-
userIds
|
|
24
|
-
}) => {
|
|
25
|
-
return this.get(`${_constants.urls.identity.applications.v1}/users-apps`, {
|
|
26
|
-
userIds: userIds.join(',')
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
this.getTenantsApplications = async () => {
|
|
31
|
-
return this.get(_constants.urls.applications.tenant.v1);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
this.getApplicationsData = async ({
|
|
35
|
-
appIds,
|
|
36
|
-
includeFreeAccess = true
|
|
37
|
-
}) => {
|
|
38
|
-
return this.get(_constants.urls.applications.v1, {
|
|
39
|
-
ids: appIds.join(','),
|
|
40
|
-
_includeFreeAccess: includeFreeAccess
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
this.assignUserToApplications = async body => {
|
|
45
|
-
return this.post(`${_constants.urls.identity.applications.v1}/apps-user`, body);
|
|
46
|
-
};
|
|
18
|
+
async function getUserApplicationsId({
|
|
19
|
+
userId
|
|
20
|
+
}) {
|
|
21
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.applications.v1}/${userId}/apps`);
|
|
22
|
+
}
|
|
47
23
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
24
|
+
async function getUsersApplicationsId({
|
|
25
|
+
userIds
|
|
26
|
+
}) {
|
|
27
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.applications.v1}/users-apps`, {
|
|
28
|
+
userIds: userIds.join(',')
|
|
29
|
+
});
|
|
30
|
+
}
|
|
51
31
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return this.get(`${_constants.urls.identity.applications.v1}/apps-users`, {
|
|
56
|
-
appIds: appIds.join(',')
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
}
|
|
32
|
+
async function getTenantsApplications() {
|
|
33
|
+
return (0, _fetch.Get)(_constants.urls.applications.tenant.v1);
|
|
34
|
+
}
|
|
60
35
|
|
|
36
|
+
async function getApplicationsData({
|
|
37
|
+
appIds,
|
|
38
|
+
includeFreeAccess = true
|
|
39
|
+
}) {
|
|
40
|
+
return (0, _fetch.Get)(_constants.urls.applications.v1, {
|
|
41
|
+
ids: appIds.join(','),
|
|
42
|
+
_includeFreeAccess: includeFreeAccess
|
|
43
|
+
});
|
|
61
44
|
}
|
|
62
45
|
|
|
63
|
-
|
|
46
|
+
async function assignUserToApplications(body) {
|
|
47
|
+
return (0, _fetch.Post)(`${_constants.urls.identity.applications.v1}/apps-user`, body);
|
|
48
|
+
}
|
|
64
49
|
|
|
65
|
-
|
|
50
|
+
async function unassignUserFromApplications(body) {
|
|
51
|
+
return (0, _fetch.Delete)(`${_constants.urls.identity.applications.v1}/user-apps`, body);
|
|
52
|
+
}
|
|
66
53
|
|
|
67
|
-
|
|
54
|
+
async function getUsersOfApplications({
|
|
55
|
+
appIds
|
|
56
|
+
}) {
|
|
57
|
+
return (0, _fetch.Get)(`${_constants.urls.identity.applications.v1}/apps-users`, {
|
|
58
|
+
appIds: appIds.join(',')
|
|
59
|
+
});
|
|
60
|
+
}
|
package/node/audits/index.js
CHANGED
|
@@ -5,44 +5,33 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.exportAudits = exportAudits;
|
|
9
|
+
exports.getAudits = getAudits;
|
|
10
|
+
exports.getAuditsStats = getAuditsStats;
|
|
9
11
|
|
|
10
12
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
13
|
|
|
12
|
-
var
|
|
14
|
+
var _fetch = require("../fetch");
|
|
13
15
|
|
|
14
|
-
var
|
|
16
|
+
var _constants = require("../constants");
|
|
15
17
|
|
|
16
18
|
const _excluded = ["endpoint", "headerProps"];
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
super(appName);
|
|
21
|
-
|
|
22
|
-
this.getAudits = async params => {
|
|
23
|
-
return this.get(_constants.urls.audits.v1, params);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
this.getAuditsStats = async params => {
|
|
27
|
-
return this.get(`${_constants.urls.audits.v1}/stats`, params);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
this.exportAudits = async params => {
|
|
31
|
-
const {
|
|
32
|
-
endpoint,
|
|
33
|
-
headerProps
|
|
34
|
-
} = params,
|
|
35
|
-
restParams = (0, _objectWithoutPropertiesLoose2.default)(params, _excluded);
|
|
36
|
-
return this.postDownload(`${_constants.urls.audits.v1}/export/${endpoint}`, {
|
|
37
|
-
properties: headerProps
|
|
38
|
-
}, restParams);
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
20
|
+
async function getAudits(params) {
|
|
21
|
+
return (0, _fetch.Get)(_constants.urls.audits.v1, params);
|
|
42
22
|
}
|
|
43
23
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
24
|
+
async function getAuditsStats(params) {
|
|
25
|
+
return (0, _fetch.Get)(`${_constants.urls.audits.v1}/stats`, params);
|
|
26
|
+
}
|
|
47
27
|
|
|
48
|
-
|
|
28
|
+
async function exportAudits(params) {
|
|
29
|
+
const {
|
|
30
|
+
endpoint,
|
|
31
|
+
headerProps
|
|
32
|
+
} = params,
|
|
33
|
+
restParams = (0, _objectWithoutPropertiesLoose2.default)(params, _excluded);
|
|
34
|
+
return (0, _fetch.PostDownload)(`${_constants.urls.audits.v1}/export/${endpoint}`, {
|
|
35
|
+
properties: headerProps
|
|
36
|
+
}, restParams);
|
|
37
|
+
}
|