@twin.org/document-management-rest-client 0.0.1-next.3 → 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.
@@ -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 createAttestation Flag to create an attestation for the document, defaults to false.
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, createAttestation) {
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;
@@ -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 createAttestation Flag to create an attestation for the document, defaults to false.
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, createAttestation) {
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 createAttestation Flag to create an attestation for the document, defaults to false.
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, createAttestation?: boolean): Promise<string>;
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
@@ -1,5 +1,5 @@
1
1
  # @twin.org/document-management-rest-client - Changelog
2
2
 
3
- ## v0.0.1-next.3
3
+ ## v0.0.1-next.5
4
4
 
5
5
  - Initial Release
@@ -50,7 +50,7 @@ Runtime name for the class.
50
50
 
51
51
  ### set()
52
52
 
53
- > **set**(`auditableItemGraphId`, `documentId`, `documentIdFormat`, `documentCode`, `blob`, `annotationObject`?, `createAttestation`?): `Promise`\<`string`\>
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
- ##### createAttestation?
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`\>
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",
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.3",
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",