@twin.org/document-management-models 0.0.2-next.3 → 0.0.3-next.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/es/dataTypes/documentManagementDataTypes.js +29 -0
- package/dist/es/dataTypes/documentManagementDataTypes.js.map +1 -0
- package/dist/es/index.js +19 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IDocument.js +2 -0
- package/dist/es/models/IDocument.js.map +1 -0
- package/dist/es/models/IDocumentAttestation.js +2 -0
- package/dist/es/models/IDocumentAttestation.js.map +1 -0
- package/dist/es/models/IDocumentList.js +2 -0
- package/dist/es/models/IDocumentList.js.map +1 -0
- package/dist/es/models/IDocumentManagementComponent.js +2 -0
- package/dist/es/models/IDocumentManagementComponent.js.map +1 -0
- package/dist/es/models/api/IDocumentManagementCreateRequest.js +2 -0
- package/dist/es/models/api/IDocumentManagementCreateRequest.js.map +1 -0
- package/dist/es/models/api/IDocumentManagementGetRequest.js +2 -0
- package/dist/es/models/api/IDocumentManagementGetRequest.js.map +1 -0
- package/dist/es/models/api/IDocumentManagementGetResponse.js +2 -0
- package/dist/es/models/api/IDocumentManagementGetResponse.js.map +1 -0
- package/dist/es/models/api/IDocumentManagementGetRevisionRequest.js +2 -0
- package/dist/es/models/api/IDocumentManagementGetRevisionRequest.js.map +1 -0
- package/dist/es/models/api/IDocumentManagementGetRevisionResponse.js +2 -0
- package/dist/es/models/api/IDocumentManagementGetRevisionResponse.js.map +1 -0
- package/dist/es/models/api/IDocumentManagementQueryRequest.js +2 -0
- package/dist/es/models/api/IDocumentManagementQueryRequest.js.map +1 -0
- package/dist/es/models/api/IDocumentManagementQueryResponse.js +2 -0
- package/dist/es/models/api/IDocumentManagementQueryResponse.js.map +1 -0
- package/dist/es/models/api/IDocumentManagementRemoveRequest.js +4 -0
- package/dist/es/models/api/IDocumentManagementRemoveRequest.js.map +1 -0
- package/dist/es/models/api/IDocumentManagementUpdateRequest.js +2 -0
- package/dist/es/models/api/IDocumentManagementUpdateRequest.js.map +1 -0
- package/dist/es/models/documentContexts.js +17 -0
- package/dist/es/models/documentContexts.js.map +1 -0
- package/dist/es/models/documentTypes.js +17 -0
- package/dist/es/models/documentTypes.js.map +1 -0
- package/dist/es/schemas/Document.json +114 -0
- package/dist/types/index.d.ts +16 -16
- package/dist/types/models/IDocument.d.ts +5 -5
- package/dist/types/models/IDocumentAttestation.d.ts +2 -2
- package/dist/types/models/IDocumentList.d.ts +2 -2
- package/dist/types/models/IDocumentManagementComponent.d.ts +10 -22
- package/dist/types/models/api/IDocumentManagementGetRequest.d.ts +2 -2
- package/dist/types/models/api/IDocumentManagementGetResponse.d.ts +1 -1
- package/dist/types/models/api/IDocumentManagementGetRevisionResponse.d.ts +1 -1
- package/dist/types/models/api/IDocumentManagementQueryRequest.d.ts +1 -1
- package/docs/changelog.md +31 -0
- package/docs/reference/interfaces/IDocument.md +5 -5
- package/docs/reference/interfaces/IDocumentManagementComponent.md +11 -83
- package/docs/reference/interfaces/IDocumentManagementCreateRequest.md +1 -1
- package/docs/reference/interfaces/IDocumentManagementGetRequest.md +3 -3
- package/docs/reference/interfaces/IDocumentManagementQueryRequest.md +2 -2
- package/package.json +25 -8
- package/dist/cjs/index.cjs +0 -190
- package/dist/esm/index.mjs +0 -186
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @twin.org/document-management-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.1](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.0...document-management-models-v0.0.3-next.1) (2025-11-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add context id features ([#24](https://github.com/twinfoundation/document-management/issues/24)) ([83f65f1](https://github.com/twinfoundation/document-management/commit/83f65f15e55f2293f5ca0d9d1e4679ba67c4ec8d))
|
|
9
|
+
* add validate-locales ([b6b6f9e](https://github.com/twinfoundation/document-management/commit/b6b6f9e9d66c17af3d030247ca168ac0b5844bdc))
|
|
10
|
+
* data type registration use fully qualified names ([18d27d0](https://github.com/twinfoundation/document-management/commit/18d27d0c21d0f652b7df4b409bb2d3c66cf22f84))
|
|
11
|
+
* document get can perform extraction ([#6](https://github.com/twinfoundation/document-management/issues/6)) ([5ce6d37](https://github.com/twinfoundation/document-management/commit/5ce6d37432ad271ca5783f422846f4be98ec2215))
|
|
12
|
+
* eslint migration to flat config ([98635aa](https://github.com/twinfoundation/document-management/commit/98635aa24ebafba265e989e461fe98104f683191))
|
|
13
|
+
* get document revision ([080eddc](https://github.com/twinfoundation/document-management/commit/080eddcc024c622dda6bb36f60f5fa80a86cf5bb))
|
|
14
|
+
* improve comments ([4d2f094](https://github.com/twinfoundation/document-management/commit/4d2f094b23e3320cb739917246c1ee5f6ad41c11))
|
|
15
|
+
* store document as a vertex ([#2](https://github.com/twinfoundation/document-management/issues/2)) ([7febedc](https://github.com/twinfoundation/document-management/commit/7febedc3fb31de9c19565d6326341046834f2c74))
|
|
16
|
+
* update dependencies ([f9d8641](https://github.com/twinfoundation/document-management/commit/f9d86417dba24027699225ec7473296e361dcb00))
|
|
17
|
+
* update framework core ([f991a59](https://github.com/twinfoundation/document-management/commit/f991a59d25ec228bcdd7a5b6bd55578985b55a84))
|
|
18
|
+
* update ts-to-schema generation ([01a5335](https://github.com/twinfoundation/document-management/commit/01a5335372f6a4764a74d56c446d669724a308aa))
|
|
19
|
+
* use standard list json ld types ([20ea04b](https://github.com/twinfoundation/document-management/commit/20ea04b05fd4bc4fcedce8f66958942c3c2fa303))
|
|
20
|
+
* use targetId in AIG for edges ([82dec81](https://github.com/twinfoundation/document-management/commit/82dec8190d8b523b350ef133bdcf648cab1023b0))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* query params force coercion ([d667d0f](https://github.com/twinfoundation/document-management/commit/d667d0f195accca2887a5ca732e9790063763996))
|
|
26
|
+
|
|
27
|
+
## [0.0.2-next.4](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.2-next.3...document-management-models-v0.0.2-next.4) (2025-10-09)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* add validate-locales ([b6b6f9e](https://github.com/twinfoundation/document-management/commit/b6b6f9e9d66c17af3d030247ca168ac0b5844bdc))
|
|
33
|
+
|
|
3
34
|
## [0.0.2-next.3](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.2-next.2...document-management-models-v0.0.2-next.3) (2025-09-29)
|
|
4
35
|
|
|
5
36
|
|
|
@@ -140,16 +140,16 @@ The date/time of when the document was deleted, as we never actually remove item
|
|
|
140
140
|
|
|
141
141
|
***
|
|
142
142
|
|
|
143
|
-
###
|
|
143
|
+
### organizationIdentity?
|
|
144
144
|
|
|
145
|
-
> **
|
|
145
|
+
> `optional` **organizationIdentity**: `string`
|
|
146
146
|
|
|
147
|
-
The
|
|
147
|
+
The organization which added the document to the graph.
|
|
148
148
|
|
|
149
149
|
***
|
|
150
150
|
|
|
151
|
-
### userIdentity
|
|
151
|
+
### userIdentity?
|
|
152
152
|
|
|
153
|
-
> **userIdentity**: `string`
|
|
153
|
+
> `optional` **userIdentity**: `string`
|
|
154
154
|
|
|
155
155
|
The user who added the document to the graph.
|
|
@@ -10,7 +10,7 @@ Interface describing an document management contract.
|
|
|
10
10
|
|
|
11
11
|
### create()
|
|
12
12
|
|
|
13
|
-
> **create**(`documentId`, `documentIdFormat`, `documentCode`, `blob`, `annotationObject?`, `auditableItemGraphEdges?`, `options
|
|
13
|
+
> **create**(`documentId`, `documentIdFormat`, `documentCode`, `blob`, `annotationObject?`, `auditableItemGraphEdges?`, `options?`): `Promise`\<`string`\>
|
|
14
14
|
|
|
15
15
|
Create a document as an auditable item graph vertex and add its content to blob storage.
|
|
16
16
|
If the document id already exists and the blob data is different a new revision will be created.
|
|
@@ -28,7 +28,7 @@ The document id to create.
|
|
|
28
28
|
|
|
29
29
|
The format of the document identifier.
|
|
30
30
|
|
|
31
|
-
`
|
|
31
|
+
`string` | `undefined`
|
|
32
32
|
|
|
33
33
|
##### documentCode
|
|
34
34
|
|
|
@@ -76,18 +76,6 @@ Flag to add the document id as an alias to the aig vertex, defaults to true.
|
|
|
76
76
|
|
|
77
77
|
Annotation object for the alias.
|
|
78
78
|
|
|
79
|
-
##### userIdentity?
|
|
80
|
-
|
|
81
|
-
`string`
|
|
82
|
-
|
|
83
|
-
The identity to perform the auditable item graph operation with.
|
|
84
|
-
|
|
85
|
-
##### nodeIdentity?
|
|
86
|
-
|
|
87
|
-
`string`
|
|
88
|
-
|
|
89
|
-
The node identity to use for vault operations.
|
|
90
|
-
|
|
91
79
|
#### Returns
|
|
92
80
|
|
|
93
81
|
`Promise`\<`string`\>
|
|
@@ -98,7 +86,7 @@ The auditable item graph vertex created for the document including its revision.
|
|
|
98
86
|
|
|
99
87
|
### update()
|
|
100
88
|
|
|
101
|
-
> **update**(`auditableItemGraphDocumentId`, `blob?`, `annotationObject?`, `auditableItemGraphEdges
|
|
89
|
+
> **update**(`auditableItemGraphDocumentId`, `blob?`, `annotationObject?`, `auditableItemGraphEdges?`): `Promise`\<`void`\>
|
|
102
90
|
|
|
103
91
|
Update a document as an auditable item graph vertex and add its content to blob storage.
|
|
104
92
|
If the blob data is different a new revision will be created.
|
|
@@ -130,18 +118,6 @@ Additional information to associate with the document.
|
|
|
130
118
|
|
|
131
119
|
The auditable item graph vertices to connect the document to, if undefined retains current connections.
|
|
132
120
|
|
|
133
|
-
##### userIdentity?
|
|
134
|
-
|
|
135
|
-
`string`
|
|
136
|
-
|
|
137
|
-
The identity to perform the auditable item graph operation with.
|
|
138
|
-
|
|
139
|
-
##### nodeIdentity?
|
|
140
|
-
|
|
141
|
-
`string`
|
|
142
|
-
|
|
143
|
-
The node identity to use for vault operations.
|
|
144
|
-
|
|
145
121
|
#### Returns
|
|
146
122
|
|
|
147
123
|
`Promise`\<`void`\>
|
|
@@ -152,7 +128,7 @@ Nothing.
|
|
|
152
128
|
|
|
153
129
|
### get()
|
|
154
130
|
|
|
155
|
-
> **get**(`auditableItemGraphDocumentId`, `options?`, `cursor?`, `
|
|
131
|
+
> **get**(`auditableItemGraphDocumentId`, `options?`, `cursor?`, `limit?`): `Promise`\<[`IDocumentList`](IDocumentList.md)\>
|
|
156
132
|
|
|
157
133
|
Get a document using it's auditable item graph vertex id and optional revision.
|
|
158
134
|
|
|
@@ -210,23 +186,11 @@ By default extraction will auto detect the mime type of the document, this can b
|
|
|
210
186
|
|
|
211
187
|
The cursor to get the next chunk of revisions.
|
|
212
188
|
|
|
213
|
-
#####
|
|
189
|
+
##### limit?
|
|
214
190
|
|
|
215
191
|
`number`
|
|
216
192
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
##### userIdentity?
|
|
220
|
-
|
|
221
|
-
`string`
|
|
222
|
-
|
|
223
|
-
The identity to perform the auditable item graph operation with.
|
|
224
|
-
|
|
225
|
-
##### nodeIdentity?
|
|
226
|
-
|
|
227
|
-
`string`
|
|
228
|
-
|
|
229
|
-
The node identity to use for vault operations.
|
|
193
|
+
Limit the number of items to return, defaults to 1 so only most recent is returned.
|
|
230
194
|
|
|
231
195
|
#### Returns
|
|
232
196
|
|
|
@@ -238,7 +202,7 @@ The documents and revisions if requested, ordered by revision descending, cursor
|
|
|
238
202
|
|
|
239
203
|
### getRevision()
|
|
240
204
|
|
|
241
|
-
> **getRevision**(`auditableItemGraphDocumentId`, `revision`, `options
|
|
205
|
+
> **getRevision**(`auditableItemGraphDocumentId`, `revision`, `options?`): `Promise`\<[`IDocument`](IDocument.md)\>
|
|
242
206
|
|
|
243
207
|
Get a document revision using it's auditable item graph vertex id.
|
|
244
208
|
|
|
@@ -290,18 +254,6 @@ If provided will extract data from the document using the specified rule group i
|
|
|
290
254
|
|
|
291
255
|
By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
292
256
|
|
|
293
|
-
##### userIdentity?
|
|
294
|
-
|
|
295
|
-
`string`
|
|
296
|
-
|
|
297
|
-
The identity to perform the auditable item graph operation with.
|
|
298
|
-
|
|
299
|
-
##### nodeIdentity?
|
|
300
|
-
|
|
301
|
-
`string`
|
|
302
|
-
|
|
303
|
-
The node identity to use for vault operations.
|
|
304
|
-
|
|
305
257
|
#### Returns
|
|
306
258
|
|
|
307
259
|
`Promise`\<[`IDocument`](IDocument.md)\>
|
|
@@ -312,7 +264,7 @@ The documents and revisions if requested, ordered by revision descending, cursor
|
|
|
312
264
|
|
|
313
265
|
### removeRevision()
|
|
314
266
|
|
|
315
|
-
> **removeRevision**(`auditableItemGraphDocumentId`, `revision
|
|
267
|
+
> **removeRevision**(`auditableItemGraphDocumentId`, `revision`): `Promise`\<`void`\>
|
|
316
268
|
|
|
317
269
|
Remove an auditable item graph vertex using it's id.
|
|
318
270
|
The document dateDeleted will be set, but can still be queried with the includeRemoved flag.
|
|
@@ -331,18 +283,6 @@ The auditable item graph vertex id which contains the document.
|
|
|
331
283
|
|
|
332
284
|
The revision of the document to remove.
|
|
333
285
|
|
|
334
|
-
##### userIdentity?
|
|
335
|
-
|
|
336
|
-
`string`
|
|
337
|
-
|
|
338
|
-
The identity to perform the auditable item graph operation with.
|
|
339
|
-
|
|
340
|
-
##### nodeIdentity?
|
|
341
|
-
|
|
342
|
-
`string`
|
|
343
|
-
|
|
344
|
-
The node identity to use for vault operations.
|
|
345
|
-
|
|
346
286
|
#### Returns
|
|
347
287
|
|
|
348
288
|
`Promise`\<`void`\>
|
|
@@ -353,7 +293,7 @@ Nothing.
|
|
|
353
293
|
|
|
354
294
|
### query()
|
|
355
295
|
|
|
356
|
-
> **query**(`documentId`, `cursor?`, `
|
|
296
|
+
> **query**(`documentId`, `cursor?`, `limit?`): `Promise`\<`IAuditableItemGraphVertexList`\>
|
|
357
297
|
|
|
358
298
|
Find all the document with a specific id.
|
|
359
299
|
|
|
@@ -371,23 +311,11 @@ The document id to find in the graph.
|
|
|
371
311
|
|
|
372
312
|
The cursor to get the next chunk of documents.
|
|
373
313
|
|
|
374
|
-
#####
|
|
314
|
+
##### limit?
|
|
375
315
|
|
|
376
316
|
`number`
|
|
377
317
|
|
|
378
|
-
The
|
|
379
|
-
|
|
380
|
-
##### userIdentity?
|
|
381
|
-
|
|
382
|
-
`string`
|
|
383
|
-
|
|
384
|
-
The identity to perform the auditable item graph operation with.
|
|
385
|
-
|
|
386
|
-
##### nodeIdentity?
|
|
387
|
-
|
|
388
|
-
`string`
|
|
389
|
-
|
|
390
|
-
The node identity to use for vault operations.
|
|
318
|
+
The limit to get the next chunk of documents.
|
|
391
319
|
|
|
392
320
|
#### Returns
|
|
393
321
|
|
|
@@ -96,11 +96,11 @@ If provided will extract data from the document using the specified rule group i
|
|
|
96
96
|
|
|
97
97
|
By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
98
98
|
|
|
99
|
-
####
|
|
99
|
+
#### limit?
|
|
100
100
|
|
|
101
|
-
> `optional` **
|
|
101
|
+
> `optional` **limit**: `string`
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
PLimit the number of items to return, defaults to 1 so only most recent is returned.
|
|
104
104
|
|
|
105
105
|
##### Default
|
|
106
106
|
|
|
@@ -34,8 +34,8 @@ The id of the document id we are trying to find.
|
|
|
34
34
|
|
|
35
35
|
The cursor to get the next chunk of documents.
|
|
36
36
|
|
|
37
|
-
####
|
|
37
|
+
#### limit?
|
|
38
38
|
|
|
39
|
-
> `optional` **
|
|
39
|
+
> `optional` **limit**: `string`
|
|
40
40
|
|
|
41
41
|
The number of documents to return.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/document-management-models",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3-next.1",
|
|
4
4
|
"description": "Models which define the structure of the document management connectors and services",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,22 +24,39 @@
|
|
|
24
24
|
"@twin.org/standards-schema-org": "next",
|
|
25
25
|
"@twin.org/standards-unece": "next"
|
|
26
26
|
},
|
|
27
|
-
"main": "./dist/
|
|
28
|
-
"module": "./dist/esm/index.mjs",
|
|
27
|
+
"main": "./dist/es/index.js",
|
|
29
28
|
"types": "./dist/types/index.d.ts",
|
|
30
29
|
"exports": {
|
|
31
30
|
".": {
|
|
32
31
|
"types": "./dist/types/index.d.ts",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
32
|
+
"import": "./dist/es/index.js",
|
|
33
|
+
"default": "./dist/es/index.js"
|
|
35
34
|
},
|
|
36
35
|
"./locales/*.json": "./locales/*.json"
|
|
37
36
|
},
|
|
38
37
|
"files": [
|
|
39
|
-
"dist/
|
|
40
|
-
"dist/esm",
|
|
38
|
+
"dist/es",
|
|
41
39
|
"dist/types",
|
|
42
40
|
"locales",
|
|
43
41
|
"docs"
|
|
44
|
-
]
|
|
42
|
+
],
|
|
43
|
+
"keywords": [
|
|
44
|
+
"twin",
|
|
45
|
+
"trade",
|
|
46
|
+
"iota",
|
|
47
|
+
"framework",
|
|
48
|
+
"blockchain",
|
|
49
|
+
"document-management",
|
|
50
|
+
"documents",
|
|
51
|
+
"management",
|
|
52
|
+
"storage",
|
|
53
|
+
"rest-api",
|
|
54
|
+
"models",
|
|
55
|
+
"types",
|
|
56
|
+
"schemas"
|
|
57
|
+
],
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "git+https://github.com/twinfoundation/document-management/issues"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://twindev.org"
|
|
45
62
|
}
|
package/dist/cjs/index.cjs
DELETED
|
@@ -1,190 +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 document management objects.
|
|
9
|
-
*/
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
|
-
const DocumentContexts = {
|
|
12
|
-
/**
|
|
13
|
-
* The context root for the document types.
|
|
14
|
-
*/
|
|
15
|
-
ContextRoot: "https://schema.twindev.org/documents/",
|
|
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 document management objects.
|
|
26
|
-
*/
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
28
|
-
const DocumentTypes = {
|
|
29
|
-
/**
|
|
30
|
-
* Represents a document.
|
|
31
|
-
*/
|
|
32
|
-
Document: "Document",
|
|
33
|
-
/**
|
|
34
|
-
* Represents a document attestation.
|
|
35
|
-
*/
|
|
36
|
-
DocumentAttestation: "DocumentAttestation"
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
var $schema = "https://json-schema.org/draft/2020-12/schema";
|
|
40
|
-
var $id = "https://schema.twindev.org/documents/Document";
|
|
41
|
-
var description = "Interface describing a document.";
|
|
42
|
-
var type = "object";
|
|
43
|
-
var properties = {
|
|
44
|
-
"@context": {
|
|
45
|
-
type: "array",
|
|
46
|
-
minItems: 3,
|
|
47
|
-
items: {
|
|
48
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
49
|
-
},
|
|
50
|
-
description: "JSON-LD Context.",
|
|
51
|
-
prefixItems: [
|
|
52
|
-
{
|
|
53
|
-
type: "string",
|
|
54
|
-
"const": "https://schema.twindev.org/documents/"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
type: "string",
|
|
58
|
-
"const": "https://schema.twindev.org/common/"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
type: "string",
|
|
62
|
-
"const": "https://schema.org"
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
type: {
|
|
67
|
-
type: "string",
|
|
68
|
-
"const": "Document",
|
|
69
|
-
description: "JSON-LD Type."
|
|
70
|
-
},
|
|
71
|
-
id: {
|
|
72
|
-
type: "string",
|
|
73
|
-
description: "The full id of the document."
|
|
74
|
-
},
|
|
75
|
-
documentId: {
|
|
76
|
-
type: "string",
|
|
77
|
-
description: "The id of the document."
|
|
78
|
-
},
|
|
79
|
-
documentIdFormat: {
|
|
80
|
-
type: "string",
|
|
81
|
-
description: "The format of the document id."
|
|
82
|
-
},
|
|
83
|
-
documentCode: {
|
|
84
|
-
$ref: "https://vocabulary.uncefact.org/DocumentCodeList",
|
|
85
|
-
description: "The code for the document type."
|
|
86
|
-
},
|
|
87
|
-
documentRevision: {
|
|
88
|
-
type: "number",
|
|
89
|
-
description: "The revision of the document as a 0 based index."
|
|
90
|
-
},
|
|
91
|
-
annotationObject: {
|
|
92
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
93
|
-
description: "Additional annotation information for the document."
|
|
94
|
-
},
|
|
95
|
-
blobStorageId: {
|
|
96
|
-
type: "string",
|
|
97
|
-
description: "The blob storage id for the document."
|
|
98
|
-
},
|
|
99
|
-
blobHash: {
|
|
100
|
-
type: "string",
|
|
101
|
-
description: "The hash of the blob data."
|
|
102
|
-
},
|
|
103
|
-
blobStorageEntry: {
|
|
104
|
-
$ref: "https://schema.twindev.org/blob-storage/BlobStorageEntry",
|
|
105
|
-
description: "The additional JSON-LD for blob storage if it was requested."
|
|
106
|
-
},
|
|
107
|
-
extractedData: {
|
|
108
|
-
description: "The data extracted from the document using data extraction services."
|
|
109
|
-
},
|
|
110
|
-
attestationId: {
|
|
111
|
-
type: "string",
|
|
112
|
-
description: "The attestation for the document if one was created."
|
|
113
|
-
},
|
|
114
|
-
attestationInformation: {
|
|
115
|
-
$ref: "https://schema.twindev.org/attestation/AttestationInformation",
|
|
116
|
-
description: "The additional JSON-LD for attestation storage if it was requested."
|
|
117
|
-
},
|
|
118
|
-
dateCreated: {
|
|
119
|
-
type: "string",
|
|
120
|
-
description: "The date/time of when the document was created."
|
|
121
|
-
},
|
|
122
|
-
dateModified: {
|
|
123
|
-
type: "string",
|
|
124
|
-
description: "The date/time of when the document was modified."
|
|
125
|
-
},
|
|
126
|
-
dateDeleted: {
|
|
127
|
-
type: "string",
|
|
128
|
-
description: "The date/time of when the document was deleted, as we never actually remove items."
|
|
129
|
-
},
|
|
130
|
-
nodeIdentity: {
|
|
131
|
-
type: "string",
|
|
132
|
-
description: "The node which added the document to the graph."
|
|
133
|
-
},
|
|
134
|
-
userIdentity: {
|
|
135
|
-
type: "string",
|
|
136
|
-
description: "The user who added the document to the graph."
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
var required = [
|
|
140
|
-
"@context",
|
|
141
|
-
"type",
|
|
142
|
-
"id",
|
|
143
|
-
"documentId",
|
|
144
|
-
"documentCode",
|
|
145
|
-
"documentRevision",
|
|
146
|
-
"blobStorageId",
|
|
147
|
-
"blobHash",
|
|
148
|
-
"dateCreated",
|
|
149
|
-
"nodeIdentity",
|
|
150
|
-
"userIdentity"
|
|
151
|
-
];
|
|
152
|
-
var additionalProperties = false;
|
|
153
|
-
var DocumentSchema = {
|
|
154
|
-
$schema: $schema,
|
|
155
|
-
$id: $id,
|
|
156
|
-
description: description,
|
|
157
|
-
type: type,
|
|
158
|
-
properties: properties,
|
|
159
|
-
required: required,
|
|
160
|
-
additionalProperties: additionalProperties
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
// Copyright 2024 IOTA Stiftung.
|
|
164
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
165
|
-
/**
|
|
166
|
-
* Handle all the data types for document management.
|
|
167
|
-
*/
|
|
168
|
-
class DocumentManagementDataTypes {
|
|
169
|
-
/**
|
|
170
|
-
* Register all the data types.
|
|
171
|
-
*/
|
|
172
|
-
static registerTypes() {
|
|
173
|
-
dataCore.DataTypeHandlerFactory.register(`${DocumentContexts.ContextRoot}${DocumentTypes.Document}`, () => ({
|
|
174
|
-
context: DocumentContexts.ContextRoot,
|
|
175
|
-
type: DocumentTypes.Document,
|
|
176
|
-
defaultValue: {},
|
|
177
|
-
jsonSchema: async () => DocumentSchema
|
|
178
|
-
}));
|
|
179
|
-
dataCore.DataTypeHandlerFactory.register(`${DocumentContexts.ContextRoot}${DocumentTypes.DocumentAttestation}`, () => ({
|
|
180
|
-
context: DocumentContexts.ContextRoot,
|
|
181
|
-
type: DocumentTypes.DocumentAttestation,
|
|
182
|
-
defaultValue: {},
|
|
183
|
-
jsonSchema: async () => DocumentSchema
|
|
184
|
-
}));
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
exports.DocumentContexts = DocumentContexts;
|
|
189
|
-
exports.DocumentManagementDataTypes = DocumentManagementDataTypes;
|
|
190
|
-
exports.DocumentTypes = DocumentTypes;
|