@twin.org/document-management-models 0.0.2-next.3 → 0.0.3-next.1

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.
Files changed (53) hide show
  1. package/dist/es/dataTypes/documentManagementDataTypes.js +29 -0
  2. package/dist/es/dataTypes/documentManagementDataTypes.js.map +1 -0
  3. package/dist/es/index.js +19 -0
  4. package/dist/es/index.js.map +1 -0
  5. package/dist/es/models/IDocument.js +2 -0
  6. package/dist/es/models/IDocument.js.map +1 -0
  7. package/dist/es/models/IDocumentAttestation.js +2 -0
  8. package/dist/es/models/IDocumentAttestation.js.map +1 -0
  9. package/dist/es/models/IDocumentList.js +2 -0
  10. package/dist/es/models/IDocumentList.js.map +1 -0
  11. package/dist/es/models/IDocumentManagementComponent.js +2 -0
  12. package/dist/es/models/IDocumentManagementComponent.js.map +1 -0
  13. package/dist/es/models/api/IDocumentManagementCreateRequest.js +2 -0
  14. package/dist/es/models/api/IDocumentManagementCreateRequest.js.map +1 -0
  15. package/dist/es/models/api/IDocumentManagementGetRequest.js +2 -0
  16. package/dist/es/models/api/IDocumentManagementGetRequest.js.map +1 -0
  17. package/dist/es/models/api/IDocumentManagementGetResponse.js +2 -0
  18. package/dist/es/models/api/IDocumentManagementGetResponse.js.map +1 -0
  19. package/dist/es/models/api/IDocumentManagementGetRevisionRequest.js +2 -0
  20. package/dist/es/models/api/IDocumentManagementGetRevisionRequest.js.map +1 -0
  21. package/dist/es/models/api/IDocumentManagementGetRevisionResponse.js +2 -0
  22. package/dist/es/models/api/IDocumentManagementGetRevisionResponse.js.map +1 -0
  23. package/dist/es/models/api/IDocumentManagementQueryRequest.js +2 -0
  24. package/dist/es/models/api/IDocumentManagementQueryRequest.js.map +1 -0
  25. package/dist/es/models/api/IDocumentManagementQueryResponse.js +2 -0
  26. package/dist/es/models/api/IDocumentManagementQueryResponse.js.map +1 -0
  27. package/dist/es/models/api/IDocumentManagementRemoveRequest.js +4 -0
  28. package/dist/es/models/api/IDocumentManagementRemoveRequest.js.map +1 -0
  29. package/dist/es/models/api/IDocumentManagementUpdateRequest.js +2 -0
  30. package/dist/es/models/api/IDocumentManagementUpdateRequest.js.map +1 -0
  31. package/dist/es/models/documentContexts.js +17 -0
  32. package/dist/es/models/documentContexts.js.map +1 -0
  33. package/dist/es/models/documentTypes.js +17 -0
  34. package/dist/es/models/documentTypes.js.map +1 -0
  35. package/dist/es/schemas/Document.json +114 -0
  36. package/dist/types/index.d.ts +16 -16
  37. package/dist/types/models/IDocument.d.ts +5 -5
  38. package/dist/types/models/IDocumentAttestation.d.ts +2 -2
  39. package/dist/types/models/IDocumentList.d.ts +2 -2
  40. package/dist/types/models/IDocumentManagementComponent.d.ts +10 -22
  41. package/dist/types/models/api/IDocumentManagementGetRequest.d.ts +2 -2
  42. package/dist/types/models/api/IDocumentManagementGetResponse.d.ts +1 -1
  43. package/dist/types/models/api/IDocumentManagementGetRevisionResponse.d.ts +1 -1
  44. package/dist/types/models/api/IDocumentManagementQueryRequest.d.ts +1 -1
  45. package/docs/changelog.md +31 -0
  46. package/docs/reference/interfaces/IDocument.md +5 -5
  47. package/docs/reference/interfaces/IDocumentManagementComponent.md +11 -83
  48. package/docs/reference/interfaces/IDocumentManagementCreateRequest.md +1 -1
  49. package/docs/reference/interfaces/IDocumentManagementGetRequest.md +3 -3
  50. package/docs/reference/interfaces/IDocumentManagementQueryRequest.md +2 -2
  51. package/package.json +25 -8
  52. package/dist/cjs/index.cjs +0 -190
  53. package/dist/esm/index.mjs +0 -186
