@twin.org/auditable-item-graph-service 0.0.3-next.2 → 0.0.3-next.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +3 -1
  2. package/dist/es/auditableItemGraphRoutes.js +609 -44
  3. package/dist/es/auditableItemGraphRoutes.js.map +1 -1
  4. package/dist/es/auditableItemGraphService.js +714 -159
  5. package/dist/es/auditableItemGraphService.js.map +1 -1
  6. package/dist/es/entities/auditableItemGraphAlias.js +8 -0
  7. package/dist/es/entities/auditableItemGraphAlias.js.map +1 -1
  8. package/dist/es/entities/auditableItemGraphChangeset.js +8 -0
  9. package/dist/es/entities/auditableItemGraphChangeset.js.map +1 -1
  10. package/dist/es/entities/auditableItemGraphVertex.js +8 -0
  11. package/dist/es/entities/auditableItemGraphVertex.js.map +1 -1
  12. package/dist/es/models/IAuditableItemGraphServiceConstructorOptions.js.map +1 -1
  13. package/dist/types/auditableItemGraphRoutes.d.ts +42 -2
  14. package/dist/types/auditableItemGraphService.d.ts +81 -55
  15. package/dist/types/entities/auditableItemGraphAlias.d.ts +4 -0
  16. package/dist/types/entities/auditableItemGraphChangeset.d.ts +4 -0
  17. package/dist/types/entities/auditableItemGraphVertex.d.ts +4 -0
  18. package/dist/types/models/IAuditableItemGraphServiceConstructorOptions.d.ts +4 -0
  19. package/docs/changelog.md +370 -71
  20. package/docs/examples.md +241 -1
  21. package/docs/open-api/spec.json +1218 -220
  22. package/docs/reference/classes/AuditableItemGraphAlias.md +18 -10
  23. package/docs/reference/classes/AuditableItemGraphChangeset.md +16 -8
  24. package/docs/reference/classes/AuditableItemGraphEdge.md +10 -10
  25. package/docs/reference/classes/AuditableItemGraphPatch.md +6 -6
  26. package/docs/reference/classes/AuditableItemGraphResource.md +9 -9
  27. package/docs/reference/classes/AuditableItemGraphService.md +221 -59
  28. package/docs/reference/classes/AuditableItemGraphVertex.md +26 -18
  29. package/docs/reference/functions/auditableItemGraphChangesetGet.md +31 -0
  30. package/docs/reference/functions/auditableItemGraphChangesetList.md +31 -0
  31. package/docs/reference/functions/auditableItemGraphUpdate.md +1 -1
  32. package/docs/reference/functions/auditableItemGraphUpdatePartial.md +31 -0
  33. package/docs/reference/functions/auditableItemGraphVersionGet.md +31 -0
  34. package/docs/reference/functions/auditableItemGraphVersionList.md +31 -0
  35. package/docs/reference/index.md +5 -0
  36. package/docs/reference/interfaces/IAuditableItemGraphServiceConstructorOptions.md +18 -10
  37. package/locales/en.json +7 -2
  38. package/package.json +6 -6
@@ -28,7 +28,7 @@ The dependencies for the auditable item graph connector.
28
28
 
29
29
  ## Properties
30
30
 
31
- ### CLASS\_NAME
31
+ ### CLASS\_NAME {#class_name}
32
32
 
33
33
  > `readonly` `static` **CLASS\_NAME**: `string`
34
34
 
@@ -36,7 +36,7 @@ Runtime name for the class.
36
36
 
37
37
  ***
38
38
 
39
- ### NAMESPACE\_CHANGESET
39
+ ### NAMESPACE\_CHANGESET {#namespace_changeset}
40
40
 
41
41
  > `readonly` `static` **NAMESPACE\_CHANGESET**: `string` = `"changeset"`
42
42
 
@@ -44,7 +44,7 @@ The namespace for the service changeset.
44
44
 
45
45
  ***
