@twin.org/auditable-item-graph-models 0.0.1-next.8 → 0.0.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.
Files changed (54) hide show
  1. package/dist/cjs/index.cjs +265 -393
  2. package/dist/esm/index.mjs +264 -393
  3. package/dist/types/index.d.ts +4 -3
  4. package/dist/types/models/IAuditableItemGraphAlias.d.ts +9 -4
  5. package/dist/types/models/IAuditableItemGraphAuditedElement.d.ts +2 -2
  6. package/dist/types/models/IAuditableItemGraphChangeset.d.ts +16 -14
  7. package/dist/types/models/IAuditableItemGraphComponent.d.ts +52 -36
  8. package/dist/types/models/IAuditableItemGraphEdge.d.ts +11 -6
  9. package/dist/types/models/IAuditableItemGraphPatchOperation.d.ts +3 -1
  10. package/dist/types/models/IAuditableItemGraphResource.d.ts +3 -2
  11. package/dist/types/models/IAuditableItemGraphVertex.d.ts +13 -4
  12. package/dist/types/models/IAuditableItemGraphVertexList.d.ts +11 -4
  13. package/dist/types/models/api/IAuditableItemGraphCreateRequest.d.ts +6 -6
  14. package/dist/types/models/api/IAuditableItemGraphGetRequest.d.ts +2 -2
  15. package/dist/types/models/api/IAuditableItemGraphListRequest.d.ts +10 -2
  16. package/dist/types/models/api/IAuditableItemGraphUpdateRequest.d.ts +6 -6
  17. package/dist/types/models/auditableItemGraphContexts.d.ts +17 -0
  18. package/dist/types/models/auditableItemGraphTopics.d.ts +17 -0
  19. package/dist/types/models/auditableItemGraphTypes.d.ts +4 -20
  20. package/dist/types/models/eventBus/IAuditableItemGraphEventBusVertexCreated.d.ts +9 -0
  21. package/dist/types/models/eventBus/IAuditableItemGraphEventBusVertexUpdated.d.ts +14 -0
  22. package/docs/changelog.md +90 -1
  23. package/docs/reference/classes/AuditableItemGraphDataTypes.md +3 -3
  24. package/docs/reference/index.md +6 -4
  25. package/docs/reference/interfaces/IAuditableItemGraphAlias.md +18 -18
  26. package/docs/reference/interfaces/IAuditableItemGraphAuditedElement.md +4 -4
  27. package/docs/reference/interfaces/IAuditableItemGraphChangeset.md +14 -22
  28. package/docs/reference/interfaces/IAuditableItemGraphComponent.md +109 -37
  29. package/docs/reference/interfaces/IAuditableItemGraphCreateRequest.md +4 -4
  30. package/docs/reference/interfaces/IAuditableItemGraphEdge.md +21 -21
  31. package/docs/reference/interfaces/IAuditableItemGraphEventBusVertexCreated.md +11 -0
  32. package/docs/reference/interfaces/IAuditableItemGraphEventBusVertexUpdated.md +19 -0
  33. package/docs/reference/interfaces/IAuditableItemGraphGetRequest.md +2 -2
  34. package/docs/reference/interfaces/IAuditableItemGraphListRequest.md +15 -3
  35. package/docs/reference/interfaces/IAuditableItemGraphPatchOperation.md +2 -2
  36. package/docs/reference/interfaces/IAuditableItemGraphResource.md +5 -5
  37. package/docs/reference/interfaces/IAuditableItemGraphUpdateRequest.md +4 -4
  38. package/docs/reference/interfaces/IAuditableItemGraphVertex.md +18 -18
  39. package/docs/reference/interfaces/IAuditableItemGraphVertexList.md +6 -6
  40. package/docs/reference/type-aliases/AuditableItemGraphContexts.md +5 -0
  41. package/docs/reference/type-aliases/AuditableItemGraphTopics.md +5 -0
  42. package/docs/reference/type-aliases/AuditableItemGraphTypes.md +1 -1
  43. package/docs/reference/type-aliases/VerifyDepth.md +1 -1
  44. package/docs/reference/variables/AuditableItemGraphContexts.md +19 -0
  45. package/docs/reference/variables/AuditableItemGraphTopics.md +19 -0
  46. package/docs/reference/variables/AuditableItemGraphTypes.md +6 -30
  47. package/package.json +12 -10
  48. package/dist/types/models/IAuditableItemGraphCredential.d.ts +0 -34
  49. package/dist/types/models/IAuditableItemGraphVerification.d.ts +0 -29
  50. package/dist/types/models/auditableItemGraphVerificationState.d.ts +0 -37
  51. package/docs/reference/interfaces/IAuditableItemGraphCredential.md +0 -59
  52. package/docs/reference/interfaces/IAuditableItemGraphVerification.md +0 -47
  53. package/docs/reference/type-aliases/AuditableItemGraphVerificationState.md +0 -5
  54. package/docs/reference/variables/AuditableItemGraphVerificationState.md +0 -49