@@ -0,0 +1,29 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { DataTypeHandlerFactory } from "@twin.org/data-core";
4
+ import { DocumentContexts } from "../models/documentContexts.js";
5
+ import { DocumentTypes } from "../models/documentTypes.js";
6
+ import DocumentSchema from "../schemas/Document.json" with { type: "json" };
7
+ /**
8
+ * Handle all the data types for document management.
9
+ */
10
+ export class DocumentManagementDataTypes {
11
+ /**
12
+ * Register all the data types.
13
+ */
14
+ static registerTypes() {
15
+ DataTypeHandlerFactory.register(`${DocumentContexts.ContextRoot}${DocumentTypes.Document}`, () => ({
16
+ context: DocumentContexts.ContextRoot,
17
+ type: DocumentTypes.Document,
18
+ defaultValue: {},
19
+ jsonSchema: async () => DocumentSchema
20
+ }));
21
+ DataTypeHandlerFactory.register(`${DocumentContexts.ContextRoot}${DocumentTypes.DocumentAttestation}`, () => ({
22
+ context: DocumentContexts.ContextRoot,
23
+ type: DocumentTypes.DocumentAttestation,
24
+ defaultValue: {},
25
+ jsonSchema: async () => DocumentSchema
26
+ }));
27
+ }
28
+ }
29
+ //# sourceMappingURL=documentManagementDataTypes.js.map
@@ -0,0 +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,WAAW,GAAG,aAAa,CAAC,QAAQ,EAAE,EAC1D,GAAG,EAAE,CAAC,CAAC;YACN,OAAO,EAAE,gBAAgB,CAAC,WAAW;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,WAAW,GAAG,aAAa,CAAC,mBAAmB,EAAE,EACrE,GAAG,EAAE,CAAC,CAAC;YACN,OAAO,EAAE,gBAAgB,CAAC,WAAW;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.ContextRoot}${DocumentTypes.Document}`,\n\t\t\t() => ({\n\t\t\t\tcontext: DocumentContexts.ContextRoot,\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.ContextRoot}${DocumentTypes.DocumentAttestation}`,\n\t\t\t() => ({\n\t\t\t\tcontext: DocumentContexts.ContextRoot,\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"]}
@@ -0,0 +1,19 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export * from "./dataTypes/documentManagementDataTypes.js";
4
+ export * from "./models/api/IDocumentManagementCreateRequest.js";
5
+ export * from "./models/api/IDocumentManagementGetRequest.js";
6
+ export * from "./models/api/IDocumentManagementGetResponse.js";
7
+ export * from "./models/api/IDocumentManagementGetRevisionRequest.js";
8
+ export * from "./models/api/IDocumentManagementGetRevisionResponse.js";
9
+ export * from "./models/api/IDocumentManagementQueryRequest.js";
10
+ export * from "./models/api/IDocumentManagementQueryResponse.js";
11
+ export * from "./models/api/IDocumentManagementRemoveRequest.js";
12
+ export * from "./models/api/IDocumentManagementUpdateRequest.js";
13
+ export * from "./models/documentContexts.js";
14
+ export * from "./models/documentTypes.js";
15
+ export * from "./models/IDocument.js";
16
+ export * from "./models/IDocumentAttestation.js";
17
+ export * from "./models/IDocumentList.js";
18
+ export * from "./models/IDocumentManagementComponent.js";
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kDAAkD,CAAC;AACjE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,uDAAuD,CAAC;AACtE,cAAc,wDAAwD,CAAC;AACvE,cAAc,iDAAiD,CAAC;AAChE,cAAc,kDAAkD,CAAC;AACjE,cAAc,kDAAkD,CAAC;AACjE,cAAc,kDAAkD,CAAC;AACjE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0CAA0C,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./dataTypes/documentManagementDataTypes.js\";\nexport * from \"./models/api/IDocumentManagementCreateRequest.js\";\nexport * from \"./models/api/IDocumentManagementGetRequest.js\";\nexport * from \"./models/api/IDocumentManagementGetResponse.js\";\nexport * from \"./models/api/IDocumentManagementGetRevisionRequest.js\";\nexport * from \"./models/api/IDocumentManagementGetRevisionResponse.js\";\nexport * from \"./models/api/IDocumentManagementQueryRequest.js\";\nexport * from \"./models/api/IDocumentManagementQueryResponse.js\";\nexport * from \"./models/api/IDocumentManagementRemoveRequest.js\";\nexport * from \"./models/api/IDocumentManagementUpdateRequest.js\";\nexport * from \"./models/documentContexts.js\";\nexport * from \"./models/documentTypes.js\";\nexport * from \"./models/IDocument.js\";\nexport * from \"./models/IDocumentAttestation.js\";\nexport * from \"./models/IDocumentList.js\";\nexport * from \"./models/IDocumentManagementComponent.js\";\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocument.js.map
@@ -0,0 +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 { UneceDocumentCodes } from \"@twin.org/standards-unece\";\nimport type { DocumentContexts } from \"./documentContexts.js\";\nimport type { DocumentTypes } from \"./documentTypes.js\";\n\n/**\n * Interface describing a document.\n */\nexport interface IDocument {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof DocumentContexts.ContextRoot,\n\t\ttypeof DocumentContexts.ContextRootCommon,\n\t\ttypeof SchemaOrgContexts.ContextRoot,\n\t\t...IJsonLdContextDefinitionElement[]\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof DocumentTypes.Document;\n\n\t/**\n\t * The full id of the document.\n\t */\n\tid: string;\n\n\t/**\n\t * The id of the document.\n\t */\n\tdocumentId: string;\n\n\t/**\n\t * The format of the document id.\n\t */\n\tdocumentIdFormat?: string;\n\n\t/**\n\t * The code for the document type.\n\t */\n\tdocumentCode: UneceDocumentCodes;\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"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocumentAttestation.js.map
@@ -0,0 +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 { UneceDocumentCodes } from \"@twin.org/standards-unece\";\nimport type { DocumentContexts } from \"./documentContexts.js\";\nimport type { DocumentTypes } from \"./documentTypes.js\";\n\n/**\n * Interface describing a document attestation.\n */\nexport interface IDocumentAttestation {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof DocumentContexts.ContextRoot,\n\t\ttypeof DocumentContexts.ContextRootCommon,\n\t\ttypeof SchemaOrgContexts.ContextRoot\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof DocumentTypes.DocumentAttestation;\n\n\t/**\n\t * The id of the document.\n\t */\n\tdocumentId: string;\n\n\t/**\n\t * The code for the document type.\n\t */\n\tdocumentCode: UneceDocumentCodes;\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"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocumentList.js.map
@@ -0,0 +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.ContextRoot,\n\t\ttypeof DocumentContexts.ContextRoot,\n\t\ttypeof DocumentContexts.ContextRootCommon,\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"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocumentManagementComponent.js.map
@@ -0,0 +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 { UneceDocumentCodes } 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: UneceDocumentCodes,\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"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocumentManagementCreateRequest.js.map
@@ -0,0 +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 { UneceDocumentCodes } 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: UneceDocumentCodes;\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"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocumentManagementGetRequest.js.map
@@ -0,0 +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?: boolean | 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?: boolean | 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?: boolean | 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?: boolean | 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"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocumentManagementGetResponse.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocumentManagementGetRevisionRequest.js.map
@@ -0,0 +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?: boolean | 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?: boolean | 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?: boolean | 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"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocumentManagementGetRevisionResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDocumentManagementGetRevisionResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementGetRevisionResponse.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 { IDocument } from \"../IDocument.js\";\n\n/**\n * Response to get a document revision from an auditable item graph vertex.\n */\nexport interface IDocumentManagementGetRevisionResponse {\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: IDocument;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocumentManagementQueryRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDocumentManagementQueryRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementQueryRequest.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 list of document from an auditable item graph vertex.\n */\nexport interface IDocumentManagementQueryRequest {\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 query parameters.\n\t */\n\tquery: {\n\t\t/**\n\t\t * The id of the document id we are trying to find.\n\t\t */\n\t\tdocumentId: string;\n\n\t\t/**\n\t\t * The cursor to get the next chunk of documents.\n\t\t */\n\t\tcursor?: string;\n\n\t\t/**\n\t\t * The number of documents to return.\n\t\t */\n\t\tlimit?: string;\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocumentManagementQueryResponse.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,4 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ export {};
4
+ //# sourceMappingURL=IDocumentManagementRemoveRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDocumentManagementRemoveRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementRemoveRequest.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Request to remove a document revision from an auditable item graph.\n */\nexport interface IDocumentManagementRemoveRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the auditable item graph vertex to remove the revision from.\n\t\t */\n\t\tauditableItemGraphDocumentId: string;\n\n\t\t/**\n\t\t * The revision of the document to remove.\n\t\t */\n\t\trevision: string;\n\t};\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IDocumentManagementUpdateRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDocumentManagementUpdateRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementUpdateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Request to update a document as an auditable item graph vertex.\n */\nexport interface IDocumentManagementUpdateRequest {\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 body parameters.\n\t */\n\tbody: {\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\t};\n}\n"]}
@@ -0,0 +1,17 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * The contexts of document management objects.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const DocumentContexts = {
8
+ /**
9
+ * The context root for the document types.
10
+ */
11
+ ContextRoot: "https://schema.twindev.org/documents/",
12
+ /**
13
+ * The context root for the common types.
14
+ */
15
+ ContextRootCommon: "https://schema.twindev.org/common/"
16
+ };
17
+ //# sourceMappingURL=documentContexts.js.map
@@ -0,0 +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,WAAW,EAAE,uCAAuC;IAEpD;;OAEG;IACH,iBAAiB,EAAE,oCAAoC;CAC9C,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 context root for the document types.\n\t */\n\tContextRoot: \"https://schema.twindev.org/documents/\",\n\n\t/**\n\t * The context root for the common types.\n\t */\n\tContextRootCommon: \"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"]}
@@ -0,0 +1,17 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * The types of document management objects.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const DocumentTypes = {
8
+ /**
9
+ * Represents a document.
10
+ */
11
+ Document: "Document",
12
+ /**
13
+ * Represents a document attestation.
14
+ */
15
+ DocumentAttestation: "DocumentAttestation"
16
+ };
17
+ //# sourceMappingURL=documentTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentTypes.js","sourceRoot":"","sources":["../../../src/models/documentTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,UAAU;IAEpB;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;CACjC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of document management objects.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DocumentTypes = {\n\t/**\n\t * Represents a document.\n\t */\n\tDocument: \"Document\",\n\n\t/**\n\t * Represents a document attestation.\n\t */\n\tDocumentAttestation: \"DocumentAttestation\"\n} as const;\n\n/**\n * The types of document management objects.\n */\nexport type DocumentTypes = (typeof DocumentTypes)[keyof typeof DocumentTypes];\n"]}
@@ -0,0 +1,114 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/documents/Document",
4
+ "description": "Interface describing a document.",
5
+ "type": "object",
6
+ "properties": {
7
+ "@context": {
8
+ "type": "array",
9
+ "minItems": 3,
10
+ "description": "JSON-LD Context.",
11
+ "prefixItems": [
12
+ {
13
+ "type": "string",
14
+ "const": "https://schema.twindev.org/documents/"
15
+ },
16
+ {
17
+ "type": "string",
18
+ "const": "https://schema.twindev.org/common/"
19
+ },
20
+ {
21
+ "type": "string",
22
+ "const": "https://schema.org"
23
+ }
24
+ ],
25
+ "items": {
26
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
27
+ }
28
+ },
29
+ "type": {
30
+ "type": "string",
31
+ "const": "Document",
32
+ "description": "JSON-LD Type."
33
+ },
34
+ "id": {
35
+ "type": "string",
36
+ "description": "The full id of the document."
37
+ },
38
+ "documentId": {
39
+ "type": "string",
40
+ "description": "The id of the document."
41
+ },
42
+ "documentIdFormat": {
43
+ "type": "string",
44
+ "description": "The format of the document id."
45
+ },
46
+ "documentCode": {
47
+ "$ref": "https://vocabulary.uncefact.org/DocumentCodeList",
48
+ "description": "The code for the document type."
49
+ },
50
+ "documentRevision": {
51
+ "type": "number",
52
+ "description": "The revision of the document as a 0 based index."
53
+ },
54
+ "annotationObject": {
55
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject",
56
+ "description": "Additional annotation information for the document."
57
+ },
58
+ "blobStorageId": {
59
+ "type": "string",
60
+ "description": "The blob storage id for the document."
61
+ },
62
+ "blobHash": {
63
+ "type": "string",
64
+ "description": "The hash of the blob data."
65
+ },
66
+ "blobStorageEntry": {
67
+ "$ref": "https://schema.twindev.org/blob-storage/BlobStorageEntry",
68
+ "description": "The additional JSON-LD for blob storage if it was requested."
69
+ },
70
+ "extractedData": {
71
+ "description": "The data extracted from the document using data extraction services."
72
+ },
73
+ "attestationId": {
74
+ "type": "string",
75
+ "description": "The attestation for the document if one was created."
76
+ },
77
+ "attestationInformation": {
78
+ "$ref": "https://schema.twindev.org/attestation/AttestationInformation",
79
+ "description": "The additional JSON-LD for attestation storage if it was requested."
80
+ },
81
+ "dateCreated": {
82
+ "type": "string",
83
+ "description": "The date/time of when the document was created."
84
+ },
85
+ "dateModified": {
86
+ "type": "string",
87
+ "description": "The date/time of when the document was modified."
88
+ },
89
+ "dateDeleted": {
90
+ "type": "string",
91
+ "description": "The date/time of when the document was deleted, as we never actually remove items."
92
+ },
93
+ "organizationIdentity": {
94
+ "type": "string",
95
+ "description": "The organization which added the document to the graph."
96
+ },
97
+ "userIdentity": {
98
+ "type": "string",
99
+ "description": "The user who added the document to the graph."
100
+ }
101
+ },
102
+ "required": [
103
+ "@context",
104
+ "type",
105
+ "id",
106
+ "documentId",
107
+ "documentCode",
108
+ "documentRevision",
109
+ "blobStorageId",
110
+ "blobHash",
111
+ "dateCreated"
112
+ ],
113
+ "additionalProperties": false
114
+ }
@@ -1,16 +1,16 @@
1
- export * from "./dataTypes/documentManagementDataTypes";
2
- export * from "./models/api/IDocumentManagementCreateRequest";
3
- export * from "./models/api/IDocumentManagementGetRequest";
4
- export * from "./models/api/IDocumentManagementGetResponse";
5
- export * from "./models/api/IDocumentManagementGetRevisionRequest";
6
- export * from "./models/api/IDocumentManagementGetRevisionResponse";
7
- export * from "./models/api/IDocumentManagementQueryRequest";
8
- export * from "./models/api/IDocumentManagementQueryResponse";
9
- export * from "./models/api/IDocumentManagementRemoveRequest";
10
- export * from "./models/api/IDocumentManagementUpdateRequest";
11
- export * from "./models/documentContexts";
12
- export * from "./models/documentTypes";
13
- export * from "./models/IDocument";
14
- export * from "./models/IDocumentAttestation";
15
- export * from "./models/IDocumentList";
16
- export * from "./models/IDocumentManagementComponent";
1
+ export * from "./dataTypes/documentManagementDataTypes.js";
2
+ export * from "./models/api/IDocumentManagementCreateRequest.js";
3
+ export * from "./models/api/IDocumentManagementGetRequest.js";
4
+ export * from "./models/api/IDocumentManagementGetResponse.js";
5
+ export * from "./models/api/IDocumentManagementGetRevisionRequest.js";
6
+ export * from "./models/api/IDocumentManagementGetRevisionResponse.js";
7
+ export * from "./models/api/IDocumentManagementQueryRequest.js";
8
+ export * from "./models/api/IDocumentManagementQueryResponse.js";
9
+ export * from "./models/api/IDocumentManagementRemoveRequest.js";
10
+ export * from "./models/api/IDocumentManagementUpdateRequest.js";
11
+ export * from "./models/documentContexts.js";
12
+ export * from "./models/documentTypes.js";
13
+ export * from "./models/IDocument.js";
14
+ export * from "./models/IDocumentAttestation.js";
15
+ export * from "./models/IDocumentList.js";
16
+ export * from "./models/IDocumentManagementComponent.js";
@@ -3,8 +3,8 @@ 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
5
  import type { UneceDocumentCodes } from "@twin.org/standards-unece";