46
46
 
47
- ### NAMESPACE\_EDGE
47
+ ### NAMESPACE\_EDGE {#namespace_edge}
48
48
 
49
49
  > `readonly` `static` **NAMESPACE\_EDGE**: `string` = `"edge"`
50
50
 
@@ -52,7 +52,7 @@ The namespace for the service edge.
52
52
 
53
53
  ## Methods
54
54
 
55
- ### className()
55
+ ### className() {#classname}
56
56
 
57
57
  > **className**(): `string`
58
58
 
@@ -70,7 +70,23 @@ The class name of the component.
70
70
 
71
71
  ***
72
72
 
73
- ### create()
73
+ ### start() {#start}
74
+
75
+ > **start**(): `Promise`\<`void`\>
76
+
77
+ Register all AIG metrics with the telemetry component.
78
+
79
+ #### Returns
80
+
81
+ `Promise`\<`void`\>
82
+
83
+ #### Implementation of
84
+
85
+ `IAuditableItemGraphComponent.start`
86
+
87
+ ***
88
+
89
+ ### create() {#create}
74
90
 
75
91
  > **create**(`vertex`): `Promise`\<`string`\>
76
92
 
@@ -80,45 +96,77 @@ Create a new graph vertex.
80
96
 
81
97
  ##### vertex
82
98
 
99
+ `Omit`\<`IAuditableItemGraphVertex`, `"id"`\>
100
+
83
101
  The vertex to create.
84
102
 
85
- ###### annotationObject?
103
+ #### Returns
86
104
 
87
- `IJsonLdNodeObject`
105
+ `Promise`\<`string`\>
88
106
 
89
- The annotation object for the vertex as JSON-LD.
107
+ The id of the new graph item.
90
108
 
91
- ###### aliases?
109
+ #### Implementation of
92
110
 
93
- `object`[]
111
+ `IAuditableItemGraphComponent.create`
94
112
 
95
- Alternative aliases that can be used to identify the vertex.
113
+ ***
96
114
 
97
- ###### resources?
115
+ ### update() {#update}
98
116
 
99
- `object`[]
117
+ > **update**(`vertex`): `Promise`\<`void`\>
100
118
 
101
- The resources attached to the vertex.
119
+ Update a graph vertex (PUT — full replacement of vertex state).
120
+ Concurrent updates for the same vertex are serialized via `Mutex` on the vertex id.
102
121
 
103
- ###### edges?
122
+ #### Parameters
104
123
 
105
- `object`[]
124
+ ##### vertex
106
125
 
107
- The edges connected to the vertex.
126
+ `IAuditableItemGraphVertex`
127
+
128
+ The vertex to update.
108
129
 
109
130
  #### Returns
110
131
 
111
- `Promise`\<`string`\>
132
+ `Promise`\<`void`\>
112
133
 
113
- The id of the new graph item.
134
+ Nothing.
114
135
 
115
136
  #### Implementation of
116
137
 
117
- `IAuditableItemGraphComponent.create`
138
+ `IAuditableItemGraphComponent.update`
118
139
 
119
140
  ***
120
141
 
121
- ### get()
142
+ ### updatePartial() {#updatepartial}
143
+
144
+ > **updatePartial**(`partial`): `Promise`\<`void`\>
145
+
146
+ Partially update a graph vertex (PATCH — explicit list patches; only defined properties applied).
147
+ Serialized with `update` via `Mutex` on the same vertex id within this instance.
148
+
149
+ #### Parameters
150
+
151
+ ##### partial
152
+
153
+ `IAuditableItemGraphPartialVertex`
154
+
155
+ The partial vertex update.
156
+
157
+ #### Returns
158
+
159
+ `Promise`\<`void`\>
160
+
161
+ Nothing.
162
+
163
+ #### Implementation of
164
+
165
+ `IAuditableItemGraphComponent.updatePartial`
166
+
167
+ ***
168
+
169
+ ### get() {#get}
122
170
 
