@twin.org/document-management-models 0.0.1-next.2 → 0.0.1-next.4
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 +4 -0
- package/dist/esm/index.mjs +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/IDocument.d.ts +8 -0
- package/dist/types/models/IDocumentAttestation.d.ts +40 -0
- package/dist/types/models/IDocumentManagementComponent.d.ts +9 -2
- package/dist/types/models/api/IDocumentManagementSetRequest.d.ts +8 -0
- package/dist/types/models/documentDataTypes.d.ts +4 -0
- package/docs/changelog.md +1 -1
- package/docs/reference/index.md +1 -0
- package/docs/reference/interfaces/IDocument.md +16 -0
- package/docs/reference/interfaces/IDocumentAttestation.md +59 -0
- package/docs/reference/interfaces/IDocumentManagementComponent.md +18 -2
- package/docs/reference/interfaces/IDocumentManagementSetRequest.md +12 -0
- package/docs/reference/variables/DocumentTypes.md +6 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
package/dist/esm/index.mjs
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -6,5 +6,6 @@ export * from "./models/api/IDocumentManagementRemoveRequest";
|
|
|
6
6
|
export * from "./models/api/IDocumentManagementSetRequest";
|
|
7
7
|
export * from "./models/documentDataTypes";
|
|
8
8
|
export * from "./models/IDocument";
|
|
9
|
+
export * from "./models/IDocumentAttestation";
|
|
9
10
|
export * from "./models/IDocumentList";
|
|
10
11
|
export * from "./models/IDocumentManagementComponent";
|
|
@@ -77,6 +77,14 @@ export interface IDocument {
|
|
|
77
77
|
* The date/time of when the document was deleted, as we never actually remove items.
|
|
78
78
|
*/
|
|
79
79
|
dateDeleted?: string;
|
|
80
|
+
/**
|
|
81
|
+
* The node which added the document to the graph.
|
|
82
|
+
*/
|
|
83
|
+
nodeIdentity: string;
|
|
84
|
+
/**
|
|
85
|
+
* The user who added the document to the graph.
|
|
86
|
+
*/
|
|
87
|
+
userIdentity: string;
|
|
80
88
|
/**
|
|
81
89
|
* The previous revisions of the document.
|
|
82
90
|
*/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { SchemaOrgTypes } from "@twin.org/standards-schema-org";
|
|
2
|
+
import type { UneceDocumentCodes } from "@twin.org/standards-unece";
|
|
3
|
+
import type { DocumentTypes } from "./documentDataTypes";
|
|
4
|
+
/**
|
|
5
|
+
* Interface describing a document attestation.
|
|
6
|
+
*/
|
|
7
|
+
export interface IDocumentAttestation {
|
|
8
|
+
/**
|
|
9
|
+
* JSON-LD Context.
|
|
10
|
+
*/
|
|
11
|
+
"@context": [
|
|
12
|
+
typeof DocumentTypes.ContextRoot,
|
|
13
|
+
typeof DocumentTypes.ContextRootCommon,
|
|
14
|
+
typeof SchemaOrgTypes.ContextRoot
|
|
15
|
+
];
|
|
16
|
+
/**
|
|
17
|
+
* JSON-LD Type.
|
|
18
|
+
*/
|
|
19
|
+
type: typeof DocumentTypes.DocumentAttestation;
|
|
20
|
+
/**
|
|
21
|
+
* The id of the document.
|
|
22
|
+
*/
|
|
23
|
+
documentId: string;
|
|
24
|
+
/**
|
|
25
|
+
* The code for the document type.
|
|
26
|
+
*/
|
|
27
|
+
documentCode: UneceDocumentCodes;
|
|
28
|
+
/**
|
|
29
|
+
* The revision of the document as a 0 based index.
|
|
30
|
+
*/
|
|
31
|
+
documentRevision: number;
|
|
32
|
+
/**
|
|
33
|
+
* The date/time of when the document was created.
|
|
34
|
+
*/
|
|
35
|
+
dateCreated: string;
|
|
36
|
+
/**
|
|
37
|
+
* The hash of the document being attested.
|
|
38
|
+
*/
|
|
39
|
+
blobHash: string;
|
|
40
|
+
}
|
|
@@ -17,12 +17,19 @@ export interface IDocumentManagementComponent extends IComponent {
|
|
|
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 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.includeIdAsAlias Include the document id as an alias to the aig vertex, defaults to false.
|
|
23
|
+
* @param options.aliasAnnotationObject Additional information to associate with 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
26
|
* @returns The identifier for the document which includes the auditable item graph identifier.
|
|
24
27
|
*/
|
|
25
|
-
set(auditableItemGraphId: string, documentId: string, documentIdFormat: string | undefined, documentCode: UneceDocumentCodes, blob: Uint8Array, annotationObject?: IJsonLdNodeObject,
|
|
28
|
+
set(auditableItemGraphId: string, documentId: string, documentIdFormat: string | undefined, documentCode: UneceDocumentCodes, blob: Uint8Array, annotationObject?: IJsonLdNodeObject, options?: {
|
|
29
|
+
createAttestation?: boolean;
|
|
30
|
+
includeIdAsAlias?: boolean;
|
|
31
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
32
|
+
}, userIdentity?: string, nodeIdentity?: string): Promise<string>;
|
|
26
33
|
/**
|
|
27
34
|
* Get a specific document from an auditable item graph vertex.
|
|
28
35
|
* @param auditableItemGraphId The auditable item graph vertex id to get the document from.
|
|
@@ -41,5 +41,13 @@ export interface IDocumentManagementSetRequest {
|
|
|
41
41
|
* Flag to create an attestation for the document, defaults to false
|
|
42
42
|
*/
|
|
43
43
|
createAttestation?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Include the document id as an alias to the aig vertex, defaults to false.
|
|
46
|
+
*/
|
|
47
|
+
includeIdAsAlias?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Additional information to associate with the alias.
|
|
50
|
+
*/
|
|
51
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
44
52
|
};
|
|
45
53
|
}
|
|
@@ -14,6 +14,10 @@ export declare const DocumentTypes: {
|
|
|
14
14
|
* Represents a document.
|
|
15
15
|
*/
|
|
16
16
|
readonly Document: "Document";
|
|
17
|
+
/**
|
|
18
|
+
* Represents a document attestation.
|
|
19
|
+
*/
|
|
20
|
+
readonly DocumentAttestation: "DocumentAttestation";
|
|
17
21
|
/**
|
|
18
22
|
* Represents a document list.
|
|
19
23
|
*/
|
package/docs/changelog.md
CHANGED
package/docs/reference/index.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
## Interfaces
|
|
4
4
|
|
|
5
5
|
- [IDocument](interfaces/IDocument.md)
|
|
6
|
+
- [IDocumentAttestation](interfaces/IDocumentAttestation.md)
|
|
6
7
|
- [IDocumentList](interfaces/IDocumentList.md)
|
|
7
8
|
- [IDocumentManagementComponent](interfaces/IDocumentManagementComponent.md)
|
|
8
9
|
- [IDocumentManagementGetRequest](interfaces/IDocumentManagementGetRequest.md)
|
|
@@ -132,6 +132,22 @@ The date/time of when the document was deleted, as we never actually remove item
|
|
|
132
132
|
|
|
133
133
|
***
|
|
134
134
|
|
|
135
|
+
### nodeIdentity
|
|
136
|
+
|
|
137
|
+
> **nodeIdentity**: `string`
|
|
138
|
+
|
|
139
|
+
The node which added the document to the graph.
|
|
140
|
+
|
|
141
|
+
***
|
|
142
|
+
|
|
143
|
+
### userIdentity
|
|
144
|
+
|
|
145
|
+
> **userIdentity**: `string`
|
|
146
|
+
|
|
147
|
+
The user who added the document to the graph.
|
|
148
|
+
|
|
149
|
+
***
|
|
150
|
+
|
|
135
151
|
### revisions?
|
|
136
152
|
|
|
137
153
|
> `optional` **revisions**: [`IDocument`](IDocument.md)[]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Interface: IDocumentAttestation
|
|
2
|
+
|
|
3
|
+
Interface describing a document attestation.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### @context
|
|
8
|
+
|
|
9
|
+
> **@context**: \[`"https://schema.twindev.org/documents/"`, `"https://schema.twindev.org/common/"`, `"https://schema.org"`\]
|
|
10
|
+
|
|
11
|
+
JSON-LD Context.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### type
|
|
16
|
+
|
|
17
|
+
> **type**: `"DocumentAttestation"`
|
|
18
|
+
|
|
19
|
+
JSON-LD Type.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### documentId
|
|
24
|
+
|
|
25
|
+
> **documentId**: `string`
|
|
26
|
+
|
|
27
|
+
The id of the document.
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### documentCode
|
|
32
|
+
|
|
33
|
+
> **documentCode**: `string`
|
|
34
|
+
|
|
35
|
+
The code for the document type.
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### documentRevision
|
|
40
|
+
|
|
41
|
+
> **documentRevision**: `number`
|
|
42
|
+
|
|
43
|
+
The revision of the document as a 0 based index.
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### dateCreated
|
|
48
|
+
|
|
49
|
+
> **dateCreated**: `string`
|
|
50
|
+
|
|
51
|
+
The date/time of when the document was created.
|
|
52
|
+
|
|
53
|
+
***
|
|
54
|
+
|
|
55
|
+
### blobHash
|
|
56
|
+
|
|
57
|
+
> **blobHash**: `string`
|
|
58
|
+
|
|
59
|
+
The hash of the document being attested.
|
|
@@ -10,7 +10,7 @@ Interface describing an document management contract.
|
|
|
10
10
|
|
|
11
11
|
### set()
|
|
12
12
|
|
|
13
|
-
> **set**(`auditableItemGraphId`, `documentId`, `documentIdFormat`, `documentCode`, `blob`, `annotationObject`?, `
|
|
13
|
+
> **set**(`auditableItemGraphId`, `documentId`, `documentIdFormat`, `documentCode`, `blob`, `annotationObject`?, `options`?, `userIdentity`?, `nodeIdentity`?): `Promise`\<`string`\>
|
|
14
14
|
|
|
15
15
|
Store a document in 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.
|
|
@@ -54,12 +54,28 @@ The data to create the document with.
|
|
|
54
54
|
|
|
55
55
|
Additional information to associate with the document.
|
|
56
56
|
|
|
57
|
-
#####
|
|
57
|
+
##### options?
|
|
58
|
+
|
|
59
|
+
Additional options for the set operation.
|
|
60
|
+
|
|
61
|
+
###### createAttestation?
|
|
58
62
|
|
|
59
63
|
`boolean`
|
|
60
64
|
|
|
61
65
|
Flag to create an attestation for the document, defaults to false.
|
|
62
66
|
|
|
67
|
+
###### includeIdAsAlias?
|
|
68
|
+
|
|
69
|
+
`boolean`
|
|
70
|
+
|
|
71
|
+
Include the document id as an alias to the aig vertex, defaults to false.
|
|
72
|
+
|
|
73
|
+
###### aliasAnnotationObject?
|
|
74
|
+
|
|
75
|
+
`IJsonLdNodeObject`
|
|
76
|
+
|
|
77
|
+
Additional information to associate with the alias.
|
|
78
|
+
|
|
63
79
|
##### userIdentity?
|
|
64
80
|
|
|
65
81
|
`string`
|
|
@@ -59,3 +59,15 @@ Additional information to associate with the document.
|
|
|
59
59
|
> `optional` **createAttestation**: `boolean`
|
|
60
60
|
|
|
61
61
|
Flag to create an attestation for the document, defaults to false
|
|
62
|
+
|
|
63
|
+
#### includeIdAsAlias?
|
|
64
|
+
|
|
65
|
+
> `optional` **includeIdAsAlias**: `boolean`
|
|
66
|
+
|
|
67
|
+
Include the document id as an alias to the aig vertex, defaults to false.
|
|
68
|
+
|
|
69
|
+
#### aliasAnnotationObject?
|
|
70
|
+
|
|
71
|
+
> `optional` **aliasAnnotationObject**: `IJsonLdNodeObject`
|
|
72
|
+
|
|
73
|
+
Additional information to associate with the alias.
|
|
@@ -24,6 +24,12 @@ The context root for the common types.
|
|
|
24
24
|
|
|
25
25
|
Represents a document.
|
|
26
26
|
|
|
27
|
+
### DocumentAttestation
|
|
28
|
+
|
|
29
|
+
> `readonly` **DocumentAttestation**: `"DocumentAttestation"` = `"DocumentAttestation"`
|
|
30
|
+
|
|
31
|
+
Represents a document attestation.
|
|
32
|
+
|
|
27
33
|
### DocumentList
|
|
28
34
|
|
|
29
35
|
> `readonly` **DocumentList**: `"DocumentList"` = `"DocumentList"`
|
package/package.json
CHANGED