6
- import type { DocumentContexts } from "./documentContexts";
7
- import type { DocumentTypes } from "./documentTypes";
6
+ import type { DocumentContexts } from "./documentContexts.js";
7
+ import type { DocumentTypes } from "./documentTypes.js";
8
8
  /**
9
9
  * Interface describing a document.
10
10
  */
@@ -83,11 +83,11 @@ export interface IDocument {
83
83
  */
84
84
  dateDeleted?: string;
85
85
  /**
86
- * The node which added the document to the graph.
86
+ * The organization which added the document to the graph.
87
87
  */
88
- nodeIdentity: string;
88
+ organizationIdentity?: string;
89
89
  /**
90
90
  * The user who added the document to the graph.
91
91
  */
92
- userIdentity: string;
92
+ userIdentity?: string;
93
93
  }
@@ -1,7 +1,7 @@
1
1
  import type { SchemaOrgContexts } from "@twin.org/standards-schema-org";
2
2
  import type { UneceDocumentCodes } from "@twin.org/standards-unece";
3
- import type { DocumentContexts } from "./documentContexts";
4
- import type { DocumentTypes } from "./documentTypes";
3
+ import type { DocumentContexts } from "./documentContexts.js";
4
+ import type { DocumentTypes } from "./documentTypes.js";
5
5
  /**
6
6
  * Interface describing a document attestation.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
2
2
  import type { SchemaOrgContexts, SchemaOrgTypes } from "@twin.org/standards-schema-org";
3
- import type { DocumentContexts } from "./documentContexts";
4
- import type { IDocument } from "./IDocument";
3
+ import type { DocumentContexts } from "./documentContexts.js";
4
+ import type { IDocument } from "./IDocument.js";
5
5
  /**
6
6
  * Interface describing a list of document entries.
7
7
  */
