@atlaskit/teams-client 6.0.0 → 6.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/teams-client
2
2
 
3
+ ## 6.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`dacb66ef5c8a6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dacb66ef5c8a6) -
8
+ Add an optional `TeamSlackRequestOptions` argument to the Teams in Slack requests. Setting
9
+ `skipAuthRedirect` makes a missing Staffy session reject the request instead of navigating the
10
+ top-level window to Staffy login. Only reachable while the
11
+ `ptc-onboard-teams-slack-app-to-global-edge-url` gate is on.
12
+
13
+ ## 6.1.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [`0ce9c55149824`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0ce9c55149824) -
18
+ Changing endpoint from no scoped to team scoped
19
+
3
20
  ## 6.0.0
4
21
 
5
22
  ### Major Changes
@@ -56,7 +56,7 @@ var TeamsUFOExperience = exports.TeamsUFOExperience = /*#__PURE__*/function (_UF
56
56
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
57
57
  metadata: {
58
58
  error: (0, _createErrorMetadata.createErrorMetadata)(error),
59
- packageVersion: "5.6.0",
59
+ packageVersion: "6.1.0",
60
60
  packageName: "@atlaskit/teams-client"
61
61
  }
62
62
  }]);
@@ -64,7 +64,7 @@ var TeamsUFOExperience = exports.TeamsUFOExperience = /*#__PURE__*/function (_UF
64
64
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
65
65
  metadata: {
66
66
  error: 'unknown error',
67
- packageVersion: "5.6.0",
67
+ packageVersion: "6.1.0",
68
68
  packageName: "@atlaskit/teams-client"
69
69
  }
70
70
  }]);
@@ -15,6 +15,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
15
15
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
16
16
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
17
17
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
18
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
18
19
  var _constants = require("../constants");
19
20
  var _restClient = require("../rest-client");
20
21
  var _excluded = ["linkUri"];
@@ -51,6 +52,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
51
52
  * @property {string} cursor - Cursor to fetch the next page of results
52
53
  */
53
54
 
55
+ // oxlint-disable-next-line eslint/no-redeclare
56
+
54
57
  var v3UrlPath = "/v3/teams";
55
58
  var v4UrlPath = "/v4/teams";
56
59
 
@@ -903,11 +906,13 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
903
906
  }, {
904
907
  key: "getWriteMediaToken",
905
908
  value: function () {
906
- var _getWriteMediaToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
909
+ var _getWriteMediaToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29(teamId) {
910
+ var path;
907
911
  return _regenerator.default.wrap(function (_context29) {
908
912
  while (1) switch (_context29.prev = _context29.next) {
909
913
  case 0:
910
- return _context29.abrupt("return", this.getResource('/v4/teams/header-image/media-upload').then(function (response) {
914
+ path = (0, _fg.fg)('ptc-enable-team-scoped-header-image-media-upload') && teamId ? "".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/header-image/media-upload") : "".concat(v4UrlPath, "/header-image/media-upload");
915
+ return _context29.abrupt("return", this.getResource(path).then(function (response) {
911
916
  var _response$baseUrl;
912
917
  return _objectSpread(_objectSpread({}, response), {}, {
913
918
  baseUrl: (_response$baseUrl = response.baseUrl) !== null && _response$baseUrl !== void 0 && _response$baseUrl.endsWith('/') ? response.baseUrl.slice(0, -1) : response.baseUrl
@@ -919,7 +924,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
919
924
  }
920
925
  }, _callee29, this);
921
926
  }));
922
- function getWriteMediaToken() {
927
+ function getWriteMediaToken(_x53) {
923
928
  return _getWriteMediaToken.apply(this, arguments);
924
929
  }
925
930
  return getWriteMediaToken;
@@ -945,7 +950,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
945
950
  }
946
951
  }, _callee30, this);
947
952
  }));
948
- function getSoftDeletedTeamById(_x53) {
953
+ function getSoftDeletedTeamById(_x54) {
949
954
  return _getSoftDeletedTeamById.apply(this, arguments);
950
955
  }
951
956
  return getSoftDeletedTeamById;
@@ -974,7 +979,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
974
979
  }
975
980
  }, _callee31, this);
976
981
  }));
977
- function getUserInSiteUserBase(_x54) {
982
+ function getUserInSiteUserBase(_x55) {
978
983
  return _getUserInSiteUserBase.apply(this, arguments);
979
984
  }
980
985
  return getUserInSiteUserBase;
@@ -997,7 +1002,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
997
1002
  }
998
1003
  }, _callee32, this);
999
1004
  }));
1000
- function retrieveBrowseUserPermission(_x55) {
1005
+ function retrieveBrowseUserPermission(_x56) {
1001
1006
  return _retrieveBrowseUserPermission.apply(this, arguments);
1002
1007
  }
1003
1008
  return retrieveBrowseUserPermission;
@@ -1064,7 +1069,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
1064
1069
  }
1065
1070
  }, _callee34, this);
1066
1071
  }));
1067
- function getLinkedTeamsBulk(_x56) {
1072
+ function getLinkedTeamsBulk(_x57) {
1068
1073
  return _getLinkedTeamsBulk.apply(this, arguments);
1069
1074
  }
1070
1075
  return getLinkedTeamsBulk;
@@ -1097,7 +1102,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
1097
1102
  }
1098
1103
  }, _callee35, this);
1099
1104
  }));
1100
- function getTeamProfileDetails(_x57, _x58) {
1105
+ function getTeamProfileDetails(_x58, _x59) {
1101
1106
  return _getTeamProfileDetails.apply(this, arguments);
1102
1107
  }
1103
1108
  return getTeamProfileDetails;
@@ -1157,7 +1162,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
1157
1162
  }
1158
1163
  }, _callee37, this);
1159
1164
  }));
1160
- function restoreTeamToSyncedGroup(_x59, _x60) {
1165
+ function restoreTeamToSyncedGroup(_x60, _x61) {
1161
1166
  return _restoreTeamToSyncedGroup.apply(this, arguments);
1162
1167
  }
1163
1168
  return restoreTeamToSyncedGroup;
@@ -1176,7 +1181,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
1176
1181
  }
1177
1182
  }, _callee38, this);
1178
1183
  }));
