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