@twin.org/document-management-models 0.0.1-next.2 → 0.0.1-next.20
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 +167 -5
- package/dist/esm/index.mjs +166 -6
- package/dist/types/dataTypes/documentManagementDataTypes.d.ts +9 -0
- package/dist/types/index.d.ts +8 -2
- package/dist/types/models/IDocument.d.ts +14 -9
- package/dist/types/models/IDocumentAttestation.d.ts +41 -0
- package/dist/types/models/IDocumentList.d.ts +13 -7
- package/dist/types/models/IDocumentManagementComponent.d.ts +75 -33
- package/dist/types/models/api/{IDocumentManagementSetRequest.d.ts → IDocumentManagementCreateRequest.d.ts} +19 -12
- package/dist/types/models/api/IDocumentManagementGetRequest.d.ts +17 -13
- package/dist/types/models/api/IDocumentManagementGetResponse.d.ts +2 -2
- package/dist/types/models/api/IDocumentManagementGetRevisionRequest.d.ts +53 -0
- package/dist/types/models/api/IDocumentManagementGetRevisionResponse.d.ts +17 -0
- package/dist/types/models/api/IDocumentManagementQueryRequest.d.ts +7 -22
- package/dist/types/models/api/IDocumentManagementQueryResponse.d.ts +2 -2
- package/dist/types/models/api/IDocumentManagementRemoveRequest.d.ts +5 -15
- package/dist/types/models/api/IDocumentManagementUpdateRequest.d.ts +36 -0
- package/dist/types/models/documentContexts.d.ts +17 -0
- package/dist/types/models/documentTypes.d.ts +17 -0
- package/docs/changelog.md +104 -1
- package/docs/reference/classes/DocumentManagementDataTypes.md +25 -0
- package/docs/reference/index.md +11 -1
- package/docs/reference/interfaces/IDocument.md +14 -6
- package/docs/reference/interfaces/IDocumentAttestation.md +59 -0
- package/docs/reference/interfaces/IDocumentList.md +15 -7
- package/docs/reference/interfaces/IDocumentManagementComponent.md +179 -55
- package/docs/reference/interfaces/{IDocumentManagementSetRequest.md → IDocumentManagementCreateRequest.md} +21 -17
- package/docs/reference/interfaces/IDocumentManagementGetRequest.md +24 -18
- package/docs/reference/interfaces/IDocumentManagementGetResponse.md +1 -1
- package/docs/reference/interfaces/IDocumentManagementGetRevisionRequest.md +91 -0
- package/docs/reference/interfaces/IDocumentManagementGetRevisionResponse.md +23 -0
- package/docs/reference/interfaces/IDocumentManagementQueryRequest.md +11 -43
- package/docs/reference/interfaces/IDocumentManagementQueryResponse.md +1 -1
- package/docs/reference/interfaces/IDocumentManagementRemoveRequest.md +7 -27
- package/docs/reference/interfaces/IDocumentManagementUpdateRequest.md +43 -0
- package/docs/reference/type-aliases/DocumentContexts.md +5 -0
- package/docs/reference/type-aliases/DocumentTypes.md +1 -1
- package/docs/reference/variables/DocumentContexts.md +19 -0
- package/docs/reference/variables/DocumentTypes.md +3 -15
- package/package.json +3 -1
- package/dist/types/models/documentDataTypes.d.ts +0 -25
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IAuditableItemGraphVertexList } from "@twin.org/auditable-item-graph-models";
|
|
1
2
|
import type { IComponent } from "@twin.org/core";
|
|
2
3
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
3
4
|
import type { UneceDocumentCodes } from "@twin.org/standards-unece";
|
|
@@ -8,71 +9,112 @@ import type { IDocumentList } from "./IDocumentList";
|
|
|
8
9
|
*/
|
|
9
10
|
export interface IDocumentManagementComponent extends IComponent {
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Create a document as an auditable item graph vertex and add its content to blob storage.
|
|
12
13
|
* If the document id already exists and the blob data is different a new revision will be created.
|
|
13
14
|
* For any other changes the current revision will be updated.
|
|
14
|
-
* @param auditableItemGraphId The auditable item graph vertex id to create the document on.
|
|
15
15
|
* @param documentId The document id to create.
|
|
16
16
|
* @param documentIdFormat The format of the document identifier.
|
|
17
17
|
* @param documentCode The code for the document type.
|
|
18
18
|
* @param blob The data to create the document with.
|
|
19
19
|
* @param annotationObject Additional information to associate with the document.
|
|
20
|
-
* @param
|
|
20
|
+
* @param auditableItemGraphEdges The auditable item graph vertices to connect the document to.
|
|
21
|
+
* @param options Additional options for the set operation.
|
|
22
|
+
* @param options.createAttestation Flag to create an attestation for the document, defaults to false.
|
|
23
|
+
* @param options.addAlias Flag to add the document id as an alias to the aig vertex, defaults to true.
|
|
24
|
+
* @param options.aliasAnnotationObject Annotation object for the alias.
|
|
21
25
|
* @param userIdentity The identity to perform the auditable item graph operation with.
|
|
22
26
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
23
|
-
* @returns The
|
|
27
|
+
* @returns The auditable item graph vertex created for the document including its revision.
|
|
24
28
|
*/
|
|
25
|
-
|
|
29
|
+
create(documentId: string, documentIdFormat: string | undefined, documentCode: UneceDocumentCodes, blob: Uint8Array, annotationObject?: IJsonLdNodeObject, auditableItemGraphEdges?: {
|
|
30
|
+
id: string;
|
|
31
|
+
addAlias?: boolean;
|
|
32
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
33
|
+
}[], options?: {
|
|
34
|
+
createAttestation?: boolean;
|
|
35
|
+
addAlias?: boolean;
|
|
36
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
37
|
+
}, userIdentity?: string, nodeIdentity?: string): Promise<string>;
|
|
26
38
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
39
|
+
* Update a document as an auditable item graph vertex and add its content to blob storage.
|
|
40
|
+
* If the blob data is different a new revision will be created.
|
|
41
|
+
* For any other changes the current revision will be updated.
|
|
42
|
+
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
43
|
+
* @param blob The data to update the document with.
|
|
44
|
+
* @param annotationObject Additional information to associate with the document.
|
|
45
|
+
* @param auditableItemGraphEdges The auditable item graph vertices to connect the document to, if undefined retains current connections.
|
|
46
|
+
* @param userIdentity The identity to perform the auditable item graph operation with.
|
|
47
|
+
* @param nodeIdentity The node identity to use for vault operations.
|
|
48
|
+
* @returns Nothing.
|
|
49
|
+
*/
|
|
50
|
+
update(auditableItemGraphDocumentId: string, blob?: Uint8Array, annotationObject?: IJsonLdNodeObject, auditableItemGraphEdges?: {
|
|
51
|
+
id: string;
|
|
52
|
+
addAlias?: boolean;
|
|
53
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
54
|
+
}[], userIdentity?: string, nodeIdentity?: string): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Get a document using it's auditable item graph vertex id and optional revision.
|
|
57
|
+
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
30
58
|
* @param options Additional options for the get operation.
|
|
31
59
|
* @param options.includeBlobStorageMetadata Flag to include the blob storage metadata for the document, defaults to false.
|
|
32
60
|
* @param options.includeBlobStorageData Flag to include the blob storage data for the document, defaults to false.
|
|
33
61
|
* @param options.includeAttestation Flag to include the attestation information for the document, defaults to false.
|
|
34
62
|
* @param options.includeRemoved Flag to include deleted documents, defaults to false.
|
|
35
|
-
* @param options.
|
|
36
|
-
* @param
|
|
63
|
+
* @param options.extractRuleGroupId If provided will extract data from the document using the specified rule group id.
|
|
64
|
+
* @param options.extractMimeType By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
65
|
+
* @param cursor The cursor to get the next chunk of revisions.
|
|
66
|
+
* @param pageSize Page size of items to return, defaults to 1 so only most recent is returned.
|
|
37
67
|
* @param userIdentity The identity to perform the auditable item graph operation with.
|
|
38
68
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
39
69
|
* @returns The documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.
|
|
40
70
|
*/
|
|
41
|
-
get(
|
|
71
|
+
get(auditableItemGraphDocumentId: string, options?: {
|
|
42
72
|
includeBlobStorageMetadata?: boolean;
|
|
43
73
|
includeBlobStorageData?: boolean;
|
|
44
74
|
includeAttestation?: boolean;
|
|
45
75
|
includeRemoved?: boolean;
|
|
46
|
-
|
|
47
|
-
|
|
76
|
+
extractRuleGroupId?: string;
|
|
77
|
+
extractMimeType?: string;
|
|
78
|
+
}, cursor?: string, pageSize?: number, userIdentity?: string, nodeIdentity?: string): Promise<IDocumentList>;
|
|
48
79
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param options
|
|
54
|
-
* @param options.
|
|
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>;
|
|
100
|
+
/**
|
|
101
|
+
* Remove an auditable item graph vertex using it's id.
|
|
102
|
+
* The document dateDeleted will be set, but can still be queried with the includeRemoved flag.
|
|
103
|
+
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
104
|
+
* @param revision The revision of the document to remove.
|
|
55
105
|
* @param userIdentity The identity to perform the auditable item graph operation with.
|
|
56
106
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
57
107
|
* @returns Nothing.
|
|
58
108
|
*/
|
|
59
|
-
|
|
60
|
-
removeAllRevisions?: boolean;
|
|
61
|
-
}, userIdentity?: string, nodeIdentity?: string): Promise<void>;
|
|
109
|
+
removeRevision(auditableItemGraphDocumentId: string, revision: number, userIdentity?: string, nodeIdentity?: string): Promise<void>;
|
|
62
110
|
/**
|
|
63
|
-
*
|
|
64
|
-
* @param
|
|
65
|
-
* @param documentCodes The document codes to query for, if undefined gets all document codes.
|
|
66
|
-
* @param options Additional options for the query operation.
|
|
67
|
-
* @param options.includeMostRecentRevisions Include the most recent 5 revisions, use the individual get to retrieve more.
|
|
68
|
-
* @param options.includeRemoved Flag to include deleted documents, defaults to false.
|
|
111
|
+
* Find all the document with a specific id.
|
|
112
|
+
* @param documentId The document id to find in the graph.
|
|
69
113
|
* @param cursor The cursor to get the next chunk of documents.
|
|
114
|
+
* @param pageSize The page size to get the next chunk of documents.
|
|
70
115
|
* @param userIdentity The identity to perform the auditable item graph operation with.
|
|
71
116
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
72
|
-
* @returns The
|
|
117
|
+
* @returns The graph vertices that contain documents referencing the specified document id.
|
|
73
118
|
*/
|
|
74
|
-
query(
|
|
75
|
-
includeMostRecentRevisions?: boolean;
|
|
76
|
-
includeRemoved?: boolean;
|
|
77
|
-
}, cursor?: string, userIdentity?: string, nodeIdentity?: string): Promise<IDocumentList>;
|
|
119
|
+
query(documentId: string, cursor?: string, pageSize?: number, userIdentity?: string, nodeIdentity?: string): Promise<IAuditableItemGraphVertexList>;
|
|
78
120
|
}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
2
|
import type { UneceDocumentCodes } from "@twin.org/standards-unece";
|
|
3
3
|
/**
|
|
4
|
-
* Request to
|
|
4
|
+
* Request to create a document as an auditable item graph vertex.
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
7
|
-
/**
|
|
8
|
-
* The path parameters.
|
|
9
|
-
*/
|
|
10
|
-
pathParams: {
|
|
11
|
-
/**
|
|
12
|
-
* The id of the auditable item graph vertex to store the document on.
|
|
13
|
-
*/
|
|
14
|
-
auditableItemGraphId: string;
|
|
15
|
-
};
|
|
6
|
+
export interface IDocumentManagementCreateRequest {
|
|
16
7
|
/**
|
|
17
8
|
* The body parameters.
|
|
18
9
|
*/
|
|
@@ -38,8 +29,24 @@ export interface IDocumentManagementSetRequest {
|
|
|
38
29
|
*/
|
|
39
30
|
annotationObject?: IJsonLdNodeObject;
|
|
40
31
|
/**
|
|
41
|
-
*
|
|
32
|
+
* The auditable item graph vertices to connect the document to.
|
|
33
|
+
*/
|
|
34
|
+
auditableItemGraphEdges?: {
|
|
35
|
+
id: string;
|
|
36
|
+
addAlias?: boolean;
|
|
37
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
38
|
+
}[];
|
|
39
|
+
/**
|
|
40
|
+
* Flag to create an attestation for the document, defaults to false.
|
|
42
41
|
*/
|
|
43
42
|
createAttestation?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Flag to add the document id as an alias to the aig vertex, defaults to true.
|
|
45
|
+
*/
|
|
46
|
+
addAlias?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Annotation object for the alias.
|
|
49
|
+
*/
|
|
50
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
44
51
|
};
|
|
45
52
|
}
|
|
@@ -13,14 +13,10 @@ export interface IDocumentManagementGetRequest {
|
|
|
13
13
|
* The path parameters.
|
|
14
14
|
*/
|
|
15
15
|
pathParams: {
|
|
16
|
-
/**
|
|
17
|
-
* The id of the auditable item graph vertex to store the document on.
|
|
18
|
-
*/
|
|
19
|
-
auditableItemGraphId: string;
|
|
20
16
|
/**
|
|
21
17
|
* The full id of the document to get.
|
|
22
18
|
*/
|
|
23
|
-
|
|
19
|
+
auditableItemGraphDocumentId: string;
|
|
24
20
|
};
|
|
25
21
|
/**
|
|
26
22
|
* The query parameters.
|
|
@@ -30,30 +26,38 @@ export interface IDocumentManagementGetRequest {
|
|
|
30
26
|
* Include the blob storage metadata in the response.
|
|
31
27
|
* @default false
|
|
32
28
|
*/
|
|
33
|
-
includeBlobStorageMetadata?: boolean;
|
|
29
|
+
includeBlobStorageMetadata?: boolean | string;
|
|
34
30
|
/**
|
|
35
31
|
* Include the blob storage data in the response.
|
|
36
32
|
* @default false
|
|
37
33
|
*/
|
|
38
|
-
includeBlobStorageData?: boolean;
|
|
34
|
+
includeBlobStorageData?: boolean | string;
|
|
39
35
|
/**
|
|
40
36
|
* Include the attestation information in the response.
|
|
41
37
|
* @default false
|
|
42
38
|
*/
|
|
43
|
-
includeAttestation?: boolean;
|
|
39
|
+
includeAttestation?: boolean | string;
|
|
44
40
|
/**
|
|
45
41
|
* Include deleted documents in the response.
|
|
46
42
|
* @default false
|
|
47
43
|
*/
|
|
48
|
-
includeRemoved?: boolean;
|
|
44
|
+
includeRemoved?: boolean | string;
|
|
45
|
+
/**
|
|
46
|
+
* If provided will extract data from the document using the specified rule group id.
|
|
47
|
+
*/
|
|
48
|
+
extractRuleGroupId?: string;
|
|
49
|
+
/**
|
|
50
|
+
* By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
51
|
+
*/
|
|
52
|
+
extractMimeType?: string;
|
|
49
53
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @default
|
|
54
|
+
* Page size of items to return, defaults to 1 so only most recent is returned.
|
|
55
|
+
* @default 1
|
|
52
56
|
*/
|
|
53
|
-
|
|
57
|
+
pageSize?: number | string;
|
|
54
58
|
/**
|
|
55
59
|
* The cursor to get the next chunk of revisions.
|
|
56
60
|
*/
|
|
57
|
-
|
|
61
|
+
cursor?: string;
|
|
58
62
|
};
|
|
59
63
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
2
|
-
import type {
|
|
2
|
+
import type { IDocumentList } from "../IDocumentList";
|
|
3
3
|
/**
|
|
4
4
|
* Response to get a document and optionally revisions from an auditable item graph vertex.
|
|
5
5
|
*/
|
|
@@ -13,5 +13,5 @@ export interface IDocumentManagementGetResponse {
|
|
|
13
13
|
/**
|
|
14
14
|
* The body parameters.
|
|
15
15
|
*/
|
|
16
|
-
body:
|
|
16
|
+
body: IDocumentList;
|
|
17
17
|
}
|
|
@@ -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 | string;
|
|
34
|
+
/**
|
|
35
|
+
* Include the blob storage data in the response.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
includeBlobStorageData?: boolean | string;
|
|
39
|
+
/**
|
|
40
|
+
* Include the attestation information in the response.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
includeAttestation?: boolean | string;
|
|
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
|
+
}
|
|
@@ -9,36 +9,21 @@ export interface IDocumentManagementQueryRequest {
|
|
|
9
9
|
headers?: {
|
|
10
10
|
[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
|
|
11
11
|
};
|
|
12
|
-
/**
|
|
13
|
-
* The path parameters.
|
|
14
|
-
*/
|
|
15
|
-
pathParams: {
|
|
16
|
-
/**
|
|
17
|
-
* The id of the auditable item graph vertex which contains the documents.
|
|
18
|
-
*/
|
|
19
|
-
auditableItemGraphId: string;
|
|
20
|
-
};
|
|
21
12
|
/**
|
|
22
13
|
* The query parameters.
|
|
23
14
|
*/
|
|
24
|
-
query
|
|
15
|
+
query: {
|
|
25
16
|
/**
|
|
26
|
-
*
|
|
17
|
+
* The id of the document id we are trying to find.
|
|
27
18
|
*/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Include deleted documents in the response.
|
|
31
|
-
* @default false
|
|
32
|
-
*/
|
|
33
|
-
includeRemoved?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Include the most recent 5 revisions, use the individual get to retrieve more.
|
|
36
|
-
* @default false
|
|
37
|
-
*/
|
|
38
|
-
includeMostRecentRevisions?: boolean;
|
|
19
|
+
documentId: string;
|
|
39
20
|
/**
|
|
40
21
|
* The cursor to get the next chunk of documents.
|
|
41
22
|
*/
|
|
42
23
|
cursor?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The number of documents to return.
|
|
26
|
+
*/
|
|
27
|
+
pageSize?: number | string;
|
|
43
28
|
};
|
|
44
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { IAuditableItemGraphVertexList } from "@twin.org/auditable-item-graph-models";
|
|
1
2
|
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
2
|
-
import type { IDocumentList } from "../IDocumentList";
|
|
3
3
|
/**
|
|
4
4
|
* Response to query the documents from an auditable item graph vertex.
|
|
5
5
|
*/
|
|
@@ -13,5 +13,5 @@ export interface IDocumentManagementQueryResponse {
|
|
|
13
13
|
/**
|
|
14
14
|
* The body parameters.
|
|
15
15
|
*/
|
|
16
|
-
body:
|
|
16
|
+
body: IAuditableItemGraphVertexList;
|
|
17
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Request to remove a document from an auditable item graph.
|
|
2
|
+
* Request to remove a document revision from an auditable item graph.
|
|
3
3
|
*/
|
|
4
4
|
export interface IDocumentManagementRemoveRequest {
|
|
5
5
|
/**
|
|
@@ -7,22 +7,12 @@ export interface IDocumentManagementRemoveRequest {
|
|
|
7
7
|
*/
|
|
8
8
|
pathParams: {
|
|
9
9
|
/**
|
|
10
|
-
* The id of the auditable item graph vertex to remove the
|
|
10
|
+
* The id of the auditable item graph vertex to remove the revision from.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
auditableItemGraphDocumentId: string;
|
|
13
13
|
/**
|
|
14
|
-
* The
|
|
14
|
+
* The revision of the document to remove.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* The query parameters.
|
|
20
|
-
*/
|
|
21
|
-
query?: {
|
|
22
|
-
/**
|
|
23
|
-
* Flag to remove all revisions of the document.
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
removeAllRevisions?: boolean;
|
|
16
|
+
revision: string;
|
|
27
17
|
};
|
|
28
18
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
+
/**
|
|
3
|
+
* Request to update a document as an auditable item graph vertex.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDocumentManagementUpdateRequest {
|
|
6
|
+
/**
|
|
7
|
+
* The path parameters.
|
|
8
|
+
*/
|
|
9
|
+
pathParams: {
|
|
10
|
+
/**
|
|
11
|
+
* The full id of the document to get.
|
|
12
|
+
*/
|
|
13
|
+
auditableItemGraphDocumentId: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The body parameters.
|
|
17
|
+
*/
|
|
18
|
+
body: {
|
|
19
|
+
/**
|
|
20
|
+
* The data to create the document with, in base64.
|
|
21
|
+
*/
|
|
22
|
+
blob?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Additional information to associate with the document.
|
|
25
|
+
*/
|
|
26
|
+
annotationObject?: IJsonLdNodeObject;
|
|
27
|
+
/**
|
|
28
|
+
* The auditable item graph vertices to connect the document to.
|
|
29
|
+
*/
|
|
30
|
+
auditableItemGraphEdges?: {
|
|
31
|
+
id: string;
|
|
32
|
+
addAlias?: boolean;
|
|
33
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contexts of document management objects.
|
|
3
|
+
*/
|
|
4
|
+
export declare const DocumentContexts: {
|
|
5
|
+
/**
|
|
6
|
+
* The context root for the document types.
|
|
7
|
+
*/
|
|
8
|
+
readonly ContextRoot: "https://schema.twindev.org/documents/";
|
|
9
|
+
/**
|
|
10
|
+
* The context root for the common types.
|
|
11
|
+
*/
|
|
12
|
+
readonly ContextRootCommon: "https://schema.twindev.org/common/";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The contexts of document management objects.
|
|
16
|
+
*/
|
|
17
|
+
export type DocumentContexts = (typeof DocumentContexts)[keyof typeof DocumentContexts];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The types of document management objects.
|
|
3
|
+
*/
|
|
4
|
+
export declare const DocumentTypes: {
|
|
5
|
+
/**
|
|
6
|
+
* Represents a document.
|
|
7
|
+
*/
|
|
8
|
+
readonly Document: "Document";
|
|
9
|
+
/**
|
|
10
|
+
* Represents a document attestation.
|
|
11
|
+
*/
|
|
12
|
+
readonly DocumentAttestation: "DocumentAttestation";
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The types of document management objects.
|
|
16
|
+
*/
|
|
17
|
+
export type DocumentTypes = (typeof DocumentTypes)[keyof typeof DocumentTypes];
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,108 @@
|
|
|
1
1
|
# @twin.org/document-management-models - Changelog
|
|
2
2
|
|
|
3
|
-
## v0.0.1-next.
|
|
3
|
+
## [0.0.1-next.20](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.19...document-management-models-v0.0.1-next.20) (2025-06-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* data type registration use fully qualified names ([18d27d0](https://github.com/twinfoundation/document-management/commit/18d27d0c21d0f652b7df4b409bb2d3c66cf22f84))
|
|
9
|
+
* document get can perform extraction ([#6](https://github.com/twinfoundation/document-management/issues/6)) ([5ce6d37](https://github.com/twinfoundation/document-management/commit/5ce6d37432ad271ca5783f422846f4be98ec2215))
|
|
10
|
+
* get document revision ([080eddc](https://github.com/twinfoundation/document-management/commit/080eddcc024c622dda6bb36f60f5fa80a86cf5bb))
|
|
11
|
+
* improve comments ([4d2f094](https://github.com/twinfoundation/document-management/commit/4d2f094b23e3320cb739917246c1ee5f6ad41c11))
|
|
12
|
+
* store document as a vertex ([#2](https://github.com/twinfoundation/document-management/issues/2)) ([7febedc](https://github.com/twinfoundation/document-management/commit/7febedc3fb31de9c19565d6326341046834f2c74))
|
|
13
|
+
* update dependencies ([f9d8641](https://github.com/twinfoundation/document-management/commit/f9d86417dba24027699225ec7473296e361dcb00))
|
|
14
|
+
* update ts-to-schema generation ([01a5335](https://github.com/twinfoundation/document-management/commit/01a5335372f6a4764a74d56c446d669724a308aa))
|
|
15
|
+
* use standard list json ld types ([20ea04b](https://github.com/twinfoundation/document-management/commit/20ea04b05fd4bc4fcedce8f66958942c3c2fa303))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* query params force coercion ([d667d0f](https://github.com/twinfoundation/document-management/commit/d667d0f195accca2887a5ca732e9790063763996))
|
|
21
|
+
|
|
22
|
+
## [0.0.1-next.19](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.18...document-management-models-v0.0.1-next.19) (2025-06-20)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* query params force coercion ([d667d0f](https://github.com/twinfoundation/document-management/commit/d667d0f195accca2887a5ca732e9790063763996))
|
|
28
|
+
|
|
29
|
+
## [0.0.1-next.18](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.17...document-management-models-v0.0.1-next.18) (2025-06-18)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Miscellaneous Chores
|
|
33
|
+
|
|
34
|
+
* **document-management-models:** Synchronize repo versions
|
|
35
|
+
|
|
36
|
+
## [0.0.1-next.17](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.16...document-management-models-v0.0.1-next.17) (2025-06-12)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* update dependencies ([f9d8641](https://github.com/twinfoundation/document-management/commit/f9d86417dba24027699225ec7473296e361dcb00))
|
|
42
|
+
|
|
43
|
+
## [0.0.1-next.16](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.15...document-management-models-v0.0.1-next.16) (2025-06-03)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Features
|
|
47
|
+
|
|
48
|
+
* update ts-to-schema generation ([01a5335](https://github.com/twinfoundation/document-management/commit/01a5335372f6a4764a74d56c446d669724a308aa))
|
|
49
|
+
|
|
50
|
+
## [0.0.1-next.15](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.14...document-management-models-v0.0.1-next.15) (2025-05-28)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Features
|
|
54
|
+
|
|
55
|
+
* data type registration use fully qualified names ([18d27d0](https://github.com/twinfoundation/document-management/commit/18d27d0c21d0f652b7df4b409bb2d3c66cf22f84))
|
|
56
|
+
|
|
57
|
+
## [0.0.1-next.14](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.13...document-management-models-v0.0.1-next.14) (2025-05-08)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Features
|
|
61
|
+
|
|
62
|
+
* use standard list json ld types ([20ea04b](https://github.com/twinfoundation/document-management/commit/20ea04b05fd4bc4fcedce8f66958942c3c2fa303))
|
|
63
|
+
|
|
64
|
+
## [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)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
### Miscellaneous Chores
|
|
68
|
+
|
|
69
|
+
* **document-management-models:** Synchronize repo versions
|
|
70
|
+
|
|
71
|
+
## [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)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Features
|
|
75
|
+
|
|
76
|
+
* get document revision ([080eddc](https://github.com/twinfoundation/document-management/commit/080eddcc024c622dda6bb36f60f5fa80a86cf5bb))
|
|
77
|
+
|
|
78
|
+
## [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)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### Features
|
|
82
|
+
|
|
83
|
+
* document get can perform extraction ([#6](https://github.com/twinfoundation/document-management/issues/6)) ([5ce6d37](https://github.com/twinfoundation/document-management/commit/5ce6d37432ad271ca5783f422846f4be98ec2215))
|
|
84
|
+
|
|
85
|
+
## [0.0.1-next.10](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.9...document-management-models-v0.0.1-next.10) (2025-04-25)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
### Miscellaneous Chores
|
|
89
|
+
|
|
90
|
+
* **document-management-models:** Synchronize repo versions
|
|
91
|
+
|
|
92
|
+
## [0.0.1-next.9](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.8...document-management-models-v0.0.1-next.9) (2025-04-17)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Features
|
|
96
|
+
|
|
97
|
+
* store document as a vertex ([#2](https://github.com/twinfoundation/document-management/issues/2)) ([7febedc](https://github.com/twinfoundation/document-management/commit/7febedc3fb31de9c19565d6326341046834f2c74))
|
|
98
|
+
|
|
99
|
+
## [0.0.1-next.8](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.1-next.7...document-management-models-v0.0.1-next.8) (2025-03-28)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
### Features
|
|
103
|
+
|
|
104
|
+
* improve comments ([4d2f094](https://github.com/twinfoundation/document-management/commit/4d2f094b23e3320cb739917246c1ee5f6ad41c11))
|
|
105
|
+
|
|
106
|
+
## v0.0.1-next.7
|
|
4
107
|
|
|
5
108
|
- Initial Release
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Class: DocumentManagementDataTypes
|
|
2
|
+
|
|
3
|
+
Handle all the data types for document management.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new DocumentManagementDataTypes**(): `DocumentManagementDataTypes`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`DocumentManagementDataTypes`
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### registerTypes()
|
|
18
|
+
|
|
19
|
+
> `static` **registerTypes**(): `void`
|
|
20
|
+
|
|
21
|
+
Register all the data types.
|
|
22
|
+
|
|
23
|
+
#### Returns
|
|
24
|
+
|
|
25
|
+
`void`
|