@twin.org/document-management-models 0.0.3-next.14 → 0.0.3-next.16
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/index.js +4 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IDocumentManagementComponent.js.map +1 -1
- package/dist/es/models/IDocumentManagementEdgeEntry.js +2 -0
- package/dist/es/models/IDocumentManagementEdgeEntry.js.map +1 -0
- 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/IDocumentManagementUpdatePartialRequest.js +2 -0
- package/dist/es/models/api/IDocumentManagementUpdatePartialRequest.js.map +1 -0
- package/dist/es/models/documentManagementMetricIds.js +29 -0
- package/dist/es/models/documentManagementMetricIds.js.map +1 -0
- package/dist/es/models/documentManagementMetrics.js +36 -0
- package/dist/es/models/documentManagementMetrics.js.map +1 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/models/IDocumentManagementComponent.d.ts +16 -12
- package/dist/types/models/IDocumentManagementEdgeEntry.d.ts +18 -0
- package/dist/types/models/api/IDocumentManagementCreateRequest.d.ts +2 -5
- package/dist/types/models/api/IDocumentManagementGetRequest.d.ts +5 -0
- package/dist/types/models/api/IDocumentManagementUpdatePartialRequest.d.ts +43 -0
- package/dist/types/models/documentManagementMetricIds.d.ts +29 -0
- package/dist/types/models/documentManagementMetrics.d.ts +5 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/index.md +5 -1
- package/docs/reference/interfaces/IDocumentManagementComponent.md +26 -6
- package/docs/reference/interfaces/IDocumentManagementCreateRequest.md +1 -1
- package/docs/reference/interfaces/IDocumentManagementEdgeEntry.md +27 -0
- package/docs/reference/interfaces/IDocumentManagementGetRequest.md +12 -0
- package/docs/reference/interfaces/IDocumentManagementUpdatePartialRequest.md +56 -0
- package/docs/reference/type-aliases/DocumentManagementMetricIds.md +5 -0
- package/docs/reference/variables/DocumentManagementMetricIds.md +37 -0
- package/docs/reference/variables/DocumentManagementMetrics.md +5 -0
- package/package.json +5 -4
- package/dist/es/models/api/IDocumentManagementUpdateRequest.js +0 -2
- package/dist/es/models/api/IDocumentManagementUpdateRequest.js.map +0 -1
- package/dist/types/models/api/IDocumentManagementUpdateRequest.d.ts +0 -36
- package/docs/reference/interfaces/IDocumentManagementUpdateRequest.md +0 -43
package/dist/es/index.js
CHANGED
|
@@ -9,11 +9,14 @@ export * from "./models/api/IDocumentManagementGetRevisionResponse.js";
|
|
|
9
9
|
export * from "./models/api/IDocumentManagementQueryRequest.js";
|
|
10
10
|
export * from "./models/api/IDocumentManagementQueryResponse.js";
|
|
11
11
|
export * from "./models/api/IDocumentManagementRemoveRequest.js";
|
|
12
|
-
export * from "./models/api/
|
|
12
|
+
export * from "./models/api/IDocumentManagementUpdatePartialRequest.js";
|
|
13
13
|
export * from "./models/documentContexts.js";
|
|
14
14
|
export * from "./models/documentTypes.js";
|
|
15
15
|
export * from "./models/IDocument.js";
|
|
16
16
|
export * from "./models/IDocumentAttestation.js";
|
|
17
17
|
export * from "./models/IDocumentList.js";
|
|
18
18
|
export * from "./models/IDocumentManagementComponent.js";
|
|
19
|
+
export * from "./models/IDocumentManagementEdgeEntry.js";
|
|
20
|
+
export * from "./models/documentManagementMetricIds.js";
|
|
21
|
+
export * from "./models/documentManagementMetrics.js";
|
|
19
22
|
//# sourceMappingURL=index.js.map
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +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,
|
|
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,yDAAyD,CAAC;AACxE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,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/IDocumentManagementUpdatePartialRequest.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\";\nexport * from \"./models/IDocumentManagementEdgeEntry.js\";\nexport * from \"./models/documentManagementMetricIds.js\";\nexport * from \"./models/documentManagementMetrics.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IDocumentManagementComponent.js","sourceRoot":"","sources":["../../../src/models/IDocumentManagementComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuditableItemGraphVertexList } from \"@twin.org/auditable-item-graph-models\";\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { UneceDocumentCodeList } from \"@twin.org/standards-unece\";\nimport type { IDocument } from \"./IDocument.js\";\nimport type { IDocumentList } from \"./IDocumentList.js\";\n\n/**\n * Interface describing
|
|
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\";\nimport type { IDocumentManagementEdgeEntry } from \"./IDocumentManagementEdgeEntry.js\";\n\n/**\n * Interface describing a 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?: IDocumentManagementEdgeEntry[],\n\t\toptions?: {\n\t\t\tcreateAttestation?: boolean;\n\t\t\taddAlias?: boolean;\n\t\t\taliasAnnotationObject?: IJsonLdNodeObject;\n\t\t}\n\t): Promise<string>;\n\n\t/**\n\t * Update a document as an auditable item graph vertex and add its content to blob storage.\n\t * If the blob data is different a new revision will be created.\n\t * For any other changes the current revision will be updated.\n\t * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.\n\t * @param blob The data to update the document with.\n\t * @param annotationObject Additional information to associate with the document.\n\t * @param auditableItemGraphEdges Explicit edge delta to apply. If undefined, existing connections\n\t * are retained unchanged. Use `add` to create new connections and `remove` to disconnect existing\n\t * ones by their target vertex id. To update alias metadata on an already-connected vertex, include\n\t * it in `add` with the updated `aliasAnnotationObject` — AIG's alias patch is an upsert, so the\n\t * alias is updated in place without creating a duplicate back-edge.\n\t * @param auditableItemGraphEdges.add Connections to add; each creates a back-edge on the connected vertex.\n\t * @param auditableItemGraphEdges.remove Target vertex IDs to disconnect; their back-edges are removed.\n\t * @returns Nothing.\n\t */\n\tupdatePartial(\n\t\tauditableItemGraphDocumentId: string,\n\t\tblob?: Uint8Array,\n\t\tannotationObject?: IJsonLdNodeObject,\n\t\tauditableItemGraphEdges?: {\n\t\t\tadd?: IDocumentManagementEdgeEntry[];\n\t\t\tremove?: string[];\n\t\t}\n\t): Promise<void>;\n\n\t/**\n\t * Get a document using it's auditable item graph vertex id and optional revision.\n\t * @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.\n\t * @param options Additional options for the get operation.\n\t * @param options.includeBlobStorageMetadata Flag to include the blob storage metadata for the document, defaults to false.\n\t * @param options.includeBlobStorageData Flag to include the blob storage data for the document, defaults to false.\n\t * @param options.includeAttestation Flag to include the attestation information for the document, defaults to false.\n\t * @param options.includeRemoved Flag to include deleted documents, defaults to false.\n\t * @param options.includeDeletedEdges Flag to include soft-deleted edges in the response, defaults to false.\n\t * @param options.extractRuleGroupId If provided will extract data from the document using the specified rule group id.\n\t * @param options.extractMimeType By default extraction will auto detect the mime type of the document, this can be used to override the detection.\n\t * @param cursor The cursor to get the next chunk of revisions.\n\t * @param limit 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\tincludeDeletedEdges?: boolean;\n\t\t\textractRuleGroupId?: string;\n\t\t\textractMimeType?: string;\n\t\t},\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IDocumentList;\n\t\tcursor?: string;\n\t}>;\n\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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDocumentManagementEdgeEntry.js","sourceRoot":"","sources":["../../../src/models/IDocumentManagementEdgeEntry.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 * A single edge entry used when connecting a document to an AIG vertex.\n */\nexport interface IDocumentManagementEdgeEntry {\n\t/**\n\t * The target AIG vertex id to connect to.\n\t */\n\ttargetId: string;\n\n\t/**\n\t * Whether to add the document id as an alias on the connected vertex, defaults to false.\n\t */\n\taddAlias?: boolean;\n\n\t/**\n\t * Annotation object for the alias, if addAlias is true.\n\t */\n\taliasAnnotationObject?: IJsonLdNodeObject;\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 { 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?:
|
|
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\";\nimport type { IDocumentManagementEdgeEntry } from \"../IDocumentManagementEdgeEntry.js\";\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?: IDocumentManagementEdgeEntry[];\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?: 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
|
+
{"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 * Include soft-deleted edges in the response.\n\t\t * @default false\n\t\t */\n\t\tincludeDeletedEdges?: 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 @@
|
|
|
1
|
+
{"version":3,"file":"IDocumentManagementUpdatePartialRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IDocumentManagementUpdatePartialRequest.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 { IDocumentManagementEdgeEntry } from \"../IDocumentManagementEdgeEntry.js\";\n\n/**\n * Request to partially update a document as an auditable item graph vertex.\n */\nexport interface IDocumentManagementUpdatePartialRequest {\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The full id of the document to update.\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 update 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 * Explicit edge delta to apply. Use `add` to create new connections and `remove` to\n\t\t * disconnect existing ones by their target vertex id.\n\t\t */\n\t\tauditableItemGraphEdges?: {\n\t\t\t/**\n\t\t\t * Connections to add; each entry creates a back-edge on the connected vertex.\n\t\t\t */\n\t\t\tadd?: IDocumentManagementEdgeEntry[];\n\n\t\t\t/**\n\t\t\t * Target vertex IDs to disconnect; their back-edges are removed.\n\t\t\t */\n\t\t\tremove?: string[];\n\t\t};\n\t};\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* Metric IDs for the document management service.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const DocumentManagementMetricIds = {
|
|
8
|
+
/**
|
|
9
|
+
* Number of documents created.
|
|
10
|
+
*/
|
|
11
|
+
DocumentsCreated: "dm_documents_created",
|
|
12
|
+
/**
|
|
13
|
+
* Number of documents updated.
|
|
14
|
+
*/
|
|
15
|
+
DocumentsUpdated: "dm_documents_updated",
|
|
16
|
+
/**
|
|
17
|
+
* Number of document revisions created.
|
|
18
|
+
*/
|
|
19
|
+
RevisionsCreated: "dm_revisions_created",
|
|
20
|
+
/**
|
|
21
|
+
* Number of document revisions removed.
|
|
22
|
+
*/
|
|
23
|
+
RevisionsRemoved: "dm_revisions_removed",
|
|
24
|
+
/**
|
|
25
|
+
* Number of document attestations created.
|
|
26
|
+
*/
|
|
27
|
+
AttestationsCreated: "dm_attestations_created"
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=documentManagementMetricIds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentManagementMetricIds.js","sourceRoot":"","sources":["../../../src/models/documentManagementMetricIds.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,2BAA2B,GAAG;IAC1C;;OAEG;IACH,gBAAgB,EAAE,sBAAsB;IACxC;;OAEG;IACH,gBAAgB,EAAE,sBAAsB;IACxC;;OAEG;IACH,gBAAgB,EAAE,sBAAsB;IACxC;;OAEG;IACH,gBAAgB,EAAE,sBAAsB;IACxC;;OAEG;IACH,mBAAmB,EAAE,yBAAyB;CACrC,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Metric IDs for the document management service.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DocumentManagementMetricIds = {\n\t/**\n\t * Number of documents created.\n\t */\n\tDocumentsCreated: \"dm_documents_created\",\n\t/**\n\t * Number of documents updated.\n\t */\n\tDocumentsUpdated: \"dm_documents_updated\",\n\t/**\n\t * Number of document revisions created.\n\t */\n\tRevisionsCreated: \"dm_revisions_created\",\n\t/**\n\t * Number of document revisions removed.\n\t */\n\tRevisionsRemoved: \"dm_revisions_removed\",\n\t/**\n\t * Number of document attestations created.\n\t */\n\tAttestationsCreated: \"dm_attestations_created\"\n} as const;\n\n/**\n * Metric IDs for the document management service.\n */\nexport type DocumentManagementMetricIds =\n\t(typeof DocumentManagementMetricIds)[keyof typeof DocumentManagementMetricIds];\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { MetricType } from "@twin.org/telemetry-models";
|
|
4
|
+
import { DocumentManagementMetricIds } from "./documentManagementMetricIds.js";
|
|
5
|
+
/**
|
|
6
|
+
* Metrics registered by the document management service.
|
|
7
|
+
*/
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
|
+
export const DocumentManagementMetrics = [
|
|
10
|
+
{
|
|
11
|
+
id: DocumentManagementMetricIds.DocumentsCreated,
|
|
12
|
+
label: "Documents created",
|
|
13
|
+
type: MetricType.Counter
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: DocumentManagementMetricIds.DocumentsUpdated,
|
|
17
|
+
label: "Documents updated",
|
|
18
|
+
type: MetricType.Counter
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: DocumentManagementMetricIds.RevisionsCreated,
|
|
22
|
+
label: "Document revisions created",
|
|
23
|
+
type: MetricType.Counter
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: DocumentManagementMetricIds.RevisionsRemoved,
|
|
27
|
+
label: "Document revisions removed",
|
|
28
|
+
type: MetricType.Counter
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: DocumentManagementMetricIds.AttestationsCreated,
|
|
32
|
+
label: "Document attestations created",
|
|
33
|
+
type: MetricType.Counter
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
//# sourceMappingURL=documentManagementMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentManagementMetrics.js","sourceRoot":"","sources":["../../../src/models/documentManagementMetrics.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAyB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAuB;IAC5D;QACC,EAAE,EAAE,2BAA2B,CAAC,gBAAgB;QAChD,KAAK,EAAE,mBAAmB;QAC1B,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,2BAA2B,CAAC,gBAAgB;QAChD,KAAK,EAAE,mBAAmB;QAC1B,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,2BAA2B,CAAC,gBAAgB;QAChD,KAAK,EAAE,4BAA4B;QACnC,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,2BAA2B,CAAC,gBAAgB;QAChD,KAAK,EAAE,4BAA4B;QACnC,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;IACD;QACC,EAAE,EAAE,2BAA2B,CAAC,mBAAmB;QACnD,KAAK,EAAE,+BAA+B;QACtC,IAAI,EAAE,UAAU,CAAC,OAAO;KACxB;CACD,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { type ITelemetryMetric, MetricType } from \"@twin.org/telemetry-models\";\nimport { DocumentManagementMetricIds } from \"./documentManagementMetricIds.js\";\n\n/**\n * Metrics registered by the document management service.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DocumentManagementMetrics: ITelemetryMetric[] = [\n\t{\n\t\tid: DocumentManagementMetricIds.DocumentsCreated,\n\t\tlabel: \"Documents created\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: DocumentManagementMetricIds.DocumentsUpdated,\n\t\tlabel: \"Documents updated\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: DocumentManagementMetricIds.RevisionsCreated,\n\t\tlabel: \"Document revisions created\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: DocumentManagementMetricIds.RevisionsRemoved,\n\t\tlabel: \"Document revisions removed\",\n\t\ttype: MetricType.Counter\n\t},\n\t{\n\t\tid: DocumentManagementMetricIds.AttestationsCreated,\n\t\tlabel: \"Document attestations created\",\n\t\ttype: MetricType.Counter\n\t}\n];\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,10 +7,13 @@ export * from "./models/api/IDocumentManagementGetRevisionResponse.js";
|
|
|
7
7
|
export * from "./models/api/IDocumentManagementQueryRequest.js";
|
|
8
8
|
export * from "./models/api/IDocumentManagementQueryResponse.js";
|
|
9
9
|
export * from "./models/api/IDocumentManagementRemoveRequest.js";
|
|
10
|
-
export * from "./models/api/
|
|
10
|
+
export * from "./models/api/IDocumentManagementUpdatePartialRequest.js";
|
|
11
11
|
export * from "./models/documentContexts.js";
|
|
12
12
|
export * from "./models/documentTypes.js";
|
|
13
13
|
export * from "./models/IDocument.js";
|
|
14
14
|
export * from "./models/IDocumentAttestation.js";
|
|
15
15
|
export * from "./models/IDocumentList.js";
|
|
16
16
|
export * from "./models/IDocumentManagementComponent.js";
|
|
17
|
+
export * from "./models/IDocumentManagementEdgeEntry.js";
|
|
18
|
+
export * from "./models/documentManagementMetricIds.js";
|
|
19
|
+
export * from "./models/documentManagementMetrics.js";
|
|
@@ -4,8 +4,9 @@ import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
|
4
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
|
+
import type { IDocumentManagementEdgeEntry } from "./IDocumentManagementEdgeEntry.js";
|
|
7
8
|
/**
|
|
8
|
-
* Interface describing
|
|
9
|
+
* Interface describing a document management contract.
|
|
9
10
|
*/
|
|
10
11
|
export interface IDocumentManagementComponent extends IComponent {
|
|
11
12
|
/**
|
|
@@ -24,11 +25,7 @@ export interface IDocumentManagementComponent extends IComponent {
|
|
|
24
25
|
* @param options.aliasAnnotationObject Annotation object for the alias.
|
|
25
26
|
* @returns The auditable item graph vertex created for the document including its revision.
|
|
26
27
|
*/
|
|
27
|
-
create(documentId: string, documentIdFormat: string | undefined, documentCode: UneceDocumentCodeList, blob: Uint8Array, annotationObject?: IJsonLdNodeObject, auditableItemGraphEdges?: {
|
|
28
|
-
targetId: string;
|
|
29
|
-
addAlias?: boolean;
|
|
30
|
-
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
31
|
-
}[], options?: {
|
|
28
|
+
create(documentId: string, documentIdFormat: string | undefined, documentCode: UneceDocumentCodeList, blob: Uint8Array, annotationObject?: IJsonLdNodeObject, auditableItemGraphEdges?: IDocumentManagementEdgeEntry[], options?: {
|
|
32
29
|
createAttestation?: boolean;
|
|
33
30
|
addAlias?: boolean;
|
|
34
31
|
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
@@ -40,14 +37,19 @@ export interface IDocumentManagementComponent extends IComponent {
|
|
|
40
37
|
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
41
38
|
* @param blob The data to update the document with.
|
|
42
39
|
* @param annotationObject Additional information to associate with the document.
|
|
43
|
-
* @param auditableItemGraphEdges
|
|
40
|
+
* @param auditableItemGraphEdges Explicit edge delta to apply. If undefined, existing connections
|
|
41
|
+
* are retained unchanged. Use `add` to create new connections and `remove` to disconnect existing
|
|
42
|
+
* ones by their target vertex id. To update alias metadata on an already-connected vertex, include
|
|
43
|
+
* it in `add` with the updated `aliasAnnotationObject` — AIG's alias patch is an upsert, so the
|
|
44
|
+
* alias is updated in place without creating a duplicate back-edge.
|
|
45
|
+
* @param auditableItemGraphEdges.add Connections to add; each creates a back-edge on the connected vertex.
|
|
46
|
+
* @param auditableItemGraphEdges.remove Target vertex IDs to disconnect; their back-edges are removed.
|
|
44
47
|
* @returns Nothing.
|
|
45
48
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}[]): Promise<void>;
|
|
49
|
+
updatePartial(auditableItemGraphDocumentId: string, blob?: Uint8Array, annotationObject?: IJsonLdNodeObject, auditableItemGraphEdges?: {
|
|
50
|
+
add?: IDocumentManagementEdgeEntry[];
|
|
51
|
+
remove?: string[];
|
|
52
|
+
}): Promise<void>;
|
|
51
53
|
/**
|
|
52
54
|
* Get a document using it's auditable item graph vertex id and optional revision.
|
|
53
55
|
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
@@ -56,6 +58,7 @@ export interface IDocumentManagementComponent extends IComponent {
|
|
|
56
58
|
* @param options.includeBlobStorageData Flag to include the blob storage data for the document, defaults to false.
|
|
57
59
|
* @param options.includeAttestation Flag to include the attestation information for the document, defaults to false.
|
|
58
60
|
* @param options.includeRemoved Flag to include deleted documents, defaults to false.
|
|
61
|
+
* @param options.includeDeletedEdges Flag to include soft-deleted edges in the response, defaults to false.
|
|
59
62
|
* @param options.extractRuleGroupId If provided will extract data from the document using the specified rule group id.
|
|
60
63
|
* @param options.extractMimeType By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
61
64
|
* @param cursor The cursor to get the next chunk of revisions.
|
|
@@ -67,6 +70,7 @@ export interface IDocumentManagementComponent extends IComponent {
|
|
|
67
70
|
includeBlobStorageData?: boolean;
|
|
68
71
|
includeAttestation?: boolean;
|
|
69
72
|
includeRemoved?: boolean;
|
|
73
|
+
includeDeletedEdges?: boolean;
|
|
70
74
|
extractRuleGroupId?: string;
|
|
71
75
|
extractMimeType?: string;
|
|
72
76
|
}, cursor?: string, limit?: number): Promise<{
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
+
/**
|
|
3
|
+
* A single edge entry used when connecting a document to an AIG vertex.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDocumentManagementEdgeEntry {
|
|
6
|
+
/**
|
|
7
|
+
* The target AIG vertex id to connect to.
|
|
8
|
+
*/
|
|
9
|
+
targetId: string;
|
|
10
|
+
/**
|
|
11
|
+
* Whether to add the document id as an alias on the connected vertex, defaults to false.
|
|
12
|
+
*/
|
|
13
|
+
addAlias?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Annotation object for the alias, if addAlias is true.
|
|
16
|
+
*/
|
|
17
|
+
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
18
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
2
|
import type { UneceDocumentCodeList } from "@twin.org/standards-unece";
|
|
3
|
+
import type { IDocumentManagementEdgeEntry } from "../IDocumentManagementEdgeEntry.js";
|
|
3
4
|
/**
|
|
4
5
|
* Request to create a document as an auditable item graph vertex.
|
|
5
6
|
*/
|
|
@@ -31,11 +32,7 @@ export interface IDocumentManagementCreateRequest {
|
|
|
31
32
|
/**
|
|
32
33
|
* The auditable item graph vertices to connect the document to.
|
|
33
34
|
*/
|
|
34
|
-
auditableItemGraphEdges?:
|
|
35
|
-
targetId: string;
|
|
36
|
-
addAlias?: boolean;
|
|
37
|
-
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
38
|
-
}[];
|
|
35
|
+
auditableItemGraphEdges?: IDocumentManagementEdgeEntry[];
|
|
39
36
|
/**
|
|
40
37
|
* Flag to create an attestation for the document, defaults to false.
|
|
41
38
|
*/
|
|
@@ -42,6 +42,11 @@ export interface IDocumentManagementGetRequest {
|
|
|
42
42
|
* @default false
|
|
43
43
|
*/
|
|
44
44
|
includeRemoved?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Include soft-deleted edges in the response.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
includeDeletedEdges?: string;
|
|
45
50
|
/**
|
|
46
51
|
* If provided will extract data from the document using the specified rule group id.
|
|
47
52
|
*/
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
+
import type { IDocumentManagementEdgeEntry } from "../IDocumentManagementEdgeEntry.js";
|
|
3
|
+
/**
|
|
4
|
+
* Request to partially update a document as an auditable item graph vertex.
|
|
5
|
+
*/
|
|
6
|
+
export interface IDocumentManagementUpdatePartialRequest {
|
|
7
|
+
/**
|
|
8
|
+
* The path parameters.
|
|
9
|
+
*/
|
|
10
|
+
pathParams: {
|
|
11
|
+
/**
|
|
12
|
+
* The full id of the document to update.
|
|
13
|
+
*/
|
|
14
|
+
auditableItemGraphDocumentId: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The body parameters.
|
|
18
|
+
*/
|
|
19
|
+
body: {
|
|
20
|
+
/**
|
|
21
|
+
* The data to update the document with, in base64.
|
|
22
|
+
*/
|
|
23
|
+
blob?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Additional information to associate with the document.
|
|
26
|
+
*/
|
|
27
|
+
annotationObject?: IJsonLdNodeObject;
|
|
28
|
+
/**
|
|
29
|
+
* Explicit edge delta to apply. Use `add` to create new connections and `remove` to
|
|
30
|
+
* disconnect existing ones by their target vertex id.
|
|
31
|
+
*/
|
|
32
|
+
auditableItemGraphEdges?: {
|
|
33
|
+
/**
|
|
34
|
+
* Connections to add; each entry creates a back-edge on the connected vertex.
|
|
35
|
+
*/
|
|
36
|
+
add?: IDocumentManagementEdgeEntry[];
|
|
37
|
+
/**
|
|
38
|
+
* Target vertex IDs to disconnect; their back-edges are removed.
|
|
39
|
+
*/
|
|
40
|
+
remove?: string[];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metric IDs for the document management service.
|
|
3
|
+
*/
|
|
4
|
+
export declare const DocumentManagementMetricIds: {
|
|
5
|
+
/**
|
|
6
|
+
* Number of documents created.
|
|
7
|
+
*/
|
|
8
|
+
readonly DocumentsCreated: "dm_documents_created";
|
|
9
|
+
/**
|
|
10
|
+
* Number of documents updated.
|
|
11
|
+
*/
|
|
12
|
+
readonly DocumentsUpdated: "dm_documents_updated";
|
|
13
|
+
/**
|
|
14
|
+
* Number of document revisions created.
|
|
15
|
+
*/
|
|
16
|
+
readonly RevisionsCreated: "dm_revisions_created";
|
|
17
|
+
/**
|
|
18
|
+
* Number of document revisions removed.
|
|
19
|
+
*/
|
|
20
|
+
readonly RevisionsRemoved: "dm_revisions_removed";
|
|
21
|
+
/**
|
|
22
|
+
* Number of document attestations created.
|
|
23
|
+
*/
|
|
24
|
+
readonly AttestationsCreated: "dm_attestations_created";
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Metric IDs for the document management service.
|
|
28
|
+
*/
|
|
29
|
+
export type DocumentManagementMetricIds = (typeof DocumentManagementMetricIds)[keyof typeof DocumentManagementMetricIds];
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.16](https://github.com/iotaledger/twin-document-management/compare/document-management-models-v0.0.3-next.15...document-management-models-v0.0.3-next.16) (2026-06-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* replace destructive update() with updatePartial() for edge linking ([#50](https://github.com/iotaledger/twin-document-management/issues/50)) ([c1d2c33](https://github.com/iotaledger/twin-document-management/commit/c1d2c337c371bdcc1f23cac482393468ef84f0d7))
|
|
9
|
+
|
|
10
|
+
## [0.0.3-next.15](https://github.com/iotaledger/twin-document-management/compare/document-management-models-v0.0.3-next.14...document-management-models-v0.0.3-next.15) (2026-05-22)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add event-driven telemetry metrics ([#46](https://github.com/iotaledger/twin-document-management/issues/46)) ([2cc4933](https://github.com/iotaledger/twin-document-management/commit/2cc49338a05972279ee8e68027506a796e96766e))
|
|
16
|
+
|
|
3
17
|
## [0.0.3-next.14](https://github.com/iotaledger/twin-document-management/compare/document-management-models-v0.0.3-next.13...document-management-models-v0.0.3-next.14) (2026-05-20)
|
|
4
18
|
|
|
5
19
|
|
package/docs/reference/index.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
- [IDocumentAttestation](interfaces/IDocumentAttestation.md)
|
|
11
11
|
- [IDocumentList](interfaces/IDocumentList.md)
|
|
12
12
|
- [IDocumentManagementComponent](interfaces/IDocumentManagementComponent.md)
|
|
13
|
+
- [IDocumentManagementEdgeEntry](interfaces/IDocumentManagementEdgeEntry.md)
|
|
13
14
|
- [IDocumentManagementCreateRequest](interfaces/IDocumentManagementCreateRequest.md)
|
|
14
15
|
- [IDocumentManagementGetRequest](interfaces/IDocumentManagementGetRequest.md)
|
|
15
16
|
- [IDocumentManagementGetResponse](interfaces/IDocumentManagementGetResponse.md)
|
|
@@ -18,14 +19,17 @@
|
|
|
18
19
|
- [IDocumentManagementQueryRequest](interfaces/IDocumentManagementQueryRequest.md)
|
|
19
20
|
- [IDocumentManagementQueryResponse](interfaces/IDocumentManagementQueryResponse.md)
|
|
20
21
|
- [IDocumentManagementRemoveRequest](interfaces/IDocumentManagementRemoveRequest.md)
|
|
21
|
-
- [
|
|
22
|
+
- [IDocumentManagementUpdatePartialRequest](interfaces/IDocumentManagementUpdatePartialRequest.md)
|
|
22
23
|
|
|
23
24
|
## Type Aliases
|
|
24
25
|
|
|
25
26
|
- [DocumentContexts](type-aliases/DocumentContexts.md)
|
|
27
|
+
- [DocumentManagementMetricIds](type-aliases/DocumentManagementMetricIds.md)
|
|
26
28
|
- [DocumentTypes](type-aliases/DocumentTypes.md)
|
|
27
29
|
|
|
28
30
|
## Variables
|
|
29
31
|
|
|
30
32
|
- [DocumentContexts](variables/DocumentContexts.md)
|
|
33
|
+
- [DocumentManagementMetricIds](variables/DocumentManagementMetricIds.md)
|
|
34
|
+
- [DocumentManagementMetrics](variables/DocumentManagementMetrics.md)
|
|
31
35
|
- [DocumentTypes](variables/DocumentTypes.md)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Interface: IDocumentManagementComponent
|
|
2
2
|
|
|
3
|
-
Interface describing
|
|
3
|
+
Interface describing a document management contract.
|
|
4
4
|
|
|
5
5
|
## Extends
|
|
6
6
|
|
|
@@ -50,7 +50,7 @@ Additional information to associate with the document.
|
|
|
50
50
|
|
|
51
51
|
##### auditableItemGraphEdges?
|
|
52
52
|
|
|
53
|
-
`
|
|
53
|
+
[`IDocumentManagementEdgeEntry`](IDocumentManagementEdgeEntry.md)[]
|
|
54
54
|
|
|
55
55
|
The auditable item graph vertices to connect the document to.
|
|
56
56
|
|
|
@@ -84,9 +84,9 @@ The auditable item graph vertex created for the document including its revision.
|
|
|
84
84
|
|
|
85
85
|
***
|
|
86
86
|
|
|
87
|
-
###
|
|
87
|
+
### updatePartial() {#updatepartial}
|
|
88
88
|
|
|
89
|
-
> **
|
|
89
|
+
> **updatePartial**(`auditableItemGraphDocumentId`, `blob?`, `annotationObject?`, `auditableItemGraphEdges?`): `Promise`\<`void`\>
|
|
90
90
|
|
|
91
91
|
Update a document as an auditable item graph vertex and add its content to blob storage.
|
|
92
92
|
If the blob data is different a new revision will be created.
|
|
@@ -114,9 +114,23 @@ Additional information to associate with the document.
|
|
|
114
114
|
|
|
115
115
|
##### auditableItemGraphEdges?
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
Explicit edge delta to apply. If undefined, existing connections
|
|
118
|
+
are retained unchanged. Use `add` to create new connections and `remove` to disconnect existing
|
|
119
|
+
ones by their target vertex id. To update alias metadata on an already-connected vertex, include
|
|
120
|
+
it in `add` with the updated `aliasAnnotationObject` — AIG's alias patch is an upsert, so the
|
|
121
|
+
alias is updated in place without creating a duplicate back-edge.
|
|
118
122
|
|
|
119
|
-
|
|
123
|
+
###### add?
|
|
124
|
+
|
|
125
|
+
[`IDocumentManagementEdgeEntry`](IDocumentManagementEdgeEntry.md)[]
|
|
126
|
+
|
|
127
|
+
Connections to add; each creates a back-edge on the connected vertex.
|
|
128
|
+
|
|
129
|
+
###### remove?
|
|
130
|
+
|
|
131
|
+
`string`[]
|
|
132
|
+
|
|
133
|
+
Target vertex IDs to disconnect; their back-edges are removed.
|
|
120
134
|
|
|
121
135
|
#### Returns
|
|
122
136
|
|
|
@@ -168,6 +182,12 @@ Flag to include the attestation information for the document, defaults to false.
|
|
|
168
182
|
|
|
169
183
|
Flag to include deleted documents, defaults to false.
|
|
170
184
|
|
|
185
|
+
###### includeDeletedEdges?
|
|
186
|
+
|
|
187
|
+
`boolean`
|
|
188
|
+
|
|
189
|
+
Flag to include soft-deleted edges in the response, defaults to false.
|
|
190
|
+
|
|
171
191
|
###### extractRuleGroupId?
|
|
172
192
|
|
|
173
193
|
`string`
|
|
@@ -42,7 +42,7 @@ Additional information to associate with the document.
|
|
|
42
42
|
|
|
43
43
|
#### auditableItemGraphEdges?
|
|
44
44
|
|
|
45
|
-
> `optional` **auditableItemGraphEdges?**: `
|
|
45
|
+
> `optional` **auditableItemGraphEdges?**: [`IDocumentManagementEdgeEntry`](IDocumentManagementEdgeEntry.md)[]
|
|
46
46
|
|
|
47
47
|
The auditable item graph vertices to connect the document to.
|
|
48
48
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Interface: IDocumentManagementEdgeEntry
|
|
2
|
+
|
|
3
|
+
A single edge entry used when connecting a document to an AIG vertex.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### targetId {#targetid}
|
|
8
|
+
|
|
9
|
+
> **targetId**: `string`
|
|
10
|
+
|
|
11
|
+
The target AIG vertex id to connect to.
|
|
12
|
+
|
|
13
|
+
***
|
|
14
|
+
|
|
15
|
+
### addAlias? {#addalias}
|
|
16
|
+
|
|
17
|
+
> `optional` **addAlias?**: `boolean`
|
|
18
|
+
|
|
19
|
+
Whether to add the document id as an alias on the connected vertex, defaults to false.
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### aliasAnnotationObject? {#aliasannotationobject}
|
|
24
|
+
|
|
25
|
+
> `optional` **aliasAnnotationObject?**: `IJsonLdNodeObject`
|
|
26
|
+
|
|
27
|
+
Annotation object for the alias, if addAlias is true.
|
|
@@ -84,6 +84,18 @@ Include deleted documents in the response.
|
|
|
84
84
|
false
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
#### includeDeletedEdges?
|
|
88
|
+
|
|
89
|
+
> `optional` **includeDeletedEdges?**: `string`
|
|
90
|
+
|
|
91
|
+
Include soft-deleted edges in the response.
|
|
92
|
+
|
|
93
|
+
##### Default
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
false
|
|
97
|
+
```
|
|
98
|
+
|
|
87
99
|
#### extractRuleGroupId?
|
|
88
100
|
|
|
89
101
|
> `optional` **extractRuleGroupId?**: `string`
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Interface: IDocumentManagementUpdatePartialRequest
|
|
2
|
+
|
|
3
|
+
Request to partially update a document as an auditable item graph vertex.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### pathParams {#pathparams}
|
|
8
|
+
|
|
9
|
+
> **pathParams**: `object`
|
|
10
|
+
|
|
11
|
+
The path parameters.
|
|
12
|
+
|
|
13
|
+
#### auditableItemGraphDocumentId
|
|
14
|
+
|
|
15
|
+
> **auditableItemGraphDocumentId**: `string`
|
|
16
|
+
|
|
17
|
+
The full id of the document to update.
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### body {#body}
|
|
22
|
+
|
|
23
|
+
> **body**: `object`
|
|
24
|
+
|
|
25
|
+
The body parameters.
|
|
26
|
+
|
|
27
|
+
#### blob?
|
|
28
|
+
|
|
29
|
+
> `optional` **blob?**: `string`
|
|
30
|
+
|
|
31
|
+
The data to update the document with, in base64.
|
|
32
|
+
|
|
33
|
+
#### annotationObject?
|
|
34
|
+
|
|
35
|
+
> `optional` **annotationObject?**: `IJsonLdNodeObject`
|
|
36
|
+
|
|
37
|
+
Additional information to associate with the document.
|
|
38
|
+
|
|
39
|
+
#### auditableItemGraphEdges?
|
|
40
|
+
|
|
41
|
+
> `optional` **auditableItemGraphEdges?**: `object`
|
|
42
|
+
|
|
43
|
+
Explicit edge delta to apply. Use `add` to create new connections and `remove` to
|
|
44
|
+
disconnect existing ones by their target vertex id.
|
|
45
|
+
|
|
46
|
+
##### auditableItemGraphEdges.add?
|
|
47
|
+
|
|
48
|
+
> `optional` **add?**: [`IDocumentManagementEdgeEntry`](IDocumentManagementEdgeEntry.md)[]
|
|
49
|
+
|
|
50
|
+
Connections to add; each entry creates a back-edge on the connected vertex.
|
|
51
|
+
|
|
52
|
+
##### auditableItemGraphEdges.remove?
|
|
53
|
+
|
|
54
|
+
> `optional` **remove?**: `string`[]
|
|
55
|
+
|
|
56
|
+
Target vertex IDs to disconnect; their back-edges are removed.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Type Alias: DocumentManagementMetricIds
|
|
2
|
+
|
|
3
|
+
> **DocumentManagementMetricIds** = *typeof* [`DocumentManagementMetricIds`](../variables/DocumentManagementMetricIds.md)\[keyof *typeof* [`DocumentManagementMetricIds`](../variables/DocumentManagementMetricIds.md)\]
|
|
4
|
+
|
|
5
|
+
Metric IDs for the document management service.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Variable: DocumentManagementMetricIds
|
|
2
|
+
|
|
3
|
+
> `const` **DocumentManagementMetricIds**: `object`
|
|
4
|
+
|
|
5
|
+
Metric IDs for the document management service.
|
|
6
|
+
|
|
7
|
+
## Type Declaration
|
|
8
|
+
|
|
9
|
+
### DocumentsCreated {#documentscreated}
|
|
10
|
+
|
|
11
|
+
> `readonly` **DocumentsCreated**: `"dm_documents_created"` = `"dm_documents_created"`
|
|
12
|
+
|
|
13
|
+
Number of documents created.
|
|
14
|
+
|
|
15
|
+
### DocumentsUpdated {#documentsupdated}
|
|
16
|
+
|
|
17
|
+
> `readonly` **DocumentsUpdated**: `"dm_documents_updated"` = `"dm_documents_updated"`
|
|
18
|
+
|
|
19
|
+
Number of documents updated.
|
|
20
|
+
|
|
21
|
+
### RevisionsCreated {#revisionscreated}
|
|
22
|
+
|
|
23
|
+
> `readonly` **RevisionsCreated**: `"dm_revisions_created"` = `"dm_revisions_created"`
|
|
24
|
+
|
|
25
|
+
Number of document revisions created.
|
|
26
|
+
|
|
27
|
+
### RevisionsRemoved {#revisionsremoved}
|
|
28
|
+
|
|
29
|
+
> `readonly` **RevisionsRemoved**: `"dm_revisions_removed"` = `"dm_revisions_removed"`
|
|
30
|
+
|
|
31
|
+
Number of document revisions removed.
|
|
32
|
+
|
|
33
|
+
### AttestationsCreated {#attestationscreated}
|
|
34
|
+
|
|
35
|
+
> `readonly` **AttestationsCreated**: `"dm_attestations_created"` = `"dm_attestations_created"`
|
|
36
|
+
|
|
37
|
+
Number of document attestations created.
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/document-management-models",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.16",
|
|
4
4
|
"description": "Shared data models, schemas, and context definitions for document lifecycle records.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/iotaledger/document-management.git",
|
|
7
|
+
"url": "git+https://github.com/iotaledger/twin-document-management.git",
|
|
8
8
|
"directory": "packages/document-management-models"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"@twin.org/data-json-ld": "next",
|
|
23
23
|
"@twin.org/nameof": "next",
|
|
24
24
|
"@twin.org/standards-schema-org": "next",
|
|
25
|
-
"@twin.org/standards-unece": "next"
|
|
25
|
+
"@twin.org/standards-unece": "next",
|
|
26
|
+
"@twin.org/telemetry-models": "next"
|
|
26
27
|
},
|
|
27
28
|
"main": "./dist/es/index.js",
|
|
28
29
|
"types": "./dist/types/index.d.ts",
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"schemas"
|
|
57
58
|
],
|
|
58
59
|
"bugs": {
|
|
59
|
-
"url": "git+https://github.com/iotaledger/document-management/issues"
|
|
60
|
+
"url": "git+https://github.com/iotaledger/twin-document-management/issues"
|
|
60
61
|
},
|
|
61
62
|
"homepage": "https://twindev.org"
|
|
62
63
|
}
|
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
-
/**
|
|
3
|
-
* Request to update a document as an auditable item graph vertex.
|
|
4
|
-
*/
|
|
5
|
-
export interface IDocumentManagementUpdateRequest {
|
|
6
|
-
/**
|
|
7
|
-
* The path parameters.
|
|
8
|
-
*/
|
|
9
|
-
pathParams: {
|
|
10
|
-
/**
|
|
11
|
-
* The full id of the document to get.
|
|
12
|
-
*/
|
|
13
|
-
auditableItemGraphDocumentId: string;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* The body parameters.
|
|
17
|
-
*/
|
|
18
|
-
body: {
|
|
19
|
-
/**
|
|
20
|
-
* The data to create the document with, in base64.
|
|
21
|
-
*/
|
|
22
|
-
blob?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Additional information to associate with the document.
|
|
25
|
-
*/
|
|
26
|
-
annotationObject?: IJsonLdNodeObject;
|
|
27
|
-
/**
|
|
28
|
-
* The auditable item graph vertices to connect the document to.
|
|
29
|
-
*/
|
|
30
|
-
auditableItemGraphEdges?: {
|
|
31
|
-
targetId: string;
|
|
32
|
-
addAlias?: boolean;
|
|
33
|
-
aliasAnnotationObject?: IJsonLdNodeObject;
|
|
34
|
-
}[];
|
|
35
|
-
};
|
|
36
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Interface: IDocumentManagementUpdateRequest
|
|
2
|
-
|
|
3
|
-
Request to update a document as an auditable item graph vertex.
|
|
4
|
-
|
|
5
|
-
## Properties
|
|
6
|
-
|
|
7
|
-
### pathParams {#pathparams}
|
|
8
|
-
|
|
9
|
-
> **pathParams**: `object`
|
|
10
|
-
|
|
11
|
-
The path parameters.
|
|
12
|
-
|
|
13
|
-
#### auditableItemGraphDocumentId
|
|
14
|
-
|
|
15
|
-
> **auditableItemGraphDocumentId**: `string`
|
|
16
|
-
|
|
17
|
-
The full id of the document to get.
|
|
18
|
-
|
|
19
|
-
***
|
|
20
|
-
|
|
21
|
-
### body {#body}
|
|
22
|
-
|
|
23
|
-
> **body**: `object`
|
|
24
|
-
|
|
25
|
-
The body parameters.
|
|
26
|
-
|
|
27
|
-
#### blob?
|
|
28
|
-
|
|
29
|
-
> `optional` **blob?**: `string`
|
|
30
|
-
|
|
31
|
-
The data to create the document with, in base64.
|
|
32
|
-
|
|
33
|
-
#### annotationObject?
|
|
34
|
-
|
|
35
|
-
> `optional` **annotationObject?**: `IJsonLdNodeObject`
|
|
36
|
-
|
|
37
|
-
Additional information to associate with the document.
|
|
38
|
-
|
|
39
|
-
#### auditableItemGraphEdges?
|
|
40
|
-
|
|
41
|
-
> `optional` **auditableItemGraphEdges?**: `object`[]
|
|
42
|
-
|
|
43
|
-
The auditable item graph vertices to connect the document to.
|