@frontegg/rest-api 3.0.1 → 3.0.4
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.js +67 -101
- package/account-settings/index.js +4 -43
- package/audits/index.js +16 -69
- package/auth/enums.js +2 -2
- package/auth/index.d.ts +4 -0
- package/auth/index.js +354 -2044
- package/auth/interfaces.js +1 -1
- package/auth/secutiry-poilicy/index.js +45 -254
- package/connectivity/index.js +79 -73
- package/constants.js +1 -1
- package/error.js +9 -33
- package/fetch.js +165 -519
- package/index.js +26 -26
- package/jwt.js +19 -45
- package/metadata/index.js +19 -159
- package/node/ContextHolder.js +68 -104
- package/node/account-settings/index.js +4 -46
- package/node/audits/index.js +15 -68
- package/node/auth/enums.js +2 -2
- package/node/auth/index.js +487 -2099
- package/node/auth/interfaces.js +2 -2
- package/node/auth/secutiry-poilicy/index.js +36 -240
- package/node/connectivity/index.js +78 -71
- package/node/constants.js +1 -1
- package/node/error.js +9 -38
- package/node/fetch.js +166 -521
- package/node/index.js +47 -49
- package/node/jwt.js +19 -51
- package/node/metadata/index.js +19 -163
- package/node/notifications/index.js +18 -94
- package/node/reports/index.js +62 -171
- package/node/roles/index.js +34 -172
- package/node/routers.js +2 -2
- package/node/sub-tenants/index.js +12 -126
- package/node/subscriptions/enums.js +4 -4
- package/node/subscriptions/index.js +10 -10
- package/node/subscriptions/interfaces.js +1 -1
- package/node/subscriptions/invoices.js +10 -70
- package/node/subscriptions/managedSubscriptions.js +16 -111
- package/node/subscriptions/paymentMethods.js +15 -69
- package/node/subscriptions/paymentProviders.js +2 -26
- package/node/subscriptions/plans.js +4 -46
- package/node/subscriptions/providers/index.js +1 -1
- package/node/subscriptions/providers/stripe/index.js +10 -106
- package/node/subscriptions/subscriptions.js +16 -111
- package/node/subscriptions/summaries.js +2 -26
- package/node/subscriptions/tenantConfiguration.js +4 -46
- package/node/teams/index.js +57 -406
- package/node/tenants/index.js +8 -86
- package/node/vendor/index.js +2 -26
- package/notifications/index.js +18 -93
- package/package.json +1 -1
- package/reports/index.js +65 -175
- package/roles/index.js +34 -175
- package/routers.js +2 -2
- package/sub-tenants/index.js +12 -127
- package/subscriptions/enums.js +4 -4
- package/subscriptions/invoices.js +12 -70
- package/subscriptions/managedSubscriptions.js +20 -115
- package/subscriptions/paymentMethods.js +16 -70
- package/subscriptions/paymentProviders.js +2 -22
- package/subscriptions/plans.js +4 -43
- package/subscriptions/providers/stripe/index.js +10 -106
- package/subscriptions/subscriptions.js +20 -115
- package/subscriptions/summaries.js +2 -22
- package/subscriptions/tenantConfiguration.js +4 -43
- package/teams/index.js +56 -420
- package/tenants/index.js +8 -85
- package/vendor/index.js +2 -23
package/teams/index.js
CHANGED
|
@@ -1,445 +1,81 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
2
|
import { Get, Post, Put, Delete, Patch } from '../fetch';
|
|
6
3
|
import { urls } from '../constants';
|
|
7
|
-
export function getProfile(
|
|
8
|
-
return
|
|
4
|
+
export async function getProfile(params) {
|
|
5
|
+
return Get(`${urls.identity.users.v2}/me`, params != null ? params : {
|
|
6
|
+
addRoles: true
|
|
7
|
+
});
|
|
9
8
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
_getProfile = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(params) {
|
|
13
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
14
|
-
while (1) {
|
|
15
|
-
switch (_context.prev = _context.next) {
|
|
16
|
-
case 0:
|
|
17
|
-
return _context.abrupt("return", Get("".concat(urls.identity.users.v2, "/me"), params != null ? params : {
|
|
18
|
-
addRoles: true
|
|
19
|
-
}));
|
|
20
|
-
|
|
21
|
-
case 1:
|
|
22
|
-
case "end":
|
|
23
|
-
return _context.stop();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}, _callee);
|
|
27
|
-
}));
|
|
28
|
-
return _getProfile.apply(this, arguments);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function updateProfile(_x2) {
|
|
32
|
-
return _updateProfile.apply(this, arguments);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function _updateProfile() {
|
|
36
|
-
_updateProfile = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(body) {
|
|
37
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
38
|
-
while (1) {
|
|
39
|
-
switch (_context2.prev = _context2.next) {
|
|
40
|
-
case 0:
|
|
41
|
-
return _context2.abrupt("return", Put("".concat(urls.identity.users.v2, "/me"), body));
|
|
42
|
-
|
|
43
|
-
case 1:
|
|
44
|
-
case "end":
|
|
45
|
-
return _context2.stop();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}, _callee2);
|
|
49
|
-
}));
|
|
50
|
-
return _updateProfile.apply(this, arguments);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function updateProfileImage(_x3) {
|
|
54
|
-
return _updateProfileImage.apply(this, arguments);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function _updateProfileImage() {
|
|
58
|
-
_updateProfileImage = _asyncToGenerator(_regeneratorRuntime.mark(function _callee3(body) {
|
|
59
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
60
|
-
while (1) {
|
|
61
|
-
switch (_context3.prev = _context3.next) {
|
|
62
|
-
case 0:
|
|
63
|
-
return _context3.abrupt("return", Put("".concat(urls.team.profile.v1, "/me/image/v1"), body, {
|
|
64
|
-
responseType: 'plain',
|
|
65
|
-
contentType: undefined
|
|
66
|
-
}));
|
|
67
|
-
|
|
68
|
-
case 1:
|
|
69
|
-
case "end":
|
|
70
|
-
return _context3.stop();
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}, _callee3);
|
|
74
|
-
}));
|
|
75
|
-
return _updateProfileImage.apply(this, arguments);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function changePassword(_x4) {
|
|
79
|
-
return _changePassword.apply(this, arguments);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _changePassword() {
|
|
83
|
-
_changePassword = _asyncToGenerator(_regeneratorRuntime.mark(function _callee4(body) {
|
|
84
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
85
|
-
while (1) {
|
|
86
|
-
switch (_context4.prev = _context4.next) {
|
|
87
|
-
case 0:
|
|
88
|
-
return _context4.abrupt("return", Post("".concat(urls.identity.users.v1, "/passwords/change"), body));
|
|
89
|
-
|
|
90
|
-
case 1:
|
|
91
|
-
case "end":
|
|
92
|
-
return _context4.stop();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}, _callee4);
|
|
96
|
-
}));
|
|
97
|
-
return _changePassword.apply(this, arguments);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function loadUsers(_x5) {
|
|
101
|
-
return _loadUsers.apply(this, arguments);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function _loadUsers() {
|
|
105
|
-
_loadUsers = _asyncToGenerator(_regeneratorRuntime.mark(function _callee5(params) {
|
|
106
|
-
var _params$sort, _params$sort$0$id, _params$sort2, _params$sort2$, _params$sort3, _params$sort3$;
|
|
107
|
-
|
|
108
|
-
var filters, sorts;
|
|
109
|
-
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
110
|
-
while (1) {
|
|
111
|
-
switch (_context5.prev = _context5.next) {
|
|
112
|
-
case 0:
|
|
113
|
-
filters = (params.filter || []).reduce(function (p, n) {
|
|
114
|
-
return _extends({}, p, _defineProperty({}, n.id, n.value));
|
|
115
|
-
}, {});
|
|
116
|
-
sorts = (_params$sort = params.sort) != null && _params$sort.length ? {
|
|
117
|
-
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',
|
|
118
|
-
sortDirection: (_params$sort3 = params.sort) != null && (_params$sort3$ = _params$sort3[0]) != null && _params$sort3$.desc ? 'desc' : 'asc'
|
|
119
|
-
} : null;
|
|
120
|
-
return _context5.abrupt("return", Get(urls.team.members.v1, _extends({
|
|
121
|
-
pageOffset: params.pageOffset,
|
|
122
|
-
pageSize: params.pageSize
|
|
123
|
-
}, filters, sorts)));
|
|
124
|
-
|
|
125
|
-
case 3:
|
|
126
|
-
case "end":
|
|
127
|
-
return _context5.stop();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}, _callee5);
|
|
131
|
-
}));
|
|
132
|
-
return _loadUsers.apply(this, arguments);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export function addUser(_x6) {
|
|
136
|
-
return _addUser.apply(this, arguments);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function _addUser() {
|
|
140
|
-
_addUser = _asyncToGenerator(_regeneratorRuntime.mark(function _callee6(body) {
|
|
141
|
-
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
142
|
-
while (1) {
|
|
143
|
-
switch (_context6.prev = _context6.next) {
|
|
144
|
-
case 0:
|
|
145
|
-
return _context6.abrupt("return", Post(urls.identity.users.v2, _extends({}, body, {
|
|
146
|
-
provider: 'local'
|
|
147
|
-
})));
|
|
148
|
-
|
|
149
|
-
case 1:
|
|
150
|
-
case "end":
|
|
151
|
-
return _context6.stop();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}, _callee6);
|
|
155
|
-
}));
|
|
156
|
-
return _addUser.apply(this, arguments);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export function deleteUser(_x7) {
|
|
160
|
-
return _deleteUser.apply(this, arguments);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function _deleteUser() {
|
|
164
|
-
_deleteUser = _asyncToGenerator(_regeneratorRuntime.mark(function _callee7(body) {
|
|
165
|
-
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
166
|
-
while (1) {
|
|
167
|
-
switch (_context7.prev = _context7.next) {
|
|
168
|
-
case 0:
|
|
169
|
-
return _context7.abrupt("return", Delete("".concat(urls.team.members.v1, "/").concat(body.userId)));
|
|
170
|
-
|
|
171
|
-
case 1:
|
|
172
|
-
case "end":
|
|
173
|
-
return _context7.stop();
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}, _callee7);
|
|
177
|
-
}));
|
|
178
|
-
return _deleteUser.apply(this, arguments);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export function updateUser(_x8) {
|
|
182
|
-
return _updateUser.apply(this, arguments);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function _updateUser() {
|
|
186
|
-
_updateUser = _asyncToGenerator(_regeneratorRuntime.mark(function _callee8(body) {
|
|
187
|
-
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
188
|
-
while (1) {
|
|
189
|
-
switch (_context8.prev = _context8.next) {
|
|
190
|
-
case 0:
|
|
191
|
-
return _context8.abrupt("return", Put(urls.team.members.v1, body));
|
|
192
|
-
|
|
193
|
-
case 1:
|
|
194
|
-
case "end":
|
|
195
|
-
return _context8.stop();
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}, _callee8);
|
|
199
|
-
}));
|
|
200
|
-
return _updateUser.apply(this, arguments);
|
|
9
|
+
export async function updateProfile(body) {
|
|
10
|
+
return Put(`${urls.identity.users.v2}/me`, body);
|
|
201
11
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
12
|
+
export async function updateProfileImage(body) {
|
|
13
|
+
return Put(`${urls.team.profile.v1}/me/image/v1`, body, {
|
|
14
|
+
responseType: 'plain',
|
|
15
|
+
contentType: undefined
|
|
16
|
+
});
|
|
205
17
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
_createInviteUserLink = _asyncToGenerator(_regeneratorRuntime.mark(function _callee9(body) {
|
|
209
|
-
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
210
|
-
while (1) {
|
|
211
|
-
switch (_context9.prev = _context9.next) {
|
|
212
|
-
case 0:
|
|
213
|
-
return _context9.abrupt("return", Post(urls.identity.tenants.invites.user.v1, _extends({}, body)));
|
|
214
|
-
|
|
215
|
-
case 1:
|
|
216
|
-
case "end":
|
|
217
|
-
return _context9.stop();
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}, _callee9);
|
|
221
|
-
}));
|
|
222
|
-
return _createInviteUserLink.apply(this, arguments);
|
|
18
|
+
export async function changePassword(body) {
|
|
19
|
+
return Post(`${urls.identity.users.v1}/passwords/change`, body);
|
|
223
20
|
}
|
|
21
|
+
export async function loadUsers(params) {
|
|
22
|
+
var _params$sort, _params$sort$0$id, _params$sort2, _params$sort2$, _params$sort3, _params$sort3$;
|
|
224
23
|
|
|
225
|
-
|
|
226
|
-
|
|
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));
|
|
227
35
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
232
|
-
while (1) {
|
|
233
|
-
switch (_context10.prev = _context10.next) {
|
|
234
|
-
case 0:
|
|
235
|
-
return _context10.abrupt("return", Patch(urls.identity.tenants.invites.user.v1, _extends({}, body)));
|
|
236
|
-
|
|
237
|
-
case 1:
|
|
238
|
-
case "end":
|
|
239
|
-
return _context10.stop();
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}, _callee10);
|
|
36
|
+
export async function addUser(body) {
|
|
37
|
+
return Post(urls.identity.users.v2, _extends({}, body, {
|
|
38
|
+
provider: 'local'
|
|
243
39
|
}));
|
|
244
|
-
return _updateInviteUserLink.apply(this, arguments);
|
|
245
40
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return _deleteInviteUserLink.apply(this, arguments);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
function _deleteInviteUserLink() {
|
|
252
|
-
_deleteInviteUserLink = _asyncToGenerator(_regeneratorRuntime.mark(function _callee11() {
|
|
253
|
-
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
254
|
-
while (1) {
|
|
255
|
-
switch (_context11.prev = _context11.next) {
|
|
256
|
-
case 0:
|
|
257
|
-
return _context11.abrupt("return", Delete(urls.identity.tenants.invites.user.v1));
|
|
258
|
-
|
|
259
|
-
case 1:
|
|
260
|
-
case "end":
|
|
261
|
-
return _context11.stop();
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}, _callee11);
|
|
265
|
-
}));
|
|
266
|
-
return _deleteInviteUserLink.apply(this, arguments);
|
|
41
|
+
export async function deleteUser(body) {
|
|
42
|
+
return Delete(`${urls.team.members.v1}/${body.userId}`);
|
|
267
43
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
return _getInviteUserLink.apply(this, arguments);
|
|
44
|
+
export async function updateUser(body) {
|
|
45
|
+
return Put(urls.team.members.v1, body);
|
|
271
46
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
_getInviteUserLink = _asyncToGenerator(_regeneratorRuntime.mark(function _callee12() {
|
|
275
|
-
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
276
|
-
while (1) {
|
|
277
|
-
switch (_context12.prev = _context12.next) {
|
|
278
|
-
case 0:
|
|
279
|
-
return _context12.abrupt("return", Get(urls.identity.tenants.invites.user.v1));
|
|
280
|
-
|
|
281
|
-
case 1:
|
|
282
|
-
case "end":
|
|
283
|
-
return _context12.stop();
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}, _callee12);
|
|
287
|
-
}));
|
|
288
|
-
return _getInviteUserLink.apply(this, arguments);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
export function getInviteLinkConfiguration() {
|
|
292
|
-
return _getInviteLinkConfiguration.apply(this, arguments);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
function _getInviteLinkConfiguration() {
|
|
296
|
-
_getInviteLinkConfiguration = _asyncToGenerator(_regeneratorRuntime.mark(function _callee13() {
|
|
297
|
-
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
298
|
-
while (1) {
|
|
299
|
-
switch (_context13.prev = _context13.next) {
|
|
300
|
-
case 0:
|
|
301
|
-
return _context13.abrupt("return", Get(urls.identity.tenants.invites.configuration.v1));
|
|
302
|
-
|
|
303
|
-
case 1:
|
|
304
|
-
case "end":
|
|
305
|
-
return _context13.stop();
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}, _callee13);
|
|
309
|
-
}));
|
|
310
|
-
return _getInviteLinkConfiguration.apply(this, arguments);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export function loadAvailableRoles() {
|
|
314
|
-
return _loadAvailableRoles.apply(this, arguments);
|
|
47
|
+
export async function createInviteUserLink(body) {
|
|
48
|
+
return Post(urls.identity.tenants.invites.user.v1, _extends({}, body));
|
|
315
49
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
_loadAvailableRoles = _asyncToGenerator(_regeneratorRuntime.mark(function _callee14() {
|
|
319
|
-
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
320
|
-
while (1) {
|
|
321
|
-
switch (_context14.prev = _context14.next) {
|
|
322
|
-
case 0:
|
|
323
|
-
return _context14.abrupt("return", Get(urls.team.roles.v1));
|
|
324
|
-
|
|
325
|
-
case 1:
|
|
326
|
-
case "end":
|
|
327
|
-
return _context14.stop();
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
}, _callee14);
|
|
331
|
-
}));
|
|
332
|
-
return _loadAvailableRoles.apply(this, arguments);
|
|
50
|
+
export async function updateInviteUserLink(body) {
|
|
51
|
+
return Patch(urls.identity.tenants.invites.user.v1, _extends({}, body));
|
|
333
52
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
return _loadAvailablePermissions.apply(this, arguments);
|
|
53
|
+
export async function deleteInviteUserLink() {
|
|
54
|
+
return Delete(urls.identity.tenants.invites.user.v1);
|
|
337
55
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
_loadAvailablePermissions = _asyncToGenerator(_regeneratorRuntime.mark(function _callee15() {
|
|
341
|
-
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
342
|
-
while (1) {
|
|
343
|
-
switch (_context15.prev = _context15.next) {
|
|
344
|
-
case 0:
|
|
345
|
-
return _context15.abrupt("return", Get(urls.identity.permissions.v1));
|
|
346
|
-
|
|
347
|
-
case 1:
|
|
348
|
-
case "end":
|
|
349
|
-
return _context15.stop();
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}, _callee15);
|
|
353
|
-
}));
|
|
354
|
-
return _loadAvailablePermissions.apply(this, arguments);
|
|
56
|
+
export async function getInviteUserLink() {
|
|
57
|
+
return Get(urls.identity.tenants.invites.user.v1);
|
|
355
58
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
return _loadStats.apply(this, arguments);
|
|
59
|
+
export async function getInviteLinkConfiguration() {
|
|
60
|
+
return Get(urls.identity.tenants.invites.configuration.v1);
|
|
359
61
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
_loadStats = _asyncToGenerator(_regeneratorRuntime.mark(function _callee16() {
|
|
363
|
-
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
364
|
-
while (1) {
|
|
365
|
-
switch (_context16.prev = _context16.next) {
|
|
366
|
-
case 0:
|
|
367
|
-
return _context16.abrupt("return", Get("".concat(urls.team.stats.v1, "/members")));
|
|
368
|
-
|
|
369
|
-
case 1:
|
|
370
|
-
case "end":
|
|
371
|
-
return _context16.stop();
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
}, _callee16);
|
|
375
|
-
}));
|
|
376
|
-
return _loadStats.apply(this, arguments);
|
|
62
|
+
export async function loadAvailableRoles() {
|
|
63
|
+
return Get(urls.team.roles.v1);
|
|
377
64
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
return _resendActivationLink.apply(this, arguments);
|
|
65
|
+
export async function loadAvailablePermissions() {
|
|
66
|
+
return Get(urls.identity.permissions.v1);
|
|
381
67
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
_resendActivationLink = _asyncToGenerator(_regeneratorRuntime.mark(function _callee17(body) {
|
|
385
|
-
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
386
|
-
while (1) {
|
|
387
|
-
switch (_context17.prev = _context17.next) {
|
|
388
|
-
case 0:
|
|
389
|
-
return _context17.abrupt("return", Post("".concat(urls.team.members.v1, "/").concat(body.userId, "/resendActivationEmail"), {}));
|
|
390
|
-
|
|
391
|
-
case 1:
|
|
392
|
-
case "end":
|
|
393
|
-
return _context17.stop();
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}, _callee17);
|
|
397
|
-
}));
|
|
398
|
-
return _resendActivationLink.apply(this, arguments);
|
|
68
|
+
export async function loadStats() {
|
|
69
|
+
return Get(`${urls.team.stats.v1}/members`);
|
|
399
70
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
return _resendInvitationLink.apply(this, arguments);
|
|
71
|
+
export async function resendActivationLink(body) {
|
|
72
|
+
return Post(`${urls.team.members.v1}/${body.userId}/resendActivationEmail`, {});
|
|
403
73
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
408
|
-
while (1) {
|
|
409
|
-
switch (_context18.prev = _context18.next) {
|
|
410
|
-
case 0:
|
|
411
|
-
return _context18.abrupt("return", Post(urls.identity.users.v2, _extends({}, body, {
|
|
412
|
-
provider: 'local'
|
|
413
|
-
})));
|
|
414
|
-
|
|
415
|
-
case 1:
|
|
416
|
-
case "end":
|
|
417
|
-
return _context18.stop();
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}, _callee18);
|
|
74
|
+
export async function resendInvitationLink(body) {
|
|
75
|
+
return Post(urls.identity.users.v2, _extends({}, body, {
|
|
76
|
+
provider: 'local'
|
|
421
77
|
}));
|
|
422
|
-
return _resendInvitationLink.apply(this, arguments);
|
|
423
78
|
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
return _resendInvitationLinkToAllTenants.apply(this, arguments);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
function _resendInvitationLinkToAllTenants() {
|
|
430
|
-
_resendInvitationLinkToAllTenants = _asyncToGenerator(_regeneratorRuntime.mark(function _callee19(body) {
|
|
431
|
-
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
432
|
-
while (1) {
|
|
433
|
-
switch (_context19.prev = _context19.next) {
|
|
434
|
-
case 0:
|
|
435
|
-
return _context19.abrupt("return", Post(urls.identity.users.invitation.resendAll.v1, _extends({}, body)));
|
|
436
|
-
|
|
437
|
-
case 1:
|
|
438
|
-
case "end":
|
|
439
|
-
return _context19.stop();
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}, _callee19);
|
|
443
|
-
}));
|
|
444
|
-
return _resendInvitationLinkToAllTenants.apply(this, arguments);
|
|
79
|
+
export async function resendInvitationLinkToAllTenants(body) {
|
|
80
|
+
return Post(urls.identity.users.invitation.resendAll.v1, _extends({}, body));
|
|
445
81
|
}
|
package/tenants/index.js
CHANGED
|
@@ -1,91 +1,14 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
1
|
import { Get, Put } from '../fetch';
|
|
4
2
|
import { urls } from '../constants';
|
|
5
|
-
export function switchTenant(
|
|
6
|
-
return
|
|
3
|
+
export async function switchTenant(body) {
|
|
4
|
+
return Put(`${urls.identity.users.v1}/tenant`, body);
|
|
7
5
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
_switchTenant = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(body) {
|
|
11
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
12
|
-
while (1) {
|
|
13
|
-
switch (_context.prev = _context.next) {
|
|
14
|
-
case 0:
|
|
15
|
-
return _context.abrupt("return", Put("".concat(urls.identity.users.v1, "/tenant"), body));
|
|
16
|
-
|
|
17
|
-
case 1:
|
|
18
|
-
case "end":
|
|
19
|
-
return _context.stop();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}, _callee);
|
|
23
|
-
}));
|
|
24
|
-
return _switchTenant.apply(this, arguments);
|
|
6
|
+
export async function getTenants() {
|
|
7
|
+
return Get(`${urls.identity.users.v2}/me/tenants`);
|
|
25
8
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return _getTenants.apply(this, arguments);
|
|
9
|
+
export async function getSubTenants() {
|
|
10
|
+
return Get(urls.tenants.hierarchy.v1);
|
|
29
11
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
_getTenants = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2() {
|
|
33
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
34
|
-
while (1) {
|
|
35
|
-
switch (_context2.prev = _context2.next) {
|
|
36
|
-
case 0:
|
|
37
|
-
return _context2.abrupt("return", Get("".concat(urls.identity.users.v2, "/me/tenants")));
|
|
38
|
-
|
|
39
|
-
case 1:
|
|
40
|
-
case "end":
|
|
41
|
-
return _context2.stop();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}, _callee2);
|
|
45
|
-
}));
|
|
46
|
-
return _getTenants.apply(this, arguments);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function getSubTenants() {
|
|
50
|
-
return _getSubTenants.apply(this, arguments);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function _getSubTenants() {
|
|
54
|
-
_getSubTenants = _asyncToGenerator(_regeneratorRuntime.mark(function _callee3() {
|
|
55
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
56
|
-
while (1) {
|
|
57
|
-
switch (_context3.prev = _context3.next) {
|
|
58
|
-
case 0:
|
|
59
|
-
return _context3.abrupt("return", Get(urls.tenants.hierarchy.v1));
|
|
60
|
-
|
|
61
|
-
case 1:
|
|
62
|
-
case "end":
|
|
63
|
-
return _context3.stop();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}, _callee3);
|
|
67
|
-
}));
|
|
68
|
-
return _getSubTenants.apply(this, arguments);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function getSubTenantsAsTree() {
|
|
72
|
-
return _getSubTenantsAsTree.apply(this, arguments);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function _getSubTenantsAsTree() {
|
|
76
|
-
_getSubTenantsAsTree = _asyncToGenerator(_regeneratorRuntime.mark(function _callee4() {
|
|
77
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
78
|
-
while (1) {
|
|
79
|
-
switch (_context4.prev = _context4.next) {
|
|
80
|
-
case 0:
|
|
81
|
-
return _context4.abrupt("return", Get(urls.tenants.hierarchy.tree.v1));
|
|
82
|
-
|
|
83
|
-
case 1:
|
|
84
|
-
case "end":
|
|
85
|
-
return _context4.stop();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}, _callee4);
|
|
89
|
-
}));
|
|
90
|
-
return _getSubTenantsAsTree.apply(this, arguments);
|
|
12
|
+
export async function getSubTenantsAsTree() {
|
|
13
|
+
return Get(urls.tenants.hierarchy.tree.v1);
|
|
91
14
|
}
|
package/vendor/index.js
CHANGED
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
1
|
import { Get } from '../fetch';
|
|
4
2
|
import { urls } from '../constants';
|
|
5
|
-
export function getVendorPublicInfo() {
|
|
6
|
-
return
|
|
3
|
+
export async function getVendorPublicInfo() {
|
|
4
|
+
return Get(`${urls.vendor}/public`);
|
|
7
5
|
}
|
|
8
|
-
|
|
9
|
-
function _getVendorPublicInfo() {
|
|
10
|
-
_getVendorPublicInfo = _asyncToGenerator(_regeneratorRuntime.mark(function _callee() {
|
|
11
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
12
|
-
while (1) {
|
|
13
|
-
switch (_context.prev = _context.next) {
|
|
14
|
-
case 0:
|
|
15
|
-
return _context.abrupt("return", Get("".concat(urls.vendor, "/public")));
|
|
16
|
-
|
|
17
|
-
case 1:
|
|
18
|
-
case "end":
|
|
19
|
-
return _context.stop();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}, _callee);
|
|
23
|
-
}));
|
|
24
|
-
return _getVendorPublicInfo.apply(this, arguments);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
6
|
;
|