@_linked/core 0.0.1 → 1.0.0-next.20260216062729

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.
Files changed (81) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/LICENSE +1 -1
  3. package/README.md +147 -92
  4. package/lib/cjs/queries/SelectQuery.d.ts +5 -0
  5. package/lib/cjs/queries/SelectQuery.js +14 -0
  6. package/lib/cjs/queries/SelectQuery.js.map +1 -1
  7. package/lib/cjs/shapes/SHACL.d.ts +1 -0
  8. package/lib/cjs/shapes/SHACL.js +82 -2
  9. package/lib/cjs/shapes/SHACL.js.map +1 -1
  10. package/lib/cjs/shapes/Shape.d.ts +13 -1
  11. package/lib/cjs/shapes/Shape.js +6 -0
  12. package/lib/cjs/shapes/Shape.js.map +1 -1
  13. package/lib/cjs/test-helpers/query-fixtures.d.ts +583 -0
  14. package/lib/cjs/test-helpers/query-fixtures.js +39 -1
  15. package/lib/cjs/test-helpers/query-fixtures.js.map +1 -1
  16. package/lib/esm/queries/SelectQuery.d.ts +5 -0
  17. package/lib/esm/queries/SelectQuery.js +14 -0
  18. package/lib/esm/queries/SelectQuery.js.map +1 -1
  19. package/lib/esm/shapes/SHACL.d.ts +1 -0
  20. package/lib/esm/shapes/SHACL.js +82 -2
  21. package/lib/esm/shapes/SHACL.js.map +1 -1
  22. package/lib/esm/shapes/Shape.d.ts +13 -1
  23. package/lib/esm/shapes/Shape.js +6 -0
  24. package/lib/esm/shapes/Shape.js.map +1 -1
  25. package/lib/esm/test-helpers/query-fixtures.d.ts +583 -0
  26. package/lib/esm/test-helpers/query-fixtures.js +38 -0
  27. package/lib/esm/test-helpers/query-fixtures.js.map +1 -1
  28. package/package.json +17 -1
  29. package/.context/notes.md +0 -0
  30. package/.context/todos.md +0 -0
  31. package/AGENTS.md +0 -59
  32. package/docs/001-core-extraction.md +0 -305
  33. package/jest.config.js +0 -25
  34. package/scripts/dual-package.js +0 -25
  35. package/src/collections/CoreMap.ts +0 -127
  36. package/src/collections/CoreSet.ts +0 -171
  37. package/src/collections/ShapeSet.ts +0 -18
  38. package/src/index.ts +0 -88
  39. package/src/interfaces/ICoreIterable.ts +0 -35
  40. package/src/interfaces/IFileStore.ts +0 -28
  41. package/src/interfaces/IQuadStore.ts +0 -16
  42. package/src/interfaces/IQueryParser.ts +0 -51
  43. package/src/ontologies/lincd.ts +0 -25
  44. package/src/ontologies/npm.ts +0 -15
  45. package/src/ontologies/owl.ts +0 -26
  46. package/src/ontologies/rdf.ts +0 -32
  47. package/src/ontologies/rdfs.ts +0 -38
  48. package/src/ontologies/shacl.ts +0 -136
  49. package/src/ontologies/xsd.ts +0 -47
  50. package/src/package.ts +0 -11
  51. package/src/queries/CreateQuery.ts +0 -41
  52. package/src/queries/DeleteQuery.ts +0 -54
  53. package/src/queries/MutationQuery.ts +0 -287
  54. package/src/queries/QueryContext.ts +0 -41
  55. package/src/queries/QueryFactory.ts +0 -275
  56. package/src/queries/QueryParser.ts +0 -79
  57. package/src/queries/SelectQuery.ts +0 -2101
  58. package/src/queries/UpdateQuery.ts +0 -47
  59. package/src/shapes/List.ts +0 -52
  60. package/src/shapes/SHACL.ts +0 -653
  61. package/src/shapes/Shape.ts +0 -282
  62. package/src/test-helpers/query-fixtures.ts +0 -313
  63. package/src/tests/core-utils.test.ts +0 -286
  64. package/src/tests/metadata.test.ts +0 -65
  65. package/src/tests/query.test.ts +0 -599
  66. package/src/tests/query.types.test.ts +0 -606
  67. package/src/tests/store-routing.test.ts +0 -133
  68. package/src/utils/LinkedErrorLogging.ts +0 -25
  69. package/src/utils/LinkedFileStorage.ts +0 -75
  70. package/src/utils/LinkedStorage.ts +0 -120
  71. package/src/utils/NameSpace.ts +0 -5
  72. package/src/utils/NodeReference.ts +0 -16
  73. package/src/utils/Package.ts +0 -681
  74. package/src/utils/Prefix.ts +0 -108
  75. package/src/utils/ShapeClass.ts +0 -335
  76. package/src/utils/Types.ts +0 -19
  77. package/src/utils/URI.ts +0 -40
  78. package/src/utils/cached.ts +0 -53
  79. package/tsconfig-cjs.json +0 -8
  80. package/tsconfig-esm.json +0 -9
  81. package/tsconfig.json +0 -29
