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