@@ -2,8 +2,8 @@ import type { IAuditableItemGraphVertexList } from "@twin.org/auditable-item-gra
2
2
  import type { IComponent } from "@twin.org/core";
3
3
  import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
4
4
  import type { UneceDocumentCodes } from "@twin.org/standards-unece";
5
- import type { IDocument } from "./IDocument";
6
- import type { IDocumentList } from "./IDocumentList";
5
+ import type { IDocument } from "./IDocument.js";
6
+ import type { IDocumentList } from "./IDocumentList.js";
7
7
  /**
8
8
  * Interface describing an document management contract.
9
9
  */
@@ -22,8 +22,6 @@ export interface IDocumentManagementComponent extends IComponent {
22
22
  * @param options.createAttestation Flag to create an attestation for the document, defaults to false.
23
23
  * @param options.addAlias Flag to add the document id as an alias to the aig vertex, defaults to true.
24
24
  * @param options.aliasAnnotationObject Annotation object for the alias.
25
- * @param userIdentity The identity to perform the auditable item graph operation with.
26
- * @param nodeIdentity The node identity to use for vault operations.
27
25
  * @returns The auditable item graph vertex created for the document including its revision.
28
26
  */
29
27
  create(documentId: string, documentIdFormat: string | undefined, documentCode: UneceDocumentCodes, blob: Uint8Array, annotationObject?: IJsonLdNodeObject, auditableItemGraphEdges?: {
@@ -34,7 +32,7 @@ export interface IDocumentManagementComponent extends IComponent {
34
32
  createAttestation?: boolean;
35
33
  addAlias?: boolean;
36
34
  aliasAnnotationObject?: IJsonLdNodeObject;
37
- }, userIdentity?: string, nodeIdentity?: string): Promise<string>;
35
+ }): Promise<string>;
38
36
  /**
39
37
  * Update a document as an auditable item graph vertex and add its content to blob storage.
40
38
  * If the blob data is different a new revision will be created.
@@ -43,15 +41,13 @@ export interface IDocumentManagementComponent extends IComponent {
43
41
  * @param blob The data to update the document with.
44
42
  * @param annotationObject Additional information to associate with the document.
45
43
  * @param auditableItemGraphEdges The auditable item graph vertices to connect the document to, if undefined retains current connections.
46
- * @param userIdentity The identity to perform the auditable item graph operation with.
47
- * @param nodeIdentity The node identity to use for vault operations.
48
44
  * @returns Nothing.
49
45
  */
