@atlaskit/teams-client 4.19.0 → 4.20.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 (31) hide show
  1. package/CHANGELOG.md +7 -3
  2. package/dist/cjs/common/utils/permissions/constants.js +11 -4
  3. package/dist/cjs/common/utils/permissions/types.js +1 -1
  4. package/dist/cjs/common/utils/ufo/constants.js +1 -1
  5. package/dist/cjs/common/utils/ufo/index.js +2 -2
  6. package/dist/cjs/services/legion-client/index.js +201 -180
  7. package/dist/cjs/services/main.js +559 -533
  8. package/dist/cjs/services/sentry/utils/get-sentry-config.js +1 -1
  9. package/dist/es2019/common/utils/permissions/constants.js +9 -4
  10. package/dist/es2019/common/utils/permissions/types.js +1 -1
  11. package/dist/es2019/common/utils/ufo/constants.js +1 -1
  12. package/dist/es2019/common/utils/ufo/index.js +2 -2
  13. package/dist/es2019/services/legion-client/index.js +4 -0
  14. package/dist/es2019/services/main.js +7 -0
  15. package/dist/es2019/services/sentry/utils/get-sentry-config.js +1 -1
  16. package/dist/esm/common/utils/permissions/constants.js +11 -4
  17. package/dist/esm/common/utils/permissions/types.js +1 -1
  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/legion-client/index.js +201 -180
  21. package/dist/esm/services/main.js +559 -533
  22. package/dist/esm/services/sentry/utils/get-sentry-config.js +1 -1
  23. package/dist/types/common/utils/permissions/types.d.ts +1 -1
  24. package/dist/types/common/utils/ufo/constants.d.ts +2 -2
  25. package/dist/types/services/legion-client/index.d.ts +1 -0
  26. package/dist/types/services/main.d.ts +4 -0
  27. package/dist/types-ts4.5/common/utils/permissions/types.d.ts +2 -1
  28. package/dist/types-ts4.5/common/utils/ufo/constants.d.ts +2 -1
  29. package/dist/types-ts4.5/services/legion-client/index.d.ts +1 -0
  30. package/dist/types-ts4.5/services/main.d.ts +4 -0
  31. package/package.json +4 -1
@@ -658,6 +658,27 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
658
658
  }
659
659
  return deleteTeam;
660
660
  }()
