@twin.org/auditable-item-graph-models 0.0.2-next.7 → 0.0.3-next.0
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/es/dataTypes/auditableItemGraphDataTypes.js +65 -0
- package/dist/es/dataTypes/auditableItemGraphDataTypes.js.map +1 -0
- package/dist/es/index.js +25 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IAuditableItemGraphAlias.js +2 -0
- package/dist/es/models/IAuditableItemGraphAlias.js.map +1 -0
- package/dist/es/models/IAuditableItemGraphAuditedElement.js +4 -0
- package/dist/es/models/IAuditableItemGraphAuditedElement.js.map +1 -0
- package/dist/es/models/IAuditableItemGraphChangeset.js +2 -0
- package/dist/es/models/IAuditableItemGraphChangeset.js.map +1 -0
- package/dist/es/models/IAuditableItemGraphComponent.js +2 -0
- package/dist/es/models/IAuditableItemGraphComponent.js.map +1 -0
- package/dist/es/models/IAuditableItemGraphEdge.js +2 -0
- package/dist/es/models/IAuditableItemGraphEdge.js.map +1 -0
- package/dist/es/models/IAuditableItemGraphPatchOperation.js +2 -0
- package/dist/es/models/IAuditableItemGraphPatchOperation.js.map +1 -0
- package/dist/es/models/IAuditableItemGraphResource.js +2 -0
- package/dist/es/models/IAuditableItemGraphResource.js.map +1 -0
- package/dist/es/models/IAuditableItemGraphVertex.js +2 -0
- package/dist/es/models/IAuditableItemGraphVertex.js.map +1 -0
- package/dist/es/models/IAuditableItemGraphVertexList.js +2 -0
- package/dist/es/models/IAuditableItemGraphVertexList.js.map +1 -0
- package/dist/es/models/api/IAuditableItemGraphCreateRequest.js +2 -0
- package/dist/es/models/api/IAuditableItemGraphCreateRequest.js.map +1 -0
- package/dist/es/models/api/IAuditableItemGraphGetRequest.js +2 -0
- package/dist/es/models/api/IAuditableItemGraphGetRequest.js.map +1 -0
- package/dist/es/models/api/IAuditableItemGraphGetResponse.js +2 -0
- package/dist/es/models/api/IAuditableItemGraphGetResponse.js.map +1 -0
- package/dist/es/models/api/IAuditableItemGraphListRequest.js +2 -0
- package/dist/es/models/api/IAuditableItemGraphListRequest.js.map +1 -0
- package/dist/es/models/api/IAuditableItemGraphListResponse.js +2 -0
- package/dist/es/models/api/IAuditableItemGraphListResponse.js.map +1 -0
- package/dist/es/models/api/IAuditableItemGraphUpdateRequest.js +2 -0
- package/dist/es/models/api/IAuditableItemGraphUpdateRequest.js.map +1 -0
- package/dist/es/models/auditableItemGraphContexts.js +17 -0
- package/dist/es/models/auditableItemGraphContexts.js.map +1 -0
- package/dist/es/models/auditableItemGraphTopics.js +17 -0
- package/dist/es/models/auditableItemGraphTopics.js.map +1 -0
- package/dist/es/models/auditableItemGraphTypes.js +37 -0
- package/dist/es/models/auditableItemGraphTypes.js.map +1 -0
- package/dist/es/models/eventBus/IAuditableItemGraphEventBusVertexCreated.js +4 -0
- package/dist/es/models/eventBus/IAuditableItemGraphEventBusVertexCreated.js.map +1 -0
- package/dist/es/models/eventBus/IAuditableItemGraphEventBusVertexUpdated.js +2 -0
- package/dist/es/models/eventBus/IAuditableItemGraphEventBusVertexUpdated.js.map +1 -0
- package/dist/es/models/verifyDepth.js +21 -0
- package/dist/es/models/verifyDepth.js.map +1 -0
- package/dist/es/schemas/AuditableItemGraphAlias.json +65 -0
- package/dist/es/schemas/AuditableItemGraphChangeset.json +66 -0
- package/dist/es/schemas/AuditableItemGraphEdge.json +73 -0
- package/dist/es/schemas/AuditableItemGraphPatchOperation.json +65 -0
- package/dist/es/schemas/AuditableItemGraphResource.json +60 -0
- package/dist/es/schemas/AuditableItemGraphVertex.json +93 -0
- package/dist/es/schemas/AuditableItemGraphVertexList.json +59 -0
- package/dist/types/index.d.ts +22 -22
- package/dist/types/models/IAuditableItemGraphAlias.d.ts +3 -3
- package/dist/types/models/IAuditableItemGraphChangeset.d.ts +4 -4
- package/dist/types/models/IAuditableItemGraphComponent.d.ts +9 -14
- package/dist/types/models/IAuditableItemGraphEdge.d.ts +3 -3
- package/dist/types/models/IAuditableItemGraphPatchOperation.d.ts +2 -2
- package/dist/types/models/IAuditableItemGraphResource.d.ts +3 -3
- package/dist/types/models/IAuditableItemGraphVertex.d.ts +9 -9
- package/dist/types/models/IAuditableItemGraphVertexList.d.ts +3 -3
- package/dist/types/models/api/IAuditableItemGraphGetRequest.d.ts +1 -1
- package/dist/types/models/api/IAuditableItemGraphGetResponse.d.ts +1 -1
- package/dist/types/models/api/IAuditableItemGraphListRequest.d.ts +3 -3
- package/dist/types/models/api/IAuditableItemGraphListResponse.d.ts +1 -1
- package/docs/changelog.md +7 -0
- package/docs/reference/interfaces/IAuditableItemGraphChangeset.md +2 -2
- package/docs/reference/interfaces/IAuditableItemGraphComponent.md +7 -37
- package/docs/reference/interfaces/IAuditableItemGraphListRequest.md +3 -3
- package/docs/reference/interfaces/IAuditableItemGraphVertex.md +3 -3
- package/package.json +21 -8
- package/dist/cjs/index.cjs +0 -716
- package/dist/esm/index.mjs +0 -710
package/dist/cjs/index.cjs
DELETED
|
@@ -1,716 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var dataCore = require('@twin.org/data-core');
|
|
4
|
-
|
|
5
|
-
// Copyright 2024 IOTA Stiftung.
|
|
6
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
7
|
-
/**
|
|
8
|
-
* The contexts of auditable item graph data.
|
|
9
|
-
*/
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
|
-
const AuditableItemGraphContexts = {
|
|
12
|
-
/**
|
|
13
|
-
* The context root for the auditable item graph types.
|
|
14
|
-
*/
|
|
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 = {
|
|
29
|
-
/**
|
|
30
|
-
* Represents auditable item graph vertex.
|
|
31
|
-
*/
|
|
32
|
-
Vertex: "AuditableItemGraphVertex",
|
|
33
|
-
/**
|
|
34
|
-
* Represents auditable item graph vertex list.
|
|
35
|
-
*/
|
|
36
|
-
VertexList: "AuditableItemGraphVertexList",
|
|
37
|
-
/**
|
|
38
|
-
* Represents auditable item graph alias.
|
|
39
|
-
*/
|
|
40
|
-
Alias: "AuditableItemGraphAlias",
|
|
41
|
-
/**
|
|
42
|
-
* Represents auditable item graph resource.
|
|
43
|
-
*/
|
|
44
|
-
Resource: "AuditableItemGraphResource",
|
|
45
|
-
/**
|
|
46
|
-
* Represents auditable item graph edge.
|
|
47
|
-
*/
|
|
48
|
-
Edge: "AuditableItemGraphEdge",
|
|
49
|
-
/**
|
|
50
|
-
* Represents auditable item graph changeset.
|
|
51
|
-
*/
|
|
52
|
-
Changeset: "AuditableItemGraphChangeset",
|
|
53
|
-
/**
|
|
54
|
-
* Represents patch operation.
|
|
55
|
-
*/
|
|
56
|
-
PatchOperation: "AuditableItemGraphPatchOperation"
|
|
57
|
-
};
|
|
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.";
|
|
62
|
-
var type$6 = "object";
|
|
63
|
-
var properties$6 = {
|
|
64
|
-
id: {
|
|
65
|
-
type: "string",
|
|
66
|
-
description: "The id of the element."
|
|
67
|
-
},
|
|
68
|
-
dateCreated: {
|
|
69
|
-
type: "string",
|
|
70
|
-
description: "The date/time of when the element was created."
|
|
71
|
-
},
|
|
72
|
-
dateModified: {
|
|
73
|
-
type: "string",
|
|
74
|
-
description: "The date/time of when the element was modified."
|
|
75
|
-
},
|
|
76
|
-
dateDeleted: {
|
|
77
|
-
type: "string",
|
|
78
|
-
description: "The date/time of when the element was deleted, as we never actually remove items."
|
|
79
|
-
},
|
|
80
|
-
"@context": {
|
|
81
|
-
anyOf: [
|
|
82
|
-
{
|
|
83
|
-
type: "string",
|
|
84
|
-
"const": "https://schema.twindev.org/aig/"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
type: "array",
|
|
88
|
-
minItems: 1,
|
|
89
|
-
items: {
|
|
90
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
91
|
-
},
|
|
92
|
-
prefixItems: [
|
|
93
|
-
{
|
|
94
|
-
type: "string",
|
|
95
|
-
"const": "https://schema.twindev.org/aig/"
|
|
96
|
-
}
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
],
|
|
100
|
-
description: "JSON-LD Context."
|
|
101
|
-
},
|
|
102
|
-
type: {
|
|
103
|
-
type: "string",
|
|
104
|
-
"const": "AuditableItemGraphAlias",
|
|
105
|
-
description: "JSON-LD Type."
|
|
106
|
-
},
|
|
107
|
-
annotationObject: {
|
|
108
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
109
|
-
description: "The JSON-LD annotation object for the alias."
|
|
110
|
-
},
|
|
111
|
-
aliasFormat: {
|
|
112
|
-
type: "string",
|
|
113
|
-
description: "The format of the id in the alias."
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
var required$6 = [
|
|
117
|
-
"@context",
|
|
118
|
-
"id",
|
|
119
|
-
"type"
|
|
120
|
-
];
|
|
121
|
-
var additionalProperties$6 = false;
|
|
122
|
-
var AuditableItemGraphAliasSchema = {
|
|
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
|
|
130
|
-
};
|
|
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.";
|
|
135
|
-
var type$5 = "object";
|
|
136
|
-
var properties$5 = {
|
|
137
|
-
"@context": {
|
|
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: [
|
|
145
|
-
{
|
|
146
|
-
type: "string",
|
|
147
|
-
"const": "https://schema.twindev.org/aig/"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
type: "string",
|
|
151
|
-
"const": "https://schema.twindev.org/common/"
|
|
152
|
-
}
|
|
153
|
-
]
|
|
154
|
-
},
|
|
155
|
-
type: {
|
|
156
|
-
type: "string",
|
|
157
|
-
"const": "AuditableItemGraphChangeset",
|
|
158
|
-
description: "JSON-LD Type."
|
|
159
|
-
},
|
|
160
|
-
id: {
|
|
161
|
-
type: "string",
|
|
162
|
-
description: "The id of the changeset."
|
|
163
|
-
},
|
|
164
|
-
dateCreated: {
|
|
165
|
-
type: "string",
|
|
166
|
-
description: "The date/time of when the changeset was created."
|
|
167
|
-
},
|
|
168
|
-
userIdentity: {
|
|
169
|
-
type: "string",
|
|
170
|
-
description: "The user identity that created the changes."
|
|
171
|
-
},
|
|
172
|
-
patches: {
|
|
173
|
-
type: "array",
|
|
174
|
-
items: false,
|
|
175
|
-
description: "The patches in the changeset.",
|
|
176
|
-
prefixItems: [
|
|
177
|
-
{
|
|
178
|
-
$ref: "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation"
|
|
179
|
-
}
|
|
180
|
-
]
|
|
181
|
-
},
|
|
182
|
-
proofId: {
|
|
183
|
-
type: "string",
|
|
184
|
-
description: "The immutable proof id which contains the signature for this changeset."
|
|
185
|
-
},
|
|
186
|
-
verification: {
|
|
187
|
-
$ref: "https://schema.twindev.org/immutable-proof/ImmutableProofVerification",
|
|
188
|
-
description: "The verification for the changeset."
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
var required$5 = [
|
|
192
|
-
"@context",
|
|
193
|
-
"type",
|
|
194
|
-
"id",
|
|
195
|
-
"dateCreated",
|
|
196
|
-
"userIdentity",
|
|
197
|
-
"patches"
|
|
198
|
-
];
|
|
199
|
-
var additionalProperties$5 = false;
|
|
200
|
-
var AuditableItemGraphChangesetSchema = {
|
|
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
|
|
208
|
-
};
|
|
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.";
|
|
213
|
-
var type$4 = "object";
|
|
214
|
-
var properties$4 = {
|
|
215
|
-
id: {
|
|
216
|
-
type: "string",
|
|
217
|
-
description: "The id of the element."
|
|
218
|
-
},
|
|
219
|
-
dateCreated: {
|
|
220
|
-
type: "string",
|
|
221
|
-
description: "The date/time of when the element was created."
|
|
222
|
-
},
|
|
223
|
-
dateModified: {
|
|
224
|
-
type: "string",
|
|
225
|
-
description: "The date/time of when the element was modified."
|
|
226
|
-
},
|
|
227
|
-
dateDeleted: {
|
|
228
|
-
type: "string",
|
|
229
|
-
description: "The date/time of when the element was deleted, as we never actually remove items."
|
|
230
|
-
},
|
|
231
|
-
"@context": {
|
|
232
|
-
anyOf: [
|
|
233
|
-
{
|
|
234
|
-
type: "string",
|
|
235
|
-
"const": "https://schema.twindev.org/aig/"
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
type: "array",
|
|
239
|
-
minItems: 1,
|
|
240
|
-
items: {
|
|
241
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
242
|
-
},
|
|
243
|
-
prefixItems: [
|
|
244
|
-
{
|
|
245
|
-
type: "string",
|
|
246
|
-
"const": "https://schema.twindev.org/aig/"
|
|
247
|
-
}
|
|
248
|
-
]
|
|
249
|
-
}
|
|
250
|
-
],
|
|
251
|
-
description: "JSON-LD Context."
|
|
252
|
-
},
|
|
253
|
-
targetId: {
|
|
254
|
-
type: "string",
|
|
255
|
-
description: "The target vertex id the edge connects to."
|
|
256
|
-
},
|
|
257
|
-
type: {
|
|
258
|
-
type: "string",
|
|
259
|
-
"const": "AuditableItemGraphEdge",
|
|
260
|
-
description: "JSON-LD Type."
|
|
261
|
-
},
|
|
262
|
-
annotationObject: {
|
|
263
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
264
|
-
description: "The JSON-LD annotation object for the edge."
|
|
265
|
-
},
|
|
266
|
-
edgeRelationships: {
|
|
267
|
-
type: "array",
|
|
268
|
-
items: false,
|
|
269
|
-
description: "The relationships between the two vertices.",
|
|
270
|
-
prefixItems: [
|
|
271
|
-
{
|
|
272
|
-
type: "string"
|
|
273
|
-
}
|
|
274
|
-
]
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
var required$4 = [
|
|
278
|
-
"@context",
|
|
279
|
-
"targetId",
|
|
280
|
-
"type",
|
|
281
|
-
"edgeRelationships"
|
|
282
|
-
];
|
|
283
|
-
var additionalProperties$4 = false;
|
|
284
|
-
var AuditableItemGraphEdgeSchema = {
|
|
285
|
-
$schema: $schema$4,
|
|
286
|
-
$id: $id$4,
|
|
287
|
-
description: description$4,
|
|
288
|
-
type: type$4,
|
|
289
|
-
properties: properties$4,
|
|
290
|
-
required: required$4,
|
|
291
|
-
additionalProperties: additionalProperties$4
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
var $schema$3 = "https://json-schema.org/draft/2020-12/schema";
|
|
295
|
-
var $id$3 = "https://schema.twindev.org/aig/AuditableItemGraphPatchOperation";
|
|
296
|
-
var description$3 = "The patch operation for JSON diffs.";
|
|
297
|
-
var type$3 = "object";
|
|
298
|
-
var properties$3 = {
|
|
299
|
-
"@context": {
|
|
300
|
-
anyOf: [
|
|
301
|
-
{
|
|
302
|
-
type: "string",
|
|
303
|
-
"const": "https://schema.twindev.org/aig/"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
type: "array",
|
|
307
|
-
minItems: 1,
|
|
308
|
-
items: {
|
|
309
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
310
|
-
},
|
|
311
|
-
prefixItems: [
|
|
312
|
-
{
|
|
313
|
-
type: "string",
|
|
314
|
-
"const": "https://schema.twindev.org/aig/"
|
|
315
|
-
}
|
|
316
|
-
]
|
|
317
|
-
}
|
|
318
|
-
],
|
|
319
|
-
description: "JSON-LD Context."
|
|
320
|
-
},
|
|
321
|
-
type: {
|
|
322
|
-
type: "string",
|
|
323
|
-
"const": "AuditableItemGraphPatchOperation",
|
|
324
|
-
description: "JSON-LD Type."
|
|
325
|
-
},
|
|
326
|
-
patchOperation: {
|
|
327
|
-
type: "string",
|
|
328
|
-
"enum": [
|
|
329
|
-
"add",
|
|
330
|
-
"remove",
|
|
331
|
-
"replace",
|
|
332
|
-
"move",
|
|
333
|
-
"copy",
|
|
334
|
-
"test"
|
|
335
|
-
],
|
|
336
|
-
description: "The operation that was performed on the item."
|
|
337
|
-
},
|
|
338
|
-
patchPath: {
|
|
339
|
-
type: "string",
|
|
340
|
-
description: "The path to the object that was changed."
|
|
341
|
-
},
|
|
342
|
-
patchFrom: {
|
|
343
|
-
type: "string",
|
|
344
|
-
description: "The path the value was copied or moved from."
|
|
345
|
-
},
|
|
346
|
-
patchValue: {
|
|
347
|
-
description: "The value to add."
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
var required$3 = [
|
|
351
|
-
"@context",
|
|
352
|
-
"type",
|
|
353
|
-
"patchOperation",
|
|
354
|
-
"patchPath"
|
|
355
|
-
];
|
|
356
|
-
var additionalProperties$3 = false;
|
|
357
|
-
var AuditableItemGraphPatchOperationSchema = {
|
|
358
|
-
$schema: $schema$3,
|
|
359
|
-
$id: $id$3,
|
|
360
|
-
description: description$3,
|
|
361
|
-
type: type$3,
|
|
362
|
-
properties: properties$3,
|
|
363
|
-
required: required$3,
|
|
364
|
-
additionalProperties: additionalProperties$3
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
var $schema$2 = "https://json-schema.org/draft/2020-12/schema";
|
|
368
|
-
var $id$2 = "https://schema.twindev.org/aig/AuditableItemGraphResource";
|
|
369
|
-
var description$2 = "Interface describing an auditable item graph vertex resource.";
|
|
370
|
-
var type$2 = "object";
|
|
371
|
-
var properties$2 = {
|
|
372
|
-
id: {
|
|
373
|
-
type: "string",
|
|
374
|
-
description: "The id of the element."
|
|
375
|
-
},
|
|
376
|
-
dateCreated: {
|
|
377
|
-
type: "string",
|
|
378
|
-
description: "The date/time of when the element was created."
|
|
379
|
-
},
|
|
380
|
-
dateModified: {
|
|
381
|
-
type: "string",
|
|
382
|
-
description: "The date/time of when the element was modified."
|
|
383
|
-
},
|
|
384
|
-
dateDeleted: {
|
|
385
|
-
type: "string",
|
|
386
|
-
description: "The date/time of when the element was deleted, as we never actually remove items."
|
|
387
|
-
},
|
|
388
|
-
"@context": {
|
|
389
|
-
anyOf: [
|
|
390
|
-
{
|
|
391
|
-
type: "string",
|
|
392
|
-
"const": "https://schema.twindev.org/aig/"
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
type: "array",
|
|
396
|
-
minItems: 1,
|
|
397
|
-
items: {
|
|
398
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
399
|
-
},
|
|
400
|
-
prefixItems: [
|
|
401
|
-
{
|
|
402
|
-
type: "string",
|
|
403
|
-
"const": "https://schema.twindev.org/aig/"
|
|
404
|
-
}
|
|
405
|
-
]
|
|
406
|
-
}
|
|
407
|
-
],
|
|
408
|
-
description: "JSON-LD Context."
|
|
409
|
-
},
|
|
410
|
-
type: {
|
|
411
|
-
type: "string",
|
|
412
|
-
"const": "AuditableItemGraphResource",
|
|
413
|
-
description: "JSON-LD Type."
|
|
414
|
-
},
|
|
415
|
-
resourceObject: {
|
|
416
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
417
|
-
description: "The JSON-LD object for the resource."
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
var required$2 = [
|
|
421
|
-
"@context",
|
|
422
|
-
"type"
|
|
423
|
-
];
|
|
424
|
-
var additionalProperties$2 = false;
|
|
425
|
-
var AuditableItemGraphResourceSchema = {
|
|
426
|
-
$schema: $schema$2,
|
|
427
|
-
$id: $id$2,
|
|
428
|
-
description: description$2,
|
|
429
|
-
type: type$2,
|
|
430
|
-
properties: properties$2,
|
|
431
|
-
required: required$2,
|
|
432
|
-
additionalProperties: additionalProperties$2
|
|
433
|
-
};
|
|
434
|
-
|
|
435
|
-
var $schema$1 = "https://json-schema.org/draft/2020-12/schema";
|
|
436
|
-
var $id$1 = "https://schema.twindev.org/aig/AuditableItemGraphVertex";
|
|
437
|
-
var description$1 = "Interface describing an auditable item graph vertex.";
|
|
438
|
-
var type$1 = "object";
|
|
439
|
-
var properties$1 = {
|
|
440
|
-
id: {
|
|
441
|
-
type: "string",
|
|
442
|
-
description: "The id of the element."
|
|
443
|
-
},
|
|
444
|
-
dateCreated: {
|
|
445
|
-
type: "string",
|
|
446
|
-
description: "The date/time of when the element was created."
|
|
447
|
-
},
|
|
448
|
-
dateModified: {
|
|
449
|
-
type: "string",
|
|
450
|
-
description: "The date/time of when the element was modified."
|
|
451
|
-
},
|
|
452
|
-
dateDeleted: {
|
|
453
|
-
type: "string",
|
|
454
|
-
description: "The date/time of when the element was deleted, as we never actually remove items."
|
|
455
|
-
},
|
|
456
|
-
"@context": {
|
|
457
|
-
type: "array",
|
|
458
|
-
minItems: 2,
|
|
459
|
-
items: {
|
|
460
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
461
|
-
},
|
|
462
|
-
description: "JSON-LD Context.",
|
|
463
|
-
prefixItems: [
|
|
464
|
-
{
|
|
465
|
-
type: "string",
|
|
466
|
-
"const": "https://schema.twindev.org/aig/"
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
type: "string",
|
|
470
|
-
"const": "https://schema.twindev.org/common/"
|
|
471
|
-
}
|
|
472
|
-
]
|
|
473
|
-
},
|
|
474
|
-
type: {
|
|
475
|
-
type: "string",
|
|
476
|
-
"const": "AuditableItemGraphVertex",
|
|
477
|
-
description: "JSON-LD Type."
|
|
478
|
-
},
|
|
479
|
-
nodeIdentity: {
|
|
480
|
-
type: "string",
|
|
481
|
-
description: "The identity of the node which controls the vertex."
|
|
482
|
-
},
|
|
483
|
-
annotationObject: {
|
|
484
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
485
|
-
description: "The JSON-LD annotation object for the vertex."
|
|
486
|
-
},
|
|
487
|
-
aliases: {
|
|
488
|
-
type: "array",
|
|
489
|
-
items: false,
|
|
490
|
-
description: "Alternative aliases that can be used to identify the vertex.",
|
|
491
|
-
prefixItems: [
|
|
492
|
-
{
|
|
493
|
-
$ref: "https://schema.twindev.org/aig/AuditableItemGraphAlias"
|
|
494
|
-
}
|
|
495
|
-
]
|
|
496
|
-
},
|
|
497
|
-
resources: {
|
|
498
|
-
type: "array",
|
|
499
|
-
items: false,
|
|
500
|
-
description: "The resources attached to the vertex.",
|
|
501
|
-
prefixItems: [
|
|
502
|
-
{
|
|
503
|
-
$ref: "https://schema.twindev.org/aig/AuditableItemGraphResource"
|
|
504
|
-
}
|
|
505
|
-
]
|
|
506
|
-
},
|
|
507
|
-
edges: {
|
|
508
|
-
type: "array",
|
|
509
|
-
items: false,
|
|
510
|
-
description: "Edges connected to the vertex.",
|
|
511
|
-
prefixItems: [
|
|
512
|
-
{
|
|
513
|
-
$ref: "https://schema.twindev.org/aig/AuditableItemGraphEdge"
|
|
514
|
-
}
|
|
515
|
-
]
|
|
516
|
-
},
|
|
517
|
-
changesets: {
|
|
518
|
-
type: "array",
|
|
519
|
-
items: false,
|
|
520
|
-
description: "Changesets for the vertex.",
|
|
521
|
-
prefixItems: [
|
|
522
|
-
{
|
|
523
|
-
$ref: "https://schema.twindev.org/aig/AuditableItemGraphChangeset"
|
|
524
|
-
}
|
|
525
|
-
]
|
|
526
|
-
},
|
|
527
|
-
verified: {
|
|
528
|
-
type: "boolean",
|
|
529
|
-
description: "Is the vertex verified, will only be populated when verification is requested."
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
var required$1 = [
|
|
533
|
-
"@context",
|
|
534
|
-
"id",
|
|
535
|
-
"type"
|
|
536
|
-
];
|
|
537
|
-
var additionalProperties$1 = false;
|
|
538
|
-
var AuditableItemGraphVertexSchema = {
|
|
539
|
-
$schema: $schema$1,
|
|
540
|
-
$id: $id$1,
|
|
541
|
-
description: description$1,
|
|
542
|
-
type: type$1,
|
|
543
|
-
properties: properties$1,
|
|
544
|
-
required: required$1,
|
|
545
|
-
additionalProperties: additionalProperties$1
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
var $schema = "https://json-schema.org/draft/2020-12/schema";
|
|
549
|
-
var $id = "https://schema.twindev.org/aig/AuditableItemGraphVertexList";
|
|
550
|
-
var description = "Interface describing an auditable item graph vertex list.";
|
|
551
|
-
var type = "object";
|
|
552
|
-
var properties = {
|
|
553
|
-
"@context": {
|
|
554
|
-
type: "array",
|
|
555
|
-
minItems: 2,
|
|
556
|
-
items: {
|
|
557
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
558
|
-
},
|
|
559
|
-
description: "JSON-LD Context.",
|
|
560
|
-
prefixItems: [
|
|
561
|
-
{
|
|
562
|
-
type: "string",
|
|
563
|
-
"const": "https://schema.org"
|
|
564
|
-
},
|
|
565
|
-
{
|
|
566
|
-
type: "string",
|
|
567
|
-
"const": "https://schema.twindev.org/aig/"
|
|
568
|
-
}
|
|
569
|
-
]
|
|
570
|
-
},
|
|
571
|
-
type: {
|
|
572
|
-
type: "array",
|
|
573
|
-
minItems: 2,
|
|
574
|
-
items: false,
|
|
575
|
-
maxItems: 2,
|
|
576
|
-
description: "JSON-LD Type.",
|
|
577
|
-
prefixItems: [
|
|
578
|
-
{
|
|
579
|
-
type: "string",
|
|
580
|
-
"const": "ItemList"
|
|
581
|
-
},
|
|
582
|
-
{
|
|
583
|
-
type: "string",
|
|
584
|
-
"const": "AuditableItemGraphVertexList"
|
|
585
|
-
}
|
|
586
|
-
]
|
|
587
|
-
},
|
|
588
|
-
itemListElement: {
|
|
589
|
-
type: "array",
|
|
590
|
-
items: false,
|
|
591
|
-
description: "The list of vertices.",
|
|
592
|
-
prefixItems: [
|
|
593
|
-
{
|
|
594
|
-
$ref: "https://schema.twindev.org/aig/AuditableItemGraphVertex"
|
|
595
|
-
}
|
|
596
|
-
]
|
|
597
|
-
},
|
|
598
|
-
nextItem: {
|
|
599
|
-
type: "string",
|
|
600
|
-
description: "The cursor to get the next chunk of vertices."
|
|
601
|
-
}
|
|
602
|
-
};
|
|
603
|
-
var required = [
|
|
604
|
-
"@context",
|
|
605
|
-
"type",
|
|
606
|
-
"itemListElement"
|
|
607
|
-
];
|
|
608
|
-
var additionalProperties = false;
|
|
609
|
-
var AuditableItemGraphVertexListSchema = {
|
|
610
|
-
$schema: $schema,
|
|
611
|
-
$id: $id,
|
|
612
|
-
description: description,
|
|
613
|
-
type: type,
|
|
614
|
-
properties: properties,
|
|
615
|
-
required: required,
|
|
616
|
-
additionalProperties: additionalProperties
|
|
617
|
-
};
|
|
618
|
-
|
|
619
|
-
// Copyright 2024 IOTA Stiftung.
|
|
620
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
621
|
-
/**
|
|
622
|
-
* Handle all the data types for auditable item graph.
|
|
623
|
-
*/
|
|
624
|
-
class AuditableItemGraphDataTypes {
|
|
625
|
-
/**
|
|
626
|
-
* Register all the data types.
|
|
627
|
-
*/
|
|
628
|
-
static registerTypes() {
|
|
629
|
-
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Vertex}`, () => ({
|
|
630
|
-
context: AuditableItemGraphContexts.ContextRoot,
|
|
631
|
-
type: AuditableItemGraphTypes.Vertex,
|
|
632
|
-
defaultValue: {},
|
|
633
|
-
jsonSchema: async () => AuditableItemGraphVertexSchema
|
|
634
|
-
}));
|
|
635
|
-
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.VertexList}`, () => ({
|
|
636
|
-
context: AuditableItemGraphContexts.ContextRoot,
|
|
637
|
-
type: AuditableItemGraphTypes.VertexList,
|
|
638
|
-
defaultValue: {},
|
|
639
|
-
jsonSchema: async () => AuditableItemGraphVertexListSchema
|
|
640
|
-
}));
|
|
641
|
-
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Alias}`, () => ({
|
|
642
|
-
context: AuditableItemGraphContexts.ContextRoot,
|
|
643
|
-
type: AuditableItemGraphTypes.Alias,
|
|
644
|
-
defaultValue: {},
|
|
645
|
-
jsonSchema: async () => AuditableItemGraphAliasSchema
|
|
646
|
-
}));
|
|
647
|
-
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Resource}`, () => ({
|
|
648
|
-
context: AuditableItemGraphContexts.ContextRoot,
|
|
649
|
-
type: AuditableItemGraphTypes.Resource,
|
|
650
|
-
defaultValue: {},
|
|
651
|
-
jsonSchema: async () => AuditableItemGraphResourceSchema
|
|
652
|
-
}));
|
|
653
|
-
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Edge}`, () => ({
|
|
654
|
-
context: AuditableItemGraphContexts.ContextRoot,
|
|
655
|
-
type: AuditableItemGraphTypes.Edge,
|
|
656
|
-
defaultValue: {},
|
|
657
|
-
jsonSchema: async () => AuditableItemGraphEdgeSchema
|
|
658
|
-
}));
|
|
659
|
-
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.Changeset}`, () => ({
|
|
660
|
-
context: AuditableItemGraphContexts.ContextRoot,
|
|
661
|
-
type: AuditableItemGraphTypes.Changeset,
|
|
662
|
-
defaultValue: {},
|
|
663
|
-
jsonSchema: async () => AuditableItemGraphChangesetSchema
|
|
664
|
-
}));
|
|
665
|
-
dataCore.DataTypeHandlerFactory.register(`${AuditableItemGraphContexts.ContextRoot}${AuditableItemGraphTypes.PatchOperation}`, () => ({
|
|
666
|
-
context: AuditableItemGraphContexts.ContextRoot,
|
|
667
|
-
type: AuditableItemGraphTypes.PatchOperation,
|
|
668
|
-
defaultValue: {},
|
|
669
|
-
jsonSchema: async () => AuditableItemGraphPatchOperationSchema
|
|
670
|
-
}));
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
// Copyright 2024 IOTA Stiftung.
|
|
675
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
676
|
-
/**
|
|
677
|
-
* The topics for auditable item graph event bus notifications.
|
|
678
|
-
*/
|
|
679
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
680
|
-
const AuditableItemGraphTopics = {
|
|
681
|
-
/**
|
|
682
|
-
* A vertex was created.
|
|
683
|
-
*/
|
|
684
|
-
VertexCreated: "auditable-item-graph:vertex-created",
|
|
685
|
-
/**
|
|
686
|
-
* A vertex was updated.
|
|
687
|
-
*/
|
|
688
|
-
VertexUpdated: "auditable-item-graph:vertex-updated"
|
|
689
|
-
};
|
|
690
|
-
|
|
691
|
-
// Copyright 2024 IOTA Stiftung.
|
|
692
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
693
|
-
/**
|
|
694
|
-
* How deep to verify the signatures.
|
|
695
|
-
*/
|
|
696
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
697
|
-
const VerifyDepth = {
|
|
698
|
-
/**
|
|
699
|
-
* Do not verify any signatures.
|
|
700
|
-
*/
|
|
701
|
-
None: "none",
|
|
702
|
-
/**
|
|
703
|
-
* Verify only the most recent signature.
|
|
704
|
-
*/
|
|
705
|
-
Current: "current",
|
|
706
|
-
/**
|
|
707
|
-
* Verify all the signatures.
|
|
708
|
-
*/
|
|
709
|
-
All: "all"
|
|
710
|
-
};
|
|
711
|
-
|
|
712
|
-
exports.AuditableItemGraphContexts = AuditableItemGraphContexts;
|
|
713
|
-
exports.AuditableItemGraphDataTypes = AuditableItemGraphDataTypes;
|
|
714
|
-
exports.AuditableItemGraphTopics = AuditableItemGraphTopics;
|
|
715
|
-
exports.AuditableItemGraphTypes = AuditableItemGraphTypes;
|
|
716
|
-
exports.VerifyDepth = VerifyDepth;
|