50
46
  update(auditableItemGraphDocumentId: string, blob?: Uint8Array, annotationObject?: IJsonLdNodeObject, auditableItemGraphEdges?: {
51
47
  targetId: string;
52
48
  addAlias?: boolean;
53
49
  aliasAnnotationObject?: IJsonLdNodeObject;
54
- }[], userIdentity?: string, nodeIdentity?: string): Promise<void>;
50
+ }[]): Promise<void>;
55
51
  /**
56
52
  * Get a document using it's auditable item graph vertex id and optional revision.
57
53
  * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
@@ -63,9 +59,7 @@ export interface IDocumentManagementComponent extends IComponent {
63
59
  * @param options.extractRuleGroupId If provided will extract data from the document using the specified rule group id.
64
60
  * @param options.extractMimeType By default extraction will auto detect the mime type of the document, this can be used to override the detection.
65
61
  * @param cursor The cursor to get the next chunk of revisions.
66
- * @param pageSize Page size of items to return, defaults to 1 so only most recent is returned.
67
- * @param userIdentity The identity to perform the auditable item graph operation with.
68
- * @param nodeIdentity The node identity to use for vault operations.
62
+ * @param limit Limit the number of items to return, defaults to 1 so only most recent is returned.
69
63
  * @returns The documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.
70
64
  */
