@twin.org/document-management-models 0.0.1-next.1 → 0.0.1-next.10
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 +17 -3
- package/dist/esm/index.mjs +17 -4
- package/dist/types/index.d.ts +5 -2
- package/dist/types/models/IDocument.d.ts +10 -9
- package/dist/types/models/IDocumentAttestation.d.ts +41 -0
- package/dist/types/models/IDocumentList.d.ts +9 -4
- package/dist/types/models/IDocumentManagementComponent.d.ts +50 -34
- package/dist/types/models/api/{IDocumentManagementSetRequest.d.ts → IDocumentManagementCreateRequest.d.ts} +19 -12
- package/dist/types/models/api/IDocumentManagementGetRequest.d.ts +5 -9
- package/dist/types/models/api/IDocumentManagementGetResponse.d.ts +2 -2
- 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/{documentDataTypes.d.ts → documentTypes.d.ts} +4 -8
- package/docs/changelog.md +22 -1
- package/docs/reference/index.md +5 -1
- package/docs/reference/interfaces/IDocument.md +6 -6
- package/docs/reference/interfaces/IDocumentAttestation.md +59 -0
- package/docs/reference/interfaces/IDocumentList.md +9 -1
- package/docs/reference/interfaces/IDocumentManagementComponent.md +110 -72
- package/docs/reference/interfaces/{IDocumentManagementSetRequest.md → IDocumentManagementCreateRequest.md} +21 -17
- package/docs/reference/interfaces/IDocumentManagementGetRequest.md +8 -14
- package/docs/reference/interfaces/IDocumentManagementGetResponse.md +1 -1
- 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 +6 -12
- package/package.json +2 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
// Copyright 2024 IOTA Stiftung.
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0.
|
|
5
5
|
/**
|
|
6
|
-
* The
|
|
6
|
+
* The contexts of document management objects.
|
|
7
7
|
*/
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
|
-
const
|
|
9
|
+
const DocumentContexts = {
|
|
10
10
|
/**
|
|
11
11
|
* The context root for the document types.
|
|
12
12
|
*/
|
|
@@ -14,15 +14,29 @@ const DocumentTypes = {
|
|
|
14
14
|
/**
|
|
15
15
|
* The context root for the common types.
|
|
16
16
|
*/
|
|
17
|
-
ContextRootCommon: "https://schema.twindev.org/common/"
|
|
17
|
+
ContextRootCommon: "https://schema.twindev.org/common/"
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Copyright 2024 IOTA Stiftung.
|
|
21
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
22
|
+
/**
|
|
23
|
+
* The types of document management objects.
|
|
24
|
+
*/
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
26
|
+
const DocumentTypes = {
|
|
18
27
|
/**
|
|
19
28
|
* Represents a document.
|
|
20
29
|
*/
|
|
21
30
|
Document: "Document",
|
|
31
|
+
/**
|
|
32
|
+
* Represents a document attestation.
|
|
33
|
+
*/
|
|
34
|
+
DocumentAttestation: "DocumentAttestation",
|
|
22
35
|
/**
|
|
23
36
|
* Represents a document list.
|
|
24
37
|
*/
|
|
25
38
|
DocumentList: "DocumentList"
|
|
26
39
|
};
|
|
27
40
|
|
|
41
|
+
exports.DocumentContexts = DocumentContexts;
|
|
28
42
|
exports.DocumentTypes = DocumentTypes;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
4
|
+
* The contexts of document management objects.
|
|
5
5
|
*/
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
-
const
|
|
7
|
+
const DocumentContexts = {
|
|
8
8
|
/**
|
|
9
9
|
* The context root for the document types.
|
|
10
10
|
*/
|
|
@@ -12,15 +12,28 @@ const DocumentTypes = {
|
|
|
12
12
|
/**
|
|
13
13
|
* The context root for the common types.
|
|
14
14
|
*/
|
|
15
|
-
ContextRootCommon: "https://schema.twindev.org/common/"
|
|
15
|
+
ContextRootCommon: "https://schema.twindev.org/common/"
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// Copyright 2024 IOTA Stiftung.
|
|
19
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
20
|
+
/**
|
|
21
|
+
* The types of document management objects.
|
|
22
|
+
*/
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
24
|
+
const DocumentTypes = {
|
|
16
25
|
/**
|
|
17
26
|
* Represents a document.
|
|
18
27
|
*/
|
|
19
28
|
Document: "Document",
|
|
29
|
+
/**
|
|
30
|
+
* Represents a document attestation.
|
|
31
|
+
*/
|
|
32
|
+
DocumentAttestation: "DocumentAttestation",
|
|
20
33
|
/**
|
|
21
34
|
* Represents a document list.
|
|
22
35
|
*/
|
|
23
36
|
DocumentList: "DocumentList"
|
|
24
37
|
};
|
|
25
38
|
|
|
26
|
-
export { DocumentTypes };
|
|
39
|
+
export { DocumentContexts, DocumentTypes };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
export * from "./models/api/IDocumentManagementCreateRequest";
|
|
1
2
|
export * from "./models/api/IDocumentManagementGetRequest";
|
|
2
3
|
export * from "./models/api/IDocumentManagementGetResponse";
|
|
3
4
|
export * from "./models/api/IDocumentManagementQueryRequest";
|
|
4
5
|
export * from "./models/api/IDocumentManagementQueryResponse";
|
|
5
6
|
export * from "./models/api/IDocumentManagementRemoveRequest";
|
|
6
|
-
export * from "./models/api/
|
|
7
|
-
export * from "./models/
|
|
7
|
+
export * from "./models/api/IDocumentManagementUpdateRequest";
|
|
8
|
+
export * from "./models/documentContexts";
|
|
9
|
+
export * from "./models/documentTypes";
|
|
8
10
|
export * from "./models/IDocument";
|
|
11
|
+
export * from "./models/IDocumentAttestation";
|
|
9
12
|
export * from "./models/IDocumentList";
|
|
10
13
|
export * from "./models/IDocumentManagementComponent";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { IAttestationInformation } from "@twin.org/attestation-models";
|
|
2
2
|
import type { IBlobStorageEntry } from "@twin.org/blob-storage-models";
|
|
3
3
|
import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
4
|
-
import type {
|
|
4
|
+
import type { SchemaOrgContexts } from "@twin.org/standards-schema-org";
|
|
5
5
|
import type { UneceDocumentCodes } from "@twin.org/standards-unece";
|
|
6
|
-
import type {
|
|
6
|
+
import type { DocumentContexts } from "./documentContexts";
|
|
7
|
+
import type { DocumentTypes } from "./documentTypes";
|
|
7
8
|
/**
|
|
8
9
|
* Interface describing a document.
|
|
9
10
|
*/
|
|
@@ -12,9 +13,9 @@ export interface IDocument {
|
|
|
12
13
|
* JSON-LD Context.
|
|
13
14
|
*/
|
|
14
15
|
"@context": [
|
|
15
|
-
typeof
|
|
16
|
-
typeof
|
|
17
|
-
typeof
|
|
16
|
+
typeof DocumentContexts.ContextRoot,
|
|
17
|
+
typeof DocumentContexts.ContextRootCommon,
|
|
18
|
+
typeof SchemaOrgContexts.ContextRoot,
|
|
18
19
|
...IJsonLdContextDefinitionElement[]
|
|
19
20
|
];
|
|
20
21
|
/**
|
|
@@ -78,11 +79,11 @@ export interface IDocument {
|
|
|
78
79
|
*/
|
|
79
80
|
dateDeleted?: string;
|
|
80
81
|
/**
|
|
81
|
-
* The
|
|
82
|
+
* The node which added the document to the graph.
|
|
82
83
|
*/
|
|
83
|
-
|
|
84
|
+
nodeIdentity: string;
|
|
84
85
|
/**
|
|
85
|
-
* The
|
|
86
|
+
* The user who added the document to the graph.
|
|
86
87
|
*/
|
|
87
|
-
|
|
88
|
+
userIdentity: string;
|
|
88
89
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { SchemaOrgContexts } from "@twin.org/standards-schema-org";
|
|
2
|
+
import type { UneceDocumentCodes } from "@twin.org/standards-unece";
|
|
3
|
+
import type { DocumentContexts } from "./documentContexts";
|
|
4
|
+
import type { DocumentTypes } from "./documentTypes";
|
|
5
|
+
/**
|
|
6
|
+
* Interface describing a document attestation.
|
|
7
|
+
*/
|
|
8
|
+
export interface IDocumentAttestation {
|
|
9
|
+
/**
|
|
10
|
+
* JSON-LD Context.
|
|
11
|
+
*/
|
|
12
|
+
"@context": [
|
|
13
|
+
typeof DocumentContexts.ContextRoot,
|
|
14
|
+
typeof DocumentContexts.ContextRootCommon,
|
|
15
|
+
typeof SchemaOrgContexts.ContextRoot
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* JSON-LD Type.
|
|
19
|
+
*/
|
|
20
|
+
type: typeof DocumentTypes.DocumentAttestation;
|
|
21
|
+
/**
|
|
22
|
+
* The id of the document.
|
|
23
|
+
*/
|
|
24
|
+
documentId: string;
|
|
25
|
+
/**
|
|
26
|
+
* The code for the document type.
|
|
27
|
+
*/
|
|
28
|
+
documentCode: UneceDocumentCodes;
|
|
29
|
+
/**
|
|
30
|
+
* The revision of the document as a 0 based index.
|
|
31
|
+
*/
|
|
32
|
+
documentRevision: number;
|
|
33
|
+
/**
|
|
34
|
+
* The date/time of when the document was created.
|
|
35
|
+
*/
|
|
36
|
+
dateCreated: string;
|
|
37
|
+
/**
|
|
38
|
+
* The hash of the document being attested.
|
|
39
|
+
*/
|
|
40
|
+
blobHash: string;
|
|
41
|
+
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DocumentContexts } from "./documentContexts";
|
|
3
|
+
import type { DocumentTypes } from "./documentTypes";
|
|
3
4
|
import type { IDocument } from "./IDocument";
|
|
4
5
|
/**
|
|
5
|
-
* Interface describing a document
|
|
6
|
+
* Interface describing a list of document entries.
|
|
6
7
|
*/
|
|
7
8
|
export interface IDocumentList {
|
|
8
9
|
/**
|
|
9
10
|
* JSON-LD Context.
|
|
10
11
|
*/
|
|
11
12
|
"@context": [
|
|
12
|
-
typeof
|
|
13
|
-
typeof
|
|
13
|
+
typeof DocumentContexts.ContextRoot,
|
|
14
|
+
typeof DocumentContexts.ContextRootCommon,
|
|
14
15
|
...IJsonLdContextDefinitionElement[]
|
|
15
16
|
];
|
|
16
17
|
/**
|
|
@@ -21,6 +22,10 @@ export interface IDocumentList {
|
|
|
21
22
|
* The list of documents.
|
|
22
23
|
*/
|
|
23
24
|
documents: IDocument[];
|
|
25
|
+
/**
|
|
26
|
+
* The ids of the other vertices which are connected to the document.
|
|
27
|
+
*/
|
|
28
|
+
edges?: string[];
|
|
24
29
|
/**
|
|
25
30
|
* The cursor to get the next chunk of documents.
|
|
26
31
|
*/
|
|
@@ -1,78 +1,94 @@
|
|
|
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";
|
|
4
|
-
import type { IDocument } from "./IDocument";
|
|
5
5
|
import type { IDocumentList } from "./IDocumentList";
|
|
6
6
|
/**
|
|
7
7
|
* Interface describing an document management contract.
|
|
8
8
|
*/
|
|
9
9
|
export interface IDocumentManagementComponent extends IComponent {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Create a document as an auditable item graph vertex and add its content to blob storage.
|
|
12
12
|
* If the document id already exists and the blob data is different a new revision will be created.
|
|
13
13
|
* 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
14
|
* @param documentId The document id to create.
|
|
16
15
|
* @param documentIdFormat The format of the document identifier.
|
|
17
16
|
* @param documentCode The code for the document type.
|
|
18
17
|
* @param blob The data to create the document with.
|
|
19
18
|
* @param annotationObject Additional information to associate with the document.
|
|
20
|
-
* @param
|
|
19
|
+
* @param auditableItemGraphEdges The auditable item graph vertices to connect the document to.
|
|
20
|
+
* @param options Additional options for the set operation.
|
|
21
|
+
* @param options.createAttestation Flag to create an attestation for the document, defaults to false.
|
|
22
|
+
* @param options.addAlias Flag to add the document id as an alias to the aig vertex, defaults to true.
|
|
23
|
+
* @param options.aliasAnnotationObject Annotation object for the alias.
|
|
21
24
|
* @param userIdentity The identity to perform the auditable item graph operation with.
|
|
22
25
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
23
|
-
* @returns The
|
|
26
|
+
* @returns The auditable item graph vertex created for the document including its revision.
|
|
24
27
|
*/
|
|
25
|
-
|
|
28
|
+
create(documentId: string, documentIdFormat: string | undefined, documentCode: UneceDocumentCodes, blob: Uint8Array, annotationObject?: IJsonLdNodeObject, auditableItemGraphEdges?: {
|
|
29
|
+
id: string;
|
|
30
|
+
addAlias?: boolean;
|
|
31
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
32
|
+
}[], options?: {
|
|
33
|
+
createAttestation?: boolean;
|
|
34
|
+
addAlias?: boolean;
|
|
35
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
36
|
+
}, userIdentity?: string, nodeIdentity?: string): Promise<string>;
|
|
26
37
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
38
|
+
* Update a document as an auditable item graph vertex and add its content to blob storage.
|
|
39
|
+
* If the blob data is different a new revision will be created.
|
|
40
|
+
* For any other changes the current revision will be updated.
|
|
41
|
+
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
42
|
+
* @param blob The data to update the document with.
|
|
43
|
+
* @param annotationObject Additional information to associate with the document.
|
|
44
|
+
* @param auditableItemGraphEdges The auditable item graph vertices to connect the document to, if undefined retains current connections.
|
|
45
|
+
* @param userIdentity The identity to perform the auditable item graph operation with.
|
|
46
|
+
* @param nodeIdentity The node identity to use for vault operations.
|
|
47
|
+
* @returns Nothing.
|
|
48
|
+
*/
|
|
49
|
+
update(auditableItemGraphDocumentId: string, blob?: Uint8Array, annotationObject?: IJsonLdNodeObject, auditableItemGraphEdges?: {
|
|
50
|
+
id: string;
|
|
51
|
+
addAlias?: boolean;
|
|
52
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
53
|
+
}[], userIdentity?: string, nodeIdentity?: string): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Get a document using it's auditable item graph vertex id and optional revision.
|
|
56
|
+
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
30
57
|
* @param options Additional options for the get operation.
|
|
31
58
|
* @param options.includeBlobStorageMetadata Flag to include the blob storage metadata for the document, defaults to false.
|
|
32
59
|
* @param options.includeBlobStorageData Flag to include the blob storage data for the document, defaults to false.
|
|
33
60
|
* @param options.includeAttestation Flag to include the attestation information for the document, defaults to false.
|
|
34
61
|
* @param options.includeRemoved Flag to include deleted documents, defaults to false.
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
62
|
+
* @param cursor The cursor to get the next chunk of revisions.
|
|
63
|
+
* @param pageSize Page size of items to return, defaults to 1 so only most recent is returned.
|
|
37
64
|
* @param userIdentity The identity to perform the auditable item graph operation with.
|
|
38
65
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
39
66
|
* @returns The documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.
|
|
40
67
|
*/
|
|
41
|
-
get(
|
|
68
|
+
get(auditableItemGraphDocumentId: string, options?: {
|
|
42
69
|
includeBlobStorageMetadata?: boolean;
|
|
43
70
|
includeBlobStorageData?: boolean;
|
|
44
71
|
includeAttestation?: boolean;
|
|
45
72
|
includeRemoved?: boolean;
|
|
46
|
-
|
|
47
|
-
}, revisionCursor?: string, userIdentity?: string, nodeIdentity?: string): Promise<IDocument>;
|
|
73
|
+
}, cursor?: string, pageSize?: number, userIdentity?: string, nodeIdentity?: string): Promise<IDocumentList>;
|
|
48
74
|
/**
|
|
49
|
-
* Remove
|
|
50
|
-
* The
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param options Additional options for the remove operation.
|
|
54
|
-
* @param options.removeAllRevisions Flag to remove all revisions of the document, defaults to false.
|
|
75
|
+
* Remove an auditable item graph vertex using it's id.
|
|
76
|
+
* The document dateDeleted will be set, but can still be queried with the includeRemoved flag.
|
|
77
|
+
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
78
|
+
* @param revision The revision of the document to remove.
|
|
55
79
|
* @param userIdentity The identity to perform the auditable item graph operation with.
|
|
56
80
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
57
81
|
* @returns Nothing.
|
|
58
82
|
*/
|
|
59
|
-
|
|
60
|
-
removeAllRevisions?: boolean;
|
|
61
|
-
}, userIdentity?: string, nodeIdentity?: string): Promise<void>;
|
|
83
|
+
removeRevision(auditableItemGraphDocumentId: string, revision: number, userIdentity?: string, nodeIdentity?: string): Promise<void>;
|
|
62
84
|
/**
|
|
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.
|
|
85
|
+
* Find all the document with a specific id.
|
|
86
|
+
* @param documentId The document id to find in the graph.
|
|
69
87
|
* @param cursor The cursor to get the next chunk of documents.
|
|
88
|
+
* @param pageSize The page size to get the next chunk of documents.
|
|
70
89
|
* @param userIdentity The identity to perform the auditable item graph operation with.
|
|
71
90
|
* @param nodeIdentity The node identity to use for vault operations.
|
|
72
|
-
* @returns The
|
|
91
|
+
* @returns The graph vertices that contain documents referencing the specified document id.
|
|
73
92
|
*/
|
|
74
|
-
query(
|
|
75
|
-
includeMostRecentRevisions?: boolean;
|
|
76
|
-
includeRemoved?: boolean;
|
|
77
|
-
}, cursor?: string, userIdentity?: string, nodeIdentity?: string): Promise<IDocumentList>;
|
|
93
|
+
query(documentId: string, cursor?: string, pageSize?: number, userIdentity?: string, nodeIdentity?: string): Promise<IAuditableItemGraphVertexList>;
|
|
78
94
|
}
|
|
@@ -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.
|
|
@@ -47,13 +43,13 @@ export interface IDocumentManagementGetRequest {
|
|
|
47
43
|
*/
|
|
48
44
|
includeRemoved?: boolean;
|
|
49
45
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @default
|
|
46
|
+
* Page size of items to return, defaults to 1 so only most recent is returned.
|
|
47
|
+
* @default 1
|
|
52
48
|
*/
|
|
53
|
-
|
|
49
|
+
pageSize?: string;
|
|
54
50
|
/**
|
|
55
51
|
* The cursor to get the next chunk of revisions.
|
|
56
52
|
*/
|
|
57
|
-
|
|
53
|
+
cursor?: string;
|
|
58
54
|
};
|
|
59
55
|
}
|
|
@@ -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
|
}
|
|
@@ -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?: 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];
|
|
@@ -2,18 +2,14 @@
|
|
|
2
2
|
* The types of document management objects.
|
|
3
3
|
*/
|
|
4
4
|
export declare const DocumentTypes: {
|
|
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
5
|
/**
|
|
14
6
|
* Represents a document.
|
|
15
7
|
*/
|
|
16
8
|
readonly Document: "Document";
|
|
9
|
+
/**
|
|
10
|
+
* Represents a document attestation.
|
|
11
|
+
*/
|
|
12
|
+
readonly DocumentAttestation: "DocumentAttestation";
|
|
17
13
|
/**
|
|
18
14
|
* Represents a document list.
|
|
19
15
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @twin.org/document-management-models - Changelog
|
|
2
2
|
|
|
3
|
-
## v0.0.1-next.1
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **document-management-models:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
## [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)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
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
|
+
|
|
17
|
+
## [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* improve comments ([4d2f094](https://github.com/twinfoundation/document-management/commit/4d2f094b23e3320cb739917246c1ee5f6ad41c11))
|
|
23
|
+
|
|
24
|
+
## v0.0.1-next.7
|
|
4
25
|
|
|
5
26
|
- Initial Release
|