@atlaskit/teams-client 4.6.4 → 4.8.0

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 (42) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/common/utils/ufo/constants.js +1 -1
  3. package/dist/cjs/common/utils/ufo/index.js +2 -2
  4. package/dist/cjs/services/agg-client/index.js +51 -0
  5. package/dist/cjs/services/agg-client/utils/queries/team-has-agents-query.js +12 -0
  6. package/dist/cjs/services/legion-client/index.js +199 -162
  7. package/dist/cjs/services/main.js +738 -679
  8. package/dist/cjs/services/sentry/utils/get-sentry-config.js +1 -1
  9. package/dist/cjs/types/association.js +5 -0
  10. package/dist/es2019/common/utils/ufo/constants.js +1 -1
  11. package/dist/es2019/common/utils/ufo/index.js +2 -2
  12. package/dist/es2019/services/agg-client/index.js +29 -1
  13. package/dist/es2019/services/agg-client/utils/queries/team-has-agents-query.js +24 -0
  14. package/dist/es2019/services/legion-client/index.js +16 -0
  15. package/dist/es2019/services/main.js +16 -0
  16. package/dist/es2019/services/sentry/utils/get-sentry-config.js +1 -1
  17. package/dist/es2019/types/association.js +1 -0
  18. package/dist/esm/common/utils/ufo/constants.js +1 -1
  19. package/dist/esm/common/utils/ufo/index.js +2 -2
  20. package/dist/esm/services/agg-client/index.js +52 -1
  21. package/dist/esm/services/agg-client/utils/queries/team-has-agents-query.js +5 -0
  22. package/dist/esm/services/legion-client/index.js +199 -162
  23. package/dist/esm/services/main.js +738 -679
  24. package/dist/esm/services/sentry/utils/get-sentry-config.js +1 -1
  25. package/dist/esm/types/association.js +1 -0
  26. package/dist/types/common/utils/ufo/constants.d.ts +2 -2
  27. package/dist/types/services/agg-client/index.d.ts +3 -1
  28. package/dist/types/services/agg-client/utils/queries/team-has-agents-query.d.ts +15 -0
  29. package/dist/types/services/legion-client/index.d.ts +2 -1
  30. package/dist/types/services/legion-client/types.d.ts +8 -0
  31. package/dist/types/services/main.d.ts +10 -0
  32. package/dist/types/types/association.d.ts +8 -0
  33. package/dist/types/types/index.d.ts +1 -0
  34. package/dist/types-ts4.5/common/utils/ufo/constants.d.ts +3 -2
  35. package/dist/types-ts4.5/services/agg-client/index.d.ts +3 -1
  36. package/dist/types-ts4.5/services/agg-client/utils/queries/team-has-agents-query.d.ts +15 -0
  37. package/dist/types-ts4.5/services/legion-client/index.d.ts +2 -1
  38. package/dist/types-ts4.5/services/legion-client/types.d.ts +8 -0
  39. package/dist/types-ts4.5/services/main.d.ts +10 -0
  40. package/dist/types-ts4.5/types/association.d.ts +8 -0
  41. package/dist/types-ts4.5/types/index.d.ts +1 -0
  42. package/package.json +1 -1
@@ -472,58 +472,95 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
472
472
  return selfJoinTeam;
473
473
  }()
474
474
  }, {
475
- key: "cancelJoinRequest",
475
+ key: "addAgentsToTeam",
476
476
  value: function () {
477
- var _cancelJoinRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(teamId) {
477
+ var _addAgentsToTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(teamId, agents) {
478
+ var missingAgentsError, url;
478
479
  return _regeneratorRuntime.wrap(function _callee13$(_context13) {
479
480
  while (1) switch (_context13.prev = _context13.next) {
480
481
  case 0:
481
- return _context13.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/request")));
482
- case 1:
482
+ if (!(!agents || agents.length === 0)) {
483
+ _context13.next = 4;
484
+ break;
485
+ }
486
+ missingAgentsError = new Error('Missing agents to add');
487
+ this.logException(missingAgentsError, 'addAgentToTeam');
488
+ throw missingAgentsError;
489
+ case 4:
490
+ _context13.prev = 4;
491
+ url = "".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/agents");
492
+ return _context13.abrupt("return", this.postResource(url, {
493
+ agents: agents
494
+ }));
495
+ case 9:
496
+ _context13.prev = 9;
497
+ _context13.t0 = _context13["catch"](4);
498
+ this.logException(_context13.t0, 'addAgentToTeam');
499
+ throw _context13.t0;
500
+ case 13:
483
501
  case "end":
484
502
  return _context13.stop();
485
503
  }
486
- }, _callee13, this);
504
+ }, _callee13, this, [[4, 9]]);
487
505
  }));