71
65
  get(auditableItemGraphDocumentId: string, options?: {
@@ -75,7 +69,7 @@ export interface IDocumentManagementComponent extends IComponent {
75
69
  includeRemoved?: boolean;
76
70
  extractRuleGroupId?: string;
77
71
  extractMimeType?: string;
78
- }, cursor?: string, pageSize?: number, userIdentity?: string, nodeIdentity?: string): Promise<IDocumentList>;
72
+ }, cursor?: string, limit?: number): Promise<IDocumentList>;
79
73
  /**
80
74
  * Get a document revision using it's auditable item graph vertex id.
81
75
  * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
@@ -86,8 +80,6 @@ export interface IDocumentManagementComponent extends IComponent {
86
80
  * @param options.includeAttestation Flag to include the attestation information for the document, defaults to false.
87
81
  * @param options.extractRuleGroupId If provided will extract data from the document using the specified rule group id.
88
82
  * @param options.extractMimeType By default extraction will auto detect the mime type of the document, this can be used to override the detection.
89
- * @param userIdentity The identity to perform the auditable item graph operation with.
90
- * @param nodeIdentity The node identity to use for vault operations.
91
83
  * @returns The documents and revisions if requested, ordered by revision descending, cursor is set if there are more document revisions.
92
84
  */
