@twin.org/document-management-models 0.0.3-next.5 → 0.0.3-next.7

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.
@@ -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 { 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.Namespace,\n\t\ttypeof DocumentContexts.NamespaceCommon,\n\t\ttypeof SchemaOrgContexts.Namespace,\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
+ {"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.Context,\n\t\ttypeof DocumentContexts.ContextCommon,\n\t\ttypeof SchemaOrgContexts.Context,\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 { 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.Namespace,\n\t\ttypeof DocumentContexts.NamespaceCommon,\n\t\ttypeof SchemaOrgContexts.Namespace\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
+ {"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.Context,\n\t\ttypeof DocumentContexts.ContextCommon,\n\t\ttypeof SchemaOrgContexts.Context\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":"IDocumentList.js","sourceRoot":"","sources":["../../../src/models/IDocumentList.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { SchemaOrgContexts, SchemaOrgTypes } from \"@twin.org/standards-schema-org\";\nimport type { DocumentContexts } from \"./documentContexts.js\";\nimport type { IDocument } from \"./IDocument.js\";\n\n/**\n * Interface describing a list of document entries.\n */\nexport interface IDocumentList {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof SchemaOrgContexts.Namespace,\n\t\ttypeof DocumentContexts.Namespace,\n\t\ttypeof DocumentContexts.NamespaceCommon,\n\t\t...IJsonLdContextDefinitionElement[]\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof SchemaOrgTypes.ItemList;\n\n\t/**\n\t * The list of documents.\n\t */\n\t[SchemaOrgTypes.ItemListElement]: IDocument[];\n\n\t/**\n\t * The ids of the other vertices which are connected to the document.\n\t */\n\tedges?: string[];\n\n\t/**\n\t * The cursor to get the next chunk of documents.\n\t */\n\t[SchemaOrgTypes.NextItem]?: string;\n}\n"]}
1
+ {"version":3,"file":"IDocumentList.js","sourceRoot":"","sources":["../../../src/models/IDocumentList.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { SchemaOrgContexts, SchemaOrgTypes } from \"@twin.org/standards-schema-org\";\nimport type { DocumentContexts } from \"./documentContexts.js\";\nimport type { IDocument } from \"./IDocument.js\";\n\n/**\n * Interface describing a list of document entries.\n */\nexport interface IDocumentList {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof SchemaOrgContexts.Context,\n\t\ttypeof DocumentContexts.Context,\n\t\ttypeof DocumentContexts.ContextCommon,\n\t\t...IJsonLdContextDefinitionElement[]\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof SchemaOrgTypes.ItemList;\n\n\t/**\n\t * The list of documents.\n\t */\n\t[SchemaOrgTypes.ItemListElement]: IDocument[];\n\n\t/**\n\t * The ids of the other vertices which are connected to the document.\n\t */\n\tedges?: 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 { 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
+ {"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<{\n\t\tentries: IDocumentList;\n\t\tcursor?: string;\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 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<{\n\t\tentries: IAuditableItemGraphVertexList;\n\t\tcursor?: string;\n\t}>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IDocumentManagementGetResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\nimport type { IDocumentList } from \"../IDocumentList.js\";\n\n/**\n * Response to get a document and optionally revisions from an auditable item graph vertex.\n */\nexport interface IDocumentManagementGetResponse {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The body parameters.\n\t */\n\tbody: IDocumentList;\n}\n"]}
1
+ {"version":3,"file":"IDocumentManagementGetResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\nimport type { IDocumentList } from \"../IDocumentList.js\";\n\n/**\n * Response to get a document and optionally revisions from an auditable item graph vertex.\n */\nexport interface IDocumentManagementGetResponse {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t\t[HeaderTypes.Link]?: string | string[];\n\t};\n\n\t/**\n\t * The body parameters.\n\t */\n\tbody: IDocumentList;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IDocumentManagementQueryResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementQueryResponse.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 { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Response to query the documents from an auditable item graph vertex.\n */\nexport interface IDocumentManagementQueryResponse {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The body parameters.\n\t */\n\tbody: IAuditableItemGraphVertexList;\n}\n"]}
1
+ {"version":3,"file":"IDocumentManagementQueryResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementQueryResponse.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 { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Response to query the documents from an auditable item graph vertex.\n */\nexport interface IDocumentManagementQueryResponse {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t\t[HeaderTypes.Link]?: string | string[];\n\t};\n\n\t/**\n\t * The body parameters.\n\t */\n\tbody: IAuditableItemGraphVertexList;\n}\n"]}
@@ -6,12 +6,28 @@
6
6
  // eslint-disable-next-line @typescript-eslint/naming-convention
7
7
  export const DocumentContexts = {
8
8
  /**
9
- * The namespace for the document types.
9
+ * The canonical RDF namespace URI for Document Management.
10
10
  */
11
11
  Namespace: "https://schema.twindev.org/documents/",
12
12
  /**
13
- * The namespace for the common types.
13
+ * The value to use in context for Document Management.
14
14
  */
15
- NamespaceCommon: "https://schema.twindev.org/common/"
15
+ Context: "https://schema.twindev.org/documents/",
16
+ /**
17
+ * The JSON-LD Context URL for Document Management.
18
+ */
19
+ JsonLdContext: "https://schema.twindev.org/documents/types.jsonld",
20
+ /**
21
+ * The canonical RDF namespace URI for TWIN Common.
22
+ */
23
+ NamespaceCommon: "https://schema.twindev.org/common/",
24
+ /**
25
+ * The value to use in JSON-LD context for TWIN Common.
26
+ */
27
+ ContextCommon: "https://schema.twindev.org/common/",
28
+ /**
29
+ * The JSON-LD Context URL for TWIN Common.
30
+ */
31
+ JsonLdContextCommon: "https://schema.twindev.org/common/types.jsonld"
16
32
  };
17
33
  //# sourceMappingURL=documentContexts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"documentContexts.js","sourceRoot":"","sources":["../../../src/models/documentContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B;;OAEG;IACH,SAAS,EAAE,uCAAuC;IAElD;;OAEG;IACH,eAAe,EAAE,oCAAoC;CAC5C,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts of document management objects.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DocumentContexts = {\n\t/**\n\t * The namespace for the document types.\n\t */\n\tNamespace: \"https://schema.twindev.org/documents/\",\n\n\t/**\n\t * The namespace for the common types.\n\t */\n\tNamespaceCommon: \"https://schema.twindev.org/common/\"\n} as const;\n\n/**\n * The contexts of document management objects.\n */\nexport type DocumentContexts = (typeof DocumentContexts)[keyof typeof DocumentContexts];\n"]}
1
+ {"version":3,"file":"documentContexts.js","sourceRoot":"","sources":["../../../src/models/documentContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B;;OAEG;IACH,SAAS,EAAE,uCAAuC;IAElD;;OAEG;IACH,OAAO,EAAE,uCAAuC;IAEhD;;OAEG;IACH,aAAa,EAAE,mDAAmD;IAElE;;OAEG;IACH,eAAe,EAAE,oCAAoC;IAErD;;OAEG;IACH,aAAa,EAAE,oCAAoC;IAEnD;;OAEG;IACH,mBAAmB,EAAE,gDAAgD;CAC5D,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts of document management objects.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DocumentContexts = {\n\t/**\n\t * The canonical RDF namespace URI for Document Management.\n\t */\n\tNamespace: \"https://schema.twindev.org/documents/\",\n\n\t/**\n\t * The value to use in context for Document Management.\n\t */\n\tContext: \"https://schema.twindev.org/documents/\",\n\n\t/**\n\t * The JSON-LD Context URL for Document Management.\n\t */\n\tJsonLdContext: \"https://schema.twindev.org/documents/types.jsonld\",\n\n\t/**\n\t * The canonical RDF namespace URI for TWIN Common.\n\t */\n\tNamespaceCommon: \"https://schema.twindev.org/common/\",\n\n\t/**\n\t * The value to use in JSON-LD context for TWIN Common.\n\t */\n\tContextCommon: \"https://schema.twindev.org/common/\",\n\n\t/**\n\t * The JSON-LD Context URL for TWIN Common.\n\t */\n\tJsonLdContextCommon: \"https://schema.twindev.org/common/types.jsonld\"\n} as const;\n\n/**\n * The contexts of document management objects.\n */\nexport type DocumentContexts = (typeof DocumentContexts)[keyof typeof DocumentContexts];\n"]}
@@ -13,9 +13,9 @@ export interface IDocument {
13
13
  * JSON-LD Context.
14
14
  */
15
15
  "@context": [
16
- typeof DocumentContexts.Namespace,
17
- typeof DocumentContexts.NamespaceCommon,
18
- typeof SchemaOrgContexts.Namespace,
16
+ typeof DocumentContexts.Context,
17
+ typeof DocumentContexts.ContextCommon,
18
+ typeof SchemaOrgContexts.Context,
19
19
  ...IJsonLdContextDefinitionElement[]
20
20
  ];
21
21
  /**
@@ -10,9 +10,9 @@ export interface IDocumentAttestation {
10
10
  * JSON-LD Context.
11
11
  */
12
12
  "@context": [
13
- typeof DocumentContexts.Namespace,
14
- typeof DocumentContexts.NamespaceCommon,
15
- typeof SchemaOrgContexts.Namespace
13
+ typeof DocumentContexts.Context,
14
+ typeof DocumentContexts.ContextCommon,
15
+ typeof SchemaOrgContexts.Context
16
16
  ];
17
17
  /**
18
18
  * JSON-LD Type.
@@ -10,9 +10,9 @@ export interface IDocumentList {
10
10
  * JSON-LD Context.
11
11
  */
12
12
  "@context": [
13
- typeof SchemaOrgContexts.Namespace,
14
- typeof DocumentContexts.Namespace,
15
- typeof DocumentContexts.NamespaceCommon,
13
+ typeof SchemaOrgContexts.Context,
14
+ typeof DocumentContexts.Context,
15
+ typeof DocumentContexts.ContextCommon,
16
16
  ...IJsonLdContextDefinitionElement[]
17
17
  ];
18
18
  /**
@@ -27,8 +27,4 @@ export interface IDocumentList {
27
27
  * The ids of the other vertices which are connected to the document.
28
28
  */
29
29
  edges?: string[];
30
- /**
31
- * The cursor to get the next chunk of documents.
32
- */
33
- [SchemaOrgTypes.NextItem]?: string;
34
30
  }
@@ -69,7 +69,10 @@ export interface IDocumentManagementComponent extends IComponent {
69
69
  includeRemoved?: boolean;
70
70
  extractRuleGroupId?: string;
71
71
  extractMimeType?: string;
72
- }, cursor?: string, limit?: number): Promise<IDocumentList>;
72
+ }, cursor?: string, limit?: number): Promise<{
73
+ entries: IDocumentList;
74
+ cursor?: string;
75
+ }>;
73
76
  /**
74
77
  * Get a document revision using it's auditable item graph vertex id.
75
78
  * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
@@ -104,5 +107,8 @@ export interface IDocumentManagementComponent extends IComponent {
104
107
  * @param limit The limit to get the next chunk of documents.
105
108
  * @returns The graph vertices that contain documents referencing the specified document id.
106
109
  */