488
- function cancelJoinRequest(_x22) {
489
- return _cancelJoinRequest.apply(this, arguments);
506
+ function addAgentsToTeam(_x22, _x23) {
507
+ return _addAgentsToTeam.apply(this, arguments);
490
508
  }
491
- return cancelJoinRequest;
509
+ return addAgentsToTeam;
492
510
  }()
493
511
  }, {
494
- key: "acceptJoinRequest",
512
+ key: "cancelJoinRequest",
495
513
  value: function () {
496
- var _acceptJoinRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(teamId, memberId) {
514
+ var _cancelJoinRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(teamId) {
497
515
  return _regeneratorRuntime.wrap(function _callee14$(_context14) {
498
516
  while (1) switch (_context14.prev = _context14.next) {
499
517
  case 0:
500
- return _context14.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/request/accept")));
518
+ return _context14.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/request")));
501
519
  case 1:
502
520
  case "end":
503
521
  return _context14.stop();
504
522
  }
505
523
  }, _callee14, this);
506
524
  }));
507
- function acceptJoinRequest(_x23, _x24) {
508
- return _acceptJoinRequest.apply(this, arguments);
525
+ function cancelJoinRequest(_x24) {
526
+ return _cancelJoinRequest.apply(this, arguments);
509
527
  }
510
- return acceptJoinRequest;
528
+ return cancelJoinRequest;
511
529
  }()
512
530
  }, {
513
- key: "declineJoinRequest",
531
+ key: "acceptJoinRequest",
514
532
  value: function () {
515
- var _declineJoinRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(teamId, memberId) {
533
+ var _acceptJoinRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(teamId, memberId) {
516
534
  return _regeneratorRuntime.wrap(function _callee15$(_context15) {
517
535
  while (1) switch (_context15.prev = _context15.next) {
518
536
  case 0:
519
- return _context15.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/request/decline")));
537
+ return _context15.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/request/accept")));
520
538
  case 1:
521
539
  case "end":
522
540
  return _context15.stop();
523
541
  }
524
542
  }, _callee15, this);
525
543
  }));
526
- function declineJoinRequest(_x25, _x26) {
544
+ function acceptJoinRequest(_x25, _x26) {
545
+ return _acceptJoinRequest.apply(this, arguments);
546
+ }
547
+ return acceptJoinRequest;
548
+ }()
549
+ }, {
550
+ key: "declineJoinRequest",
551
+ value: function () {
552
+ var _declineJoinRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(teamId, memberId) {
553
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
554
+ while (1) switch (_context16.prev = _context16.next) {
555
+ case 0:
556
+ return _context16.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/request/decline")));
557
+ case 1:
558
+ case "end":
559
+ return _context16.stop();
560
+ }
561
+ }, _callee16, this);
562
+ }));
563
+ function declineJoinRequest(_x27, _x28) {
527
564
  return _declineJoinRequest.apply(this, arguments);
528
565
  }
529
566
  return declineJoinRequest;
@@ -535,18 +572,18 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
535
572
  }, {
536
573
  key: "deleteTeamMembership",
537
574
  value: (function () {
538
- var _deleteTeamMembership = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(teamId, memberId) {
539
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
540
- while (1) switch (_context16.prev = _context16.next) {
575
+ var _deleteTeamMembership = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(teamId, memberId) {
576
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
577
+ while (1) switch (_context17.prev = _context17.next) {
541
578
  case 0:
542
- return _context16.abrupt("return", this.deleteResource("".concat(v3UrlPath, "/").concat(this.trimTeamARI(teamId), "/members/").concat(memberId)));
579
+ return _context17.abrupt("return", this.deleteResource("".concat(v3UrlPath, "/").concat(this.trimTeamARI(teamId), "/members/").concat(memberId)));
543
580
  case 1:
544
581
  case "end":
545
- return _context16.stop();
582
+ return _context17.stop();
546
583
  }
547
- }, _callee16, this);
584
+ }, _callee17, this);
548
585
  }));