123
171
  > **get**(`id`, `options?`): `Promise`\<`IAuditableItemGraphVertex`\>
124
172
 
@@ -142,11 +190,57 @@ Additional options for the get operation.
142
190
 
143
191
  Whether to include deleted/updated aliases, resource, edges, defaults to false.
144
192
 
145
- ###### includeChangesets?
193
+ ###### verifySignatureDepth?
146
194
 
147
- `boolean`
195
+ `VerifyDepth`
196
+
197
+ How many signatures to verify, defaults to "none".
198
+
199
+ #### Returns
200
+
201
+ `Promise`\<`IAuditableItemGraphVertex`\>
202
+
203
+ The vertex if found.
204
+
205
+ #### Throws
206
+
207
+ NotFoundError if the vertex is not found.
208
+
209
+ #### Implementation of
210
+
211
+ `IAuditableItemGraphComponent.get`
212
+
213
+ ***
214
+
215
+ ### getChangesets() {#getchangesets}
216
+
217
+ > **getChangesets**(`id`, `cursor?`, `limit?`, `options?`): `Promise`\<\{ `changesets`: `IAuditableItemGraphChangesetList`; `cursor?`: `string`; \}\>
218
+
219
+ Get a graph vertex changeset list.
220
+
221
+ #### Parameters
222
+
223
+ ##### id
224
+
225
+ `string`
226
+
227
+ The id of the vertex to get.
228
+
229
+ ##### cursor?
230
+
231
+ `string`
148
232
 
149
- Whether to include the changesets of the vertex, defaults to false.
233
+ The optional cursor to get next chunk.
234
+
235
+ ##### limit?
236
+
237
+ `number`
238
+
239
+ Limit the number of entities to return.
240
+
241
+ ##### options?
242
+
243
+ Additional options for the get operation.
150
244
 
151
245
  ###### verifySignatureDepth?
152
246
 
@@ -156,7 +250,7 @@ How many signatures to verify, defaults to "none".
156
250
 
157
251
  #### Returns
158
252
 
159
- `Promise`\<`IAuditableItemGraphVertex`\>
253
+ `Promise`\<\{ `changesets`: `IAuditableItemGraphChangesetList`; `cursor?`: `string`; \}\>
160
254
 
161
255
  The vertex if found.
162
256
 
@@ -166,69 +260,137 @@ NotFoundError if the vertex is not found.
166
260
 
167
261
  #### Implementation of
168
262
 
169
- `IAuditableItemGraphComponent.get`
263
+ `IAuditableItemGraphComponent.getChangesets`
170
264
 
171
265
  ***
172
266
 
173
- ### update()
267
+ ### getChangeset() {#getchangeset}
174
268
 
175
- > **update**(`vertex`): `Promise`\<`void`\>
269
+ > **getChangeset**(`id`, `options?`): `Promise`\<`IAuditableItemGraphChangeset`\>
176
270
 
177
- Update a graph vertex.
271
+ Get a graph vertex changeset.
178
272
 
179
273
  #### Parameters
180
274
 
181
- ##### vertex
275
+ ##### id
182
276
 
183
- The vertex to update.
277
+ `string`
278
+
279
+ The id of the vertex to get.
280
+
281
+ ##### options?
282
+
283
+ Additional options for the get operation.
284
+
285
+ ###### verifySignatureDepth?
286
+
287
+ `VerifyDepth`
288
+
289
+ How many signatures to verify, defaults to "none".
290
+
291
+ #### Returns
292
+
293
+ `Promise`\<`IAuditableItemGraphChangeset`\>
294
+
295
+ The vertex if found.
296
+
297
+ #### Throws
298
+
299
+ NotFoundError if the vertex is not found.
300
+
301
+ #### Implementation of
302
+
303
+ `IAuditableItemGraphComponent.getChangeset`
304
+
305
+ ***
184
306
 