1179
- function createTeamContainers(_x61) {
1184
+ function createTeamContainers(_x62) {
1180
1185
  return _createTeamContainers.apply(this, arguments);
1181
1186
  }
1182
1187
  return createTeamContainers;
@@ -1200,7 +1205,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
1200
1205
  }
1201
1206
  }, _callee39, this);
1202
1207
  }));
1203
- function getTeamEnabledSites(_x62) {
1208
+ function getTeamEnabledSites(_x63) {
1204
1209
  return _getTeamEnabledSites.apply(this, arguments);
1205
1210
  }
1206
1211
  return getTeamEnabledSites;
@@ -1227,7 +1232,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
1227
1232
  }
1228
1233
  }, _callee40, this);
1229
1234
  }));
1230
- function assignTeamsToSites(_x63) {
1235
+ function assignTeamsToSites(_x64) {
1231
1236
  return _assignTeamsToSites.apply(this, arguments);
1232
1237
  }
1233
1238
  return assignTeamsToSites;
@@ -1249,7 +1254,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
1249
1254
  }
1250
1255
  }, _callee41, this);
1251
1256
  }));
1252
- function getTeamsToBeClonedToJsmSites(_x64) {
1257
+ function getTeamsToBeClonedToJsmSites(_x65) {
1253
1258
  return _getTeamsToBeClonedToJsmSites.apply(this, arguments);
1254
1259
  }
1255
1260
  return getTeamsToBeClonedToJsmSites;
@@ -1271,7 +1276,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
1271
1276
  }
1272
1277
  }, _callee42, this);
1273
1278
  }));
1274
- function setTeamSiteAssignmentPermission(_x65, _x66) {
1279
+ function setTeamSiteAssignmentPermission(_x66, _x67) {
1275
1280
  return _setTeamSiteAssignmentPermission.apply(this, arguments);
1276
1281
  }
1277
1282
  return setTeamSiteAssignmentPermission;
@@ -1300,7 +1305,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
1300
1305
  }
1301
1306
  }, _callee43, this);
1302
1307
  }));
1303
- function getAssignedTeams(_x67, _x68, _x69, _x70) {
1308
+ function getAssignedTeams(_x68, _x69, _x70, _x71) {
1304
1309
  return _getAssignedTeams.apply(this, arguments);
1305
1310
  }
1306
1311
  return getAssignedTeams;
@@ -1329,7 +1334,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
1329
1334
  }
1330
1335
  }, _callee44, this);
1331
1336
  }));
1332
- function getUnassignedTeams(_x71, _x72, _x73, _x74) {
1337
+ function getUnassignedTeams(_x72, _x73, _x74, _x75) {
1333
1338
  return _getUnassignedTeams.apply(this, arguments);
1334
1339
  }
1335
1340
  return getUnassignedTeams;
@@ -1531,7 +1536,7 @@ var LegionClient = exports.LegionClient = /*#__PURE__*/function (_RestClient) {
1531
1536
  }
1532
1537
  }, _callee46, this, [[0, 1]]);
1533
1538
  }));
1534
- function getTeamStatesInBulk(_x75, _x76) {
1539
+ function getTeamStatesInBulk(_x76, _x77) {
1535
1540
  return _getTeamStatesInBulk.apply(this, arguments);
1536
1541
  }
1537
1542
  return getTeamStatesInBulk;
@@ -2084,13 +2084,13 @@ var TeamsClient = exports.TeamsClient = /*#__PURE__*/function () {
2084
2084
  }, {
2085
2085
  key: "getWriteTeamMediaToken",
2086
2086
  value: (function () {
2087
- var _getWriteTeamMediaToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58() {
2087
+ var _getWriteTeamMediaToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(teamId) {
2088
2088
  var _this53 = this;
2089
2089
  return _regenerator.default.wrap(function (_context58) {
2090
2090
  while (1) switch (_context58.prev = _context58.next) {
2091
2091
  case 0:
2092
2092
  return _context58.abrupt("return", this.measurePerformance('getWriteTeamMediaToken', function () {
2093
- return _this53._legionClient.getWriteMediaToken();
2093
+ return _this53._legionClient.getWriteMediaToken(teamId);
2094
2094
  }));
2095
2095
  case 1:
2096
2096
  case "end":
@@ -2098,7 +2098,7 @@ var TeamsClient = exports.TeamsClient = /*#__PURE__*/function () {
2098
2098
  }
2099
2099
  }, _callee58, this);
2100
2100
  }));
2101
- function getWriteTeamMediaToken() {
2101
+ function getWriteTeamMediaToken(_x24) {
2102
2102
  return _getWriteTeamMediaToken.apply(this, arguments);
2103
2103
  }
2104
2104
  return getWriteTeamMediaToken;
@@ -2184,7 +2184,7 @@ var TeamsClient = exports.TeamsClient = /*#__PURE__*/function () {
2184
2184
  }
2185
2185
  }, _callee61, this);
2186
2186
  }));
