@twin.org/document-management-service 0.0.3-next.15 → 0.0.3-next.17

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.
@@ -317,16 +317,16 @@
317
317
  }
318
318
  },
319
319
  "/document-management/{auditableItemGraphDocumentId}": {
320
- "put": {
321
- "operationId": "DocumentManagementUpdate",
322
- "summary": "Update a document in an auditable item graph vertex and add its content to blob storage.",
320
+ "patch": {
321
+ "operationId": "DocumentManagementUpdatePartial",
322
+ "summary": "Partially update a document in an auditable item graph vertex and add its content to blob storage.",
323
323
  "tags": [
324
324
  "Document Management"
325
325
  ],
326
326
  "parameters": [
327
327
  {
328
328
  "name": "auditableItemGraphDocumentId",
329
- "description": "The full id of the document to get.",
329
+ "description": "The full id of the document to update.",
330
330
  "in": "path",
331
331
  "required": true,
332
332
  "schema": {
@@ -342,15 +342,15 @@
342
342
  }
343
343
  ],
344
344
  "requestBody": {
345
- "description": "Request to update a document as an auditable item graph vertex.",
345
+ "description": "Request to partially update a document as an auditable item graph vertex.",
346
346
  "required": true,
347
347
  "content": {
348
348
  "application/json": {
349
349
  "schema": {
350
- "$ref": "#/components/schemas/DocumentManagementUpdateRequest"
350
+ "$ref": "#/components/schemas/DocumentManagementUpdatePartialRequest"
351
351
  },
352
352
  "examples": {
353
- "DocumentManagementUpdateRequestExample": {
353
+ "DocumentManagementUpdatePartialRequestExample": {
354
354
  "value": {
355
355
  "blob": "SGVsbG8gV29ybGQ=",
356
356
  "annotationObject": {
@@ -481,6 +481,15 @@
481
481
  "type": "string"
482
482
  }
483
483
  },
484
+ {
485
+ "name": "includeDeletedEdges",
486
+ "description": "Include soft-deleted edges in the response.",
487
+ "in": "query",
488
+ "required": false,
489
+ "schema": {
490
+ "type": "string"
491
+ }
492
+ },
484
493
  {
485
494
  "name": "extractRuleGroupId",
486
495
  "description": "If provided will extract data from the document using the specified rule group id.",
@@ -501,7 +510,7 @@
501
510
  },
502
511
  {
503
512
  "name": "limit",
504
- "description": "PLimit the number of items to return, defaults to 1 so only most recent is returned.",
513
+ "description": "Limit the number of items to return, defaults to 1 so only most recent is returned.",
505
514
  "in": "query",
506
515
  "required": false,
507
516
  "schema": {
@@ -1187,21 +1196,7 @@
1187
1196
  "auditableItemGraphEdges": {
1188
1197
  "type": "array",
1189
1198
  "items": {
1190
- "type": "object",
1191
- "properties": {
1192
- "targetId": {
1193
- "type": "string"
1194
- },
1195
- "addAlias": {
1196
- "type": "boolean"
1197
- },
1198
- "aliasAnnotationObject": {
1199
- "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
1200
- }
1201
- },
1202
- "required": [
1203
- "targetId"
1204
- ]
1199
+ "$ref": "#/components/schemas/DocumentManagementEdgeEntry"
1205
1200
  },
1206
1201
  "description": "The auditable item graph vertices to connect the document to."
1207
1202
  },
@@ -1225,36 +1220,55 @@
1225
1220
  ],
1226
1221
  "description": "The body parameters."
1227
1222
  },
1228
- "DocumentManagementUpdateRequest": {
1223
+ "DocumentManagementEdgeEntry": {
1224
+ "description": "A single edge entry used when connecting a document to an AIG vertex.",
1225
+ "type": "object",
1226
+ "properties": {
1227
+ "targetId": {
1228
+ "type": "string",
1229
+ "description": "The target AIG vertex id to connect to."
1230
+ },
1231
+ "addAlias": {
1232
+ "type": "boolean",
1233
+ "description": "Whether to add the document id as an alias on the connected vertex, defaults to false."
1234
+ },
1235
+ "aliasAnnotationObject": {
1236
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
1237
+ }
1238
+ },
1239
+ "required": [
1240
+ "targetId"
1241
+ ]
1242
+ },
1243
+ "DocumentManagementUpdatePartialRequest": {
1229
1244
  "type": "object",
1230
1245
  "properties": {
1231
1246
  "blob": {
1232
1247
  "type": "string",
1233
- "description": "The data to create the document with, in base64."
1248
+ "description": "The data to update the document with, in base64."
1234
1249
  },
1235
1250
  "annotationObject": {
1236
1251
  "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
1237
1252
  },
1238
1253
  "auditableItemGraphEdges": {
1239
- "type": "array",
1240
- "items": {
1241
- "type": "object",
1242
- "properties": {
1243
- "targetId": {
1244
- "type": "string"
1245
- },
1246
- "addAlias": {
1247
- "type": "boolean"
1254
+ "type": "object",
1255
+ "properties": {
1256
+ "add": {
1257
+ "type": "array",
1258
+ "items": {
1259
+ "$ref": "#/components/schemas/DocumentManagementEdgeEntry"
1248
1260
  },
1249
- "aliasAnnotationObject": {
1250
- "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
1251
- }
1261
+ "description": "Connections to add; each entry creates a back-edge on the connected vertex."
1252
1262
  },
1253
- "required": [
1254
- "targetId"
1255
- ]
1263
+ "remove": {
1264
+ "type": "array",
1265
+ "items": {
1266
+ "type": "string"
1267
+ },
1268
+ "description": "Target vertex IDs to disconnect; their back-edges are removed."
1269
+ }
1256
1270
  },
1257
- "description": "The auditable item graph vertices to connect the document to."
1271
+ "description": "Explicit edge delta to apply. Use `add` to create new connections and `remove` to\ndisconnect existing ones by their target vertex id."
1258
1272
  }
1259
1273
  },
1260
1274
  "description": "The body parameters."
@@ -64,6 +64,8 @@ Register all document management metrics with the telemetry component.
64
64
 
65
65
  `Promise`\<`void`\>
66
66
 
67
+ A promise that resolves when metrics have been registered.
68
+
67
69
  #### Implementation of
68
70
 
69
71
  `IDocumentManagementComponent.start`
@@ -112,7 +114,7 @@ Additional information to associate with the document.
112
114
 
113
115
  ##### auditableItemGraphEdges?
114
116
 
115
- `object`[]
117
+ `IDocumentManagementEdgeEntry`[]
116
118
 
117
119
  The auditable item graph vertices to connect the document to.
118
120
 
@@ -150,9 +152,9 @@ The auditable item graph vertex created for the document including its revision.
150
152
 
151
153
  ***
152
154
 
153
- ### update() {#update}
155
+ ### updatePartial() {#updatepartial}
154
156
 
155
- > **update**(`auditableItemGraphDocumentId`, `blob?`, `annotationObject?`, `auditableItemGraphEdges?`): `Promise`\<`void`\>
157
+ > **updatePartial**(`auditableItemGraphDocumentId`, `blob?`, `annotationObject?`, `auditableItemGraphEdges?`): `Promise`\<`void`\>
156
158
 
157
159
  Update a document as an auditable item graph vertex and add its content to blob storage.
158
160
  If the blob data is different a new revision will be created.
@@ -180,19 +182,33 @@ Additional information to associate with the document.
180
182
 
181
183
  ##### auditableItemGraphEdges?
182
184
 
183
- `object`[]
185
+ Explicit edge delta to apply. If undefined, existing connections
186
+ are retained unchanged. Use `add` to create new connections and `remove` to disconnect existing
187
+ ones by their target vertex id. To update alias metadata on an already-connected vertex, include
188
+ it in `add` with the updated `aliasAnnotationObject` — AIG's alias patch is an upsert, so the
189
+ alias is updated in place without creating a duplicate back-edge.
190
+
191
+ ###### add?
192
+
193
+ `IDocumentManagementEdgeEntry`[]
194
+
195
+ Connections to add; each creates a back-edge on the connected vertex.
196
+
197
+ ###### remove?
198
+
199
+ `string`[]
184
200
 
185
- The auditable item graph vertices to connect the document to, if undefined retains current connections.
201
+ Target vertex IDs to disconnect; their back-edges are removed.
186
202
 
187
203
  #### Returns
188
204
 
189
205
  `Promise`\<`void`\>
190
206
 
191
- Nothing.
207
+ A promise that resolves when the document has been updated.
192
208
 
193
209
  #### Implementation of
194
210
 
195
- `IDocumentManagementComponent.update`
211
+ `IDocumentManagementComponent.updatePartial`
196
212
 
197
213
  ***
198
214
 
@@ -238,6 +254,12 @@ Flag to include the attestation information for the document, defaults to false.
238
254
 
239
255
  Flag to include deleted documents, defaults to false.
240
256
 
257
+ ###### includeDeletedEdges?
258
+
259
+ `boolean`
260
+
261
+ Flag to include soft-deleted edges in the response, defaults to false.
262
+
241
263
  ###### extractRuleGroupId?
242
264
 
243
265
  `string`
@@ -332,7 +354,7 @@ By default extraction will auto detect the mime type of the document, this can b
332
354
 
333
355
  `Promise`\<`IDocument`\>
334
356
 
335
- The documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.
357
+ The document for the specified revision.
336
358
 
337
359
  #### Implementation of
338
360
 
@@ -365,7 +387,7 @@ The revision of the document to remove.
365
387
 
366
388
  `Promise`\<`void`\>
367
389
 
368
- Nothing.
390
+ A promise that resolves when the revision has been removed.
369
391
 
370
392
  #### Implementation of
371
393
 
@@ -1,6 +1,6 @@
1
- # Function: documentManagementUpdate()
1
+ # Function: documentManagementUpdatePartial()
2
2
 
3
- > **documentManagementUpdate**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
3
+ > **documentManagementUpdatePartial**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
4
 
5
5
  Update the document from the auditable item graph vertex.
6
6
 
@@ -20,7 +20,7 @@ The name of the component to use in the routes.
20
20
 
21
21
  ### request
22
22
 
23
- `IDocumentManagementUpdateRequest`
23
+ `IDocumentManagementUpdatePartialRequest`
24
24
 
25
25
  The request.
26
26
 
@@ -20,6 +20,6 @@
20
20
  - [documentManagementCreate](functions/documentManagementCreate.md)
21
21
  - [documentManagementGet](functions/documentManagementGet.md)
22
22
  - [documentManagementGetRevision](functions/documentManagementGetRevision.md)
23
- - [documentManagementUpdate](functions/documentManagementUpdate.md)
23
+ - [documentManagementUpdatePartial](functions/documentManagementUpdatePartial.md)
24
24
  - [documentManagementRemove](functions/documentManagementRemove.md)
25
25
  - [documentManagementQuery](functions/documentManagementQuery.md)
@@ -1,3 +1,5 @@
1
1
  # Variable: restEntryPoints
2
2
 
3
3
  > `const` **restEntryPoints**: `IRestRouteEntryPoint`[]
4
+
5
+ REST entry points for the document management service.
package/locales/en.json CHANGED
@@ -2,12 +2,14 @@
2
2
  "error": {
3
3
  "documentManagementService": {
4
4
  "createFailed": "Failed to create document",
5
+ "connectedVertexNotFound": "The connected vertex \"{notFoundId}\" does not exist",
5
6
  "updateFailed": "Failed to update document",
6
7
  "getFailed": "Failed to get document",
7
8
  "getRevisionFailed": "Failed to get document revision",
8
9
  "queryFailed": "Failed to query document",
9
10
  "documentRevisionNone": "There are no revisions in the document",
10
11
  "documentRevisionNotFound": "There is no revision number \"{notFoundId}\" in the document",
12
+ "documentRevisionMissingId": "Revision {revision} was found but has no resolvable resource id — possible data integrity issue",
11
13
  "removeRevisionFailed": "Failed to remove document revision"
12
14
  }
13
15
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@twin.org/document-management-service",
3
- "version": "0.0.3-next.15",
3
+ "version": "0.0.3-next.17",
4
4
  "description": "Service-side document lifecycle operations and REST route generation for server integrations.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/iotaledger/document-management.git",
7
+ "url": "git+https://github.com/iotaledger/twin-document-management.git",
8
8
  "directory": "packages/document-management-service"
9
9
  },
10
10
  "author": "martyn.janes@iota.org",
@@ -23,7 +23,7 @@
23
23
  "@twin.org/crypto": "next",
24
24
  "@twin.org/data-json-ld": "next",
25
25
  "@twin.org/data-processing-models": "next",
26
- "@twin.org/document-management-models": "0.0.3-next.15",
26
+ "@twin.org/document-management-models": "0.0.3-next.17",
27
27
  "@twin.org/entity": "next",
28
28
  "@twin.org/entity-storage-models": "next",
29
29
  "@twin.org/nameof": "next",
@@ -64,7 +64,7 @@
64
64
  "business-logic"
65
65
  ],
66
66
  "bugs": {
67
- "url": "git+https://github.com/iotaledger/document-management/issues"
67
+ "url": "git+https://github.com/iotaledger/twin-document-management/issues"
68
68
  },
69
69
  "homepage": "https://twindev.org"
70
70
  }