185
- ###### id
307
+ ### getVersion() {#getversion}
308
+
309
+ > **getVersion**(`id`, `version`): `Promise`\<`IAuditableItemGraphVertex`\>
310
+
311
+ Get a graph vertex at a specific version.
312
+
313
+ #### Parameters
314
+
315
+ ##### id
186
316
 
187
317
  `string`
188
318
 
189
- The id of the vertex to update.
319
+ The id of the vertex.
320
+
321
+ ##### version
322
+
323
+ `number`
324
+
325
+ The version number to retrieve.
326
+
327
+ #### Returns
328
+
329
+ `Promise`\<`IAuditableItemGraphVertex`\>
330
+
331
+ The vertex reconstructed at that version.
332
+
333
+ #### Throws
334
+
335
+ NotFoundError if the vertex or version is not found.
336
+
337
+ #### Implementation of
338
+
339
+ `IAuditableItemGraphComponent.getVersion`
190
340
 
191
- ###### annotationObject?
341
+ ***
342
+
343
+ ### getVersions() {#getversions}
192
344
 
193
- `IJsonLdNodeObject`
345
+ > **getVersions**(`id`, `options?`): `Promise`\<`IAuditableItemGraphVertexVersionList`\>
194
346
 
195
- The annotation object for the vertex as JSON-LD.
347
+ Get all versions of a graph vertex.
196
348
 
197
- ###### aliases?
349
+ #### Parameters
198
350
 
199
- `object`[]
351
+ ##### id
200
352
 
201
- Alternative aliases that can be used to identify the vertex.
353
+ `string`
202
354
 
203
- ###### resources?
355
+ The id of the vertex.
204
356
 
205
- `object`[]
357
+ ##### options?
206
358
 
207
- The resources attached to the vertex.
359
+ Additional options for the operation.
208
360
 
209
- ###### edges?
361
+ ###### after?
210
362
 
211
- `object`[]
363
+ `string`
364
+
365
+ Only return versions created after this ISO 8601 timestamp (exclusive).
366
+
367
+ ###### before?
368
+
369
+ `string`
212
370
 
213
- The edges connected to the vertex.
371
+ Only return versions created before this ISO 8601 timestamp (exclusive).
214
372
 
215
373
  #### Returns
216
374
 
217
- `Promise`\<`void`\>
375
+ `Promise`\<`IAuditableItemGraphVertexVersionList`\>
218
376
 
219
- Nothing.
377
+ The list of vertex versions.
378
+
379
+ #### Throws
380
+
381
+ NotFoundError if the vertex is not found.
220
382
 
221
383
  #### Implementation of
222
384
 
223
- `IAuditableItemGraphComponent.update`
385
+ `IAuditableItemGraphComponent.getVersions`
224
386
 
225
387
  ***
226
388
 
227
- ### removeVerifiable()
389
+ ### removeProof() {#removeproof}
228
390
 
229
- > **removeVerifiable**(`id`): `Promise`\<`void`\>
391
+ > **removeProof**(`id`): `Promise`\<`void`\>
230
392
 
231
- Remove the verifiable storage for an item.
393
+ Remove the proof for an item.
232
394
 
233
395
  #### Parameters
234
396
 
@@ -236,7 +398,7 @@ Remove the verifiable storage for an item.
236
398
 
237
399
  `string`
238
400
 
239
- The id of the vertex to get.
401
+ The id of the vertex to remove the proof from.
240
402
 
241
403
  #### Returns
242
404
 
@@ -250,13 +412,13 @@ NotFoundError if the vertex is not found.
250
412
 
251
413
  #### Implementation of
252
414
 
253
- `IAuditableItemGraphComponent.removeVerifiable`
415
+ `IAuditableItemGraphComponent.removeProof`
254
416
 
255
417
  ***
256
418
 
257
- ### query()
419
+ ### query() {#query}
258
420
 
