@twin.org/document-management-models 0.0.3-next.3 → 0.0.3-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/es/models/IDocument.js.map +1 -1
- package/dist/es/models/IDocumentAttestation.js.map +1 -1
- package/dist/es/models/IDocumentManagementComponent.js.map +1 -1
- package/dist/es/models/api/IDocumentManagementCreateRequest.js.map +1 -1
- package/dist/es/schemas/Document.json +1 -1
- package/dist/types/models/IDocument.d.ts +2 -2
- package/dist/types/models/IDocumentAttestation.d.ts +2 -2
- package/dist/types/models/IDocumentManagementComponent.d.ts +2 -2
- package/dist/types/models/api/IDocumentManagementCreateRequest.d.ts +2 -2
- package/docs/changelog.md +7 -0
- package/docs/reference/interfaces/IDocument.md +1 -1
- package/docs/reference/interfaces/IDocumentAttestation.md +1 -1
- package/docs/reference/interfaces/IDocumentManagementComponent.md +1 -1
- package/docs/reference/interfaces/IDocumentManagementCreateRequest.md +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDocument.js","sourceRoot":"","sources":["../../../src/models/IDocument.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAttestationInformation } from \"@twin.org/attestation-models\";\nimport type { IBlobStorageEntry } from \"@twin.org/blob-storage-models\";\nimport type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { SchemaOrgContexts } from \"@twin.org/standards-schema-org\";\nimport type {
|
|
1
|
+
{"version":3,"file":"IDocument.js","sourceRoot":"","sources":["../../../src/models/IDocument.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAttestationInformation } from \"@twin.org/attestation-models\";\nimport type { IBlobStorageEntry } from \"@twin.org/blob-storage-models\";\nimport type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { SchemaOrgContexts } from \"@twin.org/standards-schema-org\";\nimport type { UneceDocumentCodeList } from \"@twin.org/standards-unece\";\nimport type { DocumentContexts } from \"./documentContexts.js\";\nimport type { DocumentTypes } from \"./documentTypes.js\";\n\n/**\n * Interface describing a document.\n */\nexport interface IDocument {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof DocumentContexts.ContextRoot,\n\t\ttypeof DocumentContexts.ContextRootCommon,\n\t\ttypeof SchemaOrgContexts.ContextRoot,\n\t\t...IJsonLdContextDefinitionElement[]\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof DocumentTypes.Document;\n\n\t/**\n\t * The full id of the document.\n\t */\n\tid: string;\n\n\t/**\n\t * The id of the document.\n\t */\n\tdocumentId: string;\n\n\t/**\n\t * The format of the document id.\n\t */\n\tdocumentIdFormat?: string;\n\n\t/**\n\t * The code for the document type.\n\t */\n\tdocumentCode: UneceDocumentCodeList;\n\n\t/**\n\t * The revision of the document as a 0 based index.\n\t */\n\tdocumentRevision: number;\n\n\t/**\n\t * Additional annotation information for the document.\n\t */\n\tannotationObject?: IJsonLdNodeObject;\n\n\t/**\n\t * The blob storage id for the document.\n\t */\n\tblobStorageId: string;\n\n\t/**\n\t * The hash of the blob data.\n\t */\n\tblobHash: string;\n\n\t/**\n\t * The additional JSON-LD for blob storage if it was requested.\n\t */\n\tblobStorageEntry?: IBlobStorageEntry;\n\n\t/**\n\t * The data extracted from the document using data extraction services.\n\t */\n\textractedData?: unknown;\n\n\t/**\n\t * The attestation for the document if one was created.\n\t */\n\tattestationId?: string;\n\n\t/**\n\t * The additional JSON-LD for attestation storage if it was requested.\n\t */\n\tattestationInformation?: IAttestationInformation;\n\n\t/**\n\t * The date/time of when the document was created.\n\t */\n\tdateCreated: string;\n\n\t/**\n\t * The date/time of when the document was modified.\n\t */\n\tdateModified?: string;\n\n\t/**\n\t * The date/time of when the document was deleted, as we never actually remove items.\n\t */\n\tdateDeleted?: string;\n\n\t/**\n\t * The organization which added the document to the graph.\n\t */\n\torganizationIdentity?: string;\n\n\t/**\n\t * The user who added the document to the graph.\n\t */\n\tuserIdentity?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDocumentAttestation.js","sourceRoot":"","sources":["../../../src/models/IDocumentAttestation.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { SchemaOrgContexts } from \"@twin.org/standards-schema-org\";\nimport type {
|
|
1
|
+
{"version":3,"file":"IDocumentAttestation.js","sourceRoot":"","sources":["../../../src/models/IDocumentAttestation.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { SchemaOrgContexts } from \"@twin.org/standards-schema-org\";\nimport type { UneceDocumentCodeList } from \"@twin.org/standards-unece\";\nimport type { DocumentContexts } from \"./documentContexts.js\";\nimport type { DocumentTypes } from \"./documentTypes.js\";\n\n/**\n * Interface describing a document attestation.\n */\nexport interface IDocumentAttestation {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof DocumentContexts.ContextRoot,\n\t\ttypeof DocumentContexts.ContextRootCommon,\n\t\ttypeof SchemaOrgContexts.ContextRoot\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof DocumentTypes.DocumentAttestation;\n\n\t/**\n\t * The id of the document.\n\t */\n\tdocumentId: string;\n\n\t/**\n\t * The code for the document type.\n\t */\n\tdocumentCode: UneceDocumentCodeList;\n\n\t/**\n\t * The revision of the document as a 0 based index.\n\t */\n\tdocumentRevision: number;\n\n\t/**\n\t * The date/time of when the document was created.\n\t */\n\tdateCreated: string;\n\n\t/**\n\t * The hash of the document being attested.\n\t */\n\tblobHash: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDocumentManagementComponent.js","sourceRoot":"","sources":["../../../src/models/IDocumentManagementComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuditableItemGraphVertexList } from \"@twin.org/auditable-item-graph-models\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type {
|
|
1
|
+
{"version":3,"file":"IDocumentManagementComponent.js","sourceRoot":"","sources":["../../../src/models/IDocumentManagementComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuditableItemGraphVertexList } from \"@twin.org/auditable-item-graph-models\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { UneceDocumentCodeList } from \"@twin.org/standards-unece\";\nimport type { IDocument } from \"./IDocument.js\";\nimport type { IDocumentList } from \"./IDocumentList.js\";\n\n/**\n * Interface describing an document management contract.\n */\nexport interface IDocumentManagementComponent extends IComponent {\n\t/**\n\t * Create 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\tcreate(\n\t\tdocumentId: string,\n\t\tdocumentIdFormat: string | undefined,\n\t\tdocumentCode: UneceDocumentCodeList,\n\t\tblob: Uint8Array,\n\t\tannotationObject?: IJsonLdNodeObject,\n\t\tauditableItemGraphEdges?: {\n\t\t\ttargetId: string;\n\t\t\taddAlias?: boolean;\n\t\t\taliasAnnotationObject?: IJsonLdNodeObject;\n\t\t}[],\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\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 The auditable item graph vertices to connect the document to, if undefined retains current connections.\n\t * @returns Nothing.\n\t */\n\tupdate(\n\t\tauditableItemGraphDocumentId: string,\n\t\tblob?: Uint8Array,\n\t\tannotationObject?: IJsonLdNodeObject,\n\t\tauditableItemGraphEdges?: {\n\t\t\ttargetId: string;\n\t\t\taddAlias?: boolean;\n\t\t\taliasAnnotationObject?: IJsonLdNodeObject;\n\t\t}[]\n\t): Promise<void>;\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.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 Limit the number 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\tget(\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\textractRuleGroupId?: string;\n\t\t\textractMimeType?: string;\n\t\t},\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<IDocumentList>;\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 of the document to get.\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 documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.\n\t */\n\tgetRevision(\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\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 Nothing.\n\t */\n\tremoveRevision(auditableItemGraphDocumentId: string, revision: number): Promise<void>;\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\tquery(\n\t\tdocumentId: string,\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<IAuditableItemGraphVertexList>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDocumentManagementCreateRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type {
|
|
1
|
+
{"version":3,"file":"IDocumentManagementCreateRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { UneceDocumentCodeList } from \"@twin.org/standards-unece\";\n\n/**\n * Request to create a document as an auditable item graph vertex.\n */\nexport interface IDocumentManagementCreateRequest {\n\t/**\n\t * The body parameters.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The document id to create.\n\t\t */\n\t\tdocumentId: string;\n\n\t\t/**\n\t\t * The format of the document identifier.\n\t\t */\n\t\tdocumentIdFormat: string | undefined;\n\n\t\t/**\n\t\t * The code for the document type.\n\t\t */\n\t\tdocumentCode: UneceDocumentCodeList;\n\n\t\t/**\n\t\t * The data to create the document with, in base64.\n\t\t */\n\t\tblob: string;\n\n\t\t/**\n\t\t * Additional information to associate with the document.\n\t\t */\n\t\tannotationObject?: IJsonLdNodeObject;\n\n\t\t/**\n\t\t * The auditable item graph vertices to connect the document to.\n\t\t */\n\t\tauditableItemGraphEdges?: {\n\t\t\ttargetId: string;\n\t\t\taddAlias?: boolean;\n\t\t\taliasAnnotationObject?: IJsonLdNodeObject;\n\t\t}[];\n\n\t\t/**\n\t\t * Flag to create an attestation for the document, defaults to false.\n\t\t */\n\t\tcreateAttestation?: boolean;\n\n\t\t/**\n\t\t * Flag to add the document id as an alias to the aig vertex, defaults to true.\n\t\t */\n\t\taddAlias?: boolean;\n\n\t\t/**\n\t\t * Annotation object for the alias.\n\t\t */\n\t\taliasAnnotationObject?: IJsonLdNodeObject;\n\t};\n}\n"]}
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"description": "The format of the document id."
|
|
45
45
|
},
|
|
46
46
|
"documentCode": {
|
|
47
|
-
"$ref": "https://schema.twindev.org/
|
|
47
|
+
"$ref": "https://schema.twindev.org/unece/UneceDocumentCodeList",
|
|
48
48
|
"description": "The code for the document type."
|
|
49
49
|
},
|
|
50
50
|
"documentRevision": {
|
|
@@ -2,7 +2,7 @@ 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
4
|
import type { SchemaOrgContexts } from "@twin.org/standards-schema-org";
|
|
5
|
-
import type {
|
|
5
|
+
import type { UneceDocumentCodeList } from "@twin.org/standards-unece";
|
|
6
6
|
import type { DocumentContexts } from "./documentContexts.js";
|
|
7
7
|
import type { DocumentTypes } from "./documentTypes.js";
|
|
8
8
|
/**
|
|
@@ -37,7 +37,7 @@ export interface IDocument {
|
|
|
37
37
|
/**
|
|
38
38
|
* The code for the document type.
|
|
39
39
|
*/
|
|
40
|
-
documentCode:
|
|
40
|
+
documentCode: UneceDocumentCodeList;
|
|
41
41
|
/**
|
|
42
42
|
* The revision of the document as a 0 based index.
|
|
43
43
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SchemaOrgContexts } from "@twin.org/standards-schema-org";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UneceDocumentCodeList } from "@twin.org/standards-unece";
|
|
3
3
|
import type { DocumentContexts } from "./documentContexts.js";
|
|
4
4
|
import type { DocumentTypes } from "./documentTypes.js";
|
|
5
5
|
/**
|
|
@@ -25,7 +25,7 @@ export interface IDocumentAttestation {
|
|
|
25
25
|
/**
|
|
26
26
|
* The code for the document type.
|
|
27
27
|
*/
|
|
28
|
-
documentCode:
|
|
28
|
+
documentCode: UneceDocumentCodeList;
|
|
29
29
|
/**
|
|
30
30
|
* The revision of the document as a 0 based index.
|
|
31
31
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IAuditableItemGraphVertexList } from "@twin.org/auditable-item-graph-models";
|
|
2
2
|
import type { IComponent } from "@twin.org/core";
|
|
3
3
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
4
|
-
import type {
|
|
4
|
+
import type { UneceDocumentCodeList } from "@twin.org/standards-unece";
|
|
5
5
|
import type { IDocument } from "./IDocument.js";
|
|
6
6
|
import type { IDocumentList } from "./IDocumentList.js";
|
|
7
7
|
/**
|
|
@@ -24,7 +24,7 @@ export interface IDocumentManagementComponent extends IComponent {
|
|
|
24
24
|
* @param options.aliasAnnotationObject Annotation object for the alias.
|
|
25
25
|
* @returns The auditable item graph vertex created for the document including its revision.
|
|
26
26
|
*/
|
|
27
|
-
create(documentId: string, documentIdFormat: string | undefined, documentCode:
|
|
27
|
+
create(documentId: string, documentIdFormat: string | undefined, documentCode: UneceDocumentCodeList, blob: Uint8Array, annotationObject?: IJsonLdNodeObject, auditableItemGraphEdges?: {
|
|
28
28
|
targetId: string;
|
|
29
29
|
addAlias?: boolean;
|
|
30
30
|
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UneceDocumentCodeList } from "@twin.org/standards-unece";
|
|
3
3
|
/**
|
|
4
4
|
* Request to create a document as an auditable item graph vertex.
|
|
5
5
|
*/
|
|
@@ -19,7 +19,7 @@ export interface IDocumentManagementCreateRequest {
|
|
|
19
19
|
/**
|
|
20
20
|
* The code for the document type.
|
|
21
21
|
*/
|
|
22
|
-
documentCode:
|
|
22
|
+
documentCode: UneceDocumentCodeList;
|
|
23
23
|
/**
|
|
24
24
|
* The data to create the document with, in base64.
|
|
25
25
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @twin.org/document-management-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.4](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.3...document-management-models-v0.0.3-next.4) (2026-01-06)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update unece dependencies ([a27548c](https://github.com/twinfoundation/document-management/commit/a27548cdebbe1d9577fc8341166538c2f07348a3))
|
|
9
|
+
|
|
3
10
|
## [0.0.3-next.3](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.2...document-management-models-v0.0.3-next.3) (2025-12-03)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED