@twin.org/document-management-rest-client 0.0.1-next.2 → 0.0.1-next.5
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
CHANGED
|
@@ -37,10 +37,13 @@ class DocumentManagementClient extends apiCore.BaseRestClient {
|
|
|
37
37
|
* @param documentCode The code for the document type.
|
|
38
38
|
* @param blob The data to create the document.
|
|
39
39
|
* @param annotationObject Additional information to associate with the document.
|
|
40
|
-
* @param
|
|
40
|
+
* @param options Additional options for the set operation.
|
|
41
|
+
* @param options.createAttestation Flag to create an attestation for the document, defaults to false.
|
|
42
|
+
* @param options.includeIdAsAlias Include the document id as an alias to the aig vertex, defaults to false.
|
|
43
|
+
* @param options.aliasAnnotationObject Additional information to associate with the alias.
|
|
41
44
|
* @returns The identifier for the document which includes the auditable item graph identifier.
|
|
42
45
|
*/
|
|
43
|
-
async set(auditableItemGraphId, documentId, documentIdFormat, documentCode, blob, annotationObject,
|
|
46
|
+
async set(auditableItemGraphId, documentId, documentIdFormat, documentCode, blob, annotationObject, options) {
|
|
44
47
|
core.Guards.stringValue(this.CLASS_NAME, "auditableItemGraphId", auditableItemGraphId);
|
|
45
48
|
core.Guards.stringValue(this.CLASS_NAME, "documentId", documentId);
|
|
46
49
|
core.Guards.arrayOneOf(this.CLASS_NAME, "documentCode", documentCode, Object.values(standardsUnece.UneceDocumentCodes));
|
|
@@ -55,7 +58,9 @@ class DocumentManagementClient extends apiCore.BaseRestClient {
|
|
|
55
58
|
documentCode,
|
|
56
59
|
blob: core.Converter.bytesToBase64(blob),
|
|
57
60
|
annotationObject,
|
|
58
|
-
createAttestation
|
|
61
|
+
createAttestation: options?.createAttestation,
|
|
62
|
+
includeIdAsAlias: options?.includeIdAsAlias,
|
|
63
|
+
aliasAnnotationObject: options?.aliasAnnotationObject
|
|
59
64
|
}
|
|
60
65
|
});
|
|
61
66
|
return response.headers.location;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -35,10 +35,13 @@ class DocumentManagementClient extends BaseRestClient {
|
|
|
35
35
|
* @param documentCode The code for the document type.
|
|
36
36
|
* @param blob The data to create the document.
|
|
37
37
|
* @param annotationObject Additional information to associate with the document.
|
|
38
|
-
* @param
|
|
38
|
+
* @param options Additional options for the set operation.
|
|
39
|
+
* @param options.createAttestation Flag to create an attestation for the document, defaults to false.
|
|
40
|
+
* @param options.includeIdAsAlias Include the document id as an alias to the aig vertex, defaults to false.
|
|
41
|
+
* @param options.aliasAnnotationObject Additional information to associate with the alias.
|
|
39
42
|
* @returns The identifier for the document which includes the auditable item graph identifier.
|
|
40
43
|
*/
|
|
41
|
-
async set(auditableItemGraphId, documentId, documentIdFormat, documentCode, blob, annotationObject,
|
|
44
|
+
async set(auditableItemGraphId, documentId, documentIdFormat, documentCode, blob, annotationObject, options) {
|
|
42
45
|
Guards.stringValue(this.CLASS_NAME, "auditableItemGraphId", auditableItemGraphId);
|
|
43
46
|
Guards.stringValue(this.CLASS_NAME, "documentId", documentId);
|
|
44
47
|
Guards.arrayOneOf(this.CLASS_NAME, "documentCode", documentCode, Object.values(UneceDocumentCodes));
|
|
@@ -53,7 +56,9 @@ class DocumentManagementClient extends BaseRestClient {
|
|
|
53
56
|
documentCode,
|
|
54
57
|
blob: Converter.bytesToBase64(blob),
|
|
55
58
|
annotationObject,
|
|
56
|
-
createAttestation
|
|
59
|
+
createAttestation: options?.createAttestation,
|
|
60
|
+
includeIdAsAlias: options?.includeIdAsAlias,
|
|
61
|
+
aliasAnnotationObject: options?.aliasAnnotationObject
|
|
57
62
|
}
|
|
58
63
|
});
|
|
59
64
|
return response.headers.location;
|
|
@@ -26,10 +26,17 @@ export declare class DocumentManagementClient extends BaseRestClient implements
|
|
|
26
26
|
* @param documentCode The code for the document type.
|
|
27
27
|
* @param blob The data to create the document.
|
|
28
28
|
* @param annotationObject Additional information to associate with the document.
|
|
29
|
-
* @param
|
|
29
|
+
* @param options Additional options for the set operation.
|
|
30
|
+
* @param options.createAttestation Flag to create an attestation for the document, defaults to false.
|
|
31
|
+
* @param options.includeIdAsAlias Include the document id as an alias to the aig vertex, defaults to false.
|
|
32
|
+
* @param options.aliasAnnotationObject Additional information to associate with the alias.
|
|
30
33
|
* @returns The identifier for the document which includes the auditable item graph identifier.
|
|
31
34
|
*/
|
|
32
|
-
set(auditableItemGraphId: string, documentId: string, documentIdFormat: string | undefined, documentCode: UneceDocumentCodes, blob: Uint8Array, annotationObject?: IJsonLdNodeObject,
|
|
35
|
+
set(auditableItemGraphId: string, documentId: string, documentIdFormat: string | undefined, documentCode: UneceDocumentCodes, blob: Uint8Array, annotationObject?: IJsonLdNodeObject, options?: {
|
|
36
|
+
createAttestation?: boolean;
|
|
37
|
+
includeIdAsAlias?: boolean;
|
|
38
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
39
|
+
}): Promise<string>;
|
|
33
40
|
/**
|
|
34
41
|
* Get a specific document from an auditable item graph vertex.
|
|
35
42
|
* @param auditableItemGraphId The auditable item graph vertex id to get the document from.
|
package/docs/changelog.md
CHANGED
|
@@ -50,7 +50,7 @@ Runtime name for the class.
|
|
|
50
50
|
|
|
51
51
|
### set()
|
|
52
52
|
|
|
53
|
-
> **set**(`auditableItemGraphId`, `documentId`, `documentIdFormat`, `documentCode`, `blob`, `annotationObject`?, `
|
|
53
|
+
> **set**(`auditableItemGraphId`, `documentId`, `documentIdFormat`, `documentCode`, `blob`, `annotationObject`?, `options`?): `Promise`\<`string`\>
|
|
54
54
|
|
|
55
55
|
Store a document in an auditable item graph vertex and add its content to blob storage.
|
|
56
56
|
If the document id already exists and the blob data is different a new revision will be created.
|
|
@@ -94,12 +94,28 @@ The data to create the document.
|
|
|
94
94
|
|
|
95
95
|
Additional information to associate with the document.
|
|
96
96
|
|
|
97
|
-
#####
|
|
97
|
+
##### options?
|
|
98
|
+
|
|
99
|
+
Additional options for the set operation.
|
|
100
|
+
|
|
101
|
+
###### createAttestation?
|
|
98
102
|
|
|
99
103
|
`boolean`
|
|
100
104
|
|
|
101
105
|
Flag to create an attestation for the document, defaults to false.
|
|
102
106
|
|
|
107
|
+
###### includeIdAsAlias?
|
|
108
|
+
|
|
109
|
+
`boolean`
|
|
110
|
+
|
|
111
|
+
Include the document id as an alias to the aig vertex, defaults to false.
|
|
112
|
+
|
|
113
|
+
###### aliasAnnotationObject?
|
|
114
|
+
|
|
115
|
+
`IJsonLdNodeObject`
|
|
116
|
+
|
|
117
|
+
Additional information to associate with the alias.
|
|
118
|
+
|
|
103
119
|
#### Returns
|
|
104
120
|
|
|
105
121
|
`Promise`\<`string`\>
|
|
@@ -136,31 +152,31 @@ The identifier of the document to get.
|
|
|
136
152
|
|
|
137
153
|
Additional options for the get operation.
|
|
138
154
|
|
|
139
|
-
###### includeBlobStorageMetadata
|
|
155
|
+
###### includeBlobStorageMetadata?
|
|
140
156
|
|
|
141
157
|
`boolean`
|
|
142
158
|
|
|
143
159
|
Flag to include the blob storage metadata for the document, defaults to false.
|
|
144
160
|
|
|
145
|
-
###### includeBlobStorageData
|
|
161
|
+
###### includeBlobStorageData?
|
|
146
162
|
|
|
147
163
|
`boolean`
|
|
148
164
|
|
|
149
165
|
Flag to include the blob storage data for the document, defaults to false.
|
|
150
166
|
|
|
151
|
-
###### includeAttestation
|
|
167
|
+
###### includeAttestation?
|
|
152
168
|
|
|
153
169
|
`boolean`
|
|
154
170
|
|
|
155
171
|
Flag to include the attestation information for the document, defaults to false.
|
|
156
172
|
|
|
157
|
-
###### includeRemoved
|
|
173
|
+
###### includeRemoved?
|
|
158
174
|
|
|
159
175
|
`boolean`
|
|
160
176
|
|
|
161
177
|
Flag to include deleted documents, defaults to false.
|
|
162
178
|
|
|
163
|
-
###### maxRevisionCount
|
|
179
|
+
###### maxRevisionCount?
|
|
164
180
|
|
|
165
181
|
`number`
|
|
166
182
|
|
|
@@ -209,7 +225,7 @@ The identifier of the document to remove.
|
|
|
209
225
|
|
|
210
226
|
Additional options for the remove operation.
|
|
211
227
|
|
|
212
|
-
###### removeAllRevisions
|
|
228
|
+
###### removeAllRevisions?
|
|
213
229
|
|
|
214
230
|
`boolean`
|
|
215
231
|
|
|
@@ -251,13 +267,13 @@ The document codes to query for, if undefined gets all document codes.
|
|
|
251
267
|
|
|
252
268
|
Additional options for the query operation.
|
|
253
269
|
|
|
254
|
-
###### includeMostRecentRevisions
|
|
270
|
+
###### includeMostRecentRevisions?
|
|
255
271
|
|
|
256
272
|
`boolean`
|
|
257
273
|
|
|
258
274
|
Include the most recent 5 revisions, use the individual get to retrieve more.
|
|
259
275
|
|
|
260
|
-
###### includeRemoved
|
|
276
|
+
###### includeRemoved?
|
|
261
277
|
|
|
262
278
|
`boolean`
|
|
263
279
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/document-management-rest-client",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.5",
|
|
4
4
|
"description": "Document management contract implementation which can connect to REST endpoints",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@twin.org/api-models": "next",
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
20
|
"@twin.org/data-json-ld": "next",
|
|
21
|
-
"@twin.org/document-management-models": "0.0.1-next.
|
|
21
|
+
"@twin.org/document-management-models": "0.0.1-next.5",
|
|
22
22
|
"@twin.org/entity": "next",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/standards-unece": "next",
|