259
- > **query**(`options?`, `conditions?`, `orderBy?`, `orderByDirection?`, `properties?`, `cursor?`, `limit?`): `Promise`\<`IAuditableItemGraphVertexList`\>
421
+ > **query**(`options?`, `conditions?`, `orderBy?`, `orderByDirection?`, `properties?`, `cursor?`, `limit?`): `Promise`\<\{ `entries`: `IAuditableItemGraphVertexList`; `cursor?`: `string`; \}\>
260
422
 
261
423
  Query the graph for vertices.
262
424
 
@@ -284,7 +446,7 @@ Look in id, alias or both, defaults to both.
284
446
 
285
447
  Find only exact matches, default to false meaning partial matching.
286
448
 
287
- ###### includesResourceTypes?
449
+ ###### resourceTypes?
288
450
 
289
451
  `string`[]
290
452
 
@@ -298,9 +460,9 @@ Conditions to use in the query.
298
460
 
299
461
  ##### orderBy?
300
462
 
301
- The order for the results, defaults to created.
463
+ `"dateCreated"` \| `"dateModified"`
302
464
 
303
- `"dateCreated"` | `"dateModified"`
465
+ The order for the results, defaults to created.
304
466
 
305
467
  ##### orderByDirection?
306
468
 
@@ -328,7 +490,7 @@ Limit the number of entities to return.
328
490
 
329
491
  #### Returns
330
492
 
331
- `Promise`\<`IAuditableItemGraphVertexList`\>
493
+ `Promise`\<\{ `entries`: `IAuditableItemGraphVertexList`; `cursor?`: `string`; \}\>
332
494
 
333
495
  The entities, which can be partial if a limited keys list was provided.
334
496
 
@@ -14,7 +14,7 @@ Class describing the auditable item graph vertex.
14
14
 
15
15
  ## Properties
16
16
 
17
- ### id
17
+ ### id {#id}
18
18
 
19
19
  > **id**: `string`
20
20
 
@@ -22,15 +22,15 @@ The id of the vertex.
22
22
 
23
23
  ***
24
24
 
25
- ### organizationIdentity?
25
+ ### organizationIdentity? {#organizationidentity}
26
26
 
27
- > `optional` **organizationIdentity**: `string`
27
+ > `optional` **organizationIdentity?**: `string`
28
28
 
29
29
  The identity of the organization which controls the vertex.
30
30
 
31
31
  ***
32
32
 
33
- ### dateCreated
33
+ ### dateCreated {#datecreated}
34
34
 
35
35
  > **dateCreated**: `string`
36
36
 
@@ -38,56 +38,64 @@ The date/time of when the vertex was created.
38
38
 
39
39
  ***
40
40
 
41
- ### dateModified?
41
+ ### dateModified? {#datemodified}
42
42
 
43
- > `optional` **dateModified**: `string`
43
+ > `optional` **dateModified?**: `string`
44
44
 
45
45
  The date/time of when the vertex was last modified.
46
46
 
47
47
  ***
48
48
 
49
- ### aliasIndex?
49
+ ### aliasIndex? {#aliasindex}
50
50
 
51
- > `optional` **aliasIndex**: `string`
51
+ > `optional` **aliasIndex?**: `string`
52
52
 
53
53
  Combined alias index for the vertex used for querying.
54
54
 
55
55
  ***
56
56
 
57
- ### resourceTypeIndex?
57
+ ### resourceTypeIndex? {#resourcetypeindex}
58
58
 
59
- > `optional` **resourceTypeIndex**: `string`
59
+ > `optional` **resourceTypeIndex?**: `string`
60
60
 
61
61
  Combined resource type index for the vertex used for querying.
62
62
 
63
63
  ***
64
64
 
65
- ### annotationObject?
65
+ ### annotationObject? {#annotationobject}
66
66
 
67
- > `optional` **annotationObject**: `IJsonLdNodeObject`
67
+ > `optional` **annotationObject?**: `IJsonLdNodeObject`
68
68
 
