@twin.org/auditable-item-graph-models 0.0.1-next.9 → 0.0.2-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +234 -148
- package/dist/esm/index.mjs +233 -149
- package/dist/types/index.d.ts +4 -0
- package/dist/types/models/IAuditableItemGraphAlias.d.ts +9 -4
- package/dist/types/models/IAuditableItemGraphAuditedElement.d.ts +2 -2
- package/dist/types/models/IAuditableItemGraphChangeset.d.ts +8 -2
- package/dist/types/models/IAuditableItemGraphComponent.d.ts +52 -36
- package/dist/types/models/IAuditableItemGraphEdge.d.ts +11 -6
- package/dist/types/models/IAuditableItemGraphPatchOperation.d.ts +3 -1
- package/dist/types/models/IAuditableItemGraphResource.d.ts +3 -2
- package/dist/types/models/IAuditableItemGraphVertex.d.ts +13 -4
- package/dist/types/models/IAuditableItemGraphVertexList.d.ts +11 -4
- package/dist/types/models/api/IAuditableItemGraphCreateRequest.d.ts +6 -6
- package/dist/types/models/api/IAuditableItemGraphGetRequest.d.ts +2 -2
- package/dist/types/models/api/IAuditableItemGraphListRequest.d.ts +10 -2
- package/dist/types/models/api/IAuditableItemGraphUpdateRequest.d.ts +6 -6
- package/dist/types/models/auditableItemGraphContexts.d.ts +17 -0
- package/dist/types/models/auditableItemGraphTopics.d.ts +17 -0
- package/dist/types/models/auditableItemGraphTypes.d.ts +4 -8
- package/dist/types/models/eventBus/IAuditableItemGraphEventBusVertexCreated.d.ts +9 -0
- package/dist/types/models/eventBus/IAuditableItemGraphEventBusVertexUpdated.d.ts +14 -0
- package/docs/changelog.md +109 -1
- package/docs/reference/classes/AuditableItemGraphDataTypes.md +3 -3
- package/docs/reference/index.md +6 -0
- package/docs/reference/interfaces/IAuditableItemGraphAlias.md +18 -18
- package/docs/reference/interfaces/IAuditableItemGraphAuditedElement.md +4 -4
- package/docs/reference/interfaces/IAuditableItemGraphChangeset.md +2 -2
- package/docs/reference/interfaces/IAuditableItemGraphComponent.md +109 -37
- package/docs/reference/interfaces/IAuditableItemGraphCreateRequest.md +4 -4
- package/docs/reference/interfaces/IAuditableItemGraphEdge.md +21 -21
- package/docs/reference/interfaces/IAuditableItemGraphEventBusVertexCreated.md +11 -0
- package/docs/reference/interfaces/IAuditableItemGraphEventBusVertexUpdated.md +19 -0
- package/docs/reference/interfaces/IAuditableItemGraphGetRequest.md +2 -2
- package/docs/reference/interfaces/IAuditableItemGraphListRequest.md +15 -3
- package/docs/reference/interfaces/IAuditableItemGraphPatchOperation.md +2 -2
- package/docs/reference/interfaces/IAuditableItemGraphResource.md +5 -5
- package/docs/reference/interfaces/IAuditableItemGraphUpdateRequest.md +4 -4
- package/docs/reference/interfaces/IAuditableItemGraphVertex.md +18 -18
- package/docs/reference/interfaces/IAuditableItemGraphVertexList.md +6 -6
- package/docs/reference/type-aliases/AuditableItemGraphContexts.md +5 -0
- package/docs/reference/type-aliases/AuditableItemGraphTopics.md +5 -0
- package/docs/reference/type-aliases/AuditableItemGraphTypes.md +1 -1
- package/docs/reference/type-aliases/VerifyDepth.md +1 -1
- package/docs/reference/variables/AuditableItemGraphContexts.md +19 -0
- package/docs/reference/variables/AuditableItemGraphTopics.md +19 -0
- package/docs/reference/variables/AuditableItemGraphTypes.md +6 -12
- package/package.json +5 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -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
|
|
8
|
+
* The contexts of auditable item graph data.
|
|
9
9
|
*/
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
|
-
const
|
|
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,13 +53,12 @@ const AuditableItemGraphTypes = {
|
|
|
36
53
|
/**
|
|
37
54
|
* Represents patch operation.
|
|
38
55
|
*/
|
|
39
|
-
PatchOperation: "AuditableItemGraphPatchOperation"
|
|
40
|
-
/**
|
|
41
|
-
* Represents auditable item stream vertex list.
|
|
42
|
-
*/
|
|
43
|
-
VertexList: "AuditableItemGraphVertexList"
|
|
56
|
+
PatchOperation: "AuditableItemGraphPatchOperation"
|
|
44
57
|
};
|
|
45
58
|
|
|
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.";
|
|
46
62
|
var type$6 = "object";
|
|
47
63
|
var properties$6 = {
|
|
48
64
|
id: {
|
|
@@ -70,15 +86,15 @@ var properties$6 = {
|
|
|
70
86
|
{
|
|
71
87
|
type: "array",
|
|
72
88
|
minItems: 1,
|
|
73
|
-
items:
|
|
89
|
+
items: {
|
|
90
|
+
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
91
|
+
},
|
|
92
|
+
prefixItems: [
|
|
74
93
|
{
|
|
75
94
|
type: "string",
|
|
76
95
|
"const": "https://schema.twindev.org/aig/"
|
|
77
96
|
}
|
|
78
|
-
]
|
|
79
|
-
additionalItems: {
|
|
80
|
-
type: "string"
|
|
81
|
-
}
|
|
97
|
+
]
|
|
82
98
|
}
|
|
83
99
|
],
|
|
84
100
|
description: "JSON-LD Context."
|
|
@@ -88,9 +104,9 @@ var properties$6 = {
|
|
|
88
104
|
"const": "AuditableItemGraphAlias",
|
|
89
105
|
description: "JSON-LD Type."
|
|
90
106
|
},
|
|
91
|
-
|
|
107
|
+
annotationObject: {
|
|
92
108
|
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
93
|
-
description: "The JSON-LD object for the alias."
|
|
109
|
+
description: "The JSON-LD annotation object for the alias."
|
|
94
110
|
},
|
|
95
111
|
aliasFormat: {
|
|
96
112
|
type: "string",
|
|
@@ -99,43 +115,42 @@ var properties$6 = {
|
|
|
99
115
|
};
|
|
100
116
|
var required$6 = [
|
|
101
117
|
"@context",
|
|
102
|
-
"dateCreated",
|
|
103
118
|
"id",
|
|
104
119
|
"type"
|
|
105
120
|
];
|
|
106
121
|
var additionalProperties$6 = false;
|
|
107
|
-
var description$6 = "Interface describing an alias for a vertex.";
|
|
108
122
|
var AuditableItemGraphAliasSchema = {
|
|
123
|
+
$schema: $schema$6,
|
|
124
|
+
$id: $id$6,
|
|
125
|
+
description: description$6,
|
|
109
126
|
type: type$6,
|
|
110
127
|
properties: properties$6,
|
|
111
128
|
required: required$6,
|
|
112
|
-
additionalProperties: additionalProperties$6
|
|
113
|
-
description: description$6
|
|
129
|
+
additionalProperties: additionalProperties$6
|
|
114
130
|
};
|
|
115
131
|
|
|
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.";
|
|
116
135
|
var type$5 = "object";
|
|
117
136
|
var properties$5 = {
|
|
118
137
|
"@context": {
|
|
119
|
-
|
|
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: [
|
|
120
145
|
{
|
|
121
146
|
type: "string",
|
|
122
147
|
"const": "https://schema.twindev.org/aig/"
|
|
123
148
|
},
|
|
124
149
|
{
|
|
125
|
-
type: "
|
|
126
|
-
|
|
127
|
-
items: [
|
|
128
|
-
{
|
|
129
|
-
type: "string",
|
|
130
|
-
"const": "https://schema.twindev.org/aig/"
|
|
131
|
-
}
|
|
132
|
-
],
|
|
133
|
-
additionalItems: {
|
|
134
|
-
type: "string"
|
|
135
|
-
}
|
|
150
|
+
type: "string",
|
|
151
|
+
"const": "https://schema.twindev.org/common/"
|
|
136
152
|
}
|
|
137
|
-
]
|
|
138
|
-
description: "JSON-LD Context."
|
|
153
|
+
]
|
|
139
154
|
},
|
|
140
155
|
type: {
|
|
141
156
|
type: "string",
|
|
@@ -156,10 +171,13 @@ var properties$5 = {
|
|
|
156
171
|
},
|
|
157
172
|
patches: {
|
|
158
173
|
type: "array",
|
|
159
|
-
items:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
174
|
+
items: false,
|
|
175
|
+
description: "The patches in the changeset.",
|
|
176
|
+
prefixItems: [
|
|
177
|
+
{
|
|
178
|
+
$ref: "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
163
181
|
},
|
|
164
182
|
proofId: {
|
|
165
183
|
type: "string",
|
|
@@ -179,15 +197,19 @@ var required$5 = [
|
|
|
179
197
|
"patches"
|
|
180
198
|
];
|
|
181
199
|
var additionalProperties$5 = false;
|
|
182
|
-
var description$5 = "Interface describing a set of updates to the vertex.";
|
|
183
200
|
var AuditableItemGraphChangesetSchema = {
|
|
201
|
+
$schema: $schema$5,
|
|
202
|
+
$id: $id$5,
|
|
203
|
+
description: description$5,
|
|
184
204
|
type: type$5,
|
|
185
205
|
properties: properties$5,
|
|
186
206
|
required: required$5,
|
|
187
|
-
additionalProperties: additionalProperties$5
|
|
188
|
-
description: description$5
|
|
207
|
+
additionalProperties: additionalProperties$5
|
|
189
208
|
};
|
|
190
209
|
|
|
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.";
|
|
191
213
|
var type$4 = "object";
|
|
192
214
|
var properties$4 = {
|
|
193
215
|
id: {
|
|
@@ -215,15 +237,15 @@ var properties$4 = {
|
|
|
215
237
|
{
|
|
216
238
|
type: "array",
|
|
217
239
|
minItems: 1,
|
|
218
|
-
items:
|
|
240
|
+
items: {
|
|
241
|
+
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
242
|
+
},
|
|
243
|
+
prefixItems: [
|
|
219
244
|
{
|
|
220
245
|
type: "string",
|
|
221
246
|
"const": "https://schema.twindev.org/aig/"
|
|
222
247
|
}
|
|
223
|
-
]
|
|
224
|
-
additionalItems: {
|
|
225
|
-
type: "string"
|
|
226
|
-
}
|
|
248
|
+
]
|
|
227
249
|
}
|
|
228
250
|
],
|
|
229
251
|
description: "JSON-LD Context."
|
|
@@ -233,32 +255,41 @@ var properties$4 = {
|
|
|
233
255
|
"const": "AuditableItemGraphEdge",
|
|
234
256
|
description: "JSON-LD Type."
|
|
235
257
|
},
|
|
236
|
-
|
|
258
|
+
annotationObject: {
|
|
237
259
|
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
238
|
-
description: "The JSON-LD object for the edge."
|
|
260
|
+
description: "The JSON-LD annotation object for the edge."
|
|
239
261
|
},
|
|
240
|
-
|
|
241
|
-
type: "
|
|
242
|
-
|
|
262
|
+
edgeRelationships: {
|
|
263
|
+
type: "array",
|
|
264
|
+
items: false,
|
|
265
|
+
description: "The relationships between the two vertices.",
|
|
266
|
+
prefixItems: [
|
|
267
|
+
{
|
|
268
|
+
type: "string"
|
|
269
|
+
}
|
|
270
|
+
]
|
|
243
271
|
}
|
|
244
272
|
};
|
|
245
273
|
var required$4 = [
|
|
246
274
|
"@context",
|
|
247
|
-
"dateCreated",
|
|
248
|
-
"edgeRelationship",
|
|
249
275
|
"id",
|
|
250
|
-
"type"
|
|
276
|
+
"type",
|
|
277
|
+
"edgeRelationships"
|
|
251
278
|
];
|
|
252
279
|
var additionalProperties$4 = false;
|
|
253
|
-
var description$4 = "Interface describing an edge between two vertices in an auditable item graph.";
|
|
254
280
|
var AuditableItemGraphEdgeSchema = {
|
|
281
|
+
$schema: $schema$4,
|
|
282
|
+
$id: $id$4,
|
|
283
|
+
description: description$4,
|
|
255
284
|
type: type$4,
|
|
256
285
|
properties: properties$4,
|
|
257
286
|
required: required$4,
|
|
258
|
-
additionalProperties: additionalProperties$4
|
|
259
|
-
description: description$4
|
|
287
|
+
additionalProperties: additionalProperties$4
|
|
260
288
|
};
|
|
261
289
|
|
|
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.";
|
|
262
293
|
var type$3 = "object";
|
|
263
294
|
var properties$3 = {
|
|
264
295
|
"@context": {
|
|
@@ -270,15 +301,15 @@ var properties$3 = {
|
|
|
270
301
|
{
|
|
271
302
|
type: "array",
|
|
272
303
|
minItems: 1,
|
|
273
|
-
items:
|
|
304
|
+
items: {
|
|
305
|
+
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
306
|
+
},
|
|
307
|
+
prefixItems: [
|
|
274
308
|
{
|
|
275
309
|
type: "string",
|
|
276
310
|
"const": "https://schema.twindev.org/aig/"
|
|
277
311
|
}
|
|
278
|
-
]
|
|
279
|
-
additionalItems: {
|
|
280
|
-
type: "string"
|
|
281
|
-
}
|
|
312
|
+
]
|
|
282
313
|
}
|
|
283
314
|
],
|
|
284
315
|
description: "JSON-LD Context."
|
|
@@ -319,15 +350,19 @@ var required$3 = [
|
|
|
319
350
|
"patchPath"
|
|
320
351
|
];
|
|
321
352
|
var additionalProperties$3 = false;
|
|
322
|
-
var description$3 = "The patch operation for JSON diffs.";
|
|
323
353
|
var AuditableItemGraphPatchOperationSchema = {
|
|
354
|
+
$schema: $schema$3,
|
|
355
|
+
$id: $id$3,
|
|
356
|
+
description: description$3,
|
|
324
357
|
type: type$3,
|
|
325
358
|
properties: properties$3,
|
|
326
359
|
required: required$3,
|
|
327
|
-
additionalProperties: additionalProperties$3
|
|
328
|
-
description: description$3
|
|
360
|
+
additionalProperties: additionalProperties$3
|
|
329
361
|
};
|
|
330
362
|
|
|
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.";
|
|
331
366
|
var type$2 = "object";
|
|
332
367
|
var properties$2 = {
|
|
333
368
|
id: {
|
|
@@ -355,15 +390,15 @@ var properties$2 = {
|
|
|
355
390
|
{
|
|
356
391
|
type: "array",
|
|
357
392
|
minItems: 1,
|
|
358
|
-
items:
|
|
393
|
+
items: {
|
|
394
|
+
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
395
|
+
},
|
|
396
|
+
prefixItems: [
|
|
359
397
|
{
|
|
360
398
|
type: "string",
|
|
361
399
|
"const": "https://schema.twindev.org/aig/"
|
|
362
400
|
}
|
|
363
|
-
]
|
|
364
|
-
additionalItems: {
|
|
365
|
-
type: "string"
|
|
366
|
-
}
|
|
401
|
+
]
|
|
367
402
|
}
|
|
368
403
|
],
|
|
369
404
|
description: "JSON-LD Context."
|
|
@@ -380,20 +415,22 @@ var properties$2 = {
|
|
|
380
415
|
};
|
|
381
416
|
var required$2 = [
|
|
382
417
|
"@context",
|
|
383
|
-
"dateCreated",
|
|
384
|
-
"id",
|
|
385
418
|
"type"
|
|
386
419
|
];
|
|
387
420
|
var additionalProperties$2 = false;
|
|
388
|
-
var description$2 = "Interface describing an auditable item graph vertex resource.";
|
|
389
421
|
var AuditableItemGraphResourceSchema = {
|
|
422
|
+
$schema: $schema$2,
|
|
423
|
+
$id: $id$2,
|
|
424
|
+
description: description$2,
|
|
390
425
|
type: type$2,
|
|
391
426
|
properties: properties$2,
|
|
392
427
|
required: required$2,
|
|
393
|
-
additionalProperties: additionalProperties$2
|
|
394
|
-
description: description$2
|
|
428
|
+
additionalProperties: additionalProperties$2
|
|
395
429
|
};
|
|
396
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.";
|
|
397
434
|
var type$1 = "object";
|
|
398
435
|
var properties$1 = {
|
|
399
436
|
id: {
|
|
@@ -413,26 +450,22 @@ var properties$1 = {
|
|
|
413
450
|
description: "The date/time of when the element was deleted, as we never actually remove items."
|
|
414
451
|
},
|
|
415
452
|
"@context": {
|
|
416
|
-
|
|
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: [
|
|
417
460
|
{
|
|
418
461
|
type: "string",
|
|
419
462
|
"const": "https://schema.twindev.org/aig/"
|
|
420
463
|
},
|
|
421
464
|
{
|
|
422
|
-
type: "
|
|
423
|
-
|
|
424
|
-
items: [
|
|
425
|
-
{
|
|
426
|
-
type: "string",
|
|
427
|
-
"const": "https://schema.twindev.org/aig/"
|
|
428
|
-
}
|
|
429
|
-
],
|
|
430
|
-
additionalItems: {
|
|
431
|
-
type: "string"
|
|
432
|
-
}
|
|
465
|
+
type: "string",
|
|
466
|
+
"const": "https://schema.twindev.org/common/"
|
|
433
467
|
}
|
|
434
|
-
]
|
|
435
|
-
description: "JSON-LD Context."
|
|
468
|
+
]
|
|
436
469
|
},
|
|
437
470
|
type: {
|
|
438
471
|
type: "string",
|
|
@@ -443,37 +476,49 @@ var properties$1 = {
|
|
|
443
476
|
type: "string",
|
|
444
477
|
description: "The identity of the node which controls the vertex."
|
|
445
478
|
},
|
|
446
|
-
|
|
479
|
+
annotationObject: {
|
|
447
480
|
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
448
|
-
description: "The JSON-LD object for the vertex."
|
|
481
|
+
description: "The JSON-LD annotation object for the vertex."
|
|
449
482
|
},
|
|
450
483
|
aliases: {
|
|
451
484
|
type: "array",
|
|
452
|
-
items:
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
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
|
-
|
|
461
|
-
|
|
462
|
-
|
|
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
|
-
|
|
468
|
-
|
|
469
|
-
|
|
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
|
-
|
|
475
|
-
|
|
476
|
-
|
|
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",
|
|
@@ -482,57 +527,71 @@ var properties$1 = {
|
|
|
482
527
|
};
|
|
483
528
|
var required$1 = [
|
|
484
529
|
"@context",
|
|
485
|
-
"dateCreated",
|
|
486
530
|
"id",
|
|
487
531
|
"type"
|
|
488
532
|
];
|
|
489
533
|
var additionalProperties$1 = false;
|
|
490
|
-
var description$1 = "Interface describing an auditable item graph vertex.";
|
|
491
534
|
var AuditableItemGraphVertexSchema = {
|
|
535
|
+
$schema: $schema$1,
|
|
536
|
+
$id: $id$1,
|
|
537
|
+
description: description$1,
|
|
492
538
|
type: type$1,
|
|
493
539
|
properties: properties$1,
|
|
494
540
|
required: required$1,
|
|
495
|
-
additionalProperties: additionalProperties$1
|
|
496
|
-
description: description$1
|
|
541
|
+
additionalProperties: additionalProperties$1
|
|
497
542
|
};
|
|
498
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.";
|
|
499
547
|
var type = "object";
|
|
500
548
|
var properties = {
|
|
501
549
|
"@context": {
|
|
502
|
-
|
|
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: [
|
|
503
557
|
{
|
|
504
558
|
type: "string",
|
|
505
|
-
"const": "https://schema.
|
|
559
|
+
"const": "https://schema.org"
|
|
506
560
|
},
|
|
507
561
|
{
|
|
508
|
-
type: "
|
|
509
|
-
|
|
510
|
-
items: [
|
|
511
|
-
{
|
|
512
|
-
type: "string",
|
|
513
|
-
"const": "https://schema.twindev.org/aig/"
|
|
514
|
-
}
|
|
515
|
-
],
|
|
516
|
-
additionalItems: {
|
|
517
|
-
type: "string"
|
|
518
|
-
}
|
|
562
|
+
type: "string",
|
|
563
|
+
"const": "https://schema.twindev.org/aig/"
|
|
519
564
|
}
|
|
520
|
-
]
|
|
521
|
-
description: "JSON-LD Context."
|
|
565
|
+
]
|
|
522
566
|
},
|
|
523
567
|
type: {
|
|
524
|
-
type: "
|
|
525
|
-
|
|
526
|
-
|
|
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
|
+
]
|
|
527
583
|
},
|
|
528
|
-
|
|
584
|
+
itemListElement: {
|
|
529
585
|
type: "array",
|
|
530
|
-
items:
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
586
|
+
items: false,
|
|
587
|
+
description: "The list of vertices.",
|
|
588
|
+
prefixItems: [
|
|
589
|
+
{
|
|
590
|
+
$ref: "https://schema.twindev.org/aig/AuditableItemGraphVertex"
|
|
591
|
+
}
|
|
592
|
+
]
|
|
534
593
|
},
|
|
535
|
-
|
|
594
|
+
nextItem: {
|
|
536
595
|
type: "string",
|
|
537
596
|
description: "The cursor to get the next chunk of vertices."
|
|
538
597
|
}
|
|
@@ -540,16 +599,17 @@ var properties = {
|
|
|
540
599
|
var required = [
|
|
541
600
|
"@context",
|
|
542
601
|
"type",
|
|
543
|
-
"
|
|
602
|
+
"itemListElement"
|
|
544
603
|
];
|
|
545
604
|
var additionalProperties = false;
|
|
546
|
-
var description = "Interface describing an auditable item graph vertex list.";
|
|
547
605
|
var AuditableItemGraphVertexListSchema = {
|
|
606
|
+
$schema: $schema,
|
|
607
|
+
$id: $id,
|
|
608
|
+
description: description,
|
|
548
609
|
type: type,
|
|
549
610
|
properties: properties,
|
|
550
611
|
required: required,
|
|
551
|
-
additionalProperties: additionalProperties
|
|
552
|
-
description: description
|
|
612
|
+
additionalProperties: additionalProperties
|
|
553
613
|
};
|
|
554
614
|
|
|
555
615
|
// Copyright 2024 IOTA Stiftung.
|
|
@@ -562,44 +622,68 @@ class AuditableItemGraphDataTypes {
|
|
|
562
622
|
* Register all the data types.
|
|
563
623
|
*/
|
|
564
624
|
static registerTypes() {
|
|
565
|
-
dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.Vertex
|
|
625
|
+
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Vertex}`, () => ({
|
|
626
|
+
context: AuditableItemGraphContexts.ContextRoot,
|
|
566
627
|
type: AuditableItemGraphTypes.Vertex,
|
|
567
628
|
defaultValue: {},
|
|
568
629
|
jsonSchema: async () => AuditableItemGraphVertexSchema
|
|
569
630
|
}));
|
|
570
|
-
dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.
|
|
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,
|
|
571
639
|
type: AuditableItemGraphTypes.Alias,
|
|
572
640
|
defaultValue: {},
|
|
573
641
|
jsonSchema: async () => AuditableItemGraphAliasSchema
|
|
574
642
|
}));
|
|
575
|
-
dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.Resource
|
|
643
|
+
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Resource}`, () => ({
|
|
644
|
+
context: AuditableItemGraphContexts.ContextRoot,
|
|
576
645
|
type: AuditableItemGraphTypes.Resource,
|
|
577
646
|
defaultValue: {},
|
|
578
647
|
jsonSchema: async () => AuditableItemGraphResourceSchema
|
|
579
648
|
}));
|
|
580
|
-
dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.Edge
|
|
649
|
+
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Edge}`, () => ({
|
|
650
|
+
context: AuditableItemGraphContexts.ContextRoot,
|
|
581
651
|
type: AuditableItemGraphTypes.Edge,
|
|
582
652
|
defaultValue: {},
|
|
583
653
|
jsonSchema: async () => AuditableItemGraphEdgeSchema
|
|
584
654
|
}));
|
|
585
|
-
dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.Changeset
|
|
655
|
+
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Changeset}`, () => ({
|
|
656
|
+
context: AuditableItemGraphContexts.ContextRoot,
|
|
586
657
|
type: AuditableItemGraphTypes.Changeset,
|
|
587
658
|
defaultValue: {},
|
|
588
659
|
jsonSchema: async () => AuditableItemGraphChangesetSchema
|
|
589
660
|
}));
|
|
590
|
-
dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.PatchOperation
|
|
661
|
+
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.PatchOperation}`, () => ({
|
|
662
|
+
context: AuditableItemGraphContexts.ContextRoot,
|
|
591
663
|
type: AuditableItemGraphTypes.PatchOperation,
|
|
592
664
|
defaultValue: {},
|
|
593
665
|
jsonSchema: async () => AuditableItemGraphPatchOperationSchema
|
|
594
666
|
}));
|
|
595
|
-
dataCore.DataTypeHandlerFactory.register(AuditableItemGraphTypes.VertexList, () => ({
|
|
596
|
-
type: AuditableItemGraphTypes.VertexList,
|
|
597
|
-
defaultValue: {},
|
|
598
|
-
jsonSchema: async () => AuditableItemGraphVertexListSchema
|
|
599
|
-
}));
|
|
600
667
|
}
|
|
601
668
|
}
|
|
602
669
|
|
|
670
|
+
// Copyright 2024 IOTA Stiftung.
|
|
671
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
672
|
+
/**
|
|
673
|
+
* The topics for auditable item graph event bus notifications.
|
|
674
|
+
*/
|
|
675
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
676
|
+
const AuditableItemGraphTopics = {
|
|
677
|
+
/**
|
|
678
|
+
* A vertex was created.
|
|
679
|
+
*/
|
|
680
|
+
VertexCreated: "auditable-item-graph:vertex-created",
|
|
681
|
+
/**
|
|
682
|
+
* A vertex was updated.
|
|
683
|
+
*/
|
|
684
|
+
VertexUpdated: "auditable-item-graph:vertex-updated"
|
|
685
|
+
};
|
|
686
|
+
|
|
603
687
|
// Copyright 2024 IOTA Stiftung.
|
|
604
688
|
// SPDX-License-Identifier: Apache-2.0.
|
|
605
689
|
/**
|
|
@@ -621,6 +705,8 @@ const VerifyDepth = {
|
|
|
621
705
|
All: "all"
|
|
622
706
|
};
|
|
623
707
|
|
|
708
|
+
exports.AuditableItemGraphContexts = AuditableItemGraphContexts;
|
|
624
709
|
exports.AuditableItemGraphDataTypes = AuditableItemGraphDataTypes;
|
|
710
|
+
exports.AuditableItemGraphTopics = AuditableItemGraphTopics;
|
|
625
711
|
exports.AuditableItemGraphTypes = AuditableItemGraphTypes;
|
|
626
712
|
exports.VerifyDepth = VerifyDepth;
|