@@ -1,599 +0,0 @@
1
- import {describe, expect, test} from '@jest/globals';
2
- import {Shape} from '../shapes/Shape';
3
- import {SelectQueryFactory} from '../queries/SelectQuery';
4
- import {IQueryParser} from '../interfaces/IQueryParser';
5
- import {DeleteResponse} from '../queries/DeleteQuery';
6
- import {CreateResponse} from '../queries/CreateQuery';
7
- import {AddId, NodeReferenceValue, UpdatePartial} from '../queries/QueryFactory';
8
- import {UpdateQueryFactory} from '../queries/UpdateQuery';
9
- import {CreateQueryFactory} from '../queries/CreateQuery';
10
- import {DeleteQueryFactory} from '../queries/DeleteQuery';
11
- import {NodeId} from '../queries/MutationQuery';
12
- import {Dog, Person, Pet, queryFactories, name as namePath, tmpEntityBase} from '../test-helpers/query-fixtures';
13
- import {setQueryContext} from '../queries/QueryContext';
14
-
15
- class QueryCaptureStore implements IQueryParser {
16
- lastQuery?: any;
17
-
18
- async selectQuery<ResultType>(query: SelectQueryFactory<Shape>) {
19
- this.lastQuery = query.getQueryObject();
20
- return [] as ResultType;
21
- }
22
-
23
- async createQuery<ShapeType extends Shape, U extends UpdatePartial<ShapeType>>(
24
- updateObjectOrFn: U,
25
- shapeClass: typeof Shape,
26
- ): Promise<CreateResponse<U>> {
27
- const factory = new CreateQueryFactory(shapeClass, updateObjectOrFn);
28
- this.lastQuery = factory.getQueryObject();
29
- return {} as CreateResponse<U>;
30
- }
31
-
32
- async updateQuery<ShapeType extends Shape, U extends UpdatePartial<ShapeType>>(
33
- id: string | NodeReferenceValue,
34
- updateObjectOrFn: U,
35
- shapeClass: typeof Shape,
36
- ): Promise<AddId<U>> {
37
- const factory = new UpdateQueryFactory(shapeClass, id, updateObjectOrFn);
38
- this.lastQuery = factory.getQueryObject();
39
- return {} as AddId<U>;
40
- }
41
-
42
- async deleteQuery(
43
- id: NodeId | NodeId[] | NodeReferenceValue[],
44
- shapeClass: typeof Shape,
45
- ): Promise<DeleteResponse> {
46
- const ids = (Array.isArray(id) ? id : [id]) as NodeId[];
47
- const factory = new DeleteQueryFactory(shapeClass, ids);
48
- this.lastQuery = factory.getQueryObject();
49
- return {deleted: [], count: 0};
50
- }
51
- }
52
-
53
- const store = new QueryCaptureStore();
54
- Person.queryParser = store;
55
- Pet.queryParser = store;
56
- Dog.queryParser = store;
57
-
58
- const captureQuery = async (runner: () => Promise<unknown>) => {
59
- store.lastQuery = undefined;
60
- await runner();
61
- return store.lastQuery;
62
- };
63
-
64
- const expectSelectQuery = (query: any) => {
65
- expect(query).toBeDefined();
66
- expect(query?.type).toBe('select');
67
- expect(query?.select).toBeDefined();
68
- };
69
-
70
- const expectWhere = (query: any) => {
71
- const whereStep = query?.where ?? query?.select?.[0]?.[0]?.where;
72
- expect(whereStep).toBeDefined();
73
- };
74
-
75
- setQueryContext('user', {id: 'user-1'}, Person);
76
-
77
- describe('1. Basic Property Selection', () => {
78
- test('can select a literal property of all instances', async () => {
79
- const query = await captureQuery(() => queryFactories.selectName());
80
-
81
- expectSelectQuery(query);
82
- expect(query?.select[0][0].property.label).toBe('name');
83
- });
84
-
85
- test('can select an object property of all instances', async () => {
86
- const query = await captureQuery(() => queryFactories.selectFriends());
87
-
88
- expectSelectQuery(query);
89
- expect(query?.select[0][0].property.label).toBe('friends');
90
- });
91
-
92
- test('can select a date', async () => {
93
- const query = await captureQuery(() => queryFactories.selectBirthDate());
94
-
95
- expectSelectQuery(query);
96
- expect(query?.select[0][0].property.label).toBe('birthDate');
97
- });
98
-
99
- test('can select a boolean', async () => {
100
- const query = await captureQuery(() => queryFactories.selectIsRealPerson());
101
-
102
- expectSelectQuery(query);
103
- expect(query?.select[0][0].property.label).toBe('isRealPerson');
104
- });
105
-
106
- test('can select properties of a specific subject', async () => {
107
- const query = await captureQuery(() => queryFactories.selectById());
108
-
109
- expectSelectQuery(query);
110
- expect(query?.subject).toEqual({id: `${tmpEntityBase}p1`});
111
- expect(query?.singleResult).toBe(true);
112
- });
113
-
114
- test('can select properties of a specific subject by ID reference', async () => {
115
- const query = await captureQuery(() => queryFactories.selectByIdReference());
116
-
117
- expectSelectQuery(query);
118
- expect(query?.subject).toEqual({id: `${tmpEntityBase}p1`});
119
- expect(query?.singleResult).toBe(true);
120
- });
121
-
122
- test('select with a non existing returns undefined (query object still exists)', async () => {
123
- const query = await captureQuery(() => queryFactories.selectNonExisting());
124
-
125
- expectSelectQuery(query);
126
- expect(query?.subject).toEqual({id: 'https://does.not/exist'});
127
- expect(query?.singleResult).toBe(true);
128
- });
129
-
130
- test('selecting only undefined properties returns an empty object (query still captures)', async () => {
131
- const query = await captureQuery(() => queryFactories.selectUndefinedOnly());
132
-
133
- expectSelectQuery(query);
134
- expect(query?.select?.[0]?.length).toBeGreaterThan(0);
135
- });
136
- });
137
-
138
- describe('2. Nested & Path Selection', () => {
139
- test('can select sub properties of a first property that returns a set', async () => {
140
- const query = await captureQuery(() => queryFactories.selectFriendsName());
141
-
142
- expectSelectQuery(query);
143
- expect(query?.select[0][0].property.label).toBe('friends');
144
- expect(query?.select[0][1].property.label).toBe('name');
145
- });
146
-
147
- test('can select a nested set of shapes', async () => {
148
- const query = await captureQuery(() =>
149
- queryFactories.selectNestedFriendsName(),
150
- );
151
-
152
- expectSelectQuery(query);
153
- expect(query?.select[0][0].property.label).toBe('friends');
154
- });
155
-
156
- test('can select multiple property paths', async () => {
157
- const query = await captureQuery(() => queryFactories.selectMultiplePaths());
158
-
159
- expectSelectQuery(query);
160
- expect(query?.select).toHaveLength(3);
161
- });
162
-
163
- test('can select property of single shape value', async () => {
164
- const query = await captureQuery(() => queryFactories.selectBestFriendName());
165
-
166
- expectSelectQuery(query);
167
- expect(query?.select[0][0].property.label).toBe('bestFriend');
168
- });
169
-
170
- test('can select 3 level deep nested paths', async () => {
171
- const query = await captureQuery(() => queryFactories.selectDeepNested());
172
-
173
- expectSelectQuery(query);
174
- expect(query?.select[0][0].property.label).toBe('friends');
175
- });
176
- });
177
-
178
- describe('3. Filtering (Where Clauses)', () => {
179
- test('can use where() to filter a string in a set of Literals with equals', async () => {
180
- const query = await captureQuery(() =>
181
- queryFactories.whereFriendsNameEquals(),
182
- );
183
-
184
- expectSelectQuery(query);
185
- expectWhere(query);
186
- });
187
-
188
- test('where object value', async () => {
189
- const query = await captureQuery(() => queryFactories.whereBestFriendEquals());
190
-
191
- expectSelectQuery(query);
192
- expectWhere(query);
193
- });
194
-
195
- test('where on literal', async () => {
196
- const query = await captureQuery(() => queryFactories.whereHobbyEquals());
197
-
198
- expectSelectQuery(query);
199
- expectWhere(query);
200
- });
201
-
202
- test('where and', async () => {
203
- const query = await captureQuery(() => queryFactories.whereAnd());
204
-
205
- expectSelectQuery(query);
206
- expectWhere(query);
207
- });
208
-
209
- test('where or', async () => {
210
- const query = await captureQuery(() => queryFactories.whereOr());
211
-
212
- expectSelectQuery(query);
213
- expectWhere(query);
214
- });
215
-
216
- test('select all', async () => {
217
- const query = await captureQuery(() => queryFactories.selectAll());
218
-
219
- expectSelectQuery(query);
220
- });
221
-
222
- test('empty select with where', async () => {
223
- const query = await captureQuery(() => queryFactories.selectWhereNameSemmy());
224
-
225
- expectSelectQuery(query);
226
- expectWhere(query);
227
- });
228
-
229
- test('where and or and', async () => {
230
- const query = await captureQuery(() => queryFactories.whereAndOrAnd());
231
-
232
- expectSelectQuery(query);
233
- expectWhere(query);
234
- });
235
-
236
- test('where and or and (nested)', async () => {
237
- const query = await captureQuery(() => queryFactories.whereAndOrAndNested());
238
-
239
- expectSelectQuery(query);
240
- expectWhere(query);
241
- });
242
-
243
- test('where some implicit', async () => {
244
- const query = await captureQuery(() => queryFactories.whereSomeImplicit());
245
-
246
- expectSelectQuery(query);
247
- expectWhere(query);
248
- });
249
-
250
- test('where some explicit', async () => {
251
- const query = await captureQuery(() => queryFactories.whereSomeExplicit());
252
-
253
- expectSelectQuery(query);
254
- expectWhere(query);
255
- });
256
-
257
- test('where every', async () => {
258
- const query = await captureQuery(() => queryFactories.whereEvery());
259
-
260
- expectSelectQuery(query);
261
- expectWhere(query);
262
- });
263
-
264
- test('where sequences', async () => {
265
- const query = await captureQuery(() => queryFactories.whereSequences());
266
-
267
- expectSelectQuery(query);
268
- expectWhere(query);
269
- });
270
-
271
- test('outer where()', async () => {
272
- const query = await captureQuery(() => queryFactories.outerWhere());
273
-
274
- expectSelectQuery(query);
275
- expectWhere(query);
276
- });
277
-
278
- test('where with query context', async () => {
279
- const query = await captureQuery(() => queryFactories.whereWithContext());
280
-
281
- expectSelectQuery(query);
282
- expectWhere(query);
283
- expect(query?.where?.path?.[0]?.property?.label).toBe('bestFriend');
284
- expect(query?.where?.args?.[0]).toEqual({
285
- id: 'user-1',
286
- shape: {id: Person.shape.id},
287
- });
288
- });
289
-
290
- test('where with query context as base of property path', async () => {
291
- const query = await captureQuery(() => queryFactories.whereWithContextPath());
292
-
293
- expectSelectQuery(query);
294
- expectWhere(query);
295
- expect(query?.where?.method).toBe('some');
296
- const nestedWhere = query?.where?.args?.[0];
297
- expect(nestedWhere?.method).toBe('=');
298
- expect(nestedWhere?.path?.[0]?.property?.label).toBe('name');
299
- expect(nestedWhere?.args?.[0]?.subject).toEqual({
300
- id: 'user-1',
301
- shape: {id: Person.shape.id},
302
- });
303
- expect(nestedWhere?.args?.[0]?.path?.[0]?.property?.label).toBe('name');
304
- });
305
- });
306
-
307
- describe('4. Aggregation & Sub-Select', () => {
308
- test('count a shapeset', async () => {
309
- const query = await captureQuery(() => queryFactories.countFriends());
310
-
311
- expectSelectQuery(query);
312
- expect(query?.select?.[0]?.some((step: any) => step?.count)).toBe(true);
313
- });
314
-
315
- test('count a nested property', async () => {
316
- const query = await captureQuery(() => queryFactories.countNestedFriends());
317
-
318
- expectSelectQuery(query);
319
- });
320
-
321
- test('labeling the key of count()', async () => {
322
- const query = await captureQuery(() => queryFactories.countLabel());
323
-
324
- expectSelectQuery(query);
325
- expect(query?.select).toBeDefined();
326
- });
327
-
328
- test('nested object property', async () => {
329
- const query = await captureQuery(() => queryFactories.nestedObjectProperty());
330
-
331
- expectSelectQuery(query);
332
- });
333
-
334
- test('nested object property (single)', async () => {
335
- const query = await captureQuery(() =>
336
- queryFactories.nestedObjectPropertySingle(),
337
- );
338
-
339
- expectSelectQuery(query);
340
- });
341
-
342
- test('sub select single prop', async () => {
343
- const query = await captureQuery(() => queryFactories.subSelectSingleProp());
344
-
345
- expectSelectQuery(query);
346
- });
347
-
348
- test('sub select plural prop - custom object', async () => {
349
- const query = await captureQuery(() => queryFactories.subSelectPluralCustom());
350
-
351
- expectSelectQuery(query);
352
- });
353
-
354
- test('double nested sub select', async () => {
355
- const query = await captureQuery(() => queryFactories.doubleNestedSubSelect());
356
-
357
- expectSelectQuery(query);
358
- });
359
-
360
- test('sub select all primitives', async () => {
361
- const query = await captureQuery(() => queryFactories.subSelectAllPrimitives());
362
-
363
- expectSelectQuery(query);
364
- });
365
-
366
- test('custom result object - equals without where returns a boolean', async () => {
367
- const query = await captureQuery(() =>
368
- queryFactories.customResultEqualsBoolean(),
369
- );
370
-
371
- expectSelectQuery(query);
372
- });
373
-
374
- test('custom result object 2', async () => {
375
- const query = await captureQuery(() => queryFactories.customResultNumFriends());
376
-
377
- expectSelectQuery(query);
378
- });
379
-
380
- test('count equals', async () => {
381
- const query = await captureQuery(() => queryFactories.countEquals());
382
-
383
- expectSelectQuery(query);
384
- expectWhere(query);
385
- });
386
-
387
- test('sub select query returning an array', async () => {
388
- const query = await captureQuery(() => queryFactories.subSelectArray());
389
-
390
- expectSelectQuery(query);
391
- });
392
- });
393
-
394
- describe('5. Type Casting & Transformations', () => {
395
- test('select shapeset as', async () => {
396
- const query = await captureQuery(() => queryFactories.selectShapeSetAs());
397
-
398
- expectSelectQuery(query);
399
- });
400
-
401
- test('select non existing returns null or empty array for multiple value properties', async () => {
402
- const query = await captureQuery(() =>
403
- queryFactories.selectNonExistingMultiple(),
404
- );
405
-
406
- expectSelectQuery(query);
407
- });
408
-
409
- test('select shape as', async () => {
410
- const query = await captureQuery(() => queryFactories.selectShapeAs());
411
-
412
- expectSelectQuery(query);
413
- });
414
-
415
- test('select one', async () => {
416
- const query = await captureQuery(() => queryFactories.selectOne());
417
-
418
- expectSelectQuery(query);
419
- expect(query?.singleResult).toBe(true);
420
- });
421
-
422
- test('nested queries 2', async () => {
423
- const query = await captureQuery(() => queryFactories.nestedQueries2());
424
-
425
- expectSelectQuery(query);
426
- });
427
-
428
- test('select duplicate paths', async () => {
429
- const query = await captureQuery(() => queryFactories.selectDuplicatePaths());
430
-
431
- expectSelectQuery(query);
432
- });
433
- });
434
-
435
- describe('6. Preload (Component-like Queries)', () => {
436
- test('can preload a component query onto a property path', async () => {
437
- const query = await captureQuery(() => queryFactories.preloadBestFriend());
438
-
439
- expectSelectQuery(query);
440
- expect(query?.select[0][0].property.label).toBe('bestFriend');
441
- expect(query?.select[0][1]?.name?.[0]?.property?.label).toBe('name');
442
- });
443
- });
444
-
445
- describe('7. Sorting & Limiting', () => {
446
- test('outer where with limit', async () => {
447
- const query = await captureQuery(() => queryFactories.outerWhereLimit());
448
-
449
- expectSelectQuery(query);
450
- expect(query?.limit).toBe(1);
451
- });
452
-
453
- test('sort by 1 property - ASC (default)', async () => {
454
- const query = await captureQuery(() => queryFactories.sortByAsc());
455
-
456
- expectSelectQuery(query);
457
- expect(query?.sortBy?.direction).toBe('ASC');
458
- });
459
-
460
- test('sort by 1 property - DESC', async () => {
461
- const query = await captureQuery(() => queryFactories.sortByDesc());
462
-
463
- expectSelectQuery(query);
464
- expect(query?.sortBy?.direction).toBe('DESC');
465
- });
466
- });
467
-
468
- describe('8. CRUD Operations (Create, Update, Delete)', () => {
469
- test('update query 1 - with simple object argument', async () => {
470
- const query = await captureQuery(() => queryFactories.updateSimple());
471
-
472
- expect(query?.type).toBe('update');
473
- expect(query?.id).toBe(`${tmpEntityBase}p1`);
474
- });
475
-
476
- test('create query 1 - create simple person with literal fields', async () => {
477
- const query = await captureQuery(() => queryFactories.createSimple());
478
-
479
- expect(query?.type).toBe('create');
480
- });
481
-
482
- test('create query 2 - create person with new and existing friends', async () => {
483
- const query = await captureQuery(() => queryFactories.createWithFriends());
484
-
485
- expect(query?.type).toBe('create');
486
- });
487
-
488
- test('create query 3 - create a new person with a fixed ID', async () => {
489
- const query = await captureQuery(() => queryFactories.createWithFixedId());
490
-
491
- expect(query?.type).toBe('create');
492
- });
493
-
494
- test('delete query 1 - delete newly created node', async () => {
495
- const query = await captureQuery(() => queryFactories.deleteSingle());
496
-
497
- expect(query?.type).toBe('delete');
498
- expect(query?.ids?.[0]).toEqual({id: `${tmpEntityBase}to-delete`});
499
- });
500
-
501
- test('delete query 2 - delete newly created node by node reference', async () => {
502
- const query = await captureQuery(() => queryFactories.deleteSingleRef());
503
-
504
- expect(query?.type).toBe('delete');
505
- });
506
-
507
- test('delete query 3 - delete multiple newly created nodes', async () => {
508
- const query = await captureQuery(() => queryFactories.deleteMultiple());
509
-
510
- expect(query?.type).toBe('delete');
511
- expect(query?.ids).toHaveLength(2);
512
- });
513
-
514
- test('delete query 4 - delete multiple newly created nodes by passing the full result objects', async () => {
515
- const query = await captureQuery(() => queryFactories.deleteMultipleFull());
516
-
517
- expect(query?.type).toBe('delete');
518
- });
519
-
520
- test('update query 2 - overwrite a set (default)', async () => {
521
- const query = await captureQuery(() => queryFactories.updateOverwriteSet());
522
-
523
- expect(query?.type).toBe('update');
524
- });
525
-
526
- test('update query 3 - unset a single value property', async () => {
527
- const query = await captureQuery(() =>
528
- queryFactories.updateUnsetSingleUndefined(),
529
- );
530
-
531
- expect(query?.type).toBe('update');
532
- });
533
-
534
- test('update query 3B - unset a single value property with null', async () => {
535
- const query = await captureQuery(() => queryFactories.updateUnsetSingleNull());
536
-
537
- expect(query?.type).toBe('update');
538
- });
539
-
540
- test('update query 4 - overwrite a nested object argument', async () => {
541
- const query = await captureQuery(() => queryFactories.updateOverwriteNested());
542
-
543
- expect(query?.type).toBe('update');
544
- });
545
-
546
- test('update query 5 - pass id references', async () => {
547
- const query = await captureQuery(() => queryFactories.updatePassIdReferences());
548
-
549
- expect(query?.type).toBe('update');
550
- });
551
-
552
- test('update query 6 - add to and remove from Multi-Value Property (friends)', async () => {
553
- const query = await captureQuery(() => queryFactories.updateAddRemoveMulti());
554
-
555
- expect(query?.type).toBe('update');
556
- });
557
-
558
- test('update query 7 - remove from Multi-Value Property (friends)', async () => {
559
- const query = await captureQuery(() => queryFactories.updateRemoveMulti());
560
-
561
- expect(query?.type).toBe('update');
562
- });
563
-
564
- test('update query 8 - $add and $remove in same update', async () => {
565
- const query = await captureQuery(() => queryFactories.updateAddRemoveSame());
566
-
567
- expect(query?.type).toBe('update');
568
- });
569
-
570
- test('update query 9 - unset Multi-Value Property with undefined', async () => {
571
- const query = await captureQuery(() =>
572
- queryFactories.updateUnsetMultiUndefined(),
573
- );
574
-
575
- expect(query?.type).toBe('update');
576
- });
577
-
578
- test('update query 10 - create new nested object with predefined ID', async () => {
579
- const query = await captureQuery(() =>
580
- queryFactories.updateNestedWithPredefinedId(),
581
- );
582
-
583
- expect(query?.type).toBe('update');
584
- });
585
-
586
- test('update query 11 - update datatype: Date', async () => {
587
- const query = await captureQuery(() => queryFactories.updateBirthDate());
588
-
589
- expect(query?.type).toBe('update');
590
- });
591
- });
592
-
593
- describe('8. NodeReferenceValue', () => {
594
- test('property paths normalize to NodeReferenceValue', () => {
595
- const property = Person.shape.getPropertyShape('name');
596
- expect(property).toBeDefined();
597
- expect(property?.path).toEqual(namePath);
598
- });
599
- });