@forge/teamwork-graph 3.1.0-next.3-experimental-4bd2ca0 → 3.1.0-next.3-experimental-ec29181
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/README.md +38 -16
- package/out/__test__/entity-operations.test.js +87 -144
- package/out/__test__/group-operations.test.js +41 -46
- package/out/__test__/user-operations.test.js +61 -48
- package/out/graph.d.ts.map +1 -1
- package/out/graph.js +31 -33
- package/out/types/requests.d.ts +11 -11
- package/out/types/requests.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@ jest.mock('@forge/api');
|
|
|
8
8
|
describe('TeamWorkGraphClient - setObjects', () => {
|
|
9
9
|
let graphClient;
|
|
10
10
|
let mockFetch;
|
|
11
|
+
const TEST_CONNECTION_ID = 'test-connection-123';
|
|
11
12
|
beforeEach(() => {
|
|
12
13
|
graphClient = new graph_1.TeamWorkGraphClient();
|
|
13
14
|
mockFetch = jest.fn();
|
|
@@ -16,7 +17,8 @@ describe('TeamWorkGraphClient - setObjects', () => {
|
|
|
16
17
|
});
|
|
17
18
|
it('throws if objects array is empty', async () => {
|
|
18
19
|
await expect(graphClient.setObjects({
|
|
19
|
-
objects: []
|
|
20
|
+
objects: [],
|
|
21
|
+
connectionId: TEST_CONNECTION_ID
|
|
20
22
|
})).rejects.toThrow('objects array cannot be empty');
|
|
21
23
|
});
|
|
22
24
|
it('throws if more than 100 objects', async () => {
|
|
@@ -54,7 +56,8 @@ describe('TeamWorkGraphClient - setObjects', () => {
|
|
|
54
56
|
};
|
|
55
57
|
const manyObjects = Array(validators_1.MAX_BULK_OBJECTS + 1).fill(documentObject);
|
|
56
58
|
await expect(graphClient.setObjects({
|
|
57
|
-
objects: manyObjects
|
|
59
|
+
objects: manyObjects,
|
|
60
|
+
connectionId: TEST_CONNECTION_ID
|
|
58
61
|
})).rejects.toThrow(`Bulk ingestion supports maximum ${validators_1.MAX_BULK_OBJECTS} objects. Received ${validators_1.MAX_BULK_OBJECTS + 1}`);
|
|
59
62
|
});
|
|
60
63
|
it('posts to /api/v1/entities/bulk and returns response', async () => {
|
|
@@ -90,7 +93,7 @@ describe('TeamWorkGraphClient - setObjects', () => {
|
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
};
|
|
93
|
-
const req = { objects: [documentObject] };
|
|
96
|
+
const req = { objects: [documentObject], connectionId: TEST_CONNECTION_ID };
|
|
94
97
|
const backendResponse = {
|
|
95
98
|
accepted: [
|
|
96
99
|
{
|
|
@@ -153,7 +156,7 @@ describe('TeamWorkGraphClient - setObjects', () => {
|
|
|
153
156
|
lastActive: '2024-07-09T15:27:37.000Z'
|
|
154
157
|
}
|
|
155
158
|
};
|
|
156
|
-
const req = { objects: [messageObject] };
|
|
159
|
+
const req = { objects: [messageObject], connectionId: TEST_CONNECTION_ID };
|
|
157
160
|
const backendResponse = {
|
|
158
161
|
accepted: [
|
|
159
162
|
{
|
|
@@ -176,7 +179,7 @@ describe('TeamWorkGraphClient - setObjects', () => {
|
|
|
176
179
|
expect(result).toEqual(expected);
|
|
177
180
|
});
|
|
178
181
|
it('throws if objects is not an array', async () => {
|
|
179
|
-
const req = { objects: null };
|
|
182
|
+
const req = { objects: null, connectionId: TEST_CONNECTION_ID };
|
|
180
183
|
await expect(graphClient.setObjects(req)).rejects.toThrow('objects must be an array');
|
|
181
184
|
});
|
|
182
185
|
it('should pass Atl-Connection-Id header when connectionId is provided', async () => {
|
|
@@ -236,70 +239,11 @@ describe('TeamWorkGraphClient - setObjects', () => {
|
|
|
236
239
|
})
|
|
237
240
|
}));
|
|
238
241
|
});
|
|
239
|
-
it('should not pass Atl-Connection-Id header when connectionId is not provided', async () => {
|
|
240
|
-
const documentObject = {
|
|
241
|
-
schemaVersion: '1.0',
|
|
242
|
-
id: 'my-document',
|
|
243
|
-
updateSequenceNumber: 123,
|
|
244
|
-
displayName: 'My Document',
|
|
245
|
-
url: 'https://document.com',
|
|
246
|
-
createdAt: '2024-04-16T09:01:32+00:00',
|
|
247
|
-
lastUpdatedAt: '2024-04-16T09:01:32+00:00',
|
|
248
|
-
permissions: [
|
|
249
|
-
{
|
|
250
|
-
accessControls: [
|
|
251
|
-
{
|
|
252
|
-
principals: [
|
|
253
|
-
{
|
|
254
|
-
type: 'EVERYONE'
|
|
255
|
-
}
|
|
256
|
-
]
|
|
257
|
-
}
|
|
258
|
-
]
|
|
259
|
-
}
|
|
260
|
-
],
|
|
261
|
-
'atlassian:document': {
|
|
262
|
-
type: {
|
|
263
|
-
category: 'DOCUMENT',
|
|
264
|
-
iconUrl: 'http://icon.com'
|
|
265
|
-
},
|
|
266
|
-
content: {
|
|
267
|
-
mimeType: 'text/plain',
|
|
268
|
-
text: 'Really large content here...'
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
const req = { objects: [documentObject] };
|
|
273
|
-
const backendResponse = {
|
|
274
|
-
accepted: [
|
|
275
|
-
{
|
|
276
|
-
entityType: 'atlassian:document',
|
|
277
|
-
entityId: { id: 'my-document' },
|
|
278
|
-
thirdPartyAri: 'ari:third-party:test::document/my-document'
|
|
279
|
-
}
|
|
280
|
-
]
|
|
281
|
-
};
|
|
282
|
-
mockFetch.mockResolvedValueOnce({
|
|
283
|
-
ok: true,
|
|
284
|
-
json: () => Promise.resolve(backendResponse)
|
|
285
|
-
});
|
|
286
|
-
await graphClient.setObjects(req);
|
|
287
|
-
expect(mockFetch).toHaveBeenCalledWith((0, endpoints_1.getFullPath)(endpoints_1.ENDPOINTS.OBJECTS.BULK), expect.objectContaining({
|
|
288
|
-
method: 'POST',
|
|
289
|
-
headers: expect.objectContaining({
|
|
290
|
-
'Content-Type': 'application/json'
|
|
291
|
-
})
|
|
292
|
-
}));
|
|
293
|
-
expect(mockFetch).toHaveBeenCalledWith((0, endpoints_1.getFullPath)(endpoints_1.ENDPOINTS.OBJECTS.BULK), expect.not.objectContaining({
|
|
294
|
-
headers: expect.objectContaining({
|
|
295
|
-
'Atl-Connection-Id': expect.anything()
|
|
296
|
-
})
|
|
297
|
-
}));
|
|
298
|
-
});
|
|
299
242
|
});
|
|
300
243
|
describe('TeamWorkGraphClient - getObjectByExternalId', () => {
|
|
301
244
|
let graphClient;
|
|
302
245
|
let mockFetch;
|
|
246
|
+
const TEST_CONNECTION_ID = 'test-connection-123';
|
|
303
247
|
beforeEach(() => {
|
|
304
248
|
graphClient = new graph_1.TeamWorkGraphClient();
|
|
305
249
|
mockFetch = jest.fn();
|
|
@@ -329,12 +273,16 @@ describe('TeamWorkGraphClient - getObjectByExternalId', () => {
|
|
|
329
273
|
});
|
|
330
274
|
const result = await graphClient.getObjectByExternalId({
|
|
331
275
|
objectType: 'atlassian:document',
|
|
332
|
-
externalId: 'pipelines/123/builds/456'
|
|
276
|
+
externalId: 'pipelines/123/builds/456',
|
|
277
|
+
connectionId: TEST_CONNECTION_ID
|
|
333
278
|
});
|
|
334
279
|
expect(mockFetch).toHaveBeenCalledWith((0, endpoints_1.getFullPath)(endpoints_1.ENDPOINTS.OBJECTS.GET_BY_EXTERNAL_ID), {
|
|
335
280
|
method: 'POST',
|
|
336
281
|
redirect: 'follow',
|
|
337
|
-
headers: {
|
|
282
|
+
headers: {
|
|
283
|
+
'Content-Type': 'application/json',
|
|
284
|
+
'Atl-Connection-Id': TEST_CONNECTION_ID
|
|
285
|
+
},
|
|
338
286
|
body: JSON.stringify({
|
|
339
287
|
entityType: 'atlassian:document',
|
|
340
288
|
entityIds: ['pipelines/123/builds/456']
|
|
@@ -361,7 +309,8 @@ describe('TeamWorkGraphClient - getObjectByExternalId', () => {
|
|
|
361
309
|
mockFetch.mockResolvedValueOnce(errorResponse);
|
|
362
310
|
const result = await graphClient.getObjectByExternalId({
|
|
363
311
|
objectType: 'atlassian:document',
|
|
364
|
-
externalId: 'nonexistent-entity'
|
|
312
|
+
externalId: 'nonexistent-entity',
|
|
313
|
+
connectionId: TEST_CONNECTION_ID
|
|
365
314
|
});
|
|
366
315
|
expect(result).toEqual({
|
|
367
316
|
success: false,
|
|
@@ -372,13 +321,15 @@ describe('TeamWorkGraphClient - getObjectByExternalId', () => {
|
|
|
372
321
|
it('should throw error when objectType is missing', async () => {
|
|
373
322
|
await expect(graphClient.getObjectByExternalId({
|
|
374
323
|
objectType: '',
|
|
375
|
-
externalId: 'pipelines/123/builds/456'
|
|
324
|
+
externalId: 'pipelines/123/builds/456',
|
|
325
|
+
connectionId: TEST_CONNECTION_ID
|
|
376
326
|
})).rejects.toThrow('objectType is required');
|
|
377
327
|
});
|
|
378
328
|
it('should throw error when externalId is missing', async () => {
|
|
379
329
|
await expect(graphClient.getObjectByExternalId({
|
|
380
330
|
objectType: 'atlassian:document',
|
|
381
|
-
externalId: ''
|
|
331
|
+
externalId: '',
|
|
332
|
+
connectionId: TEST_CONNECTION_ID
|
|
382
333
|
})).rejects.toThrow('externalId is required');
|
|
383
334
|
});
|
|
384
335
|
it('should pass Atl-Connection-Id header when connectionId is provided', async () => {
|
|
@@ -416,47 +367,11 @@ describe('TeamWorkGraphClient - getObjectByExternalId', () => {
|
|
|
416
367
|
})
|
|
417
368
|
}));
|
|
418
369
|
});
|
|
419
|
-
it('should not pass Atl-Connection-Id header when connectionId is not provided', async () => {
|
|
420
|
-
const expectedObject = {
|
|
421
|
-
id: 'ari:cloud:teamwork-graph:object/123',
|
|
422
|
-
externalId: 'pipelines/123/builds/456',
|
|
423
|
-
objectType: 'atlassian:document',
|
|
424
|
-
displayName: 'Build Documentation',
|
|
425
|
-
description: 'Documentation for build process',
|
|
426
|
-
url: 'https://example.com/builds/456',
|
|
427
|
-
createdAt: '2024-01-01T00:00:00Z',
|
|
428
|
-
lastUpdatedAt: '2024-01-01T00:00:00Z',
|
|
429
|
-
meta: {
|
|
430
|
-
resourceType: 'Document',
|
|
431
|
-
created: '2024-01-01T00:00:00Z',
|
|
432
|
-
lastModified: '2024-01-01T00:00:00Z',
|
|
433
|
-
location: 'https://example.com/v2/entities/123'
|
|
434
|
-
}
|
|
435
|
-
};
|
|
436
|
-
mockFetch.mockResolvedValueOnce({
|
|
437
|
-
ok: true,
|
|
438
|
-
json: () => Promise.resolve({ entities: [expectedObject] })
|
|
439
|
-
});
|
|
440
|
-
await graphClient.getObjectByExternalId({
|
|
441
|
-
objectType: 'atlassian:document',
|
|
442
|
-
externalId: 'pipelines/123/builds/456'
|
|
443
|
-
});
|
|
444
|
-
expect(mockFetch).toHaveBeenCalledWith((0, endpoints_1.getFullPath)(endpoints_1.ENDPOINTS.OBJECTS.GET_BY_EXTERNAL_ID), expect.objectContaining({
|
|
445
|
-
method: 'POST',
|
|
446
|
-
headers: expect.objectContaining({
|
|
447
|
-
'Content-Type': 'application/json'
|
|
448
|
-
})
|
|
449
|
-
}));
|
|
450
|
-
expect(mockFetch).toHaveBeenCalledWith((0, endpoints_1.getFullPath)(endpoints_1.ENDPOINTS.OBJECTS.GET_BY_EXTERNAL_ID), expect.not.objectContaining({
|
|
451
|
-
headers: expect.objectContaining({
|
|
452
|
-
'Atl-Connection-Id': expect.anything()
|
|
453
|
-
})
|
|
454
|
-
}));
|
|
455
|
-
});
|
|
456
370
|
});
|
|
457
371
|
describe('TeamWorkGraphClient - deleteObjectsByExternalId', () => {
|
|
458
372
|
let graphClient;
|
|
459
373
|
let mockFetch;
|
|
374
|
+
const TEST_CONNECTION_ID = 'test-connection-123';
|
|
460
375
|
beforeEach(() => {
|
|
461
376
|
graphClient = new graph_1.TeamWorkGraphClient();
|
|
462
377
|
mockFetch = jest.fn();
|
|
@@ -479,7 +394,8 @@ describe('TeamWorkGraphClient - deleteObjectsByExternalId', () => {
|
|
|
479
394
|
});
|
|
480
395
|
const result = await graphClient.deleteObjectsByExternalId({
|
|
481
396
|
objectType: 'atlassian:document',
|
|
482
|
-
externalIds: ['pipelines/123/builds/456', 'pipelines/123/builds/789']
|
|
397
|
+
externalIds: ['pipelines/123/builds/456', 'pipelines/123/builds/789'],
|
|
398
|
+
connectionId: TEST_CONNECTION_ID
|
|
483
399
|
});
|
|
484
400
|
expect(mockFetch).toHaveBeenCalledWith((0, endpoints_1.getFullPath)(endpoints_1.ENDPOINTS.OBJECTS.BULK_DELETE), {
|
|
485
401
|
method: 'DELETE',
|
|
@@ -488,39 +404,47 @@ describe('TeamWorkGraphClient - deleteObjectsByExternalId', () => {
|
|
|
488
404
|
entityIds: ['pipelines/123/builds/456', 'pipelines/123/builds/789']
|
|
489
405
|
}),
|
|
490
406
|
redirect: 'follow',
|
|
491
|
-
headers: {
|
|
407
|
+
headers: {
|
|
408
|
+
'Content-Type': 'application/json',
|
|
409
|
+
'Atl-Connection-Id': TEST_CONNECTION_ID
|
|
410
|
+
}
|
|
492
411
|
});
|
|
493
412
|
expect(result).toEqual(expectedResponse);
|
|
494
413
|
});
|
|
495
414
|
it('should throw error when objectType is missing', async () => {
|
|
496
415
|
await expect(graphClient.deleteObjectsByExternalId({
|
|
497
416
|
objectType: '',
|
|
498
|
-
externalIds: ['pipelines/123/builds/456']
|
|
417
|
+
externalIds: ['pipelines/123/builds/456'],
|
|
418
|
+
connectionId: TEST_CONNECTION_ID
|
|
499
419
|
})).rejects.toThrow('objectType is required');
|
|
500
420
|
});
|
|
501
421
|
it('should throw error when externalIds array is empty', async () => {
|
|
502
422
|
await expect(graphClient.deleteObjectsByExternalId({
|
|
503
423
|
objectType: 'atlassian:document',
|
|
504
|
-
externalIds: []
|
|
424
|
+
externalIds: [],
|
|
425
|
+
connectionId: TEST_CONNECTION_ID
|
|
505
426
|
})).rejects.toThrow('externalIds array cannot be empty');
|
|
506
427
|
});
|
|
507
428
|
it('should throw error when externalIds array exceeds limit', async () => {
|
|
508
429
|
const manyExternalIds = Array(validators_1.MAX_BULK_OBJECTS_DELETE + 1).fill('pipelines/123/builds/456');
|
|
509
430
|
await expect(graphClient.deleteObjectsByExternalId({
|
|
510
431
|
objectType: 'atlassian:document',
|
|
511
|
-
externalIds: manyExternalIds
|
|
432
|
+
externalIds: manyExternalIds,
|
|
433
|
+
connectionId: TEST_CONNECTION_ID
|
|
512
434
|
})).rejects.toThrow(`Bulk object deletion supports maximum ${validators_1.MAX_BULK_OBJECTS_DELETE} objects`);
|
|
513
435
|
});
|
|
514
436
|
it('should throw error when externalIds is not an array', async () => {
|
|
515
437
|
await expect(graphClient.deleteObjectsByExternalId({
|
|
516
438
|
objectType: 'atlassian:document',
|
|
517
|
-
externalIds: null
|
|
439
|
+
externalIds: null,
|
|
440
|
+
connectionId: TEST_CONNECTION_ID
|
|
518
441
|
})).rejects.toThrow('externalIds must be an array');
|
|
519
442
|
});
|
|
520
443
|
});
|
|
521
444
|
describe('TeamWorkGraphClient - deleteObjectsByProperties', () => {
|
|
522
445
|
let graphClient;
|
|
523
446
|
let mockFetch;
|
|
447
|
+
const TEST_CONNECTION_ID = 'test-connection-123';
|
|
524
448
|
beforeEach(() => {
|
|
525
449
|
graphClient = new graph_1.TeamWorkGraphClient();
|
|
526
450
|
mockFetch = jest.fn();
|
|
@@ -539,7 +463,8 @@ describe('TeamWorkGraphClient - deleteObjectsByProperties', () => {
|
|
|
539
463
|
properties: {
|
|
540
464
|
environment: 'staging'
|
|
541
465
|
},
|
|
542
|
-
objectType: 'atlassian:document'
|
|
466
|
+
objectType: 'atlassian:document',
|
|
467
|
+
connectionId: TEST_CONNECTION_ID
|
|
543
468
|
});
|
|
544
469
|
expect(mockFetch).toHaveBeenCalledWith((0, endpoints_1.getFullPath)(endpoints_1.ENDPOINTS.OBJECTS.DELETE_BY_PROPERTIES), {
|
|
545
470
|
method: 'DELETE',
|
|
@@ -550,7 +475,10 @@ describe('TeamWorkGraphClient - deleteObjectsByProperties', () => {
|
|
|
550
475
|
entityType: 'atlassian:document'
|
|
551
476
|
}),
|
|
552
477
|
redirect: 'follow',
|
|
553
|
-
headers: {
|
|
478
|
+
headers: {
|
|
479
|
+
'Content-Type': 'application/json',
|
|
480
|
+
'Atl-Connection-Id': TEST_CONNECTION_ID
|
|
481
|
+
}
|
|
554
482
|
});
|
|
555
483
|
expect(result).toEqual(expectedResponse);
|
|
556
484
|
});
|
|
@@ -560,17 +488,30 @@ describe('TeamWorkGraphClient - deleteObjectsByProperties', () => {
|
|
|
560
488
|
environment: 'production',
|
|
561
489
|
status: 'completed'
|
|
562
490
|
},
|
|
563
|
-
objectType: 'atlassian:document'
|
|
491
|
+
objectType: 'atlassian:document',
|
|
492
|
+
connectionId: TEST_CONNECTION_ID
|
|
564
493
|
})).rejects.toThrow('properties object must contain exactly 1 property');
|
|
565
494
|
});
|
|
566
495
|
it('should throw error when properties is missing', async () => {
|
|
567
|
-
await expect(graphClient.deleteObjectsByProperties({
|
|
496
|
+
await expect(graphClient.deleteObjectsByProperties({
|
|
497
|
+
properties: {},
|
|
498
|
+
objectType: 'atlassian:document',
|
|
499
|
+
connectionId: TEST_CONNECTION_ID
|
|
500
|
+
})).rejects.toThrow('properties object cannot be empty');
|
|
568
501
|
});
|
|
569
502
|
it('should throw error when properties is not an object', async () => {
|
|
570
|
-
await expect(graphClient.deleteObjectsByProperties({
|
|
503
|
+
await expect(graphClient.deleteObjectsByProperties({
|
|
504
|
+
properties: 'not-an-object',
|
|
505
|
+
objectType: 'atlassian:document',
|
|
506
|
+
connectionId: TEST_CONNECTION_ID
|
|
507
|
+
})).rejects.toThrow('properties must be an object');
|
|
571
508
|
});
|
|
572
509
|
it('should throw error when properties object is empty', async () => {
|
|
573
|
-
await expect(graphClient.deleteObjectsByProperties({
|
|
510
|
+
await expect(graphClient.deleteObjectsByProperties({
|
|
511
|
+
properties: {},
|
|
512
|
+
objectType: 'atlassian:document',
|
|
513
|
+
connectionId: TEST_CONNECTION_ID
|
|
514
|
+
})).rejects.toThrow('properties object cannot be empty');
|
|
574
515
|
});
|
|
575
516
|
it('should throw error when multiple properties are provided', async () => {
|
|
576
517
|
await expect(graphClient.deleteObjectsByProperties({
|
|
@@ -579,13 +520,15 @@ describe('TeamWorkGraphClient - deleteObjectsByProperties', () => {
|
|
|
579
520
|
status: 'completed',
|
|
580
521
|
priority: 'high'
|
|
581
522
|
},
|
|
582
|
-
objectType: 'atlassian:document'
|
|
523
|
+
objectType: 'atlassian:document',
|
|
524
|
+
connectionId: TEST_CONNECTION_ID
|
|
583
525
|
})).rejects.toThrow('properties object must contain exactly 1 property');
|
|
584
526
|
});
|
|
585
527
|
});
|
|
586
528
|
describe('TeamWorkGraphClient - bulk entities', () => {
|
|
587
529
|
let graphClient;
|
|
588
530
|
let mockFetch;
|
|
531
|
+
const TEST_CONNECTION_ID = 'test-connection-123';
|
|
589
532
|
beforeEach(() => {
|
|
590
533
|
graphClient = new graph_1.TeamWorkGraphClient();
|
|
591
534
|
mockFetch = jest.fn();
|
|
@@ -622,7 +565,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
622
565
|
],
|
|
623
566
|
'atlassian:branch': {}
|
|
624
567
|
};
|
|
625
|
-
const req = { objects: [branchObject] };
|
|
568
|
+
const req = { objects: [branchObject], connectionId: TEST_CONNECTION_ID };
|
|
626
569
|
const backendResponse = {
|
|
627
570
|
accepted: [
|
|
628
571
|
{
|
|
@@ -686,7 +629,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
686
629
|
]
|
|
687
630
|
}
|
|
688
631
|
};
|
|
689
|
-
const req = { objects: [commitObject] };
|
|
632
|
+
const req = { objects: [commitObject], connectionId: TEST_CONNECTION_ID };
|
|
690
633
|
const backendResponse = {
|
|
691
634
|
accepted: [
|
|
692
635
|
{
|
|
@@ -756,7 +699,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
756
699
|
]
|
|
757
700
|
}
|
|
758
701
|
};
|
|
759
|
-
const req = { objects: [buildObject] };
|
|
702
|
+
const req = { objects: [buildObject], connectionId: TEST_CONNECTION_ID };
|
|
760
703
|
const backendResponse = {
|
|
761
704
|
accepted: [
|
|
762
705
|
{
|
|
@@ -849,7 +792,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
849
792
|
]
|
|
850
793
|
}
|
|
851
794
|
};
|
|
852
|
-
const req = { objects: [featureFlagObject] };
|
|
795
|
+
const req = { objects: [featureFlagObject], connectionId: TEST_CONNECTION_ID };
|
|
853
796
|
const backendResponse = {
|
|
854
797
|
accepted: [
|
|
855
798
|
{
|
|
@@ -942,7 +885,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
942
885
|
]
|
|
943
886
|
}
|
|
944
887
|
};
|
|
945
|
-
const req = { objects: [calendarEventObject] };
|
|
888
|
+
const req = { objects: [calendarEventObject], connectionId: TEST_CONNECTION_ID };
|
|
946
889
|
const backendResponse = {
|
|
947
890
|
accepted: [
|
|
948
891
|
{
|
|
@@ -1000,7 +943,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1000
943
|
]
|
|
1001
944
|
}
|
|
1002
945
|
};
|
|
1003
|
-
const req = { objects: [commentObject] };
|
|
946
|
+
const req = { objects: [commentObject], connectionId: TEST_CONNECTION_ID };
|
|
1004
947
|
const backendResponse = {
|
|
1005
948
|
accepted: [
|
|
1006
949
|
{
|
|
@@ -1072,7 +1015,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1072
1015
|
memberCount: 3
|
|
1073
1016
|
}
|
|
1074
1017
|
};
|
|
1075
|
-
const req = { objects: [conversationObject] };
|
|
1018
|
+
const req = { objects: [conversationObject], connectionId: TEST_CONNECTION_ID };
|
|
1076
1019
|
const backendResponse = {
|
|
1077
1020
|
accepted: [
|
|
1078
1021
|
{
|
|
@@ -1151,7 +1094,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1151
1094
|
accountType: 'Enterprise'
|
|
1152
1095
|
}
|
|
1153
1096
|
};
|
|
1154
|
-
const req = { objects: [customerOrgObject] };
|
|
1097
|
+
const req = { objects: [customerOrgObject], connectionId: TEST_CONNECTION_ID };
|
|
1155
1098
|
const backendResponse = {
|
|
1156
1099
|
accepted: [
|
|
1157
1100
|
{
|
|
@@ -1229,7 +1172,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1229
1172
|
isClosed: false
|
|
1230
1173
|
}
|
|
1231
1174
|
};
|
|
1232
|
-
const req = { objects: [dealObject] };
|
|
1175
|
+
const req = { objects: [dealObject], connectionId: TEST_CONNECTION_ID };
|
|
1233
1176
|
const backendResponse = {
|
|
1234
1177
|
accepted: [
|
|
1235
1178
|
{ entityType: 'atlassian:deal', entityId: { id: 'deal-1' }, thirdPartyAri: 'ari:third-party:test::deal/deal-1' }
|
|
@@ -1304,7 +1247,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1304
1247
|
region: 'us-east-1'
|
|
1305
1248
|
}
|
|
1306
1249
|
};
|
|
1307
|
-
const req = { objects: [deploymentObject] };
|
|
1250
|
+
const req = { objects: [deploymentObject], connectionId: TEST_CONNECTION_ID };
|
|
1308
1251
|
const backendResponse = {
|
|
1309
1252
|
accepted: [
|
|
1310
1253
|
{
|
|
@@ -1357,7 +1300,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1357
1300
|
iconUrl: 'https://figma.com/icons/mobile-login-screen.svg'
|
|
1358
1301
|
}
|
|
1359
1302
|
};
|
|
1360
|
-
const req = { objects: [designObject] };
|
|
1303
|
+
const req = { objects: [designObject], connectionId: TEST_CONNECTION_ID };
|
|
1361
1304
|
const backendResponse = {
|
|
1362
1305
|
accepted: [
|
|
1363
1306
|
{
|
|
@@ -1439,7 +1382,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1439
1382
|
watchersCount: 8
|
|
1440
1383
|
}
|
|
1441
1384
|
};
|
|
1442
|
-
const req = { objects: [projectObject] };
|
|
1385
|
+
const req = { objects: [projectObject], connectionId: TEST_CONNECTION_ID };
|
|
1443
1386
|
const backendResponse = {
|
|
1444
1387
|
accepted: [
|
|
1445
1388
|
{
|
|
@@ -1519,7 +1462,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1519
1462
|
taskCount: 3
|
|
1520
1463
|
}
|
|
1521
1464
|
};
|
|
1522
|
-
const req = { objects: [pullRequestObject] };
|
|
1465
|
+
const req = { objects: [pullRequestObject], connectionId: TEST_CONNECTION_ID };
|
|
1523
1466
|
const backendResponse = {
|
|
1524
1467
|
accepted: [
|
|
1525
1468
|
{
|
|
@@ -1589,7 +1532,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1589
1532
|
fullNounThirdPartyAri: 'ari:cloud:jira:company-site:issue/AUTH-123'
|
|
1590
1533
|
}
|
|
1591
1534
|
};
|
|
1592
|
-
const req = { objects: [remoteLinkObject] };
|
|
1535
|
+
const req = { objects: [remoteLinkObject], connectionId: TEST_CONNECTION_ID };
|
|
1593
1536
|
const backendResponse = {
|
|
1594
1537
|
accepted: [
|
|
1595
1538
|
{
|
|
@@ -1640,7 +1583,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1640
1583
|
avatarDescription: 'Company logo representing the ecommerce backend repository'
|
|
1641
1584
|
}
|
|
1642
1585
|
};
|
|
1643
|
-
const req = { objects: [repositoryObject] };
|
|
1586
|
+
const req = { objects: [repositoryObject], connectionId: TEST_CONNECTION_ID };
|
|
1644
1587
|
const backendResponse = {
|
|
1645
1588
|
accepted: [
|
|
1646
1589
|
{
|
|
@@ -1700,7 +1643,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1700
1643
|
serviceType: 'REST API'
|
|
1701
1644
|
}
|
|
1702
1645
|
};
|
|
1703
|
-
const req = { objects: [softwareServiceObject] };
|
|
1646
|
+
const req = { objects: [softwareServiceObject], connectionId: TEST_CONNECTION_ID };
|
|
1704
1647
|
const backendResponse = {
|
|
1705
1648
|
accepted: [
|
|
1706
1649
|
{
|
|
@@ -1757,7 +1700,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1757
1700
|
labels: ['engineering', 'documentation', 'team-resources', 'best-practices', 'onboarding']
|
|
1758
1701
|
}
|
|
1759
1702
|
};
|
|
1760
|
-
const req = { objects: [spaceObject] };
|
|
1703
|
+
const req = { objects: [spaceObject], connectionId: TEST_CONNECTION_ID };
|
|
1761
1704
|
const backendResponse = {
|
|
1762
1705
|
accepted: [
|
|
1763
1706
|
{
|
|
@@ -1878,7 +1821,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1878
1821
|
]
|
|
1879
1822
|
}
|
|
1880
1823
|
};
|
|
1881
|
-
const req = { objects: [videoObject] };
|
|
1824
|
+
const req = { objects: [videoObject], connectionId: TEST_CONNECTION_ID };
|
|
1882
1825
|
const backendResponse = {
|
|
1883
1826
|
accepted: [
|
|
1884
1827
|
{
|
|
@@ -1973,7 +1916,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
1973
1916
|
team: 'Backend Infrastructure Team'
|
|
1974
1917
|
}
|
|
1975
1918
|
};
|
|
1976
|
-
const req = { objects: [workItemObject] };
|
|
1919
|
+
const req = { objects: [workItemObject], connectionId: TEST_CONNECTION_ID };
|
|
1977
1920
|
const backendResponse = {
|
|
1978
1921
|
accepted: [
|
|
1979
1922
|
{
|
|
@@ -2030,7 +1973,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
2030
1973
|
]
|
|
2031
1974
|
}
|
|
2032
1975
|
};
|
|
2033
|
-
const req = { objects: [dashboardObject] };
|
|
1976
|
+
const req = { objects: [dashboardObject], connectionId: TEST_CONNECTION_ID };
|
|
2034
1977
|
const backendResponse = {
|
|
2035
1978
|
accepted: [
|
|
2036
1979
|
{
|
|
@@ -2087,7 +2030,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
2087
2030
|
environment: 'staging'
|
|
2088
2031
|
}
|
|
2089
2032
|
};
|
|
2090
|
-
const req = { objects: [testObject] };
|
|
2033
|
+
const req = { objects: [testObject], connectionId: TEST_CONNECTION_ID };
|
|
2091
2034
|
const backendResponse = {
|
|
2092
2035
|
accepted: [
|
|
2093
2036
|
{
|
|
@@ -2143,7 +2086,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
2143
2086
|
testType: 'unit'
|
|
2144
2087
|
}
|
|
2145
2088
|
};
|
|
2146
|
-
const req = { objects: [testExecutionObject] };
|
|
2089
|
+
const req = { objects: [testExecutionObject], connectionId: TEST_CONNECTION_ID };
|
|
2147
2090
|
const backendResponse = {
|
|
2148
2091
|
accepted: [
|
|
2149
2092
|
{
|
|
@@ -2194,7 +2137,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
2194
2137
|
],
|
|
2195
2138
|
'atlassian:test-plan': {}
|
|
2196
2139
|
};
|
|
2197
|
-
const req = { objects: [testPlanObject] };
|
|
2140
|
+
const req = { objects: [testPlanObject], connectionId: TEST_CONNECTION_ID };
|
|
2198
2141
|
const backendResponse = {
|
|
2199
2142
|
accepted: [
|
|
2200
2143
|
{
|
|
@@ -2255,7 +2198,7 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
2255
2198
|
environment: 'staging'
|
|
2256
2199
|
}
|
|
2257
2200
|
};
|
|
2258
|
-
const req = { objects: [testRunObject] };
|
|
2201
|
+
const req = { objects: [testRunObject], connectionId: TEST_CONNECTION_ID };
|
|
2259
2202
|
const backendResponse = {
|
|
2260
2203
|
accepted: [
|
|
2261
2204
|
{
|