549
- function deleteTeamMembership(_x27, _x28) {
586
+ function deleteTeamMembership(_x29, _x30) {
550
587
  return _deleteTeamMembership.apply(this, arguments);
551
588
  }
552
589
  return deleteTeamMembership;
@@ -559,18 +596,18 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
559
596
  }, {
560
597
  key: "revokeTeamInvite",
561
598
  value: (function () {
562
- var _revokeTeamInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(teamId, memberId) {
563
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
564
- while (1) switch (_context17.prev = _context17.next) {
599
+ var _revokeTeamInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(teamId, memberId) {
600
+ return _regeneratorRuntime.wrap(function _callee18$(_context18) {
601
+ while (1) switch (_context18.prev = _context18.next) {
565
602
  case 0:
566
- return _context17.abrupt("return", this.deleteResource("".concat(v3UrlPath, "/ui/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/revoke")));
603
+ return _context18.abrupt("return", this.deleteResource("".concat(v3UrlPath, "/ui/").concat(this.trimTeamARI(teamId), "/membership/").concat(memberId, "/revoke")));
567
604
  case 1:
568
605
  case "end":
569
- return _context17.stop();
606
+ return _context18.stop();
570
607
  }
571
- }, _callee17, this);
608
+ }, _callee18, this);
572
609
  }));
573
- function revokeTeamInvite(_x29, _x30) {
610
+ function revokeTeamInvite(_x31, _x32) {
574
611
  return _revokeTeamInvite.apply(this, arguments);
575
612
  }
576
613
  return revokeTeamInvite;
@@ -578,18 +615,18 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
578
615
  }, {
579
616
  key: "deleteTeam",
580
617
  value: function () {
581
- var _deleteTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(teamId) {
582
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
583
- while (1) switch (_context18.prev = _context18.next) {
618
+ var _deleteTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(teamId) {
619
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
620
+ while (1) switch (_context19.prev = _context19.next) {
584
621
  case 0:
585
- return _context18.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId))));
622
+ return _context19.abrupt("return", this.deleteResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId))));
586
623
  case 1:
587
624
  case "end":
588
- return _context18.stop();
625
+ return _context19.stop();
589
626
  }
590
- }, _callee18, this);
627
+ }, _callee19, this);
591
628
  }));
592
- function deleteTeam(_x31) {
629
+ function deleteTeam(_x33) {
593
630
  return _deleteTeam.apply(this, arguments);
594
631
  }
595
632
  return deleteTeam;
@@ -601,23 +638,23 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
601
638
  }, {
602
639
  key: "isSingleFullMemberTeam",
603
640
  value: (function () {
604
- var _isSingleFullMemberTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(teamId) {
641
+ var _isSingleFullMemberTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(teamId) {
605
642
  var members;
606
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
607
- while (1) switch (_context19.prev = _context19.next) {
643
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
644
+ while (1) switch (_context20.prev = _context20.next) {
608
645
  case 0:
609
- _context19.next = 2;
646
+ _context20.next = 2;
610
647
  return this.getResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/members?size=2&membershipState=FULL_MEMBER&siteId=").concat(this.getCloudId()));
611
648
  case 2:
612
- members = _context19.sent;
613
- return _context19.abrupt("return", members.entities.length === 1);
649
+ members = _context20.sent;
650
+ return _context20.abrupt("return", members.entities.length === 1);
614
651
  case 4:
615
652
  case "end":
616
- return _context19.stop();
653
+ return _context20.stop();
617
654
  }
618
- }, _callee19, this);
655
+ }, _callee20, this);
619
656
  }));
620
- function isSingleFullMemberTeam(_x32) {
657
+ function isSingleFullMemberTeam(_x34) {
621
658
  return _isSingleFullMemberTeam.apply(this, arguments);
622
659
  }
623
660
  return isSingleFullMemberTeam;
@@ -625,20 +662,20 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
625
662
  }, {
626
663
  key: "createTeam",
627
664
  value: function () {
628
- var _createTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(displayName, originQuery, members) {
665
+ var _createTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(displayName, originQuery, members) {
629
666
  var membershipSettings,
630
667
  organizationId,
631
668
  err,
632
669
  url,
633
670
  legionTeam,
634
- _args20 = arguments;
635
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
636
- while (1) switch (_context20.prev = _context20.next) {
671
+ _args21 = arguments;
672
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
673
+ while (1) switch (_context21.prev = _context21.next) {
637
674
  case 0:
638
- membershipSettings = _args20.length > 3 && _args20[3] !== undefined ? _args20[3] : 'OPEN';
675
+ membershipSettings = _args21.length > 3 && _args21[3] !== undefined ? _args21[3] : 'OPEN';
639
676
  organizationId = this.getContext().orgId;
640
677
  if (organizationId) {
641
- _context20.next = 6;
678
+ _context21.next = 6;
642
679
  break;
643
680
  }
644
681
  err = new Error('Organization ID is required');
@@ -646,7 +683,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
646
683
  throw err;
647
684
  case 6:
648
685
  url = "".concat(v4UrlPath, "?").concat(this.constructProductOriginParams(originQuery));
649
- _context20.next = 9;
686
+ _context21.next = 9;
650
687
  return this.postResource(url, {
651
688
  displayName: displayName,
652
689
  description: '',
@@ -656,15 +693,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
656
693
  members: _toConsumableArray(new Set(members))
657
694
  });
658
695
  case 9:
659
- legionTeam = _context20.sent;
660
- return _context20.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionTeam));
696
+ legionTeam = _context21.sent;
697
+ return _context21.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionTeam));
661
698
  case 11:
662
699
  case "end":
663
- return _context20.stop();
700
+ return _context21.stop();
664
701
  }
665
- }, _callee20, this);
702
+ }, _callee21, this);
666
703
  }));
