@twin.org/auditable-item-graph-models 0.0.1-next.3 → 0.0.1-next.31

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 (57) hide show
  1. package/dist/cjs/index.cjs +375 -253
  2. package/dist/esm/index.mjs +374 -253
  3. package/dist/types/index.d.ts +5 -3
  4. package/dist/types/models/IAuditableItemGraphAlias.d.ts +21 -3
  5. package/dist/types/models/IAuditableItemGraphAuditedElement.d.ts +7 -7
  6. package/dist/types/models/IAuditableItemGraphChangeset.d.ts +26 -10
  7. package/dist/types/models/IAuditableItemGraphComponent.d.ts +55 -59
  8. package/dist/types/models/IAuditableItemGraphEdge.d.ts +21 -3
  9. package/dist/types/models/IAuditableItemGraphPatchOperation.d.ts +28 -2
  10. package/dist/types/models/IAuditableItemGraphResource.d.ts +16 -2
  11. package/dist/types/models/IAuditableItemGraphVertex.d.ts +28 -2
  12. package/dist/types/models/IAuditableItemGraphVertexList.d.ts +25 -0
  13. package/dist/types/models/api/IAuditableItemGraphCreateRequest.d.ts +9 -9
  14. package/dist/types/models/api/IAuditableItemGraphGetRequest.d.ts +2 -2
  15. package/dist/types/models/api/IAuditableItemGraphGetResponse.d.ts +2 -13
  16. package/dist/types/models/api/IAuditableItemGraphListRequest.d.ts +10 -5
  17. package/dist/types/models/api/IAuditableItemGraphListResponse.d.ts +2 -12
  18. package/dist/types/models/api/IAuditableItemGraphUpdateRequest.d.ts +9 -9
  19. package/dist/types/models/auditableItemGraphContexts.d.ts +17 -0
  20. package/dist/types/models/auditableItemGraphTopics.d.ts +17 -0
  21. package/dist/types/models/auditableItemGraphTypes.d.ts +8 -24
  22. package/dist/types/models/eventBus/IAuditableItemGraphEventBusVertexCreated.d.ts +9 -0
  23. package/dist/types/models/eventBus/IAuditableItemGraphEventBusVertexUpdated.d.ts +14 -0
  24. package/docs/changelog.md +1 -1
  25. package/docs/reference/index.md +7 -5
  26. package/docs/reference/interfaces/IAuditableItemGraphAlias.md +34 -22
  27. package/docs/reference/interfaces/IAuditableItemGraphAuditedElement.md +11 -11
  28. package/docs/reference/interfaces/IAuditableItemGraphChangeset.md +33 -17
  29. package/docs/reference/interfaces/IAuditableItemGraphComponent.md +104 -54
  30. package/docs/reference/interfaces/IAuditableItemGraphCreateRequest.md +5 -5
  31. package/docs/reference/interfaces/IAuditableItemGraphEdge.md +38 -26
  32. package/docs/reference/interfaces/IAuditableItemGraphEventBusVertexCreated.md +11 -0
  33. package/docs/reference/interfaces/IAuditableItemGraphEventBusVertexUpdated.md +19 -0
  34. package/docs/reference/interfaces/IAuditableItemGraphGetRequest.md +2 -2
  35. package/docs/reference/interfaces/IAuditableItemGraphGetResponse.md +4 -4
  36. package/docs/reference/interfaces/IAuditableItemGraphListRequest.md +11 -5
  37. package/docs/reference/interfaces/IAuditableItemGraphListResponse.md +3 -3
  38. package/docs/reference/interfaces/IAuditableItemGraphPatchOperation.md +46 -2
  39. package/docs/reference/interfaces/IAuditableItemGraphResource.md +32 -20
  40. package/docs/reference/interfaces/IAuditableItemGraphUpdateRequest.md +5 -5
  41. package/docs/reference/interfaces/IAuditableItemGraphVertex.md +50 -18
  42. package/docs/reference/interfaces/IAuditableItemGraphVertexList.md +35 -0
  43. package/docs/reference/type-aliases/AuditableItemGraphContexts.md +5 -0
  44. package/docs/reference/type-aliases/AuditableItemGraphTopics.md +5 -0
  45. package/docs/reference/variables/AuditableItemGraphContexts.md +19 -0
  46. package/docs/reference/variables/AuditableItemGraphTopics.md +19 -0
  47. package/docs/reference/variables/AuditableItemGraphTypes.md +9 -33
  48. package/package.json +5 -34
  49. package/dist/types/models/IAuditableItemGraphCredential.d.ts +0 -25
  50. package/dist/types/models/IAuditableItemGraphMetadataElement.d.ts +0 -10
  51. package/dist/types/models/IAuditableItemGraphVerification.d.ts +0 -15
  52. package/dist/types/models/auditableItemGraphVerificationState.d.ts +0 -37
  53. package/docs/reference/interfaces/IAuditableItemGraphCredential.md +0 -43
  54. package/docs/reference/interfaces/IAuditableItemGraphVerification.md +0 -23
  55. package/docs/reference/type-aliases/AuditableItemGraphVerificationState.md +0 -5
  56. package/docs/reference/type-aliases/JsonReturnType.md +0 -13
  57. package/docs/reference/variables/AuditableItemGraphVerificationState.md +0 -49
