@forge/teamwork-graph 2.3.0-next.6 → 2.3.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/out/__test__/user-operations.test.js +40 -9
- package/out/graph.d.ts.map +1 -1
- package/out/graph.js +6 -3
- package/package.json +2 -2
|
@@ -208,13 +208,23 @@ describe('TeamWorkGraphClient - User Operations', () => {
|
|
|
208
208
|
updatedAt: Date.now()
|
|
209
209
|
};
|
|
210
210
|
it('should successfully map users with accountId', async () => {
|
|
211
|
+
const mockApiResponse = {
|
|
212
|
+
success: {
|
|
213
|
+
directMappings: [{ externalId: 'user-123', accountId: '5dd4fb8db3a9c80fc0a3283b' }]
|
|
214
|
+
}
|
|
215
|
+
};
|
|
211
216
|
const expectedResponse = {
|
|
212
217
|
success: true,
|
|
213
|
-
results:
|
|
218
|
+
results: {
|
|
219
|
+
success: {
|
|
220
|
+
directMappings: [{ externalId: 'user-123', accountId: '5dd4fb8db3a9c80fc0a3283b' }]
|
|
221
|
+
},
|
|
222
|
+
failures: {}
|
|
223
|
+
}
|
|
214
224
|
};
|
|
215
225
|
mockFetch.mockResolvedValueOnce({
|
|
216
226
|
ok: true,
|
|
217
|
-
json: () => Promise.resolve(
|
|
227
|
+
json: () => Promise.resolve(mockApiResponse)
|
|
218
228
|
});
|
|
219
229
|
const result = await graphClient.mapUsers({
|
|
220
230
|
directMappings: [mappingWithAccountId]
|
|
@@ -228,13 +238,21 @@ describe('TeamWorkGraphClient - User Operations', () => {
|
|
|
228
238
|
expect(result).toEqual(expectedResponse);
|
|
229
239
|
});
|
|
230
240
|
it('should successfully map users with email address', async () => {
|
|
241
|
+
const mockApiResponse = {
|
|
242
|
+
success: {
|
|
243
|
+
directMappings: [{ externalId: 'user-456', email: 'tagapitos@my-company.com' }]
|
|
244
|
+
}
|
|
245
|
+
};
|
|
231
246
|
const expectedResponse = {
|
|
232
247
|
success: true,
|
|
233
|
-
results:
|
|
248
|
+
results: {
|
|
249
|
+
success: { directMappings: [{ externalId: 'user-456', email: 'tagapitos@my-company.com' }] },
|
|
250
|
+
failures: {}
|
|
251
|
+
}
|
|
234
252
|
};
|
|
235
253
|
mockFetch.mockResolvedValueOnce({
|
|
236
254
|
ok: true,
|
|
237
|
-
json: () => Promise.resolve(
|
|
255
|
+
json: () => Promise.resolve(mockApiResponse)
|
|
238
256
|
});
|
|
239
257
|
const result = await graphClient.mapUsers({
|
|
240
258
|
directMappings: [mappingWithEmail]
|
|
@@ -248,16 +266,29 @@ describe('TeamWorkGraphClient - User Operations', () => {
|
|
|
248
266
|
expect(result).toEqual(expectedResponse);
|
|
249
267
|
});
|
|
250
268
|
it('should successfully map multiple users with mixed accountId and email', async () => {
|
|
269
|
+
const mockApiResponse = {
|
|
270
|
+
success: {
|
|
271
|
+
directMappings: [
|
|
272
|
+
{ externalId: 'user-123', accountId: '5dd4fb8db3a9c80fc0a3283b' },
|
|
273
|
+
{ externalId: 'user-456', email: 'tagapitos@my-company.com' }
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
};
|
|
251
277
|
const expectedResponse = {
|
|
252
278
|
success: true,
|
|
253
|
-
results:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
279
|
+
results: {
|
|
280
|
+
success: {
|
|
281
|
+
directMappings: [
|
|
282
|
+
{ externalId: 'user-123', accountId: '5dd4fb8db3a9c80fc0a3283b' },
|
|
283
|
+
{ externalId: 'user-456', email: 'tagapitos@my-company.com' }
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
failures: {}
|
|
287
|
+
}
|
|
257
288
|
};
|
|
258
289
|
mockFetch.mockResolvedValueOnce({
|
|
259
290
|
ok: true,
|
|
260
|
-
json: () => Promise.resolve(
|
|
291
|
+
json: () => Promise.resolve(mockApiResponse)
|
|
261
292
|
});
|
|
262
293
|
const result = await graphClient.mapUsers({
|
|
263
294
|
directMappings: [mappingWithAccountId, mappingWithEmail]
|
package/out/graph.d.ts.map
CHANGED
|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CHANGED
|
@@ -149,8 +149,8 @@ class TeamWorkGraphClient {
|
|
|
149
149
|
return {
|
|
150
150
|
success: true,
|
|
151
151
|
results: {
|
|
152
|
-
success: response.success ||
|
|
153
|
-
failures: response.failures ||
|
|
152
|
+
success: response.success || {},
|
|
153
|
+
failures: response.failures || {}
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
}
|
|
@@ -202,7 +202,10 @@ class TeamWorkGraphClient {
|
|
|
202
202
|
});
|
|
203
203
|
return {
|
|
204
204
|
success: true,
|
|
205
|
-
results:
|
|
205
|
+
results: {
|
|
206
|
+
success: response.success || {},
|
|
207
|
+
failures: response.failures || {}
|
|
208
|
+
}
|
|
206
209
|
};
|
|
207
210
|
}
|
|
208
211
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/teamwork-graph",
|
|
3
|
-
"version": "2.3.0
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Forge TeamworkGraph SDK",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"jest-when": "^3.6.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@forge/api": "^6.1.1
|
|
25
|
+
"@forge/api": "^6.1.1"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"registry": "https://packages.atlassian.com/api/npm/npm-public/"
|