667
- function createTeam(_x33, _x34, _x35) {
704
+ function createTeam(_x35, _x36, _x37) {
668
705
  return _createTeam.apply(this, arguments);
669
706
  }
670
707
  return createTeam;
@@ -672,15 +709,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
672
709
  }, {
673
710
  key: "createExternalTeam",
674
711
  value: function () {
675
- var _createExternalTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(description, externalReference, teamName, siteId) {
712
+ var _createExternalTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(description, externalReference, teamName, siteId) {
676
713
  var organizationId, cloudId, err, url, legionExternalTeam;
677
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
678
- while (1) switch (_context21.prev = _context21.next) {
714
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
715
+ while (1) switch (_context22.prev = _context22.next) {
679
716
  case 0:
680
717
  organizationId = this.getContext().orgId;
681
718
  cloudId = this.getContext().cloudId;
682
719
  if (organizationId) {
683
- _context21.next = 6;
720
+ _context22.next = 6;
684
721
  break;
685
722
  }
686
723
  err = new Error('Organization ID is required');
@@ -688,7 +725,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
688
725
  throw err;
689
726
  case 6:
690
727
  url = "".concat(v4UrlPath, "/external?origin.cloudId=").concat(encodeURIComponent(this.getCloudId(siteId || cloudId)));
691
- _context21.next = 9;
728
+ _context22.next = 9;
692
729
  return this.postResource(url, {
693
730
  description: description,
694
731
  externalReference: externalReference,
@@ -697,15 +734,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
697
734
  displayName: teamName
698
735
  });
699
736
  case 9:
700
- legionExternalTeam = _context21.sent;
701
- return _context21.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionExternalTeam));
737
+ legionExternalTeam = _context22.sent;
738
+ return _context22.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionExternalTeam));
702
739
  case 11:
703
740
  case "end":
704
- return _context21.stop();
741
+ return _context22.stop();
705
742
  }
706
- }, _callee21, this);
743
+ }, _callee22, this);
707
744
  }));
708
- function createExternalTeam(_x36, _x37, _x38, _x39) {
745
+ function createExternalTeam(_x38, _x39, _x40, _x41) {
709
746
  return _createExternalTeam.apply(this, arguments);
710
747
  }
711
748
  return createExternalTeam;
@@ -713,23 +750,23 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
713
750
  }, {
714
751
  key: "getTeamAndGroupDiff",
715
752
  value: function () {
716
- var _getTeamAndGroupDiff = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(teamId, externalReference) {
753
+ var _getTeamAndGroupDiff = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(teamId, externalReference) {
717
754
  var siteId;
718
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
719
- while (1) switch (_context22.prev = _context22.next) {
755
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
756
+ while (1) switch (_context23.prev = _context23.next) {
720
757
  case 0:
721
758
  siteId = this.getCloudId();
722
- return _context22.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/external/diff"), {
759
+ return _context23.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/external/diff"), {
723
760
  siteId: siteId,
724
761
  externalReference: externalReference
725
762
  }));
726
763
  case 2:
727
764
  case "end":
728
- return _context22.stop();
765
+ return _context23.stop();
729
766
  }
730
- }, _callee22, this);
767
+ }, _callee23, this);
731
768
  }));
