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