@twin.org/document-management-rest-client 0.0.3-next.18 → 0.0.3-next.19
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/es/documentManagementRestClient.js +23 -26
- package/dist/es/documentManagementRestClient.js.map +1 -1
- package/dist/types/documentManagementRestClient.d.ts +20 -16
- package/docs/changelog.md +14 -0
- package/docs/reference/classes/DocumentManagementRestClient.md +39 -35
- package/package.json +2 -2
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
import { BaseRestClient } from "@twin.org/api-core";
|
|
4
4
|
import { Coerce, Converter, Guards, Is, Urn } from "@twin.org/core";
|
|
5
|
-
import { UneceDocumentCodeList } from "@twin.org/standards-unece";
|
|
6
5
|
import { HeaderHelper, HeaderTypes } from "@twin.org/web";
|
|
7
6
|
/**
|
|
8
7
|
* Client for performing document management through to REST endpoints.
|
|
@@ -30,33 +29,26 @@ export class DocumentManagementRestClient extends BaseRestClient {
|
|
|
30
29
|
* Store a document as an auditable item graph vertex and add its content to blob storage.
|
|
31
30
|
* If the document id already exists and the blob data is different a new revision will be created.
|
|
32
31
|
* For any other changes the current revision will be updated.
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
* @param documentCode The code for the document type.
|
|
36
|
-
* @param blob The data to create the document with.
|
|
37
|
-
* @param annotationObject Additional information to associate with the document.
|
|
32
|
+
* @param document The document base properties.
|
|
33
|
+
* @param blob The data to create the document with as bytes, or an existing blob storage entry id.
|
|
38
34
|
* @param auditableItemGraphEdges The auditable item graph vertices to connect the document to.
|
|
39
35
|
* @param options Additional options for the set operation.
|
|
40
|
-
* @param options.
|
|
41
|
-
* @param options.
|
|
36
|
+
* @param options.includeAttestation Flag to create an attestation for the document, defaults to false.
|
|
37
|
+
* @param options.includeAlias Flag to add the document id as an alias to the aig vertex, defaults to true.
|
|
42
38
|
* @param options.aliasAnnotationObject Annotation object for the alias.
|
|
43
39
|
* @returns The auditable item graph vertex created for the document including its revision.
|
|
44
40
|
*/
|
|
45
|
-
async create(
|
|
46
|
-
Guards.stringValue(DocumentManagementRestClient.CLASS_NAME, "documentId", documentId);
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
async create(document, blob, auditableItemGraphEdges, options) {
|
|
42
|
+
Guards.stringValue(DocumentManagementRestClient.CLASS_NAME, "document.documentId", document.documentId);
|
|
43
|
+
if (!Is.uint8Array(blob) && !Is.stringValue(blob)) {
|
|
44
|
+
Guards.uint8Array(DocumentManagementRestClient.CLASS_NAME, "blob", blob);
|
|
45
|
+
}
|
|
49
46
|
const response = await this.fetch("/", "POST", {
|
|
50
47
|
body: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
documentCode,
|
|
54
|
-
blob: Converter.bytesToBase64(blob),
|
|
55
|
-
annotationObject,
|
|
48
|
+
document,
|
|
49
|
+
blob: Is.uint8Array(blob) ? Converter.bytesToBase64(blob) : blob,
|
|
56
50
|
auditableItemGraphEdges,
|
|
57
|
-
|
|
58
|
-
addAlias: options?.addAlias,
|
|
59
|
-
aliasAnnotationObject: options?.aliasAnnotationObject
|
|
51
|
+
options
|
|
60
52
|
}
|
|
61
53
|
});
|
|
62
54
|
return response.headers.location;
|
|
@@ -66,8 +58,8 @@ export class DocumentManagementRestClient extends BaseRestClient {
|
|
|
66
58
|
* If the blob data is different a new revision will be created.
|
|
67
59
|
* For any other changes the current revision will be updated.
|
|
68
60
|
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
69
|
-
* @param
|
|
70
|
-
* @param
|
|
61
|
+
* @param document The document base properties to update. annotationObject, documentIdFormat and documentCode are applied in-place to the current revision.
|
|
62
|
+
* @param blob The data to update the document with as bytes, or an existing blob storage entry id.
|
|
71
63
|
* @param auditableItemGraphEdges Explicit edge delta to apply. If undefined, existing connections
|
|
72
64
|
* are retained unchanged. Use `add` to create new connections and `remove` to disconnect existing
|
|
73
65
|
* ones by their target vertex id. To update alias metadata on an already-connected vertex, include
|
|
@@ -75,18 +67,23 @@ export class DocumentManagementRestClient extends BaseRestClient {
|
|
|
75
67
|
* alias is updated in place without creating a duplicate back-edge.
|
|
76
68
|
* @param auditableItemGraphEdges.add Connections to add; each creates a back-edge on the connected vertex.
|
|
77
69
|
* @param auditableItemGraphEdges.remove Target vertex IDs to disconnect; their back-edges are removed.
|
|
70
|
+
* @param options Additional options for the update operation.
|
|
71
|
+
* @param options.includeAttestation Set to true to start attesting the document, or false to remove the existing attestation. Omit to leave unchanged.
|
|
72
|
+
* @param options.includeAlias Set to true to add the document id as an alias on the aig vertex, or false to remove it. Omit to leave unchanged.
|
|
73
|
+
* @param options.aliasAnnotationObject Annotation object for the alias when adding.
|
|
78
74
|
* @returns A promise that resolves when the document has been updated.
|
|
79
75
|
*/
|
|
80
|
-
async updatePartial(auditableItemGraphDocumentId, blob,
|
|
76
|
+
async updatePartial(auditableItemGraphDocumentId, document, blob, auditableItemGraphEdges, options) {
|
|
81
77
|
Urn.guard(DocumentManagementRestClient.CLASS_NAME, "auditableItemGraphDocumentId", auditableItemGraphDocumentId);
|
|
82
78
|
await this.fetch("/:auditableItemGraphDocumentId", "PATCH", {
|
|
83
79
|
pathParams: {
|
|
84
80
|
auditableItemGraphDocumentId
|
|
85
81
|
},
|
|
86
82
|
body: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
auditableItemGraphEdges
|
|
83
|
+
document,
|
|
84
|
+
blob: Is.uint8Array(blob) ? Converter.bytesToBase64(blob) : blob,
|
|
85
|
+
auditableItemGraphEdges,
|
|
86
|
+
options
|
|
90
87
|
}
|
|
91
88
|
});
|
|
92
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentManagementRestClient.js","sourceRoot":"","sources":["../../src/documentManagementRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOpD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I,CAAC;IACtB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,cAAc,CAC1B,4BAAoC,EACpC,QAAgB;QAEhB,GAAG,CAAC,KAAK,CACR,4BAA4B,CAAC,UAAU,kCAEvC,4BAA4B,CAC5B,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC,UAAU,cAAoB,QAAQ,CAAC,CAAC;QAEpF,MAAM,IAAI,CAAC,KAAK,CACf,0CAA0C,EAC1C,QAAQ,EACR;YACC,UAAU,EAAE;gBACX,4BAA4B;gBAC5B,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE;aAC7B;SACD,CACD,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,KAAK,CACjB,UAAkB,EAClB,MAAe,EACf,KAAc;QAKd,MAAM,CAAC,WAAW,CAAC,4BAA4B,CAAC,UAAU,gBAAsB,UAAU,CAAC,CAAC;QAE5F,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAG/B,GAAG,EAAE,KAAK,EAAE;YACb,KAAK,EAAE;gBACN,UAAU;gBACV,MAAM;gBACN,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;aAC3B;SACD,CAAC,CAAC;QAEH,OAAO;YACN,OAAO,EAAE,QAAQ,CAAC,IAAI;YACtB,MAAM,EAAE,YAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAC3F,EAAE,cAAc,EAAE,MAAM;SACzB,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport type {\n\tIBaseRestClientConfig,\n\tICreatedResponse,\n\tINoContentResponse\n} from \"@twin.org/api-models\";\nimport type { IAuditableItemGraphVertexList } from \"@twin.org/auditable-item-graph-models\";\nimport { Coerce, Converter, Guards, Is, Urn } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type {\n\tIDocument,\n\tIDocumentList,\n\tIDocumentManagementComponent,\n\tIDocumentManagementCreateRequest,\n\tIDocumentManagementEdgeEntry,\n\tIDocumentManagementGetRequest,\n\tIDocumentManagementGetResponse,\n\tIDocumentManagementGetRevisionRequest,\n\tIDocumentManagementGetRevisionResponse,\n\tIDocumentManagementQueryRequest,\n\tIDocumentManagementQueryResponse,\n\tIDocumentManagementRemoveRequest,\n\tIDocumentManagementUpdatePartialRequest\n} from \"@twin.org/document-management-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { UneceDocumentCodeList } from \"@twin.org/standards-unece\";\nimport { HeaderHelper, HeaderTypes } from \"@twin.org/web\";\n\n/**\n * Client for performing document management through to REST endpoints.\n */\nexport class DocumentManagementRestClient\n\textends BaseRestClient\n\timplements IDocumentManagementComponent\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DocumentManagementRestClient>();\n\n\t/**\n\t * Create a new instance of DocumentManagementRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(DocumentManagementRestClient.CLASS_NAME, config, \"document-management\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn DocumentManagementRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Store a document as an auditable item graph vertex and add its content to blob storage.\n\t * If the document id already exists and the blob data is different a new revision will be created.\n\t * For any other changes the current revision will be updated.\n\t * @param documentId The document id to create.\n\t * @param documentIdFormat The format of the document identifier.\n\t * @param documentCode The code for the document type.\n\t * @param blob The data to create the document with.\n\t * @param annotationObject Additional information to associate with the document.\n\t * @param auditableItemGraphEdges The auditable item graph vertices to connect the document to.\n\t * @param options Additional options for the set operation.\n\t * @param options.createAttestation Flag to create an attestation for the document, defaults to false.\n\t * @param options.addAlias Flag to add the document id as an alias to the aig vertex, defaults to true.\n\t * @param options.aliasAnnotationObject Annotation object for the alias.\n\t * @returns The auditable item graph vertex created for the document including its revision.\n\t */\n\tpublic async create(\n\t\tdocumentId: string,\n\t\tdocumentIdFormat: string | undefined,\n\t\tdocumentCode: UneceDocumentCodeList,\n\t\tblob: Uint8Array,\n\t\tannotationObject?: IJsonLdNodeObject,\n\t\tauditableItemGraphEdges?: IDocumentManagementEdgeEntry[],\n\t\toptions?: {\n\t\t\tcreateAttestation?: boolean;\n\t\t\taddAlias?: boolean;\n\t\t\taliasAnnotationObject?: IJsonLdNodeObject;\n\t\t}\n\t): Promise<string> {\n\t\tGuards.stringValue(DocumentManagementRestClient.CLASS_NAME, nameof(documentId), documentId);\n\t\tGuards.arrayOneOf(\n\t\t\tDocumentManagementRestClient.CLASS_NAME,\n\t\t\tnameof(documentCode),\n\t\t\tdocumentCode,\n\t\t\tObject.values(UneceDocumentCodeList)\n\t\t);\n\t\tGuards.uint8Array(DocumentManagementRestClient.CLASS_NAME, nameof(blob), blob);\n\n\t\tconst response = await this.fetch<IDocumentManagementCreateRequest, ICreatedResponse>(\n\t\t\t\"/\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\tbody: {\n\t\t\t\t\tdocumentId,\n\t\t\t\t\tdocumentIdFormat,\n\t\t\t\t\tdocumentCode,\n\t\t\t\t\tblob: Converter.bytesToBase64(blob),\n\t\t\t\t\tannotationObject,\n\t\t\t\t\tauditableItemGraphEdges,\n\t\t\t\t\tcreateAttestation: options?.createAttestation,\n\t\t\t\t\taddAlias: options?.addAlias,\n\t\t\t\t\taliasAnnotationObject: options?.aliasAnnotationObject\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.headers.location;\n\t}\n\n\t/**\n\t * Update a document as an auditable item graph vertex and add its content to blob storage.\n\t * If the blob data is different a new revision will be created.\n\t * For any other changes the current revision will be updated.\n\t * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.\n\t * @param blob The data to update the document with.\n\t * @param annotationObject Additional information to associate with the document.\n\t * @param auditableItemGraphEdges Explicit edge delta to apply. If undefined, existing connections\n\t * are retained unchanged. Use `add` to create new connections and `remove` to disconnect existing\n\t * ones by their target vertex id. To update alias metadata on an already-connected vertex, include\n\t * it in `add` with the updated `aliasAnnotationObject` — AIG's alias patch is an upsert, so the\n\t * alias is updated in place without creating a duplicate back-edge.\n\t * @param auditableItemGraphEdges.add Connections to add; each creates a back-edge on the connected vertex.\n\t * @param auditableItemGraphEdges.remove Target vertex IDs to disconnect; their back-edges are removed.\n\t * @returns A promise that resolves when the document has been updated.\n\t */\n\tpublic async updatePartial(\n\t\tauditableItemGraphDocumentId: string,\n\t\tblob?: Uint8Array,\n\t\tannotationObject?: IJsonLdNodeObject,\n\t\tauditableItemGraphEdges?: {\n\t\t\tadd?: IDocumentManagementEdgeEntry[];\n\t\t\tremove?: string[];\n\t\t}\n\t): Promise<void> {\n\t\tUrn.guard(\n\t\t\tDocumentManagementRestClient.CLASS_NAME,\n\t\t\tnameof(auditableItemGraphDocumentId),\n\t\t\tauditableItemGraphDocumentId\n\t\t);\n\n\t\tawait this.fetch<IDocumentManagementUpdatePartialRequest, INoContentResponse>(\n\t\t\t\"/:auditableItemGraphDocumentId\",\n\t\t\t\"PATCH\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tauditableItemGraphDocumentId\n\t\t\t\t},\n\t\t\t\tbody: {\n\t\t\t\t\tblob: Is.uint8Array(blob) ? Converter.bytesToBase64(blob) : undefined,\n\t\t\t\t\tannotationObject,\n\t\t\t\t\tauditableItemGraphEdges\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Get a document using it's auditable item graph vertex id and optional revision.\n\t * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.\n\t * @param options Additional options for the get operation.\n\t * @param options.includeBlobStorageMetadata Flag to include the blob storage metadata for the document, defaults to false.\n\t * @param options.includeBlobStorageData Flag to include the blob storage data for the document, defaults to false.\n\t * @param options.includeAttestation Flag to include the attestation information for the document, defaults to false.\n\t * @param options.includeRemoved Flag to include deleted documents, defaults to false.\n\t * @param options.includeDeletedEdges Flag to include soft-deleted edges in the response, defaults to false.\n\t * @param options.extractRuleGroupId If provided will extract data from the document using the specified rule group id.\n\t * @param options.extractMimeType By default extraction will auto detect the mime type of the document, this can be used to override the detection.\n\t * @param cursor The cursor to get the next chunk of revisions.\n\t * @param limit The limit of items to return, defaults to 1 so only most recent is returned.\n\t * @returns The documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.\n\t */\n\tpublic async get(\n\t\tauditableItemGraphDocumentId: string,\n\t\toptions?: {\n\t\t\tincludeBlobStorageMetadata?: boolean;\n\t\t\tincludeBlobStorageData?: boolean;\n\t\t\tincludeAttestation?: boolean;\n\t\t\tincludeRemoved?: boolean;\n\t\t\tincludeDeletedEdges?: boolean;\n\t\t\textractRuleGroupId?: string;\n\t\t\textractMimeType?: string;\n\t\t},\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IDocumentList;\n\t\tcursor?: string;\n\t}> {\n\t\tUrn.guard(\n\t\t\tDocumentManagementRestClient.CLASS_NAME,\n\t\t\tnameof(auditableItemGraphDocumentId),\n\t\t\tauditableItemGraphDocumentId\n\t\t);\n\n\t\tconst response = await this.fetch<\n\t\t\tIDocumentManagementGetRequest,\n\t\t\tIDocumentManagementGetResponse\n\t\t>(\"/:auditableItemGraphDocumentId\", \"GET\", {\n\t\t\tpathParams: {\n\t\t\t\tauditableItemGraphDocumentId\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tincludeBlobStorageMetadata: Coerce.string(options?.includeBlobStorageMetadata),\n\t\t\t\tincludeBlobStorageData: Coerce.string(options?.includeBlobStorageData),\n\t\t\t\tincludeAttestation: Coerce.string(options?.includeAttestation),\n\t\t\t\tincludeRemoved: Coerce.string(options?.includeRemoved),\n\t\t\t\tincludeDeletedEdges: Coerce.string(options?.includeDeletedEdges),\n\t\t\t\textractRuleGroupId: options?.extractRuleGroupId,\n\t\t\t\textractMimeType: options?.extractMimeType,\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tentries: response.body,\n\t\t\tcursor: HeaderHelper.extractLinkHeaderRelation(response.headers?.[HeaderTypes.Link], \"next\")\n\t\t\t\t?.urlQueryParams?.cursor\n\t\t};\n\t}\n\n\t/**\n\t * Get a document revision using it's auditable item graph vertex id.\n\t * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.\n\t * @param revision The revision id for the document.\n\t * @param options Additional options for the get operation.\n\t * @param options.includeBlobStorageMetadata Flag to include the blob storage metadata for the document, defaults to false.\n\t * @param options.includeBlobStorageData Flag to include the blob storage data for the document, defaults to false.\n\t * @param options.includeAttestation Flag to include the attestation information for the document, defaults to false.\n\t * @param options.extractRuleGroupId If provided will extract data from the document using the specified rule group id.\n\t * @param options.extractMimeType By default extraction will auto detect the mime type of the document, this can be used to override the detection.\n\t * @returns The document for the specified revision.\n\t */\n\tpublic async getRevision(\n\t\tauditableItemGraphDocumentId: string,\n\t\trevision: number,\n\t\toptions?: {\n\t\t\tincludeBlobStorageMetadata?: boolean;\n\t\t\tincludeBlobStorageData?: boolean;\n\t\t\tincludeAttestation?: boolean;\n\t\t\textractRuleGroupId?: string;\n\t\t\textractMimeType?: string;\n\t\t}\n\t): Promise<IDocument> {\n\t\tUrn.guard(\n\t\t\tDocumentManagementRestClient.CLASS_NAME,\n\t\t\tnameof(auditableItemGraphDocumentId),\n\t\t\tauditableItemGraphDocumentId\n\t\t);\n\t\tGuards.integer(DocumentManagementRestClient.CLASS_NAME, nameof(revision), revision);\n\n\t\tconst response = await this.fetch<\n\t\t\tIDocumentManagementGetRevisionRequest,\n\t\t\tIDocumentManagementGetRevisionResponse\n\t\t>(\"/:auditableItemGraphDocumentId/:revision\", \"GET\", {\n\t\t\tpathParams: {\n\t\t\t\tauditableItemGraphDocumentId,\n\t\t\t\trevision: revision.toString()\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tincludeBlobStorageMetadata: Coerce.string(options?.includeBlobStorageMetadata),\n\t\t\t\tincludeBlobStorageData: Coerce.string(options?.includeBlobStorageData),\n\t\t\t\tincludeAttestation: Coerce.string(options?.includeAttestation),\n\t\t\t\textractRuleGroupId: options?.extractRuleGroupId,\n\t\t\t\textractMimeType: options?.extractMimeType\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Remove an auditable item graph vertex using it's id.\n\t * The document dateDeleted will be set, but can still be queried with the includeRemoved flag.\n\t * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.\n\t * @param revision The revision of the document to remove.\n\t * @returns A promise that resolves when the revision has been removed.\n\t */\n\tpublic async removeRevision(\n\t\tauditableItemGraphDocumentId: string,\n\t\trevision: number\n\t): Promise<void> {\n\t\tUrn.guard(\n\t\t\tDocumentManagementRestClient.CLASS_NAME,\n\t\t\tnameof(auditableItemGraphDocumentId),\n\t\t\tauditableItemGraphDocumentId\n\t\t);\n\t\tGuards.integer(DocumentManagementRestClient.CLASS_NAME, nameof(revision), revision);\n\n\t\tawait this.fetch<IDocumentManagementRemoveRequest, INoContentResponse>(\n\t\t\t\"/:auditableItemGraphDocumentId/:revision\",\n\t\t\t\"DELETE\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tauditableItemGraphDocumentId,\n\t\t\t\t\trevision: revision.toString()\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Find all the document with a specific id.\n\t * @param documentId The document id to find in the graph.\n\t * @param cursor The cursor to get the next chunk of documents.\n\t * @param limit The limit to get the next chunk of documents.\n\t * @returns The graph vertices that contain documents referencing the specified document id.\n\t */\n\tpublic async query(\n\t\tdocumentId: string,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAuditableItemGraphVertexList;\n\t\tcursor?: string;\n\t}> {\n\t\tGuards.stringValue(DocumentManagementRestClient.CLASS_NAME, nameof(documentId), documentId);\n\n\t\tconst response = await this.fetch<\n\t\t\tIDocumentManagementQueryRequest,\n\t\t\tIDocumentManagementQueryResponse\n\t\t>(\"/\", \"GET\", {\n\t\t\tquery: {\n\t\t\t\tdocumentId,\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tentries: response.body,\n\t\t\tcursor: HeaderHelper.extractLinkHeaderRelation(response.headers?.[HeaderTypes.Link], \"next\")\n\t\t\t\t?.urlQueryParams?.cursor\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"documentManagementRestClient.js","sourceRoot":"","sources":["../../src/documentManagementRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOpD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAmBpE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,4BACZ,SAAQ,cAAc;IAGtB;;OAEG;IACI,MAAM,CAAU,UAAU,kCAAkD;IAEnF;;;OAGG;IACH,YAAY,MAA6B;QACxC,KAAK,CAAC,4BAA4B,CAAC,UAAU,EAAE,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC/E,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,4BAA4B,CAAC,UAAU,CAAC;IAChD,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,KAAK,CAAC,MAAM,CAClB,QAAuB,EACvB,IAAyB,EACzB,uBAAwD,EACxD,OAIC;QAED,MAAM,CAAC,WAAW,CACjB,4BAA4B,CAAC,UAAU,yBAEvC,QAAQ,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3B;SACD,CAAC,CAAC;QAEH,OAAO;YACN,OAAO,EAAE,QAAQ,CAAC,IAAI;YACtB,MAAM,EAAE,YAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAC3F,EAAE,cAAc,EAAE,MAAM;SACzB,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport type {\n\tIBaseRestClientConfig,\n\tICreatedResponse,\n\tINoContentResponse\n} from \"@twin.org/api-models\";\nimport type { IAuditableItemGraphVertexList } from \"@twin.org/auditable-item-graph-models\";\nimport { Coerce, Converter, Guards, Is, Urn } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type {\n\tIDocumentBase,\n\tIDocumentHydrated,\n\tIDocumentList,\n\tIDocumentManagementComponent,\n\tIDocumentManagementCreateRequest,\n\tIDocumentManagementEdgeEntry,\n\tIDocumentManagementGetRequest,\n\tIDocumentManagementGetResponse,\n\tIDocumentManagementGetRevisionRequest,\n\tIDocumentManagementGetRevisionResponse,\n\tIDocumentManagementQueryRequest,\n\tIDocumentManagementQueryResponse,\n\tIDocumentManagementRemoveRequest,\n\tIDocumentManagementUpdatePartialRequest\n} from \"@twin.org/document-management-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { HeaderHelper, HeaderTypes } from \"@twin.org/web\";\n\n/**\n * Client for performing document management through to REST endpoints.\n */\nexport class DocumentManagementRestClient\n\textends BaseRestClient\n\timplements IDocumentManagementComponent\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DocumentManagementRestClient>();\n\n\t/**\n\t * Create a new instance of DocumentManagementRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(DocumentManagementRestClient.CLASS_NAME, config, \"document-management\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn DocumentManagementRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Store a document as an auditable item graph vertex and add its content to blob storage.\n\t * If the document id already exists and the blob data is different a new revision will be created.\n\t * For any other changes the current revision will be updated.\n\t * @param document The document base properties.\n\t * @param blob The data to create the document with as bytes, or an existing blob storage entry id.\n\t * @param auditableItemGraphEdges The auditable item graph vertices to connect the document to.\n\t * @param options Additional options for the set operation.\n\t * @param options.includeAttestation Flag to create an attestation for the document, defaults to false.\n\t * @param options.includeAlias Flag to add the document id as an alias to the aig vertex, defaults to true.\n\t * @param options.aliasAnnotationObject Annotation object for the alias.\n\t * @returns The auditable item graph vertex created for the document including its revision.\n\t */\n\tpublic async create(\n\t\tdocument: IDocumentBase,\n\t\tblob: Uint8Array | string,\n\t\tauditableItemGraphEdges?: IDocumentManagementEdgeEntry[],\n\t\toptions?: {\n\t\t\tincludeAttestation?: boolean;\n\t\t\tincludeAlias?: boolean;\n\t\t\taliasAnnotationObject?: IJsonLdNodeObject;\n\t\t}\n\t): Promise<string> {\n\t\tGuards.stringValue(\n\t\t\tDocumentManagementRestClient.CLASS_NAME,\n\t\t\tnameof(document.documentId),\n\t\t\tdocument.documentId\n\t\t);\n\t\tif (!Is.uint8Array(blob) && !Is.stringValue(blob)) {\n\t\t\tGuards.uint8Array(DocumentManagementRestClient.CLASS_NAME, nameof(blob), blob);\n\t\t}\n\n\t\tconst response = await this.fetch<IDocumentManagementCreateRequest, ICreatedResponse>(\n\t\t\t\"/\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\tbody: {\n\t\t\t\t\tdocument,\n\t\t\t\t\tblob: Is.uint8Array(blob) ? Converter.bytesToBase64(blob) : blob,\n\t\t\t\t\tauditableItemGraphEdges,\n\t\t\t\t\toptions\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.headers.location;\n\t}\n\n\t/**\n\t * Update a document as an auditable item graph vertex and add its content to blob storage.\n\t * If the blob data is different a new revision will be created.\n\t * For any other changes the current revision will be updated.\n\t * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.\n\t * @param document The document base properties to update. annotationObject, documentIdFormat and documentCode are applied in-place to the current revision.\n\t * @param blob The data to update the document with as bytes, or an existing blob storage entry id.\n\t * @param auditableItemGraphEdges Explicit edge delta to apply. If undefined, existing connections\n\t * are retained unchanged. Use `add` to create new connections and `remove` to disconnect existing\n\t * ones by their target vertex id. To update alias metadata on an already-connected vertex, include\n\t * it in `add` with the updated `aliasAnnotationObject` — AIG's alias patch is an upsert, so the\n\t * alias is updated in place without creating a duplicate back-edge.\n\t * @param auditableItemGraphEdges.add Connections to add; each creates a back-edge on the connected vertex.\n\t * @param auditableItemGraphEdges.remove Target vertex IDs to disconnect; their back-edges are removed.\n\t * @param options Additional options for the update operation.\n\t * @param options.includeAttestation Set to true to start attesting the document, or false to remove the existing attestation. Omit to leave unchanged.\n\t * @param options.includeAlias Set to true to add the document id as an alias on the aig vertex, or false to remove it. Omit to leave unchanged.\n\t * @param options.aliasAnnotationObject Annotation object for the alias when adding.\n\t * @returns A promise that resolves when the document has been updated.\n\t */\n\tpublic async updatePartial(\n\t\tauditableItemGraphDocumentId: string,\n\t\tdocument?: Partial<\n\t\t\tPick<IDocumentBase, \"annotationObject\" | \"documentIdFormat\" | \"documentCode\">\n\t\t>,\n\t\tblob?: Uint8Array | string,\n\t\tauditableItemGraphEdges?: {\n\t\t\tadd?: IDocumentManagementEdgeEntry[];\n\t\t\tremove?: string[];\n\t\t},\n\t\toptions?: {\n\t\t\tincludeAttestation?: boolean;\n\t\t\tincludeAlias?: boolean;\n\t\t\taliasAnnotationObject?: IJsonLdNodeObject;\n\t\t}\n\t): Promise<void> {\n\t\tUrn.guard(\n\t\t\tDocumentManagementRestClient.CLASS_NAME,\n\t\t\tnameof(auditableItemGraphDocumentId),\n\t\t\tauditableItemGraphDocumentId\n\t\t);\n\n\t\tawait this.fetch<IDocumentManagementUpdatePartialRequest, INoContentResponse>(\n\t\t\t\"/:auditableItemGraphDocumentId\",\n\t\t\t\"PATCH\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tauditableItemGraphDocumentId\n\t\t\t\t},\n\t\t\t\tbody: {\n\t\t\t\t\tdocument,\n\t\t\t\t\tblob: Is.uint8Array(blob) ? Converter.bytesToBase64(blob) : blob,\n\t\t\t\t\tauditableItemGraphEdges,\n\t\t\t\t\toptions\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Get a document using it's auditable item graph vertex id and optional revision.\n\t * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.\n\t * @param options Additional options for the get operation.\n\t * @param options.includeBlobStorageMetadata Flag to include the blob storage metadata for the document, defaults to false.\n\t * @param options.includeBlobStorageData Flag to include the blob storage data for the document, defaults to false.\n\t * @param options.includeAttestation Flag to include the attestation information for the document, defaults to false.\n\t * @param options.includeRemoved Flag to include deleted documents, defaults to false.\n\t * @param options.includeDeletedEdges Flag to include soft-deleted edges in the response, defaults to false.\n\t * @param options.extractRuleGroupId If provided will extract data from the document using the specified rule group id.\n\t * @param options.extractMimeType By default extraction will auto detect the mime type of the document, this can be used to override the detection.\n\t * @param cursor The cursor to get the next chunk of revisions.\n\t * @param limit The limit of items to return, defaults to 1 so only most recent is returned.\n\t * @returns The documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.\n\t */\n\tpublic async get(\n\t\tauditableItemGraphDocumentId: string,\n\t\toptions?: {\n\t\t\tincludeBlobStorageMetadata?: boolean;\n\t\t\tincludeBlobStorageData?: boolean;\n\t\t\tincludeAttestation?: boolean;\n\t\t\tincludeRemoved?: boolean;\n\t\t\tincludeDeletedEdges?: boolean;\n\t\t\textractRuleGroupId?: string;\n\t\t\textractMimeType?: string;\n\t\t},\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IDocumentList;\n\t\tcursor?: string;\n\t}> {\n\t\tUrn.guard(\n\t\t\tDocumentManagementRestClient.CLASS_NAME,\n\t\t\tnameof(auditableItemGraphDocumentId),\n\t\t\tauditableItemGraphDocumentId\n\t\t);\n\n\t\tconst response = await this.fetch<\n\t\t\tIDocumentManagementGetRequest,\n\t\t\tIDocumentManagementGetResponse\n\t\t>(\"/:auditableItemGraphDocumentId\", \"GET\", {\n\t\t\tpathParams: {\n\t\t\t\tauditableItemGraphDocumentId\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tincludeBlobStorageMetadata: Coerce.string(options?.includeBlobStorageMetadata),\n\t\t\t\tincludeBlobStorageData: Coerce.string(options?.includeBlobStorageData),\n\t\t\t\tincludeAttestation: Coerce.string(options?.includeAttestation),\n\t\t\t\tincludeRemoved: Coerce.string(options?.includeRemoved),\n\t\t\t\tincludeDeletedEdges: Coerce.string(options?.includeDeletedEdges),\n\t\t\t\textractRuleGroupId: options?.extractRuleGroupId,\n\t\t\t\textractMimeType: options?.extractMimeType,\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tentries: response.body,\n\t\t\tcursor: HeaderHelper.extractLinkHeaderRelation(response.headers?.[HeaderTypes.Link], \"next\")\n\t\t\t\t?.urlQueryParams?.cursor\n\t\t};\n\t}\n\n\t/**\n\t * Get a document revision using it's auditable item graph vertex id.\n\t * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.\n\t * @param revision The revision id for the document.\n\t * @param options Additional options for the get operation.\n\t * @param options.includeBlobStorageMetadata Flag to include the blob storage metadata for the document, defaults to false.\n\t * @param options.includeBlobStorageData Flag to include the blob storage data for the document, defaults to false.\n\t * @param options.includeAttestation Flag to include the attestation information for the document, defaults to false.\n\t * @param options.extractRuleGroupId If provided will extract data from the document using the specified rule group id.\n\t * @param options.extractMimeType By default extraction will auto detect the mime type of the document, this can be used to override the detection.\n\t * @returns The document for the specified revision.\n\t */\n\tpublic async getRevision(\n\t\tauditableItemGraphDocumentId: string,\n\t\trevision: number,\n\t\toptions?: {\n\t\t\tincludeBlobStorageMetadata?: boolean;\n\t\t\tincludeBlobStorageData?: boolean;\n\t\t\tincludeAttestation?: boolean;\n\t\t\textractRuleGroupId?: string;\n\t\t\textractMimeType?: string;\n\t\t}\n\t): Promise<IDocumentHydrated> {\n\t\tUrn.guard(\n\t\t\tDocumentManagementRestClient.CLASS_NAME,\n\t\t\tnameof(auditableItemGraphDocumentId),\n\t\t\tauditableItemGraphDocumentId\n\t\t);\n\t\tGuards.integer(DocumentManagementRestClient.CLASS_NAME, nameof(revision), revision);\n\n\t\tconst response = await this.fetch<\n\t\t\tIDocumentManagementGetRevisionRequest,\n\t\t\tIDocumentManagementGetRevisionResponse\n\t\t>(\"/:auditableItemGraphDocumentId/:revision\", \"GET\", {\n\t\t\tpathParams: {\n\t\t\t\tauditableItemGraphDocumentId,\n\t\t\t\trevision: revision.toString()\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tincludeBlobStorageMetadata: Coerce.string(options?.includeBlobStorageMetadata),\n\t\t\t\tincludeBlobStorageData: Coerce.string(options?.includeBlobStorageData),\n\t\t\t\tincludeAttestation: Coerce.string(options?.includeAttestation),\n\t\t\t\textractRuleGroupId: options?.extractRuleGroupId,\n\t\t\t\textractMimeType: options?.extractMimeType\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Remove an auditable item graph vertex using it's id.\n\t * The document dateDeleted will be set, but can still be queried with the includeRemoved flag.\n\t * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.\n\t * @param revision The revision of the document to remove.\n\t * @returns A promise that resolves when the revision has been removed.\n\t */\n\tpublic async removeRevision(\n\t\tauditableItemGraphDocumentId: string,\n\t\trevision: number\n\t): Promise<void> {\n\t\tUrn.guard(\n\t\t\tDocumentManagementRestClient.CLASS_NAME,\n\t\t\tnameof(auditableItemGraphDocumentId),\n\t\t\tauditableItemGraphDocumentId\n\t\t);\n\t\tGuards.integer(DocumentManagementRestClient.CLASS_NAME, nameof(revision), revision);\n\n\t\tawait this.fetch<IDocumentManagementRemoveRequest, INoContentResponse>(\n\t\t\t\"/:auditableItemGraphDocumentId/:revision\",\n\t\t\t\"DELETE\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tauditableItemGraphDocumentId,\n\t\t\t\t\trevision: revision.toString()\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Find all the document with a specific id.\n\t * @param documentId The document id to find in the graph.\n\t * @param cursor The cursor to get the next chunk of documents.\n\t * @param limit The limit to get the next chunk of documents.\n\t * @returns The graph vertices that contain documents referencing the specified document id.\n\t */\n\tpublic async query(\n\t\tdocumentId: string,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAuditableItemGraphVertexList;\n\t\tcursor?: string;\n\t}> {\n\t\tGuards.stringValue(DocumentManagementRestClient.CLASS_NAME, nameof(documentId), documentId);\n\n\t\tconst response = await this.fetch<\n\t\t\tIDocumentManagementQueryRequest,\n\t\t\tIDocumentManagementQueryResponse\n\t\t>(\"/\", \"GET\", {\n\t\t\tquery: {\n\t\t\t\tdocumentId,\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tentries: response.body,\n\t\t\tcursor: HeaderHelper.extractLinkHeaderRelation(response.headers?.[HeaderTypes.Link], \"next\")\n\t\t\t\t?.urlQueryParams?.cursor\n\t\t};\n\t}\n}\n"]}
|
|
@@ -2,8 +2,7 @@ import { BaseRestClient } from "@twin.org/api-core";
|
|
|
2
2
|
import type { IBaseRestClientConfig } from "@twin.org/api-models";
|
|
3
3
|
import type { IAuditableItemGraphVertexList } from "@twin.org/auditable-item-graph-models";
|
|
4
4
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
5
|
-
import type {
|
|
6
|
-
import { UneceDocumentCodeList } from "@twin.org/standards-unece";
|
|
5
|
+
import type { IDocumentBase, IDocumentHydrated, IDocumentList, IDocumentManagementComponent, IDocumentManagementEdgeEntry } from "@twin.org/document-management-models";
|
|
7
6
|
/**
|
|
8
7
|
* Client for performing document management through to REST endpoints.
|
|
9
8
|
*/
|
|
@@ -26,21 +25,18 @@ export declare class DocumentManagementRestClient extends BaseRestClient impleme
|
|
|
26
25
|
* Store a document as an auditable item graph vertex and add its content to blob storage.
|
|
27
26
|
* If the document id already exists and the blob data is different a new revision will be created.
|
|
28
27
|
* For any other changes the current revision will be updated.
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param documentCode The code for the document type.
|
|
32
|
-
* @param blob The data to create the document with.
|
|
33
|
-
* @param annotationObject Additional information to associate with the document.
|
|
28
|
+
* @param document The document base properties.
|
|
29
|
+
* @param blob The data to create the document with as bytes, or an existing blob storage entry id.
|
|
34
30
|
* @param auditableItemGraphEdges The auditable item graph vertices to connect the document to.
|
|
35
31
|
* @param options Additional options for the set operation.
|
|
36
|
-
* @param options.
|
|
37
|
-
* @param options.
|
|
32
|
+
* @param options.includeAttestation Flag to create an attestation for the document, defaults to false.
|
|
33
|
+
* @param options.includeAlias Flag to add the document id as an alias to the aig vertex, defaults to true.
|
|
38
34
|
* @param options.aliasAnnotationObject Annotation object for the alias.
|
|
39
35
|
* @returns The auditable item graph vertex created for the document including its revision.
|
|
40
36
|
*/
|
|
41
|
-
create(
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
create(document: IDocumentBase, blob: Uint8Array | string, auditableItemGraphEdges?: IDocumentManagementEdgeEntry[], options?: {
|
|
38
|
+
includeAttestation?: boolean;
|
|
39
|
+
includeAlias?: boolean;
|
|
44
40
|
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
45
41
|
}): Promise<string>;
|
|
46
42
|
/**
|
|
@@ -48,8 +44,8 @@ export declare class DocumentManagementRestClient extends BaseRestClient impleme
|
|
|
48
44
|
* If the blob data is different a new revision will be created.
|
|
49
45
|
* For any other changes the current revision will be updated.
|
|
50
46
|
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
47
|
+
* @param document The document base properties to update. annotationObject, documentIdFormat and documentCode are applied in-place to the current revision.
|
|
48
|
+
* @param blob The data to update the document with as bytes, or an existing blob storage entry id.
|
|
53
49
|
* @param auditableItemGraphEdges Explicit edge delta to apply. If undefined, existing connections
|
|
54
50
|
* are retained unchanged. Use `add` to create new connections and `remove` to disconnect existing
|
|
55
51
|
* ones by their target vertex id. To update alias metadata on an already-connected vertex, include
|
|
@@ -57,11 +53,19 @@ export declare class DocumentManagementRestClient extends BaseRestClient impleme
|
|
|
57
53
|
* alias is updated in place without creating a duplicate back-edge.
|
|
58
54
|
* @param auditableItemGraphEdges.add Connections to add; each creates a back-edge on the connected vertex.
|
|
59
55
|
* @param auditableItemGraphEdges.remove Target vertex IDs to disconnect; their back-edges are removed.
|
|
56
|
+
* @param options Additional options for the update operation.
|
|
57
|
+
* @param options.includeAttestation Set to true to start attesting the document, or false to remove the existing attestation. Omit to leave unchanged.
|
|
58
|
+
* @param options.includeAlias Set to true to add the document id as an alias on the aig vertex, or false to remove it. Omit to leave unchanged.
|
|
59
|
+
* @param options.aliasAnnotationObject Annotation object for the alias when adding.
|
|
60
60
|
* @returns A promise that resolves when the document has been updated.
|
|
61
61
|
*/
|
|
62
|
-
updatePartial(auditableItemGraphDocumentId: string,
|
|
62
|
+
updatePartial(auditableItemGraphDocumentId: string, document?: Partial<Pick<IDocumentBase, "annotationObject" | "documentIdFormat" | "documentCode">>, blob?: Uint8Array | string, auditableItemGraphEdges?: {
|
|
63
63
|
add?: IDocumentManagementEdgeEntry[];
|
|
64
64
|
remove?: string[];
|
|
65
|
+
}, options?: {
|
|
66
|
+
includeAttestation?: boolean;
|
|
67
|
+
includeAlias?: boolean;
|
|
68
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
65
69
|
}): Promise<void>;
|
|
66
70
|
/**
|
|
67
71
|
* Get a document using it's auditable item graph vertex id and optional revision.
|
|
@@ -108,7 +112,7 @@ export declare class DocumentManagementRestClient extends BaseRestClient impleme
|
|
|
108
112
|
includeAttestation?: boolean;
|
|
109
113
|
extractRuleGroupId?: string;
|
|
110
114
|
extractMimeType?: string;
|
|
111
|
-
}): Promise<
|
|
115
|
+
}): Promise<IDocumentHydrated>;
|
|
112
116
|
/**
|
|
113
117
|
* Remove an auditable item graph vertex using it's id.
|
|
114
118
|
* The document dateDeleted will be set, but can still be queried with the includeRemoved flag.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.19](https://github.com/iotaledger/twin-document-management/compare/document-management-rest-client-v0.0.3-next.18...document-management-rest-client-v0.0.3-next.19) (2026-06-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* updated API surface ([#58](https://github.com/iotaledger/twin-document-management/issues/58)) ([e811d22](https://github.com/iotaledger/twin-document-management/commit/e811d22e27d905ff4dbee43273f6195c7386491b))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/document-management-models bumped from 0.0.3-next.18 to 0.0.3-next.19
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.18](https://github.com/iotaledger/twin-document-management/compare/document-management-rest-client-v0.0.3-next.17...document-management-rest-client-v0.0.3-next.18) (2026-06-19)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -64,7 +64,7 @@ The class name of the component.
|
|
|
64
64
|
|
|
65
65
|
### create() {#create}
|
|
66
66
|
|
|
67
|
-
> **create**(`
|
|
67
|
+
> **create**(`document`, `blob`, `auditableItemGraphEdges?`, `options?`): `Promise`\<`string`\>
|
|
68
68
|
|
|
69
69
|
Store a document as an auditable item graph vertex and add its content to blob storage.
|
|
70
70
|
If the document id already exists and the blob data is different a new revision will be created.
|
|
@@ -72,35 +72,17 @@ For any other changes the current revision will be updated.
|
|
|
72
72
|
|
|
73
73
|
#### Parameters
|
|
74
74
|
|
|
75
|
-
#####
|
|
76
|
-
|
|
77
|
-
`string`
|
|
78
|
-
|
|
79
|
-
The document id to create.
|
|
80
|
-
|
|
81
|
-
##### documentIdFormat
|
|
75
|
+
##### document
|
|
82
76
|
|
|
83
|
-
`
|
|
77
|
+
`IDocumentBase`
|
|
84
78
|
|
|
85
|
-
The
|
|
86
|
-
|
|
87
|
-
##### documentCode
|
|
88
|
-
|
|
89
|
-
`UneceDocumentCodeList`
|
|
90
|
-
|
|
91
|
-
The code for the document type.
|
|
79
|
+
The document base properties.
|
|
92
80
|
|
|
93
81
|
##### blob
|
|
94
82
|
|
|
95
|
-
`Uint8Array
|
|
96
|
-
|
|
97
|
-
The data to create the document with.
|
|
83
|
+
`string` \| `Uint8Array`\<`ArrayBufferLike`\>
|
|
98
84
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
`IJsonLdNodeObject`
|
|
102
|
-
|
|
103
|
-
Additional information to associate with the document.
|
|
85
|
+
The data to create the document with as bytes, or an existing blob storage entry id.
|
|
104
86
|
|
|
105
87
|
##### auditableItemGraphEdges?
|
|
106
88
|
|
|
@@ -112,13 +94,13 @@ The auditable item graph vertices to connect the document to.
|
|
|
112
94
|
|
|
113
95
|
Additional options for the set operation.
|
|
114
96
|
|
|
115
|
-
######
|
|
97
|
+
###### includeAttestation?
|
|
116
98
|
|
|
117
99
|
`boolean`
|
|
118
100
|
|
|
119
101
|
Flag to create an attestation for the document, defaults to false.
|
|
120
102
|
|
|
121
|
-
######
|
|
103
|
+
###### includeAlias?
|
|
122
104
|
|
|
123
105
|
`boolean`
|
|
124
106
|
|
|
@@ -144,7 +126,7 @@ The auditable item graph vertex created for the document including its revision.
|
|
|
144
126
|
|
|
145
127
|
### updatePartial() {#updatepartial}
|
|
146
128
|
|
|
147
|
-
> **updatePartial**(`auditableItemGraphDocumentId`, `blob?`, `
|
|
129
|
+
> **updatePartial**(`auditableItemGraphDocumentId`, `document?`, `blob?`, `auditableItemGraphEdges?`, `options?`): `Promise`\<`void`\>
|
|
148
130
|
|
|
149
131
|
Update a document as an auditable item graph vertex and add its content to blob storage.
|
|
150
132
|
If the blob data is different a new revision will be created.
|
|
@@ -158,17 +140,17 @@ For any other changes the current revision will be updated.
|
|
|
158
140
|
|
|
159
141
|
The auditable item graph vertex id which contains the document.
|
|
160
142
|
|
|
161
|
-
#####
|
|
143
|
+
##### document?
|
|
162
144
|
|
|
163
|
-
`
|
|
145
|
+
`Partial`\<`Pick`\<`IDocumentBase`, `"annotationObject"` \| `"documentIdFormat"` \| `"documentCode"`\>\>
|
|
164
146
|
|
|
165
|
-
The
|
|
147
|
+
The document base properties to update. annotationObject, documentIdFormat and documentCode are applied in-place to the current revision.
|
|
166
148
|
|
|
167
|
-
#####
|
|
149
|
+
##### blob?
|
|
168
150
|
|
|
169
|
-
`
|
|
151
|
+
`string` \| `Uint8Array`\<`ArrayBufferLike`\>
|
|
170
152
|
|
|
171
|
-
|
|
153
|
+
The data to update the document with as bytes, or an existing blob storage entry id.
|
|
172
154
|
|
|
173
155
|
##### auditableItemGraphEdges?
|
|
174
156
|
|
|
@@ -190,6 +172,28 @@ Connections to add; each creates a back-edge on the connected vertex.
|
|
|
190
172
|
|
|
191
173
|
Target vertex IDs to disconnect; their back-edges are removed.
|
|
192
174
|
|
|
175
|
+
##### options?
|
|
176
|
+
|
|
177
|
+
Additional options for the update operation.
|
|
178
|
+
|
|
179
|
+
###### includeAttestation?
|
|
180
|
+
|
|
181
|
+
`boolean`
|
|
182
|
+
|
|
183
|
+
Set to true to start attesting the document, or false to remove the existing attestation. Omit to leave unchanged.
|
|
184
|
+
|
|
185
|
+
###### includeAlias?
|
|
186
|
+
|
|
187
|
+
`boolean`
|
|
188
|
+
|
|
189
|
+
Set to true to add the document id as an alias on the aig vertex, or false to remove it. Omit to leave unchanged.
|
|
190
|
+
|
|
191
|
+
###### aliasAnnotationObject?
|
|
192
|
+
|
|
193
|
+
`IJsonLdNodeObject`
|
|
194
|
+
|
|
195
|
+
Annotation object for the alias when adding.
|
|
196
|
+
|
|
193
197
|
#### Returns
|
|
194
198
|
|
|
195
199
|
`Promise`\<`void`\>
|
|
@@ -288,7 +292,7 @@ The documents and revisions if requested, ordered by revision descending, cursor
|
|
|
288
292
|
|
|
289
293
|
### getRevision() {#getrevision}
|
|
290
294
|
|
|
291
|
-
> **getRevision**(`auditableItemGraphDocumentId`, `revision`, `options?`): `Promise`\<`
|
|
295
|
+
> **getRevision**(`auditableItemGraphDocumentId`, `revision`, `options?`): `Promise`\<`IDocumentHydrated`\>
|
|
292
296
|
|
|
293
297
|
Get a document revision using it's auditable item graph vertex id.
|
|
294
298
|
|
|
@@ -342,7 +346,7 @@ By default extraction will auto detect the mime type of the document, this can b
|
|
|
342
346
|
|
|
343
347
|
#### Returns
|
|
344
348
|
|
|
345
|
-
`Promise`\<`
|
|
349
|
+
`Promise`\<`IDocumentHydrated`\>
|
|
346
350
|
|
|
347
351
|
The document for the specified revision.
|
|
348
352
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/document-management-rest-client",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.19",
|
|
4
4
|
"description": "REST client operations for creating, updating, retrieving, and querying managed documents.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@twin.org/auditable-item-graph-models": "next",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/data-json-ld": "next",
|
|
22
|
-
"@twin.org/document-management-models": "0.0.3-next.
|
|
22
|
+
"@twin.org/document-management-models": "0.0.3-next.19",
|
|
23
23
|
"@twin.org/entity": "next",
|
|
24
24
|
"@twin.org/nameof": "next",
|
|
25
25
|
"@twin.org/standards-unece": "next",
|