661
+ }, {
662
+ key: "archiveTeam",
663
+ value: function () {
664
+ var _archiveTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(teamId) {
665
+ var siteId;
666
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
667
+ while (1) switch (_context21.prev = _context21.next) {
668
+ case 0:
669
+ siteId = this.getCloudId();
670
+ return _context21.abrupt("return", this.postResourceRaw("".concat(v4UrlPath, "/archive?siteId=").concat(siteId), JSON.stringify([this.trimTeamARI(teamId)])));
671
+ case 2:
672
+ case "end":
673
+ return _context21.stop();
674
+ }
675
+ }, _callee21, this);
676
+ }));
677
+ function archiveTeam(_x36) {
678
+ return _archiveTeam.apply(this, arguments);
679
+ }
680
+ return archiveTeam;
681
+ }()
661
682
  /**
662
683
  * @private
663
684
  * @deprecated should be other means to solve this issue
@@ -665,23 +686,23 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
665
686
  }, {
666
687
  key: "isSingleFullMemberTeam",
667
688
  value: (function () {
668
- var _isSingleFullMemberTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(teamId) {
689
+ var _isSingleFullMemberTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(teamId) {
669
690
  var members;
670
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
671
- while (1) switch (_context21.prev = _context21.next) {
691
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
692
+ while (1) switch (_context22.prev = _context22.next) {
672
693
  case 0:
673
- _context21.next = 2;
694
+ _context22.next = 2;
674
695
  return this.getResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/members?size=2&membershipState=FULL_MEMBER&siteId=").concat(this.getCloudId()));
675
696
  case 2:
676
- members = _context21.sent;
677
- return _context21.abrupt("return", members.entities.length === 1);
697
+ members = _context22.sent;
698
+ return _context22.abrupt("return", members.entities.length === 1);
678
699
  case 4:
679
700
  case "end":
680
- return _context21.stop();
701
+ return _context22.stop();
681
702
  }
682
- }, _callee21, this);
703
+ }, _callee22, this);
683
704
  }));
684
- function isSingleFullMemberTeam(_x36) {
705
+ function isSingleFullMemberTeam(_x37) {
685
706
  return _isSingleFullMemberTeam.apply(this, arguments);
686
707
  }
687
708
  return isSingleFullMemberTeam;
@@ -689,20 +710,20 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
689
710
  }, {
690
711
  key: "createTeam",
691
712
  value: function () {
692
- var _createTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(displayName, originQuery, members) {
713
+ var _createTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(displayName, originQuery, members) {
693
714
  var membershipSettings,
694
715
  organizationId,
695
716
  err,
696
717
  url,
697
718
  legionTeam,
698
- _args22 = arguments;
699
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
700
- while (1) switch (_context22.prev = _context22.next) {
719
+ _args23 = arguments;
720
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
721
+ while (1) switch (_context23.prev = _context23.next) {
701
722
  case 0:
702
- membershipSettings = _args22.length > 3 && _args22[3] !== undefined ? _args22[3] : 'OPEN';
723
+ membershipSettings = _args23.length > 3 && _args23[3] !== undefined ? _args23[3] : 'OPEN';
703
724
  organizationId = this.getContext().orgId;
704
725
  if (organizationId) {
705
- _context22.next = 6;
726
+ _context23.next = 6;
706
727
  break;
707
728
  }
708
729
  err = new Error('Organization ID is required');
@@ -710,7 +731,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
710
731
  throw err;
711
732
  case 6:
712
733
  url = "".concat(v4UrlPath, "?").concat(this.constructProductOriginParams(originQuery));
713
- _context22.next = 9;
734
+ _context23.next = 9;
714
735
  return this.postResource(url, {
715
736
  displayName: displayName,
716
737
  description: '',
@@ -720,15 +741,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
720
741
  members: _toConsumableArray(new Set(members))
721
742
  });
722
743
  case 9:
723
- legionTeam = _context22.sent;
724
- return _context22.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionTeam));
744
+ legionTeam = _context23.sent;
745
+ return _context23.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionTeam));
725
746
  case 11:
726
747
  case "end":
727
- return _context22.stop();
748
+ return _context23.stop();
728
749
  }
729
- }, _callee22, this);
750
+ }, _callee23, this);
730
751
  }));
731
- function createTeam(_x37, _x38, _x39) {
752
+ function createTeam(_x38, _x39, _x40) {
732
753
  return _createTeam.apply(this, arguments);
733
754
  }
734
755
  return createTeam;
@@ -736,15 +757,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
736
757
  }, {
737
758
  key: "createExternalTeam",
738
759
  value: function () {
739
- var _createExternalTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(description, externalReference, teamName, siteId) {
760
+ var _createExternalTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(description, externalReference, teamName, siteId) {
740
761
  var organizationId, cloudId, err, url, legionExternalTeam;
741
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
742
- while (1) switch (_context23.prev = _context23.next) {
762
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
763
+ while (1) switch (_context24.prev = _context24.next) {
743
764
  case 0:
744
765
  organizationId = this.getContext().orgId;
745
766
  cloudId = this.getContext().cloudId;
746
767
  if (organizationId) {
747
- _context23.next = 6;
768
+ _context24.next = 6;
748
769
  break;
749
770
  }
750
771
  err = new Error('Organization ID is required');
@@ -752,7 +773,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
752
773
  throw err;
753
774
  case 6:
754
775
  url = "".concat(v4UrlPath, "/external?origin.cloudId=").concat(encodeURIComponent(this.getCloudId(siteId || cloudId)));
755
- _context23.next = 9;
776
+ _context24.next = 9;
756
777
  return this.postResource(url, {
757
778
  description: description,
758
779
  externalReference: externalReference,
@@ -761,15 +782,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
761
782
  displayName: teamName
762
783
  });
763
784
  case 9:
764
- legionExternalTeam = _context23.sent;
765
- return _context23.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionExternalTeam));
785
+ legionExternalTeam = _context24.sent;
786
+ return _context24.abrupt("return", this.mapTeamCreateResponseV4ToTeam(legionExternalTeam));
766
787
  case 11:
767
788
  case "end":
768
- return _context23.stop();
789
+ return _context24.stop();
769
790
  }
770
- }, _callee23, this);
791
+ }, _callee24, this);
771
792
  }));
772
- function createExternalTeam(_x40, _x41, _x42, _x43) {
793
+ function createExternalTeam(_x41, _x42, _x43, _x44) {
773
794
  return _createExternalTeam.apply(this, arguments);
774
795
  }
775
796
  return createExternalTeam;
@@ -777,23 +798,23 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
777
798
  }, {
778
799
  key: "getTeamAndGroupDiff",
779
800
  value: function () {
780
- var _getTeamAndGroupDiff = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(teamId, externalReference) {
801
+ var _getTeamAndGroupDiff = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(teamId, externalReference) {
781
802
  var siteId;
782
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
783
- while (1) switch (_context24.prev = _context24.next) {
803
+ return _regeneratorRuntime.wrap(function _callee25$(_context25) {
804
+ while (1) switch (_context25.prev = _context25.next) {
784
805
  case 0:
785
806
  siteId = this.getCloudId();
786
- return _context24.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/external/diff"), {
807
+ return _context25.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/external/diff"), {
787
808
  siteId: siteId,
788
809
  externalReference: externalReference
789
810
  }));
790
811
  case 2:
791
812
  case "end":
792
- return _context24.stop();
813
+ return _context25.stop();
793
814
  }
794
- }, _callee24, this);
815
+ }, _callee25, this);
795
816
  }));
796
- function getTeamAndGroupDiff(_x44, _x45) {
817
+ function getTeamAndGroupDiff(_x45, _x46) {
797
818
  return _getTeamAndGroupDiff.apply(this, arguments);
798
819
  }
799
820
  return getTeamAndGroupDiff;
@@ -801,23 +822,23 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
801
822
  }, {
802
823
  key: "linkExistingTeamToGroup",
803
824
  value: function () {
804
- var _linkExistingTeamToGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(teamId, externalReference) {
825
+ var _linkExistingTeamToGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(teamId, externalReference) {
805
826
  var siteId;
806
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
807
- while (1) switch (_context25.prev = _context25.next) {
827
+ return _regeneratorRuntime.wrap(function _callee26$(_context26) {
828
+ while (1) switch (_context26.prev = _context26.next) {
808
829
  case 0:
809
830
  siteId = this.getCloudId();
810
- return _context25.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/external/link"), {
831
+ return _context26.abrupt("return", this.postResource("".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/external/link"), {
811
832
  externalReference: externalReference,
812
833
  siteId: siteId
813
834
  }));
814
835
  case 2:
815
836
  case "end":
816
- return _context25.stop();
837
+ return _context26.stop();
817
838
  }
818
- }, _callee25, this);
839
+ }, _callee26, this);
819
840
  }));
820
- function linkExistingTeamToGroup(_x46, _x47) {
841
+ function linkExistingTeamToGroup(_x47, _x48) {
821
842
  return _linkExistingTeamToGroup.apply(this, arguments);
822
843
  }
823
844
  return linkExistingTeamToGroup;
@@ -825,11 +846,11 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
825
846
  }, {
826
847
  key: "getWriteMediaToken",
827
848
  value: function () {
828
- var _getWriteMediaToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
829
- return _regeneratorRuntime.wrap(function _callee26$(_context26) {
830
- while (1) switch (_context26.prev = _context26.next) {
849
+ var _getWriteMediaToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
850
+ return _regeneratorRuntime.wrap(function _callee27$(_context27) {
851
+ while (1) switch (_context27.prev = _context27.next) {
831
852
  case 0:
832
- return _context26.abrupt("return", this.getResource('/v4/teams/header-image/media-upload').then(function (response) {
853
+ return _context27.abrupt("return", this.getResource('/v4/teams/header-image/media-upload').then(function (response) {
833
854
  var _response$baseUrl;
834
855
  return _objectSpread(_objectSpread({}, response), {}, {
835
856
  baseUrl: (_response$baseUrl = response.baseUrl) !== null && _response$baseUrl !== void 0 && _response$baseUrl.endsWith('/') ? response.baseUrl.slice(0, -1) : response.baseUrl
@@ -837,9 +858,9 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
837
858
  }));
838
859
  case 1:
839
860
  case "end":
840
- return _context26.stop();
861
+ return _context27.stop();
841
862
  }
842
- }, _callee26, this);
863
+ }, _callee27, this);
843
864
  }));
844
865
  function getWriteMediaToken() {
845
866
  return _getWriteMediaToken.apply(this, arguments);
@@ -849,25 +870,25 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
849
870
  }, {
850
871
  key: "getSoftDeletedTeamById",
851
872
  value: function () {
852
- var _getSoftDeletedTeamById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(teamId) {
873
+ var _getSoftDeletedTeamById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(teamId) {
853
874
  var orgId, siteId;
854
- return _regeneratorRuntime.wrap(function _callee27$(_context27) {
855
- while (1) switch (_context27.prev = _context27.next) {
875
+ return _regeneratorRuntime.wrap(function _callee28$(_context28) {
876
+ while (1) switch (_context28.prev = _context28.next) {
856
877
  case 0:
857
878
  orgId = this.getOrgId();
858
879
  siteId = this.getCloudId();
859
- return _context27.abrupt("return", this.getResource("".concat(v4UrlPath, "/org/").concat(orgId, "/soft-deleted/").concat(this.trimTeamARI(teamId), "?siteId=").concat(siteId)).then(function (response) {
880
+ return _context28.abrupt("return", this.getResource("".concat(v4UrlPath, "/org/").concat(orgId, "/soft-deleted/").concat(this.trimTeamARI(teamId), "?siteId=").concat(siteId)).then(function (response) {
860
881
  return _objectSpread(_objectSpread({}, response.teamResponse), {}, {
861
882
  id: teamId
862
883
  });
863
884
  }));
864
885
  case 3:
865
886
  case "end":
866
- return _context27.stop();
887
+ return _context28.stop();
867
888
  }
868
- }, _callee27, this);
889
+ }, _callee28, this);
869
890
  }));
870
- function getSoftDeletedTeamById(_x48) {
891
+ function getSoftDeletedTeamById(_x49) {
871
892
  return _getSoftDeletedTeamById.apply(this, arguments);
872
893
  }
873
894
  return getSoftDeletedTeamById;
@@ -878,13 +899,13 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
878
899
  }, {
879
900
  key: "getUserInSiteUserBase",
880
901
  value: (function () {
881
- var _getUserInSiteUserBase = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(userId) {
902
+ var _getUserInSiteUserBase = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(userId) {
882
903
  var siteId;
883
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
884
- while (1) switch (_context28.prev = _context28.next) {
904
+ return _regeneratorRuntime.wrap(function _callee29$(_context29) {
905
+ while (1) switch (_context29.prev = _context29.next) {
885
906
  case 0:
886
907
  siteId = this.getCloudId();
887
- return _context28.abrupt("return", this.getResource("/teams/site/".concat(siteId, "/users/").concat(userId, "/exists"), {
908
+ return _context29.abrupt("return", this.getResource("/teams/site/".concat(siteId, "/users/").concat(userId, "/exists"), {
888
909
  headers: {
889
910
  Accept: 'application/json',
890
911
  'X-header-client-id': 'ptc-fe'
@@ -892,11 +913,11 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
892
913
  }));
893
914
  case 2:
894
915
  case "end":
895
- return _context28.stop();
916
+ return _context29.stop();
896
917
  }
897
- }, _callee28, this);
918
+ }, _callee29, this);
898
919
  }));
899
- function getUserInSiteUserBase(_x49) {
920
+ function getUserInSiteUserBase(_x50) {
900
921
  return _getUserInSiteUserBase.apply(this, arguments);
901
922
  }
902
923
  return getUserInSiteUserBase;
@@ -904,22 +925,22 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
904
925
  }, {
905
926
  key: "retrieveBrowseUserPermission",
906
927
  value: function () {
907
- var _retrieveBrowseUserPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(product) {
908
- return _regeneratorRuntime.wrap(function _callee29$(_context29) {
909
- while (1) switch (_context29.prev = _context29.next) {
928
+ var _retrieveBrowseUserPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(product) {
929
+ return _regeneratorRuntime.wrap(function _callee30$(_context30) {
930
+ while (1) switch (_context30.prev = _context30.next) {
910
931
  case 0:
911
- return _context29.abrupt("return", this.getResourceCached("/teams/site/".concat(this.getCloudId(), "/canSearchUsers?product=").concat(product), undefined,
932
+ return _context30.abrupt("return", this.getResourceCached("/teams/site/".concat(this.getCloudId(), "/canSearchUsers?product=").concat(product), undefined,
912
933
  // 2 minute expiration, resolves duplicate calls in initial load
913
934
  {
914
935
  expiration: 1000 * 60 * 2
915
936
  }));
916
937
  case 1:
917
938
  case "end":
918
- return _context29.stop();
939
+ return _context30.stop();
919
940
  }
920
- }, _callee29, this);
941
+ }, _callee30, this);
921
942
  }));
922
- function retrieveBrowseUserPermission(_x50) {
943
+ function retrieveBrowseUserPermission(_x51) {
923
944
  return _retrieveBrowseUserPermission.apply(this, arguments);
924
945
  }
925
946
  return retrieveBrowseUserPermission;
@@ -927,27 +948,27 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
927
948
  }, {
928
949
  key: "getPermissions",
929
950
  value: function () {
930
- var _getPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
951
+ var _getPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
931
952
  var orgId, siteId, err;
932
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
933
- while (1) switch (_context30.prev = _context30.next) {
953
+ return _regeneratorRuntime.wrap(function _callee31$(_context31) {
954
+ while (1) switch (_context31.prev = _context31.next) {
934
955
  case 0:
935
956
  orgId = this.getContext().orgId;
936
957
  siteId = this.getCloudId();
937
958
  if (orgId) {
938
- _context30.next = 6;
959
+ _context31.next = 6;
939
960
  break;
940
961
  }
941
962
  err = new Error('Organization ID is required');
942
963
  this.logException(err, 'getPermissions');
943
964
  throw err;
944
965
  case 6:
945
- return _context30.abrupt("return", this.getResourceCached("".concat(v4UrlPath, "/permission/self/organization/").concat(orgId, "?siteId=").concat(siteId)));
966
+ return _context31.abrupt("return", this.getResourceCached("".concat(v4UrlPath, "/permission/self/organization/").concat(orgId, "?siteId=").concat(siteId)));
946
967
  case 7:
947
968
  case "end":
948
- return _context30.stop();
969
+ return _context31.stop();
949
970
  }
950
- }, _callee30, this);
971
+ }, _callee31, this);
951
972
  }));
952
973
  function getPermissions() {
953
974
  return _getPermissions.apply(this, arguments);
@@ -957,36 +978,36 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
957
978
  }, {
958
979
  key: "getLinkedTeamsBulk",
959
980
  value: function () {
960
- var _getLinkedTeamsBulk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(groupIds) {
981
+ var _getLinkedTeamsBulk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(groupIds) {
961
982
  var organizationId, err, legionExternalTeam;
962
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
963
- while (1) switch (_context31.prev = _context31.next) {
983
+ return _regeneratorRuntime.wrap(function _callee32$(_context32) {
984
+ while (1) switch (_context32.prev = _context32.next) {
964
985
  case 0:
965
986
  organizationId = this.getContext().orgId;
966
987
  if (organizationId) {
967
- _context31.next = 5;
988
+ _context32.next = 5;
968
989
  break;
969
990
  }
970
991
  err = new Error('Organization ID is required');
971
992
  this.logException(err, 'getLinkedTeamsBulk');
972
993
  throw err;
973
994
  case 5:
974
- _context31.next = 7;
995
+ _context32.next = 7;
975
996
  return this.postResource("".concat(v4UrlPath, "/external/bulk"), {
976
997
  organizationId: organizationId,
977
998
  source: 'ATLASSIAN_GROUP',
978
999
  externalIds: groupIds
979
1000
  });
980
1001
  case 7:
981
- legionExternalTeam = _context31.sent;
982
- return _context31.abrupt("return", legionExternalTeam);
1002
+ legionExternalTeam = _context32.sent;
1003
+ return _context32.abrupt("return", legionExternalTeam);
983
1004
  case 9:
984
1005
  case "end":
985
- return _context31.stop();
1006
+ return _context32.stop();
986
1007
  }
987
- }, _callee31, this);
1008
+ }, _callee32, this);
988
1009
  }));
989
- function getLinkedTeamsBulk(_x51) {
1010
+ function getLinkedTeamsBulk(_x52) {
990
1011
  return _getLinkedTeamsBulk.apply(this, arguments);
991
1012
  }
992
1013
  return getLinkedTeamsBulk;
@@ -994,32 +1015,32 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
994
1015
  }, {
995
1016
  key: "getTeamProfileDetails",
996
1017
  value: function () {
997
- var _getTeamProfileDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(teamId) {
1018
+ var _getTeamProfileDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(teamId) {
998
1019
  var siteId, err, linkedTeamsProfileDetails;
999
- return _regeneratorRuntime.wrap(function _callee32$(_context32) {
1000
- while (1) switch (_context32.prev = _context32.next) {
1020
+ return _regeneratorRuntime.wrap(function _callee33$(_context33) {
1021
+ while (1) switch (_context33.prev = _context33.next) {
1001
1022
  case 0:
1002
1023
  siteId = this.getCloudId();
1003
1024
  if (siteId) {
1004
- _context32.next = 5;
1025
+ _context33.next = 5;
1005
1026
  break;
1006
1027
  }
1007
1028
  err = new Error('Site ID is required');
1008
1029
  this.logException(err, 'getTeamProfileDetails');
1009
1030
  throw err;
1010
1031
  case 5:
1011
- _context32.next = 7;
1032
+ _context33.next = 7;
1012
1033
  return this.getResource("".concat(v4UrlPath, "/").concat(teamId, "/profile?siteId=").concat(this.getCloudId()));
1013
1034
  case 7:
1014
- linkedTeamsProfileDetails = _context32.sent;
1015
- return _context32.abrupt("return", linkedTeamsProfileDetails);
1035
+ linkedTeamsProfileDetails = _context33.sent;
1036
+ return _context33.abrupt("return", linkedTeamsProfileDetails);
1016
1037
  case 9:
1017
1038
  case "end":
1018
- return _context32.stop();
1039
+ return _context33.stop();
1019
1040
  }
1020
- }, _callee32, this);
1041
+ }, _callee33, this);
1021
1042
  }));
1022
- function getTeamProfileDetails(_x52) {
1043
+ function getTeamProfileDetails(_x53) {
1023
1044
  return _getTeamProfileDetails.apply(this, arguments);
1024
1045
  }
1025
1046
  return getTeamProfileDetails;
@@ -1027,30 +1048,30 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1027
1048
  }, {
1028
1049
  key: "getOrgScope",
1029
1050
  value: function () {
1030
- var _getOrgScope = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
1051
+ var _getOrgScope = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
1031
1052
  var orgId, err, orgScope;
1032
- return _regeneratorRuntime.wrap(function _callee33$(_context33) {
1033
- while (1) switch (_context33.prev = _context33.next) {
1053
+ return _regeneratorRuntime.wrap(function _callee34$(_context34) {
1054
+ while (1) switch (_context34.prev = _context34.next) {
1034
1055
  case 0:
1035
1056
  orgId = this.getContext().orgId;
1036
1057
  if (orgId) {
1037
- _context33.next = 5;
1058
+ _context34.next = 5;
1038
1059
  break;
1039
1060
  }
1040
1061
  err = new Error('Organization ID is required');
1041
1062
  this.logException(err, 'getOrgScope');
1042
1063
  throw err;
1043
1064
  case 5:
1044
- _context33.next = 7;
1065
+ _context34.next = 7;
1045
1066
  return this.getResourceCached("".concat(v4UrlPath, "/org/").concat(orgId, "/scope"));
1046
1067
  case 7:
1047
- orgScope = _context33.sent;
1048
- return _context33.abrupt("return", orgScope);
1068
+ orgScope = _context34.sent;
1069
+ return _context34.abrupt("return", orgScope);
1049
1070
  case 9:
1050
1071
  case "end":
1051
- return _context33.stop();
1072
+ return _context34.stop();
1052
1073
  }
1053
- }, _callee33, this);
1074
+ }, _callee34, this);
1054
1075
  }));
1055
1076
  function getOrgScope() {
1056
1077
  return _getOrgScope.apply(this, arguments);
@@ -1060,26 +1081,26 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1060
1081
  }, {
1061
1082
  key: "restoreTeamToSyncedGroup",
1062
1083
  value: function () {
1063
- var _restoreTeamToSyncedGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(teamId, externalReference) {
1084
+ var _restoreTeamToSyncedGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(teamId, externalReference) {
1064
1085
  var siteId;
1065
- return _regeneratorRuntime.wrap(function _callee34$(_context34) {
1066
- while (1) switch (_context34.prev = _context34.next) {
1086
+ return _regeneratorRuntime.wrap(function _callee35$(_context35) {
1087
+ while (1) switch (_context35.prev = _context35.next) {
1067
1088
  case 0:
1068
1089
  siteId = this.getCloudId();
1069
- _context34.next = 3;
1090
+ _context35.next = 3;
1070
1091
  return this.postResource("".concat(v4UrlPath, "/").concat(teamId, "/external/restore"), {
1071
1092
  externalReference: externalReference,
1072
1093
  siteId: siteId
1073
1094
  });
1074
1095
  case 3:
1075
- return _context34.abrupt("return", _context34.sent);
1096
+ return _context35.abrupt("return", _context35.sent);
1076
1097
  case 4:
1077
1098
  case "end":
1078
- return _context34.stop();
1099
+ return _context35.stop();
1079
1100
  }
1080
- }, _callee34, this);
1101
+ }, _callee35, this);
1081
1102
  }));
1082
- function restoreTeamToSyncedGroup(_x53, _x54) {
1103
+ function restoreTeamToSyncedGroup(_x54, _x55) {
1083
1104
  return _restoreTeamToSyncedGroup.apply(this, arguments);
1084
1105
  }
1085
1106
  return restoreTeamToSyncedGroup;
@@ -1087,18 +1108,18 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1087
1108
  }, {
1088
1109
  key: "createTeamContainers",
1089
1110
  value: function () {
1090
- var _createTeamContainers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(payload) {
1091
- return _regeneratorRuntime.wrap(function _callee35$(_context35) {
1092
- while (1) switch (_context35.prev = _context35.next) {
1111
+ var _createTeamContainers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(payload) {
1112
+ return _regeneratorRuntime.wrap(function _callee36$(_context36) {
1113
+ while (1) switch (_context36.prev = _context36.next) {
1093
1114
  case 0:
1094
- return _context35.abrupt("return", this.postResource("".concat(v4UrlPath, "/containers"), _objectSpread({}, payload)));
1115
+ return _context36.abrupt("return", this.postResource("".concat(v4UrlPath, "/containers"), _objectSpread({}, payload)));
1095
1116
  case 1:
1096
1117
  case "end":
1097
- return _context35.stop();
1118
+ return _context36.stop();
1098
1119
  }
1099
- }, _callee35, this);
1120
+ }, _callee36, this);
1100
1121
  }));
1101
- function createTeamContainers(_x55) {
1122
+ function createTeamContainers(_x56) {
1102
1123
  return _createTeamContainers.apply(this, arguments);
1103
1124
  }
1104
1125
  return createTeamContainers;
@@ -1106,23 +1127,23 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1106
1127
  }, {
1107
1128
  key: "getTeamEnabledSites",
1108
1129
  value: function () {
1109
- var _getTeamEnabledSites = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(teamId) {
1130
+ var _getTeamEnabledSites = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(teamId) {
1110
1131
  var teamEnabledSites;
1111
- return _regeneratorRuntime.wrap(function _callee36$(_context36) {
1112
- while (1) switch (_context36.prev = _context36.next) {
1132
+ return _regeneratorRuntime.wrap(function _callee37$(_context37) {
1133
+ while (1) switch (_context37.prev = _context37.next) {
1113
1134
  case 0:
1114
- _context36.next = 2;
1135
+ _context37.next = 2;
1115
1136
  return this.getResourceCached("".concat(v4UrlPath, "/migrations/scope/").concat(teamId));
1116
1137
  case 2:
1117
- teamEnabledSites = _context36.sent;
1118
- return _context36.abrupt("return", teamEnabledSites);
1138
+ teamEnabledSites = _context37.sent;
1139
+ return _context37.abrupt("return", teamEnabledSites);
1119
1140
  case 4:
1120
1141
  case "end":
1121
- return _context36.stop();
1142
+ return _context37.stop();
1122
1143
  }
1123
- }, _callee36, this);
1144
+ }, _callee37, this);
1124
1145
  }));
1125
- function getTeamEnabledSites(_x56) {
1146
+ function getTeamEnabledSites(_x57) {
1126
1147
  return _getTeamEnabledSites.apply(this, arguments);
1127
1148
  }
1128
1149
  return getTeamEnabledSites;
@@ -1130,26 +1151,26 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1130
1151
  }, {
1131
1152
  key: "assignTeamsToSites",
1132
1153
  value: function () {
1133
- var _assignTeamsToSites = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(migrations) {
1154
+ var _assignTeamsToSites = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(migrations) {
1134
1155
  var assignTeamsToSitesResponse;
1135
- return _regeneratorRuntime.wrap(function _callee37$(_context37) {
1136
- while (1) switch (_context37.prev = _context37.next) {
1156
+ return _regeneratorRuntime.wrap(function _callee38$(_context38) {
1157
+ while (1) switch (_context38.prev = _context38.next) {
1137
1158
  case 0:
1138
- _context37.next = 2;
1159
+ _context38.next = 2;
1139
1160
  return this.postResource("".concat(v4UrlPath, "/migrations/scope"), {
1140
1161
  originOrgId: this.getContext().orgId,
1141
1162
  migrations: migrations
1142
1163
  });
1143
1164
  case 2:
1144
- assignTeamsToSitesResponse = _context37.sent;
1145
- return _context37.abrupt("return", assignTeamsToSitesResponse);
1165
+ assignTeamsToSitesResponse = _context38.sent;
1166
+ return _context38.abrupt("return", assignTeamsToSitesResponse);
1146
1167
  case 4:
1147
1168
  case "end":
1148
- return _context37.stop();
1169
+ return _context38.stop();
1149
1170
  }
1150
- }, _callee37, this);
1171
+ }, _callee38, this);
1151
1172
  }));
1152
- function assignTeamsToSites(_x57) {
1173
+ function assignTeamsToSites(_x58) {
1153
1174
  return _assignTeamsToSites.apply(this, arguments);
1154
1175
  }
1155
1176
  return assignTeamsToSites;
@@ -1157,21 +1178,21 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1157
1178
  }, {
1158
1179
  key: "getTeamsToBeClonedToJsmSites",
1159
1180
  value: function () {
1160
- var _getTeamsToBeClonedToJsmSites = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(teamsToSiteScope) {
1161
- return _regeneratorRuntime.wrap(function _callee38$(_context38) {
1162
- while (1) switch (_context38.prev = _context38.next) {
1181
+ var _getTeamsToBeClonedToJsmSites = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(teamsToSiteScope) {
1182
+ return _regeneratorRuntime.wrap(function _callee39$(_context39) {
1183
+ while (1) switch (_context39.prev = _context39.next) {
1163
1184
  case 0:
1164
- return _context38.abrupt("return", this.postResource("".concat(v4UrlPath, "/migrations/scope/review"), {
1185
+ return _context39.abrupt("return", this.postResource("".concat(v4UrlPath, "/migrations/scope/review"), {
1165
1186
  orgId: this.getContext().orgId,
1166
1187
  teamsToSiteScope: teamsToSiteScope
1167
1188
  }));
1168
1189
  case 1:
1169
1190
  case "end":
1170
- return _context38.stop();
1191
+ return _context39.stop();
1171
1192
  }
1172
- }, _callee38, this);
1193
+ }, _callee39, this);
1173
1194
  }));
1174
- function getTeamsToBeClonedToJsmSites(_x58) {
1195
+ function getTeamsToBeClonedToJsmSites(_x59) {
1175
1196
  return _getTeamsToBeClonedToJsmSites.apply(this, arguments);
1176
1197
  }
1177
1198
  return getTeamsToBeClonedToJsmSites;
@@ -1179,21 +1200,21 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1179
1200
  }, {
1180
1201
  key: "setTeamSiteAssignmentPermission",
1181
1202
  value: function () {
1182
- var _setTeamSiteAssignmentPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(orgId, alignmentPermission) {
1183
- return _regeneratorRuntime.wrap(function _callee39$(_context39) {
1184
- while (1) switch (_context39.prev = _context39.next) {
1203
+ var _setTeamSiteAssignmentPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(orgId, alignmentPermission) {
1204
+ return _regeneratorRuntime.wrap(function _callee40$(_context40) {
1205
+ while (1) switch (_context40.prev = _context40.next) {
1185
1206
  case 0:
1186
- return _context39.abrupt("return", this.postResource("".concat(v4UrlPath, "/migrations/scope/permissions"), {
1207
+ return _context40.abrupt("return", this.postResource("".concat(v4UrlPath, "/migrations/scope/permissions"), {
1187
1208
  orgId: orgId,
1188
1209
  alignmentPermission: alignmentPermission
1189
1210
  }));
1190
1211
  case 1:
1191
1212
  case "end":
1192
- return _context39.stop();
1213
+ return _context40.stop();
1193
1214
  }
1194
- }, _callee39, this);
1215
+ }, _callee40, this);
1195
1216
  }));
1196
- function setTeamSiteAssignmentPermission(_x59, _x60) {
1217
+ function setTeamSiteAssignmentPermission(_x60, _x61) {
1197
1218
  return _setTeamSiteAssignmentPermission.apply(this, arguments);
1198
1219
  }
1199
1220
  return setTeamSiteAssignmentPermission;
@@ -1201,12 +1222,12 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1201
1222
  }, {
1202
1223
  key: "getAssignedTeams",
1203
1224
  value: function () {
1204
- var _getAssignedTeams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(orgId, count, cursor, displayNameContains) {
1225
+ var _getAssignedTeams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(orgId, count, cursor, displayNameContains) {
1205
1226
  var assignedTeamsResponse;
1206
- return _regeneratorRuntime.wrap(function _callee40$(_context40) {
1207
- while (1) switch (_context40.prev = _context40.next) {
1227
+ return _regeneratorRuntime.wrap(function _callee41$(_context41) {
1228
+ while (1) switch (_context41.prev = _context41.next) {
1208
1229
  case 0:
1209
- _context40.next = 2;
1230
+ _context41.next = 2;
1210
1231
  return this.postResource("".concat(v4UrlPath, "/migrations/scope/aligned/search"), {
1211
1232
  orgId: orgId,
1212
1233
  count: count,
@@ -1214,15 +1235,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1214
1235
  displayNameContains: displayNameContains
1215
1236
  });
1216
1237
  case 2:
1217
- assignedTeamsResponse = _context40.sent;
1218
- return _context40.abrupt("return", assignedTeamsResponse);
1238
+ assignedTeamsResponse = _context41.sent;
1239
+ return _context41.abrupt("return", assignedTeamsResponse);
1219
1240
  case 4:
1220
1241
  case "end":
1221
- return _context40.stop();
1242
+ return _context41.stop();
1222
1243
  }
1223
- }, _callee40, this);
1244
+ }, _callee41, this);
1224
1245
  }));
1225
- function getAssignedTeams(_x61, _x62, _x63, _x64) {
1246
+ function getAssignedTeams(_x62, _x63, _x64, _x65) {
1226
1247
  return _getAssignedTeams.apply(this, arguments);
1227
1248
  }
1228
1249
  return getAssignedTeams;
@@ -1230,12 +1251,12 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1230
1251
  }, {
1231
1252
  key: "getUnassignedTeams",
1232
1253
  value: function () {
1233
- var _getUnassignedTeams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(orgId, count, cursor, query) {
1254
+ var _getUnassignedTeams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(orgId, count, cursor, query) {
1234
1255
  var unassignedTeamsResponse;
1235
- return _regeneratorRuntime.wrap(function _callee41$(_context41) {
1236
- while (1) switch (_context41.prev = _context41.next) {
1256
+ return _regeneratorRuntime.wrap(function _callee42$(_context42) {
1257
+ while (1) switch (_context42.prev = _context42.next) {
1237
1258
  case 0:
1238
- _context41.next = 2;
1259
+ _context42.next = 2;
1239
1260
  return this.postResource("".concat(v4UrlPath, "/migrations/scope/unaligned/search"), {
1240
1261
  orgId: orgId,
1241
1262
  count: count,
@@ -1243,15 +1264,15 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1243
1264
  query: query
1244
1265
  });
1245
1266
  case 2:
1246
- unassignedTeamsResponse = _context41.sent;
1247
- return _context41.abrupt("return", unassignedTeamsResponse);
1267
+ unassignedTeamsResponse = _context42.sent;
1268
+ return _context42.abrupt("return", unassignedTeamsResponse);
1248
1269
  case 4:
1249
1270
  case "end":
1250
- return _context41.stop();
1271
+ return _context42.stop();
1251
1272
  }
1252
- }, _callee41, this);
1273
+ }, _callee42, this);
1253
1274
  }));
1254
- function getUnassignedTeams(_x65, _x66, _x67, _x68) {
1275
+ function getUnassignedTeams(_x66, _x67, _x68, _x69) {
1255
1276
  return _getUnassignedTeams.apply(this, arguments);
1256
1277
  }
1257
1278
  return getUnassignedTeams;
@@ -1259,26 +1280,26 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1259
1280
  }, {
1260
1281
  key: "getTeamSiteAssignmentOrgDetails",
1261
1282
  value: function () {
1262
- var _getTeamSiteAssignmentOrgDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
1283
+ var _getTeamSiteAssignmentOrgDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43() {
1263
1284
  var orgId, err;
1264
- return _regeneratorRuntime.wrap(function _callee42$(_context42) {
1265
- while (1) switch (_context42.prev = _context42.next) {
1285
+ return _regeneratorRuntime.wrap(function _callee43$(_context43) {
1286
+ while (1) switch (_context43.prev = _context43.next) {
1266
1287
  case 0:
1267
1288
  orgId = this.getContext().orgId;
1268
1289
  if (orgId) {
1269
- _context42.next = 5;
1290
+ _context43.next = 5;
1270
1291
  break;
1271
1292
  }
1272
1293
  err = new Error('Organization ID is required');
1273
1294
  this.logException(err, 'getTeamSiteAssignmentOrgDetails');
1274
1295
  throw err;
1275
1296
  case 5:
1276
- return _context42.abrupt("return", this.getResource("".concat(v4UrlPath, "/migrations/scope/details/").concat(orgId)));
1297
+ return _context43.abrupt("return", this.getResource("".concat(v4UrlPath, "/migrations/scope/details/").concat(orgId)));
1277
1298
  case 6:
1278
1299
  case "end":
1279
- return _context42.stop();
1300
+ return _context43.stop();
1280
1301
  }
1281
- }, _callee42, this);
1302
+ }, _callee43, this);
1282
1303
  }));
1283
1304
  function getTeamSiteAssignmentOrgDetails() {
1284
1305
  return _getTeamSiteAssignmentOrgDetails.apply(this, arguments);