107
- query(documentId: string, cursor?: string, limit?: number): Promise<IAuditableItemGraphVertexList>;
110
+ query(documentId: string, cursor?: string, limit?: number): Promise<{
111
+ entries: IAuditableItemGraphVertexList;
112
+ cursor?: string;
113
+ }>;
108
114
  }
@@ -9,6 +9,7 @@ export interface IDocumentManagementGetResponse {
9
9
  */
10
10
  headers?: {
11
11
  [HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
12
+ [HeaderTypes.Link]?: string | string[];
12
13
  };
13
14
  /**
14
15
  * The body parameters.
@@ -9,6 +9,7 @@ export interface IDocumentManagementQueryResponse {
9
9
  */
10
10
  headers?: {
11
11
  [HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;
12
+ [HeaderTypes.Link]?: string | string[];
12
13
  };
13
14
  /**
14
15
  * The body parameters.
@@ -3,13 +3,29 @@
3
3
  */
4
4
  export declare const DocumentContexts: {
5
5
  /**
6
- * The namespace for the document types.
6
+ * The canonical RDF namespace URI for Document Management.
7
7
  */
8
8
  readonly Namespace: "https://schema.twindev.org/documents/";
9
9
  /**
10
- * The namespace for the common types.
10
+ * The value to use in context for Document Management.
11
+ */
12
+ readonly Context: "https://schema.twindev.org/documents/";
13
+ /**
14
+ * The JSON-LD Context URL for Document Management.
15
+ */
16
+ readonly JsonLdContext: "https://schema.twindev.org/documents/types.jsonld";
17
+ /**
18
+ * The canonical RDF namespace URI for TWIN Common.
11
19
  */
12
20
  readonly NamespaceCommon: "https://schema.twindev.org/common/";
21
+ /**
22
+ * The value to use in JSON-LD context for TWIN Common.
23
+ */
24
+ readonly ContextCommon: "https://schema.twindev.org/common/";
25
+ /**
26
+ * The JSON-LD Context URL for TWIN Common.
27
+ */
28
+ readonly JsonLdContextCommon: "https://schema.twindev.org/common/types.jsonld";
13
29
  };
14
30
  /**
15
31
  * The contexts of document management objects.
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @twin.org/document-management-models - Changelog
2
2
 
3
+ ## [0.0.3-next.7](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.6...document-management-models-v0.0.3-next.7) (2026-01-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * replace nextItem property with Link header ([#34](https://github.com/twinfoundation/document-management/issues/34)) ([3f04c3f](https://github.com/twinfoundation/document-management/commit/3f04c3fb5c9ec0c56f213089a15cc247fbfbd59c))
9
+
10
+ ## [0.0.3-next.6](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.5...document-management-models-v0.0.3-next.6) (2026-01-22)
11
+
12
+
13
+ ### Features
14
+
15
+ * update contexts ([#32](https://github.com/twinfoundation/document-management/issues/32)) ([2fc1d92](https://github.com/twinfoundation/document-management/commit/2fc1d9200ecd8b755efb552c5f84f996cb61e64a))
16
+
3
17
  ## [0.0.3-next.5](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.4...document-management-models-v0.0.3-next.5) (2026-01-14)
4
18
 
5
19
 
@@ -33,11 +33,3 @@ The list of documents.
33
33
  > `optional` **edges**: `string`[]
34
34
 
35
35
  The ids of the other vertices which are connected to the document.
36
-
37
- ***
38
-
39
- ### nextItem?
40
-
41
- > `optional` **nextItem**: `string`
42
-
43
- The cursor to get the next chunk of documents.
@@ -128,7 +128,7 @@ Nothing.
128
128
 
129
129
  ### get()
130
130
 
131
- > **get**(`auditableItemGraphDocumentId`, `options?`, `cursor?`, `limit?`): `Promise`\<[`IDocumentList`](IDocumentList.md)\>
131
+ > **get**(`auditableItemGraphDocumentId`, `options?`, `cursor?`, `limit?`): `Promise`\<\{ `entries`: [`IDocumentList`](IDocumentList.md); `cursor?`: `string`; \}\>
132
132
 
133
133
  Get a document using it's auditable item graph vertex id and optional revision.
134
134
 
@@ -194,7 +194,7 @@ Limit the number of items to return, defaults to 1 so only most recent is return
194
194
 
195
195
  #### Returns
196
196
 
197
- `Promise`\<[`IDocumentList`](IDocumentList.md)\>
197
+ `Promise`\<\{ `entries`: [`IDocumentList`](IDocumentList.md); `cursor?`: `string`; \}\>
198
198
 
199
199
  The documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.
200
200
 
@@ -293,7 +293,7 @@ Nothing.
293
293
 
294
294
  ### query()
295
295
 
296
- > **query**(`documentId`, `cursor?`, `limit?`): `Promise`\<`IAuditableItemGraphVertexList`\>
296
+ > **query**(`documentId`, `cursor?`, `limit?`): `Promise`\<\{ `entries`: `IAuditableItemGraphVertexList`; `cursor?`: `string`; \}\>
297
297
 
298
298
  Find all the document with a specific id.
299
299
 
@@ -319,6 +319,6 @@ The limit to get the next chunk of documents.
319
319
 
320
320
  #### Returns
321
321
 
322
- `Promise`\<`IAuditableItemGraphVertexList`\>
322
+ `Promise`\<\{ `entries`: `IAuditableItemGraphVertexList`; `cursor?`: `string`; \}\>
323
323
 
324
324
  The graph vertices that contain documents referencing the specified document id.
@@ -14,6 +14,10 @@ The headers which can be used to determine the response data type.
14
14
 
15
15
  > **content-type**: `"application/json"` \| `"application/ld+json"`
16
16
 
17
+ #### link?
18
+
19
+ > `optional` **link**: `string` \| `string`[]
20
+
17
21
  ***
18
22
 
19
23
  ### body
@@ -14,6 +14,10 @@ The headers which can be used to determine the response data type.
14
14
 
15
15
  > **content-type**: `"application/json"` \| `"application/ld+json"`
16
16
 
17
+ #### link?
18
+
19
+ > `optional` **link**: `string` \| `string`[]
20
+
17
21
  ***
18
22
 
19
23
  ### body
@@ -10,10 +10,34 @@ The contexts of document management objects.
10
10
 
11
11
  > `readonly` **Namespace**: `"https://schema.twindev.org/documents/"` = `"https://schema.twindev.org/documents/"`
12
12
 
13
- The namespace for the document types.
13
+ The canonical RDF namespace URI for Document Management.
14
+
15
+ ### Context
16
+
17
+ > `readonly` **Context**: `"https://schema.twindev.org/documents/"` = `"https://schema.twindev.org/documents/"`
18
+
19
+ The value to use in context for Document Management.
20
+
21
+ ### JsonLdContext
22
+
23
+ > `readonly` **JsonLdContext**: `"https://schema.twindev.org/documents/types.jsonld"` = `"https://schema.twindev.org/documents/types.jsonld"`
24
+
25
+ The JSON-LD Context URL for Document Management.
14
26
 
15
27
  ### NamespaceCommon
16
28
 
17
29
  > `readonly` **NamespaceCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
18
30
 
19
- The namespace for the common types.
31
+ The canonical RDF namespace URI for TWIN Common.
32
+
33
+ ### ContextCommon
34
+
35
+ > `readonly` **ContextCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
36
+
37
+ The value to use in JSON-LD context for TWIN Common.
38
+
39
+ ### JsonLdContextCommon
40
+
41
+ > `readonly` **JsonLdContextCommon**: `"https://schema.twindev.org/common/types.jsonld"` = `"https://schema.twindev.org/common/types.jsonld"`
42
+
43
+ The JSON-LD Context URL for TWIN Common.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/document-management-models",
3
- "version": "0.0.3-next.5",
3
+ "version": "0.0.3-next.7",
4
4
  "description": "Models which define the structure of the document management connectors and services",
5
5
  "repository": {
6
6
  "type": "git",