2187
- function updateUserHeaderImage(_x24) {
2187
+ function updateUserHeaderImage(_x25) {
2188
2188
  return _updateUserHeaderImage.apply(this, arguments);
2189
2189
  }
2190
2190
  return updateUserHeaderImage;
@@ -36,7 +36,7 @@ function getSentryConfig(options) {
36
36
  return _objectSpread(_objectSpread(_objectSpread({}, otherOptions), DEFAULT_SENTRY_CONFIG), {}, {
37
37
  // Standalone __VERSION__ is set from `bin/set-release-version.sh`
38
38
  // when building to deploy to production
39
- release: "".concat("@atlaskit/teams-client", "@").concat("5.6.0") ||
39
+ release: "".concat("@atlaskit/teams-client", "@").concat("6.1.0") ||
40
40
  // @ts-ignore Jira - window.BUILD_KEY
41
41
  window.BUILD_KEY || ( // @ts-ignore Confluence - window.__buildInfo
42
42
  (_window$__buildInfo = window.__buildInfo) === null || _window$__buildInfo === void 0 ? void 0 : _window$__buildInfo.FRONTEND_VERSION) || '---',
@@ -46,14 +46,15 @@ var TeamsInSlackClient = exports.TeamsInSlackClient = /*#__PURE__*/function (_Re
46
46
  /**
47
47
  * Pre-flight auth probe for Staffy Global Edge calls (COMMIT-27483).
48
48
  * Fetches /api/authping with credentials:'include'. On failure (302→Okta),
49
- * navigates to /staffy/login?return_to=<current URL> for top-level Okta SSO.
49
+ * navigates to /staffy/login?return_to=<current URL> for top-level Okta SSO,
50
+ * or rejects without navigating when `skipAuthRedirect` is set.
50
51
  * No-op when the gate is OFF (Stargate path).
51
52
  */
52
53
  (0, _inherits2.default)(TeamsInSlackClient, _RestClient);
53
54
  return (0, _createClass2.default)(TeamsInSlackClient, [{
54
55
  key: "ensureStaffyAuth",
55
56
  value: (function () {
56
- var _ensureStaffyAuth = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
57
+ var _ensureStaffyAuth = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(options) {
57
58
  var authenticated, returnTo;
58
59
  return _regenerator.default.wrap(function (_context) {
59
60
  while (1) switch (_context.prev = _context.next) {
@@ -84,12 +85,20 @@ var TeamsInSlackClient = exports.TeamsInSlackClient = /*#__PURE__*/function (_Re
84
85
  staffyAuthAttempted = false;
85
86
  return _context.abrupt("return");
86
87
  case 3:
87
- if (!staffyAuthAttempted) {
88
+ if (!(options !== null && options !== void 0 && options.skipAuthRedirect)) {
88
89
  _context.next = 4;
89
90
  break;
90
91
  }
91
- return _context.abrupt("return");
92
+ throw new _SLOIgnoreError.SLOIgnoreError({
93
+ message: 'Staffy session missing, skipping login redirect'
94
+ });
92
95
  case 4:
96
+ if (!staffyAuthAttempted) {
97
+ _context.next = 5;
98
+ break;
99
+ }
100
+ return _context.abrupt("return");
101
+ case 5:
93
102
  staffyAuthAttempted = true;
94
103
  _redirectCount.redirectCount.increment();
95
104
  returnTo = encodeURIComponent(window.location.href);
@@ -97,13 +106,13 @@ var TeamsInSlackClient = exports.TeamsInSlackClient = /*#__PURE__*/function (_Re
97
106
  throw new _SLOIgnoreError.SLOIgnoreError({
98
107
  message: 'Redirecting to Staffy login'
99
108
  });
100
- case 5:
109
+ case 6:
101
110
  case "end":
102
111
  return _context.stop();
103
112
  }
104
113
  }, _callee);
105
114
  }));
106
- function ensureStaffyAuth() {
115
+ function ensureStaffyAuth(_x) {
107
116
  return _ensureStaffyAuth.apply(this, arguments);
108
117
  }
109
118
  return ensureStaffyAuth;
@@ -111,12 +120,12 @@ var TeamsInSlackClient = exports.TeamsInSlackClient = /*#__PURE__*/function (_Re
111
120
  }, {
112
121
  key: "getTeamInSlack",
113
122
  value: function () {
114
- var _getTeamInSlack = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(teamId, teamName) {
123
+ var _getTeamInSlack = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(teamId, teamName, options) {
115
124
  return _regenerator.default.wrap(function (_context2) {
116
125
  while (1) switch (_context2.prev = _context2.next) {
117
126
  case 0:
118
127
  _context2.next = 1;
119
- return this.ensureStaffyAuth();
128
+ return this.ensureStaffyAuth(options);
120
129
  case 1:
121
130
  return _context2.abrupt("return", this.getResource("/".concat(teamId, "?teamName=").concat(encodeURIComponent(teamName))).then(function (response) {
122
131
  return _objectSpread({
@@ -129,7 +138,7 @@ var TeamsInSlackClient = exports.TeamsInSlackClient = /*#__PURE__*/function (_Re
129
138
  }
130
139
  }, _callee2, this);
131
140
  }));
132
- function getTeamInSlack(_x, _x2) {
141
+ function getTeamInSlack(_x2, _x3, _x4) {
133
142
  return _getTeamInSlack.apply(this, arguments);
134
143
  }
135
144
  return getTeamInSlack;
@@ -137,12 +146,12 @@ var TeamsInSlackClient = exports.TeamsInSlackClient = /*#__PURE__*/function (_Re
137
146
  }, {
138
147
  key: "disconnectTeamInSlack",
139
148
  value: function () {
140
- var _disconnectTeamInSlack = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(teamId) {
149
+ var _disconnectTeamInSlack = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(teamId, options) {
141
150
  return _regenerator.default.wrap(function (_context3) {
142
151
  while (1) switch (_context3.prev = _context3.next) {
143
152
  case 0:
144
153
  _context3.next = 1;
145
- return this.ensureStaffyAuth();
154
+ return this.ensureStaffyAuth(options);
146
155
  case 1:
147
156
  return _context3.abrupt("return", this.deleteResource("/".concat(teamId)).then(function (response) {
148
157
  return _objectSpread({
@@ -155,7 +164,7 @@ var TeamsInSlackClient = exports.TeamsInSlackClient = /*#__PURE__*/function (_Re
155
164
  }
156
165
  }, _callee3, this);
157
166
  }));
158
- function disconnectTeamInSlack(_x3) {
167
+ function disconnectTeamInSlack(_x5, _x6) {
159
168
  return _disconnectTeamInSlack.apply(this, arguments);
160
169
  }
161
170
  return disconnectTeamInSlack;
@@ -163,12 +172,12 @@ var TeamsInSlackClient = exports.TeamsInSlackClient = /*#__PURE__*/function (_Re
163
172
  }, {
164
173
  key: "updateTeamInSlack",
165
174
  value: function () {
166
- var _updateTeamInSlack = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(teamId, channelId, usergroupHandle) {
175
+ var _updateTeamInSlack = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(teamId, channelId, usergroupHandle, options) {
167
176
  return _regenerator.default.wrap(function (_context4) {
168
177
  while (1) switch (_context4.prev = _context4.next) {
169
178
  case 0:
170
179
  _context4.next = 1;
171
- return this.ensureStaffyAuth();
180
+ return this.ensureStaffyAuth(options);
172
181
  case 1:
173
182
  return _context4.abrupt("return", this.postResource("/".concat(teamId, "?channel=").concat(channelId, "&groupName=").concat(usergroupHandle)).then(function (response) {
174
183
  return _objectSpread({
@@ -181,7 +190,7 @@ var TeamsInSlackClient = exports.TeamsInSlackClient = /*#__PURE__*/function (_Re
181
190
  }
182
191
  }, _callee4, this);
183
192
  }));
184
- function updateTeamInSlack(_x4, _x5, _x6) {
193
+ function updateTeamInSlack(_x7, _x8, _x9, _x0) {
185
194
  return _updateTeamInSlack.apply(this, arguments);
186
195
  }
187
196
  return updateTeamInSlack;
@@ -31,7 +31,7 @@ export class TeamsUFOExperience extends UFOExperience {
31
31
  return super.failure({
32
32
  metadata: {
33
33
  error: createErrorMetadata(error),
34
- packageVersion: "5.6.0",
34
+ packageVersion: "6.1.0",
35
35
  packageName: "@atlaskit/teams-client"
36
36
  }
37
37
  });
@@ -39,7 +39,7 @@ export class TeamsUFOExperience extends UFOExperience {
39
39
  return super.failure({
40
40
  metadata: {
41
41
  error: 'unknown error',
42
- packageVersion: "5.6.0",
42
+ packageVersion: "6.1.0",
43
43
  packageName: "@atlaskit/teams-client"
44
44
  }
45
45
  });
@@ -1,3 +1,4 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
1
2
  import { DEFAULT_CONFIG } from '../constants';
2
3
  import { RestClient } from '../rest-client';
3
4
 
@@ -30,6 +31,8 @@ import { RestClient } from '../rest-client';
30
31
  * @property {string} cursor - Cursor to fetch the next page of results
31
32
  */
32
33
 
34
+ // oxlint-disable-next-line eslint/no-redeclare
35
+
33
36
  const v3UrlPath = `/v3/teams`;
34
37
  const v4UrlPath = `/v4/teams`;
35
38
 
@@ -329,8 +332,9 @@ export class LegionClient extends RestClient {
329
332
  siteId
330
333
  });
331
334
  }
332
- async getWriteMediaToken() {
333
- return this.getResource('/v4/teams/header-image/media-upload').then(response => {
335
+ async getWriteMediaToken(teamId) {
336
+ const path = fg('ptc-enable-team-scoped-header-image-media-upload') && teamId ? `${v4UrlPath}/${this.trimTeamARI(teamId)}/header-image/media-upload` : `${v4UrlPath}/header-image/media-upload`;
337
+ return this.getResource(path).then(response => {
334
338
  var _response$baseUrl;
335
339
  return {
336
340
  ...response,
@@ -619,8 +619,8 @@ export class TeamsClient {
619
619
  /**
620
620
  * Get token to upload media for a team
621
621
  */
622
- async getWriteTeamMediaToken() {
623
- return this.measurePerformance('getWriteTeamMediaToken', () => this._legionClient.getWriteMediaToken());
622
+ async getWriteTeamMediaToken(teamId) {
623
+ return this.measurePerformance('getWriteTeamMediaToken', () => this._legionClient.getWriteMediaToken(teamId));
624
624
  }
625
625
 
626
626
  /**
@@ -28,7 +28,7 @@ export function getSentryConfig(options) {
28
28
  ...DEFAULT_SENTRY_CONFIG,
29
29
  // Standalone __VERSION__ is set from `bin/set-release-version.sh`
30
30
  // when building to deploy to production
31
- release: `${"@atlaskit/teams-client"}@${"5.6.0"}` ||
31
+ release: `${"@atlaskit/teams-client"}@${"6.1.0"}` ||
32
32
  // @ts-ignore Jira - window.BUILD_KEY
33
33
  window.BUILD_KEY || ( // @ts-ignore Confluence - window.__buildInfo
34
34
  (_window$__buildInfo = window.__buildInfo) === null || _window$__buildInfo === void 0 ? void 0 : _window$__buildInfo.FRONTEND_VERSION) || '---',
@@ -28,10 +28,11 @@ export class TeamsInSlackClient extends RestClient {
28
28
  /**
29
29
  * Pre-flight auth probe for Staffy Global Edge calls (COMMIT-27483).
30
30
  * Fetches /api/authping with credentials:'include'. On failure (302→Okta),
31
- * navigates to /staffy/login?return_to=<current URL> for top-level Okta SSO.
31
+ * navigates to /staffy/login?return_to=<current URL> for top-level Okta SSO,
32
+ * or rejects without navigating when `skipAuthRedirect` is set.
32
33
  * No-op when the gate is OFF (Stargate path).
33
34
  */
34
- async ensureStaffyAuth() {
35
+ async ensureStaffyAuth(options) {
35
36
  if (!fg('ptc-onboard-teams-slack-app-to-global-edge-url')) {
36
37
  return;
37
38
  }
@@ -45,6 +46,11 @@ export class TeamsInSlackClient extends RestClient {
45
46
  staffyAuthAttempted = false;
46
47
  return;
47
48
  }
49
+ if (options !== null && options !== void 0 && options.skipAuthRedirect) {
50
+ throw new SLOIgnoreError({
51
+ message: 'Staffy session missing, skipping login redirect'
52
+ });
53
+ }
48
54
  if (staffyAuthAttempted) {
49
55
  // Already redirected once — let the call proceed and surface the error.
50
56
  return;
@@ -57,22 +63,22 @@ export class TeamsInSlackClient extends RestClient {
57
63
  message: 'Redirecting to Staffy login'
58
64
  });
59
65
  }
60
- async getTeamInSlack(teamId, teamName) {
61
- await this.ensureStaffyAuth();
66
+ async getTeamInSlack(teamId, teamName, options) {
67
+ await this.ensureStaffyAuth(options);
62
68
  return this.getResource(`/${teamId}?teamName=${encodeURIComponent(teamName)}`).then(response => ({
63
69
  id: teamId,
64
70
  ...response
65
71
  }));
66
72
  }
67
- async disconnectTeamInSlack(teamId) {
68
- await this.ensureStaffyAuth();
73
+ async disconnectTeamInSlack(teamId, options) {
74
+ await this.ensureStaffyAuth(options);
69
75
  return this.deleteResource(`/${teamId}`).then(response => ({
70
76
  id: teamId,
71
77
  ...response
72
78
  }));
73
79
  }
74
- async updateTeamInSlack(teamId, channelId, usergroupHandle) {
75
- await this.ensureStaffyAuth();
80
+ async updateTeamInSlack(teamId, channelId, usergroupHandle, options) {
81
+ await this.ensureStaffyAuth(options);
76
82
  return this.postResource(`/${teamId}?channel=${channelId}&groupName=${usergroupHandle}`).then(response => ({
77
83
  id: teamId,
78
84
  ...response
@@ -49,7 +49,7 @@ export var TeamsUFOExperience = /*#__PURE__*/function (_UFOExperience) {
49
49
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
50
50
  metadata: {
51
51
  error: createErrorMetadata(error),
52
- packageVersion: "5.6.0",
52
+ packageVersion: "6.1.0",
53
53
  packageName: "@atlaskit/teams-client"
54
54
  }
55
55
  }]);
@@ -57,7 +57,7 @@ export var TeamsUFOExperience = /*#__PURE__*/function (_UFOExperience) {
57
57
  return _superPropGet(TeamsUFOExperience, "failure", this, 3)([{
58
58
  metadata: {
59
59
  error: 'unknown error',
60
- packageVersion: "5.6.0",
60
+ packageVersion: "6.1.0",
61
61
  packageName: "@atlaskit/teams-client"
62
62
  }
63
63
  }]);
@@ -13,6 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  import _regeneratorRuntime from "@babel/runtime/regenerator";
14
14
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
15
15
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
16
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
16
17
  import { DEFAULT_CONFIG } from '../constants';
17
18
  import { RestClient } from '../rest-client';
18
19
 
@@ -45,6 +46,8 @@ import { RestClient } from '../rest-client';
45
46
  * @property {string} cursor - Cursor to fetch the next page of results
46
47
  */
47
48
 
49
+ // oxlint-disable-next-line eslint/no-redeclare
50
+
48
51
  var v3UrlPath = "/v3/teams";
49
52
  var v4UrlPath = "/v4/teams";
50
53
 
@@ -897,11 +900,13 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
897
900
  }, {
898
901
  key: "getWriteMediaToken",
899
902
  value: function () {
900
- var _getWriteMediaToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
903
+ var _getWriteMediaToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(teamId) {
904
+ var path;
901
905
  return _regeneratorRuntime.wrap(function (_context29) {
902
906
  while (1) switch (_context29.prev = _context29.next) {
903
907
  case 0:
904
- return _context29.abrupt("return", this.getResource('/v4/teams/header-image/media-upload').then(function (response) {
908
+ path = fg('ptc-enable-team-scoped-header-image-media-upload') && teamId ? "".concat(v4UrlPath, "/").concat(this.trimTeamARI(teamId), "/header-image/media-upload") : "".concat(v4UrlPath, "/header-image/media-upload");
909
+ return _context29.abrupt("return", this.getResource(path).then(function (response) {
905
910
  var _response$baseUrl;
906
911
  return _objectSpread(_objectSpread({}, response), {}, {
907
912
  baseUrl: (_response$baseUrl = response.baseUrl) !== null && _response$baseUrl !== void 0 && _response$baseUrl.endsWith('/') ? response.baseUrl.slice(0, -1) : response.baseUrl
@@ -913,7 +918,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
913
918
  }
914
919
  }, _callee29, this);
915
920
  }));
916
- function getWriteMediaToken() {
921
+ function getWriteMediaToken(_x53) {
917
922
  return _getWriteMediaToken.apply(this, arguments);
918
923
  }
919
924
  return getWriteMediaToken;
@@ -939,7 +944,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
939
944
  }
940
945
  }, _callee30, this);
941
946
  }));
942
- function getSoftDeletedTeamById(_x53) {
947
+ function getSoftDeletedTeamById(_x54) {
943
948
  return _getSoftDeletedTeamById.apply(this, arguments);
944
949
  }
945
950
  return getSoftDeletedTeamById;
@@ -968,7 +973,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
968
973
  }
969
974
  }, _callee31, this);
970
975
  }));
971
- function getUserInSiteUserBase(_x54) {
976
+ function getUserInSiteUserBase(_x55) {
972
977
  return _getUserInSiteUserBase.apply(this, arguments);
973
978
  }
974
979
  return getUserInSiteUserBase;
@@ -991,7 +996,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
991
996
  }
992
997
  }, _callee32, this);
993
998
  }));
994
- function retrieveBrowseUserPermission(_x55) {
999
+ function retrieveBrowseUserPermission(_x56) {
995
1000
  return _retrieveBrowseUserPermission.apply(this, arguments);
996
1001
  }
997
1002
  return retrieveBrowseUserPermission;
@@ -1058,7 +1063,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1058
1063
  }
1059
1064
  }, _callee34, this);
1060
1065
  }));
1061
- function getLinkedTeamsBulk(_x56) {
1066
+ function getLinkedTeamsBulk(_x57) {
1062
1067
  return _getLinkedTeamsBulk.apply(this, arguments);
1063
1068
  }
1064
1069
  return getLinkedTeamsBulk;
@@ -1091,7 +1096,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1091
1096
  }
1092
1097
  }, _callee35, this);
1093
1098
  }));
1094
- function getTeamProfileDetails(_x57, _x58) {
1099
+ function getTeamProfileDetails(_x58, _x59) {
1095
1100
  return _getTeamProfileDetails.apply(this, arguments);
1096
1101
  }
1097
1102
  return getTeamProfileDetails;
@@ -1151,7 +1156,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1151
1156
  }
1152
1157
  }, _callee37, this);
1153
1158
  }));
1154
- function restoreTeamToSyncedGroup(_x59, _x60) {
1159
+ function restoreTeamToSyncedGroup(_x60, _x61) {
1155
1160
  return _restoreTeamToSyncedGroup.apply(this, arguments);
1156
1161
  }
1157
1162
  return restoreTeamToSyncedGroup;
@@ -1170,7 +1175,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1170
1175
  }
1171
1176
  }, _callee38, this);
1172
1177
  }));
1173
- function createTeamContainers(_x61) {
1178
+ function createTeamContainers(_x62) {
1174
1179
  return _createTeamContainers.apply(this, arguments);
1175
1180
  }
1176
1181
  return createTeamContainers;
@@ -1194,7 +1199,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1194
1199
  }
1195
1200
  }, _callee39, this);
1196
1201
  }));
1197
- function getTeamEnabledSites(_x62) {
1202
+ function getTeamEnabledSites(_x63) {
1198
1203
  return _getTeamEnabledSites.apply(this, arguments);
1199
1204
  }
1200
1205
  return getTeamEnabledSites;
@@ -1221,7 +1226,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1221
1226
  }
1222
1227
  }, _callee40, this);
1223
1228
  }));
1224
- function assignTeamsToSites(_x63) {
1229
+ function assignTeamsToSites(_x64) {
1225
1230
  return _assignTeamsToSites.apply(this, arguments);
1226
1231
  }
1227
1232
  return assignTeamsToSites;
@@ -1243,7 +1248,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1243
1248
  }
1244
1249
  }, _callee41, this);
1245
1250
  }));
1246
- function getTeamsToBeClonedToJsmSites(_x64) {
1251
+ function getTeamsToBeClonedToJsmSites(_x65) {
1247
1252
  return _getTeamsToBeClonedToJsmSites.apply(this, arguments);
1248
1253
  }
1249
1254
  return getTeamsToBeClonedToJsmSites;
@@ -1265,7 +1270,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1265
1270
  }
1266
1271
  }, _callee42, this);
1267
1272
  }));
1268
- function setTeamSiteAssignmentPermission(_x65, _x66) {
1273
+ function setTeamSiteAssignmentPermission(_x66, _x67) {
1269
1274
  return _setTeamSiteAssignmentPermission.apply(this, arguments);
1270
1275
  }
1271
1276
  return setTeamSiteAssignmentPermission;
@@ -1294,7 +1299,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1294
1299
  }
1295
1300
  }, _callee43, this);
1296
1301
  }));