93
85
  getRevision(auditableItemGraphDocumentId: string, revision: number, options?: {
@@ -96,25 +88,21 @@ export interface IDocumentManagementComponent extends IComponent {
96
88
  includeAttestation?: boolean;
97
89
  extractRuleGroupId?: string;
98
90
  extractMimeType?: string;
99
- }, userIdentity?: string, nodeIdentity?: string): Promise<IDocument>;
91
+ }): Promise<IDocument>;
100
92
  /**
101
93
  * Remove an auditable item graph vertex using it's id.
102
94
  * The document dateDeleted will be set, but can still be queried with the includeRemoved flag.
103
95
  * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
104
96
  * @param revision The revision of the document to remove.
105
- * @param userIdentity The identity to perform the auditable item graph operation with.
106
- * @param nodeIdentity The node identity to use for vault operations.
107
97
  * @returns Nothing.
108
98
  */
109
- removeRevision(auditableItemGraphDocumentId: string, revision: number, userIdentity?: string, nodeIdentity?: string): Promise<void>;
99
+ removeRevision(auditableItemGraphDocumentId: string, revision: number): Promise<void>;
110
100
  /**
111
101
  * Find all the document with a specific id.
112
102
  * @param documentId The document id to find in the graph.
113
103
  * @param cursor The cursor to get the next chunk of documents.
114
- * @param pageSize The page size to get the next chunk of documents.
115
- * @param userIdentity The identity to perform the auditable item graph operation with.
116
- * @param nodeIdentity The node identity to use for vault operations.
104
+ * @param limit The limit to get the next chunk of documents.
117
105
  * @returns The graph vertices that contain documents referencing the specified document id.
118
106
  */
