@atlaskit/teams-client 4.33.0 → 4.33.1
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/CHANGELOG.md +8 -0
- package/dist/cjs/common/utils/http.js +8 -8
- package/dist/cjs/common/utils/permissions/has-permission.js +4 -0
- package/dist/cjs/common/utils/ufo/index.js +2 -2
- package/dist/cjs/services/agg-client/index.js +28 -28
- package/dist/cjs/services/directory-client/index.js +38 -36
- package/dist/cjs/services/graphql-client/main.js +13 -12
- package/dist/cjs/services/graphql-client/utils/index.js +32 -31
- package/dist/cjs/services/identity-client/index.js +10 -10
- package/dist/cjs/services/invitations-client/index.js +40 -38
- package/dist/cjs/services/legion-client/index.js +163 -162
- package/dist/cjs/services/main.js +162 -162
- package/dist/cjs/services/mutability-client/index.js +1 -1
- package/dist/cjs/services/object-resolver-client/index.js +18 -18
- package/dist/cjs/services/public-api-client/index.js +69 -68
- package/dist/cjs/services/replines-client/index.js +2 -2
- package/dist/cjs/services/reporting-lines-client/index.js +4 -4
- package/dist/cjs/services/rest-client/index.js +28 -28
- package/dist/cjs/services/rest-client/utils/parse-error-message.js +18 -18
- package/dist/cjs/services/sentry/main.js +23 -22
- package/dist/cjs/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/cjs/services/sentry/utils/initialise-sentry.js +6 -6
- package/dist/cjs/services/sentry/utils/sentry-client.js +20 -19
- package/dist/cjs/services/sentry/utils/use-teams-sentry-client-setup.js +4 -4
- package/dist/cjs/services/team-central-client/index.js +36 -36
- package/dist/cjs/services/teams-in-slack-client/index.js +3 -3
- package/dist/cjs/services/use-query-light/main.js +38 -38
- package/dist/cjs/services/user-preferences-client/index.js +6 -6
- package/dist/es2019/common/utils/permissions/has-permission.js +4 -0
- package/dist/es2019/common/utils/ufo/index.js +2 -2
- package/dist/es2019/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/esm/common/utils/http.js +8 -8
- package/dist/esm/common/utils/permissions/has-permission.js +4 -0
- package/dist/esm/common/utils/ufo/index.js +2 -2
- package/dist/esm/services/agg-client/index.js +28 -28
- package/dist/esm/services/directory-client/index.js +38 -36
- package/dist/esm/services/graphql-client/main.js +13 -12
- package/dist/esm/services/graphql-client/utils/index.js +32 -31
- package/dist/esm/services/identity-client/index.js +10 -10
- package/dist/esm/services/invitations-client/index.js +40 -38
- package/dist/esm/services/legion-client/index.js +163 -162
- package/dist/esm/services/main.js +162 -162
- package/dist/esm/services/mutability-client/index.js +1 -1
- package/dist/esm/services/object-resolver-client/index.js +18 -18
- package/dist/esm/services/public-api-client/index.js +69 -68
- package/dist/esm/services/replines-client/index.js +2 -2
- package/dist/esm/services/reporting-lines-client/index.js +4 -4
- package/dist/esm/services/rest-client/index.js +28 -28
- package/dist/esm/services/rest-client/utils/parse-error-message.js +18 -18
- package/dist/esm/services/sentry/main.js +23 -22
- package/dist/esm/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/esm/services/sentry/utils/initialise-sentry.js +6 -6
- package/dist/esm/services/sentry/utils/sentry-client.js +19 -18
- package/dist/esm/services/sentry/utils/use-teams-sentry-client-setup.js +4 -4
- package/dist/esm/services/team-central-client/index.js +36 -36
- package/dist/esm/services/teams-in-slack-client/index.js +3 -3
- package/dist/esm/services/use-query-light/main.js +38 -38
- package/dist/esm/services/user-preferences-client/index.js +6 -6
- package/dist/types/common/utils/permissions/has-permission.d.ts +4 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types-ts4.5/common/utils/permissions/has-permission.d.ts +4 -0
- package/dist/types-ts4.5/types/index.d.ts +1 -1
- package/package.json +2 -1
|
@@ -86,16 +86,16 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
86
86
|
value: function () {
|
|
87
87
|
var _getTeamById = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(teamId, cloudId) {
|
|
88
88
|
var siteId, teamResponse;
|
|
89
|
-
return _regenerator.default.wrap(function
|
|
89
|
+
return _regenerator.default.wrap(function (_context) {
|
|
90
90
|
while (1) switch (_context.prev = _context.next) {
|
|
91
91
|
case 0:
|
|
92
92
|
siteId = this.getCloudId(cloudId);
|
|
93
|
-
_context.next =
|
|
93
|
+
_context.next = 1;
|
|
94
94
|
return this.getResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "?siteId=").concat(siteId));
|
|
95
|
-
case
|
|
95
|
+
case 1:
|
|
96
96
|
teamResponse = _context.sent;
|
|
97
97
|
return _context.abrupt("return", this.mapTeamResponseV4ToTeam(teamResponse));
|
|
98
|
-
case
|
|
98
|
+
case 2:
|
|
99
99
|
case "end":
|
|
100
100
|
return _context.stop();
|
|
101
101
|
}
|
|
@@ -111,15 +111,15 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
111
111
|
value: function () {
|
|
112
112
|
var _getAllTeams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(allTeamsQuery) {
|
|
113
113
|
var _this2 = this;
|
|
114
|
-
var _allTeamsQuery$enable, _orgId, _siteId, enablePagination, _yield$this$postResou, entities, _cursor, teams;
|
|
115
|
-
return _regenerator.default.wrap(function
|
|
114
|
+
var _allTeamsQuery$enable, _orgId, _siteId, enablePagination, _yield$this$postResou, entities, _cursor, teams, _t;
|
|
115
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
116
116
|
while (1) switch (_context2.prev = _context2.next) {
|
|
117
117
|
case 0:
|
|
118
118
|
_context2.prev = 0;
|
|
119
119
|
_orgId = this.getOrgId(allTeamsQuery.orgId);
|
|
120
120
|
_siteId = this.getCloudId();
|
|
121
121
|
enablePagination = (_allTeamsQuery$enable = allTeamsQuery.enablePagination) !== null && _allTeamsQuery$enable !== void 0 ? _allTeamsQuery$enable : true;
|
|
122
|
-
_context2.next =
|
|
122
|
+
_context2.next = 1;
|
|
123
123
|
return this.postResource("".concat(v4UrlPath, "/search"), _objectSpread({
|
|
124
124
|
organizationId: _orgId,
|
|
125
125
|
siteId: _siteId,
|
|
@@ -138,7 +138,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
138
138
|
}, enablePagination && allTeamsQuery.cursor ? {
|
|
139
139
|
cursor: allTeamsQuery.cursor
|
|
140
140
|
} : {}));
|
|
141
|
-
case
|
|
141
|
+
case 1:
|
|
142
142
|
_yield$this$postResou = _context2.sent;
|
|
143
143
|
entities = _yield$this$postResou.entities;
|
|
144
144
|
_cursor = _yield$this$postResou.cursor;
|
|
@@ -149,20 +149,20 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
149
149
|
cursor: _cursor,
|
|
150
150
|
teams: teams
|
|
151
151
|
});
|
|
152
|
-
case
|
|
153
|
-
_context2.prev =
|
|
154
|
-
|
|
155
|
-
this.logException(
|
|
152
|
+
case 2:
|
|
153
|
+
_context2.prev = 2;
|
|
154
|
+
_t = _context2["catch"](0);
|
|
155
|
+
this.logException(_t, 'getAllTeams');
|
|
156
156
|
return _context2.abrupt("return", {
|
|
157
157
|
cursor: '',
|
|
158
158
|
teams: [],
|
|
159
|
-
error:
|
|
159
|
+
error: _t instanceof Error ? _t : undefined
|
|
160
160
|
});
|
|
161
|
-
case
|
|
161
|
+
case 3:
|
|
162
162
|
case "end":
|
|
163
163
|
return _context2.stop();
|
|
164
164
|
}
|
|
165
|
-
}, _callee2, this, [[0,
|
|
165
|
+
}, _callee2, this, [[0, 2]]);
|
|
166
166
|
}));
|
|
167
167
|
function getAllTeams(_x3) {
|
|
168
168
|
return _getAllTeams.apply(this, arguments);
|
|
@@ -174,15 +174,15 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
174
174
|
value: function () {
|
|
175
175
|
var _updateTeamById = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(teamId, data) {
|
|
176
176
|
var teamResponse;
|
|
177
|
-
return _regenerator.default.wrap(function
|
|
177
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
178
178
|
while (1) switch (_context3.prev = _context3.next) {
|
|
179
179
|
case 0:
|
|
180
|
-
_context3.next =
|
|
180
|
+
_context3.next = 1;
|
|
181
181
|
return this.patchResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId)), data);
|
|
182
|
-
case
|
|
182
|
+
case 1:
|
|
183
183
|
teamResponse = _context3.sent;
|
|
184
184
|
return _context3.abrupt("return", this.mapTeamResponseV4ToTeam(teamResponse));
|
|
185
|
-
case
|
|
185
|
+
case 2:
|
|
186
186
|
case "end":
|
|
187
187
|
return _context3.stop();
|
|
188
188
|
}
|
|
@@ -202,15 +202,15 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
202
202
|
value: (function () {
|
|
203
203
|
var _inviteUsersToTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(teamId, users, originQuery) {
|
|
204
204
|
var emails, ids, url;
|
|
205
|
-
return _regenerator.default.wrap(function
|
|
205
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
206
206
|
while (1) switch (_context4.prev = _context4.next) {
|
|
207
207
|
case 0:
|
|
208
208
|
if (!(!users || users.length === 0)) {
|
|
209
|
-
_context4.next =
|
|
209
|
+
_context4.next = 1;
|
|
210
210
|
break;
|
|
211
211
|
}
|
|
212
212
|
return _context4.abrupt("return", Promise.resolve([]));
|
|
213
|
-
case
|
|
213
|
+
case 1:
|
|
214
214
|
emails = [];
|
|
215
215
|
ids = [];
|
|
216
216
|
users.forEach(function (user) {
|
|
@@ -225,7 +225,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
225
225
|
emailAddresses: emails,
|
|
226
226
|
atlassianAccounts: ids
|
|
227
227
|
}));
|
|
228
|
-
case
|
|
228
|
+
case 2:
|
|
229
229
|
case "end":
|
|
230
230
|
return _context4.stop();
|
|
231
231
|
}
|
|
@@ -240,7 +240,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
240
240
|
key: "getMyTeamMembership",
|
|
241
241
|
value: function () {
|
|
242
242
|
var _getMyTeamMembership = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(teamId) {
|
|
243
|
-
return _regenerator.default.wrap(function
|
|
243
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
244
244
|
while (1) switch (_context5.prev = _context5.next) {
|
|
245
245
|
case 0:
|
|
246
246
|
return _context5.abrupt("return", this.getResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/me?siteId=").concat(this.getCloudId()), {
|
|
@@ -264,16 +264,16 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
264
264
|
value: function () {
|
|
265
265
|
var _getTeamLinksByTeamId = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(teamId) {
|
|
266
266
|
var siteId, response;
|
|
267
|
-
return _regenerator.default.wrap(function
|
|
267
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
268
268
|
while (1) switch (_context6.prev = _context6.next) {
|
|
269
269
|
case 0:
|
|
270
270
|
siteId = this.getCloudId();
|
|
271
|
-
_context6.next =
|
|
271
|
+
_context6.next = 1;
|
|
272
272
|
return this.getResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/links?siteId=").concat(siteId));
|
|
273
|
-
case
|
|
273
|
+
case 1:
|
|
274
274
|
response = _context6.sent;
|
|
275
275
|
return _context6.abrupt("return", this.mapLegionTeamLinksResponseV4ToTeamLinkResponse(response));
|
|
276
|
-
case
|
|
276
|
+
case 2:
|
|
277
277
|
case "end":
|
|
278
278
|
return _context6.stop();
|
|
279
279
|
}
|
|
@@ -289,7 +289,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
289
289
|
value: function () {
|
|
290
290
|
var _createTeamLink = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(teamId, link) {
|
|
291
291
|
var sanitisedTeamLink, response;
|
|
292
|
-
return _regenerator.default.wrap(function
|
|
292
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
293
293
|
while (1) switch (_context7.prev = _context7.next) {
|
|
294
294
|
case 0:
|
|
295
295
|
sanitisedTeamLink = _objectSpread(_objectSpread({
|
|
@@ -301,12 +301,12 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
301
301
|
} : {}), link.teamId ? {
|
|
302
302
|
teamId: link.teamId.trim()
|
|
303
303
|
} : {});
|
|
304
|
-
_context7.next =
|
|
304
|
+
_context7.next = 1;
|
|
305
305
|
return this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/links"), sanitisedTeamLink);
|
|
306
|
-
case
|
|
306
|
+
case 1:
|
|
307
307
|
response = _context7.sent;
|
|
308
308
|
return _context7.abrupt("return", this.mapLegionTeamLinkResponseV4ToTeamLink(response));
|
|
309
|
-
case
|
|
309
|
+
case 2:
|
|
310
310
|
case "end":
|
|
311
311
|
return _context7.stop();
|
|
312
312
|
}
|
|
@@ -322,18 +322,18 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
322
322
|
value: function () {
|
|
323
323
|
var _updateTeamLink = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(teamId, linkId, _ref) {
|
|
324
324
|
var linkUri, linkFields, response;
|
|
325
|
-
return _regenerator.default.wrap(function
|
|
325
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
326
326
|
while (1) switch (_context8.prev = _context8.next) {
|
|
327
327
|
case 0:
|
|
328
328
|
linkUri = _ref.linkUri, linkFields = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
329
|
-
_context8.next =
|
|
329
|
+
_context8.next = 1;
|
|
330
330
|
return this.putResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/links/").concat(linkId), _objectSpread({
|
|
331
331
|
linkUri: linkUri.trim()
|
|
332
332
|
}, linkFields));
|
|
333
|
-
case
|
|
333
|
+
case 1:
|
|
334
334
|
response = _context8.sent;
|
|
335
335
|
return _context8.abrupt("return", this.mapLegionTeamLinkResponseV4ToTeamLink(response));
|
|
336
|
-
case
|
|
336
|
+
case 2:
|
|
337
337
|
case "end":
|
|
338
338
|
return _context8.stop();
|
|
339
339
|
}
|
|
@@ -348,7 +348,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
348
348
|
key: "deleteTeamLink",
|
|
349
349
|
value: function () {
|
|
350
350
|
var _deleteTeamLink = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(teamId, linkId) {
|
|
351
|
-
return _regenerator.default.wrap(function
|
|
351
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
352
352
|
while (1) switch (_context9.prev = _context9.next) {
|
|
353
353
|
case 0:
|
|
354
354
|
return _context9.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/links/").concat(linkId)));
|
|
@@ -368,12 +368,12 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
368
368
|
value: function () {
|
|
369
369
|
var _reorderTeamLink = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee0(teamId, linkId, newPosition) {
|
|
370
370
|
var queryArgs;
|
|
371
|
-
return _regenerator.default.wrap(function
|
|
371
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
372
372
|
while (1) switch (_context0.prev = _context0.next) {
|
|
373
373
|
case 0:
|
|
374
374
|
queryArgs = "?linkId=".concat(linkId, "&newPosition=").concat(newPosition);
|
|
375
375
|
return _context0.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/links/order").concat(queryArgs)));
|
|
376
|
-
case
|
|
376
|
+
case 1:
|
|
377
377
|
case "end":
|
|
378
378
|
return _context0.stop();
|
|
379
379
|
}
|
|
@@ -389,20 +389,20 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
389
389
|
value: function () {
|
|
390
390
|
var _getOrgEligibilityForManagedTeams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
391
391
|
var orgId, err;
|
|
392
|
-
return _regenerator.default.wrap(function
|
|
392
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
393
393
|
while (1) switch (_context1.prev = _context1.next) {
|
|
394
394
|
case 0:
|
|
395
395
|
orgId = this.getOrgId();
|
|
396
396
|
if (orgId) {
|
|
397
|
-
_context1.next =
|
|
397
|
+
_context1.next = 1;
|
|
398
398
|
break;
|
|
399
399
|
}
|
|
400
400
|
err = new Error('Organization ID is required');
|
|
401
401
|
this.logException(err, 'getOrgEligibilityForManagedTeams');
|
|
402
402
|
throw err;
|
|
403
|
-
case
|
|
403
|
+
case 1:
|
|
404
404
|
return _context1.abrupt("return", this.getResourceCached("".concat(v4UrlPath, "/org/").concat(orgId, "/premium/eligibility")));
|
|
405
|
-
case
|
|
405
|
+
case 2:
|
|
406
406
|
case "end":
|
|
407
407
|
return _context1.stop();
|
|
408
408
|
}
|
|
@@ -421,7 +421,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
421
421
|
key: "acceptTeamInvitation",
|
|
422
422
|
value: (function () {
|
|
423
423
|
var _acceptTeamInvitation = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(teamId) {
|
|
424
|
-
return _regenerator.default.wrap(function
|
|
424
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
425
425
|
while (1) switch (_context10.prev = _context10.next) {
|
|
426
426
|
case 0:
|
|
427
427
|
return _context10.abrupt("return", this.postResource("".concat(v3UrlPath, "/ui/").concat(this.trimTeamARI(teamId), "/membership/accept")));
|
|
@@ -445,7 +445,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
445
445
|
key: "declineTeamInvitation",
|
|
446
446
|
value: (function () {
|
|
447
447
|
var _declineTeamInvitation = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(teamId) {
|
|
448
|
-
return _regenerator.default.wrap(function
|
|
448
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
449
449
|
while (1) switch (_context11.prev = _context11.next) {
|
|
450
450
|
case 0:
|
|
451
451
|
return _context11.abrupt("return", this.postResource("".concat(v3UrlPath, "/ui/").concat(this.trimTeamARI(teamId), "/membership/decline")));
|
|
@@ -467,12 +467,12 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
467
467
|
// TODO Test me
|
|
468
468
|
teamId, originQuery) {
|
|
469
469
|
var url;
|
|
470
|
-
return _regenerator.default.wrap(function
|
|
470
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
471
471
|
while (1) switch (_context12.prev = _context12.next) {
|
|
472
472
|
case 0:
|
|
473
473
|
url = "".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/join?").concat(this.constructProductOriginParams(originQuery));
|
|
474
474
|
return _context12.abrupt("return", this.postResource(url));
|
|
475
|
-
case
|
|
475
|
+
case 1:
|
|
476
476
|
case "end":
|
|
477
477
|
return _context12.stop();
|
|
478
478
|
}
|
|
@@ -487,33 +487,33 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
487
487
|
key: "addAgentsToTeam",
|
|
488
488
|
value: function () {
|
|
489
489
|
var _addAgentsToTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(teamId, agents) {
|
|
490
|
-
var missingAgentsError, url;
|
|
491
|
-
return _regenerator.default.wrap(function
|
|
490
|
+
var missingAgentsError, url, _t2;
|
|
491
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
492
492
|
while (1) switch (_context13.prev = _context13.next) {
|
|
493
493
|
case 0:
|
|
494
494
|
if (!(!agents || agents.length === 0)) {
|
|
495
|
-
_context13.next =
|
|
495
|
+
_context13.next = 1;
|
|
496
496
|
break;
|
|
497
497
|
}
|
|
498
498
|
missingAgentsError = new Error('Missing agents to add');
|
|
499
499
|
this.logException(missingAgentsError, 'addAgentToTeam');
|
|
500
500
|
throw missingAgentsError;
|
|
501
|
-
case
|
|
502
|
-
_context13.prev =
|
|
501
|
+
case 1:
|
|
502
|
+
_context13.prev = 1;
|
|
503
503
|
url = "".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/agents");
|
|
504
504
|
return _context13.abrupt("return", this.postResource(url, {
|
|
505
505
|
agents: agents
|
|
506
506
|
}));
|
|
507
|
-
case
|
|
508
|
-
_context13.prev =
|
|
509
|
-
|
|
510
|
-
this.logException(
|
|
511
|
-
throw
|
|
512
|
-
case
|
|
507
|
+
case 2:
|
|
508
|
+
_context13.prev = 2;
|
|
509
|
+
_t2 = _context13["catch"](1);
|
|
510
|
+
this.logException(_t2, 'addAgentToTeam');
|
|
511
|
+
throw _t2;
|
|
512
|
+
case 3:
|
|
513
513
|
case "end":
|
|
514
514
|
return _context13.stop();
|
|
515
515
|
}
|
|
516
|
-
}, _callee13, this, [[
|
|
516
|
+
}, _callee13, this, [[1, 2]]);
|
|
517
517
|
}));
|
|
518
518
|
function addAgentsToTeam(_x23, _x24) {
|
|
519
519
|
return _addAgentsToTeam.apply(this, arguments);
|
|
@@ -524,23 +524,23 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
524
524
|
key: "removeAgentTeamAssociation",
|
|
525
525
|
value: function () {
|
|
526
526
|
var _removeAgentTeamAssociation = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(teamId, agentId) {
|
|
527
|
-
var url;
|
|
528
|
-
return _regenerator.default.wrap(function
|
|
527
|
+
var url, _t3;
|
|
528
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
529
529
|
while (1) switch (_context14.prev = _context14.next) {
|
|
530
530
|
case 0:
|
|
531
531
|
_context14.prev = 0;
|
|
532
532
|
url = "".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/agents/").concat(agentId);
|
|
533
533
|
return _context14.abrupt("return", this.deleteResource(url));
|
|
534
|
-
case
|
|
535
|
-
_context14.prev =
|
|
536
|
-
|
|
537
|
-
this.logException(
|
|
538
|
-
throw
|
|
539
|
-
case
|
|
534
|
+
case 1:
|
|
535
|
+
_context14.prev = 1;
|
|
536
|
+
_t3 = _context14["catch"](0);
|
|
537
|
+
this.logException(_t3, 'removeAgentTeamAssociation');
|
|
538
|
+
throw _t3;
|
|
539
|
+
case 2:
|
|
540
540
|
case "end":
|
|
541
541
|
return _context14.stop();
|
|
542
542
|
}
|
|
543
|
-
}, _callee14, this, [[0,
|
|
543
|
+
}, _callee14, this, [[0, 1]]);
|
|
544
544
|
}));
|
|
545
545
|
function removeAgentTeamAssociation(_x25, _x26) {
|
|
546
546
|
return _removeAgentTeamAssociation.apply(this, arguments);
|
|
@@ -551,7 +551,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
551
551
|
key: "cancelJoinRequest",
|
|
552
552
|
value: function () {
|
|
553
553
|
var _cancelJoinRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(teamId) {
|
|
554
|
-
return _regenerator.default.wrap(function
|
|
554
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
555
555
|
while (1) switch (_context15.prev = _context15.next) {
|
|
556
556
|
case 0:
|
|
557
557
|
return _context15.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/request")));
|
|
@@ -570,7 +570,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
570
570
|
key: "acceptJoinRequest",
|
|
571
571
|
value: function () {
|
|
572
572
|
var _acceptJoinRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16(teamId, memberId) {
|
|
573
|
-
return _regenerator.default.wrap(function
|
|
573
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
574
574
|
while (1) switch (_context16.prev = _context16.next) {
|
|
575
575
|
case 0:
|
|
576
576
|
return _context16.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/request/accept")));
|
|
@@ -589,7 +589,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
589
589
|
key: "declineJoinRequest",
|
|
590
590
|
value: function () {
|
|
591
591
|
var _declineJoinRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(teamId, memberId) {
|
|
592
|
-
return _regenerator.default.wrap(function
|
|
592
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
593
593
|
while (1) switch (_context17.prev = _context17.next) {
|
|
594
594
|
case 0:
|
|
595
595
|
return _context17.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/request/decline")));
|
|
@@ -612,7 +612,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
612
612
|
key: "deleteTeamMembership",
|
|
613
613
|
value: (function () {
|
|
614
614
|
var _deleteTeamMembership = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(teamId, memberId) {
|
|
615
|
-
return _regenerator.default.wrap(function
|
|
615
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
616
616
|
while (1) switch (_context18.prev = _context18.next) {
|
|
617
617
|
case 0:
|
|
618
618
|
return _context18.abrupt("return", this.deleteResource("".concat(v3UrlPath, "/").concat(this.trimTeamARI(teamId), "/members/").concat(memberId)));
|
|
@@ -636,7 +636,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
636
636
|
key: "revokeTeamInvite",
|
|
637
637
|
value: (function () {
|
|
638
638
|
var _revokeTeamInvite = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(teamId, memberId) {
|
|
639
|
-
return _regenerator.default.wrap(function
|
|
639
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
640
640
|
while (1) switch (_context19.prev = _context19.next) {
|
|
641
641
|
case 0:
|
|
642
642
|
return _context19.abrupt("return", this.deleteResource("".concat(v3UrlPath, "/ui/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/revoke")));
|
|
@@ -655,7 +655,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
655
655
|
key: "deleteTeam",
|
|
656
656
|
value: function () {
|
|
657
657
|
var _deleteTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(teamId) {
|
|
658
|
-
return _regenerator.default.wrap(function
|
|
658
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
659
659
|
while (1) switch (_context20.prev = _context20.next) {
|
|
660
660
|
case 0:
|
|
661
661
|
return _context20.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId))));
|
|
@@ -675,12 +675,12 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
675
675
|
value: function () {
|
|
676
676
|
var _archiveTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(teamId) {
|
|
677
677
|
var siteId;
|
|
678
|
-
return _regenerator.default.wrap(function
|
|
678
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
679
679
|
while (1) switch (_context21.prev = _context21.next) {
|
|
680
680
|
case 0:
|
|
681
681
|
siteId = this.getCloudId();
|
|
682
682
|
return _context21.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/archive?siteId=").concat(siteId)));
|
|
683
|
-
case
|
|
683
|
+
case 1:
|
|
684
684
|
case "end":
|
|
685
685
|
return _context21.stop();
|
|
686
686
|
}
|
|
@@ -696,12 +696,12 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
696
696
|
value: function () {
|
|
697
697
|
var _unArchiveTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(teamId) {
|
|
698
698
|
var siteId;
|
|
699
|
-
return _regenerator.default.wrap(function
|
|
699
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
700
700
|
while (1) switch (_context22.prev = _context22.next) {
|
|
701
701
|
case 0:
|
|
702
702
|
siteId = this.getCloudId();
|
|
703
703
|
return _context22.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/unarchive?siteId=").concat(siteId)));
|
|
704
|
-
case
|
|
704
|
+
case 1:
|
|
705
705
|
case "end":
|
|
706
706
|
return _context22.stop();
|
|
707
707
|
}
|
|
@@ -716,7 +716,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
716
716
|
key: "unlinkTeamFromGroup",
|
|
717
717
|
value: function () {
|
|
718
718
|
var _unlinkTeamFromGroup = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(teamId, membershipSettings) {
|
|
719
|
-
return _regenerator.default.wrap(function
|
|
719
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
720
720
|
while (1) switch (_context23.prev = _context23.next) {
|
|
721
721
|
case 0:
|
|
722
722
|
return _context23.abrupt("return", this.patchResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId)), {
|
|
@@ -742,15 +742,15 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
742
742
|
value: (function () {
|
|
743
743
|
var _isSingleFullMemberTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(teamId) {
|
|
744
744
|
var members;
|
|
745
|
-
return _regenerator.default.wrap(function
|
|
745
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
746
746
|
while (1) switch (_context24.prev = _context24.next) {
|
|
747
747
|
case 0:
|
|
748
|
-
_context24.next =
|
|
748
|
+
_context24.next = 1;
|
|
749
749
|
return this.getResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/members?size=2&membershipState=FULL_MEMBER&siteId=").concat(this.getCloudId()));
|
|
750
|
-
case
|
|
750
|
+
case 1:
|
|
751
751
|
members = _context24.sent;
|
|
752
752
|
return _context24.abrupt("return", members.entities.length === 1);
|
|
753
|
-
case
|
|
753
|
+
case 2:
|
|
754
754
|
case "end":
|
|
755
755
|
return _context24.stop();
|
|
756
756
|
}
|
|
@@ -772,22 +772,22 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
772
772
|
url,
|
|
773
773
|
legionTeam,
|
|
774
774
|
_args25 = arguments;
|
|
775
|
-
return _regenerator.default.wrap(function
|
|
775
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
776
776
|
while (1) switch (_context25.prev = _context25.next) {
|
|
777
777
|
case 0:
|
|
778
778
|
membershipSettings = _args25.length > 3 && _args25[3] !== undefined ? _args25[3] : 'OPEN';
|
|
779
779
|
typeId = _args25.length > 4 ? _args25[4] : undefined;
|
|
780
780
|
organizationId = this.getContext().orgId;
|
|
781
781
|
if (organizationId) {
|
|
782
|
-
_context25.next =
|
|
782
|
+
_context25.next = 1;
|
|
783
783
|
break;
|
|
784
784
|
}
|
|
785
785
|
err = new Error('Organization ID is required');
|
|
786
786
|
this.logException(err, 'createTeam');
|
|
787
787
|
throw err;
|
|
788
|
-
case
|
|
788
|
+
case 1:
|
|
789
789
|
url = "".concat(v4UrlPath, "?").concat(this.constructProductOriginParams(originQuery));
|
|
790
|
-
_context25.next =
|
|
790
|
+
_context25.next = 2;
|
|
791
791
|
return this.postResource(url, {
|
|
792
792
|
displayName: displayName,
|
|
793
793
|
description: '',
|
|
@@ -797,10 +797,10 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
797
797
|
members: (0, _toConsumableArray2.default)(new Set(members)),
|
|
798
798
|
typeId: typeId
|
|
799
799
|
});
|
|
800
|
-
case
|
|
800
|
+
case 2:
|
|
801
801
|
legionTeam = _context25.sent;
|
|
802
802
|
return _context25.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionTeam));
|
|
803
|
-
case
|
|
803
|
+
case 3:
|
|
804
804
|
case "end":
|
|
805
805
|
return _context25.stop();
|
|
806
806
|
}
|
|
@@ -816,21 +816,21 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
816
816
|
value: function () {
|
|
817
817
|
var _createExternalTeam = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26(description, externalReference, teamName, siteId) {
|
|
818
818
|
var organizationId, cloudId, err, url, legionExternalTeam;
|
|
819
|
-
return _regenerator.default.wrap(function
|
|
819
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
820
820
|
while (1) switch (_context26.prev = _context26.next) {
|
|
821
821
|
case 0:
|
|
822
822
|
organizationId = this.getContext().orgId;
|
|
823
823
|
cloudId = this.getContext().cloudId;
|
|
824
824
|
if (organizationId) {
|
|
825
|
-
_context26.next =
|
|
825
|
+
_context26.next = 1;
|
|
826
826
|
break;
|
|
827
827
|
}
|
|
828
828
|
err = new Error('Organization ID is required');
|
|
829
829
|
this.logException(err, 'createTeam');
|
|
830
830
|
throw err;
|
|
831
|
-
case
|
|
831
|
+
case 1:
|
|
832
832
|
url = "".concat(v4UrlPath, "/external?origin.cloudId=").concat(encodeURIComponent(this.getCloudId(siteId || cloudId)));
|
|
833
|
-
_context26.next =
|
|
833
|
+
_context26.next = 2;
|
|
834
834
|
return this.postResource(url, {
|
|
835
835
|
description: description,
|
|
836
836
|
externalReference: externalReference,
|
|
@@ -838,10 +838,10 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
838
838
|
siteId: siteId || cloudId,
|
|
839
839
|
displayName: teamName
|
|
840
840
|
});
|
|
841
|
-
case
|
|
841
|
+
case 2:
|
|
842
842
|
legionExternalTeam = _context26.sent;
|
|
843
843
|
return _context26.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionExternalTeam));
|
|
844
|
-
case
|
|
844
|
+
case 3:
|
|
845
845
|
case "end":
|
|
846
846
|
return _context26.stop();
|
|
847
847
|
}
|
|
@@ -857,7 +857,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
857
857
|
value: function () {
|
|
858
858
|
var _getTeamAndGroupDiff = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(teamId, externalReference) {
|
|
859
859
|
var siteId;
|
|
860
|
-
return _regenerator.default.wrap(function
|
|
860
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
861
861
|
while (1) switch (_context27.prev = _context27.next) {
|
|
862
862
|
case 0:
|
|
863
863
|
siteId = this.getCloudId();
|
|
@@ -865,7 +865,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
865
865
|
siteId: siteId,
|
|
866
866
|
externalReference: externalReference
|
|
867
867
|
}));
|
|
868
|
-
case
|
|
868
|
+
case 1:
|
|
869
869
|
case "end":
|
|
870
870
|
return _context27.stop();
|
|
871
871
|
}
|
|
@@ -881,7 +881,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
881
881
|
value: function () {
|
|
882
882
|
var _linkExistingTeamToGroup = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(teamId, externalReference) {
|
|
883
883
|
var siteId;
|
|
884
|
-
return _regenerator.default.wrap(function
|
|
884
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
885
885
|
while (1) switch (_context28.prev = _context28.next) {
|
|
886
886
|
case 0:
|
|
887
887
|
siteId = this.getCloudId();
|
|
@@ -889,7 +889,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
889
889
|
externalReference: externalReference,
|
|
890
890
|
siteId: siteId
|
|
891
891
|
}));
|
|
892
|
-
case
|
|
892
|
+
case 1:
|
|
893
893
|
case "end":
|
|
894
894
|
return _context28.stop();
|
|
895
895
|
}
|
|
@@ -904,7 +904,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
904
904
|
key: "getWriteMediaToken",
|
|
905
905
|
value: function () {
|
|
906
906
|
var _getWriteMediaToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
907
|
-
return _regenerator.default.wrap(function
|
|
907
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
908
908
|
while (1) switch (_context29.prev = _context29.next) {
|
|
909
909
|
case 0:
|
|
910
910
|
return _context29.abrupt("return", this.getResource('/v4/teams/header-image/media-upload').then(function (response) {
|
|
@@ -929,7 +929,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
929
929
|
value: function () {
|
|
930
930
|
var _getSoftDeletedTeamById = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(teamId) {
|
|
931
931
|
var orgId, siteId;
|
|
932
|
-
return _regenerator.default.wrap(function
|
|
932
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
933
933
|
while (1) switch (_context30.prev = _context30.next) {
|
|
934
934
|
case 0:
|
|
935
935
|
orgId = this.getOrgId();
|
|
@@ -939,7 +939,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
939
939
|
id: teamId
|
|
940
940
|
});
|
|
941
941
|
}));
|
|
942
|
-
case
|
|
942
|
+
case 1:
|
|
943
943
|
case "end":
|
|
944
944
|
return _context30.stop();
|
|
945
945
|
}
|
|
@@ -958,7 +958,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
958
958
|
value: (function () {
|
|
959
959
|
var _getUserInSiteUserBase = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(userId) {
|
|
960
960
|
var siteId;
|
|
961
|
-
return _regenerator.default.wrap(function
|
|
961
|
+
return _regenerator.default.wrap(function (_context31) {
|
|
962
962
|
while (1) switch (_context31.prev = _context31.next) {
|
|
963
963
|
case 0:
|
|
964
964
|
siteId = this.getCloudId();
|
|
@@ -968,7 +968,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
968
968
|
'X-header-client-id': 'ptc-fe'
|
|
969
969
|
}
|
|
970
970
|
}));
|
|
971
|
-
case
|
|
971
|
+
case 1:
|
|
972
972
|
case "end":
|
|
973
973
|
return _context31.stop();
|
|
974
974
|
}
|
|
@@ -983,7 +983,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
983
983
|
key: "retrieveBrowseUserPermission",
|
|
984
984
|
value: function () {
|
|
985
985
|
var _retrieveBrowseUserPermission = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(product) {
|
|
986
|
-
return _regenerator.default.wrap(function
|
|
986
|
+
return _regenerator.default.wrap(function (_context32) {
|
|
987
987
|
while (1) switch (_context32.prev = _context32.next) {
|
|
988
988
|
case 0:
|
|
989
989
|
return _context32.abrupt("return", this.getResourceCached("/teams/site/".concat(this.getCloudId(), "/canSearchUsers?product=").concat(product), undefined,
|
|
@@ -1007,21 +1007,21 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1007
1007
|
value: function () {
|
|
1008
1008
|
var _getPermissions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
1009
1009
|
var orgId, siteId, err;
|
|
1010
|
-
return _regenerator.default.wrap(function
|
|
1010
|
+
return _regenerator.default.wrap(function (_context33) {
|
|
1011
1011
|
while (1) switch (_context33.prev = _context33.next) {
|
|
1012
1012
|
case 0:
|
|
1013
1013
|
orgId = this.getContext().orgId;
|
|
1014
1014
|
siteId = this.getCloudId();
|
|
1015
1015
|
if (orgId) {
|
|
1016
|
-
_context33.next =
|
|
1016
|
+
_context33.next = 1;
|
|
1017
1017
|
break;
|
|
1018
1018
|
}
|
|
1019
1019
|
err = new Error('Organization ID is required');
|
|
1020
1020
|
this.logException(err, 'getPermissions');
|
|
1021
1021
|
throw err;
|
|
1022
|
-
case
|
|
1022
|
+
case 1:
|
|
1023
1023
|
return _context33.abrupt("return", this.getResourceCached("".concat(v4UrlPath, "/permission/self/organization/").concat(orgId, "?siteId=").concat(siteId)));
|
|
1024
|
-
case
|
|
1024
|
+
case 2:
|
|
1025
1025
|
case "end":
|
|
1026
1026
|
return _context33.stop();
|
|
1027
1027
|
}
|
|
@@ -1037,28 +1037,28 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1037
1037
|
value: function () {
|
|
1038
1038
|
var _getLinkedTeamsBulk = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(groupIds) {
|
|
1039
1039
|
var organizationId, err, legionExternalTeam;
|
|
1040
|
-
return _regenerator.default.wrap(function
|
|
1040
|
+
return _regenerator.default.wrap(function (_context34) {
|
|
1041
1041
|
while (1) switch (_context34.prev = _context34.next) {
|
|
1042
1042
|
case 0:
|
|
1043
1043
|
organizationId = this.getContext().orgId;
|
|
1044
1044
|
if (organizationId) {
|
|
1045
|
-
_context34.next =
|
|
1045
|
+
_context34.next = 1;
|
|
1046
1046
|
break;
|
|
1047
1047
|
}
|
|
1048
1048
|
err = new Error('Organization ID is required');
|
|
1049
1049
|
this.logException(err, 'getLinkedTeamsBulk');
|
|
1050
1050
|
throw err;
|
|
1051
|
-
case
|
|
1052
|
-
_context34.next =
|
|
1051
|
+
case 1:
|
|
1052
|
+
_context34.next = 2;
|
|
1053
1053
|
return this.postResource("".concat(v4UrlPath, "/external/bulk"), {
|
|
1054
1054
|
organizationId: organizationId,
|
|
1055
1055
|
source: 'ATLASSIAN_GROUP',
|
|
1056
1056
|
externalIds: groupIds
|
|
1057
1057
|
});
|
|
1058
|
-
case
|
|
1058
|
+
case 2:
|
|
1059
1059
|
legionExternalTeam = _context34.sent;
|
|
1060
1060
|
return _context34.abrupt("return", legionExternalTeam);
|
|
1061
|
-
case
|
|
1061
|
+
case 3:
|
|
1062
1062
|
case "end":
|
|
1063
1063
|
return _context34.stop();
|
|
1064
1064
|
}
|
|
@@ -1074,24 +1074,24 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1074
1074
|
value: function () {
|
|
1075
1075
|
var _getTeamProfileDetails = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(teamId, siteId) {
|
|
1076
1076
|
var finalSiteId, err, linkedTeamsProfileDetails;
|
|
1077
|
-
return _regenerator.default.wrap(function
|
|
1077
|
+
return _regenerator.default.wrap(function (_context35) {
|
|
1078
1078
|
while (1) switch (_context35.prev = _context35.next) {
|
|
1079
1079
|
case 0:
|
|
1080
1080
|
finalSiteId = siteId || this.getCloudId();
|
|
1081
1081
|
if (finalSiteId) {
|
|
1082
|
-
_context35.next =
|
|
1082
|
+
_context35.next = 1;
|
|
1083
1083
|
break;
|
|
1084
1084
|
}
|
|
1085
1085
|
err = new Error('Site ID is required');
|
|
1086
1086
|
this.logException(err, 'getTeamProfileDetails');
|
|
1087
1087
|
throw err;
|
|
1088
|
-
case
|
|
1089
|
-
_context35.next =
|
|
1088
|
+
case 1:
|
|
1089
|
+
_context35.next = 2;
|
|
1090
1090
|
return this.getResource("".concat(v4UrlPath, "/").concat(teamId, "/profile?siteId=").concat(finalSiteId));
|
|
1091
|
-
case
|
|
1091
|
+
case 2:
|
|
1092
1092
|
linkedTeamsProfileDetails = _context35.sent;
|
|
1093
1093
|
return _context35.abrupt("return", linkedTeamsProfileDetails);
|
|
1094
|
-
case
|
|
1094
|
+
case 3:
|
|
1095
1095
|
case "end":
|
|
1096
1096
|
return _context35.stop();
|
|
1097
1097
|
}
|
|
@@ -1107,24 +1107,24 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1107
1107
|
value: function () {
|
|
1108
1108
|
var _getOrgScope = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
1109
1109
|
var orgId, err, orgScope;
|
|
1110
|
-
return _regenerator.default.wrap(function
|
|
1110
|
+
return _regenerator.default.wrap(function (_context36) {
|
|
1111
1111
|
while (1) switch (_context36.prev = _context36.next) {
|
|
1112
1112
|
case 0:
|
|
1113
1113
|
orgId = this.getContext().orgId;
|
|
1114
1114
|
if (orgId) {
|
|
1115
|
-
_context36.next =
|
|
1115
|
+
_context36.next = 1;
|
|
1116
1116
|
break;
|
|
1117
1117
|
}
|
|
1118
1118
|
err = new Error('Organization ID is required');
|
|
1119
1119
|
this.logException(err, 'getOrgScope');
|
|
1120
1120
|
throw err;
|
|
1121
|
-
case
|
|
1122
|
-
_context36.next =
|
|
1121
|
+
case 1:
|
|
1122
|
+
_context36.next = 2;
|
|
1123
1123
|
return this.getResourceCached("".concat(v4UrlPath, "/org/").concat(orgId, "/scope"));
|
|
1124
|
-
case
|
|
1124
|
+
case 2:
|
|
1125
1125
|
orgScope = _context36.sent;
|
|
1126
1126
|
return _context36.abrupt("return", orgScope);
|
|
1127
|
-
case
|
|
1127
|
+
case 3:
|
|
1128
1128
|
case "end":
|
|
1129
1129
|
return _context36.stop();
|
|
1130
1130
|
}
|
|
@@ -1140,18 +1140,18 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1140
1140
|
value: function () {
|
|
1141
1141
|
var _restoreTeamToSyncedGroup = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(teamId, externalReference) {
|
|
1142
1142
|
var siteId;
|
|
1143
|
-
return _regenerator.default.wrap(function
|
|
1143
|
+
return _regenerator.default.wrap(function (_context37) {
|
|
1144
1144
|
while (1) switch (_context37.prev = _context37.next) {
|
|
1145
1145
|
case 0:
|
|
1146
1146
|
siteId = this.getCloudId();
|
|
1147
|
-
_context37.next =
|
|
1147
|
+
_context37.next = 1;
|
|
1148
1148
|
return this.postResource("".concat(v4UrlPath, "/").concat(teamId, "/external/restore"), {
|
|
1149
1149
|
externalReference: externalReference,
|
|
1150
1150
|
siteId: siteId
|
|
1151
1151
|
});
|
|
1152
|
-
case
|
|
1152
|
+
case 1:
|
|
1153
1153
|
return _context37.abrupt("return", _context37.sent);
|
|
1154
|
-
case
|
|
1154
|
+
case 2:
|
|
1155
1155
|
case "end":
|
|
1156
1156
|
return _context37.stop();
|
|
1157
1157
|
}
|
|
@@ -1166,7 +1166,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1166
1166
|
key: "createTeamContainers",
|
|
1167
1167
|
value: function () {
|
|
1168
1168
|
var _createTeamContainers = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38(payload) {
|
|
1169
|
-
return _regenerator.default.wrap(function
|
|
1169
|
+
return _regenerator.default.wrap(function (_context38) {
|
|
1170
1170
|
while (1) switch (_context38.prev = _context38.next) {
|
|
1171
1171
|
case 0:
|
|
1172
1172
|
return _context38.abrupt("return", this.postResource("".concat(v4UrlPath, "/containers"), _objectSpread({}, payload)));
|
|
@@ -1186,15 +1186,15 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1186
1186
|
value: function () {
|
|
1187
1187
|
var _getTeamEnabledSites = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39(teamId) {
|
|
1188
1188
|
var teamEnabledSites;
|
|
1189
|
-
return _regenerator.default.wrap(function
|
|
1189
|
+
return _regenerator.default.wrap(function (_context39) {
|
|
1190
1190
|
while (1) switch (_context39.prev = _context39.next) {
|
|
1191
1191
|
case 0:
|
|
1192
|
-
_context39.next =
|
|
1192
|
+
_context39.next = 1;
|
|
1193
1193
|
return this.getResourceCached("".concat(v4UrlPath, "/migrations/scope/").concat(teamId));
|
|
1194
|
-
case
|
|
1194
|
+
case 1:
|
|
1195
1195
|
teamEnabledSites = _context39.sent;
|
|
1196
1196
|
return _context39.abrupt("return", teamEnabledSites);
|
|
1197
|
-
case
|
|
1197
|
+
case 2:
|
|
1198
1198
|
case "end":
|
|
1199
1199
|
return _context39.stop();
|
|
1200
1200
|
}
|
|
@@ -1210,18 +1210,18 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1210
1210
|
value: function () {
|
|
1211
1211
|
var _assignTeamsToSites = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(migrations) {
|
|
1212
1212
|
var assignTeamsToSitesResponse;
|
|
1213
|
-
return _regenerator.default.wrap(function
|
|
1213
|
+
return _regenerator.default.wrap(function (_context40) {
|
|
1214
1214
|
while (1) switch (_context40.prev = _context40.next) {
|
|
1215
1215
|
case 0:
|
|
1216
|
-
_context40.next =
|
|
1216
|
+
_context40.next = 1;
|
|
1217
1217
|
return this.postResource("".concat(v4UrlPath, "/migrations/scope"), {
|
|
1218
1218
|
originOrgId: this.getContext().orgId,
|
|
1219
1219
|
migrations: migrations
|
|
1220
1220
|
});
|
|
1221
|
-
case
|
|
1221
|
+
case 1:
|
|
1222
1222
|
assignTeamsToSitesResponse = _context40.sent;
|
|
1223
1223
|
return _context40.abrupt("return", assignTeamsToSitesResponse);
|
|
1224
|
-
case
|
|
1224
|
+
case 2:
|
|
1225
1225
|
case "end":
|
|
1226
1226
|
return _context40.stop();
|
|
1227
1227
|
}
|
|
@@ -1236,7 +1236,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1236
1236
|
key: "getTeamsToBeClonedToJsmSites",
|
|
1237
1237
|
value: function () {
|
|
1238
1238
|
var _getTeamsToBeClonedToJsmSites = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(teamsToSiteScope) {
|
|
1239
|
-
return _regenerator.default.wrap(function
|
|
1239
|
+
return _regenerator.default.wrap(function (_context41) {
|
|
1240
1240
|
while (1) switch (_context41.prev = _context41.next) {
|
|
1241
1241
|
case 0:
|
|
1242
1242
|
return _context41.abrupt("return", this.postResource("".concat(v4UrlPath, "/migrations/scope/review"), {
|
|
@@ -1258,7 +1258,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1258
1258
|
key: "setTeamSiteAssignmentPermission",
|
|
1259
1259
|
value: function () {
|
|
1260
1260
|
var _setTeamSiteAssignmentPermission = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42(orgId, alignmentPermission) {
|
|
1261
|
-
return _regenerator.default.wrap(function
|
|
1261
|
+
return _regenerator.default.wrap(function (_context42) {
|
|
1262
1262
|
while (1) switch (_context42.prev = _context42.next) {
|
|
1263
1263
|
case 0:
|
|
1264
1264
|
return _context42.abrupt("return", this.postResource("".concat(v4UrlPath, "/migrations/scope/permissions"), {
|
|
@@ -1281,20 +1281,20 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1281
1281
|
value: function () {
|
|
1282
1282
|
var _getAssignedTeams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43(orgId, count, cursor, displayNameContains) {
|
|
1283
1283
|
var assignedTeamsResponse;
|
|
1284
|
-
return _regenerator.default.wrap(function
|
|
1284
|
+
return _regenerator.default.wrap(function (_context43) {
|
|
1285
1285
|
while (1) switch (_context43.prev = _context43.next) {
|
|
1286
1286
|
case 0:
|
|
1287
|
-
_context43.next =
|
|
1287
|
+
_context43.next = 1;
|
|
1288
1288
|
return this.postResource("".concat(v4UrlPath, "/migrations/scope/aligned/search"), {
|
|
1289
1289
|
orgId: orgId,
|
|
1290
1290
|
count: count,
|
|
1291
1291
|
cursor: cursor,
|
|
1292
1292
|
displayNameContains: displayNameContains
|
|
1293
1293
|
});
|
|
1294
|
-
case
|
|
1294
|
+
case 1:
|
|
1295
1295
|
assignedTeamsResponse = _context43.sent;
|
|
1296
1296
|
return _context43.abrupt("return", assignedTeamsResponse);
|
|
1297
|
-
case
|
|
1297
|
+
case 2:
|
|
1298
1298
|
case "end":
|
|
1299
1299
|
return _context43.stop();
|
|
1300
1300
|
}
|
|
@@ -1310,20 +1310,20 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1310
1310
|
value: function () {
|
|
1311
1311
|
var _getUnassignedTeams = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44(orgId, count, cursor, query) {
|
|
1312
1312
|
var unassignedTeamsResponse;
|
|
1313
|
-
return _regenerator.default.wrap(function
|
|
1313
|
+
return _regenerator.default.wrap(function (_context44) {
|
|
1314
1314
|
while (1) switch (_context44.prev = _context44.next) {
|
|
1315
1315
|
case 0:
|
|
1316
|
-
_context44.next =
|
|
1316
|
+
_context44.next = 1;
|
|
1317
1317
|
return this.postResource("".concat(v4UrlPath, "/migrations/scope/unaligned/search"), {
|
|
1318
1318
|
orgId: orgId,
|
|
1319
1319
|
count: count,
|
|
1320
1320
|
cursor: cursor,
|
|
1321
1321
|
query: query
|
|
1322
1322
|
});
|
|
1323
|
-
case
|
|
1323
|
+
case 1:
|
|
1324
1324
|
unassignedTeamsResponse = _context44.sent;
|
|
1325
1325
|
return _context44.abrupt("return", unassignedTeamsResponse);
|
|
1326
|
-
case
|
|
1326
|
+
case 2:
|
|
1327
1327
|
case "end":
|
|
1328
1328
|
return _context44.stop();
|
|
1329
1329
|
}
|
|
@@ -1339,20 +1339,20 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1339
1339
|
value: function () {
|
|
1340
1340
|
var _getTeamSiteAssignmentOrgDetails = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
|
|
1341
1341
|
var orgId, err;
|
|
1342
|
-
return _regenerator.default.wrap(function
|
|
1342
|
+
return _regenerator.default.wrap(function (_context45) {
|
|
1343
1343
|
while (1) switch (_context45.prev = _context45.next) {
|
|
1344
1344
|
case 0:
|
|
1345
1345
|
orgId = this.getContext().orgId;
|
|
1346
1346
|
if (orgId) {
|
|
1347
|
-
_context45.next =
|
|
1347
|
+
_context45.next = 1;
|
|
1348
1348
|
break;
|
|
1349
1349
|
}
|
|
1350
1350
|
err = new Error('Organization ID is required');
|
|
1351
1351
|
this.logException(err, 'getTeamSiteAssignmentOrgDetails');
|
|
1352
1352
|
throw err;
|
|
1353
|
-
case
|
|
1353
|
+
case 1:
|
|
1354
1354
|
return _context45.abrupt("return", this.getResource("".concat(v4UrlPath, "/migrations/scope/details/").concat(orgId)));
|
|
1355
|
-
case
|
|
1355
|
+
case 2:
|
|
1356
1356
|
case "end":
|
|
1357
1357
|
return _context45.stop();
|
|
1358
1358
|
}
|
|
@@ -1511,7 +1511,8 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1511
1511
|
key: "getTeamStatesInBulk",
|
|
1512
1512
|
value: function () {
|
|
1513
1513
|
var _getTeamStatesInBulk = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46(orgId, teamIds) {
|
|
1514
|
-
|
|
1514
|
+
var _t4;
|
|
1515
|
+
return _regenerator.default.wrap(function (_context46) {
|
|
1515
1516
|
while (1) switch (_context46.prev = _context46.next) {
|
|
1516
1517
|
case 0:
|
|
1517
1518
|
_context46.prev = 0;
|
|
@@ -1519,16 +1520,16 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
|
|
|
1519
1520
|
orgId: orgId,
|
|
1520
1521
|
teamIds: teamIds
|
|
1521
1522
|
}));
|
|
1522
|
-
case
|
|
1523
|
-
_context46.prev =
|
|
1524
|
-
|
|
1525
|
-
this.logException(
|
|
1526
|
-
throw
|
|
1527
|
-
case
|
|
1523
|
+
case 1:
|
|
1524
|
+
_context46.prev = 1;
|
|
1525
|
+
_t4 = _context46["catch"](0);
|
|
1526
|
+
this.logException(_t4, 'getTeamStatesInBulk');
|
|
1527
|
+
throw _t4;
|
|
1528
|
+
case 2:
|
|
1528
1529
|
case "end":
|
|
1529
1530
|
return _context46.stop();
|
|
1530
1531
|
}
|
|
1531
|
-
}, _callee46, this, [[0,
|
|
1532
|
+
}, _callee46, this, [[0, 1]]);
|
|
1532
1533
|
}));
|
|
1533
1534
|
function getTeamStatesInBulk(_x75, _x76) {
|
|
1534
1535
|
return _getTeamStatesInBulk.apply(this, arguments);
|