@twin.org/document-management-models 0.0.3-next.1 → 0.0.3-next.11
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/dataTypes/documentManagementDataTypes.js +4 -4
- package/dist/es/dataTypes/documentManagementDataTypes.js.map +1 -1
- package/dist/es/models/IDocument.js.map +1 -1
- package/dist/es/models/IDocumentAttestation.js.map +1 -1
- package/dist/es/models/IDocumentList.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/models/api/IDocumentManagementGetRequest.js.map +1 -1
- package/dist/es/models/api/IDocumentManagementGetResponse.js.map +1 -1
- package/dist/es/models/api/IDocumentManagementGetRevisionRequest.js.map +1 -1
- package/dist/es/models/api/IDocumentManagementQueryResponse.js.map +1 -1
- package/dist/es/models/documentContexts.js +20 -4
- package/dist/es/models/documentContexts.js.map +1 -1
- package/dist/es/schemas/Document.json +23 -24
- package/dist/types/models/IDocument.d.ts +23 -7
- package/dist/types/models/IDocumentAttestation.d.ts +12 -7
- package/dist/types/models/IDocumentList.d.ts +5 -7
- package/dist/types/models/IDocumentManagementComponent.d.ts +10 -4
- package/dist/types/models/api/IDocumentManagementCreateRequest.d.ts +2 -2
- package/dist/types/models/api/IDocumentManagementGetRequest.d.ts +4 -4
- package/dist/types/models/api/IDocumentManagementGetResponse.d.ts +1 -0
- package/dist/types/models/api/IDocumentManagementGetRevisionRequest.d.ts +3 -3
- package/dist/types/models/api/IDocumentManagementQueryResponse.d.ts +1 -0
- package/dist/types/models/documentContexts.d.ts +20 -4
- package/docs/changelog.md +71 -0
- package/docs/reference/interfaces/IDocument.md +21 -5
- package/docs/reference/interfaces/IDocumentAttestation.md +10 -5
- package/docs/reference/interfaces/IDocumentList.md +2 -8
- package/docs/reference/interfaces/IDocumentManagementComponent.md +5 -5
- package/docs/reference/interfaces/IDocumentManagementCreateRequest.md +1 -1
- package/docs/reference/interfaces/IDocumentManagementGetRequest.md +4 -4
- package/docs/reference/interfaces/IDocumentManagementGetResponse.md +4 -0
- package/docs/reference/interfaces/IDocumentManagementGetRevisionRequest.md +3 -3
- package/docs/reference/interfaces/IDocumentManagementQueryResponse.md +4 -0
- package/docs/reference/variables/DocumentContexts.md +30 -6
- package/package.json +1 -1
|
@@ -12,14 +12,14 @@ export class DocumentManagementDataTypes {
|
|
|
12
12
|
* Register all the data types.
|
|
13
13
|
*/
|
|
14
14
|
static registerTypes() {
|
|
15
|
-
DataTypeHandlerFactory.register(`${DocumentContexts.
|
|
16
|
-
|
|
15
|
+
DataTypeHandlerFactory.register(`${DocumentContexts.Namespace}${DocumentTypes.Document}`, () => ({
|
|
16
|
+
namespace: DocumentContexts.Namespace,
|
|
17
17
|
type: DocumentTypes.Document,
|
|
18
18
|
defaultValue: {},
|
|
19
19
|
jsonSchema: async () => DocumentSchema
|
|
20
20
|
}));
|
|
21
|
-
DataTypeHandlerFactory.register(`${DocumentContexts.
|
|
22
|
-
|
|
21
|
+
DataTypeHandlerFactory.register(`${DocumentContexts.Namespace}${DocumentTypes.DocumentAttestation}`, () => ({
|
|
22
|
+
namespace: DocumentContexts.Namespace,
|
|
23
23
|
type: DocumentTypes.DocumentAttestation,
|
|
24
24
|
defaultValue: {},
|
|
25
25
|
jsonSchema: async () => DocumentSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentManagementDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/documentManagementDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,sBAAsB,EAAoB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,cAAc,MAAM,0BAA0B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE5E;;GAEG;AACH,MAAM,OAAO,2BAA2B;IACvC;;OAEG;IACI,MAAM,CAAC,aAAa;QAC1B,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"documentManagementDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/documentManagementDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,sBAAsB,EAAoB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,cAAc,MAAM,0BAA0B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE5E;;GAEG;AACH,MAAM,OAAO,2BAA2B;IACvC;;OAEG;IACI,MAAM,CAAC,aAAa;QAC1B,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,gBAAgB,CAAC,SAAS,GAAG,aAAa,CAAC,QAAQ,EAAE,EACxD,GAAG,EAAE,CAAC,CAAC;YACN,SAAS,EAAE,gBAAgB,CAAC,SAAS;YACrC,IAAI,EAAE,aAAa,CAAC,QAAQ;YAC5B,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,cAA6B;SACrD,CAAC,CACF,CAAC;QAEF,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,gBAAgB,CAAC,SAAS,GAAG,aAAa,CAAC,mBAAmB,EAAE,EACnE,GAAG,EAAE,CAAC,CAAC;YACN,SAAS,EAAE,gBAAgB,CAAC,SAAS;YACrC,IAAI,EAAE,aAAa,CAAC,mBAAmB;YACvC,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,cAA6B;SACrD,CAAC,CACF,CAAC;IACH,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHandlerFactory, type IJsonSchema } from \"@twin.org/data-core\";\nimport { DocumentContexts } from \"../models/documentContexts.js\";\nimport { DocumentTypes } from \"../models/documentTypes.js\";\nimport DocumentSchema from \"../schemas/Document.json\" with { type: \"json\" };\n\n/**\n * Handle all the data types for document management.\n */\nexport class DocumentManagementDataTypes {\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${DocumentContexts.Namespace}${DocumentTypes.Document}`,\n\t\t\t() => ({\n\t\t\t\tnamespace: DocumentContexts.Namespace,\n\t\t\t\ttype: DocumentTypes.Document,\n\t\t\t\tdefaultValue: {},\n\t\t\t\tjsonSchema: async () => DocumentSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${DocumentContexts.Namespace}${DocumentTypes.DocumentAttestation}`,\n\t\t\t() => ({\n\t\t\t\tnamespace: DocumentContexts.Namespace,\n\t\t\t\ttype: DocumentTypes.DocumentAttestation,\n\t\t\t\tdefaultValue: {},\n\t\t\t\tjsonSchema: async () => DocumentSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t}\n}\n"]}
|
|
@@ -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 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 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 * json-ld type:schema:identifier\n\t */\n\tdocumentId: string;\n\n\t/**\n\t * The format of the document id.\n\t * json-ld type:schema:Text\n\t */\n\tdocumentIdFormat?: string;\n\n\t/**\n\t * The code for the document type.\n\t * json-ld type:schema:identifier\n\t */\n\tdocumentCode: UneceDocumentCodeList;\n\n\t/**\n\t * The revision of the document as a 0 based index.\n\t * json-ld type:schema:Integer\n\t */\n\tdocumentRevision: number;\n\n\t/**\n\t * Additional annotation information for the document.\n\t * json-ld namespace:twin-common\n\t */\n\tannotationObject?: IJsonLdNodeObject;\n\n\t/**\n\t * The blob storage id for the document.\n\t * json-ld type:schema:identifier\n\t */\n\tblobStorageId: string;\n\n\t/**\n\t * The integrity of the blob data.\n\t * json-ld namespace:twin-common\n\t */\n\tintegrity: string;\n\n\t/**\n\t * The additional JSON-LD for blob storage if it was requested.\n\t * json-ld id\n\t */\n\tblobStorageEntry?: IBlobStorageEntry;\n\n\t/**\n\t * The data extracted from the document using data extraction services.\n\t * json-ld type:json\n\t */\n\textractedData?: unknown;\n\n\t/**\n\t * The attestation for the document if one was created.\n\t * json-ld type:schema:identifier\n\t */\n\tattestationId?: string;\n\n\t/**\n\t * The additional JSON-LD for attestation storage if it was requested.\n\t * json-ld id\n\t */\n\tattestationInformation?: IAttestationInformation;\n\n\t/**\n\t * The date/time of when the document was created.\n\t * json-ld namespace:schema\n\t */\n\tdateCreated: string;\n\n\t/**\n\t * The date/time of when the document was modified.\n\t * json-ld namespace:schema\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 * json-ld namespace:schema\n\t */\n\tdateDeleted?: string;\n\n\t/**\n\t * The organization which added the document to the graph.\n\t * json-ld namespace:twin-common\n\t */\n\torganizationIdentity?: string;\n\n\t/**\n\t * The user who added the document to the graph.\n\t * json-ld namespace:twin-common\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 SchemaOrgContexts.Context,\n\t\ttypeof DocumentContexts.Context,\n\t\ttypeof DocumentContexts.ContextCommon\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 * json-ld type:schema:identifier\n\t */\n\tdocumentId: string;\n\n\t/**\n\t * The code for the document type.\n\t * json-ld type:schema:identifier\n\t */\n\tdocumentCode: UneceDocumentCodeList;\n\n\t/**\n\t * The revision of the document as a 0 based index.\n\t * json-ld type:schema:Integer\n\t */\n\tdocumentRevision: number;\n\n\t/**\n\t * The date/time of when the document was created.\n\t * json-ld namespace:schema\n\t */\n\tdateCreated: string;\n\n\t/**\n\t * The integrity of the document being attested.\n\t * json-ld namespace:twin-common\n\t */\n\tintegrity: 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.
|
|
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 * json-ld namespace:schema\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 * json-ld container:set\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 {
|
|
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":"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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDocumentManagementGetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementGetRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Request to get a document from an auditable item graph vertex.\n */\nexport interface IDocumentManagementGetRequest {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The full id of the document to get.\n\t\t */\n\t\tauditableItemGraphDocumentId: string;\n\t};\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * Include the blob storage metadata in the response.\n\t\t * @default false\n\t\t */\n\t\tincludeBlobStorageMetadata?:
|
|
1
|
+
{"version":3,"file":"IDocumentManagementGetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementGetRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Request to get a document from an auditable item graph vertex.\n */\nexport interface IDocumentManagementGetRequest {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The full id of the document to get.\n\t\t */\n\t\tauditableItemGraphDocumentId: string;\n\t};\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * Include the blob storage metadata in the response.\n\t\t * @default false\n\t\t */\n\t\tincludeBlobStorageMetadata?: string;\n\n\t\t/**\n\t\t * Include the blob storage data in the response.\n\t\t * @default false\n\t\t */\n\t\tincludeBlobStorageData?: string;\n\n\t\t/**\n\t\t * Include the attestation information in the response.\n\t\t * @default false\n\t\t */\n\t\tincludeAttestation?: string;\n\n\t\t/**\n\t\t * Include deleted documents in the response.\n\t\t * @default false\n\t\t */\n\t\tincludeRemoved?: string;\n\n\t\t/**\n\t\t * If provided will extract data from the document using the specified rule group id.\n\t\t */\n\t\textractRuleGroupId?: string;\n\n\t\t/**\n\t\t * By default extraction will auto detect the mime type of the document, this can be used to override the detection.\n\t\t */\n\t\textractMimeType?: string;\n\n\t\t/**\n\t\t * PLimit the number of items to return, defaults to 1 so only most recent is returned.\n\t\t * @default 1\n\t\t */\n\t\tlimit?: string;\n\n\t\t/**\n\t\t * The cursor to get the next chunk of revisions.\n\t\t */\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":"IDocumentManagementGetRevisionRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementGetRevisionRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Request to get a document revision from an auditable item graph vertex.\n */\nexport interface IDocumentManagementGetRevisionRequest {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The full id of the document to get.\n\t\t */\n\t\tauditableItemGraphDocumentId: string;\n\n\t\t/**\n\t\t * The revision of the document to get.\n\t\t */\n\t\trevision: string;\n\t};\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * Include the blob storage metadata in the response.\n\t\t * @default false\n\t\t */\n\t\tincludeBlobStorageMetadata?:
|
|
1
|
+
{"version":3,"file":"IDocumentManagementGetRevisionRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementGetRevisionRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Request to get a document revision from an auditable item graph vertex.\n */\nexport interface IDocumentManagementGetRevisionRequest {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The full id of the document to get.\n\t\t */\n\t\tauditableItemGraphDocumentId: string;\n\n\t\t/**\n\t\t * The revision of the document to get.\n\t\t */\n\t\trevision: string;\n\t};\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: {\n\t\t/**\n\t\t * Include the blob storage metadata in the response.\n\t\t * @default false\n\t\t */\n\t\tincludeBlobStorageMetadata?: string;\n\n\t\t/**\n\t\t * Include the blob storage data in the response.\n\t\t * @default false\n\t\t */\n\t\tincludeBlobStorageData?: string;\n\n\t\t/**\n\t\t * Include the attestation information in the response.\n\t\t * @default false\n\t\t */\n\t\tincludeAttestation?: string;\n\n\t\t/**\n\t\t * If provided will extract data from the document using the specified rule group id.\n\t\t */\n\t\textractRuleGroupId?: string;\n\n\t\t/**\n\t\t * By default extraction will auto detect the mime type of the document, this can be used to override the detection.\n\t\t */\n\t\textractMimeType?: string;\n\t};\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
|
|
9
|
+
* The canonical RDF namespace URI for Document Management.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
Namespace: "https://schema.twindev.org/documents/",
|
|
12
12
|
/**
|
|
13
|
-
* The context
|
|
13
|
+
* The value to use in context for Document Management.
|
|
14
14
|
*/
|
|
15
|
-
|
|
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,
|
|
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"]}
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"prefixItems": [
|
|
12
12
|
{
|
|
13
13
|
"type": "string",
|
|
14
|
-
"const": "https://schema.
|
|
14
|
+
"const": "https://schema.org"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"type": "string",
|
|
18
|
-
"const": "https://schema.twindev.org/
|
|
18
|
+
"const": "https://schema.twindev.org/documents/"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"type": "string",
|
|
22
|
-
"const": "https://schema.org"
|
|
22
|
+
"const": "https://schema.twindev.org/common/"
|
|
23
23
|
}
|
|
24
24
|
],
|
|
25
25
|
"items": {
|
|
@@ -37,66 +37,66 @@
|
|
|
37
37
|
},
|
|
38
38
|
"documentId": {
|
|
39
39
|
"type": "string",
|
|
40
|
-
"description": "The id of the document."
|
|
40
|
+
"description": "The id of the document. json-ld type:schema:identifier"
|
|
41
41
|
},
|
|
42
42
|
"documentIdFormat": {
|
|
43
43
|
"type": "string",
|
|
44
|
-
"description": "The format of the document id."
|
|
44
|
+
"description": "The format of the document id. json-ld type:schema:Text"
|
|
45
45
|
},
|
|
46
46
|
"documentCode": {
|
|
47
|
-
"$ref": "https://
|
|
48
|
-
"description": "The code for the document type."
|
|
47
|
+
"$ref": "https://schema.twindev.org/unece/UneceDocumentCodeList",
|
|
48
|
+
"description": "The code for the document type. json-ld type:schema:identifier"
|
|
49
49
|
},
|
|
50
50
|
"documentRevision": {
|
|
51
51
|
"type": "number",
|
|
52
|
-
"description": "The revision of the document as a 0 based index."
|
|
52
|
+
"description": "The revision of the document as a 0 based index. json-ld type:schema:Integer"
|
|
53
53
|
},
|
|
54
54
|
"annotationObject": {
|
|
55
55
|
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
56
|
-
"description": "Additional annotation information for the document."
|
|
56
|
+
"description": "Additional annotation information for the document. json-ld namespace:twin-common"
|
|
57
57
|
},
|
|
58
58
|
"blobStorageId": {
|
|
59
59
|
"type": "string",
|
|
60
|
-
"description": "The blob storage id for the document."
|
|
60
|
+
"description": "The blob storage id for the document. json-ld type:schema:identifier"
|
|
61
61
|
},
|
|
62
|
-
"
|
|
62
|
+
"integrity": {
|
|
63
63
|
"type": "string",
|
|
64
|
-
"description": "The
|
|
64
|
+
"description": "The integrity of the blob data. json-ld namespace:twin-common"
|
|
65
65
|
},
|
|
66
66
|
"blobStorageEntry": {
|
|
67
67
|
"$ref": "https://schema.twindev.org/blob-storage/BlobStorageEntry",
|
|
68
|
-
"description": "The additional JSON-LD for blob storage if it was requested."
|
|
68
|
+
"description": "The additional JSON-LD for blob storage if it was requested. json-ld id"
|
|
69
69
|
},
|
|
70
70
|
"extractedData": {
|
|
71
|
-
"description": "The data extracted from the document using data extraction services."
|
|
71
|
+
"description": "The data extracted from the document using data extraction services. json-ld type:json"
|
|
72
72
|
},
|
|
73
73
|
"attestationId": {
|
|
74
74
|
"type": "string",
|
|
75
|
-
"description": "The attestation for the document if one was created."
|
|
75
|
+
"description": "The attestation for the document if one was created. json-ld type:schema:identifier"
|
|
76
76
|
},
|
|
77
77
|
"attestationInformation": {
|
|
78
78
|
"$ref": "https://schema.twindev.org/attestation/AttestationInformation",
|
|
79
|
-
"description": "The additional JSON-LD for attestation storage if it was requested."
|
|
79
|
+
"description": "The additional JSON-LD for attestation storage if it was requested. json-ld id"
|
|
80
80
|
},
|
|
81
81
|
"dateCreated": {
|
|
82
82
|
"type": "string",
|
|
83
|
-
"description": "The date/time of when the document was created."
|
|
83
|
+
"description": "The date/time of when the document was created. json-ld namespace:schema"
|
|
84
84
|
},
|
|
85
85
|
"dateModified": {
|
|
86
86
|
"type": "string",
|
|
87
|
-
"description": "The date/time of when the document was modified."
|
|
87
|
+
"description": "The date/time of when the document was modified. json-ld namespace:schema"
|
|
88
88
|
},
|
|
89
89
|
"dateDeleted": {
|
|
90
90
|
"type": "string",
|
|
91
|
-
"description": "The date/time of when the document was deleted, as we never actually remove items."
|
|
91
|
+
"description": "The date/time of when the document was deleted, as we never actually remove items. json-ld namespace:schema"
|
|
92
92
|
},
|
|
93
93
|
"organizationIdentity": {
|
|
94
94
|
"type": "string",
|
|
95
|
-
"description": "The organization which added the document to the graph."
|
|
95
|
+
"description": "The organization which added the document to the graph. json-ld namespace:twin-common"
|
|
96
96
|
},
|
|
97
97
|
"userIdentity": {
|
|
98
98
|
"type": "string",
|
|
99
|
-
"description": "The user who added the document to the graph."
|
|
99
|
+
"description": "The user who added the document to the graph. json-ld namespace:twin-common"
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
"required": [
|
|
@@ -107,8 +107,7 @@
|
|
|
107
107
|
"documentCode",
|
|
108
108
|
"documentRevision",
|
|
109
109
|
"blobStorageId",
|
|
110
|
-
"
|
|
110
|
+
"integrity",
|
|
111
111
|
"dateCreated"
|
|
112
|
-
]
|
|
113
|
-
"additionalProperties": false
|
|
112
|
+
]
|
|
114
113
|
}
|
|
@@ -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
|
/**
|
|
@@ -13,9 +13,9 @@ export interface IDocument {
|
|
|
13
13
|
* JSON-LD Context.
|
|
14
14
|
*/
|
|
15
15
|
"@context": [
|
|
16
|
-
typeof
|
|
17
|
-
typeof DocumentContexts.
|
|
18
|
-
typeof
|
|
16
|
+
typeof SchemaOrgContexts.Context,
|
|
17
|
+
typeof DocumentContexts.Context,
|
|
18
|
+
typeof DocumentContexts.ContextCommon,
|
|
19
19
|
...IJsonLdContextDefinitionElement[]
|
|
20
20
|
];
|
|
21
21
|
/**
|
|
@@ -28,66 +28,82 @@ export interface IDocument {
|
|
|
28
28
|
id: string;
|
|
29
29
|
/**
|
|
30
30
|
* The id of the document.
|
|
31
|
+
* json-ld type:schema:identifier
|
|
31
32
|
*/
|
|
32
33
|
documentId: string;
|
|
33
34
|
/**
|
|
34
35
|
* The format of the document id.
|
|
36
|
+
* json-ld type:schema:Text
|
|
35
37
|
*/
|
|
36
38
|
documentIdFormat?: string;
|
|
37
39
|
/**
|
|
38
40
|
* The code for the document type.
|
|
41
|
+
* json-ld type:schema:identifier
|
|
39
42
|
*/
|
|
40
|
-
documentCode:
|
|
43
|
+
documentCode: UneceDocumentCodeList;
|
|
41
44
|
/**
|
|
42
45
|
* The revision of the document as a 0 based index.
|
|
46
|
+
* json-ld type:schema:Integer
|
|
43
47
|
*/
|
|
44
48
|
documentRevision: number;
|
|
45
49
|
/**
|
|
46
50
|
* Additional annotation information for the document.
|
|
51
|
+
* json-ld namespace:twin-common
|
|
47
52
|
*/
|
|
48
53
|
annotationObject?: IJsonLdNodeObject;
|
|
49
54
|
/**
|
|
50
55
|
* The blob storage id for the document.
|
|
56
|
+
* json-ld type:schema:identifier
|
|
51
57
|
*/
|
|
52
58
|
blobStorageId: string;
|
|
53
59
|
/**
|
|
54
|
-
* The
|
|
60
|
+
* The integrity of the blob data.
|
|
61
|
+
* json-ld namespace:twin-common
|
|
55
62
|
*/
|
|
56
|
-
|
|
63
|
+
integrity: string;
|
|
57
64
|
/**
|
|
58
65
|
* The additional JSON-LD for blob storage if it was requested.
|
|
66
|
+
* json-ld id
|
|
59
67
|
*/
|
|
60
68
|
blobStorageEntry?: IBlobStorageEntry;
|
|
61
69
|
/**
|
|
62
70
|
* The data extracted from the document using data extraction services.
|
|
71
|
+
* json-ld type:json
|
|
63
72
|
*/
|
|
64
73
|
extractedData?: unknown;
|
|
65
74
|
/**
|
|
66
75
|
* The attestation for the document if one was created.
|
|
76
|
+
* json-ld type:schema:identifier
|
|
67
77
|
*/
|
|
68
78
|
attestationId?: string;
|
|
69
79
|
/**
|
|
70
80
|
* The additional JSON-LD for attestation storage if it was requested.
|
|
81
|
+
* json-ld id
|
|
71
82
|
*/
|
|
72
83
|
attestationInformation?: IAttestationInformation;
|
|
73
84
|
/**
|
|
74
85
|
* The date/time of when the document was created.
|
|
86
|
+
* json-ld namespace:schema
|
|
75
87
|
*/
|
|
76
88
|
dateCreated: string;
|
|
77
89
|
/**
|
|
78
90
|
* The date/time of when the document was modified.
|
|
91
|
+
* json-ld namespace:schema
|
|
79
92
|
*/
|
|
80
93
|
dateModified?: string;
|
|
81
94
|
/**
|
|
82
95
|
* The date/time of when the document was deleted, as we never actually remove items.
|
|
96
|
+
* json-ld namespace:schema
|
|
83
97
|
*/
|
|
84
98
|
dateDeleted?: string;
|
|
85
99
|
/**
|
|
86
100
|
* The organization which added the document to the graph.
|
|
101
|
+
* json-ld namespace:twin-common
|
|
87
102
|
*/
|
|
88
103
|
organizationIdentity?: string;
|
|
89
104
|
/**
|
|
90
105
|
* The user who added the document to the graph.
|
|
106
|
+
* json-ld namespace:twin-common
|
|
91
107
|
*/
|
|
92
108
|
userIdentity?: string;
|
|
93
109
|
}
|
|
@@ -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
|
/**
|
|
@@ -10,9 +10,9 @@ export interface IDocumentAttestation {
|
|
|
10
10
|
* JSON-LD Context.
|
|
11
11
|
*/
|
|
12
12
|
"@context": [
|
|
13
|
-
typeof
|
|
14
|
-
typeof DocumentContexts.
|
|
15
|
-
typeof
|
|
13
|
+
typeof SchemaOrgContexts.Context,
|
|
14
|
+
typeof DocumentContexts.Context,
|
|
15
|
+
typeof DocumentContexts.ContextCommon
|
|
16
16
|
];
|
|
17
17
|
/**
|
|
18
18
|
* JSON-LD Type.
|
|
@@ -20,22 +20,27 @@ export interface IDocumentAttestation {
|
|
|
20
20
|
type: typeof DocumentTypes.DocumentAttestation;
|
|
21
21
|
/**
|
|
22
22
|
* The id of the document.
|
|
23
|
+
* json-ld type:schema:identifier
|
|
23
24
|
*/
|
|
24
25
|
documentId: string;
|
|
25
26
|
/**
|
|
26
27
|
* The code for the document type.
|
|
28
|
+
* json-ld type:schema:identifier
|
|
27
29
|
*/
|
|
28
|
-
documentCode:
|
|
30
|
+
documentCode: UneceDocumentCodeList;
|
|
29
31
|
/**
|
|
30
32
|
* The revision of the document as a 0 based index.
|
|
33
|
+
* json-ld type:schema:Integer
|
|
31
34
|
*/
|
|
32
35
|
documentRevision: number;
|
|
33
36
|
/**
|
|
34
37
|
* The date/time of when the document was created.
|
|
38
|
+
* json-ld namespace:schema
|
|
35
39
|
*/
|
|
36
40
|
dateCreated: string;
|
|
37
41
|
/**
|
|
38
|
-
* The
|
|
42
|
+
* The integrity of the document being attested.
|
|
43
|
+
* json-ld namespace:twin-common
|
|
39
44
|
*/
|
|
40
|
-
|
|
45
|
+
integrity: string;
|
|
41
46
|
}
|
|
@@ -10,9 +10,9 @@ export interface IDocumentList {
|
|
|
10
10
|
* JSON-LD Context.
|
|
11
11
|
*/
|
|
12
12
|
"@context": [
|
|
13
|
-
typeof SchemaOrgContexts.
|
|
14
|
-
typeof DocumentContexts.
|
|
15
|
-
typeof DocumentContexts.
|
|
13
|
+
typeof SchemaOrgContexts.Context,
|
|
14
|
+
typeof DocumentContexts.Context,
|
|
15
|
+
typeof DocumentContexts.ContextCommon,
|
|
16
16
|
...IJsonLdContextDefinitionElement[]
|
|
17
17
|
];
|
|
18
18
|
/**
|
|
@@ -21,14 +21,12 @@ export interface IDocumentList {
|
|
|
21
21
|
type: typeof SchemaOrgTypes.ItemList;
|
|
22
22
|
/**
|
|
23
23
|
* The list of documents.
|
|
24
|
+
* json-ld namespace:schema
|
|
24
25
|
*/
|
|
25
26
|
[SchemaOrgTypes.ItemListElement]: IDocument[];
|
|
26
27
|
/**
|
|
27
28
|
* The ids of the other vertices which are connected to the document.
|
|
29
|
+
* json-ld container:set
|
|
28
30
|
*/
|
|
29
31
|
edges?: string[];
|
|
30
|
-
/**
|
|
31
|
-
* The cursor to get the next chunk of documents.
|
|
32
|
-
*/
|
|
33
|
-
[SchemaOrgTypes.NextItem]?: string;
|
|
34
32
|
}
|
|
@@ -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;
|
|
@@ -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<
|
|
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<
|
|
110
|
+
query(documentId: string, cursor?: string, limit?: number): Promise<{
|
|
111
|
+
entries: IAuditableItemGraphVertexList;
|
|
112
|
+
cursor?: string;
|
|
113
|
+
}>;
|
|
108
114
|
}
|
|
@@ -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
|
*/
|
|
@@ -26,22 +26,22 @@ export interface IDocumentManagementGetRequest {
|
|
|
26
26
|
* Include the blob storage metadata in the response.
|
|
27
27
|
* @default false
|
|
28
28
|
*/
|
|
29
|
-
includeBlobStorageMetadata?:
|
|
29
|
+
includeBlobStorageMetadata?: string;
|
|
30
30
|
/**
|
|
31
31
|
* Include the blob storage data in the response.
|
|
32
32
|
* @default false
|
|
33
33
|
*/
|
|
34
|
-
includeBlobStorageData?:
|
|
34
|
+
includeBlobStorageData?: string;
|
|
35
35
|
/**
|
|
36
36
|
* Include the attestation information in the response.
|
|
37
37
|
* @default false
|
|
38
38
|
*/
|
|
39
|
-
includeAttestation?:
|
|
39
|
+
includeAttestation?: string;
|
|
40
40
|
/**
|
|
41
41
|
* Include deleted documents in the response.
|
|
42
42
|
* @default false
|
|
43
43
|
*/
|
|
44
|
-
includeRemoved?:
|
|
44
|
+
includeRemoved?: string;
|
|
45
45
|
/**
|
|
46
46
|
* If provided will extract data from the document using the specified rule group id.
|
|
47
47
|
*/
|
|
@@ -30,17 +30,17 @@ export interface IDocumentManagementGetRevisionRequest {
|
|
|
30
30
|
* Include the blob storage metadata in the response.
|
|
31
31
|
* @default false
|
|
32
32
|
*/
|
|
33
|
-
includeBlobStorageMetadata?:
|
|
33
|
+
includeBlobStorageMetadata?: string;
|
|
34
34
|
/**
|
|
35
35
|
* Include the blob storage data in the response.
|
|
36
36
|
* @default false
|
|
37
37
|
*/
|
|
38
|
-
includeBlobStorageData?:
|
|
38
|
+
includeBlobStorageData?: string;
|
|
39
39
|
/**
|
|
40
40
|
* Include the attestation information in the response.
|
|
41
41
|
* @default false
|
|
42
42
|
*/
|
|
43
|
-
includeAttestation?:
|
|
43
|
+
includeAttestation?: string;
|
|
44
44
|
/**
|
|
45
45
|
* If provided will extract data from the document using the specified rule group id.
|
|
46
46
|
*/
|
|
@@ -3,13 +3,29 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const DocumentContexts: {
|
|
5
5
|
/**
|
|
6
|
-
* The
|
|
6
|
+
* The canonical RDF namespace URI for Document Management.
|
|
7
7
|
*/
|
|
8
|
-
readonly
|
|
8
|
+
readonly Namespace: "https://schema.twindev.org/documents/";
|
|
9
9
|
/**
|
|
10
|
-
* The context
|
|
10
|
+
* The value to use in context for Document Management.
|
|
11
11
|
*/
|
|
12
|
-
readonly
|
|
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.
|
|
19
|
+
*/
|
|
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,76 @@
|
|
|
1
1
|
# @twin.org/document-management-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.11](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.10...document-management-models-v0.0.3-next.11) (2026-02-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update schemas ([310261d](https://github.com/twinfoundation/document-management/commit/310261d620254d9c00dfa8fbb470948af9101778))
|
|
9
|
+
|
|
10
|
+
## [0.0.3-next.10](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.9...document-management-models-v0.0.3-next.10) (2026-02-11)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add ts-to-jsonld-context tool ([da11115](https://github.com/twinfoundation/document-management/commit/da111155614dc7f7789480c8b0d2f03c66a16ae4))
|
|
16
|
+
* blobHash to integrity ([#38](https://github.com/twinfoundation/document-management/issues/38)) ([2d45756](https://github.com/twinfoundation/document-management/commit/2d457565ba61d260ace12a762e592b6b1a65788d))
|
|
17
|
+
|
|
18
|
+
## [0.0.3-next.9](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.8...document-management-models-v0.0.3-next.9) (2026-01-26)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Miscellaneous Chores
|
|
22
|
+
|
|
23
|
+
* **document-management-models:** Synchronize repo versions
|
|
24
|
+
|
|
25
|
+
## [0.0.3-next.8](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.7...document-management-models-v0.0.3-next.8) (2026-01-26)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Miscellaneous Chores
|
|
29
|
+
|
|
30
|
+
* **document-management-models:** Synchronize repo versions
|
|
31
|
+
|
|
32
|
+
## [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)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
* replace nextItem property with Link header ([#34](https://github.com/twinfoundation/document-management/issues/34)) ([3f04c3f](https://github.com/twinfoundation/document-management/commit/3f04c3fb5c9ec0c56f213089a15cc247fbfbd59c))
|
|
38
|
+
|
|
39
|
+
## [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)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
* update contexts ([#32](https://github.com/twinfoundation/document-management/issues/32)) ([2fc1d92](https://github.com/twinfoundation/document-management/commit/2fc1d9200ecd8b755efb552c5f84f996cb61e64a))
|
|
45
|
+
|
|
46
|
+
## [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)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
* update contexts and namespaces ([#29](https://github.com/twinfoundation/document-management/issues/29)) ([ef7abc0](https://github.com/twinfoundation/document-management/commit/ef7abc01d10b3f9528be8afaa21dbd00181939ae))
|
|
52
|
+
|
|
53
|
+
## [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)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Features
|
|
57
|
+
|
|
58
|
+
* update unece dependencies ([a27548c](https://github.com/twinfoundation/document-management/commit/a27548cdebbe1d9577fc8341166538c2f07348a3))
|
|
59
|
+
|
|
60
|
+
## [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)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### Features
|
|
64
|
+
|
|
65
|
+
* use updated unece types ([c141a89](https://github.com/twinfoundation/document-management/commit/c141a895138cb45fa0b1e95c42f56e31708c846c))
|
|
66
|
+
|
|
67
|
+
## [0.0.3-next.2](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.1...document-management-models-v0.0.3-next.2) (2025-11-28)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Features
|
|
71
|
+
|
|
72
|
+
* update background task service ([5c380dc](https://github.com/twinfoundation/document-management/commit/5c380dca3114254201768f184f9486828501ff66))
|
|
73
|
+
|
|
3
74
|
## [0.0.3-next.1](https://github.com/twinfoundation/document-management/compare/document-management-models-v0.0.3-next.0...document-management-models-v0.0.3-next.1) (2025-11-12)
|
|
4
75
|
|
|
5
76
|
|
|
@@ -6,7 +6,7 @@ Interface describing a document.
|
|
|
6
6
|
|
|
7
7
|
### @context
|
|
8
8
|
|
|
9
|
-
> **@context**: \[`"https://schema.
|
|
9
|
+
> **@context**: \[`"https://schema.org"`, `"https://schema.twindev.org/documents/"`, `"https://schema.twindev.org/common/"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
10
10
|
|
|
11
11
|
JSON-LD Context.
|
|
12
12
|
|
|
@@ -33,6 +33,7 @@ The full id of the document.
|
|
|
33
33
|
> **documentId**: `string`
|
|
34
34
|
|
|
35
35
|
The id of the document.
|
|
36
|
+
json-ld type:schema:identifier
|
|
36
37
|
|
|
37
38
|
***
|
|
38
39
|
|
|
@@ -41,14 +42,16 @@ The id of the document.
|
|
|
41
42
|
> `optional` **documentIdFormat**: `string`
|
|
42
43
|
|
|
43
44
|
The format of the document id.
|
|
45
|
+
json-ld type:schema:Text
|
|
44
46
|
|
|
45
47
|
***
|
|
46
48
|
|
|
47
49
|
### documentCode
|
|
48
50
|
|
|
49
|
-
> **documentCode**: `
|
|
51
|
+
> **documentCode**: `UneceDocumentCodeList`
|
|
50
52
|
|
|
51
53
|
The code for the document type.
|
|
54
|
+
json-ld type:schema:identifier
|
|
52
55
|
|
|
53
56
|
***
|
|
54
57
|
|
|
@@ -57,6 +60,7 @@ The code for the document type.
|
|
|
57
60
|
> **documentRevision**: `number`
|
|
58
61
|
|
|
59
62
|
The revision of the document as a 0 based index.
|
|
63
|
+
json-ld type:schema:Integer
|
|
60
64
|
|
|
61
65
|
***
|
|
62
66
|
|
|
@@ -65,6 +69,7 @@ The revision of the document as a 0 based index.
|
|
|
65
69
|
> `optional` **annotationObject**: `IJsonLdNodeObject`
|
|
66
70
|
|
|
67
71
|
Additional annotation information for the document.
|
|
72
|
+
json-ld namespace:twin-common
|
|
68
73
|
|
|
69
74
|
***
|
|
70
75
|
|
|
@@ -73,14 +78,16 @@ Additional annotation information for the document.
|
|
|
73
78
|
> **blobStorageId**: `string`
|
|
74
79
|
|
|
75
80
|
The blob storage id for the document.
|
|
81
|
+
json-ld type:schema:identifier
|
|
76
82
|
|
|
77
83
|
***
|
|
78
84
|
|
|
79
|
-
###
|
|
85
|
+
### integrity
|
|
80
86
|
|
|
81
|
-
> **
|
|
87
|
+
> **integrity**: `string`
|
|
82
88
|
|
|
83
|
-
The
|
|
89
|
+
The integrity of the blob data.
|
|
90
|
+
json-ld namespace:twin-common
|
|
84
91
|
|
|
85
92
|
***
|
|
86
93
|
|
|
@@ -89,6 +96,7 @@ The hash of the blob data.
|
|
|
89
96
|
> `optional` **blobStorageEntry**: `IBlobStorageEntry`
|
|
90
97
|
|
|
91
98
|
The additional JSON-LD for blob storage if it was requested.
|
|
99
|
+
json-ld id
|
|
92
100
|
|
|
93
101
|
***
|
|
94
102
|
|
|
@@ -97,6 +105,7 @@ The additional JSON-LD for blob storage if it was requested.
|
|
|
97
105
|
> `optional` **extractedData**: `unknown`
|
|
98
106
|
|
|
99
107
|
The data extracted from the document using data extraction services.
|
|
108
|
+
json-ld type:json
|
|
100
109
|
|
|
101
110
|
***
|
|
102
111
|
|
|
@@ -105,6 +114,7 @@ The data extracted from the document using data extraction services.
|
|
|
105
114
|
> `optional` **attestationId**: `string`
|
|
106
115
|
|
|
107
116
|
The attestation for the document if one was created.
|
|
117
|
+
json-ld type:schema:identifier
|
|
108
118
|
|
|
109
119
|
***
|
|
110
120
|
|
|
@@ -113,6 +123,7 @@ The attestation for the document if one was created.
|
|
|
113
123
|
> `optional` **attestationInformation**: `IAttestationInformation`
|
|
114
124
|
|
|
115
125
|
The additional JSON-LD for attestation storage if it was requested.
|
|
126
|
+
json-ld id
|
|
116
127
|
|
|
117
128
|
***
|
|
118
129
|
|
|
@@ -121,6 +132,7 @@ The additional JSON-LD for attestation storage if it was requested.
|
|
|
121
132
|
> **dateCreated**: `string`
|
|
122
133
|
|
|
123
134
|
The date/time of when the document was created.
|
|
135
|
+
json-ld namespace:schema
|
|
124
136
|
|
|
125
137
|
***
|
|
126
138
|
|
|
@@ -129,6 +141,7 @@ The date/time of when the document was created.
|
|
|
129
141
|
> `optional` **dateModified**: `string`
|
|
130
142
|
|
|
131
143
|
The date/time of when the document was modified.
|
|
144
|
+
json-ld namespace:schema
|
|
132
145
|
|
|
133
146
|
***
|
|
134
147
|
|
|
@@ -137,6 +150,7 @@ The date/time of when the document was modified.
|
|
|
137
150
|
> `optional` **dateDeleted**: `string`
|
|
138
151
|
|
|
139
152
|
The date/time of when the document was deleted, as we never actually remove items.
|
|
153
|
+
json-ld namespace:schema
|
|
140
154
|
|
|
141
155
|
***
|
|
142
156
|
|
|
@@ -145,6 +159,7 @@ The date/time of when the document was deleted, as we never actually remove item
|
|
|
145
159
|
> `optional` **organizationIdentity**: `string`
|
|
146
160
|
|
|
147
161
|
The organization which added the document to the graph.
|
|
162
|
+
json-ld namespace:twin-common
|
|
148
163
|
|
|
149
164
|
***
|
|
150
165
|
|
|
@@ -153,3 +168,4 @@ The organization which added the document to the graph.
|
|
|
153
168
|
> `optional` **userIdentity**: `string`
|
|
154
169
|
|
|
155
170
|
The user who added the document to the graph.
|
|
171
|
+
json-ld namespace:twin-common
|
|
@@ -6,7 +6,7 @@ Interface describing a document attestation.
|
|
|
6
6
|
|
|
7
7
|
### @context
|
|
8
8
|
|
|
9
|
-
> **@context**: \[`"https://schema.
|
|
9
|
+
> **@context**: \[`"https://schema.org"`, `"https://schema.twindev.org/documents/"`, `"https://schema.twindev.org/common/"`\]
|
|
10
10
|
|
|
11
11
|
JSON-LD Context.
|
|
12
12
|
|
|
@@ -25,14 +25,16 @@ JSON-LD Type.
|
|
|
25
25
|
> **documentId**: `string`
|
|
26
26
|
|
|
27
27
|
The id of the document.
|
|
28
|
+
json-ld type:schema:identifier
|
|
28
29
|
|
|
29
30
|
***
|
|
30
31
|
|
|
31
32
|
### documentCode
|
|
32
33
|
|
|
33
|
-
> **documentCode**: `
|
|
34
|
+
> **documentCode**: `UneceDocumentCodeList`
|
|
34
35
|
|
|
35
36
|
The code for the document type.
|
|
37
|
+
json-ld type:schema:identifier
|
|
36
38
|
|
|
37
39
|
***
|
|
38
40
|
|
|
@@ -41,6 +43,7 @@ The code for the document type.
|
|
|
41
43
|
> **documentRevision**: `number`
|
|
42
44
|
|
|
43
45
|
The revision of the document as a 0 based index.
|
|
46
|
+
json-ld type:schema:Integer
|
|
44
47
|
|
|
45
48
|
***
|
|
46
49
|
|
|
@@ -49,11 +52,13 @@ The revision of the document as a 0 based index.
|
|
|
49
52
|
> **dateCreated**: `string`
|
|
50
53
|
|
|
51
54
|
The date/time of when the document was created.
|
|
55
|
+
json-ld namespace:schema
|
|
52
56
|
|
|
53
57
|
***
|
|
54
58
|
|
|
55
|
-
###
|
|
59
|
+
### integrity
|
|
56
60
|
|
|
57
|
-
> **
|
|
61
|
+
> **integrity**: `string`
|
|
58
62
|
|
|
59
|
-
The
|
|
63
|
+
The integrity of the document being attested.
|
|
64
|
+
json-ld namespace:twin-common
|
|
@@ -25,6 +25,7 @@ JSON-LD Type.
|
|
|
25
25
|
> **itemListElement**: [`IDocument`](IDocument.md)[]
|
|
26
26
|
|
|
27
27
|
The list of documents.
|
|
28
|
+
json-ld namespace:schema
|
|
28
29
|
|
|
29
30
|
***
|
|
30
31
|
|
|
@@ -33,11 +34,4 @@ The list of documents.
|
|
|
33
34
|
> `optional` **edges**: `string`[]
|
|
34
35
|
|
|
35
36
|
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.
|
|
37
|
+
json-ld container:set
|
|
@@ -32,7 +32,7 @@ The format of the document identifier.
|
|
|
32
32
|
|
|
33
33
|
##### documentCode
|
|
34
34
|
|
|
35
|
-
`
|
|
35
|
+
`UneceDocumentCodeList`
|
|
36
36
|
|
|
37
37
|
The code for the document type.
|
|
38
38
|
|
|
@@ -128,7 +128,7 @@ Nothing.
|
|
|
128
128
|
|
|
129
129
|
### get()
|
|
130
130
|
|
|
131
|
-
> **get**(`auditableItemGraphDocumentId`, `options?`, `cursor?`, `limit?`): `Promise
|
|
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
|
|
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
|
|
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
|
|
322
|
+
`Promise`\<\{ `entries`: `IAuditableItemGraphVertexList`; `cursor?`: `string`; \}\>
|
|
323
323
|
|
|
324
324
|
The graph vertices that contain documents referencing the specified document id.
|
|
@@ -38,7 +38,7 @@ The query parameters.
|
|
|
38
38
|
|
|
39
39
|
#### includeBlobStorageMetadata?
|
|
40
40
|
|
|
41
|
-
> `optional` **includeBlobStorageMetadata**: `string`
|
|
41
|
+
> `optional` **includeBlobStorageMetadata**: `string`
|
|
42
42
|
|
|
43
43
|
Include the blob storage metadata in the response.
|
|
44
44
|
|
|
@@ -50,7 +50,7 @@ false
|
|
|
50
50
|
|
|
51
51
|
#### includeBlobStorageData?
|
|
52
52
|
|
|
53
|
-
> `optional` **includeBlobStorageData**: `string`
|
|
53
|
+
> `optional` **includeBlobStorageData**: `string`
|
|
54
54
|
|
|
55
55
|
Include the blob storage data in the response.
|
|
56
56
|
|
|
@@ -62,7 +62,7 @@ false
|
|
|
62
62
|
|
|
63
63
|
#### includeAttestation?
|
|
64
64
|
|
|
65
|
-
> `optional` **includeAttestation**: `string`
|
|
65
|
+
> `optional` **includeAttestation**: `string`
|
|
66
66
|
|
|
67
67
|
Include the attestation information in the response.
|
|
68
68
|
|
|
@@ -74,7 +74,7 @@ false
|
|
|
74
74
|
|
|
75
75
|
#### includeRemoved?
|
|
76
76
|
|
|
77
|
-
> `optional` **includeRemoved**: `string`
|
|
77
|
+
> `optional` **includeRemoved**: `string`
|
|
78
78
|
|
|
79
79
|
Include deleted documents in the response.
|
|
80
80
|
|
|
@@ -44,7 +44,7 @@ The query parameters.
|
|
|
44
44
|
|
|
45
45
|
#### includeBlobStorageMetadata?
|
|
46
46
|
|
|
47
|
-
> `optional` **includeBlobStorageMetadata**: `string`
|
|
47
|
+
> `optional` **includeBlobStorageMetadata**: `string`
|
|
48
48
|
|
|
49
49
|
Include the blob storage metadata in the response.
|
|
50
50
|
|
|
@@ -56,7 +56,7 @@ false
|
|
|
56
56
|
|
|
57
57
|
#### includeBlobStorageData?
|
|
58
58
|
|
|
59
|
-
> `optional` **includeBlobStorageData**: `string`
|
|
59
|
+
> `optional` **includeBlobStorageData**: `string`
|
|
60
60
|
|
|
61
61
|
Include the blob storage data in the response.
|
|
62
62
|
|
|
@@ -68,7 +68,7 @@ false
|
|
|
68
68
|
|
|
69
69
|
#### includeAttestation?
|
|
70
70
|
|
|
71
|
-
> `optional` **includeAttestation**: `string`
|
|
71
|
+
> `optional` **includeAttestation**: `string`
|
|
72
72
|
|
|
73
73
|
Include the attestation information in the response.
|
|
74
74
|
|
|
@@ -6,14 +6,38 @@ The contexts of document management objects.
|
|
|
6
6
|
|
|
7
7
|
## Type Declaration
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### Namespace
|
|
10
10
|
|
|
11
|
-
> `readonly` **
|
|
11
|
+
> `readonly` **Namespace**: `"https://schema.twindev.org/documents/"` = `"https://schema.twindev.org/documents/"`
|
|
12
12
|
|
|
13
|
-
The
|
|
13
|
+
The canonical RDF namespace URI for Document Management.
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### Context
|
|
16
16
|
|
|
17
|
-
> `readonly` **
|
|
17
|
+
> `readonly` **Context**: `"https://schema.twindev.org/documents/"` = `"https://schema.twindev.org/documents/"`
|
|
18
18
|
|
|
19
|
-
The context
|
|
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.
|
|
26
|
+
|
|
27
|
+
### NamespaceCommon
|
|
28
|
+
|
|
29
|
+
> `readonly` **NamespaceCommon**: `"https://schema.twindev.org/common/"` = `"https://schema.twindev.org/common/"`
|
|
30
|
+
|
|
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