119
- query(documentId: string, cursor?: string, pageSize?: number, userIdentity?: string, nodeIdentity?: string): Promise<IAuditableItemGraphVertexList>;
107
+ query(documentId: string, cursor?: string, limit?: number): Promise<IAuditableItemGraphVertexList>;
120
108
  }
@@ -51,10 +51,10 @@ export interface IDocumentManagementGetRequest {
51
51
  */
52
52
  extractMimeType?: string;
53
53
  /**
54
- * Page size of items to return, defaults to 1 so only most recent is returned.
54
+ * PLimit the number of items to return, defaults to 1 so only most recent is returned.
55
55
  * @default 1
56
56
  */
57
- pageSize?: number | string;
57
+ limit?: string;
58
58
  /**
59
59
  * The cursor to get the next chunk of revisions.
60
60
  */
@@ -1,5 +1,5 @@
1
1
  import type { HeaderTypes, MimeTypes } from "@twin.org/web";
2
- import type { IDocumentList } from "../IDocumentList";
2
+ import type { IDocumentList } from "../IDocumentList.js";
3
3
  /**
4
4
  * Response to get a document and optionally revisions from an auditable item graph vertex.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import type { HeaderTypes, MimeTypes } from "@twin.org/web";
2
- import type { IDocument } from "../IDocument";
2
+ import type { IDocument } from "../IDocument.js";
3
3
  /**
4
4
  * Response to get a document revision from an auditable item graph vertex.
5
5
  */
@@ -24,6 +24,6 @@ export interface IDocumentManagementQueryRequest {
24
24
  /**
25
25
  * The number of documents to return.
26
26
  */
27
- pageSize?: number | string;
27
+ limit?: string;
28
28
  };
29
29
  }