@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.
Files changed (63) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/common/utils/http.js +8 -8
  3. package/dist/cjs/common/utils/permissions/has-permission.js +4 -0
  4. package/dist/cjs/common/utils/ufo/index.js +2 -2
  5. package/dist/cjs/services/agg-client/index.js +28 -28
  6. package/dist/cjs/services/directory-client/index.js +38 -36
  7. package/dist/cjs/services/graphql-client/main.js +13 -12
  8. package/dist/cjs/services/graphql-client/utils/index.js +32 -31
  9. package/dist/cjs/services/identity-client/index.js +10 -10
  10. package/dist/cjs/services/invitations-client/index.js +40 -38
  11. package/dist/cjs/services/legion-client/index.js +163 -162
  12. package/dist/cjs/services/main.js +162 -162
  13. package/dist/cjs/services/mutability-client/index.js +1 -1
  14. package/dist/cjs/services/object-resolver-client/index.js +18 -18
  15. package/dist/cjs/services/public-api-client/index.js +69 -68
  16. package/dist/cjs/services/replines-client/index.js +2 -2
  17. package/dist/cjs/services/reporting-lines-client/index.js +4 -4
  18. package/dist/cjs/services/rest-client/index.js +28 -28
  19. package/dist/cjs/services/rest-client/utils/parse-error-message.js +18 -18
  20. package/dist/cjs/services/sentry/main.js +23 -22
  21. package/dist/cjs/services/sentry/utils/get-sentry-config.js +1 -1
  22. package/dist/cjs/services/sentry/utils/initialise-sentry.js +6 -6
  23. package/dist/cjs/services/sentry/utils/sentry-client.js +20 -19
  24. package/dist/cjs/services/sentry/utils/use-teams-sentry-client-setup.js +4 -4
  25. package/dist/cjs/services/team-central-client/index.js +36 -36
  26. package/dist/cjs/services/teams-in-slack-client/index.js +3 -3
  27. package/dist/cjs/services/use-query-light/main.js +38 -38
  28. package/dist/cjs/services/user-preferences-client/index.js +6 -6
  29. package/dist/es2019/common/utils/permissions/has-permission.js +4 -0
  30. package/dist/es2019/common/utils/ufo/index.js +2 -2
  31. package/dist/es2019/services/sentry/utils/get-sentry-config.js +1 -1
  32. package/dist/esm/common/utils/http.js +8 -8
  33. package/dist/esm/common/utils/permissions/has-permission.js +4 -0
  34. package/dist/esm/common/utils/ufo/index.js +2 -2
  35. package/dist/esm/services/agg-client/index.js +28 -28
  36. package/dist/esm/services/directory-client/index.js +38 -36
  37. package/dist/esm/services/graphql-client/main.js +13 -12
  38. package/dist/esm/services/graphql-client/utils/index.js +32 -31
  39. package/dist/esm/services/identity-client/index.js +10 -10
  40. package/dist/esm/services/invitations-client/index.js +40 -38
  41. package/dist/esm/services/legion-client/index.js +163 -162
  42. package/dist/esm/services/main.js +162 -162
  43. package/dist/esm/services/mutability-client/index.js +1 -1
  44. package/dist/esm/services/object-resolver-client/index.js +18 -18
  45. package/dist/esm/services/public-api-client/index.js +69 -68
  46. package/dist/esm/services/replines-client/index.js +2 -2
  47. package/dist/esm/services/reporting-lines-client/index.js +4 -4
  48. package/dist/esm/services/rest-client/index.js +28 -28
  49. package/dist/esm/services/rest-client/utils/parse-error-message.js +18 -18
  50. package/dist/esm/services/sentry/main.js +23 -22
  51. package/dist/esm/services/sentry/utils/get-sentry-config.js +1 -1
  52. package/dist/esm/services/sentry/utils/initialise-sentry.js +6 -6
  53. package/dist/esm/services/sentry/utils/sentry-client.js +19 -18
  54. package/dist/esm/services/sentry/utils/use-teams-sentry-client-setup.js +4 -4
  55. package/dist/esm/services/team-central-client/index.js +36 -36
  56. package/dist/esm/services/teams-in-slack-client/index.js +3 -3
  57. package/dist/esm/services/use-query-light/main.js +38 -38
  58. package/dist/esm/services/user-preferences-client/index.js +6 -6
  59. package/dist/types/common/utils/permissions/has-permission.d.ts +4 -0
  60. package/dist/types/types/index.d.ts +1 -1
  61. package/dist/types-ts4.5/common/utils/permissions/has-permission.d.ts +4 -0
  62. package/dist/types-ts4.5/types/index.d.ts +1 -1
  63. package/package.json +2 -1