@@ -7,225 +7,276 @@ import { DataTypeHandlerFactory } from '@twin.org/data-core';
7
7
  */
8
8
  // eslint-disable-next-line @typescript-eslint/naming-convention
9
9
  const AuditableItemGraphTypes = {
10
- /**
11
- * The context uri for the auditable item graph types.
12
- */
13
- ContextUri: "https://schema.twindev.org/aig/",
14
- /**
15
- * The context root for the auditable item graph types.
16
- */
17
- ContextJsonld: "https://schema.twindev.org/aig/types.jsonld",
18
10
  /**
19
11
  * Represents auditable item graph vertex.
20
12
  */
21
- Vertex: "https://schema.twindev.org/aig/AuditableItemGraphVertex",
13
+ Vertex: "AuditableItemGraphVertex",
22
14
  /**
23
15
  * Represents auditable item graph alias.
24
16
  */
25
- Alias: "https://schema.twindev.org/aig/AuditableItemGraphAlias",
17
+ Alias: "AuditableItemGraphAlias",
26
18
  /**
27
19
  * Represents auditable item graph resource.
28
20
  */
29
- Resource: "https://schema.twindev.org/aig/AuditableItemGraphResource",
21
+ Resource: "AuditableItemGraphResource",
30
22
  /**
31
23
  * Represents auditable item graph edge.
32
24
  */
33
- Edge: "https://schema.twindev.org/aig/AuditableItemGraphEdge",
25
+ Edge: "AuditableItemGraphEdge",
34
26
  /**
35
27
  * Represents auditable item graph changeset.
36
28
  */
37
- Changeset: "https://schema.twindev.org/aig/AuditableItemGraphChangeset",
29
+ Changeset: "AuditableItemGraphChangeset",
38
30
  /**
39
31
  * Represents patch operation.
40
32
  */
41
- PatchOperation: "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation",
42
- /**
43
- * Represents the immutable credential payload.
44
- */
45
- Credential: "https://schema.twindev.org/aig/AuditableItemGraphPatchCredential",
33
+ PatchOperation: "AuditableItemGraphPatchOperation",
46
34
  /**
47
- * Represents auditable item stream verification.
35
+ * Represents auditable item stream vertex list.
48
36
  */
49
- Verification: "https://schema.twindev.org/aig/AuditableItemGraphVerification",
50
- /**
51
- * Represents auditable item stream verification state.
52
- */
53
- VerificationState: "https://schema.twindev.org/aig/AuditableItemGraphVerificationState"
37
+ VertexList: "AuditableItemGraphVertexList"
54
38
  };
55
39
 
