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