@@ -80,16 +80,16 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
80
80
  value: function () {
81
81
  var _getTeamById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(teamId, cloudId) {
82
82
  var siteId, teamResponse;
83
- return _regeneratorRuntime.wrap(function _callee$(_context) {
83
+ return _regeneratorRuntime.wrap(function (_context) {
84
84
  while (1) switch (_context.prev = _context.next) {
85
85
  case 0:
86
86
  siteId = this.getCloudId(cloudId);
87
- _context.next = 3;
87
+ _context.next = 1;
88
88
  return this.getResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "?siteId=").concat(siteId));
89
- case 3:
89
+ case 1:
90
90
  teamResponse = _context.sent;
91
91
  return _context.abrupt("return", this.mapTeamResponseV4ToTeam(teamResponse));
92
- case 5:
92
+ case 2:
93
93
  case "end":
94
94
  return _context.stop();
95
95
  }
@@ -105,15 +105,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
105
105
  value: function () {
106
106
  var _getAllTeams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(allTeamsQuery) {
107
107
  var _this2 = this;
108
- var _allTeamsQuery$enable, _orgId, _siteId, enablePagination, _yield$this$postResou, entities, _cursor, teams;
109
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
108
+ var _allTeamsQuery$enable, _orgId, _siteId, enablePagination, _yield$this$postResou, entities, _cursor, teams, _t;
109
+ return _regeneratorRuntime.wrap(function (_context2) {
110
110
  while (1) switch (_context2.prev = _context2.next) {
111
111
  case 0:
112
112
  _context2.prev = 0;
113
113
  _orgId = this.getOrgId(allTeamsQuery.orgId);
114
114
  _siteId = this.getCloudId();
115
115
  enablePagination = (_allTeamsQuery$enable = allTeamsQuery.enablePagination) !== null && _allTeamsQuery$enable !== void 0 ? _allTeamsQuery$enable : true;
116
- _context2.next = 6;
116
+ _context2.next = 1;
117
117
  return this.postResource("".concat(v4UrlPath, "/search"), _objectSpread({
118
118
  organizationId: _orgId,
119
119
  siteId: _siteId,
@@ -132,7 +132,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
132
132
  }, enablePagination && allTeamsQuery.cursor ? {
133
133
  cursor: allTeamsQuery.cursor
134
134
  } : {}));
135
- case 6:
135
+ case 1:
136
136
  _yield$this$postResou = _context2.sent;
137
137
  entities = _yield$this$postResou.entities;
138
138
  _cursor = _yield$this$postResou.cursor;
@@ -143,20 +143,20 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
143
143
  cursor: _cursor,
144
144
  teams: teams
145
145
  });
146
- case 13:
147
- _context2.prev = 13;
148
- _context2.t0 = _context2["catch"](0);
149
- this.logException(_context2.t0, 'getAllTeams');
146
+ case 2:
147
+ _context2.prev = 2;
148
+ _t = _context2["catch"](0);
149
+ this.logException(_t, 'getAllTeams');
150
150
  return _context2.abrupt("return", {
151
151
  cursor: '',
152
152
  teams: [],
153
- error: _context2.t0 instanceof Error ? _context2.t0 : undefined
153
+ error: _t instanceof Error ? _t : undefined
154
154
  });
155
- case 17:
155
+ case 3:
156
156
  case "end":
157
157
  return _context2.stop();
158
158
  }
159
- }, _callee2, this, [[0, 13]]);
159
+ }, _callee2, this, [[0, 2]]);
160
160
  }));