56
- var type$8 = "object";
57
- var properties$7 = {
58
- metadata: {
59
- $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
60
- description: "The metadata to associate with the element as JSON-LD."
61
- },
40
+ var type$6 = "object";
41
+ var properties$6 = {
62
42
  id: {
63
43
  type: "string",
64
44
  description: "The id of the element."
65
45
  },
66
- created: {
67
- type: "number",
68
- description: "The timestamp of when the element was created."
46
+ dateCreated: {
47
+ type: "string",
48
+ description: "The date/time of when the element was created."
69
49
  },
70
- updated: {
71
- type: "number",
72
- description: "The timestamp of when the element was updated."
50
+ dateModified: {
51
+ type: "string",
52
+ description: "The date/time of when the element was modified."
53
+ },
54
+ dateDeleted: {
55
+ type: "string",
56
+ description: "The date/time of when the element was deleted, as we never actually remove items."
57
+ },
58
+ "@context": {
59
+ anyOf: [
60
+ {
61
+ type: "string",
62
+ "const": "https://schema.twindev.org/aig/"
63
+ },
64
+ {
65
+ type: "array",
66
+ minItems: 1,
67
+ items: [
68
+ {
69
+ type: "string",
70
+ "const": "https://schema.twindev.org/aig/"
71
+ }
72
+ ],
73
+ additionalItems: {
74
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
75
+ }
76
+ }
77
+ ],
78
+ description: "JSON-LD Context."
73
79
  },
74
- deleted: {
75
- type: "number",
76
- description: "The timestamp of when the element was deleted, as we never actually remove items."
80
+ type: {
81
+ type: "string",
82
+ "const": "AuditableItemGraphAlias",
83
+ description: "JSON-LD Type."
84
+ },
85
+ annotationObject: {
86
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
87
+ description: "The JSON-LD annotation object for the alias."
77
88
  },
78
- format: {
89
+ aliasFormat: {
79
90
  type: "string",
80
91
  description: "The format of the id in the alias."
81
92
  }
82
93
  };
83
- var additionalProperties$7 = false;
84
94
  var required$6 = [
85
- "created",
86
- "id"
95
+ "@context",
96
+ "id",
97
+ "type"
87
98
  ];
88
- var description$7 = "Interface describing an alias for a vertex.";
99
+ var additionalProperties$6 = false;
100
+ var description$6 = "Interface describing an alias for a vertex.";
89
101
  var AuditableItemGraphAliasSchema = {
90
- type: type$8,
91
- properties: properties$7,
92
- additionalProperties: additionalProperties$7,
102
+ type: type$6,
103
+ properties: properties$6,
93
104
  required: required$6,
94
- description: description$7
105
+ additionalProperties: additionalProperties$6,
106
+ description: description$6
95
107
  };
96
108
 
97
- var type$7 = "object";
98
- var properties$6 = {
99
- created: {
100
- type: "number",
101
- description: "The timestamp of when the changeset was created."
102
- },
103
- userIdentity: {
104
- type: "string",
105
- description: "The user identity that created the changes."
106
- },
107
- patches: {
109
+ var type$5 = "object";
110
+ var properties$5 = {
111
+ "@context": {
108
112
  type: "array",
109
- items: {
110
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation"
113
+ minItems: 2,
114
+ items: [
115
+ {
116
+ type: "string",
117
+ "const": "https://schema.twindev.org/aig/"
118
+ },
119
+ {
120
+ type: "string",
121
+ "const": "https://schema.twindev.org/common/"
122
+ }
123
+ ],
124
+ additionalItems: {
125
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
111
126
  },
112
- description: "The patches in the changeset."
127
+ description: "JSON-LD Context."
113
128
  },
114
- hash: {
129
+ type: {
115
130
  type: "string",
116
- description: "The hash for the changeset."
131
+ "const": "AuditableItemGraphChangeset",
132
+ description: "JSON-LD Type."
117
133
  },
118
- signature: {
134
+ id: {
119
135
  type: "string",
120
- description: "The signature for the changeset."
136
+ description: "The id of the changeset."
121
137
  },
122
- immutableStorageId: {
138
+ dateCreated: {
123
139
  type: "string",
124
- description: "The immutable storage id containing the signature for the changeset."
125
- }
126
- };
127
- var required$5 = [
128
- "created",
129
- "userIdentity",
130
- "patches",
131
- "hash",
132
- "signature"
133
- ];
134
- var additionalProperties$6 = false;
135
- var description$6 = "Interface describing a set of updates to the vertex.";
136
- var AuditableItemGraphChangesetSchema = {
137
- type: type$7,
138
- properties: properties$6,
139
- required: required$5,
140
- additionalProperties: additionalProperties$6,
141
- description: description$6
142
- };
143
-
144
- var type$6 = "object";
145
- var properties$5 = {
146
- created: {
147
- type: "number",
148
- description: "The timestamp of when the changeset was created."
140
+ description: "The date/time of when the changeset was created."
149
141
  },
150
142
  userIdentity: {
151
143
  type: "string",
152
144
  description: "The user identity that created the changes."
153
145
  },
154
- signature: {
155
- type: "string",
156
- description: "The signature for the changeset."
146
+ patches: {
147
+ type: "array",
148
+ items: {
149
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation"
150
+ },
151
+ description: "The patches in the changeset."
157
152
  },
158
- hash: {
153
+ proofId: {
159
154
  type: "string",
160
- description: "The signature for the changeset."
155
+ description: "The immutable proof id which contains the signature for this changeset."
161
156
  },
162
- integrity: {
163
- type: "string",
164
- description: "The integrity data for this changeset, encrypted."
157
+ verification: {
158
+ $ref: "https://schema.twindev.org/immutable-proof/ImmutableProofVerification",
159
+ description: "The verification for the changeset."
165
160
  }
166
161
  };
167
- var required$4 = [
168
- "created",
162
+ var required$5 = [
163
+ "@context",
164
+ "type",
165
+ "id",
166
+ "dateCreated",
169
167
  "userIdentity",
170
- "signature",
171
- "hash"
168
+ "patches"
172
169
  ];
173
170
  var additionalProperties$5 = false;
174
- var description$5 = "The data stored immutably for the graph in a verifiable credential.";
175
- var AuditableItemGraphCredentialSchema = {
176
- type: type$6,
171
+ var description$5 = "Interface describing a set of updates to the vertex.";
172
+ var AuditableItemGraphChangesetSchema = {
173
+ type: type$5,
177
174
  properties: properties$5,
178
- required: required$4,
175
+ required: required$5,
179
176
  additionalProperties: additionalProperties$5,
180
177
  description: description$5
181
178
  };
182
179
 
183
- var type$5 = "object";
180
+ var type$4 = "object";
184
181
  var properties$4 = {
185
- metadata: {
186
- $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
187
- description: "The metadata to associate with the element as JSON-LD."
188
- },
189
182
  id: {
190
183
  type: "string",
191
184
  description: "The id of the element."
192
185
  },
193
- created: {
194
- type: "number",
195
- description: "The timestamp of when the element was created."
186
+ dateCreated: {
187
+ type: "string",
188
+ description: "The date/time of when the element was created."
196
189
  },
197
- updated: {
198
- type: "number",
199
- description: "The timestamp of when the element was updated."
190
+ dateModified: {
191
+ type: "string",
192
+ description: "The date/time of when the element was modified."
200
193
  },
201
- deleted: {
202
- type: "number",
203
- description: "The timestamp of when the element was deleted, as we never actually remove items."
194
+ dateDeleted: {
195
+ type: "string",
196
+ description: "The date/time of when the element was deleted, as we never actually remove items."
197
+ },
198
+ "@context": {
199
+ anyOf: [
200
+ {
201
+ type: "string",
202
+ "const": "https://schema.twindev.org/aig/"
203
+ },
204
+ {
205
+ type: "array",
206
+ minItems: 1,
207
+ items: [
208
+ {
209
+ type: "string",
210
+ "const": "https://schema.twindev.org/aig/"
211
+ }
212
+ ],
213
+ additionalItems: {
214
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
215
+ }
216
+ }
217
+ ],
218
+ description: "JSON-LD Context."
204
219
  },
205
- relationship: {
220
+ type: {
221
+ type: "string",
222
+ "const": "AuditableItemGraphEdge",
223
+ description: "JSON-LD Type."
224
+ },
225
+ annotationObject: {
226
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
227
+ description: "The JSON-LD annotation object for the edge."
228
+ },
229
+ edgeRelationship: {
206
230
  type: "string",
207
231
  description: "The relationship between the two vertices."
208
232
  }
209
233
  };
210
- var required$3 = [
211
- "created",
234
+ var required$4 = [
235
+ "@context",
212
236
  "id",
213
- "relationship"
237
+ "type",
238
+ "edgeRelationship"
214
239
  ];
215
240
  var additionalProperties$4 = false;
216
241
  var description$4 = "Interface describing an edge between two vertices in an auditable item graph.";
217
242
  var AuditableItemGraphEdgeSchema = {
218
- type: type$5,
243
+ type: type$4,
219
244
  properties: properties$4,
220
- required: required$3,
245
+ required: required$4,
221
246
  additionalProperties: additionalProperties$4,
222
247
  description: description$4
223
248
  };
224
249
 
225
- var type$4 = "object";
226
- var additionalProperties$3 = false;
250
+ var type$3 = "object";
227
251
  var properties$3 = {
228
- op: {
252
+ "@context": {
253
+ anyOf: [
254
+ {
255
+ type: "string",
256
+ "const": "https://schema.twindev.org/aig/"
257
+ },
258
+ {
259
+ type: "array",
260
+ minItems: 1,
261
+ items: [
262
+ {
263
+ type: "string",
264
+ "const": "https://schema.twindev.org/aig/"
265
+ }
266
+ ],
267
+ additionalItems: {
268
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
269
+ }
270
+ }
271
+ ],
272
+ description: "JSON-LD Context."
273
+ },
274
+ type: {
275
+ type: "string",
276
+ "const": "AuditableItemGraphPatchOperation",
277
+ description: "JSON-LD Type."
278
+ },
279
+ patchOperation: {
229
280
  type: "string",
230
281
  "enum": [
231
282
  "add",
@@ -237,116 +288,147 @@ var properties$3 = {
237
288
  ],
238
289
  description: "The operation that was performed on the item."
239
290
  },
240
- path: {
291
+ patchPath: {
241
292
  type: "string",
242
293
  description: "The path to the object that was changed."
243
294
  },
244
- from: {
295
+ patchFrom: {
245
296
  type: "string",
246
297
  description: "The path the value was copied or moved from."
247
298
  },
248
- value: {
299
+ patchValue: {
249
300
  description: "The value to add."
250
301
  }
251
302
  };
252
- var required$2 = [
253
- "op",
254
- "path"
303
+ var required$3 = [
304
+ "@context",
305
+ "type",
306
+ "patchOperation",
307
+ "patchPath"
255
308
  ];
309
+ var additionalProperties$3 = false;
256
310
  var description$3 = "The patch operation for JSON diffs.";
257
311
  var AuditableItemGraphPatchOperationSchema = {
258
- type: type$4,
259
- additionalProperties: additionalProperties$3,
312
+ type: type$3,
260
313
  properties: properties$3,
261
- required: required$2,
314
+ required: required$3,
315
+ additionalProperties: additionalProperties$3,
262
316
  description: description$3
263
317
  };
264
318
 
265
- var type$3 = "object";
266
- var additionalProperties$2 = false;
319
+ var type$2 = "object";
267
320
  var properties$2 = {
268
- metadata: {
269
- $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
270
- description: "The metadata to associate with the element as JSON-LD."
271
- },
272
321
  id: {
273
322
  type: "string",
274
323
  description: "The id of the element."
275
324
  },
276
- created: {
277
- type: "number",
278
- description: "The timestamp of when the element was created."
325
+ dateCreated: {
326
+ type: "string",
327
+ description: "The date/time of when the element was created."
328
+ },
329
+ dateModified: {
330
+ type: "string",
331
+ description: "The date/time of when the element was modified."
279
332
  },
280
- updated: {
281
- type: "number",
282
- description: "The timestamp of when the element was updated."
333
+ dateDeleted: {
334
+ type: "string",
335
+ description: "The date/time of when the element was deleted, as we never actually remove items."
336
+ },
337
+ "@context": {
338
+ anyOf: [
339
+ {
340
+ type: "string",
341
+ "const": "https://schema.twindev.org/aig/"
342
+ },
343
+ {
344
+ type: "array",
345
+ minItems: 1,
346
+ items: [
347
+ {
348
+ type: "string",
349
+ "const": "https://schema.twindev.org/aig/"
350
+ }
351
+ ],
352
+ additionalItems: {
353
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
354
+ }
355
+ }
356
+ ],
357
+ description: "JSON-LD Context."
283
358
  },
284
- deleted: {
285
- type: "number",
286
- description: "The timestamp of when the element was deleted, as we never actually remove items."
359
+ type: {
360
+ type: "string",
361
+ "const": "AuditableItemGraphResource",
362
+ description: "JSON-LD Type."
363
+ },
364
+ resourceObject: {
365
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
366
+ description: "The JSON-LD object for the resource."
287
367
  }
288
368
  };
289
- var required$1 = [
290
- "created",
291
- "id"
369
+ var required$2 = [
370
+ "@context",
371
+ "type"
292
372
  ];
373
+ var additionalProperties$2 = false;
293
374
  var description$2 = "Interface describing an auditable item graph vertex resource.";
294
375
  var AuditableItemGraphResourceSchema = {
295
- type: type$3,
296
- additionalProperties: additionalProperties$2,
376
+ type: type$2,
297
377
  properties: properties$2,
298
- required: required$1,
378
+ required: required$2,
379
+ additionalProperties: additionalProperties$2,
299
380
  description: description$2
300
381
  };
301
382
 
302
- var type$2 = "object";
383
+ var type$1 = "object";
303
384
  var properties$1 = {
304
- epoch: {
305
- type: "number",
306
- description: "The epoch of the verification."
385
+ id: {
386
+ type: "string",
387
+ description: "The id of the element."
388
+ },
389
+ dateCreated: {
390
+ type: "string",
391
+ description: "The date/time of when the element was created."
392
+ },
393
+ dateModified: {
394
+ type: "string",
395
+ description: "The date/time of when the element was modified."
396
+ },
397
+ dateDeleted: {
398
+ type: "string",
399
+ description: "The date/time of when the element was deleted, as we never actually remove items."
400
+ },
401
+ "@context": {
402
+ type: "array",
403
+ minItems: 2,
404
+ items: [
405
+ {
406
+ type: "string",
407
+ "const": "https://schema.twindev.org/aig/"
408
+ },
409
+ {
410
+ type: "string",
411
+ "const": "https://schema.twindev.org/common/"
412
+ }
413
+ ],
414
+ additionalItems: {
415
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
416
+ },
417
+ description: "JSON-LD Context."
418
+ },
419
+ type: {
420
+ type: "string",
421
+ "const": "AuditableItemGraphVertex",
422
+ description: "JSON-LD Type."
307
423
  },
308
- state: {
309
- $ref: "https://schema.twindev.org/aig/AuditableItemGraphVerificationState",
310
- description: "The state of the verification."
311
- }
312
- };
313
- var required = [
314
- "epoch",
315
- "state"
316
- ];
317
- var additionalProperties$1 = {
318
- };
319
- var description$1 = "Interface describing an auditable item graph verification.";
320
- var AuditableItemGraphVerificationSchema = {
321
- type: type$2,
322
- properties: properties$1,
323
- required: required,
324
- additionalProperties: additionalProperties$1,
325
- description: description$1
326
- };
327
-
328
- var type$1 = "string";
329
- var description = "The state of the verification.";
330
- var AuditableItemGraphVerificationStateSchema = {
331
- type: type$1,
332
- "enum": [
333
- "ok",
334
- "hashMismatch",
335
- "signatureNotVerified",
336
- "credentialRevoked",
337
- "immutableHashMismatch",
338
- "immutableSignatureMismatch",
339
- "integrityDataMismatch"
340
- ],
341
- description: description
342
- };
343
-
344
- var type = "object";
345
- var properties = {
346
424
  nodeIdentity: {
347
425
  type: "string",
348
426
  description: "The identity of the node which controls the vertex."
349
427
  },
428
+ annotationObject: {
429
+ $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
430
+ description: "The JSON-LD annotation object for the vertex."
431
+ },
350
432
  aliases: {
351
433
  type: "array",
352
434
  items: {
@@ -375,28 +457,80 @@ var properties = {
375
457
  },
376
458
  description: "Changesets for the vertex."
377
459
  },
378
- id: {
379
- type: "string",
380
- description: "The id of the element."
460
+ verified: {
461
+ type: "boolean",
462
+ description: "Is the vertex verified, will only be populated when verification is requested."
463
+ }
464
+ };
465
+ var required$1 = [
466
+ "@context",
467
+ "id",
468
+ "type"
469
+ ];
470
+ var additionalProperties$1 = false;
471
+ var description$1 = "Interface describing an auditable item graph vertex.";
472
+ var AuditableItemGraphVertexSchema = {
473
+ type: type$1,
474
+ properties: properties$1,
475
+ required: required$1,
476
+ additionalProperties: additionalProperties$1,
477
+ description: description$1
478
+ };
479
+
480
+ var type = "object";
481
+ var properties = {
482
+ "@context": {
483
+ anyOf: [
484
+ {
485
+ type: "string",
486
+ "const": "https://schema.twindev.org/aig/"
487
+ },
488
+ {
489
+ type: "array",
490
+ minItems: 1,
491
+ items: [
492
+ {
493
+ type: "string",
494
+ "const": "https://schema.twindev.org/aig/"
495
+ }
496
+ ],
497
+ additionalItems: {
498
+ $ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
499
+ }
500
+ }
501
+ ],
502
+ description: "JSON-LD Context."
381
503
  },
382
- created: {
383
- type: "number",
384
- description: "The timestamp of when the element was created."
504
+ type: {
505
+ type: "string",
506
+ "const": "AuditableItemGraphVertexList",
507
+ description: "JSON-LD Type."
385
508
  },
386
- updated: {
387
- type: "number",
388
- description: "The timestamp of when the element was updated."
509
+ vertices: {
510
+ type: "array",
511
+ items: {
512
+ $ref: "https://schema.twindev.org/aig/AuditableItemGraphVertex"
513
+ },
514
+ description: "The list of vertices."
389
515
  },
390
- metadata: {
391
- $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
392
- description: "The metadata to associate with the element as JSON-LD."
516
+ cursor: {
517
+ type: "string",
518
+ description: "The cursor to get the next chunk of vertices."
393
519
  }
394
520
  };
521
+ var required = [
522
+ "@context",
523
+ "type",
524
+ "vertices"
525
+ ];
395
526
  var additionalProperties = false;
396
- var AuditableItemGraphVertexSchema = {
527
+ var description = "Interface describing an auditable item graph vertex list.";
528
+ var AuditableItemGraphVertexListSchema = {
397
529
  type: type,
398
530
  properties: properties,
399
- additionalProperties: additionalProperties
531
+ required: required,
532
+ additionalProperties: additionalProperties,
533
+ description: description
400
534
  };
401
535
 
402
536
  // Copyright 2024 IOTA Stiftung.
@@ -439,20 +573,10 @@ class AuditableItemGraphDataTypes {
439
573
  defaultValue: {},
440
574
  jsonSchema: async () => AuditableItemGraphPatchOperationSchema
441
575
  }));
442
- DataTypeHandlerFactory.register(AuditableItemGraphTypes.Credential, () => ({
443
- type: AuditableItemGraphTypes.Credential,
444
- defaultValue: {},
445
- jsonSchema: async () => AuditableItemGraphCredentialSchema
446
- }));
447
- DataTypeHandlerFactory.register(AuditableItemGraphTypes.Verification, () => ({
448
- type: AuditableItemGraphTypes.Verification,
576
+ DataTypeHandlerFactory.register(AuditableItemGraphTypes.VertexList, () => ({
577
+ type: AuditableItemGraphTypes.VertexList,
449
578
  defaultValue: {},
450
- jsonSchema: async () => AuditableItemGraphVerificationSchema
451
- }));
452
- DataTypeHandlerFactory.register(AuditableItemGraphTypes.VerificationState, () => ({
453
- type: AuditableItemGraphTypes.VerificationState,
454
- defaultValue: {},
455
- jsonSchema: async () => AuditableItemGraphVerificationStateSchema
579
+ jsonSchema: async () => AuditableItemGraphVertexListSchema
456
580
  }));
457
581
  }
458
582
  }
@@ -460,38 +584,35 @@ class AuditableItemGraphDataTypes {
460
584
  // Copyright 2024 IOTA Stiftung.
461
585
  // SPDX-License-Identifier: Apache-2.0.
462
586
  /**
463
- * The state of the verification.
587
+ * The contexts of auditable item graph data.
464
588
  */
465
589
  // eslint-disable-next-line @typescript-eslint/naming-convention
466
- const AuditableItemGraphVerificationState = {
467
- /**
468
- * OK.
469
- */
470
- Ok: "ok",
471
- /**
472
- * The stored hash does not matched the calculated one.
473
- */
474
- HashMismatch: "hashMismatch",
590
+ const AuditableItemGraphContexts = {
475
591
  /**
476
- * The signature verification failed.
477
- */
478
- SignatureNotVerified: "signatureNotVerified",
479
- /**
480
- * The credential in the immutable storage was revoked.
592
+ * The context root for the auditable item graph types.
481
593
  */
482
- CredentialRevoked: "credentialRevoked",
594
+ ContextRoot: "https://schema.twindev.org/aig/",
483
595
  /**
484
- * Immutable hash mismatch.
596
+ * The context root for the common types.
485
597
  */
486
- ImmutableHashMismatch: "immutableHashMismatch",
598
+ ContextRootCommon: "https://schema.twindev.org/common/"
599
+ };
600
+
601
+ // Copyright 2024 IOTA Stiftung.
602
+ // SPDX-License-Identifier: Apache-2.0.
603
+ /**
604
+ * The topics for auditable item graph event bus notifications.
605
+ */
606
+ // eslint-disable-next-line @typescript-eslint/naming-convention
607
+ const AuditableItemGraphTopics = {
487
608
  /**
488
- * Immutable signature mismatch.
609
+ * A vertex was created.
489
610
  */
490
- ImmutableSignatureMismatch: "immutableSignatureMismatch",
611
+ VertexCreated: "auditable-item-graph:vertex-created",
491
612
  /**
492
- * Integrity data mismatch.
613
+ * A vertex was updated.
493
614
  */
494
- IntegrityDataMismatch: "integrityDataMismatch"
615
+ VertexUpdated: "auditable-item-graph:vertex-updated"
495
616
  };
496
617
 
497
618
  // Copyright 2024 IOTA Stiftung.
@@ -515,4 +636,4 @@ const VerifyDepth = {
515
636
  All: "all"
516
637
  };
517
638
 
518
- export { AuditableItemGraphDataTypes, AuditableItemGraphTypes, AuditableItemGraphVerificationState, VerifyDepth };
639
+ export { AuditableItemGraphContexts, AuditableItemGraphDataTypes, AuditableItemGraphTopics, AuditableItemGraphTypes, VerifyDepth };