@twin.org/document-management-service 0.0.1-next.9 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +303 -114
- package/dist/esm/index.mjs +304 -116
- package/dist/types/documentManagementRoutes.d.ts +10 -2
- package/dist/types/documentManagementService.d.ts +26 -1
- package/dist/types/models/IDocumentManagementStorageServiceConstructorOptions.d.ts +5 -0
- package/docs/changelog.md +181 -0
- package/docs/open-api/spec.json +444 -1350
- package/docs/reference/classes/DocumentManagementService.md +90 -0
- package/docs/reference/functions/documentManagementGetRevision.md +31 -0
- package/docs/reference/functions/documentManagementUpdate.md +1 -1
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IDocumentManagementServiceConstructorOptions.md +14 -0
- package/locales/en.json +2 -1
- package/package.json +73 -15
|
@@ -240,6 +240,18 @@ Flag to include the attestation information for the document, defaults to false.
|
|
|
240
240
|
|
|
241
241
|
Flag to include deleted documents, defaults to false.
|
|
242
242
|
|
|
243
|
+
###### extractRuleGroupId?
|
|
244
|
+
|
|
245
|
+
`string`
|
|
246
|
+
|
|
247
|
+
If provided will extract data from the document using the specified rule group id.
|
|
248
|
+
|
|
249
|
+
###### extractMimeType?
|
|
250
|
+
|
|
251
|
+
`string`
|
|
252
|
+
|
|
253
|
+
By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
254
|
+
|
|
243
255
|
##### cursor?
|
|
244
256
|
|
|
245
257
|
`string`
|
|
@@ -276,6 +288,84 @@ The documents and revisions if requested, ordered by revision descending, cursor
|
|
|
276
288
|
|
|
277
289
|
***
|
|
278
290
|
|
|
291
|
+
### getRevision()
|
|
292
|
+
|
|
293
|
+
> **getRevision**(`auditableItemGraphDocumentId`, `revision`, `options?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`IDocument`\>
|
|
294
|
+
|
|
295
|
+
Get a document revision using it's auditable item graph vertex id.
|
|
296
|
+
|
|
297
|
+
#### Parameters
|
|
298
|
+
|
|
299
|
+
##### auditableItemGraphDocumentId
|
|
300
|
+
|
|
301
|
+
`string`
|
|
302
|
+
|
|
303
|
+
The auditable item graph vertex id which contains the document.
|
|
304
|
+
|
|
305
|
+
##### revision
|
|
306
|
+
|
|
307
|
+
`number`
|
|
308
|
+
|
|
309
|
+
The revision id for the document.
|
|
310
|
+
|
|
311
|
+
##### options?
|
|
312
|
+
|
|
313
|
+
Additional options for the get operation.
|
|
314
|
+
|
|
315
|
+
###### includeBlobStorageMetadata?
|
|
316
|
+
|
|
317
|
+
`boolean`
|
|
318
|
+
|
|
319
|
+
Flag to include the blob storage metadata for the document, defaults to false.
|
|
320
|
+
|
|
321
|
+
###### includeBlobStorageData?
|
|
322
|
+
|
|
323
|
+
`boolean`
|
|
324
|
+
|
|
325
|
+
Flag to include the blob storage data for the document, defaults to false.
|
|
326
|
+
|
|
327
|
+
###### includeAttestation?
|
|
328
|
+
|
|
329
|
+
`boolean`
|
|
330
|
+
|
|
331
|
+
Flag to include the attestation information for the document, defaults to false.
|
|
332
|
+
|
|
333
|
+
###### extractRuleGroupId?
|
|
334
|
+
|
|
335
|
+
`string`
|
|
336
|
+
|
|
337
|
+
If provided will extract data from the document using the specified rule group id.
|
|
338
|
+
|
|
339
|
+
###### extractMimeType?
|
|
340
|
+
|
|
341
|
+
`string`
|
|
342
|
+
|
|
343
|
+
By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
344
|
+
|
|
345
|
+
##### userIdentity?
|
|
346
|
+
|
|
347
|
+
`string`
|
|
348
|
+
|
|
349
|
+
The identity to perform the auditable item graph operation with.
|
|
350
|
+
|
|
351
|
+
##### nodeIdentity?
|
|
352
|
+
|
|
353
|
+
`string`
|
|
354
|
+
|
|
355
|
+
The node identity to use for vault operations.
|
|
356
|
+
|
|
357
|
+
#### Returns
|
|
358
|
+
|
|
359
|
+
`Promise`\<`IDocument`\>
|
|
360
|
+
|
|
361
|
+
The documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.
|
|
362
|
+
|
|
363
|
+
#### Implementation of
|
|
364
|
+
|
|
365
|
+
`IDocumentManagementComponent.getRevision`
|
|
366
|
+
|
|
367
|
+
***
|
|
368
|
+
|
|
279
369
|
### removeRevision()
|
|
280
370
|
|
|
281
371
|
> **removeRevision**(`auditableItemGraphDocumentId`, `revision`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`void`\>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: documentManagementGetRevision()
|
|
2
|
+
|
|
3
|
+
> **documentManagementGetRevision**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IDocumentManagementGetRevisionResponse`\>
|
|
4
|
+
|
|
5
|
+
Get the document revision from the auditable item graph vertex.
|
|
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
|
+
`IDocumentManagementGetRevisionRequest`
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`IDocumentManagementGetRevisionResponse`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
package/docs/reference/index.md
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
- [generateRestRoutesDocumentManagement](functions/generateRestRoutesDocumentManagement.md)
|
|
20
20
|
- [documentManagementCreate](functions/documentManagementCreate.md)
|
|
21
21
|
- [documentManagementGet](functions/documentManagementGet.md)
|
|
22
|
+
- [documentManagementGetRevision](functions/documentManagementGetRevision.md)
|
|
22
23
|
- [documentManagementUpdate](functions/documentManagementUpdate.md)
|
|
23
24
|
- [documentManagementRemove](functions/documentManagementRemove.md)
|
|
24
25
|
- [documentManagementQuery](functions/documentManagementQuery.md)
|
|
@@ -46,6 +46,20 @@ attestation
|
|
|
46
46
|
|
|
47
47
|
***
|
|
48
48
|
|
|
49
|
+
### dataProcessingComponentType?
|
|
50
|
+
|
|
51
|
+
> `optional` **dataProcessingComponentType**: `string`
|
|
52
|
+
|
|
53
|
+
The type of the data processing component.
|
|
54
|
+
|
|
55
|
+
#### Default
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
data-processing
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
49
63
|
### config?
|
|
50
64
|
|
|
51
65
|
> `optional` **config**: [`IDocumentManagementServiceConfig`](IDocumentManagementServiceConfig.md)
|
package/locales/en.json
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
"createFailed": "Failed to create document",
|
|
5
5
|
"updateFailed": "Failed to update document",
|
|
6
6
|
"getFailed": "Failed to get document",
|
|
7
|
+
"getRevisionFailed": "Failed to get document revision",
|
|
7
8
|
"removeRevision": "Failed to remove document revision",
|
|
8
9
|
"queryFailed": "Failed to query document",
|
|
9
10
|
"documentRevisionNone": "There are no revisions in the document",
|
|
10
|
-
"documentRevisionNotFound": "There is no revision number \"{
|
|
11
|
+
"documentRevisionNotFound": "There is no revision number \"{notFoundId}\" in the document",
|
|
11
12
|
"namespaceMismatch": "The namespace in the urn \"{id}\" does not match the namespace of the Document Management component \"{namespace}\""
|
|
12
13
|
}
|
|
13
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/document-management-service",
|
|
3
|
-
"version": "0.0.1
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"description": "Document management contract implementation and REST endpoint definitions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,21 +13,79 @@
|
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"clean": "rimraf dist coverage docs/reference",
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"dev": "nodemon --watch src --ext ts --exec \"npm run build && npm run bundle:esm\"",
|
|
20
|
+
"test": "vitest --run --config ./vitest.config.ts --no-cache",
|
|
21
|
+
"coverage": "vitest --run --coverage --config ./vitest.config.ts --no-cache",
|
|
22
|
+
"bundle:esm": "rollup --config rollup.config.mjs --environment MODULE:esm",
|
|
23
|
+
"bundle:cjs": "rollup --config rollup.config.mjs --environment MODULE:cjs",
|
|
24
|
+
"bundle": "npm run bundle:esm && npm run bundle:cjs",
|
|
25
|
+
"docs:clean": "rimraf docs/reference",
|
|
26
|
+
"docs:generate": "typedoc",
|
|
27
|
+
"docs:api": "ts-to-openapi ./ts-to-openapi.json ./docs/open-api/spec.json",
|
|
28
|
+
"docs": "npm run docs:clean && npm run docs:generate && npm run docs:api",
|
|
29
|
+
"dist": "npm run clean && npm run build && npm run test && npm run bundle && npm run docs",
|
|
30
|
+
"dist:no-test": "npm run clean && npm run build && npm run bundle && npm run docs",
|
|
31
|
+
"prepare": "ts-patch install -s"
|
|
32
|
+
},
|
|
16
33
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-models": "next",
|
|
18
|
-
"@twin.org/attestation-models": "
|
|
19
|
-
"@twin.org/auditable-item-graph-models": "
|
|
20
|
-
"@twin.org/blob-storage-models": "
|
|
21
|
-
"@twin.org/
|
|
22
|
-
"@twin.org/
|
|
23
|
-
"@twin.org/
|
|
24
|
-
"@twin.org/
|
|
25
|
-
"@twin.org/
|
|
26
|
-
"@twin.org/entity
|
|
27
|
-
"@twin.org/
|
|
28
|
-
"@twin.org/
|
|
29
|
-
"@twin.org/standards-
|
|
30
|
-
"@twin.org/
|
|
34
|
+
"@twin.org/api-models": "^0.0.2-next.1",
|
|
35
|
+
"@twin.org/attestation-models": "^0.0.1",
|
|
36
|
+
"@twin.org/auditable-item-graph-models": "^0.0.1",
|
|
37
|
+
"@twin.org/blob-storage-models": "^0.0.1",
|
|
38
|
+
"@twin.org/data-processing-models": "^0.0.1",
|
|
39
|
+
"@twin.org/document-management-models": "^0.0.1",
|
|
40
|
+
"@twin.org/core": "^0.0.1",
|
|
41
|
+
"@twin.org/crypto": "^0.0.1",
|
|
42
|
+
"@twin.org/data-json-ld": "^0.0.1",
|
|
43
|
+
"@twin.org/entity": "^0.0.1",
|
|
44
|
+
"@twin.org/entity-storage-models": "^0.0.1",
|
|
45
|
+
"@twin.org/nameof": "^0.0.1",
|
|
46
|
+
"@twin.org/standards-schema-org": "^0.0.1",
|
|
47
|
+
"@twin.org/standards-unece": "^0.0.1",
|
|
48
|
+
"@twin.org/web": "^0.0.1"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@twin.org/attestation-connector-nft": "^0.0.1",
|
|
52
|
+
"@twin.org/attestation-service": "^0.0.1",
|
|
53
|
+
"@twin.org/auditable-item-graph-service": "^0.0.1",
|
|
54
|
+
"@twin.org/background-task-models": "^0.0.2-next.2",
|
|
55
|
+
"@twin.org/background-task-connector-entity-storage": "^0.0.2-next.2",
|
|
56
|
+
"@twin.org/blob-storage-connector-memory": "^0.0.1",
|
|
57
|
+
"@twin.org/blob-storage-service": "^0.0.1",
|
|
58
|
+
"@twin.org/data-processing-converters": "^0.0.1",
|
|
59
|
+
"@twin.org/data-processing-extractors": "^0.0.1",
|
|
60
|
+
"@twin.org/data-processing-service": "^0.0.1",
|
|
61
|
+
"@twin.org/entity-storage-connector-memory": "^0.0.1",
|
|
62
|
+
"@twin.org/identity-connector-entity-storage": "^0.0.1",
|
|
63
|
+
"@twin.org/identity-models": "^0.0.1",
|
|
64
|
+
"@twin.org/immutable-proof-models": "^0.0.1",
|
|
65
|
+
"@twin.org/immutable-proof-service": "^0.0.1",
|
|
66
|
+
"@twin.org/modules": "^0.0.1",
|
|
67
|
+
"@twin.org/nft-connector-entity-storage": "^0.0.1",
|
|
68
|
+
"@twin.org/nft-models": "^0.0.1",
|
|
69
|
+
"@twin.org/nameof-transformer": "^0.0.1",
|
|
70
|
+
"@twin.org/nameof-vitest-plugin": "^0.0.1",
|
|
71
|
+
"@twin.org/ts-to-openapi": "^0.0.1",
|
|
72
|
+
"@twin.org/vault-models": "^0.0.1",
|
|
73
|
+
"@twin.org/vault-connector-entity-storage": "^0.0.1",
|
|
74
|
+
"@twin.org/verifiable-storage-models": "^0.0.1",
|
|
75
|
+
"@twin.org/verifiable-storage-connector-entity-storage": "^0.0.1",
|
|
76
|
+
"@twin.org/wallet-models": "^0.0.1",
|
|
77
|
+
"@twin.org/wallet-connector-entity-storage": "^0.0.1",
|
|
78
|
+
"@types/node": "24.0.1",
|
|
79
|
+
"@vitest/coverage-v8": "3.2.3",
|
|
80
|
+
"copyfiles": "2.4.1",
|
|
81
|
+
"nodemon": "3.1.10",
|
|
82
|
+
"rimraf": "6.0.1",
|
|
83
|
+
"rollup": "4.43.0",
|
|
84
|
+
"ts-patch": "3.3.0",
|
|
85
|
+
"typedoc": "0.28.5",
|
|
86
|
+
"typedoc-plugin-markdown": "4.6.4",
|
|
87
|
+
"typescript": "5.8.3",
|
|
88
|
+
"vitest": "3.2.3"
|
|
31
89
|
},
|
|
32
90
|
"main": "./dist/cjs/index.cjs",
|
|
33
91
|
"module": "./dist/esm/index.mjs",
|