1297
- function getAssignedTeams(_x67, _x68, _x69, _x70) {
1302
+ function getAssignedTeams(_x68, _x69, _x70, _x71) {
1298
1303
  return _getAssignedTeams.apply(this, arguments);
1299
1304
  }
1300
1305
  return getAssignedTeams;
@@ -1323,7 +1328,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1323
1328
  }
1324
1329
  }, _callee44, this);
1325
1330
  }));
1326
- function getUnassignedTeams(_x71, _x72, _x73, _x74) {
1331
+ function getUnassignedTeams(_x72, _x73, _x74, _x75) {
1327
1332
  return _getUnassignedTeams.apply(this, arguments);
1328
1333
  }
1329
1334
  return getUnassignedTeams;
@@ -1525,7 +1530,7 @@ export var LegionClient = /*#__PURE__*/function (_RestClient) {
1525
1530
  }
1526
1531
  }, _callee46, this, [[0, 1]]);
1527
1532
  }));
1528
- function getTeamStatesInBulk(_x75, _x76) {
1533
+ function getTeamStatesInBulk(_x76, _x77) {
1529
1534
  return _getTeamStatesInBulk.apply(this, arguments);
1530
1535
  }
1531
1536
  return getTeamStatesInBulk;
@@ -2079,13 +2079,13 @@ export var TeamsClient = /*#__PURE__*/function () {
2079
2079
  }, {
2080
2080
  key: "getWriteTeamMediaToken",
2081
2081
  value: (function () {
2082
- var _getWriteTeamMediaToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58() {
2082
+ var _getWriteTeamMediaToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(teamId) {
2083
2083
  var _this53 = this;
2084
2084
  return _regeneratorRuntime.wrap(function (_context58) {
2085
2085
  while (1) switch (_context58.prev = _context58.next) {
2086
2086
  case 0:
2087
2087
  return _context58.abrupt("return", this.measurePerformance('getWriteTeamMediaToken', function () {
2088
- return _this53._legionClient.getWriteMediaToken();
2088
+ return _this53._legionClient.getWriteMediaToken(teamId);
2089
2089
  }));
2090
2090
  case 1:
2091
2091
  case "end":
@@ -2093,7 +2093,7 @@ export var TeamsClient = /*#__PURE__*/function () {
2093
2093
  }
2094
2094
  }, _callee58, this);
2095
2095
  }));
2096
- function getWriteTeamMediaToken() {
2096
+ function getWriteTeamMediaToken(_x24) {
2097
2097
  return _getWriteTeamMediaToken.apply(this, arguments);
2098
2098
  }
2099
2099
  return getWriteTeamMediaToken;
@@ -2179,7 +2179,7 @@ export var TeamsClient = /*#__PURE__*/function () {
2179
2179
  }
2180
2180
  }, _callee61, this);
2181
2181
  }));