161
161
  function getAllTeams(_x3) {
162
162
  return _getAllTeams.apply(this, arguments);
@@ -168,15 +168,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
168
168
  value: function () {
169
169
  var _updateTeamById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(teamId, data) {
170
170
  var teamResponse;
171
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
171
+ return _regeneratorRuntime.wrap(function (_context3) {
172
172
  while (1) switch (_context3.prev = _context3.next) {
173
173
  case 0:
174
- _context3.next = 2;
174
+ _context3.next = 1;
175
175
  return this.patchResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId)), data);
176
- case 2:
176
+ case 1:
177
177
  teamResponse = _context3.sent;
178
178
  return _context3.abrupt("return", this.mapTeamResponseV4ToTeam(teamResponse));
179
- case 4:
179
+ case 2:
180
180
  case "end":
181
181
  return _context3.stop();
182
182
  }
@@ -196,15 +196,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
196
196
  value: (function () {
197
197
  var _inviteUsersToTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(teamId, users, originQuery) {
198
198
  var emails, ids, url;
199
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
199
+ return _regeneratorRuntime.wrap(function (_context4) {
200
200
  while (1) switch (_context4.prev = _context4.next) {
201
201
  case 0:
202
202
  if (!(!users || users.length === 0)) {
203
- _context4.next = 2;
203
+ _context4.next = 1;
204
204
  break;
205
205
  }
206
206
  return _context4.abrupt("return", Promise.resolve([]));
207
- case 2:
207
+ case 1:
208
208
  emails = [];
209
209
  ids = [];
210
210
  users.forEach(function (user) {
@@ -219,7 +219,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
219
219
  emailAddresses: emails,
220
220
  atlassianAccounts: ids
221
221
  }));
222
- case 7:
222
+ case 2:
223
223
  case "end":
224
224
  return _context4.stop();
225
225
  }
@@ -234,7 +234,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
234
234
  key: "getMyTeamMembership",
235
235
  value: function () {
236
236
  var _getMyTeamMembership = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(teamId) {
237
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
237
+ return _regeneratorRuntime.wrap(function (_context5) {
238
238
  while (1) switch (_context5.prev = _context5.next) {
239
239
  case 0:
240
240
  return _context5.abrupt("return", this.getResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/me?siteId=").concat(this.getCloudId()), {
@@ -258,16 +258,16 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
258
258
  value: function () {
259
259
  var _getTeamLinksByTeamId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(teamId) {
260
260
  var siteId, response;
261
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
261
+ return _regeneratorRuntime.wrap(function (_context6) {
262
262
  while (1) switch (_context6.prev = _context6.next) {
263
263
  case 0:
264
264
  siteId = this.getCloudId();
265
- _context6.next = 3;
265
+ _context6.next = 1;
266
266
  return this.getResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/links?siteId=").concat(siteId));
267
- case 3:
267
+ case 1:
268
268
  response = _context6.sent;
269
269
  return _context6.abrupt("return", this.mapLegionTeamLinksResponseV4ToTeamLinkResponse(response));
270
- case 5:
270
+ case 2:
271
271
  case "end":
272
272
  return _context6.stop();
273
273
  }
@@ -283,7 +283,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
283
283
  value: function () {
284
284
  var _createTeamLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(teamId, link) {
285
285
  var sanitisedTeamLink, response;
286
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
286
+ return _regeneratorRuntime.wrap(function (_context7) {
287
287
  while (1) switch (_context7.prev = _context7.next) {
288
288
  case 0:
289
289
  sanitisedTeamLink = _objectSpread(_objectSpread({
@@ -295,12 +295,12 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
295
295
  } : {}), link.teamId ? {
296
296
  teamId: link.teamId.trim()
297
297
  } : {});
298
- _context7.next = 3;
298
+ _context7.next = 1;
299
299
  return this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/links"), sanitisedTeamLink);
300
- case 3:
300
+ case 1:
301
301
  response = _context7.sent;
302
302
  return _context7.abrupt("return", this.mapLegionTeamLinkResponseV4ToTeamLink(response));
303
- case 5:
303
+ case 2:
304
304
  case "end":
305
305
  return _context7.stop();
306
306
  }
@@ -316,18 +316,18 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
316
316
  value: function () {
317
317
  var _updateTeamLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(teamId, linkId, _ref) {
318
318
  var linkUri, linkFields, response;
319
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
319
+ return _regeneratorRuntime.wrap(function (_context8) {
320
320
  while (1) switch (_context8.prev = _context8.next) {
321
321
  case 0:
322
322
  linkUri = _ref.linkUri, linkFields = _objectWithoutProperties(_ref, _excluded);
323
- _context8.next = 3;
323
+ _context8.next = 1;
324
324
  return this.putResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/links/").concat(linkId), _objectSpread({
325
325
  linkUri: linkUri.trim()
326
326
  }, linkFields));
327
- case 3:
327
+ case 1:
328
328
  response = _context8.sent;
329
329
  return _context8.abrupt("return", this.mapLegionTeamLinkResponseV4ToTeamLink(response));
330
- case 5:
330
+ case 2:
331
331
  case "end":
332
332
  return _context8.stop();
333
333
  }
@@ -342,7 +342,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
342
342
  key: "deleteTeamLink",
343
343
  value: function () {
344
344
  var _deleteTeamLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(teamId, linkId) {
345
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
345
+ return _regeneratorRuntime.wrap(function (_context9) {
346
346
  while (1) switch (_context9.prev = _context9.next) {
347
347
  case 0:
348
348
  return _context9.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/links/").concat(linkId)));
@@ -362,12 +362,12 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
362
362
  value: function () {
363
363
  var _reorderTeamLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee0(teamId, linkId, newPosition) {
364
364
  var queryArgs;
365
- return _regeneratorRuntime.wrap(function _callee0$(_context0) {
365
+ return _regeneratorRuntime.wrap(function (_context0) {
366
366
  while (1) switch (_context0.prev = _context0.next) {
367
367
  case 0:
368
368
  queryArgs = "?linkId=".concat(linkId, "&newPosition=").concat(newPosition);
369
369
  return _context0.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/links/order").concat(queryArgs)));
370
- case 2:
370
+ case 1:
371
371
  case "end":
372
372
  return _context0.stop();
373
373
  }
@@ -383,20 +383,20 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
383
383
  value: function () {
384
384
  var _getOrgEligibilityForManagedTeams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee1() {
385
385
  var orgId, err;
386
- return _regeneratorRuntime.wrap(function _callee1$(_context1) {
386
+ return _regeneratorRuntime.wrap(function (_context1) {
387
387
  while (1) switch (_context1.prev = _context1.next) {
388
388
  case 0:
389
389
  orgId = this.getOrgId();
390
390
  if (orgId) {
391
- _context1.next = 5;
391
+ _context1.next = 1;
392
392
  break;
393
393
  }
394
394
  err = new Error('Organization ID is required');
395
395
  this.logException(err, 'getOrgEligibilityForManagedTeams');
396
396
  throw err;
397
- case 5:
397
+ case 1:
398
398
  return _context1.abrupt("return", this.getResourceCached("".concat(v4UrlPath, "/org/").concat(orgId, "/premium/eligibility")));
399
- case 6:
399
+ case 2:
400
400
  case "end":
401
401
  return _context1.stop();
402
402
  }
@@ -415,7 +415,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
415
415
  key: "acceptTeamInvitation",
416
416
  value: (function () {
417
417
  var _acceptTeamInvitation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(teamId) {
418
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
418
+ return _regeneratorRuntime.wrap(function (_context10) {
419
419
  while (1) switch (_context10.prev = _context10.next) {
420
420
  case 0:
421
421
  return _context10.abrupt("return", this.postResource("".concat(v3UrlPath, "/ui/").concat(this.trimTeamARI(teamId), "/membership/accept")));
@@ -439,7 +439,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
439
439
  key: "declineTeamInvitation",
440
440
  value: (function () {
441
441
  var _declineTeamInvitation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(teamId) {
442
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
442
+ return _regeneratorRuntime.wrap(function (_context11) {
443
443
  while (1) switch (_context11.prev = _context11.next) {
444
444
  case 0:
445
445
  return _context11.abrupt("return", this.postResource("".concat(v3UrlPath, "/ui/").concat(this.trimTeamARI(teamId), "/membership/decline")));
@@ -461,12 +461,12 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
461
461
  // TODO Test me
462
462
  teamId, originQuery) {
463
463
  var url;
464
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
464
+ return _regeneratorRuntime.wrap(function (_context12) {
465
465
  while (1) switch (_context12.prev = _context12.next) {
466
466
  case 0:
467
467
  url = "".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/join?").concat(this.constructProductOriginParams(originQuery));
468
468
  return _context12.abrupt("return", this.postResource(url));
469
- case 2:
469
+ case 1:
470
470
  case "end":
471
471
  return _context12.stop();
472
472
  }
@@ -481,33 +481,33 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
481
481
  key: "addAgentsToTeam",
482
482
  value: function () {
483
483
  var _addAgentsToTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(teamId, agents) {
484
- var missingAgentsError, url;
485
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
484
+ var missingAgentsError, url, _t2;
485
+ return _regeneratorRuntime.wrap(function (_context13) {
486
486
  while (1) switch (_context13.prev = _context13.next) {
487
487
  case 0:
488
488
  if (!(!agents || agents.length === 0)) {
489
- _context13.next = 4;
489
+ _context13.next = 1;
490
490
  break;
491
491
  }
492
492
  missingAgentsError = new Error('Missing agents to add');
493
493
  this.logException(missingAgentsError, 'addAgentToTeam');
494
494
  throw missingAgentsError;
495
- case 4:
496
- _context13.prev = 4;
495
+ case 1:
496
+ _context13.prev = 1;
497
497
  url = "".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/agents");
498
498
  return _context13.abrupt("return", this.postResource(url, {
499
499
  agents: agents
500
500
  }));
501
- case 9:
502
- _context13.prev = 9;
503
- _context13.t0 = _context13["catch"](4);
504
- this.logException(_context13.t0, 'addAgentToTeam');
505
- throw _context13.t0;
506
- case 13:
501
+ case 2:
502
+ _context13.prev = 2;
503
+ _t2 = _context13["catch"](1);
504
+ this.logException(_t2, 'addAgentToTeam');
505
+ throw _t2;
506
+ case 3:
507
507
  case "end":
508
508
  return _context13.stop();
509
509
  }
510
- }, _callee13, this, [[4, 9]]);
510
+ }, _callee13, this, [[1, 2]]);
511
511
  }));
512
512
  function addAgentsToTeam(_x23, _x24) {
513
513
  return _addAgentsToTeam.apply(this, arguments);
@@ -518,23 +518,23 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
518
518
  key: "removeAgentTeamAssociation",
519
519
  value: function () {
520
520
  var _removeAgentTeamAssociation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(teamId, agentId) {
521
- var url;
522
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
521
+ var url, _t3;
522
+ return _regeneratorRuntime.wrap(function (_context14) {
523
523
  while (1) switch (_context14.prev = _context14.next) {
524
524
  case 0:
525
525
  _context14.prev = 0;
526
526
  url = "".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/agents/").concat(agentId);
527
527
  return _context14.abrupt("return", this.deleteResource(url));
528
- case 5:
529
- _context14.prev = 5;
530
- _context14.t0 = _context14["catch"](0);
531
- this.logException(_context14.t0, 'removeAgentTeamAssociation');
532
- throw _context14.t0;
533
- case 9:
528
+ case 1:
529
+ _context14.prev = 1;
530
+ _t3 = _context14["catch"](0);
531
+ this.logException(_t3, 'removeAgentTeamAssociation');
532
+ throw _t3;
533
+ case 2:
534
534
  case "end":
535
535
  return _context14.stop();
536
536
  }
537
- }, _callee14, this, [[0, 5]]);
537
+ }, _callee14, this, [[0, 1]]);
538
538
  }));
539
539
  function removeAgentTeamAssociation(_x25, _x26) {
540
540
  return _removeAgentTeamAssociation.apply(this, arguments);
@@ -545,7 +545,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
545
545
  key: "cancelJoinRequest",
546
546
  value: function () {
547
547
  var _cancelJoinRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(teamId) {
548
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
548
+ return _regeneratorRuntime.wrap(function (_context15) {
549
549
  while (1) switch (_context15.prev = _context15.next) {
550
550
  case 0:
551
551
  return _context15.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/request")));
@@ -564,7 +564,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
564
564
  key: "acceptJoinRequest",
565
565
  value: function () {
566
566
  var _acceptJoinRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(teamId, memberId) {
567
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
567
+ return _regeneratorRuntime.wrap(function (_context16) {
568
568
  while (1) switch (_context16.prev = _context16.next) {
569
569
  case 0:
570
570
  return _context16.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/request/accept")));
@@ -583,7 +583,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
583
583
  key: "declineJoinRequest",
584
584
  value: function () {
585
585
  var _declineJoinRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(teamId, memberId) {
586
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
586
+ return _regeneratorRuntime.wrap(function (_context17) {
587
587
  while (1) switch (_context17.prev = _context17.next) {
588
588
  case 0:
589
589
  return _context17.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/request/decline")));
@@ -606,7 +606,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
606
606
  key: "deleteTeamMembership",
607
607
  value: (function () {
608
608
  var _deleteTeamMembership = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(teamId, memberId) {
609
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
609
+ return _regeneratorRuntime.wrap(function (_context18) {
610
610
  while (1) switch (_context18.prev = _context18.next) {
611
611
  case 0:
612
612
  return _context18.abrupt("return", this.deleteResource("".concat(v3UrlPath, "/").concat(this.trimTeamARI(teamId), "/members/").concat(memberId)));
@@ -630,7 +630,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
630
630
  key: "revokeTeamInvite",
631
631
  value: (function () {
632
632
  var _revokeTeamInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(teamId, memberId) {
633
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
633
+ return _regeneratorRuntime.wrap(function (_context19) {
634
634
  while (1) switch (_context19.prev = _context19.next) {
635
635
  case 0:
636
636
  return _context19.abrupt("return", this.deleteResource("".concat(v3UrlPath, "/ui/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/revoke")));
@@ -649,7 +649,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
649
649
  key: "deleteTeam",
650
650
  value: function () {
651
651
  var _deleteTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(teamId) {
652
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
652
+ return _regeneratorRuntime.wrap(function (_context20) {
653
653
  while (1) switch (_context20.prev = _context20.next) {
654
654
  case 0:
655
655
  return _context20.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId))));
@@ -669,12 +669,12 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
669
669
  value: function () {
670
670
  var _archiveTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(teamId) {
671
671
  var siteId;
672
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
672
+ return _regeneratorRuntime.wrap(function (_context21) {
673
673
  while (1) switch (_context21.prev = _context21.next) {
674
674
  case 0:
675
675
  siteId = this.getCloudId();
676
676
  return _context21.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/archive?siteId=").concat(siteId)));
677
- case 2:
677
+ case 1:
678
678
  case "end":
679
679
  return _context21.stop();
680
680
  }
@@ -690,12 +690,12 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
690
690
  value: function () {
691
691
  var _unArchiveTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(teamId) {
692
692
  var siteId;
693
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
693
+ return _regeneratorRuntime.wrap(function (_context22) {
694
694
  while (1) switch (_context22.prev = _context22.next) {
695
695
  case 0:
696
696
  siteId = this.getCloudId();
697
697
  return _context22.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/unarchive?siteId=").concat(siteId)));
698
- case 2:
698
+ case 1:
699
699
  case "end":
700
700
  return _context22.stop();
701
701
  }
@@ -710,7 +710,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
710
710
  key: "unlinkTeamFromGroup",
711
711
  value: function () {
712
712
  var _unlinkTeamFromGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(teamId, membershipSettings) {
713
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
713
+ return _regeneratorRuntime.wrap(function (_context23) {
714
714
  while (1) switch (_context23.prev = _context23.next) {
715
715
  case 0:
716
716
  return _context23.abrupt("return", this.patchResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId)), {
@@ -736,15 +736,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
736
736
  value: (function () {
737
737
  var _isSingleFullMemberTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(teamId) {
738
738
  var members;
739
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
739
+ return _regeneratorRuntime.wrap(function (_context24) {
740
740
  while (1) switch (_context24.prev = _context24.next) {
741
741
  case 0:
742
- _context24.next = 2;
742
+ _context24.next = 1;
743
743
  return this.getResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/members?size=2&membershipState=FULL_MEMBER&siteId=").concat(this.getCloudId()));
744
- case 2:
744
+ case 1:
745
745
  members = _context24.sent;
746
746
  return _context24.abrupt("return", members.entities.length === 1);
747
- case 4:
747
+ case 2:
748
748
  case "end":
749
749
  return _context24.stop();
750
750
  }
@@ -766,22 +766,22 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
766
766
  url,
767
767
  legionTeam,
768
768
  _args25 = arguments;
769
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
769
+ return _regeneratorRuntime.wrap(function (_context25) {
770
770
  while (1) switch (_context25.prev = _context25.next) {
771
771
  case 0:
772
772
  membershipSettings = _args25.length > 3 && _args25[3] !== undefined ? _args25[3] : 'OPEN';
773
773
  typeId = _args25.length > 4 ? _args25[4] : undefined;
774
774
  organizationId = this.getContext().orgId;
775
775
  if (organizationId) {
776
- _context25.next = 7;
776
+ _context25.next = 1;
777
777
  break;
778
778
  }
779
779
  err = new Error('Organization ID is required');
780
780
  this.logException(err, 'createTeam');
781
781
  throw err;
782
- case 7:
782
+ case 1:
783
783
  url = "".concat(v4UrlPath, "?").concat(this.constructProductOriginParams(originQuery));
784
- _context25.next = 10;
784
+ _context25.next = 2;
785
785
  return this.postResource(url, {
786
786
  displayName: displayName,
787
787
  description: '',
@@ -791,10 +791,10 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
791
791
  members: _toConsumableArray(new Set(members)),
792
792
  typeId: typeId
793
793
  });
794
- case 10:
794
+ case 2:
795
795
  legionTeam = _context25.sent;
796
796
  return _context25.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionTeam));
797
- case 12:
797
+ case 3:
798
798
  case "end":
799
799
  return _context25.stop();
800
800
  }
@@ -810,21 +810,21 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
810
810
  value: function () {
811
811
  var _createExternalTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(description, externalReference, teamName, siteId) {
812
812
  var organizationId, cloudId, err, url, legionExternalTeam;
813
- return _regeneratorRuntime.wrap(function _callee26$(_context26) {
813
+ return _regeneratorRuntime.wrap(function (_context26) {
814
814
  while (1) switch (_context26.prev = _context26.next) {
815
815
  case 0:
816
816
  organizationId = this.getContext().orgId;
817
817
  cloudId = this.getContext().cloudId;
818
818
  if (organizationId) {
819
- _context26.next = 6;
819
+ _context26.next = 1;
820
820
  break;
821
821
  }
822
822
  err = new Error('Organization ID is required');
823
823
  this.logException(err, 'createTeam');
824
824
  throw err;
825
- case 6:
825
+ case 1:
826
826
  url = "".concat(v4UrlPath, "/external?origin.cloudId=").concat(encodeURIComponent(this.getCloudId(siteId || cloudId)));
827
- _context26.next = 9;
827
+ _context26.next = 2;
828
828
  return this.postResource(url, {
829
829
  description: description,
830
830
  externalReference: externalReference,
@@ -832,10 +832,10 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
832
832
  siteId: siteId || cloudId,
833
833
  displayName: teamName
834
834
  });
835
- case 9:
835
+ case 2:
836
836
  legionExternalTeam = _context26.sent;
837
837
  return _context26.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionExternalTeam));
838
- case 11:
838
+ case 3:
839
839
  case "end":
840
840
  return _context26.stop();
841
841
  }
@@ -851,7 +851,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
851
851
  value: function () {
852
852
  var _getTeamAndGroupDiff = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(teamId, externalReference) {
853
853
  var siteId;
854
- return _regeneratorRuntime.wrap(function _callee27$(_context27) {
854
+ return _regeneratorRuntime.wrap(function (_context27) {
855
855
  while (1) switch (_context27.prev = _context27.next) {
856
856
  case 0:
857
857
  siteId = this.getCloudId();
@@ -859,7 +859,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
859
859
  siteId: siteId,
860
860
  externalReference: externalReference
861
861
  }));
862
- case 2:
862
+ case 1:
863
863
  case "end":
864
864
  return _context27.stop();
865
865
  }
@@ -875,7 +875,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
875
875
  value: function () {
876
876
  var _linkExistingTeamToGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(teamId, externalReference) {
877
877
  var siteId;
878
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
878
+ return _regeneratorRuntime.wrap(function (_context28) {
879
879
  while (1) switch (_context28.prev = _context28.next) {
880
880
  case 0:
881
881
  siteId = this.getCloudId();
@@ -883,7 +883,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
883
883
  externalReference: externalReference,
884
884
  siteId: siteId
885
885
  }));
886
- case 2:
886
+ case 1:
887
887
  case "end":
888
888
  return _context28.stop();
889
889
  }
@@ -898,7 +898,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
898
898
  key: "getWriteMediaToken",
899
899
  value: function () {
900
900
  var _getWriteMediaToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
901
- return _regeneratorRuntime.wrap(function _callee29$(_context29) {
901
+ return _regeneratorRuntime.wrap(function (_context29) {
902
902
  while (1) switch (_context29.prev = _context29.next) {
903
903
  case 0:
904
904
  return _context29.abrupt("return", this.getResource('/v4/teams/header-image/media-upload').then(function (response) {
@@ -923,7 +923,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
923
923
  value: function () {
924
924
  var _getSoftDeletedTeamById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(teamId) {
925
925
  var orgId, siteId;
926
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
926
+ return _regeneratorRuntime.wrap(function (_context30) {
927
927
  while (1) switch (_context30.prev = _context30.next) {
928
928
  case 0:
929
929
  orgId = this.getOrgId();
@@ -933,7 +933,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
933
933
  id: teamId
934
934
  });
935
935
  }));
936
- case 3:
936
+ case 1:
937
937
  case "end":
938
938
  return _context30.stop();
939
939
  }
@@ -952,7 +952,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
952
952
  value: (function () {
953
953
  var _getUserInSiteUserBase = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(userId) {
954
954
  var siteId;
955
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
955
+ return _regeneratorRuntime.wrap(function (_context31) {
956
956
  while (1) switch (_context31.prev = _context31.next) {
957
957
  case 0:
958
958
  siteId = this.getCloudId();
@@ -962,7 +962,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
962
962
  'X-header-client-id': 'ptc-fe'
963
963
  }
964
964
  }));
965
- case 2:
965
+ case 1:
966
966
  case "end":
967
967
  return _context31.stop();
968
968
  }
@@ -977,7 +977,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
977
977
  key: "retrieveBrowseUserPermission",
978
978
  value: function () {
979
979
  var _retrieveBrowseUserPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(product) {
980
- return _regeneratorRuntime.wrap(function _callee32$(_context32) {
980
+ return _regeneratorRuntime.wrap(function (_context32) {
981
981
  while (1) switch (_context32.prev = _context32.next) {
982
982
  case 0:
983
983
  return _context32.abrupt("return", this.getResourceCached("/teams/site/".concat(this.getCloudId(), "/canSearchUsers?product=").concat(product), undefined,
@@ -1001,21 +1001,21 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1001
1001
  value: function () {
1002
1002
  var _getPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
1003
1003
  var orgId, siteId, err;
1004
- return _regeneratorRuntime.wrap(function _callee33$(_context33) {
1004
+ return _regeneratorRuntime.wrap(function (_context33) {
1005
1005
  while (1) switch (_context33.prev = _context33.next) {
1006
1006
  case 0:
1007
1007
  orgId = this.getContext().orgId;
1008
1008
  siteId = this.getCloudId();
1009
1009
  if (orgId) {
1010
- _context33.next = 6;
1010
+ _context33.next = 1;
1011
1011
  break;
1012
1012
  }
1013
1013
  err = new Error('Organization ID is required');
1014
1014
  this.logException(err, 'getPermissions');
1015
1015
  throw err;
1016
- case 6:
1016
+ case 1:
1017
1017
  return _context33.abrupt("return", this.getResourceCached("".concat(v4UrlPath, "/permission/self/organization/").concat(orgId, "?siteId=").concat(siteId)));
1018
- case 7:
1018
+ case 2:
1019
1019
  case "end":
1020
1020
  return _context33.stop();
1021
1021
  }
@@ -1031,28 +1031,28 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1031
1031
  value: function () {
1032
1032
  var _getLinkedTeamsBulk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(groupIds) {
1033
1033
  var organizationId, err, legionExternalTeam;
1034
- return _regeneratorRuntime.wrap(function _callee34$(_context34) {
1034
+ return _regeneratorRuntime.wrap(function (_context34) {
1035
1035
  while (1) switch (_context34.prev = _context34.next) {
1036
1036
  case 0:
1037
1037
  organizationId = this.getContext().orgId;
1038
1038
  if (organizationId) {
1039
- _context34.next = 5;
1039
+ _context34.next = 1;
1040
1040
  break;
1041
1041
  }
1042
1042
  err = new Error('Organization ID is required');
1043
1043
  this.logException(err, 'getLinkedTeamsBulk');
1044
1044
  throw err;
1045
- case 5:
1046
- _context34.next = 7;
1045
+ case 1:
1046
+ _context34.next = 2;
1047
1047
  return this.postResource("".concat(v4UrlPath, "/external/bulk"), {
1048
1048
  organizationId: organizationId,
1049
1049
  source: 'ATLASSIAN_GROUP',
1050
1050
  externalIds: groupIds
1051
1051
  });
1052
- case 7:
1052
+ case 2:
1053
1053
  legionExternalTeam = _context34.sent;
1054
1054
  return _context34.abrupt("return", legionExternalTeam);
1055
- case 9:
1055
+ case 3:
1056
1056
  case "end":
1057
1057
  return _context34.stop();
1058
1058
  }
@@ -1068,24 +1068,24 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1068
1068
  value: function () {
1069
1069
  var _getTeamProfileDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(teamId, siteId) {
1070
1070
  var finalSiteId, err, linkedTeamsProfileDetails;
1071
- return _regeneratorRuntime.wrap(function _callee35$(_context35) {
1071
+ return _regeneratorRuntime.wrap(function (_context35) {
1072
1072
  while (1) switch (_context35.prev = _context35.next) {
1073
1073
  case 0:
1074
1074
  finalSiteId = siteId || this.getCloudId();
1075
1075
  if (finalSiteId) {
1076
- _context35.next = 5;
1076
+ _context35.next = 1;
1077
1077
  break;
1078
1078
  }
1079
1079
  err = new Error('Site ID is required');
1080
1080
  this.logException(err, 'getTeamProfileDetails');
1081
1081
  throw err;
1082
- case 5:
1083
- _context35.next = 7;
1082
+ case 1:
1083
+ _context35.next = 2;
1084
1084
  return this.getResource("".concat(v4UrlPath, "/").concat(teamId, "/profile?siteId=").concat(finalSiteId));
1085
- case 7:
1085
+ case 2:
1086
1086
  linkedTeamsProfileDetails = _context35.sent;
1087
1087
  return _context35.abrupt("return", linkedTeamsProfileDetails);
1088
- case 9:
1088
+ case 3:
1089
1089
  case "end":
1090
1090
  return _context35.stop();
1091
1091
  }
@@ -1101,24 +1101,24 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1101
1101
  value: function () {
1102
1102
  var _getOrgScope = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36() {
1103
1103
  var orgId, err, orgScope;
1104
- return _regeneratorRuntime.wrap(function _callee36$(_context36) {
1104
+ return _regeneratorRuntime.wrap(function (_context36) {
1105
1105
  while (1) switch (_context36.prev = _context36.next) {
1106
1106
  case 0:
1107
1107
  orgId = this.getContext().orgId;
1108
1108
  if (orgId) {
1109
- _context36.next = 5;
1109
+ _context36.next = 1;
1110
1110
  break;
1111
1111
  }
1112
1112
  err = new Error('Organization ID is required');
1113
1113
  this.logException(err, 'getOrgScope');
1114
1114
  throw err;
1115
- case 5:
1116
- _context36.next = 7;
1115
+ case 1:
1116
+ _context36.next = 2;
1117
1117
  return this.getResourceCached("".concat(v4UrlPath, "/org/").concat(orgId, "/scope"));
1118
- case 7:
1118
+ case 2:
1119
1119
  orgScope = _context36.sent;
1120
1120
  return _context36.abrupt("return", orgScope);
1121
- case 9:
1121
+ case 3:
1122
1122
  case "end":
1123
1123
  return _context36.stop();
1124
1124
  }
@@ -1134,18 +1134,18 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1134
1134
  value: function () {
1135
1135
  var _restoreTeamToSyncedGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(teamId, externalReference) {
1136
1136
  var siteId;
1137
- return _regeneratorRuntime.wrap(function _callee37$(_context37) {
1137
+ return _regeneratorRuntime.wrap(function (_context37) {
1138
1138
  while (1) switch (_context37.prev = _context37.next) {
1139
1139
  case 0:
1140
1140
  siteId = this.getCloudId();
1141
- _context37.next = 3;
1141
+ _context37.next = 1;
1142
1142
  return this.postResource("".concat(v4UrlPath, "/").concat(teamId, "/external/restore"), {
1143
1143
  externalReference: externalReference,
1144
1144
  siteId: siteId
1145
1145
  });
1146
- case 3:
1146
+ case 1:
1147
1147
  return _context37.abrupt("return", _context37.sent);
1148
- case 4:
1148
+ case 2:
1149
1149
  case "end":
1150
1150
  return _context37.stop();
1151
1151
  }
@@ -1160,7 +1160,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1160
1160
  key: "createTeamContainers",
1161
1161
  value: function () {
1162
1162
  var _createTeamContainers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(payload) {
1163
- return _regeneratorRuntime.wrap(function _callee38$(_context38) {
1163
+ return _regeneratorRuntime.wrap(function (_context38) {
1164
1164
  while (1) switch (_context38.prev = _context38.next) {
1165
1165
  case 0:
1166
1166
  return _context38.abrupt("return", this.postResource("".concat(v4UrlPath, "/containers"), _objectSpread({}, payload)));
@@ -1180,15 +1180,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1180
1180
  value: function () {
1181
1181
  var _getTeamEnabledSites = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(teamId) {
1182
1182
  var teamEnabledSites;
1183
- return _regeneratorRuntime.wrap(function _callee39$(_context39) {
1183
+ return _regeneratorRuntime.wrap(function (_context39) {
1184
1184
  while (1) switch (_context39.prev = _context39.next) {
1185
1185
  case 0:
1186
- _context39.next = 2;
1186
+ _context39.next = 1;
1187
1187
  return this.getResourceCached("".concat(v4UrlPath, "/migrations/scope/").concat(teamId));
1188
- case 2:
1188
+ case 1:
1189
1189
  teamEnabledSites = _context39.sent;
1190
1190
  return _context39.abrupt("return", teamEnabledSites);
1191
- case 4:
1191
+ case 2:
1192
1192
  case "end":
1193
1193
  return _context39.stop();
1194
1194
  }
@@ -1204,18 +1204,18 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1204
1204
  value: function () {
1205
1205
  var _assignTeamsToSites = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(migrations) {
1206
1206
  var assignTeamsToSitesResponse;
1207
- return _regeneratorRuntime.wrap(function _callee40$(_context40) {
1207
+ return _regeneratorRuntime.wrap(function (_context40) {
1208
1208
  while (1) switch (_context40.prev = _context40.next) {
1209
1209
  case 0:
1210
- _context40.next = 2;
1210
+ _context40.next = 1;
1211
1211
  return this.postResource("".concat(v4UrlPath, "/migrations/scope"), {
1212
1212
  originOrgId: this.getContext().orgId,
1213
1213
  migrations: migrations
1214
1214
  });
1215
- case 2:
1215
+ case 1:
1216
1216
  assignTeamsToSitesResponse = _context40.sent;
1217
1217
  return _context40.abrupt("return", assignTeamsToSitesResponse);
1218
- case 4:
1218
+ case 2:
1219
1219
  case "end":
1220
1220
  return _context40.stop();
1221
1221
  }
@@ -1230,7 +1230,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1230
1230
  key: "getTeamsToBeClonedToJsmSites",
1231
1231
  value: function () {
1232
1232
  var _getTeamsToBeClonedToJsmSites = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(teamsToSiteScope) {
1233
- return _regeneratorRuntime.wrap(function _callee41$(_context41) {
1233
+ return _regeneratorRuntime.wrap(function (_context41) {
1234
1234
  while (1) switch (_context41.prev = _context41.next) {
1235
1235
  case 0:
1236
1236
  return _context41.abrupt("return", this.postResource("".concat(v4UrlPath, "/migrations/scope/review"), {
@@ -1252,7 +1252,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1252
1252
  key: "setTeamSiteAssignmentPermission",
1253
1253
  value: function () {
1254
1254
  var _setTeamSiteAssignmentPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(orgId, alignmentPermission) {
1255
- return _regeneratorRuntime.wrap(function _callee42$(_context42) {
1255
+ return _regeneratorRuntime.wrap(function (_context42) {
1256
1256
  while (1) switch (_context42.prev = _context42.next) {
1257
1257
  case 0:
1258
1258
  return _context42.abrupt("return", this.postResource("".concat(v4UrlPath, "/migrations/scope/permissions"), {
@@ -1275,20 +1275,20 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1275
1275
  value: function () {
1276
1276
  var _getAssignedTeams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(orgId, count, cursor, displayNameContains) {
1277
1277
  var assignedTeamsResponse;
1278
- return _regeneratorRuntime.wrap(function _callee43$(_context43) {
1278
+ return _regeneratorRuntime.wrap(function (_context43) {
1279
1279
  while (1) switch (_context43.prev = _context43.next) {
1280
1280
  case 0:
1281
- _context43.next = 2;
1281
+ _context43.next = 1;
1282
1282
  return this.postResource("".concat(v4UrlPath, "/migrations/scope/aligned/search"), {
1283
1283
  orgId: orgId,
1284
1284
  count: count,
1285
1285
  cursor: cursor,
1286
1286
  displayNameContains: displayNameContains
1287
1287
  });
1288
- case 2:
1288
+ case 1:
1289
1289
  assignedTeamsResponse = _context43.sent;
1290
1290
  return _context43.abrupt("return", assignedTeamsResponse);
1291
- case 4:
1291
+ case 2:
1292
1292
  case "end":
1293
1293
  return _context43.stop();
1294
1294
  }
@@ -1304,20 +1304,20 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1304
1304
  value: function () {
1305
1305
  var _getUnassignedTeams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(orgId, count, cursor, query) {
1306
1306
  var unassignedTeamsResponse;
1307
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
1307
+ return _regeneratorRuntime.wrap(function (_context44) {
1308
1308
  while (1) switch (_context44.prev = _context44.next) {
1309
1309
  case 0:
1310
- _context44.next = 2;
1310
+ _context44.next = 1;
1311
1311
  return this.postResource("".concat(v4UrlPath, "/migrations/scope/unaligned/search"), {
1312
1312
  orgId: orgId,
1313
1313
  count: count,
1314
1314
  cursor: cursor,
1315
1315
  query: query
1316
1316
  });
1317
- case 2:
1317
+ case 1:
1318
1318
  unassignedTeamsResponse = _context44.sent;
1319
1319
  return _context44.abrupt("return", unassignedTeamsResponse);
1320
- case 4:
1320
+ case 2:
1321
1321
  case "end":
1322
1322
  return _context44.stop();
1323
1323
  }
@@ -1333,20 +1333,20 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1333
1333
  value: function () {
1334
1334
  var _getTeamSiteAssignmentOrgDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45() {
1335
1335
  var orgId, err;
1336
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
1336
+ return _regeneratorRuntime.wrap(function (_context45) {
1337
1337
  while (1) switch (_context45.prev = _context45.next) {
1338
1338
  case 0:
1339
1339
  orgId = this.getContext().orgId;
1340
1340
  if (orgId) {
1341
- _context45.next = 5;
1341
+ _context45.next = 1;
1342
1342
  break;
1343
1343
  }
1344
1344
  err = new Error('Organization ID is required');
1345
1345
  this.logException(err, 'getTeamSiteAssignmentOrgDetails');
1346
1346
  throw err;
1347
- case 5:
1347
+ case 1:
1348
1348
  return _context45.abrupt("return", this.getResource("".concat(v4UrlPath, "/migrations/scope/details/").concat(orgId)));
1349
- case 6:
1349
+ case 2:
1350
1350
  case "end":
1351
1351
  return _context45.stop();
1352
1352
  }
@@ -1505,7 +1505,8 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1505
1505
  key: "getTeamStatesInBulk",
1506
1506
  value: function () {
1507
1507
  var _getTeamStatesInBulk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(orgId, teamIds) {
1508
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
1508
+ var _t4;
1509
+ return _regeneratorRuntime.wrap(function (_context46) {
1509
1510
  while (1) switch (_context46.prev = _context46.next) {
1510
1511
  case 0:
1511
1512
  _context46.prev = 0;
@@ -1513,16 +1514,16 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1513
1514
  orgId: orgId,
1514
1515
  teamIds: teamIds
1515
1516
  }));
1516
- case 4:
1517
- _context46.prev = 4;
1518
- _context46.t0 = _context46["catch"](0);
1519
- this.logException(_context46.t0, 'getTeamStatesInBulk');
1520
- throw _context46.t0;
1521
- case 8:
1517
+ case 1:
1518
+ _context46.prev = 1;
1519
+ _t4 = _context46["catch"](0);
1520
+ this.logException(_t4, 'getTeamStatesInBulk');
1521
+ throw _t4;
1522
+ case 2:
1522
1523
  case "end":
1523
1524
  return _context46.stop();
1524
1525
  }
1525
- }, _callee46, this, [[0, 4]]);
1526
+ }, _callee46, this, [[0, 1]]);
1526
1527
  }));
1527
1528
  function getTeamStatesInBulk(_x75, _x76) {
1528
1529
  return _getTeamStatesInBulk.apply(this, arguments);