@forge/teamwork-graph 3.1.1 → 3.1.2-next.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.
|
@@ -2225,3 +2225,148 @@ describe('TeamWorkGraphClient - bulk entities', () => {
|
|
|
2225
2225
|
expect(result).toEqual(expected);
|
|
2226
2226
|
});
|
|
2227
2227
|
});
|
|
2228
|
+
describe('JsonNode and AssociationObject types', () => {
|
|
2229
|
+
describe('JsonNode type', () => {
|
|
2230
|
+
it('should accept string values', () => {
|
|
2231
|
+
const jsonNode = 'test string';
|
|
2232
|
+
expect(jsonNode).toBe('test string');
|
|
2233
|
+
});
|
|
2234
|
+
it('should accept number values', () => {
|
|
2235
|
+
const jsonNode = 42;
|
|
2236
|
+
expect(jsonNode).toBe(42);
|
|
2237
|
+
});
|
|
2238
|
+
it('should accept boolean values', () => {
|
|
2239
|
+
const jsonNodeTrue = true;
|
|
2240
|
+
const jsonNodeFalse = false;
|
|
2241
|
+
expect(jsonNodeTrue).toBe(true);
|
|
2242
|
+
expect(jsonNodeFalse).toBe(false);
|
|
2243
|
+
});
|
|
2244
|
+
it('should accept null values', () => {
|
|
2245
|
+
const jsonNode = null;
|
|
2246
|
+
expect(jsonNode).toBeNull();
|
|
2247
|
+
});
|
|
2248
|
+
it('should accept object values', () => {
|
|
2249
|
+
const jsonNode = {
|
|
2250
|
+
key1: 'value1',
|
|
2251
|
+
key2: 123,
|
|
2252
|
+
key3: true,
|
|
2253
|
+
nested: {
|
|
2254
|
+
innerKey: 'innerValue'
|
|
2255
|
+
}
|
|
2256
|
+
};
|
|
2257
|
+
expect(jsonNode).toEqual({
|
|
2258
|
+
key1: 'value1',
|
|
2259
|
+
key2: 123,
|
|
2260
|
+
key3: true,
|
|
2261
|
+
nested: {
|
|
2262
|
+
innerKey: 'innerValue'
|
|
2263
|
+
}
|
|
2264
|
+
});
|
|
2265
|
+
});
|
|
2266
|
+
it('should accept array values', () => {
|
|
2267
|
+
const jsonNode = ['string', 42, true, null];
|
|
2268
|
+
expect(jsonNode).toEqual(['string', 42, true, null]);
|
|
2269
|
+
});
|
|
2270
|
+
it('should accept nested arrays and objects', () => {
|
|
2271
|
+
const jsonNode = {
|
|
2272
|
+
items: [
|
|
2273
|
+
{ id: 1, name: 'item1' },
|
|
2274
|
+
{ id: 2, name: 'item2' }
|
|
2275
|
+
],
|
|
2276
|
+
metadata: {
|
|
2277
|
+
count: 2,
|
|
2278
|
+
tags: ['tag1', 'tag2']
|
|
2279
|
+
}
|
|
2280
|
+
};
|
|
2281
|
+
expect(jsonNode).toEqual({
|
|
2282
|
+
items: [
|
|
2283
|
+
{ id: 1, name: 'item1' },
|
|
2284
|
+
{ id: 2, name: 'item2' }
|
|
2285
|
+
],
|
|
2286
|
+
metadata: {
|
|
2287
|
+
count: 2,
|
|
2288
|
+
tags: ['tag1', 'tag2']
|
|
2289
|
+
}
|
|
2290
|
+
});
|
|
2291
|
+
});
|
|
2292
|
+
it('should accept deeply nested structures', () => {
|
|
2293
|
+
const jsonNode = {
|
|
2294
|
+
level1: {
|
|
2295
|
+
level2: {
|
|
2296
|
+
level3: {
|
|
2297
|
+
value: 'deep value',
|
|
2298
|
+
array: [1, 2, { nested: 'item' }]
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
};
|
|
2303
|
+
const nodeAsObject = jsonNode;
|
|
2304
|
+
const level1 = nodeAsObject.level1;
|
|
2305
|
+
const level2 = level1.level2;
|
|
2306
|
+
const level3 = level2.level3;
|
|
2307
|
+
expect(level3.value).toBe('deep value');
|
|
2308
|
+
expect(Array.isArray(level3.array)).toBe(true);
|
|
2309
|
+
});
|
|
2310
|
+
});
|
|
2311
|
+
describe('AssociationObject type', () => {
|
|
2312
|
+
it('should accept AssociationObject with string values', () => {
|
|
2313
|
+
const association = {
|
|
2314
|
+
associationType: 'related-to',
|
|
2315
|
+
values: ['value1', 'value2', 'value3']
|
|
2316
|
+
};
|
|
2317
|
+
expect(association.associationType).toBe('related-to');
|
|
2318
|
+
expect(association.values).toEqual(['value1', 'value2', 'value3']);
|
|
2319
|
+
});
|
|
2320
|
+
it('should accept AssociationObject with mixed JsonNode values', () => {
|
|
2321
|
+
const association = {
|
|
2322
|
+
associationType: 'metadata',
|
|
2323
|
+
values: [
|
|
2324
|
+
'string value',
|
|
2325
|
+
42,
|
|
2326
|
+
true,
|
|
2327
|
+
null,
|
|
2328
|
+
{ key: 'value' },
|
|
2329
|
+
[1, 2, 3]
|
|
2330
|
+
]
|
|
2331
|
+
};
|
|
2332
|
+
expect(association.associationType).toBe('metadata');
|
|
2333
|
+
expect(association.values).toHaveLength(6);
|
|
2334
|
+
expect(association.values[0]).toBe('string value');
|
|
2335
|
+
expect(association.values[1]).toBe(42);
|
|
2336
|
+
expect(association.values[2]).toBe(true);
|
|
2337
|
+
expect(association.values[3]).toBeNull();
|
|
2338
|
+
expect(association.values[4]).toEqual({ key: 'value' });
|
|
2339
|
+
expect(association.values[5]).toEqual([1, 2, 3]);
|
|
2340
|
+
});
|
|
2341
|
+
it('should accept AssociationObject with nested JsonNode values', () => {
|
|
2342
|
+
const association = {
|
|
2343
|
+
associationType: 'complex-association',
|
|
2344
|
+
values: [
|
|
2345
|
+
{
|
|
2346
|
+
id: 'item1',
|
|
2347
|
+
tags: ['tag1', 'tag2'],
|
|
2348
|
+
metadata: {
|
|
2349
|
+
count: 5,
|
|
2350
|
+
active: true
|
|
2351
|
+
}
|
|
2352
|
+
},
|
|
2353
|
+
[
|
|
2354
|
+
{ nested: 'value' },
|
|
2355
|
+
123
|
|
2356
|
+
]
|
|
2357
|
+
]
|
|
2358
|
+
};
|
|
2359
|
+
expect(association.associationType).toBe('complex-association');
|
|
2360
|
+
expect(association.values[0]).toHaveProperty('id', 'item1');
|
|
2361
|
+
expect(Array.isArray(association.values[1])).toBe(true);
|
|
2362
|
+
});
|
|
2363
|
+
it('should accept AssociationObject with empty values array', () => {
|
|
2364
|
+
const association = {
|
|
2365
|
+
associationType: 'empty-association',
|
|
2366
|
+
values: []
|
|
2367
|
+
};
|
|
2368
|
+
expect(association.associationType).toBe('empty-association');
|
|
2369
|
+
expect(association.values).toEqual([]);
|
|
2370
|
+
});
|
|
2371
|
+
});
|
|
2372
|
+
});
|
|
@@ -39,9 +39,12 @@ export declare type BaseObjectProperties = {
|
|
|
39
39
|
associations?: Associations;
|
|
40
40
|
properties?: Record<string, any>;
|
|
41
41
|
};
|
|
42
|
+
export declare type JsonNode = string | number | boolean | null | {
|
|
43
|
+
[key: string]: JsonNode;
|
|
44
|
+
} | JsonNode[];
|
|
42
45
|
export declare type AssociationObject = {
|
|
43
46
|
associationType: string;
|
|
44
|
-
values:
|
|
47
|
+
values: JsonNode[];
|
|
45
48
|
};
|
|
46
49
|
export declare type Associations = {
|
|
47
50
|
updateSequenceNumber?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/objects/common.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS,GAAG;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEvC,oBAAY,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,qBAAqB,GAAG,WAAW,CAAC;IAC1E,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC,CAAC;AAGF,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,IAAI,E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,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,GAAG,QAAQ,EAAE,CAAC;AAEnG,oBAAY,iBAAiB,GAAG;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,QAAQ,EAAE,CAAC;CACpB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,iBAAiB,EAAE,CAAC;CAC1B,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/teamwork-graph",
|
|
3
|
-
"version": "3.1.1",
|
|
3
|
+
"version": "3.1.2-next.1",
|
|
4
4
|
"description": "Forge TeamworkGraph SDK",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"jest-when": "^3.6.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@forge/api": "^6.4.0",
|
|
26
|
+
"@forge/api": "^6.4.1-next.0",
|
|
27
27
|
"uuid": "^9.0.1"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|