@atlaskit/teams-client 6.1.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 +10 -0
- package/dist/cjs/common/utils/ufo/index.js +2 -2
- package/dist/cjs/services/legion-client/index.js +2 -0
- package/dist/cjs/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/cjs/services/teams-in-slack-client/TeamsInSlackClient.js +24 -15
- package/dist/es2019/common/utils/ufo/index.js +2 -2
- package/dist/es2019/services/legion-client/index.js +2 -0
- package/dist/es2019/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/es2019/services/teams-in-slack-client/TeamsInSlackClient.js +14 -8
- package/dist/esm/common/utils/ufo/index.js +2 -2
- package/dist/esm/services/legion-client/index.js +2 -0
- package/dist/esm/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/esm/services/teams-in-slack-client/TeamsInSlackClient.js +24 -15
- package/dist/types/services/teams-in-slack-client/TeamsInSlackClient.d.ts +6 -4
- package/dist/types/types/slack.d.ts +3 -0
- package/package.json +5 -4
- package/scripts/generate-docs.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
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
|
+
|
|
3
13
|
## 6.1.0
|
|
4
14
|
|
|
5
15
|
### Minor 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: "6.
|
|
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: "6.
|
|
67
|
+
packageVersion: "6.1.0",
|
|
68
68
|
packageName: "@atlaskit/teams-client"
|
|
69
69
|
}
|
|
70
70
|
}]);
|
|
@@ -52,6 +52,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
52
52
|
* @property {string} cursor - Cursor to fetch the next page of results
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
|
+
// oxlint-disable-next-line eslint/no-redeclare
|
|
56
|
+
|
|
55
57
|
var v3UrlPath = "/v3/teams";
|
|
56
58
|
var v4UrlPath = "/v4/teams";
|
|
57
59
|
|
|
@@ -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("6.
|
|
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 (!
|
|
88
|
+
if (!(options !== null && options !== void 0 && options.skipAuthRedirect)) {
|
|
88
89
|
_context.next = 4;
|
|
89
90
|
break;
|
|
90
91
|
}
|
|
91
|
-
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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: "6.
|
|
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: "6.
|
|
42
|
+
packageVersion: "6.1.0",
|
|
43
43
|
packageName: "@atlaskit/teams-client"
|
|
44
44
|
}
|
|
45
45
|
});
|
|
@@ -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"}@${"6.
|
|
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: "6.
|
|
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: "6.
|
|
60
|
+
packageVersion: "6.1.0",
|
|
61
61
|
packageName: "@atlaskit/teams-client"
|
|
62
62
|
}
|
|
63
63
|
}]);
|
|
@@ -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("6.
|
|
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 (!
|
|
81
|
+
if (!(options !== null && options !== void 0 && options.skipAuthRedirect)) {
|
|
81
82
|
_context.next = 4;
|
|
82
83
|
break;
|
|
83
84
|
}
|
|
84
|
-
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
186
|
+
function updateTeamInSlack(_x7, _x8, _x9, _x0) {
|
|
178
187
|
return _updateTeamInSlack.apply(this, arguments);
|
|
179
188
|
}
|
|
180
189
|
return updateTeamInSlack;
|
|
@@ -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 {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/teams-client",
|
|
3
|
-
"version": "6.
|
|
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": "
|
|
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 ../../.. &&
|
|
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/
|
|
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",
|
package/scripts/generate-docs.ts
CHANGED
|
@@ -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';
|