@atlaskit/teams-client 4.33.0 → 4.33.1
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 +8 -0
- package/dist/cjs/common/utils/http.js +8 -8
- package/dist/cjs/common/utils/permissions/has-permission.js +4 -0
- package/dist/cjs/common/utils/ufo/index.js +2 -2
- package/dist/cjs/services/agg-client/index.js +28 -28
- package/dist/cjs/services/directory-client/index.js +38 -36
- package/dist/cjs/services/graphql-client/main.js +13 -12
- package/dist/cjs/services/graphql-client/utils/index.js +32 -31
- package/dist/cjs/services/identity-client/index.js +10 -10
- package/dist/cjs/services/invitations-client/index.js +40 -38
- package/dist/cjs/services/legion-client/index.js +163 -162
- package/dist/cjs/services/main.js +162 -162
- package/dist/cjs/services/mutability-client/index.js +1 -1
- package/dist/cjs/services/object-resolver-client/index.js +18 -18
- package/dist/cjs/services/public-api-client/index.js +69 -68
- package/dist/cjs/services/replines-client/index.js +2 -2
- package/dist/cjs/services/reporting-lines-client/index.js +4 -4
- package/dist/cjs/services/rest-client/index.js +28 -28
- package/dist/cjs/services/rest-client/utils/parse-error-message.js +18 -18
- package/dist/cjs/services/sentry/main.js +23 -22
- package/dist/cjs/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/cjs/services/sentry/utils/initialise-sentry.js +6 -6
- package/dist/cjs/services/sentry/utils/sentry-client.js +20 -19
- package/dist/cjs/services/sentry/utils/use-teams-sentry-client-setup.js +4 -4
- package/dist/cjs/services/team-central-client/index.js +36 -36
- package/dist/cjs/services/teams-in-slack-client/index.js +3 -3
- package/dist/cjs/services/use-query-light/main.js +38 -38
- package/dist/cjs/services/user-preferences-client/index.js +6 -6
- package/dist/es2019/common/utils/permissions/has-permission.js +4 -0
- package/dist/es2019/common/utils/ufo/index.js +2 -2
- package/dist/es2019/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/esm/common/utils/http.js +8 -8
- package/dist/esm/common/utils/permissions/has-permission.js +4 -0
- package/dist/esm/common/utils/ufo/index.js +2 -2
- package/dist/esm/services/agg-client/index.js +28 -28
- package/dist/esm/services/directory-client/index.js +38 -36
- package/dist/esm/services/graphql-client/main.js +13 -12
- package/dist/esm/services/graphql-client/utils/index.js +32 -31
- package/dist/esm/services/identity-client/index.js +10 -10
- package/dist/esm/services/invitations-client/index.js +40 -38
- package/dist/esm/services/legion-client/index.js +163 -162
- package/dist/esm/services/main.js +162 -162
- package/dist/esm/services/mutability-client/index.js +1 -1
- package/dist/esm/services/object-resolver-client/index.js +18 -18
- package/dist/esm/services/public-api-client/index.js +69 -68
- package/dist/esm/services/replines-client/index.js +2 -2
- package/dist/esm/services/reporting-lines-client/index.js +4 -4
- package/dist/esm/services/rest-client/index.js +28 -28
- package/dist/esm/services/rest-client/utils/parse-error-message.js +18 -18
- package/dist/esm/services/sentry/main.js +23 -22
- package/dist/esm/services/sentry/utils/get-sentry-config.js +1 -1
- package/dist/esm/services/sentry/utils/initialise-sentry.js +6 -6
- package/dist/esm/services/sentry/utils/sentry-client.js +19 -18
- package/dist/esm/services/sentry/utils/use-teams-sentry-client-setup.js +4 -4
- package/dist/esm/services/team-central-client/index.js +36 -36
- package/dist/esm/services/teams-in-slack-client/index.js +3 -3
- package/dist/esm/services/use-query-light/main.js +38 -38
- package/dist/esm/services/user-preferences-client/index.js +6 -6
- package/dist/types/common/utils/permissions/has-permission.d.ts +4 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types-ts4.5/common/utils/permissions/has-permission.d.ts +4 -0
- package/dist/types-ts4.5/types/index.d.ts +1 -1
- package/package.json +2 -1
|
@@ -33,7 +33,7 @@ export var MutabilityClient = /*#__PURE__*/function (_RestClient) {
|
|
|
33
33
|
key: "getProfileWithMutability",
|
|
34
34
|
value: function () {
|
|
35
35
|
var _getProfileWithMutability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(userId) {
|
|
36
|
-
return _regeneratorRuntime.wrap(function
|
|
36
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
37
37
|
while (1) switch (_context.prev = _context.next) {
|
|
38
38
|
case 0:
|
|
39
39
|
return _context.abrupt("return", this.getResource("/".concat(userId, "/profile")).then(function (resp) {
|
|
@@ -28,7 +28,7 @@ export var ObjectResolverClient = /*#__PURE__*/function (_RestClient) {
|
|
|
28
28
|
value: function () {
|
|
29
29
|
var _getTeamLinkIcons = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(teamLinkUrls) {
|
|
30
30
|
var requestBody;
|
|
31
|
-
return _regeneratorRuntime.wrap(function
|
|
31
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
32
32
|
while (1) switch (_context.prev = _context.next) {
|
|
33
33
|
case 0:
|
|
34
34
|
requestBody = teamLinkUrls.map(function (url) {
|
|
@@ -37,7 +37,7 @@ export var ObjectResolverClient = /*#__PURE__*/function (_RestClient) {
|
|
|
37
37
|
};
|
|
38
38
|
});
|
|
39
39
|
return _context.abrupt("return", this.postResourceRaw("/object-resolver/resolve/batch", JSON.stringify(requestBody)).then(transformIconData));
|
|
40
|
-
case
|
|
40
|
+
case 1:
|
|
41
41
|
case "end":
|
|
42
42
|
return _context.stop();
|
|
43
43
|
}
|
|
@@ -52,7 +52,7 @@ export var ObjectResolverClient = /*#__PURE__*/function (_RestClient) {
|
|
|
52
52
|
key: "getAriFromUrl",
|
|
53
53
|
value: function () {
|
|
54
54
|
var _getAriFromUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(url) {
|
|
55
|
-
return _regeneratorRuntime.wrap(function
|
|
55
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
56
56
|
while (1) switch (_context2.prev = _context2.next) {
|
|
57
57
|
case 0:
|
|
58
58
|
return _context2.abrupt("return", this.postResourceRaw("/object-resolver/converter/toAri", JSON.stringify({
|
|
@@ -76,48 +76,48 @@ export var ObjectResolverClient = /*#__PURE__*/function (_RestClient) {
|
|
|
76
76
|
key: "getWebLinkTitle",
|
|
77
77
|
value: function () {
|
|
78
78
|
var _getWebLinkTitle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(webLinkUrl) {
|
|
79
|
-
var _response$meta, _response$meta2, response, _response$data2, _response$meta$auth, auth;
|
|
80
|
-
return _regeneratorRuntime.wrap(function
|
|
79
|
+
var _response$meta, _response$meta2, response, _response$data2, _response$meta$auth, auth, _t;
|
|
80
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
81
81
|
while (1) switch (_context3.prev = _context3.next) {
|
|
82
82
|
case 0:
|
|
83
83
|
_context3.prev = 0;
|
|
84
|
-
_context3.next =
|
|
84
|
+
_context3.next = 1;
|
|
85
85
|
return this.postResourceRaw('/object-resolver/resolve', JSON.stringify({
|
|
86
86
|
resourceUrl: webLinkUrl
|
|
87
87
|
}));
|
|
88
|
-
case
|
|
88
|
+
case 1:
|
|
89
89
|
response = _context3.sent;
|
|
90
90
|
if (!(response && 'data' in response)) {
|
|
91
|
-
_context3.next =
|
|
91
|
+
_context3.next = 2;
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
94
|
if (!((_response$data2 = response.data) !== null && _response$data2 !== void 0 && _response$data2.name)) {
|
|
95
|
-
_context3.next =
|
|
95
|
+
_context3.next = 2;
|
|
96
96
|
break;
|
|
97
97
|
}
|
|
98
98
|
return _context3.abrupt("return", response.data.name);
|
|
99
|
-
case
|
|
99
|
+
case 2:
|
|
100
100
|
if (!(response && 'meta' in response && (((_response$meta = response.meta) === null || _response$meta === void 0 ? void 0 : _response$meta.visibility) === 'restricted' || ((_response$meta2 = response.meta) === null || _response$meta2 === void 0 ? void 0 : _response$meta2.visibility) === 'unauthorized'))) {
|
|
101
|
-
_context3.next =
|
|
101
|
+
_context3.next = 3;
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
104
|
auth = (_response$meta$auth = response.meta.auth) === null || _response$meta$auth === void 0 ? void 0 : _response$meta$auth[0];
|
|
105
105
|
if (!(auth !== null && auth !== void 0 && auth.displayName)) {
|
|
106
|
-
_context3.next =
|
|
106
|
+
_context3.next = 3;
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
return _context3.abrupt("return", auth.displayName);
|
|
110
|
-
case
|
|
110
|
+
case 3:
|
|
111
111
|
return _context3.abrupt("return");
|
|
112
|
-
case
|
|
113
|
-
_context3.prev =
|
|
114
|
-
|
|
112
|
+
case 4:
|
|
113
|
+
_context3.prev = 4;
|
|
114
|
+
_t = _context3["catch"](0);
|
|
115
115
|
return _context3.abrupt("return");
|
|
116
|
-
case
|
|
116
|
+
case 5:
|
|
117
117
|
case "end":
|
|
118
118
|
return _context3.stop();
|
|
119
119
|
}
|
|
120
|
-
}, _callee3, this, [[0,
|
|
120
|
+
}, _callee3, this, [[0, 4]]);
|
|
121
121
|
}));
|
|
122
122
|
function getWebLinkTitle(_x3) {
|
|
123
123
|
return _getWebLinkTitle.apply(this, arguments);
|
|
@@ -37,18 +37,18 @@ export var PublicApiClient = /*#__PURE__*/function (_RestClient) {
|
|
|
37
37
|
key: "addUsersToTeam",
|
|
38
38
|
value: function () {
|
|
39
39
|
var _addUsersToTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(teamId, members) {
|
|
40
|
-
var missingMembersError, membersWithIds, _missingMembersError, orgId, url, response;
|
|
41
|
-
return _regeneratorRuntime.wrap(function
|
|
40
|
+
var missingMembersError, membersWithIds, _missingMembersError, orgId, url, response, _t;
|
|
41
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
42
42
|
while (1) switch (_context.prev = _context.next) {
|
|
43
43
|
case 0:
|
|
44
44
|
if (!(!members || members.length === 0)) {
|
|
45
|
-
_context.next =
|
|
45
|
+
_context.next = 1;
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
48
|
missingMembersError = new Error('Missing members to add');
|
|
49
49
|
this.logException(missingMembersError, 'addUsersToTeam');
|
|
50
50
|
throw missingMembersError;
|
|
51
|
-
case
|
|
51
|
+
case 1:
|
|
52
52
|
membersWithIds = members.filter(function (member) {
|
|
53
53
|
return !!member.accountId;
|
|
54
54
|
});
|
|
@@ -56,39 +56,39 @@ export var PublicApiClient = /*#__PURE__*/function (_RestClient) {
|
|
|
56
56
|
this.logException(new Error('Missing accountIds for some members'), 'addUsersToTeam');
|
|
57
57
|
}
|
|
58
58
|
if (!(membersWithIds.length === 0)) {
|
|
59
|
-
_context.next =
|
|
59
|
+
_context.next = 2;
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
62
62
|
_missingMembersError = new Error('Missing accountIds for all members');
|
|
63
63
|
this.logException(_missingMembersError, 'addUsersToTeam');
|
|
64
64
|
throw _missingMembersError;
|
|
65
|
-
case
|
|
66
|
-
_context.prev =
|
|
65
|
+
case 2:
|
|
66
|
+
_context.prev = 2;
|
|
67
67
|
orgId = this.getOrgId();
|
|
68
68
|
url = "".concat(V1_URL, "/org/").concat(orgId, "/teams/").concat(teamId, "/members/add");
|
|
69
|
-
_context.next =
|
|
69
|
+
_context.next = 3;
|
|
70
70
|
return this.postResource(url, {
|
|
71
71
|
members: membersWithIds
|
|
72
72
|
});
|
|
73
|
-
case
|
|
73
|
+
case 3:
|
|
74
74
|
response = _context.sent;
|
|
75
75
|
return _context.abrupt("return", response);
|
|
76
|
-
case
|
|
77
|
-
_context.prev =
|
|
78
|
-
|
|
79
|
-
this.logException(
|
|
80
|
-
if (!(
|
|
81
|
-
_context.next =
|
|
76
|
+
case 4:
|
|
77
|
+
_context.prev = 4;
|
|
78
|
+
_t = _context["catch"](2);
|
|
79
|
+
this.logException(_t, 'addUsersToTeam');
|
|
80
|
+
if (!(_t instanceof HttpError && SENTRY_IGNORED_ERROR_MESSAGES_CREATE.includes(_t.message))) {
|
|
81
|
+
_context.next = 5;
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
|
-
throw new SLOIgnoreHttpError(
|
|
85
|
-
case
|
|
86
|
-
throw
|
|
87
|
-
case
|
|
84
|
+
throw new SLOIgnoreHttpError(_t);
|
|
85
|
+
case 5:
|
|
86
|
+
throw _t;
|
|
87
|
+
case 6:
|
|
88
88
|
case "end":
|
|
89
89
|
return _context.stop();
|
|
90
90
|
}
|
|
91
|
-
}, _callee, this, [[
|
|
91
|
+
}, _callee, this, [[2, 4]]);
|
|
92
92
|
}));
|
|
93
93
|
function addUsersToTeam(_x, _x2) {
|
|
94
94
|
return _addUsersToTeam.apply(this, arguments);
|
|
@@ -99,18 +99,18 @@ export var PublicApiClient = /*#__PURE__*/function (_RestClient) {
|
|
|
99
99
|
key: "removeTeamMemberships",
|
|
100
100
|
value: function () {
|
|
101
101
|
var _removeTeamMemberships = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(teamId, members) {
|
|
102
|
-
var missingMembersError, membersWithIds, _missingMembersError2, orgId, url, response;
|
|
103
|
-
return _regeneratorRuntime.wrap(function
|
|
102
|
+
var missingMembersError, membersWithIds, _missingMembersError2, orgId, url, response, _t2;
|
|
103
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
104
104
|
while (1) switch (_context2.prev = _context2.next) {
|
|
105
105
|
case 0:
|
|
106
106
|
if (!(!members || members.length === 0)) {
|
|
107
|
-
_context2.next =
|
|
107
|
+
_context2.next = 1;
|
|
108
108
|
break;
|
|
109
109
|
}
|
|
110
110
|
missingMembersError = new Error('Missing members to remove');
|
|
111
111
|
this.logException(missingMembersError, 'removeTeamMemberships');
|
|
112
112
|
throw missingMembersError;
|
|
113
|
-
case
|
|
113
|
+
case 1:
|
|
114
114
|
membersWithIds = members.filter(function (member) {
|
|
115
115
|
return !!member.accountId;
|
|
116
116
|
});
|
|
@@ -118,33 +118,33 @@ export var PublicApiClient = /*#__PURE__*/function (_RestClient) {
|
|
|
118
118
|
this.logException(new Error('Missing accountIds for some members'), 'addUsersToTeam');
|
|
119
119
|
}
|
|
120
120
|
if (!(membersWithIds.length === 0)) {
|
|
121
|
-
_context2.next =
|
|
121
|
+
_context2.next = 2;
|
|
122
122
|
break;
|
|
123
123
|
}
|
|
124
124
|
_missingMembersError2 = new Error('Missing accountIds for all members');
|
|
125
125
|
this.logException(_missingMembersError2, 'removeTeamMemberships');
|
|
126
126
|
throw _missingMembersError2;
|
|
127
|
-
case
|
|
128
|
-
_context2.prev =
|
|
127
|
+
case 2:
|
|
128
|
+
_context2.prev = 2;
|
|
129
129
|
orgId = this.getOrgId();
|
|
130
130
|
url = "".concat(V1_URL, "/org/").concat(orgId, "/teams/").concat(teamId, "/members/remove");
|
|
131
|
-
_context2.next =
|
|
131
|
+
_context2.next = 3;
|
|
132
132
|
return this.postResource(url, {
|
|
133
133
|
members: membersWithIds
|
|
134
134
|
});
|
|
135
|
-
case
|
|
135
|
+
case 3:
|
|
136
136
|
response = _context2.sent;
|
|
137
137
|
return _context2.abrupt("return", response);
|
|
138
|
-
case
|
|
139
|
-
_context2.prev =
|
|
140
|
-
|
|
141
|
-
this.logException(
|
|
142
|
-
throw
|
|
143
|
-
case
|
|
138
|
+
case 4:
|
|
139
|
+
_context2.prev = 4;
|
|
140
|
+
_t2 = _context2["catch"](2);
|
|
141
|
+
this.logException(_t2, 'removeTeamMemberships');
|
|
142
|
+
throw _t2;
|
|
143
|
+
case 5:
|
|
144
144
|
case "end":
|
|
145
145
|
return _context2.stop();
|
|
146
146
|
}
|
|
147
|
-
}, _callee2, this, [[
|
|
147
|
+
}, _callee2, this, [[2, 4]]);
|
|
148
148
|
}));
|
|
149
149
|
function removeTeamMemberships(_x3, _x4) {
|
|
150
150
|
return _removeTeamMemberships.apply(this, arguments);
|
|
@@ -155,28 +155,28 @@ export var PublicApiClient = /*#__PURE__*/function (_RestClient) {
|
|
|
155
155
|
key: "getTeamDetails",
|
|
156
156
|
value: function () {
|
|
157
157
|
var _getTeamDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(teamId) {
|
|
158
|
-
var orgId, url, response;
|
|
159
|
-
return _regeneratorRuntime.wrap(function
|
|
158
|
+
var orgId, url, response, _t3;
|
|
159
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
160
160
|
while (1) switch (_context3.prev = _context3.next) {
|
|
161
161
|
case 0:
|
|
162
162
|
_context3.prev = 0;
|
|
163
163
|
orgId = this.getOrgId();
|
|
164
164
|
url = "".concat(V1_URL, "/org/").concat(orgId, "/teams/").concat(teamId);
|
|
165
|
-
_context3.next =
|
|
165
|
+
_context3.next = 1;
|
|
166
166
|
return this.getResource(url);
|
|
167
|
-
case
|
|
167
|
+
case 1:
|
|
168
168
|
response = _context3.sent;
|
|
169
169
|
return _context3.abrupt("return", response);
|
|
170
|
-
case
|
|
171
|
-
_context3.prev =
|
|
172
|
-
|
|
173
|
-
this.logException(
|
|
174
|
-
throw
|
|
175
|
-
case
|
|
170
|
+
case 2:
|
|
171
|
+
_context3.prev = 2;
|
|
172
|
+
_t3 = _context3["catch"](0);
|
|
173
|
+
this.logException(_t3, 'getTeamDetails');
|
|
174
|
+
throw _t3;
|
|
175
|
+
case 3:
|
|
176
176
|
case "end":
|
|
177
177
|
return _context3.stop();
|
|
178
178
|
}
|
|
179
|
-
}, _callee3, this, [[0,
|
|
179
|
+
}, _callee3, this, [[0, 2]]);
|
|
180
180
|
}));
|
|
181
181
|
function getTeamDetails(_x5) {
|
|
182
182
|
return _getTeamDetails.apply(this, arguments);
|
|
@@ -192,33 +192,34 @@ export var PublicApiClient = /*#__PURE__*/function (_RestClient) {
|
|
|
192
192
|
orgId,
|
|
193
193
|
url,
|
|
194
194
|
response,
|
|
195
|
-
_args4 = arguments
|
|
196
|
-
|
|
195
|
+
_args4 = arguments,
|
|
196
|
+
_t4;
|
|
197
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
197
198
|
while (1) switch (_context4.prev = _context4.next) {
|
|
198
199
|
case 0:
|
|
199
200
|
first = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : 50;
|
|
200
201
|
after = _args4.length > 2 ? _args4[2] : undefined;
|
|
201
|
-
_context4.prev =
|
|
202
|
+
_context4.prev = 1;
|
|
202
203
|
orgId = this.getOrgId();
|
|
203
204
|
url = "".concat(V1_URL, "/org/").concat(orgId, "/teams/").concat(teamId, "/members");
|
|
204
|
-
_context4.next =
|
|
205
|
+
_context4.next = 2;
|
|
205
206
|
return this.postResource(url, {
|
|
206
207
|
after: after,
|
|
207
208
|
first: first
|
|
208
209
|
});
|
|
209
|
-
case
|
|
210
|
+
case 2:
|
|
210
211
|
response = _context4.sent;
|
|
211
212
|
return _context4.abrupt("return", response);
|
|
212
|
-
case
|
|
213
|
-
_context4.prev =
|
|
214
|
-
|
|
215
|
-
this.logException(
|
|
216
|
-
throw
|
|
217
|
-
case
|
|
213
|
+
case 3:
|
|
214
|
+
_context4.prev = 3;
|
|
215
|
+
_t4 = _context4["catch"](1);
|
|
216
|
+
this.logException(_t4, 'getTeamMembers');
|
|
217
|
+
throw _t4;
|
|
218
|
+
case 4:
|
|
218
219
|
case "end":
|
|
219
220
|
return _context4.stop();
|
|
220
221
|
}
|
|
221
|
-
}, _callee4, this, [[
|
|
222
|
+
}, _callee4, this, [[1, 3]]);
|
|
222
223
|
}));
|
|
223
224
|
function getTeamMembers(_x6) {
|
|
224
225
|
return _getTeamMembers.apply(this, arguments);
|
|
@@ -229,24 +230,24 @@ export var PublicApiClient = /*#__PURE__*/function (_RestClient) {
|
|
|
229
230
|
key: "restoreTeam",
|
|
230
231
|
value: function () {
|
|
231
232
|
var _restoreTeam = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(teamId) {
|
|
232
|
-
var orgId, url;
|
|
233
|
-
return _regeneratorRuntime.wrap(function
|
|
233
|
+
var orgId, url, _t5;
|
|
234
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
234
235
|
while (1) switch (_context5.prev = _context5.next) {
|
|
235
236
|
case 0:
|
|
236
237
|
_context5.prev = 0;
|
|
237
238
|
orgId = this.getOrgId();
|
|
238
239
|
url = "".concat(V1_URL, "/org/").concat(orgId, "/teams/").concat(teamId, "/restore");
|
|
239
240
|
return _context5.abrupt("return", this.postResource(url));
|
|
240
|
-
case
|
|
241
|
-
_context5.prev =
|
|
242
|
-
|
|
243
|
-
this.logException(
|
|
244
|
-
throw
|
|
245
|
-
case
|
|
241
|
+
case 1:
|
|
242
|
+
_context5.prev = 1;
|
|
243
|
+
_t5 = _context5["catch"](0);
|
|
244
|
+
this.logException(_t5, 'restoreTeam');
|
|
245
|
+
throw _t5;
|
|
246
|
+
case 2:
|
|
246
247
|
case "end":
|
|
247
248
|
return _context5.stop();
|
|
248
249
|
}
|
|
249
|
-
}, _callee5, this, [[0,
|
|
250
|
+
}, _callee5, this, [[0, 1]]);
|
|
250
251
|
}));
|
|
251
252
|
function restoreTeam(_x7) {
|
|
252
253
|
return _restoreTeam.apply(this, arguments);
|
|
@@ -27,7 +27,7 @@ export var ReplinesClient = /*#__PURE__*/function (_RestClient) {
|
|
|
27
27
|
value: function () {
|
|
28
28
|
var _getUserTenure = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(userId) {
|
|
29
29
|
var orgId;
|
|
30
|
-
return _regeneratorRuntime.wrap(function
|
|
30
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
31
31
|
while (1) switch (_context.prev = _context.next) {
|
|
32
32
|
case 0:
|
|
33
33
|
orgId = this.getOrgId();
|
|
@@ -38,7 +38,7 @@ export var ReplinesClient = /*#__PURE__*/function (_RestClient) {
|
|
|
38
38
|
}).catch(function (_error) {
|
|
39
39
|
throw new Error('Failed to fetch user tenure');
|
|
40
40
|
}));
|
|
41
|
-
case
|
|
41
|
+
case 1:
|
|
42
42
|
case "end":
|
|
43
43
|
return _context.stop();
|
|
44
44
|
}
|
|
@@ -23,10 +23,10 @@ export var ReportingLinesClient = /*#__PURE__*/function (_BaseGraphQlClient) {
|
|
|
23
23
|
value: function () {
|
|
24
24
|
var _getReportingLines = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(userId) {
|
|
25
25
|
var response;
|
|
26
|
-
return _regeneratorRuntime.wrap(function
|
|
26
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
27
27
|
while (1) switch (_context.prev = _context.next) {
|
|
28
28
|
case 0:
|
|
29
|
-
_context.next =
|
|
29
|
+
_context.next = 1;
|
|
30
30
|
return this.makeGraphQLRequest({
|
|
31
31
|
query: ReportingLinesQueryWithAccountStatus,
|
|
32
32
|
variables: {
|
|
@@ -35,10 +35,10 @@ export var ReportingLinesClient = /*#__PURE__*/function (_BaseGraphQlClient) {
|
|
|
35
35
|
}, {
|
|
36
36
|
operationName: 'ReportingLines'
|
|
37
37
|
});
|
|
38
|
-
case
|
|
38
|
+
case 1:
|
|
39
39
|
response = _context.sent;
|
|
40
40
|
return _context.abrupt("return", response);
|
|
41
|
-
case
|
|
41
|
+
case 2:
|
|
42
42
|
case "end":
|
|
43
43
|
return _context.stop();
|
|
44
44
|
}
|
|
@@ -83,12 +83,12 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
83
83
|
var _getResource = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(path) {
|
|
84
84
|
var fetchOptions,
|
|
85
85
|
_args = arguments;
|
|
86
|
-
return _regeneratorRuntime.wrap(function
|
|
86
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
87
87
|
while (1) switch (_context.prev = _context.next) {
|
|
88
88
|
case 0:
|
|
89
89
|
fetchOptions = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
90
90
|
return _context.abrupt("return", this.makeRequest(path, fetchOptions));
|
|
91
|
-
case
|
|
91
|
+
case 1:
|
|
92
92
|
case "end":
|
|
93
93
|
return _context.stop();
|
|
94
94
|
}
|
|
@@ -109,7 +109,7 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
109
109
|
cacheRecord,
|
|
110
110
|
response,
|
|
111
111
|
_args2 = arguments;
|
|
112
|
-
return _regeneratorRuntime.wrap(function
|
|
112
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
113
113
|
while (1) switch (_context2.prev = _context2.next) {
|
|
114
114
|
case 0:
|
|
115
115
|
fetchOptions = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
|
@@ -117,18 +117,18 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
117
117
|
cacheKey = path;
|
|
118
118
|
cacheRecord = this.getCachedValue(cacheKey);
|
|
119
119
|
if (!cacheRecord) {
|
|
120
|
-
_context2.next =
|
|
120
|
+
_context2.next = 1;
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
return _context2.abrupt("return", cacheRecord);
|
|
124
|
-
case
|
|
125
|
-
_context2.next =
|
|
124
|
+
case 1:
|
|
125
|
+
_context2.next = 2;
|
|
126
126
|
return this.getResource(path, fetchOptions);
|
|
127
|
-
case
|
|
127
|
+
case 2:
|
|
128
128
|
response = _context2.sent;
|
|
129
129
|
this.cacheValue(cacheKey, response, cacheOptions === null || cacheOptions === void 0 ? void 0 : cacheOptions.expiration);
|
|
130
130
|
return _context2.abrupt("return", response);
|
|
131
|
-
case
|
|
131
|
+
case 3:
|
|
132
132
|
case "end":
|
|
133
133
|
return _context2.stop();
|
|
134
134
|
}
|
|
@@ -145,12 +145,12 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
145
145
|
var _postResource = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(path, data) {
|
|
146
146
|
var fetchOptions,
|
|
147
147
|
_args3 = arguments;
|
|
148
|
-
return _regeneratorRuntime.wrap(function
|
|
148
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
149
149
|
while (1) switch (_context3.prev = _context3.next) {
|
|
150
150
|
case 0:
|
|
151
151
|
fetchOptions = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {};
|
|
152
152
|
return _context3.abrupt("return", this.postResourceRaw(path, JSON.stringify(data), fetchOptions));
|
|
153
|
-
case
|
|
153
|
+
case 1:
|
|
154
154
|
case "end":
|
|
155
155
|
return _context3.stop();
|
|
156
156
|
}
|
|
@@ -167,7 +167,7 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
167
167
|
var _postResourceRaw = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(path, data) {
|
|
168
168
|
var fetchOptions,
|
|
169
169
|
_args4 = arguments;
|
|
170
|
-
return _regeneratorRuntime.wrap(function
|
|
170
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
171
171
|
while (1) switch (_context4.prev = _context4.next) {
|
|
172
172
|
case 0:
|
|
173
173
|
fetchOptions = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
|
|
@@ -185,7 +185,7 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
return _context4.abrupt("return", this.makeRequest(path, fetchOptions));
|
|
188
|
-
case
|
|
188
|
+
case 1:
|
|
189
189
|
case "end":
|
|
190
190
|
return _context4.stop();
|
|
191
191
|
}
|
|
@@ -201,7 +201,7 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
201
201
|
value: function () {
|
|
202
202
|
var _patchResource = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(path, data) {
|
|
203
203
|
var fetchOptions;
|
|
204
|
-
return _regeneratorRuntime.wrap(function
|
|
204
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
205
205
|
while (1) switch (_context5.prev = _context5.next) {
|
|
206
206
|
case 0:
|
|
207
207
|
fetchOptions = {
|
|
@@ -224,7 +224,7 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
return _context5.abrupt("return", this.makeRequest(path, fetchOptions));
|
|
227
|
-
case
|
|
227
|
+
case 1:
|
|
228
228
|
case "end":
|
|
229
229
|
return _context5.stop();
|
|
230
230
|
}
|
|
@@ -242,7 +242,7 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
242
242
|
var additionalFetchOptions,
|
|
243
243
|
fetchOptions,
|
|
244
244
|
_args6 = arguments;
|
|
245
|
-
return _regeneratorRuntime.wrap(function
|
|
245
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
246
246
|
while (1) switch (_context6.prev = _context6.next) {
|
|
247
247
|
case 0:
|
|
248
248
|
additionalFetchOptions = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
|
|
@@ -258,7 +258,7 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
return _context6.abrupt("return", this.makeRequest(path, _objectSpread(_objectSpread({}, fetchOptions), additionalFetchOptions)));
|
|
261
|
-
case
|
|
261
|
+
case 1:
|
|
262
262
|
case "end":
|
|
263
263
|
return _context6.stop();
|
|
264
264
|
}
|
|
@@ -276,7 +276,7 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
276
276
|
var options,
|
|
277
277
|
fetchOptions,
|
|
278
278
|
_args7 = arguments;
|
|
279
|
-
return _regeneratorRuntime.wrap(function
|
|
279
|
+
return _regeneratorRuntime.wrap(function (_context7) {
|
|
280
280
|
while (1) switch (_context7.prev = _context7.next) {
|
|
281
281
|
case 0:
|
|
282
282
|
options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
|
@@ -284,7 +284,7 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
284
284
|
method: 'delete'
|
|
285
285
|
});
|
|
286
286
|
return _context7.abrupt("return", this.makeRequest(path, fetchOptions));
|
|
287
|
-
case
|
|
287
|
+
case 1:
|
|
288
288
|
case "end":
|
|
289
289
|
return _context7.stop();
|
|
290
290
|
}
|
|
@@ -308,7 +308,7 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
308
308
|
message,
|
|
309
309
|
httpError,
|
|
310
310
|
_args8 = arguments;
|
|
311
|
-
return _regeneratorRuntime.wrap(function
|
|
311
|
+
return _regeneratorRuntime.wrap(function (_context8) {
|
|
312
312
|
while (1) switch (_context8.prev = _context8.next) {
|
|
313
313
|
case 0:
|
|
314
314
|
additionalFetchOptions = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : {
|
|
@@ -318,29 +318,29 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
318
318
|
};
|
|
319
319
|
url = this.serviceUrl + path;
|
|
320
320
|
options = _objectSpread(_objectSpread({}, defaultFetchOptions), additionalFetchOptions);
|
|
321
|
-
_context8.next =
|
|
321
|
+
_context8.next = 1;
|
|
322
322
|
return fetchWithExponentialBackoff(url, options);
|
|
323
|
-
case
|
|
323
|
+
case 1:
|
|
324
324
|
response = _context8.sent;
|
|
325
325
|
this.preventInfiniteRedirectLoop(response);
|
|
326
326
|
handleResponse(response);
|
|
327
327
|
responseStatusCode = response.status;
|
|
328
328
|
traceId = response.headers.get('atl-traceid');
|
|
329
329
|
if (response.ok) {
|
|
330
|
-
_context8.next =
|
|
330
|
+
_context8.next = 4;
|
|
331
331
|
break;
|
|
332
332
|
}
|
|
333
333
|
if (!(responseStatusCode === 401)) {
|
|
334
|
-
_context8.next =
|
|
334
|
+
_context8.next = 2;
|
|
335
335
|
break;
|
|
336
336
|
}
|
|
337
337
|
throw new SLOIgnoreError({
|
|
338
338
|
message: 'Unauthorized Request - incrementing redirect count'
|
|
339
339
|
});
|
|
340
|
-
case
|
|
341
|
-
_context8.next =
|
|
340
|
+
case 2:
|
|
341
|
+
_context8.next = 3;
|
|
342
342
|
return parseErrorMessage(response);
|
|
343
|
-
case
|
|
343
|
+
case 3:
|
|
344
344
|
message = _context8.sent;
|
|
345
345
|
httpError = new HttpError({
|
|
346
346
|
message: message,
|
|
@@ -356,9 +356,9 @@ export var RestClient = /*#__PURE__*/function (_BaseClient) {
|
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
358
|
throw httpError;
|
|
359
|
-
case
|
|
359
|
+
case 4:
|
|
360
360
|
return _context8.abrupt("return", additionalFetchOptions.ignoreResponse ? null : parseResponse(response));
|
|
361
|
-
case
|
|
361
|
+
case 5:
|
|
362
362
|
case "end":
|
|
363
363
|
return _context8.stop();
|
|
364
364
|
}
|