@twin.org/document-management-models 0.0.1-next.11 → 0.0.1-next.13
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/types/index.d.ts +2 -0
- package/dist/types/models/IDocumentManagementComponent.d.ts +22 -0
- package/dist/types/models/api/IDocumentManagementGetRevisionRequest.d.ts +53 -0
- package/dist/types/models/api/IDocumentManagementGetRevisionResponse.d.ts +17 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/index.md +2 -0
- package/docs/reference/interfaces/IDocumentManagementComponent.md +74 -0
- package/docs/reference/interfaces/IDocumentManagementGetRevisionRequest.md +91 -0
- package/docs/reference/interfaces/IDocumentManagementGetRevisionResponse.md +23 -0
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./models/api/IDocumentManagementCreateRequest";
|
|
2
2
|
export * from "./models/api/IDocumentManagementGetRequest";
|
|
3
3
|
export * from "./models/api/IDocumentManagementGetResponse";
|
|
4
|
+
export * from "./models/api/IDocumentManagementGetRevisionRequest";
|
|
5
|
+
export * from "./models/api/IDocumentManagementGetRevisionResponse";
|
|
4
6
|
export * from "./models/api/IDocumentManagementQueryRequest";
|
|
5
7
|
export * from "./models/api/IDocumentManagementQueryResponse";
|
|
6
8
|
export * from "./models/api/IDocumentManagementRemoveRequest";
|
|
@@ -2,6 +2,7 @@ import type { IAuditableItemGraphVertexList } from "@twin.org/auditable-item-gra
|
|
|
2
2
|
import type { IComponent } from "@twin.org/core";
|
|
3
3
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
4
4
|
import type { UneceDocumentCodes } from "@twin.org/standards-unece";
|
|
5
|
+
import type { IDocument } from "./IDocument";
|
|
5
6
|
import type { IDocumentList } from "./IDocumentList";
|
|
6
7
|
/**
|
|
7
8
|
* Interface describing an document management contract.
|
|
@@ -75,6 +76,27 @@ export interface IDocumentManagementComponent extends IComponent {
|
|
|
75
76
|
extractRuleGroupId?: string;
|
|
76
77
|
extractMimeType?: string;
|
|
77
78
|
}, cursor?: string, pageSize?: number, userIdentity?: string, nodeIdentity?: string): Promise<IDocumentList>;
|
|
79
|
+
/**
|
|
80
|
+
* Get a document revision using it's auditable item graph vertex id.
|
|
81
|
+
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
82
|
+
* @param revision The revision id of the document to get.
|
|
83
|
+
* @param options Additional options for the get operation.
|
|
84
|
+
* @param options.includeBlobStorageMetadata Flag to include the blob storage metadata for the document, defaults to false.
|
|
85
|
+
* @param options.includeBlobStorageData Flag to include the blob storage data for the document, defaults to false.
|
|
86
|
+
* @param options.includeAttestation Flag to include the attestation information for the document, defaults to false.
|
|
87
|
+
* @param options.extractRuleGroupId If provided will extract data from the document using the specified rule group id.
|
|
88
|
+
* @param options.extractMimeType By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
89
|
+
* @param userIdentity The identity to perform the auditable item graph operation with.
|
|
90
|
+
* @param nodeIdentity The node identity to use for vault operations.
|
|
91
|
+
* @returns The documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.
|
|
92
|
+
*/
|
|
93
|
+
getRevision(auditableItemGraphDocumentId: string, revision: number, options?: {
|
|
94
|
+
includeBlobStorageMetadata?: boolean;
|
|
95
|
+
includeBlobStorageData?: boolean;
|
|
96
|
+
includeAttestation?: boolean;
|
|
97
|
+
extractRuleGroupId?: string;
|
|
98
|
+
extractMimeType?: string;
|
|
99
|
+
}, userIdentity?: string, nodeIdentity?: string): Promise<IDocument>;
|
|
78
100
|
/**
|
|
79
101
|
* Remove an auditable item graph vertex using it's id.
|
|
80
102
|
* The document dateDeleted will be set, but can still be queried with the includeRemoved flag.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
2
|
+
/**
|
|
3
|
+
* Request to get a document revision from an auditable item graph vertex.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDocumentManagementGetRevisionRequest {
|
|
6
|
+
/**
|
|
7
|
+
* The headers which can be used to determine the response data type.
|
|
8
|
+
*/
|
|
9
|
+
headers?: {
|
|
10
|
+
[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The path parameters.
|
|
14
|
+
*/
|
|
15
|
+
pathParams: {
|
|
16
|
+
/**
|
|
17
|
+
* The full id of the document to get.
|
|
18
|
+
*/
|
|
19
|
+
auditableItemGraphDocumentId: string;
|
|
20
|
+
/**
|
|
21
|
+
* The revision of the document to get.
|
|
22
|
+
*/
|
|
23
|
+
revision: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The query parameters.
|
|
27
|
+
*/
|
|
28
|
+
query?: {
|
|
29
|
+
/**
|
|
30
|
+
* Include the blob storage metadata in the response.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
includeBlobStorageMetadata?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Include the blob storage data in the response.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
includeBlobStorageData?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Include the attestation information in the response.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
includeAttestation?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* If provided will extract data from the document using the specified rule group id.
|
|
46
|
+
*/
|
|
47
|
+
extractRuleGroupId?: string;
|
|
48
|
+
/**
|
|
49
|
+
* By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
50
|
+
*/
|
|
51
|
+
extractMimeType?: string;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
2
|
+
import type { IDocument } from "../IDocument";
|
|
3
|
+
/**
|
|
4
|
+
* Response to get a document revision from an auditable item graph vertex.
|
|
5
|
+
*/
|
|
6
|
+
export interface IDocumentManagementGetRevisionResponse {
|
|
7
|
+
/**
|
|
8
|
+
* The headers which can be used to determine the response data type.
|
|
9
|
+
*/
|
|
10
|
+
headers?: {
|
|
11
|
+
[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The body parameters.
|
|
15
|
+
*/
|
|
16
|
+
body: IDocument;
|
|
17
|
+
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @twin.org/document-management-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.1-next.13](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.12...document-management-models-v0.0.1-next.13) (2025-04-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **document-management-models:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
## [0.0.1-next.12](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.11...document-management-models-v0.0.1-next.12) (2025-04-30)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* get document revision ([080eddc](https://github.com/twinfoundation/document-management/commit/080eddcc024c622dda6bb36f60f5fa80a86cf5bb))
|
|
16
|
+
|
|
3
17
|
## [0.0.1-next.11](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.10...document-management-models-v0.0.1-next.11) (2025-04-28)
|
|
4
18
|
|
|
5
19
|
|
package/docs/reference/index.md
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
- [IDocumentManagementCreateRequest](interfaces/IDocumentManagementCreateRequest.md)
|
|
10
10
|
- [IDocumentManagementGetRequest](interfaces/IDocumentManagementGetRequest.md)
|
|
11
11
|
- [IDocumentManagementGetResponse](interfaces/IDocumentManagementGetResponse.md)
|
|
12
|
+
- [IDocumentManagementGetRevisionRequest](interfaces/IDocumentManagementGetRevisionRequest.md)
|
|
13
|
+
- [IDocumentManagementGetRevisionResponse](interfaces/IDocumentManagementGetRevisionResponse.md)
|
|
12
14
|
- [IDocumentManagementQueryRequest](interfaces/IDocumentManagementQueryRequest.md)
|
|
13
15
|
- [IDocumentManagementQueryResponse](interfaces/IDocumentManagementQueryResponse.md)
|
|
14
16
|
- [IDocumentManagementRemoveRequest](interfaces/IDocumentManagementRemoveRequest.md)
|
|
@@ -236,6 +236,80 @@ The documents and revisions if requested, ordered by revision descending, cursor
|
|
|
236
236
|
|
|
237
237
|
***
|
|
238
238
|
|
|
239
|
+
### getRevision()
|
|
240
|
+
|
|
241
|
+
> **getRevision**(`auditableItemGraphDocumentId`, `revision`, `options?`, `userIdentity?`, `nodeIdentity?`): `Promise`\<[`IDocument`](IDocument.md)\>
|
|
242
|
+
|
|
243
|
+
Get a document revision using it's auditable item graph vertex id.
|
|
244
|
+
|
|
245
|
+
#### Parameters
|
|
246
|
+
|
|
247
|
+
##### auditableItemGraphDocumentId
|
|
248
|
+
|
|
249
|
+
`string`
|
|
250
|
+
|
|
251
|
+
The auditable item graph vertex id which contains the document.
|
|
252
|
+
|
|
253
|
+
##### revision
|
|
254
|
+
|
|
255
|
+
`number`
|
|
256
|
+
|
|
257
|
+
The revision id of the document to get.
|
|
258
|
+
|
|
259
|
+
##### options?
|
|
260
|
+
|
|
261
|
+
Additional options for the get operation.
|
|
262
|
+
|
|
263
|
+
###### includeBlobStorageMetadata?
|
|
264
|
+
|
|
265
|
+
`boolean`
|
|
266
|
+
|
|
267
|
+
Flag to include the blob storage metadata for the document, defaults to false.
|
|
268
|
+
|
|
269
|
+
###### includeBlobStorageData?
|
|
270
|
+
|
|
271
|
+
`boolean`
|
|
272
|
+
|
|
273
|
+
Flag to include the blob storage data for the document, defaults to false.
|
|
274
|
+
|
|
275
|
+
###### includeAttestation?
|
|
276
|
+
|
|
277
|
+
`boolean`
|
|
278
|
+
|
|
279
|
+
Flag to include the attestation information for the document, defaults to false.
|
|
280
|
+
|
|
281
|
+
###### extractRuleGroupId?
|
|
282
|
+
|
|
283
|
+
`string`
|
|
284
|
+
|
|
285
|
+
If provided will extract data from the document using the specified rule group id.
|
|
286
|
+
|
|
287
|
+
###### extractMimeType?
|
|
288
|
+
|
|
289
|
+
`string`
|
|
290
|
+
|
|
291
|
+
By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
292
|
+
|
|
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
|
+
#### Returns
|
|
306
|
+
|
|
307
|
+
`Promise`\<[`IDocument`](IDocument.md)\>
|
|
308
|
+
|
|
309
|
+
The documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.
|
|
310
|
+
|
|
311
|
+
***
|
|
312
|
+
|
|
239
313
|
### removeRevision()
|
|
240
314
|
|
|
241
315
|
> **removeRevision**(`auditableItemGraphDocumentId`, `revision`, `userIdentity?`, `nodeIdentity?`): `Promise`\<`void`\>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Interface: IDocumentManagementGetRevisionRequest
|
|
2
|
+
|
|
3
|
+
Request to get a document revision from an auditable item graph vertex.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### headers?
|
|
8
|
+
|
|
9
|
+
> `optional` **headers**: `object`
|
|
10
|
+
|
|
11
|
+
The headers which can be used to determine the response data type.
|
|
12
|
+
|
|
13
|
+
#### accept
|
|
14
|
+
|
|
15
|
+
> **accept**: `"application/json"` \| `"application/ld+json"`
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### pathParams
|
|
20
|
+
|
|
21
|
+
> **pathParams**: `object`
|
|
22
|
+
|
|
23
|
+
The path parameters.
|
|
24
|
+
|
|
25
|
+
#### auditableItemGraphDocumentId
|
|
26
|
+
|
|
27
|
+
> **auditableItemGraphDocumentId**: `string`
|
|
28
|
+
|
|
29
|
+
The full id of the document to get.
|
|
30
|
+
|
|
31
|
+
#### revision
|
|
32
|
+
|
|
33
|
+
> **revision**: `string`
|
|
34
|
+
|
|
35
|
+
The revision of the document to get.
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### query?
|
|
40
|
+
|
|
41
|
+
> `optional` **query**: `object`
|
|
42
|
+
|
|
43
|
+
The query parameters.
|
|
44
|
+
|
|
45
|
+
#### includeBlobStorageMetadata?
|
|
46
|
+
|
|
47
|
+
> `optional` **includeBlobStorageMetadata**: `boolean`
|
|
48
|
+
|
|
49
|
+
Include the blob storage metadata in the response.
|
|
50
|
+
|
|
51
|
+
##### Default
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
false
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### includeBlobStorageData?
|
|
58
|
+
|
|
59
|
+
> `optional` **includeBlobStorageData**: `boolean`
|
|
60
|
+
|
|
61
|
+
Include the blob storage data in the response.
|
|
62
|
+
|
|
63
|
+
##### Default
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
false
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### includeAttestation?
|
|
70
|
+
|
|
71
|
+
> `optional` **includeAttestation**: `boolean`
|
|
72
|
+
|
|
73
|
+
Include the attestation information in the response.
|
|
74
|
+
|
|
75
|
+
##### Default
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
false
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### extractRuleGroupId?
|
|
82
|
+
|
|
83
|
+
> `optional` **extractRuleGroupId**: `string`
|
|
84
|
+
|
|
85
|
+
If provided will extract data from the document using the specified rule group id.
|
|
86
|
+
|
|
87
|
+
#### extractMimeType?
|
|
88
|
+
|
|
89
|
+
> `optional` **extractMimeType**: `string`
|
|
90
|
+
|
|
91
|
+
By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Interface: IDocumentManagementGetRevisionResponse
|
|
2
|
+
|
|
3
|
+
Response to get a document revision from an auditable item graph vertex.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### headers?
|
|
8
|
+
|
|
9
|
+
> `optional` **headers**: `object`
|
|
10
|
+
|
|
11
|
+
The headers which can be used to determine the response data type.
|
|
12
|
+
|
|
13
|
+
#### content-type
|
|
14
|
+
|
|
15
|
+
> **content-type**: `"application/json"` \| `"application/ld+json"`
|
|
16
|
+
|
|
17
|
+
***
|
|
18
|
+
|
|
19
|
+
### body
|
|
20
|
+
|
|
21
|
+
> **body**: [`IDocument`](IDocument.md)
|
|
22
|
+
|
|
23
|
+
The body parameters.
|
package/package.json
CHANGED