69
69
  Object to associate with the vertex as JSON-LD.
70
70
 
71
71
  ***
72
72
 
73
- ### aliases?
73
+ ### aliases? {#aliases}
74
74
 
75
- > `optional` **aliases**: [`AuditableItemGraphAlias`](AuditableItemGraphAlias.md)[]
75
+ > `optional` **aliases?**: [`AuditableItemGraphAlias`](AuditableItemGraphAlias.md)[]
76
76
 
77
77
  Alternative aliases that can be used to identify the vertex.
78
78
 
79
79
  ***
80
80
 
81
- ### resources?
81
+ ### resources? {#resources}
82
82
 
83
- > `optional` **resources**: [`AuditableItemGraphResource`](AuditableItemGraphResource.md)[]
83
+ > `optional` **resources?**: [`AuditableItemGraphResource`](AuditableItemGraphResource.md)[]
84
84
 
85
85
  The resources attached to the vertex.
86
86
 
87
87
  ***
88
88
 
89
- ### edges?
89
+ ### edges? {#edges}
90
90
 
91
- > `optional` **edges**: [`AuditableItemGraphEdge`](AuditableItemGraphEdge.md)[]
91
+ > `optional` **edges?**: [`AuditableItemGraphEdge`](AuditableItemGraphEdge.md)[]
92
92
 
93
93
  Edges connected to the vertex.
94
+
95
+ ***
96
+
97
+ ### version? {#version}
98
+
99
+ > `optional` **version?**: `number`
100
+
101
+ The current version of the vertex, incremented on each changeset.
@@ -0,0 +1,31 @@
1
+ # Function: auditableItemGraphChangesetGet()
2
+
3
+ > **auditableItemGraphChangesetGet**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IAuditableItemGraphChangesetGetResponse`\>
4
+
5
+ Get the graph vertex changeset.
6
+
7
+ ## Parameters
8
+
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
12
+
13
+ The request context for the API.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes.
20
+
21
+ ### request
22
+
23
+ `IAuditableItemGraphChangesetGetRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`IAuditableItemGraphChangesetGetResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,31 @@
1
+ # Function: auditableItemGraphChangesetList()
2
+
3
+ > **auditableItemGraphChangesetList**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IAuditableItemGraphChangesetListResponse`\>
4
+
5
+ Get the graph vertex changeset list.
6
+
7
+ ## Parameters
8
+
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
12
+
13
+ The request context for the API.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes.
20
+
21
+ ### request
22
+
23
+ `IAuditableItemGraphChangesetListRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`IAuditableItemGraphChangesetListResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **auditableItemGraphUpdate**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
4
 
5
- Update the graph vertex.
5
+ Update the graph vertex (PUT — full replacement of vertex state).
6
6
 
7
7
  ## Parameters
8
8
 
@@ -0,0 +1,31 @@
1
+ # Function: auditableItemGraphUpdatePartial()
2
+
3
+ > **auditableItemGraphUpdatePartial**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
+
5
+ Partially update the graph vertex (PATCH — optional scalars; list fields use `{ add, remove }`).
6
+
7
+ ## Parameters
8
+
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
12
+
13
+ The request context for the API.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes.
20
+
21
+ ### request
22
+
23
+ `IAuditableItemGraphUpdatePartialRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`INoContentResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,31 @@
1
+ # Function: auditableItemGraphVersionGet()
2
+
3
+ > **auditableItemGraphVersionGet**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IAuditableItemGraphVersionGetResponse`\>
4
+
5
+ Get the graph vertex at a specific version.
6
+
7
+ ## Parameters
8
+
9
+ ### httpRequestContext
10
+
11
+ `IHttpRequestContext`
12
+
13
+ The request context for the API.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes.
20
+
21
+ ### request
22
+
23
+ `IAuditableItemGraphVersionGetRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`IAuditableItemGraphVersionGetResponse`\>
30
+
31
+ The response object with additional http response properties.