@@ -5,18 +5,35 @@ var dataCore = require('@twin.org/data-core');
5
5
  // Copyright 2024 IOTA Stiftung.
6
6
  // SPDX-License-Identifier: Apache-2.0.
7
7
  /**
8
- * The types of auditable item graph data.
8
+ * The contexts of auditable item graph data.
9
9
  */
10
10
  // eslint-disable-next-line @typescript-eslint/naming-convention
11
- const AuditableItemGraphTypes = {
11
+ const AuditableItemGraphContexts = {
12
12
  /**
13
13
  * The context root for the auditable item graph types.
14
14
  */
15
15
  ContextRoot: "https://schema.twindev.org/aig/",
16
+ /**
17
+ * The context root for the common types.
18
+ */
19
+ ContextRootCommon: "https://schema.twindev.org/common/"
20
+ };
21
+
22
+ // Copyright 2024 IOTA Stiftung.
23
+ // SPDX-License-Identifier: Apache-2.0.
24
+ /**
25
+ * The types of auditable item graph data.
26
+ */
27
+ // eslint-disable-next-line @typescript-eslint/naming-convention
28
+ const AuditableItemGraphTypes = {
16
29
  /**
17
30
  * Represents auditable item graph vertex.
18
31
  */
19
32
  Vertex: "AuditableItemGraphVertex",
33
+ /**
34
+ * Represents auditable item graph vertex list.
35
+ */
36
+ VertexList: "AuditableItemGraphVertexList",
20
37
  /**
21
38
  * Represents auditable item graph alias.
22
39
  */
@@ -36,27 +53,14 @@ const AuditableItemGraphTypes = {
36
53
  /**
37
54
  * Represents patch operation.
38
55
  */
39
- PatchOperation: "AuditableItemGraphPatchOperation",
40
- /**
41
- * Represents the immutable credential payload.
42
- */
43
- Credential: "AuditableItemGraphPatchCredential",
44
- /**
45
- * Represents auditable item stream verification.
46
- */
47
- Verification: "AuditableItemGraphVerification",
48
- /**
49
- * Represents auditable item stream verification state.
50
- */
51
- VerificationState: "AuditableItemGraphVerificationState",
52
- /**
53
- * Represents auditable item stream vertex list.
54
- */
55
- VertexList: "AuditableItemGraphVertexList"
56
+ PatchOperation: "AuditableItemGraphPatchOperation"
56
57
  };
57
58
 
58
- var type$9 = "object";
59
- var properties$8 = {
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 = {
60
64
  id: {
61
65
  type: "string",
62
66
  description: "The id of the element."
@@ -82,15 +86,15 @@ var properties$8 = {
82
86
  {
83
87
  type: "array",
84
88
  minItems: 1,
85
- items: [
89
+ items: {
90
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
91
+ },
92
+ prefixItems: [
86
93
  {
87
94
  type: "string",
88
95
  "const": "https://schema.twindev.org/aig/"
89
96
  }
90
- ],
91
- additionalItems: {
92
- type: "string"
93
- }
97
+ ]
94
98
  }
95
99
  ],
96
100
  description: "JSON-LD Context."
@@ -100,60 +104,63 @@ var properties$8 = {
100
104
  "const": "AuditableItemGraphAlias",
101
105
  description: "JSON-LD Type."
102
106
  },
103
- aliasObject: {
107
+ annotationObject: {
104
108
  $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
105
- description: "The JSON-LD object for the alias."
109
+ description: "The JSON-LD annotation object for the alias."
106
110
  },
107
111
  aliasFormat: {
108
112
  type: "string",
109
113
  description: "The format of the id in the alias."
110
114
  }
111
115
  };
112
- var required$8 = [
116
+ var required$6 = [
113
117
  "@context",
114
- "dateCreated",
115
118
  "id",
116
119
  "type"
117
120
  ];
118
- var additionalProperties$8 = false;
119
- var description$9 = "Interface describing an alias for a vertex.";
121
+ var additionalProperties$6 = false;
120
122
  var AuditableItemGraphAliasSchema = {
121
- type: type$9,
122
- properties: properties$8,
123
- required: required$8,
124
- additionalProperties: additionalProperties$8,
125
- description: description$9
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
126
130
  };
127
131
 
128
- var type$8 = "object";
129
- var properties$7 = {
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 = {
130
137
  "@context": {
131
- anyOf: [
138
+ type: "array",
139
+ minItems: 2,
140
+ items: {
141
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
142
+ },
143
+ description: "JSON-LD Context.",
144
+ prefixItems: [
132
145
  {
133
146
  type: "string",
134
147
  "const": "https://schema.twindev.org/aig/"
135
148
  },
136
149
  {
137
- type: "array",
138
- minItems: 1,
139
- items: [
140
- {
141
- type: "string",
142
- "const": "https://schema.twindev.org/aig/"
143
- }
144
- ],
145
- additionalItems: {
146
- type: "string"
147
- }
150
+ type: "string",
151
+ "const": "https://schema.twindev.org/common/"
148
152
  }
149
- ],
150
- description: "JSON-LD Context."
153
+ ]
151
154
  },
152
155
  type: {
153
156
  type: "string",
154
157
  "const": "AuditableItemGraphChangeset",
155
158
  description: "JSON-LD Type."
156
159
  },
160
+ id: {
161
+ type: "string",
162
+ description: "The id of the changeset."
163
+ },
157
164
  dateCreated: {
158
165
  type: "string",
159
166
  description: "The date/time of when the changeset was created."
@@ -164,117 +171,47 @@ var properties$7 = {
164
171
  },
165
172
  patches: {
166
173
  type: "array",
167
- items: {
168
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation"
169
- },
170
- description: "The patches in the changeset."
171
- },
172
- hash: {
173
- type: "string",
174
- description: "The hash for the changeset."
175
- },
176
- signature: {
177
- type: "string",
178
- description: "The signature for 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
+ ]
179
181
  },
180
- immutableStorageId: {
182
+ proofId: {
181
183
  type: "string",
182
- description: "The immutable storage id containing the signature for the changeset."
184
+ description: "The immutable proof id which contains the signature for this changeset."
183
185
  },
184
186
  verification: {
185
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphVerification",
187
+ $ref: "https://schema.twindev.org/immutable-proof/ImmutableProofVerification",
186
188
  description: "The verification for the changeset."
187
189
  }
188
190
  };
189
- var required$7 = [
191
+ var required$5 = [
190
192
  "@context",
191
193
  "type",
194
+ "id",
192
195
  "dateCreated",
193
196
  "userIdentity",
194
- "patches",
195
- "hash",
196
- "signature"
197
+ "patches"
197
198
  ];
198
- var additionalProperties$7 = false;
199
- var description$8 = "Interface describing a set of updates to the vertex.";
199
+ var additionalProperties$5 = false;
200
200
  var AuditableItemGraphChangesetSchema = {
201
- type: type$8,
202
- properties: properties$7,
203
- required: required$7,
204
- additionalProperties: additionalProperties$7,
205
- description: description$8
206
- };
207
-
208
- var type$7 = "object";
209
- var properties$6 = {
210
- "@context": {
211
- anyOf: [
212
- {
213
- type: "string",
214
- "const": "https://schema.twindev.org/aig/"
215
- },
216
- {
217
- type: "array",
218
- minItems: 1,
219
- items: [
220
- {
221
- type: "string",
222
- "const": "https://schema.twindev.org/aig/"
223
- }
224
- ],
225
- additionalItems: {
226
- type: "string"
227
- }
228
- }
229
- ],
230
- description: "JSON-LD Context."
231
- },
232
- type: {
233
- type: "string",
234
- "const": "AuditableItemGraphPatchCredential",
235
- description: "JSON-LD Type."
236
- },
237
- dateCreated: {
238
- type: "string",
239
- description: "The date/time of when the changeset was created."
240
- },
241
- userIdentity: {
242
- type: "string",
243
- description: "The user identity that created the changes."
244
- },
245
- signature: {
246
- type: "string",
247
- description: "The signature for the changeset."
248
- },
249
- hash: {
250
- type: "string",
251
- description: "The signature for the changeset."
252
- },
253
- integrity: {
254
- type: "string",
255
- description: "The integrity data for this changeset, encrypted."
256
- }
257
- };
258
- var required$6 = [
259
- "@context",
260
- "type",
261
- "dateCreated",
262
- "userIdentity",
263
- "signature",
264
- "hash"
265
- ];
266
- var additionalProperties$6 = false;
267
- var description$7 = "The data stored immutably for the graph in a verifiable credential.";
268
- var AuditableItemGraphCredentialSchema = {
269
- type: type$7,
270
- properties: properties$6,
271
- required: required$6,
272
- additionalProperties: additionalProperties$6,
273
- description: description$7
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
274
208
  };
275
209
 
276
- var type$6 = "object";
277
- var properties$5 = {
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 = {
278
215
  id: {
279
216
  type: "string",
280
217
  description: "The id of the element."
@@ -300,15 +237,15 @@ var properties$5 = {
300
237
  {
301
238
  type: "array",
302
239
  minItems: 1,
303
- items: [
240
+ items: {
241
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
242
+ },
243
+ prefixItems: [
304
244
  {
305
245
  type: "string",
306
246
  "const": "https://schema.twindev.org/aig/"
307
247
  }
308
- ],
309
- additionalItems: {
310
- type: "string"
311
- }
248
+ ]
312
249
  }
313
250
  ],
314
251
  description: "JSON-LD Context."
@@ -318,34 +255,43 @@ var properties$5 = {
318
255
  "const": "AuditableItemGraphEdge",
319
256
  description: "JSON-LD Type."
320
257
  },
321
- edgeObject: {
258
+ annotationObject: {
322
259
  $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
323
- description: "The JSON-LD object for the edge."
260
+ description: "The JSON-LD annotation object for the edge."
324
261
  },
325
- edgeRelationship: {
326
- type: "string",
327
- description: "The relationship between the two vertices."
262
+ edgeRelationships: {
263
+ type: "array",
264
+ items: false,
265
+ description: "The relationships between the two vertices.",
266
+ prefixItems: [
267
+ {
268
+ type: "string"
269
+ }
270
+ ]
328
271
  }
329
272
  };
330
- var required$5 = [
273
+ var required$4 = [
331
274
  "@context",
332
- "dateCreated",
333
- "edgeRelationship",
334
275
  "id",
335
- "type"
276
+ "type",
277
+ "edgeRelationships"
336
278
  ];
337
- var additionalProperties$5 = false;
338
- var description$6 = "Interface describing an edge between two vertices in an auditable item graph.";
279
+ var additionalProperties$4 = false;
339
280
  var AuditableItemGraphEdgeSchema = {
340
- type: type$6,
341
- properties: properties$5,
342
- required: required$5,
343
- additionalProperties: additionalProperties$5,
344
- description: description$6
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
345
288
  };
346
289
 
347
- var type$5 = "object";
348
- var properties$4 = {
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 = {
349
295
  "@context": {
350
296
  anyOf: [
351
297
  {
@@ -355,15 +301,15 @@ var properties$4 = {
355
301
  {
356
302
  type: "array",
357
303
  minItems: 1,
358
- items: [
304
+ items: {
305
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
306
+ },
307
+ prefixItems: [
359
308
  {
360
309
  type: "string",
361
310
  "const": "https://schema.twindev.org/aig/"
362
311
  }
363
- ],
364
- additionalItems: {
365
- type: "string"
366
- }
312
+ ]
367
313
  }
368
314
  ],
369
315
  description: "JSON-LD Context."
@@ -397,24 +343,28 @@ var properties$4 = {
397
343
  description: "The value to add."
398
344
  }
399
345
  };
400
- var required$4 = [
346
+ var required$3 = [
401
347
  "@context",
402
348
  "type",
403
349
  "patchOperation",
404
350
  "patchPath"
405
351
  ];
406
- var additionalProperties$4 = false;
407
- var description$5 = "The patch operation for JSON diffs.";
352
+ var additionalProperties$3 = false;
408
353
  var AuditableItemGraphPatchOperationSchema = {
409
- type: type$5,
410
- properties: properties$4,
411
- required: required$4,
412
- additionalProperties: additionalProperties$4,
413
- description: description$5
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
414
361
  };
415
362
 
416
- var type$4 = "object";
417
- var properties$3 = {
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 = {
418
368
  id: {
419
369
  type: "string",
420
370
  description: "The id of the element."
@@ -440,15 +390,15 @@ var properties$3 = {
440
390
  {
441
391
  type: "array",
442
392
  minItems: 1,
443
- items: [
393
+ items: {
394
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
395
+ },
396
+ prefixItems: [
444
397
  {
445
398
  type: "string",
446
399
  "const": "https://schema.twindev.org/aig/"
447
400
  }
448
- ],
449
- additionalItems: {
450
- type: "string"
451
- }
401
+ ]
452
402
  }
453
403
  ],
454
404
  description: "JSON-LD Context."
@@ -463,98 +413,24 @@ var properties$3 = {
463
413
  description: "The JSON-LD object for the resource."
464
414
  }
465
415
  };
466
- var required$3 = [
467
- "@context",
468
- "dateCreated",
469
- "id",
470
- "type"
471
- ];
472
- var additionalProperties$3 = false;
473
- var description$4 = "Interface describing an auditable item graph vertex resource.";
474
- var AuditableItemGraphResourceSchema = {
475
- type: type$4,
476
- properties: properties$3,
477
- required: required$3,
478
- additionalProperties: additionalProperties$3,
479
- description: description$4
480
- };
481
-
482
- var type$3 = "object";
483
- var properties$2 = {
484
- "@context": {
485
- anyOf: [
486
- {
487
- type: "string",
488
- "const": "https://schema.twindev.org/aig/"
489
- },
490
- {
491
- type: "array",
492
- minItems: 1,
493
- items: [
494
- {
495
- type: "string",
496
- "const": "https://schema.twindev.org/aig/"
497
- }
498
- ],
499
- additionalItems: {
500
- type: "string"
501
- }
502
- }
503
- ],
504
- description: "JSON-LD Context."
505
- },
506
- type: {
507
- type: "string",
508
- "const": "AuditableItemGraphVerification",
509
- description: "JSON-LD Type."
510
- },
511
- dateCreated: {
512
- type: "string",
513
- description: "The date/time of the verification."
514
- },
515
- state: {
516
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphVerificationState",
517
- description: "The state of the verification."
518
- },
519
- stateProperties: {
520
- type: "object",
521
- additionalProperties: {
522
- },
523
- description: "The state properties."
524
- }
525
- };
526
416
  var required$2 = [
527
417
  "@context",
528
- "type",
529
- "dateCreated",
530
- "state"
418
+ "type"
531
419
  ];
532
420
  var additionalProperties$2 = false;
533
- var description$3 = "Interface describing an auditable item graph verification.";
534
- var AuditableItemGraphVerificationSchema = {
535
- type: type$3,
421
+ var AuditableItemGraphResourceSchema = {
422
+ $schema: $schema$2,
423
+ $id: $id$2,
424
+ description: description$2,
425
+ type: type$2,
536
426
  properties: properties$2,
537
427
  required: required$2,
538
- additionalProperties: additionalProperties$2,
539
- description: description$3
540
- };
541
-
542
- var type$2 = "string";
543
- var description$2 = "The state of the verification.";
544
- var AuditableItemGraphVerificationStateSchema = {
545
- type: type$2,
546
- "enum": [
547
- "ok",
548
- "hashMismatch",
549
- "signatureNotVerified",
550
- "credentialRevoked",
551
- "immutableHashMismatch",
552
- "immutableSignatureMismatch",
553
- "integrityDataMismatch"
554
- ],
555
- description: description$2
428
+ additionalProperties: additionalProperties$2
556
429
  };
557
430
 
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.";
558
434
  var type$1 = "object";
559
435
  var properties$1 = {
560
436
  id: {
@@ -574,26 +450,22 @@ var properties$1 = {
574
450
  description: "The date/time of when the element was deleted, as we never actually remove items."
575
451
  },
576
452
  "@context": {
577
- anyOf: [
453
+ type: "array",
454
+ minItems: 2,
455
+ items: {
456
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
457
+ },
458
+ description: "JSON-LD Context.",
459
+ prefixItems: [
578
460
  {
579
461
  type: "string",
580
462
  "const": "https://schema.twindev.org/aig/"
581
463
  },
582
464
  {
583
- type: "array",
584
- minItems: 1,
585
- items: [
586
- {
587
- type: "string",
588
- "const": "https://schema.twindev.org/aig/"
589
- }
590
- ],
591
- additionalItems: {
592
- type: "string"
593
- }
465
+ type: "string",
466
+ "const": "https://schema.twindev.org/common/"
594
467
  }
595
- ],
596
- description: "JSON-LD Context."
468
+ ]
597
469
  },
598
470
  type: {
599
471
  type: "string",
@@ -604,37 +476,49 @@ var properties$1 = {
604
476
  type: "string",
605
477
  description: "The identity of the node which controls the vertex."
606
478
  },
607
- vertexObject: {
479
+ annotationObject: {
608
480
  $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
609
- description: "The JSON-LD object for the vertex."
481
+ description: "The JSON-LD annotation object for the vertex."
610
482
  },
611
483
  aliases: {
612
484
  type: "array",
613
- items: {
614
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphAlias"
615
- },
616
- 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
+ ]
617
492
  },
618
493
  resources: {
619
494
  type: "array",
620
- items: {
621
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphResource"
622
- },
623
- 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
+ ]
624
502
  },
625
503
  edges: {
626
504
  type: "array",
627
- items: {
628
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphEdge"
629
- },
630
- 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
+ ]
631
512
  },
632
513
  changesets: {
633
514
  type: "array",
634
- items: {
635
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphChangeset"
636
- },
637
- 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
+ ]
638
522
  },
639
523
  verified: {
640
524
  type: "boolean",
@@ -643,57 +527,71 @@ var properties$1 = {
643
527
  };
644
528
  var required$1 = [
645
529
  "@context",
646
- "dateCreated",
647
530
  "id",
648
531
  "type"
649
532
  ];
650
533
  var additionalProperties$1 = false;
651
- var description$1 = "Interface describing an auditable item graph vertex.";
652
534
  var AuditableItemGraphVertexSchema = {
535
+ $schema: $schema$1,
536
+ $id: $id$1,
537
+ description: description$1,
653
538
  type: type$1,
654
539
  properties: properties$1,
655
540
  required: required$1,
656
- additionalProperties: additionalProperties$1,
657
- description: description$1
541
+ additionalProperties: additionalProperties$1
658
542
  };
659
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.";
660
547
  var type = "object";
661
548
  var properties = {
662
549
  "@context": {
663
- anyOf: [
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: [
664
557
  {
665
558
  type: "string",
666
- "const": "https://schema.twindev.org/aig/"
559
+ "const": "https://schema.org"
667
560
  },
668
561
  {
669
- type: "array",
670
- minItems: 1,
671
- items: [
672
- {
673
- type: "string",
674
- "const": "https://schema.twindev.org/aig/"
675
- }
676
- ],
677
- additionalItems: {
678
- type: "string"
679
- }
562
+ type: "string",
563
+ "const": "https://schema.twindev.org/aig/"
680
564
  }
681
- ],
682
- description: "JSON-LD Context."
565
+ ]
683
566
  },
684
567
  type: {
685
- type: "string",
686
- "const": "AuditableItemGraphVertexList",
687
- description: "JSON-LD 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
+ ]
688
583
  },
689
- vertices: {
584
+ itemListElement: {
690
585
  type: "array",
691
- items: {
692
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphVertex"
693
- },
694
- description: "The list of vertices."
586
+ items: false,
587
+ description: "The list of vertices.",
588
+ prefixItems: [
589
+ {
590
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphVertex"
591
+ }
592
+ ]
695
593
  },
696
- cursor: {
594
+ nextItem: {
697
595
  type: "string",
698
596
  description: "The cursor to get the next chunk of vertices."
699
597
  }
@@ -701,16 +599,17 @@ var properties = {
701
599
  var required = [
702
600
  "@context",
703
601
  "type",
704
- "vertices"
602
+ "itemListElement"
705
603
  ];
706
604
  var additionalProperties = false;
707
- var description = "Interface describing an auditable item graph vertex list.";
708
605
  var AuditableItemGraphVertexListSchema = {
606
+ $schema: $schema,
607
+ $id: $id,
608
+ description: description,
709
609
  type: type,
710
610
  properties: properties,
711
611
  required: required,
712
- additionalProperties: additionalProperties,
713
- description: description
612
+ additionalProperties: additionalProperties
714
613
  };
715
614
 
716
615
  // Copyright 2024 IOTA Stiftung.
@@ -723,94 +622,66 @@ class AuditableItemGraphDataTypes {
723
622
  * Register all the data types.
724
623
  */
725
624
  static registerTypes() {
726
- dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.Vertex, () => ({
625
+ dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Vertex}`, () => ({
626
+ context: AuditableItemGraphContexts.ContextRoot,
727
627
  type: AuditableItemGraphTypes.Vertex,
728
628
  defaultValue: {},
729
629
  jsonSchema: async () => AuditableItemGraphVertexSchema
730
630
  }));
731
- dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.Alias, () => ({
631
+ dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.VertexList}`, () => ({
632
+ context: AuditableItemGraphContexts.ContextRoot,
633
+ type: AuditableItemGraphTypes.VertexList,
634
+ defaultValue: {},
635
+ jsonSchema: async () => AuditableItemGraphVertexListSchema
636
+ }));
637
+ dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Alias}`, () => ({
638
+ context: AuditableItemGraphContexts.ContextRoot,
732
639
  type: AuditableItemGraphTypes.Alias,
733
640
  defaultValue: {},
734
641
  jsonSchema: async () => AuditableItemGraphAliasSchema
735
642
  }));
736
- dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.Resource, () => ({
643
+ dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Resource}`, () => ({
644
+ context: AuditableItemGraphContexts.ContextRoot,
737
645
  type: AuditableItemGraphTypes.Resource,
738
646
  defaultValue: {},
739
647
  jsonSchema: async () => AuditableItemGraphResourceSchema
740
648
  }));
741
- dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.Edge, () => ({
649
+ dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Edge}`, () => ({
650
+ context: AuditableItemGraphContexts.ContextRoot,
742
651
  type: AuditableItemGraphTypes.Edge,
743
652
  defaultValue: {},
744
653
  jsonSchema: async () => AuditableItemGraphEdgeSchema
745
654
  }));
746
- dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.Changeset, () => ({
655
+ dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Changeset}`, () => ({
656
+ context: AuditableItemGraphContexts.ContextRoot,
747
657
  type: AuditableItemGraphTypes.Changeset,
748
658
  defaultValue: {},
749
659
  jsonSchema: async () => AuditableItemGraphChangesetSchema
750
660
  }));
751
- dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.PatchOperation, () => ({
661
+ dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.PatchOperation}`, () => ({
662
+ context: AuditableItemGraphContexts.ContextRoot,
752
663
  type: AuditableItemGraphTypes.PatchOperation,
753
664
  defaultValue: {},
754
665
  jsonSchema: async () => AuditableItemGraphPatchOperationSchema
755
666
  }));
756
- dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.Credential, () => ({
757
- type: AuditableItemGraphTypes.Credential,
758
- defaultValue: {},
759
- jsonSchema: async () => AuditableItemGraphCredentialSchema
760
- }));
761
- dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.Verification, () => ({
762
- type: AuditableItemGraphTypes.Verification,
763
- defaultValue: {},
764
- jsonSchema: async () => AuditableItemGraphVerificationSchema
765
- }));
766
- dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.VertexList, () => ({
767
- type: AuditableItemGraphTypes.VertexList,
768
- defaultValue: {},
769
- jsonSchema: async () => AuditableItemGraphVertexListSchema
770
- }));
771
- dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.VerificationState, () => ({
772
- type: AuditableItemGraphTypes.VerificationState,
773
- defaultValue: {},
774
- jsonSchema: async () => AuditableItemGraphVerificationStateSchema
775
- }));
776
667
  }
777
668
  }
778
669
 
779
670
  // Copyright 2024 IOTA Stiftung.
780
671
  // SPDX-License-Identifier: Apache-2.0.
781
672
  /**
782
- * The state of the verification.
673
+ * The topics for auditable item graph event bus notifications.
783
674
  */
784
675
  // eslint-disable-next-line @typescript-eslint/naming-convention
785
- const AuditableItemGraphVerificationState = {
786
- /**
787
- * OK.
788
- */
789
- Ok: "ok",
790
- /**
791
- * The stored hash does not matched the calculated one.
792
- */
793
- HashMismatch: "hashMismatch",
794
- /**
795
- * The signature verification failed.
796
- */
797
- SignatureNotVerified: "signatureNotVerified",
798
- /**
799
- * The credential in the immutable storage was revoked.
800
- */
801
- CredentialRevoked: "credentialRevoked",
802
- /**
803
- * Immutable hash mismatch.
804
- */
805
- ImmutableHashMismatch: "immutableHashMismatch",
676
+ const AuditableItemGraphTopics = {
806
677
  /**
807
- * Immutable signature mismatch.
678
+ * A vertex was created.
808
679
  */
809
- ImmutableSignatureMismatch: "immutableSignatureMismatch",
680
+ VertexCreated: "auditable-item-graph:vertex-created",
810
681
  /**
811
- * Integrity data mismatch.
682
+ * A vertex was updated.
812
683
  */
813
- IntegrityDataMismatch: "integrityDataMismatch"
684
+ VertexUpdated: "auditable-item-graph:vertex-updated"
814
685
  };
815
686
 
816
687
  // Copyright 2024 IOTA Stiftung.
@@ -834,7 +705,8 @@ const VerifyDepth = {
834
705
  All: "all"
835
706
  };
836
707
 
708
+ exports.AuditableItemGraphContexts = AuditableItemGraphContexts;
837
709
  exports.AuditableItemGraphDataTypes = AuditableItemGraphDataTypes;
710
+ exports.AuditableItemGraphTopics = AuditableItemGraphTopics;
838
711
  exports.AuditableItemGraphTypes = AuditableItemGraphTypes;
839
- exports.AuditableItemGraphVerificationState = AuditableItemGraphVerificationState;
840
712
  exports.VerifyDepth = VerifyDepth;