@twin.org/auditable-item-graph-models 0.0.1-next.41 → 0.0.1-next.43

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.
@@ -30,6 +30,10 @@ const AuditableItemGraphTypes = {
30
30
  * Represents auditable item graph vertex.
31
31
  */
32
32
  Vertex: "AuditableItemGraphVertex",
33
+ /**
34
+ * Represents auditable item graph vertex list.
35
+ */
36
+ VertexList: "AuditableItemGraphVertexList",
33
37
  /**
34
38
  * Represents auditable item graph alias.
35
39
  */
@@ -52,8 +56,11 @@ const AuditableItemGraphTypes = {
52
56
  PatchOperation: "AuditableItemGraphPatchOperation"
53
57
  };
54
58
 
55
- var type$5 = "object";
56
- var properties$5 = {
59
+ var $schema$6 = "https://json-schema.org/draft/2020-12/schema";
60
+ var $id$6 = "https://schema.twindev.org/aig/AuditableItemGraphAlias";
61
+ var description$6 = "Interface describing an alias for a vertex.";
62
+ var type$6 = "object";
63
+ var properties$6 = {
57
64
  id: {
58
65
  type: "string",
59
66
  description: "The id of the element."
@@ -79,15 +86,15 @@ var properties$5 = {
79
86
  {
80
87
  type: "array",
81
88
  minItems: 1,
82
- items: [
89
+ items: {
90
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
91
+ },
92
+ prefixItems: [
83
93
  {
84
94
  type: "string",
85
95
  "const": "https://schema.twindev.org/aig/"
86
96
  }
87
- ],
88
- additionalItems: {
89
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
90
- }
97
+ ]
91
98
  }
92
99
  ],
93
100
  description: "JSON-LD Context."
@@ -106,27 +113,35 @@ var properties$5 = {
106
113
  description: "The format of the id in the alias."
107
114
  }
108
115
  };
109
- var required$5 = [
116
+ var required$6 = [
110
117
  "@context",
111
118
  "id",
112
119
  "type"
113
120
  ];
114
- var additionalProperties$5 = false;
115
- var description$5 = "Interface describing an alias for a vertex.";
121
+ var additionalProperties$6 = false;
116
122
  var AuditableItemGraphAliasSchema = {
117
- type: type$5,
118
- properties: properties$5,
119
- required: required$5,
120
- additionalProperties: additionalProperties$5,
121
- description: description$5
123
+ $schema: $schema$6,
124
+ $id: $id$6,
125
+ description: description$6,
126
+ type: type$6,
127
+ properties: properties$6,
128
+ required: required$6,
129
+ additionalProperties: additionalProperties$6
122
130
  };
123
131
 
124
- var type$4 = "object";
125
- var properties$4 = {
132
+ var $schema$5 = "https://json-schema.org/draft/2020-12/schema";
133
+ var $id$5 = "https://schema.twindev.org/aig/AuditableItemGraphChangeset";
134
+ var description$5 = "Interface describing a set of changes to the vertex.";
135
+ var type$5 = "object";
136
+ var properties$5 = {
126
137
  "@context": {
127
138
  type: "array",
128
139
  minItems: 2,
129
- items: [
140
+ items: {
141
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
142
+ },
143
+ description: "JSON-LD Context.",
144
+ prefixItems: [
130
145
  {
131
146
  type: "string",
132
147
  "const": "https://schema.twindev.org/aig/"
@@ -135,11 +150,7 @@ var properties$4 = {
135
150
  type: "string",
136
151
  "const": "https://schema.twindev.org/common/"
137
152
  }
138
- ],
139
- additionalItems: {
140
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
141
- },
142
- description: "JSON-LD Context."
153
+ ]
143
154
  },
144
155
  type: {
145
156
  type: "string",
@@ -160,10 +171,13 @@ var properties$4 = {
160
171
  },
161
172
  patches: {
162
173
  type: "array",
163
- items: {
164
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation"
165
- },
166
- description: "The patches in the changeset."
174
+ items: false,
175
+ description: "The patches in the changeset.",
176
+ prefixItems: [
177
+ {
178
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation"
179
+ }
180
+ ]
167
181
  },
168
182
  proofId: {
169
183
  type: "string",
@@ -174,7 +188,7 @@ var properties$4 = {
174
188
  description: "The verification for the changeset."
175
189
  }
176
190
  };
177
- var required$4 = [
191
+ var required$5 = [
178
192
  "@context",
179
193
  "type",
180
194
  "id",
@@ -182,18 +196,22 @@ var required$4 = [
182
196
  "userIdentity",
183
197
  "patches"
184
198
  ];
185
- var additionalProperties$4 = false;
186
- var description$4 = "Interface describing a set of changes to the vertex.";
199
+ var additionalProperties$5 = false;
187
200
  var AuditableItemGraphChangesetSchema = {
188
- type: type$4,
189
- properties: properties$4,
190
- required: required$4,
191
- additionalProperties: additionalProperties$4,
192
- description: description$4
201
+ $schema: $schema$5,
202
+ $id: $id$5,
203
+ description: description$5,
204
+ type: type$5,
205
+ properties: properties$5,
206
+ required: required$5,
207
+ additionalProperties: additionalProperties$5
193
208
  };
194
209
 
195
- var type$3 = "object";
196
- var properties$3 = {
210
+ var $schema$4 = "https://json-schema.org/draft/2020-12/schema";
211
+ var $id$4 = "https://schema.twindev.org/aig/AuditableItemGraphEdge";
212
+ var description$4 = "Interface describing an edge between two vertices in an auditable item graph.";
213
+ var type$4 = "object";
214
+ var properties$4 = {
197
215
  id: {
198
216
  type: "string",
199
217
  description: "The id of the element."
@@ -219,15 +237,15 @@ var properties$3 = {
219
237
  {
220
238
  type: "array",
221
239
  minItems: 1,
222
- items: [
240
+ items: {
241
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
242
+ },
243
+ prefixItems: [
223
244
  {
224
245
  type: "string",
225
246
  "const": "https://schema.twindev.org/aig/"
226
247
  }
227
- ],
228
- additionalItems: {
229
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
230
- }
248
+ ]
231
249
  }
232
250
  ],
233
251
  description: "JSON-LD Context."
@@ -243,30 +261,37 @@ var properties$3 = {
243
261
  },
244
262
  edgeRelationships: {
245
263
  type: "array",
246
- items: {
247
- type: "string"
248
- },
249
- description: "The relationships between the two vertices."
264
+ items: false,
265
+ description: "The relationships between the two vertices.",
266
+ prefixItems: [
267
+ {
268
+ type: "string"
269
+ }
270
+ ]
250
271
  }
251
272
  };
252
- var required$3 = [
273
+ var required$4 = [
253
274
  "@context",
254
275
  "id",
255
276
  "type",
256
277
  "edgeRelationships"
257
278
  ];
258
- var additionalProperties$3 = false;
259
- var description$3 = "Interface describing an edge between two vertices in an auditable item graph.";
279
+ var additionalProperties$4 = false;
260
280
  var AuditableItemGraphEdgeSchema = {
261
- type: type$3,
262
- properties: properties$3,
263
- required: required$3,
264
- additionalProperties: additionalProperties$3,
265
- description: description$3
281
+ $schema: $schema$4,
282
+ $id: $id$4,
283
+ description: description$4,
284
+ type: type$4,
285
+ properties: properties$4,
286
+ required: required$4,
287
+ additionalProperties: additionalProperties$4
266
288
  };
267
289
 
268
- var type$2 = "object";
269
- var properties$2 = {
290
+ var $schema$3 = "https://json-schema.org/draft/2020-12/schema";
291
+ var $id$3 = "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation";
292
+ var description$3 = "The patch operation for JSON diffs.";
293
+ var type$3 = "object";
294
+ var properties$3 = {
270
295
  "@context": {
271
296
  anyOf: [
272
297
  {
@@ -276,15 +301,15 @@ var properties$2 = {
276
301
  {
277
302
  type: "array",
278
303
  minItems: 1,
279
- items: [
304
+ items: {
305
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
306
+ },
307
+ prefixItems: [
280
308
  {
281
309
  type: "string",
282
310
  "const": "https://schema.twindev.org/aig/"
283
311
  }
284
- ],
285
- additionalItems: {
286
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
287
- }
312
+ ]
288
313
  }
289
314
  ],
290
315
  description: "JSON-LD Context."
@@ -318,24 +343,28 @@ var properties$2 = {
318
343
  description: "The value to add."
319
344
  }
320
345
  };
321
- var required$2 = [
346
+ var required$3 = [
322
347
  "@context",
323
348
  "type",
324
349
  "patchOperation",
325
350
  "patchPath"
326
351
  ];
327
- var additionalProperties$2 = false;
328
- var description$2 = "The patch operation for JSON diffs.";
352
+ var additionalProperties$3 = false;
329
353
  var AuditableItemGraphPatchOperationSchema = {
330
- type: type$2,
331
- properties: properties$2,
332
- required: required$2,
333
- additionalProperties: additionalProperties$2,
334
- description: description$2
354
+ $schema: $schema$3,
355
+ $id: $id$3,
356
+ description: description$3,
357
+ type: type$3,
358
+ properties: properties$3,
359
+ required: required$3,
360
+ additionalProperties: additionalProperties$3
335
361
  };
336
362
 
337
- var type$1 = "object";
338
- var properties$1 = {
363
+ var $schema$2 = "https://json-schema.org/draft/2020-12/schema";
364
+ var $id$2 = "https://schema.twindev.org/aig/AuditableItemGraphResource";
365
+ var description$2 = "Interface describing an auditable item graph vertex resource.";
366
+ var type$2 = "object";
367
+ var properties$2 = {
339
368
  id: {
340
369
  type: "string",
341
370
  description: "The id of the element."
@@ -361,15 +390,15 @@ var properties$1 = {
361
390
  {
362
391
  type: "array",
363
392
  minItems: 1,
364
- items: [
393
+ items: {
394
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
395
+ },
396
+ prefixItems: [
365
397
  {
366
398
  type: "string",
367
399
  "const": "https://schema.twindev.org/aig/"
368
400
  }
369
- ],
370
- additionalItems: {
371
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
372
- }
401
+ ]
373
402
  }
374
403
  ],
375
404
  description: "JSON-LD Context."
@@ -384,22 +413,26 @@ var properties$1 = {
384
413
  description: "The JSON-LD object for the resource."
385
414
  }
386
415
  };
387
- var required$1 = [
416
+ var required$2 = [
388
417
  "@context",
389
418
  "type"
390
419
  ];
391
- var additionalProperties$1 = false;
392
- var description$1 = "Interface describing an auditable item graph vertex resource.";
420
+ var additionalProperties$2 = false;
393
421
  var AuditableItemGraphResourceSchema = {
394
- type: type$1,
395
- properties: properties$1,
396
- required: required$1,
397
- additionalProperties: additionalProperties$1,
398
- description: description$1
422
+ $schema: $schema$2,
423
+ $id: $id$2,
424
+ description: description$2,
425
+ type: type$2,
426
+ properties: properties$2,
427
+ required: required$2,
428
+ additionalProperties: additionalProperties$2
399
429
  };
400
430
 
401
- var type = "object";
402
- var properties = {
431
+ var $schema$1 = "https://json-schema.org/draft/2020-12/schema";
432
+ var $id$1 = "https://schema.twindev.org/aig/AuditableItemGraphVertex";
433
+ var description$1 = "Interface describing an auditable item graph vertex.";
434
+ var type$1 = "object";
435
+ var properties$1 = {
403
436
  id: {
404
437
  type: "string",
405
438
  description: "The id of the element."
@@ -419,7 +452,11 @@ var properties = {
419
452
  "@context": {
420
453
  type: "array",
421
454
  minItems: 2,
422
- items: [
455
+ items: {
456
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
457
+ },
458
+ description: "JSON-LD Context.",
459
+ prefixItems: [
423
460
  {
424
461
  type: "string",
425
462
  "const": "https://schema.twindev.org/aig/"
@@ -428,11 +465,7 @@ var properties = {
428
465
  type: "string",
429
466
  "const": "https://schema.twindev.org/common/"
430
467
  }
431
- ],
432
- additionalItems: {
433
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
434
- },
435
- description: "JSON-LD Context."
468
+ ]
436
469
  },
437
470
  type: {
438
471
  type: "string",
@@ -449,50 +482,134 @@ var properties = {
449
482
  },
450
483
  aliases: {
451
484
  type: "array",
452
- items: {
453
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphAlias"
454
- },
455
- description: "Alternative aliases that can be used to identify the vertex."
485
+ items: false,
486
+ description: "Alternative aliases that can be used to identify the vertex.",
487
+ prefixItems: [
488
+ {
489
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphAlias"
490
+ }
491
+ ]
456
492
  },
457
493
  resources: {
458
494
  type: "array",
459
- items: {
460
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphResource"
461
- },
462
- description: "The resources attached to the vertex."
495
+ items: false,
496
+ description: "The resources attached to the vertex.",
497
+ prefixItems: [
498
+ {
499
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphResource"
500
+ }
501
+ ]
463
502
  },
464
503
  edges: {
465
504
  type: "array",
466
- items: {
467
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphEdge"
468
- },
469
- description: "Edges connected to the vertex."
505
+ items: false,
506
+ description: "Edges connected to the vertex.",
507
+ prefixItems: [
508
+ {
509
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphEdge"
510
+ }
511
+ ]
470
512
  },
471
513
  changesets: {
472
514
  type: "array",
473
- items: {
474
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphChangeset"
475
- },
476
- description: "Changesets for the vertex."
515
+ items: false,
516
+ description: "Changesets for the vertex.",
517
+ prefixItems: [
518
+ {
519
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphChangeset"
520
+ }
521
+ ]
477
522
  },
478
523
  verified: {
479
524
  type: "boolean",
480
525
  description: "Is the vertex verified, will only be populated when verification is requested."
481
526
  }
482
527
  };
483
- var required = [
528
+ var required$1 = [
484
529
  "@context",
485
530
  "id",
486
531
  "type"
487
532
  ];
488
- var additionalProperties = false;
489
- var description = "Interface describing an auditable item graph vertex.";
533
+ var additionalProperties$1 = false;
490
534
  var AuditableItemGraphVertexSchema = {
535
+ $schema: $schema$1,
536
+ $id: $id$1,
537
+ description: description$1,
538
+ type: type$1,
539
+ properties: properties$1,
540
+ required: required$1,
541
+ additionalProperties: additionalProperties$1
542
+ };
543
+
544
+ var $schema = "https://json-schema.org/draft/2020-12/schema";
545
+ var $id = "https://schema.twindev.org/aig/AuditableItemGraphVertexList";
546
+ var description = "Interface describing an auditable item graph vertex list.";
547
+ var type = "object";
548
+ var properties = {
549
+ "@context": {
550
+ type: "array",
551
+ minItems: 2,
552
+ items: {
553
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
554
+ },
555
+ description: "JSON-LD Context.",
556
+ prefixItems: [
557
+ {
558
+ type: "string",
559
+ "const": "https://schema.org"
560
+ },
561
+ {
562
+ type: "string",
563
+ "const": "https://schema.twindev.org/aig/"
564
+ }
565
+ ]
566
+ },
567
+ type: {
568
+ type: "array",
569
+ minItems: 2,
570
+ items: false,
571
+ maxItems: 2,
572
+ description: "JSON-LD Type.",
573
+ prefixItems: [
574
+ {
575
+ type: "string",
576
+ "const": "ItemList"
577
+ },
578
+ {
579
+ type: "string",
580
+ "const": "AuditableItemGraphVertexList"
581
+ }
582
+ ]
583
+ },
584
+ itemListElement: {
585
+ type: "array",
586
+ items: false,
587
+ description: "The list of vertices.",
588
+ prefixItems: [
589
+ {
590
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphVertex"
591
+ }
592
+ ]
593
+ },
594
+ nextItem: {
595
+ type: "string",
596
+ description: "The cursor to get the next chunk of vertices."
597
+ }
598
+ };
599
+ var required = [
600
+ "@context",
601
+ "type",
602
+ "itemListElement"
603
+ ];
604
+ var additionalProperties = false;
605
+ var AuditableItemGraphVertexListSchema = {
606
+ $schema: $schema,
607
+ $id: $id,
608
+ description: description,
491
609
  type: type,
492
610
  properties: properties,
493
611
  required: required,
494
- additionalProperties: additionalProperties,
495
- description: description
612
+ additionalProperties: additionalProperties
496
613
  };
497
614
 
498
615
  // Copyright 2024 IOTA Stiftung.
@@ -511,6 +628,12 @@ class AuditableItemGraphDataTypes {
511
628
  defaultValue: {},
512
629
  jsonSchema: async () => AuditableItemGraphVertexSchema
513
630
  }));
631
+ dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.VertexList}`, () => ({
632
+ context: AuditableItemGraphContexts.ContextRoot,
633
+ type: AuditableItemGraphTypes.VertexList,
634
+ defaultValue: {},
635
+ jsonSchema: async () => AuditableItemGraphVertexListSchema
636
+ }));
514
637
  dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Alias}`, () => ({
515
638
  context: AuditableItemGraphContexts.ContextRoot,
516
639
  type: AuditableItemGraphTypes.Alias,
@@ -28,6 +28,10 @@ const AuditableItemGraphTypes = {
28
28
  * Represents auditable item graph vertex.
29
29
  */
30
30
  Vertex: "AuditableItemGraphVertex",
31
+ /**
32
+ * Represents auditable item graph vertex list.
33
+ */
34
+ VertexList: "AuditableItemGraphVertexList",
31
35
  /**
32
36
  * Represents auditable item graph alias.
33
37
  */
@@ -50,8 +54,11 @@ const AuditableItemGraphTypes = {
50
54
  PatchOperation: "AuditableItemGraphPatchOperation"
51
55
  };
52
56
 
53
- var type$5 = "object";
54
- var properties$5 = {
57
+ var $schema$6 = "https://json-schema.org/draft/2020-12/schema";
58
+ var $id$6 = "https://schema.twindev.org/aig/AuditableItemGraphAlias";
59
+ var description$6 = "Interface describing an alias for a vertex.";
60
+ var type$6 = "object";
61
+ var properties$6 = {
55
62
  id: {
56
63
  type: "string",
57
64
  description: "The id of the element."
@@ -77,15 +84,15 @@ var properties$5 = {
77
84
  {
78
85
  type: "array",
79
86
  minItems: 1,
80
- items: [
87
+ items: {
88
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
89
+ },
90
+ prefixItems: [
81
91
  {
82
92
  type: "string",
83
93
  "const": "https://schema.twindev.org/aig/"
84
94
  }
85
- ],
86
- additionalItems: {
87
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
88
- }
95
+ ]
89
96
  }
90
97
  ],
91
98
  description: "JSON-LD Context."
@@ -104,27 +111,35 @@ var properties$5 = {
104
111
  description: "The format of the id in the alias."
105
112
  }
106
113
  };
107
- var required$5 = [
114
+ var required$6 = [
108
115
  "@context",
109
116
  "id",
110
117
  "type"
111
118
  ];
112
- var additionalProperties$5 = false;
113
- var description$5 = "Interface describing an alias for a vertex.";
119
+ var additionalProperties$6 = false;
114
120
  var AuditableItemGraphAliasSchema = {
115
- type: type$5,
116
- properties: properties$5,
117
- required: required$5,
118
- additionalProperties: additionalProperties$5,
119
- description: description$5
121
+ $schema: $schema$6,
122
+ $id: $id$6,
123
+ description: description$6,
124
+ type: type$6,
125
+ properties: properties$6,
126
+ required: required$6,
127
+ additionalProperties: additionalProperties$6
120
128
  };
121
129
 
122
- var type$4 = "object";
123
- var properties$4 = {
130
+ var $schema$5 = "https://json-schema.org/draft/2020-12/schema";
131
+ var $id$5 = "https://schema.twindev.org/aig/AuditableItemGraphChangeset";
132
+ var description$5 = "Interface describing a set of changes to the vertex.";
133
+ var type$5 = "object";
134
+ var properties$5 = {
124
135
  "@context": {
125
136
  type: "array",
126
137
  minItems: 2,
127
- items: [
138
+ items: {
139
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
140
+ },
141
+ description: "JSON-LD Context.",
142
+ prefixItems: [
128
143
  {
129
144
  type: "string",
130
145
  "const": "https://schema.twindev.org/aig/"
@@ -133,11 +148,7 @@ var properties$4 = {
133
148
  type: "string",
134
149
  "const": "https://schema.twindev.org/common/"
135
150
  }
136
- ],
137
- additionalItems: {
138
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
139
- },
140
- description: "JSON-LD Context."
151
+ ]
141
152
  },
142
153
  type: {
143
154
  type: "string",
@@ -158,10 +169,13 @@ var properties$4 = {
158
169
  },
159
170
  patches: {
160
171
  type: "array",
161
- items: {
162
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation"
163
- },
164
- description: "The patches in the changeset."
172
+ items: false,
173
+ description: "The patches in the changeset.",
174
+ prefixItems: [
175
+ {
176
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation"
177
+ }
178
+ ]
165
179
  },
166
180
  proofId: {
167
181
  type: "string",
@@ -172,7 +186,7 @@ var properties$4 = {
172
186
  description: "The verification for the changeset."
173
187
  }
174
188
  };
175
- var required$4 = [
189
+ var required$5 = [
176
190
  "@context",
177
191
  "type",
178
192
  "id",
@@ -180,18 +194,22 @@ var required$4 = [
180
194
  "userIdentity",
181
195
  "patches"
182
196
  ];
183
- var additionalProperties$4 = false;
184
- var description$4 = "Interface describing a set of changes to the vertex.";
197
+ var additionalProperties$5 = false;
185
198
  var AuditableItemGraphChangesetSchema = {
186
- type: type$4,
187
- properties: properties$4,
188
- required: required$4,
189
- additionalProperties: additionalProperties$4,
190
- description: description$4
199
+ $schema: $schema$5,
200
+ $id: $id$5,
201
+ description: description$5,
202
+ type: type$5,
203
+ properties: properties$5,
204
+ required: required$5,
205
+ additionalProperties: additionalProperties$5
191
206
  };
192
207
 
193
- var type$3 = "object";
194
- var properties$3 = {
208
+ var $schema$4 = "https://json-schema.org/draft/2020-12/schema";
209
+ var $id$4 = "https://schema.twindev.org/aig/AuditableItemGraphEdge";
210
+ var description$4 = "Interface describing an edge between two vertices in an auditable item graph.";
211
+ var type$4 = "object";
212
+ var properties$4 = {
195
213
  id: {
196
214
  type: "string",
197
215
  description: "The id of the element."
@@ -217,15 +235,15 @@ var properties$3 = {
217
235
  {
218
236
  type: "array",
219
237
  minItems: 1,
220
- items: [
238
+ items: {
239
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
240
+ },
241
+ prefixItems: [
221
242
  {
222
243
  type: "string",
223
244
  "const": "https://schema.twindev.org/aig/"
224
245
  }
225
- ],
226
- additionalItems: {
227
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
228
- }
246
+ ]
229
247
  }
230
248
  ],
231
249
  description: "JSON-LD Context."
@@ -241,30 +259,37 @@ var properties$3 = {
241
259
  },
242
260
  edgeRelationships: {
243
261
  type: "array",
244
- items: {
245
- type: "string"
246
- },
247
- description: "The relationships between the two vertices."
262
+ items: false,
263
+ description: "The relationships between the two vertices.",
264
+ prefixItems: [
265
+ {
266
+ type: "string"
267
+ }
268
+ ]
248
269
  }
249
270
  };
250
- var required$3 = [
271
+ var required$4 = [
251
272
  "@context",
252
273
  "id",
253
274
  "type",
254
275
  "edgeRelationships"
255
276
  ];
256
- var additionalProperties$3 = false;
257
- var description$3 = "Interface describing an edge between two vertices in an auditable item graph.";
277
+ var additionalProperties$4 = false;
258
278
  var AuditableItemGraphEdgeSchema = {
259
- type: type$3,
260
- properties: properties$3,
261
- required: required$3,
262
- additionalProperties: additionalProperties$3,
263
- description: description$3
279
+ $schema: $schema$4,
280
+ $id: $id$4,
281
+ description: description$4,
282
+ type: type$4,
283
+ properties: properties$4,
284
+ required: required$4,
285
+ additionalProperties: additionalProperties$4
264
286
  };
265
287
 
266
- var type$2 = "object";
267
- var properties$2 = {
288
+ var $schema$3 = "https://json-schema.org/draft/2020-12/schema";
289
+ var $id$3 = "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation";
290
+ var description$3 = "The patch operation for JSON diffs.";
291
+ var type$3 = "object";
292
+ var properties$3 = {
268
293
  "@context": {
269
294
  anyOf: [
270
295
  {
@@ -274,15 +299,15 @@ var properties$2 = {
274
299
  {
275
300
  type: "array",
276
301
  minItems: 1,
277
- items: [
302
+ items: {
303
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
304
+ },
305
+ prefixItems: [
278
306
  {
279
307
  type: "string",
280
308
  "const": "https://schema.twindev.org/aig/"
281
309
  }
282
- ],
283
- additionalItems: {
284
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
285
- }
310
+ ]
286
311
  }
287
312
  ],
288
313
  description: "JSON-LD Context."
@@ -316,24 +341,28 @@ var properties$2 = {
316
341
  description: "The value to add."
317
342
  }
318
343
  };
319
- var required$2 = [
344
+ var required$3 = [
320
345
  "@context",
321
346
  "type",
322
347
  "patchOperation",
323
348
  "patchPath"
324
349
  ];
325
- var additionalProperties$2 = false;
326
- var description$2 = "The patch operation for JSON diffs.";
350
+ var additionalProperties$3 = false;
327
351
  var AuditableItemGraphPatchOperationSchema = {
328
- type: type$2,
329
- properties: properties$2,
330
- required: required$2,
331
- additionalProperties: additionalProperties$2,
332
- description: description$2
352
+ $schema: $schema$3,
353
+ $id: $id$3,
354
+ description: description$3,
355
+ type: type$3,
356
+ properties: properties$3,
357
+ required: required$3,
358
+ additionalProperties: additionalProperties$3
333
359
  };
334
360
 
335
- var type$1 = "object";
336
- var properties$1 = {
361
+ var $schema$2 = "https://json-schema.org/draft/2020-12/schema";
362
+ var $id$2 = "https://schema.twindev.org/aig/AuditableItemGraphResource";
363
+ var description$2 = "Interface describing an auditable item graph vertex resource.";
364
+ var type$2 = "object";
365
+ var properties$2 = {
337
366
  id: {
338
367
  type: "string",
339
368
  description: "The id of the element."
@@ -359,15 +388,15 @@ var properties$1 = {
359
388
  {
360
389
  type: "array",
361
390
  minItems: 1,
362
- items: [
391
+ items: {
392
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
393
+ },
394
+ prefixItems: [
363
395
  {
364
396
  type: "string",
365
397
  "const": "https://schema.twindev.org/aig/"
366
398
  }
367
- ],
368
- additionalItems: {
369
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
370
- }
399
+ ]
371
400
  }
372
401
  ],
373
402
  description: "JSON-LD Context."
@@ -382,22 +411,26 @@ var properties$1 = {
382
411
  description: "The JSON-LD object for the resource."
383
412
  }
384
413
  };
385
- var required$1 = [
414
+ var required$2 = [
386
415
  "@context",
387
416
  "type"
388
417
  ];
389
- var additionalProperties$1 = false;
390
- var description$1 = "Interface describing an auditable item graph vertex resource.";
418
+ var additionalProperties$2 = false;
391
419
  var AuditableItemGraphResourceSchema = {
392
- type: type$1,
393
- properties: properties$1,
394
- required: required$1,
395
- additionalProperties: additionalProperties$1,
396
- description: description$1
420
+ $schema: $schema$2,
421
+ $id: $id$2,
422
+ description: description$2,
423
+ type: type$2,
424
+ properties: properties$2,
425
+ required: required$2,
426
+ additionalProperties: additionalProperties$2
397
427
  };
398
428
 
399
- var type = "object";
400
- var properties = {
429
+ var $schema$1 = "https://json-schema.org/draft/2020-12/schema";
430
+ var $id$1 = "https://schema.twindev.org/aig/AuditableItemGraphVertex";
431
+ var description$1 = "Interface describing an auditable item graph vertex.";
432
+ var type$1 = "object";
433
+ var properties$1 = {
401
434
  id: {
402
435
  type: "string",
403
436
  description: "The id of the element."
@@ -417,7 +450,11 @@ var properties = {
417
450
  "@context": {
418
451
  type: "array",
419
452
  minItems: 2,
420
- items: [
453
+ items: {
454
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
455
+ },
456
+ description: "JSON-LD Context.",
457
+ prefixItems: [
421
458
  {
422
459
  type: "string",
423
460
  "const": "https://schema.twindev.org/aig/"
@@ -426,11 +463,7 @@ var properties = {
426
463
  type: "string",
427
464
  "const": "https://schema.twindev.org/common/"
428
465
  }
429
- ],
430
- additionalItems: {
431
- $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
432
- },
433
- description: "JSON-LD Context."
466
+ ]
434
467
  },
435
468
  type: {
436
469
  type: "string",
@@ -447,50 +480,134 @@ var properties = {
447
480
  },
448
481
  aliases: {
449
482
  type: "array",
450
- items: {
451
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphAlias"
452
- },
453
- description: "Alternative aliases that can be used to identify the vertex."
483
+ items: false,
484
+ description: "Alternative aliases that can be used to identify the vertex.",
485
+ prefixItems: [
486
+ {
487
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphAlias"
488
+ }
489
+ ]
454
490
  },
455
491
  resources: {
456
492
  type: "array",
457
- items: {
458
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphResource"
459
- },
460
- description: "The resources attached to the vertex."
493
+ items: false,
494
+ description: "The resources attached to the vertex.",
495
+ prefixItems: [
496
+ {
497
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphResource"
498
+ }
499
+ ]
461
500
  },
462
501
  edges: {
463
502
  type: "array",
464
- items: {
465
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphEdge"
466
- },
467
- description: "Edges connected to the vertex."
503
+ items: false,
504
+ description: "Edges connected to the vertex.",
505
+ prefixItems: [
506
+ {
507
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphEdge"
508
+ }
509
+ ]
468
510
  },
469
511
  changesets: {
470
512
  type: "array",
471
- items: {
472
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphChangeset"
473
- },
474
- description: "Changesets for the vertex."
513
+ items: false,
514
+ description: "Changesets for the vertex.",
515
+ prefixItems: [
516
+ {
517
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphChangeset"
518
+ }
519
+ ]
475
520
  },
476
521
  verified: {
477
522
  type: "boolean",
478
523
  description: "Is the vertex verified, will only be populated when verification is requested."
479
524
  }
480
525
  };
481
- var required = [
526
+ var required$1 = [
482
527
  "@context",
483
528
  "id",
484
529
  "type"
485
530
  ];
486
- var additionalProperties = false;
487
- var description = "Interface describing an auditable item graph vertex.";
531
+ var additionalProperties$1 = false;
488
532
  var AuditableItemGraphVertexSchema = {
533
+ $schema: $schema$1,
534
+ $id: $id$1,
535
+ description: description$1,
536
+ type: type$1,
537
+ properties: properties$1,
538
+ required: required$1,
539
+ additionalProperties: additionalProperties$1
540
+ };
541
+
542
+ var $schema = "https://json-schema.org/draft/2020-12/schema";
543
+ var $id = "https://schema.twindev.org/aig/AuditableItemGraphVertexList";
544
+ var description = "Interface describing an auditable item graph vertex list.";
545
+ var type = "object";
546
+ var properties = {
547
+ "@context": {
548
+ type: "array",
549
+ minItems: 2,
550
+ items: {
551
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
552
+ },
553
+ description: "JSON-LD Context.",
554
+ prefixItems: [
555
+ {
556
+ type: "string",
557
+ "const": "https://schema.org"
558
+ },
559
+ {
560
+ type: "string",
561
+ "const": "https://schema.twindev.org/aig/"
562
+ }
563
+ ]
564
+ },
565
+ type: {
566
+ type: "array",
567
+ minItems: 2,
568
+ items: false,
569
+ maxItems: 2,
570
+ description: "JSON-LD Type.",
571
+ prefixItems: [
572
+ {
573
+ type: "string",
574
+ "const": "ItemList"
575
+ },
576
+ {
577
+ type: "string",
578
+ "const": "AuditableItemGraphVertexList"
579
+ }
580
+ ]
581
+ },
582
+ itemListElement: {
583
+ type: "array",
584
+ items: false,
585
+ description: "The list of vertices.",
586
+ prefixItems: [
587
+ {
588
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphVertex"
589
+ }
590
+ ]
591
+ },
592
+ nextItem: {
593
+ type: "string",
594
+ description: "The cursor to get the next chunk of vertices."
595
+ }
596
+ };
597
+ var required = [
598
+ "@context",
599
+ "type",
600
+ "itemListElement"
601
+ ];
602
+ var additionalProperties = false;
603
+ var AuditableItemGraphVertexListSchema = {
604
+ $schema: $schema,
605
+ $id: $id,
606
+ description: description,
489
607
  type: type,
490
608
  properties: properties,
491
609
  required: required,
492
- additionalProperties: additionalProperties,
493
- description: description
610
+ additionalProperties: additionalProperties
494
611
  };
495
612
 
496
613
  // Copyright 2024 IOTA Stiftung.
@@ -509,6 +626,12 @@ class AuditableItemGraphDataTypes {
509
626
  defaultValue: {},
510
627
  jsonSchema: async () => AuditableItemGraphVertexSchema
511
628
  }));
629
+ DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.VertexList}`, () => ({
630
+ context: AuditableItemGraphContexts.ContextRoot,
631
+ type: AuditableItemGraphTypes.VertexList,
632
+ defaultValue: {},
633
+ jsonSchema: async () => AuditableItemGraphVertexListSchema
634
+ }));
512
635
  DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Alias}`, () => ({
513
636
  context: AuditableItemGraphContexts.ContextRoot,
514
637
  type: AuditableItemGraphTypes.Alias,
@@ -1,6 +1,7 @@
1
1
  import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
2
2
  import type { SchemaOrgContexts, SchemaOrgTypes } from "@twin.org/standards-schema-org";
3
3
  import type { AuditableItemGraphContexts } from "./auditableItemGraphContexts";
4
+ import type { AuditableItemGraphTypes } from "./auditableItemGraphTypes";
4
5
  import type { IAuditableItemGraphVertex } from "./IAuditableItemGraphVertex";
5
6
  /**
6
7
  * Interface describing an auditable item graph vertex list.
@@ -17,7 +18,7 @@ export interface IAuditableItemGraphVertexList {
17
18
  /**
18
19
  * JSON-LD Type.
19
20
  */
20
- type: typeof SchemaOrgTypes.ItemList;
21
+ type: [typeof SchemaOrgTypes.ItemList, typeof AuditableItemGraphTypes.VertexList];
21
22
  /**
22
23
  * The list of vertices.
23
24
  */
@@ -6,6 +6,10 @@ export declare const AuditableItemGraphTypes: {
6
6
  * Represents auditable item graph vertex.
7
7
  */
8
8
  readonly Vertex: "AuditableItemGraphVertex";
9
+ /**
10
+ * Represents auditable item graph vertex list.
11
+ */
12
+ readonly VertexList: "AuditableItemGraphVertexList";
9
13
  /**
10
14
  * Represents auditable item graph alias.
11
15
  */
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @twin.org/auditable-item-graph-models - Changelog
2
2
 
3
+ ## [0.0.1-next.43](https://github.com/twinfoundation/auditable-item-graph/compare/auditable-item-graph-models-v0.0.1-next.42...auditable-item-graph-models-v0.0.1-next.43) (2025-06-17)
4
+
5
+
6
+ ### Features
7
+
8
+ * improve JSON schemas ([bec8dc1](https://github.com/twinfoundation/auditable-item-graph/commit/bec8dc1f270c6c9710623a192b984cf46f8a5613))
9
+
10
+ ## [0.0.1-next.42](https://github.com/twinfoundation/auditable-item-graph/compare/auditable-item-graph-models-v0.0.1-next.41...auditable-item-graph-models-v0.0.1-next.42) (2025-06-12)
11
+
12
+
13
+ ### Features
14
+
15
+ * update dependencies ([6986689](https://github.com/twinfoundation/auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
16
+
3
17
  ## [0.0.1-next.41](https://github.com/twinfoundation/auditable-item-graph/compare/auditable-item-graph-models-v0.0.1-next.40...auditable-item-graph-models-v0.0.1-next.41) (2025-06-03)
4
18
 
5
19
 
@@ -226,7 +226,7 @@ The optional id to look for.
226
226
 
227
227
  ###### idMode?
228
228
 
229
- `"both"` \| `"id"` \| `"alias"`
229
+ `"id"` \| `"alias"` \| `"both"`
230
230
 
231
231
  Look in id, alias or both, defaults to both.
232
232
 
@@ -30,7 +30,7 @@ The id or alias to try and find.
30
30
 
31
31
  #### idMode?
32
32
 
33
- > `optional` **idMode**: `"both"` \| `"id"` \| `"alias"`
33
+ > `optional` **idMode**: `"id"` \| `"alias"` \| `"both"`
34
34
 
35
35
  Which field to look in with the id, defaults to both.
36
36
 
@@ -22,7 +22,7 @@ JSON-LD Type.
22
22
 
23
23
  ### patchOperation
24
24
 
25
- > **patchOperation**: `"replace"` \| `"add"` \| `"remove"` \| `"copy"` \| `"move"` \| `"test"`
25
+ > **patchOperation**: `"add"` \| `"remove"` \| `"replace"` \| `"move"` \| `"copy"` \| `"test"`
26
26
 
27
27
  The operation that was performed on the item.
28
28
 
@@ -14,7 +14,7 @@ JSON-LD Context.
14
14
 
15
15
  ### type
16
16
 
17
- > **type**: `"ItemList"`
17
+ > **type**: \[`"ItemList"`, `"AuditableItemGraphVertexList"`\]
18
18
 
19
19
  JSON-LD Type.
20
20
 
@@ -12,6 +12,12 @@ The types of auditable item graph data.
12
12
 
13
13
  Represents auditable item graph vertex.
14
14
 
15
+ ### VertexList
16
+
17
+ > `readonly` **VertexList**: `"AuditableItemGraphVertexList"` = `"AuditableItemGraphVertexList"`
18
+
19
+ Represents auditable item graph vertex list.
20
+
15
21
  ### Alias
16
22
 
17
23
  > `readonly` **Alias**: `"AuditableItemGraphAlias"` = `"AuditableItemGraphAlias"`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/auditable-item-graph-models",
3
- "version": "0.0.1-next.41",
3
+ "version": "0.0.1-next.43",
4
4
  "description": "Models which define the structure of the auditable item graph connectors and services",
5
5
  "repository": {
6
6
  "type": "git",