732
- function getTeamAndGroupDiff(_x40, _x41) {
769
+ function getTeamAndGroupDiff(_x42, _x43) {
733
770
  return _getTeamAndGroupDiff.apply(this, arguments);
734
771
  }
735
772
  return getTeamAndGroupDiff;
@@ -737,23 +774,23 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
737
774
  }, {
738
775
  key: "linkExistingTeamToGroup",
739
776
  value: function () {
740
- var _linkExistingTeamToGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(teamId, externalReference) {
777
+ var _linkExistingTeamToGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(teamId, externalReference) {
741
778
  var siteId;
742
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
743
- while (1) switch (_context23.prev = _context23.next) {
779
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
780
+ while (1) switch (_context24.prev = _context24.next) {
744
781
  case 0:
745
782
  siteId = this.getCloudId();
746
- return _context23.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/external/link"), {
783
+ return _context24.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/external/link"), {
747
784
  externalReference: externalReference,
748
785
  siteId: siteId
749
786
  }));
750
787
  case 2:
751
788
  case "end":
752
- return _context23.stop();
789
+ return _context24.stop();
753
790
  }
754
- }, _callee23, this);
791
+ }, _callee24, this);
755
792
  }));
756
- function linkExistingTeamToGroup(_x42, _x43) {
793
+ function linkExistingTeamToGroup(_x44, _x45) {
757
794
  return _linkExistingTeamToGroup.apply(this, arguments);
758
795
  }
759
796
  return linkExistingTeamToGroup;
@@ -761,11 +798,11 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
761
798
  }, {
762
799
  key: "getWriteMediaToken",
763
800
  value: function () {
764
- var _getWriteMediaToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
765
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
766
- while (1) switch (_context24.prev = _context24.next) {
801
+ var _getWriteMediaToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
802
+ return _regeneratorRuntime.wrap(function _callee25$(_context25) {
803
+ while (1) switch (_context25.prev = _context25.next) {
767
804
  case 0:
768
- return _context24.abrupt("return", this.getResource('/v4/teams/header-image/media-upload').then(function (response) {
805
+ return _context25.abrupt("return", this.getResource('/v4/teams/header-image/media-upload').then(function (response) {
769
806
  var _response$baseUrl;
770
807
  return _objectSpread(_objectSpread({}, response), {}, {
771
808
  baseUrl: (_response$baseUrl = response.baseUrl) !== null && _response$baseUrl !== void 0 && _response$baseUrl.endsWith('/') ? response.baseUrl.slice(0, -1) : response.baseUrl
@@ -773,9 +810,9 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
773
810
  }));
774
811
  case 1:
775
812
  case "end":
776
- return _context24.stop();
813
+ return _context25.stop();
777
814
  }
778
- }, _callee24, this);
815
+ }, _callee25, this);
779
816
  }));
780
817
  function getWriteMediaToken() {
781
818
  return _getWriteMediaToken.apply(this, arguments);
@@ -785,25 +822,25 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
785
822
  }, {
786
823
  key: "getSoftDeletedTeamById",
787
824
  value: function () {
788
- var _getSoftDeletedTeamById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(teamId) {
825
+ var _getSoftDeletedTeamById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(teamId) {
789
826
  var orgId, siteId;
790
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
791
- while (1) switch (_context25.prev = _context25.next) {
827
+ return _regeneratorRuntime.wrap(function _callee26$(_context26) {
828
+ while (1) switch (_context26.prev = _context26.next) {
792
829
  case 0:
793
830
  orgId = this.getOrgId();
794
831
  siteId = this.getCloudId();
795
- return _context25.abrupt("return", this.getResource("".concat(v4UrlPath, "/org/").concat(orgId, "/soft-deleted/").concat(this.trimTeamARI(teamId), "?siteId=").concat(siteId)).then(function (response) {
832
+ return _context26.abrupt("return", this.getResource("".concat(v4UrlPath, "/org/").concat(orgId, "/soft-deleted/").concat(this.trimTeamARI(teamId), "?siteId=").concat(siteId)).then(function (response) {
796
833
  return _objectSpread(_objectSpread({}, response.teamResponse), {}, {
797
834
  id: teamId
798
835
  });
799
836
  }));
800
837
  case 3:
801
838
  case "end":
802
- return _context25.stop();
839
+ return _context26.stop();
803
840
  }
804
- }, _callee25, this);
841
+ }, _callee26, this);
805
842
  }));
806
- function getSoftDeletedTeamById(_x44) {
843
+ function getSoftDeletedTeamById(_x46) {
807
844
  return _getSoftDeletedTeamById.apply(this, arguments);
808
845
  }
809
846
  return getSoftDeletedTeamById;
@@ -814,13 +851,13 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
814
851
  }, {
815
852
  key: "getUserInSiteUserBase",
816
853
  value: (function () {
817
- var _getUserInSiteUserBase = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(userId) {
854
+ var _getUserInSiteUserBase = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(userId) {
818
855
  var siteId;
819
- return _regeneratorRuntime.wrap(function _callee26$(_context26) {
820
- while (1) switch (_context26.prev = _context26.next) {
856
+ return _regeneratorRuntime.wrap(function _callee27$(_context27) {
857
+ while (1) switch (_context27.prev = _context27.next) {
821
858
  case 0:
822
859
  siteId = this.getCloudId();
823
- return _context26.abrupt("return", this.getResource("/teams/site/".concat(siteId, "/users/").concat(userId, "/exists"), {
860
+ return _context27.abrupt("return", this.getResource("/teams/site/".concat(siteId, "/users/").concat(userId, "/exists"), {
824
861
  headers: {
825
862
  Accept: 'application/json',
826
863
  'X-header-client-id': 'ptc-fe'
@@ -828,11 +865,11 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
828
865
  }));
829
866
  case 2:
830
867
  case "end":
831
- return _context26.stop();
868
+ return _context27.stop();
832
869
  }
833
- }, _callee26, this);
870
+ }, _callee27, this);
834
871
  }));
835
- function getUserInSiteUserBase(_x45) {
872
+ function getUserInSiteUserBase(_x47) {
836
873
  return _getUserInSiteUserBase.apply(this, arguments);
837
874
  }
838
875
  return getUserInSiteUserBase;
@@ -840,22 +877,22 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
840
877
  }, {
841
878
  key: "retrieveBrowseUserPermission",
842
879
  value: function () {
843
- var _retrieveBrowseUserPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(product) {
844
- return _regeneratorRuntime.wrap(function _callee27$(_context27) {
845
- while (1) switch (_context27.prev = _context27.next) {
880
+ var _retrieveBrowseUserPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(product) {
881
+ return _regeneratorRuntime.wrap(function _callee28$(_context28) {
882
+ while (1) switch (_context28.prev = _context28.next) {
846
883
  case 0:
847
- return _context27.abrupt("return", this.getResourceCached("/teams/site/".concat(this.getCloudId(), "/canSearchUsers?product=").concat(product), undefined,
884
+ return _context28.abrupt("return", this.getResourceCached("/teams/site/".concat(this.getCloudId(), "/canSearchUsers?product=").concat(product), undefined,
848
885
  // 2 minute expiration, resolves duplicate calls in initial load
849
886
  {
850
887
  expiration: 1000 * 60 * 2
851
888
  }));
852
889
  case 1:
853
890
  case "end":
854
- return _context27.stop();
891
+ return _context28.stop();
855
892
  }
856
- }, _callee27, this);
893
+ }, _callee28, this);
857
894
  }));
858
- function retrieveBrowseUserPermission(_x46) {
895
+ function retrieveBrowseUserPermission(_x48) {
859
896
  return _retrieveBrowseUserPermission.apply(this, arguments);
860
897
  }
861
898
  return retrieveBrowseUserPermission;
@@ -863,27 +900,27 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
863
900
  }, {
864
901
  key: "getPermissions",
865
902
  value: function () {
866
- var _getPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
903
+ var _getPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
867
904
  var orgId, siteId, err;
868
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
869
- while (1) switch (_context28.prev = _context28.next) {
905
+ return _regeneratorRuntime.wrap(function _callee29$(_context29) {
906
+ while (1) switch (_context29.prev = _context29.next) {
870
907
  case 0:
871
908
  orgId = this.getContext().orgId;
872
909
  siteId = this.getCloudId();
873
910
  if (orgId) {
874
- _context28.next = 6;
911
+ _context29.next = 6;
875
912
  break;
876
913
  }
877
914
  err = new Error('Organization ID is required');
878
915
  this.logException(err, 'getPermissions');
879
916
  throw err;
880
917
  case 6:
881
- return _context28.abrupt("return", this.getResourceCached("".concat(v4UrlPath, "/permission/self/organization/").concat(orgId, "?siteId=").concat(siteId)));
918
+ return _context29.abrupt("return", this.getResourceCached("".concat(v4UrlPath, "/permission/self/organization/").concat(orgId, "?siteId=").concat(siteId)));
882
919
  case 7:
883
920
  case "end":
884
- return _context28.stop();
921
+ return _context29.stop();
885
922
  }
886
- }, _callee28, this);
923
+ }, _callee29, this);
887
924
  }));
888
925
  function getPermissions() {
889
926
  return _getPermissions.apply(this, arguments);
@@ -893,36 +930,36 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
893
930
  }, {
894
931
  key: "getLinkedTeamsBulk",
895
932
  value: function () {
896
- var _getLinkedTeamsBulk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(groupIds) {
933
+ var _getLinkedTeamsBulk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(groupIds) {
897
934
  var organizationId, err, legionExternalTeam;
898
- return _regeneratorRuntime.wrap(function _callee29$(_context29) {
899
- while (1) switch (_context29.prev = _context29.next) {
935
+ return _regeneratorRuntime.wrap(function _callee30$(_context30) {
936
+ while (1) switch (_context30.prev = _context30.next) {
900
937
  case 0:
901
938
  organizationId = this.getContext().orgId;
902
939
  if (organizationId) {
903
- _context29.next = 5;
940
+ _context30.next = 5;
904
941
  break;
905
942
  }
906
943
  err = new Error('Organization ID is required');
907
944
  this.logException(err, 'getLinkedTeamsBulk');
908
945
  throw err;
909
946
  case 5:
910
- _context29.next = 7;
947
+ _context30.next = 7;
911
948
  return this.postResource("".concat(v4UrlPath, "/external/bulk"), {
912
949
  organizationId: organizationId,
913
950
  source: 'ATLASSIAN_GROUP',
914
951
  externalIds: groupIds
915
952
  });
916
953
  case 7:
917
- legionExternalTeam = _context29.sent;
918
- return _context29.abrupt("return", legionExternalTeam);
954
+ legionExternalTeam = _context30.sent;
955
+ return _context30.abrupt("return", legionExternalTeam);
919
956
  case 9:
920
957
  case "end":
921
- return _context29.stop();
958
+ return _context30.stop();
922
959
  }
923
- }, _callee29, this);
960
+ }, _callee30, this);
924
961
  }));
925
- function getLinkedTeamsBulk(_x47) {
962
+ function getLinkedTeamsBulk(_x49) {
926
963
  return _getLinkedTeamsBulk.apply(this, arguments);
927
964
  }
928
965
  return getLinkedTeamsBulk;
@@ -930,32 +967,32 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
930
967
  }, {
931
968
  key: "getTeamProfileDetails",
932
969
  value: function () {
933
- var _getTeamProfileDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(teamId) {
970
+ var _getTeamProfileDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(teamId) {
934
971
  var siteId, err, linkedTeamsProfileDetails;
935
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
936
- while (1) switch (_context30.prev = _context30.next) {
972
+ return _regeneratorRuntime.wrap(function _callee31$(_context31) {
973
+ while (1) switch (_context31.prev = _context31.next) {
937
974
  case 0:
938
975
  siteId = this.getCloudId();
939
976
  if (siteId) {
940
- _context30.next = 5;
977
+ _context31.next = 5;
941
978
  break;
942
979
  }
943
980
  err = new Error('Site ID is required');
944
981
  this.logException(err, 'getTeamProfileDetails');
945
982
  throw err;
946
983
  case 5:
947
- _context30.next = 7;
984
+ _context31.next = 7;
948
985
  return this.getResource("".concat(v4UrlPath, "/").concat(teamId, "/profile?siteId=").concat(this.getCloudId()));
949
986
  case 7:
950
- linkedTeamsProfileDetails = _context30.sent;
951
- return _context30.abrupt("return", linkedTeamsProfileDetails);
987
+ linkedTeamsProfileDetails = _context31.sent;
988
+ return _context31.abrupt("return", linkedTeamsProfileDetails);
952
989
  case 9:
953
990
  case "end":
954
- return _context30.stop();
991
+ return _context31.stop();
955
992
  }
956
- }, _callee30, this);
993
+ }, _callee31, this);
957
994
  }));
958
- function getTeamProfileDetails(_x48) {
995
+ function getTeamProfileDetails(_x50) {
959
996
  return _getTeamProfileDetails.apply(this, arguments);
960
997
  }
961
998
  return getTeamProfileDetails;
@@ -963,30 +1000,30 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
963
1000
  }, {
964
1001
  key: "getOrgScope",
965
1002
  value: function () {
966
- var _getOrgScope = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
1003
+ var _getOrgScope = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
967
1004
  var orgId, err, orgScope;
968
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
969
- while (1) switch (_context31.prev = _context31.next) {
1005
+ return _regeneratorRuntime.wrap(function _callee32$(_context32) {
1006
+ while (1) switch (_context32.prev = _context32.next) {
970
1007
  case 0:
971
1008
  orgId = this.getContext().orgId;
972
1009
  if (orgId) {
973
- _context31.next = 5;
1010
+ _context32.next = 5;
974
1011
  break;
975
1012
  }
976
1013
  err = new Error('Organization ID is required');
977
1014
  this.logException(err, 'getOrgScope');
978
1015
  throw err;
979
1016
  case 5:
980
- _context31.next = 7;
1017
+ _context32.next = 7;
981
1018
  return this.getResourceCached("".concat(v4UrlPath, "/org/").concat(orgId, "/scope"));
982
1019
  case 7:
983
- orgScope = _context31.sent;
984
- return _context31.abrupt("return", orgScope);
1020
+ orgScope = _context32.sent;
1021
+ return _context32.abrupt("return", orgScope);
985
1022
  case 9:
986
1023
  case "end":
987
- return _context31.stop();
1024
+ return _context32.stop();
988
1025
  }
989
- }, _callee31, this);
1026
+ }, _callee32, this);
990
1027
  }));
991
1028
  function getOrgScope() {
992
1029
  return _getOrgScope.apply(this, arguments);
@@ -996,26 +1033,26 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
996
1033
  }, {
997
1034
  key: "restoreTeamToSyncedGroup",
998
1035
  value: function () {
999
- var _restoreTeamToSyncedGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(teamId, externalReference) {
1036
+ var _restoreTeamToSyncedGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(teamId, externalReference) {
1000
1037
  var siteId;
1001
- return _regeneratorRuntime.wrap(function _callee32$(_context32) {
1002
- while (1) switch (_context32.prev = _context32.next) {
1038
+ return _regeneratorRuntime.wrap(function _callee33$(_context33) {
1039
+ while (1) switch (_context33.prev = _context33.next) {
1003
1040
  case 0:
1004
1041
  siteId = this.getCloudId();
1005
- _context32.next = 3;
1042
+ _context33.next = 3;
1006
1043
  return this.postResource("".concat(v4UrlPath, "/").concat(teamId, "/external/restore"), {
1007
1044
  externalReference: externalReference,
1008
1045
  siteId: siteId
1009
1046
  });
1010
1047
  case 3:
1011
- return _context32.abrupt("return", _context32.sent);
1048
+ return _context33.abrupt("return", _context33.sent);
1012
1049
  case 4:
1013
1050
  case "end":
1014
- return _context32.stop();
1051
+ return _context33.stop();
1015
1052
  }
1016
- }, _callee32, this);
1053
+ }, _callee33, this);
1017
1054
  }));
1018
- function restoreTeamToSyncedGroup(_x49, _x50) {
1055
+ function restoreTeamToSyncedGroup(_x51, _x52) {
1019
1056
  return _restoreTeamToSyncedGroup.apply(this, arguments);
1020
1057
  }
1021
1058
  return restoreTeamToSyncedGroup;
@@ -1023,18 +1060,18 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1023
1060
  }, {
1024
1061
  key: "createTeamContainers",
1025
1062
  value: function () {
1026
- var _createTeamContainers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(payload) {
1027
- return _regeneratorRuntime.wrap(function _callee33$(_context33) {
1028
- while (1) switch (_context33.prev = _context33.next) {
1063
+ var _createTeamContainers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(payload) {
1064
+ return _regeneratorRuntime.wrap(function _callee34$(_context34) {
1065
+ while (1) switch (_context34.prev = _context34.next) {
1029
1066
  case 0:
1030
- return _context33.abrupt("return", this.postResource("".concat(v4UrlPath, "/containers"), _objectSpread({}, payload)));
1067
+ return _context34.abrupt("return", this.postResource("".concat(v4UrlPath, "/containers"), _objectSpread({}, payload)));
1031
1068
  case 1:
1032
1069
  case "end":
1033
- return _context33.stop();
1070
+ return _context34.stop();
1034
1071
  }
1035
- }, _callee33, this);
1072
+ }, _callee34, this);
1036
1073
  }));
1037
- function createTeamContainers(_x51) {
1074
+ function createTeamContainers(_x53) {
1038
1075
  return _createTeamContainers.apply(this, arguments);
1039
1076
  }
1040
1077
  return createTeamContainers;