2182
- function updateUserHeaderImage(_x24) {
2182
+ function updateUserHeaderImage(_x25) {
2183
2183
  return _updateUserHeaderImage.apply(this, arguments);
2184
2184
  }
2185
2185
  return updateUserHeaderImage;
@@ -29,7 +29,7 @@ export function getSentryConfig(options) {
29
29
  return _objectSpread(_objectSpread(_objectSpread({}, otherOptions), DEFAULT_SENTRY_CONFIG), {}, {
30
30
  // Standalone __VERSION__ is set from `bin/set-release-version.sh`
31
31
  // when building to deploy to production
32
- release: "".concat("@atlaskit/teams-client", "@").concat("5.6.0") ||
32
+ release: "".concat("@atlaskit/teams-client", "@").concat("6.1.0") ||
33
33
  // @ts-ignore Jira - window.BUILD_KEY
34
34
  window.BUILD_KEY || ( // @ts-ignore Confluence - window.__buildInfo
35
35
  (_window$__buildInfo = window.__buildInfo) === null || _window$__buildInfo === void 0 ? void 0 : _window$__buildInfo.FRONTEND_VERSION) || '---',
@@ -39,14 +39,15 @@ export var TeamsInSlackClient = /*#__PURE__*/function (_RestClient) {
39
39
  /**
40
40
  * Pre-flight auth probe for Staffy Global Edge calls (COMMIT-27483).
41
41
  * Fetches /api/authping with credentials:'include'. On failure (302→Okta),
42
- * navigates to /staffy/login?return_to=<current URL> for top-level Okta SSO.
42
+ * navigates to /staffy/login?return_to=<current URL> for top-level Okta SSO,
43
+ * or rejects without navigating when `skipAuthRedirect` is set.
43
44
  * No-op when the gate is OFF (Stargate path).
44
45
  */
45
46
  _inherits(TeamsInSlackClient, _RestClient);
46
47
  return _createClass(TeamsInSlackClient, [{
47
48
  key: "ensureStaffyAuth",
48
49
  value: (function () {
49
- var _ensureStaffyAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
50
+ var _ensureStaffyAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
50
51
  var authenticated, returnTo;
51
52
  return _regeneratorRuntime.wrap(function (_context) {
52
53
  while (1) switch (_context.prev = _context.next) {
@@ -77,12 +78,20 @@ export var TeamsInSlackClient = /*#__PURE__*/function (_RestClient) {
77
78
  staffyAuthAttempted = false;
78
79
  return _context.abrupt("return");
79
80
  case 3:
80
- if (!staffyAuthAttempted) {
81
+ if (!(options !== null && options !== void 0 && options.skipAuthRedirect)) {
81
82
  _context.next = 4;
82
83
  break;
83
84
  }
84
- return _context.abrupt("return");
85
+ throw new SLOIgnoreError({
86
+ message: 'Staffy session missing, skipping login redirect'
87
+ });
85
88
  case 4:
89
+ if (!staffyAuthAttempted) {
90
+ _context.next = 5;
91
+ break;
92
+ }
93
+ return _context.abrupt("return");
94
+ case 5:
86
95
  staffyAuthAttempted = true;
87
96
  redirectCount.increment();
88
97
  returnTo = encodeURIComponent(window.location.href);
@@ -90,13 +99,13 @@ export var TeamsInSlackClient = /*#__PURE__*/function (_RestClient) {
90
99
  throw new SLOIgnoreError({
91
100
  message: 'Redirecting to Staffy login'
92
101
  });
93
- case 5:
102
+ case 6:
94
103
  case "end":
95
104
  return _context.stop();
96
105
  }
97
106
  }, _callee);
98
107
  }));
99
- function ensureStaffyAuth() {
108
+ function ensureStaffyAuth(_x) {
100
109
  return _ensureStaffyAuth.apply(this, arguments);
101
110
  }
102
111
  return ensureStaffyAuth;
@@ -104,12 +113,12 @@ export var TeamsInSlackClient = /*#__PURE__*/function (_RestClient) {
104
113
  }, {
105
114
  key: "getTeamInSlack",
106
115
  value: function () {
107
- var _getTeamInSlack = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(teamId, teamName) {
116
+ var _getTeamInSlack = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(teamId, teamName, options) {
108
117
  return _regeneratorRuntime.wrap(function (_context2) {
109
118
  while (1) switch (_context2.prev = _context2.next) {
110
119
  case 0:
111
120
  _context2.next = 1;
112
- return this.ensureStaffyAuth();
121
+ return this.ensureStaffyAuth(options);
113
122
  case 1:
114
123
  return _context2.abrupt("return", this.getResource("/".concat(teamId, "?teamName=").concat(encodeURIComponent(teamName))).then(function (response) {
115
124
  return _objectSpread({
@@ -122,7 +131,7 @@ export var TeamsInSlackClient = /*#__PURE__*/function (_RestClient) {
122
131
  }
123
132
  }, _callee2, this);
124
133
  }));
125
- function getTeamInSlack(_x, _x2) {
134
+ function getTeamInSlack(_x2, _x3, _x4) {
126
135
  return _getTeamInSlack.apply(this, arguments);
127
136
  }
128
137
  return getTeamInSlack;
@@ -130,12 +139,12 @@ export var TeamsInSlackClient = /*#__PURE__*/function (_RestClient) {
130
139
  }, {
131
140
  key: "disconnectTeamInSlack",
132
141
  value: function () {
133
- var _disconnectTeamInSlack = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(teamId) {
142
+ var _disconnectTeamInSlack = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(teamId, options) {
134
143
  return _regeneratorRuntime.wrap(function (_context3) {
135
144
  while (1) switch (_context3.prev = _context3.next) {
136
145
  case 0:
137
146
  _context3.next = 1;
138
- return this.ensureStaffyAuth();
147
+ return this.ensureStaffyAuth(options);
139
148
  case 1:
140
149
  return _context3.abrupt("return", this.deleteResource("/".concat(teamId)).then(function (response) {
141
150
  return _objectSpread({
@@ -148,7 +157,7 @@ export var TeamsInSlackClient = /*#__PURE__*/function (_RestClient) {
148
157
  }
149
158
  }, _callee3, this);
150
159
  }));
151
- function disconnectTeamInSlack(_x3) {
160
+ function disconnectTeamInSlack(_x5, _x6) {
152
161
  return _disconnectTeamInSlack.apply(this, arguments);
153
162
  }
154
163
  return disconnectTeamInSlack;
@@ -156,12 +165,12 @@ export var TeamsInSlackClient = /*#__PURE__*/function (_RestClient) {
156
165
  }, {
157
166
  key: "updateTeamInSlack",
158
167
  value: function () {
159
- var _updateTeamInSlack = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(teamId, channelId, usergroupHandle) {
168
+ var _updateTeamInSlack = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(teamId, channelId, usergroupHandle, options) {
160
169
  return _regeneratorRuntime.wrap(function (_context4) {
161
170
  while (1) switch (_context4.prev = _context4.next) {
162
171
  case 0:
163
172
  _context4.next = 1;
164
- return this.ensureStaffyAuth();
173
+ return this.ensureStaffyAuth(options);
165
174
  case 1:
166
175
  return _context4.abrupt("return", this.postResource("/".concat(teamId, "?channel=").concat(channelId, "&groupName=").concat(usergroupHandle)).then(function (response) {
167
176
  return _objectSpread({
@@ -174,7 +183,7 @@ export var TeamsInSlackClient = /*#__PURE__*/function (_RestClient) {
174
183
  }
175
184
  }, _callee4, this);
176
185
  }));
177
- function updateTeamInSlack(_x4, _x5, _x6) {
186
+ function updateTeamInSlack(_x7, _x8, _x9, _x0) {
178
187
  return _updateTeamInSlack.apply(this, arguments);
179
188
  }
180
189
  return updateTeamInSlack;
@@ -139,7 +139,7 @@ export declare class LegionClient extends RestClient implements LegionClient {
139
139
  unlinkTeamFromGroup(teamId: string, membershipSettings: TeamMembershipSettings): Promise<void>;
140
140
  getTeamAndGroupDiff(teamId: string, externalReference: ExternalReference): Promise<LegionTeamAndGroupDifferenceResponse>;
141
141
  linkExistingTeamToGroup(teamId: string, externalReference: ExternalReference): Promise<void>;
142
- getWriteMediaToken(): Promise<ReadMediaTokenResponse>;
142
+ getWriteMediaToken(teamId?: string): Promise<ReadMediaTokenResponse>;
143
143
  getSoftDeletedTeamById(teamId: string): Promise<SoftDeletedTeam>;
144
144
  /**
145
145
  * Shoud only be used within Teams (P&T) packages
@@ -373,7 +373,7 @@ export declare class TeamsClient {
373
373
  /**
374
374
  * Get token to upload media for a team
375
375
  */
376
- getWriteTeamMediaToken(): Promise<AwaitedReturn<typeof userPreferencesClient.getReadMediaToken>>;
376
+ getWriteTeamMediaToken(teamId?: string): Promise<AwaitedReturn<typeof userPreferencesClient.getReadMediaToken>>;
377
377
  /**
378
378
  * Get token to read media for a user
379
379
  */
@@ -1,3 +1,4 @@
1
+ import { type TeamSlackRequestOptions } from '../../types/slack';
1
2
  import { RestClient } from '../rest-client';
2
3
  interface TeamInSlackResponse {
3
4
  connected: boolean;
@@ -13,12 +14,13 @@ export declare class TeamsInSlackClient extends RestClient {
13
14
  /**
14
15
  * Pre-flight auth probe for Staffy Global Edge calls (COMMIT-27483).
15
16
  * Fetches /api/authping with credentials:'include'. On failure (302→Okta),
16
- * navigates to /staffy/login?return_to=<current URL> for top-level Okta SSO.
17
+ * navigates to /staffy/login?return_to=<current URL> for top-level Okta SSO,
18
+ * or rejects without navigating when `skipAuthRedirect` is set.
17
19
  * No-op when the gate is OFF (Stargate path).
18
20
  */
19
21
  private ensureStaffyAuth;
20
- getTeamInSlack(teamId: string, teamName: string): Promise<TeamInSlackResult>;
21
- disconnectTeamInSlack(teamId: string): Promise<TeamInSlackResult>;
22
- updateTeamInSlack(teamId: string, channelId: string, usergroupHandle: string): Promise<TeamInSlackResult>;
22
+ getTeamInSlack(teamId: string, teamName: string, options?: TeamSlackRequestOptions): Promise<TeamInSlackResult>;
23
+ disconnectTeamInSlack(teamId: string, options?: TeamSlackRequestOptions): Promise<TeamInSlackResult>;
24
+ updateTeamInSlack(teamId: string, channelId: string, usergroupHandle: string, options?: TeamSlackRequestOptions): Promise<TeamInSlackResult>;
23
25
  }
24
26
  export {};
@@ -5,3 +5,6 @@ export interface TeamInSlack {
5
5
  slackChannelName: string;
6
6
  usergroupHandle: string;
7
7
  }
8
+ export interface TeamSlackRequestOptions {
9
+ skipAuthRedirect?: boolean;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/teams-client",
3
- "version": "6.0.0",
3
+ "version": "6.2.0",
4
4
  "description": "A client to retrieve team related data",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -25,9 +25,9 @@
25
25
  "sideEffects": false,
26
26
  "atlaskit:src": "src/index.ts",
27
27
  "scripts": {
28
- "generate:types:public-api": "yarn swagger-typescript-api -p ./src/services/public-api-client/swagger.json -o ./src/services/public-api-client/generated/ --modular --no-client --union-enums",
28
+ "generate:types:public-api": "swagger-typescript-api -p ./src/services/public-api-client/swagger.json -o ./src/services/public-api-client/generated/ --modular --no-client --union-enums",
29
29
  "generate:docs:teams-client": "ts-node --project ../../../tsconfig.node.json ./scripts/generate-docs.ts && yarn ../../.. prettier --write packages/people-and-teams/teams-client/docs",
30
- "test:coverage": "(cd ../../.. && yarn test 'packages/people-and-teams/teams-client/src' --coverage --coverageProvider=v8 --collectCoverageFrom='[\"packages/people-and-teams/teams-client/src/**\", \"!packages/people-and-teams/teams-client/src/**/**/types.ts\", \"!packages/people-and-teams/teams-client/src/ui/**/styled.tsx\"]')"
30
+ "test:coverage": "(cd ../../.. && afm run test -- 'packages/people-and-teams/teams-client/src' --coverage --coverageProvider=v8 --collectCoverageFrom='[\"packages/people-and-teams/teams-client/src/**\", \"!packages/people-and-teams/teams-client/src/**/**/types.ts\", \"!packages/people-and-teams/teams-client/src/ui/**/styled.tsx\"]')"
31
31
  },
32
32
  "dependencies": {
33
33
  "@atlaskit/atlassian-context": "^2.0.0",
@@ -48,7 +48,8 @@
48
48
  "devDependencies": {
49
49
  "@atlaskit/feature-gate-js-client": "^7.0.0",
50
50
  "@atlassian/codegen": "^0.3.0",
51
- "@atlassian/ptc-test-utils": "^0.15.0",
51
+ "@atlassian/feature-flags-test-utils": "^1.3.0",
52
+ "@atlassian/ptc-test-utils": "^0.16.0",
52
53
  "@testing-library/react": "^16.3.0",
53
54
  "@types/faker": "^4.1.8",
54
55
  "react": "^19.2.0",
@@ -62,6 +63,9 @@
62
63
  "enable_edit_team_name_external_type_teams": {
63
64
  "type": "boolean"
64
65
  },
66
+ "ptc-enable-team-scoped-header-image-media-upload": {
67
+ "type": "boolean"
68
+ },
65
69
  "ptc-enable-team-type-permission-enabled": {
66
70
  "type": "boolean"
67
71
  },
@@ -1,7 +1,7 @@
1
1
  import { writeFileSync } from 'fs';
2
2
  import { join } from 'path';
3
3
 
4
- import { createSignedArtifact } from '@atlassian/codegen';
4
+ import { createSignedArtifact } from '@atlassian/codegen/signed-artifact';
5
5
 
6
6
  import { parseFile } from './parse-file';
7
7
  import { toMarkdown } from './to-markdown';