@twin.org/document-management-models 0.0.3-next.15 → 0.0.3-next.17
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 +2 -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/IDocumentManagementQueryRequest.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/types/index.d.ts +2 -1
- package/dist/types/models/IDocumentManagementComponent.d.ts +19 -15
- 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 +6 -1
- package/dist/types/models/api/IDocumentManagementQueryRequest.d.ts +1 -1
- package/dist/types/models/api/IDocumentManagementUpdatePartialRequest.d.ts +43 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/index.md +2 -1
- package/docs/reference/interfaces/IDocumentManagementComponent.md +29 -9
- package/docs/reference/interfaces/IDocumentManagementCreateRequest.md +1 -1
- package/docs/reference/interfaces/IDocumentManagementEdgeEntry.md +27 -0
- package/docs/reference/interfaces/IDocumentManagementGetRequest.md +13 -1
- package/docs/reference/interfaces/IDocumentManagementQueryRequest.md +1 -1
- package/docs/reference/interfaces/IDocumentManagementUpdatePartialRequest.md +56 -0
- package/package.json +3 -3
- 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,13 +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";
|
|
19
20
|
export * from "./models/documentManagementMetricIds.js";
|
|
20
21
|
export * from "./models/documentManagementMetrics.js";
|
|
21
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 A promise that resolves when the document has been updated.\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 document for the specified revision.\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 A promise that resolves when the revision has been removed.\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 *
|
|
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 * Limit the number of items to return, defaults to 1 so only most recent is returned.\n\t\t * @default 1\n\t\t */\n\t\tlimit?: string;\n\n\t\t/**\n\t\t * The cursor to get the next chunk of revisions.\n\t\t */\n\t\tcursor?: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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
|
|
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 query a list of documents 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 @@
|
|
|
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"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,12 +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";
|
|
17
18
|
export * from "./models/documentManagementMetricIds.js";
|
|
18
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
|
|
44
|
-
*
|
|
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.
|
|
47
|
+
* @returns A promise that resolves when the document has been updated.
|
|
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<{
|
|
@@ -83,7 +87,7 @@ export interface IDocumentManagementComponent extends IComponent {
|
|
|
83
87
|
* @param options.includeAttestation Flag to include the attestation information for the document, defaults to false.
|
|
84
88
|
* @param options.extractRuleGroupId If provided will extract data from the document using the specified rule group id.
|
|
85
89
|
* @param options.extractMimeType By default extraction will auto detect the mime type of the document, this can be used to override the detection.
|
|
86
|
-
* @returns The
|
|
90
|
+
* @returns The document for the specified revision.
|
|
87
91
|
*/
|
|
88
92
|
getRevision(auditableItemGraphDocumentId: string, revision: number, options?: {
|
|
89
93
|
includeBlobStorageMetadata?: boolean;
|
|
@@ -97,7 +101,7 @@ export interface IDocumentManagementComponent extends IComponent {
|
|
|
97
101
|
* The document dateDeleted will be set, but can still be queried with the includeRemoved flag.
|
|
98
102
|
* @param auditableItemGraphDocumentId The auditable item graph vertex id which contains the document.
|
|
99
103
|
* @param revision The revision of the document to remove.
|
|
100
|
-
* @returns
|
|
104
|
+
* @returns A promise that resolves when the revision has been removed.
|
|
101
105
|
*/
|
|
102
106
|
removeRevision(auditableItemGraphDocumentId: string, revision: number): Promise<void>;
|
|
103
107
|
/**
|
|
@@ -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
|
*/
|
|
@@ -51,7 +56,7 @@ export interface IDocumentManagementGetRequest {
|
|
|
51
56
|
*/
|
|
52
57
|
extractMimeType?: string;
|
|
53
58
|
/**
|
|
54
|
-
*
|
|
59
|
+
* Limit the number of items to return, defaults to 1 so only most recent is returned.
|
|
55
60
|
* @default 1
|
|
56
61
|
*/
|
|
57
62
|
limit?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
2
2
|
/**
|
|
3
|
-
* Request to
|
|
3
|
+
* Request to query a list of documents from an auditable item graph vertex.
|
|
4
4
|
*/
|
|
5
5
|
export interface IDocumentManagementQueryRequest {
|
|
6
6
|
/**
|
|
@@ -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
|
+
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.17](https://github.com/iotaledger/twin-document-management/compare/document-management-models-v0.0.3-next.16...document-management-models-v0.0.3-next.17) (2026-06-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **document-management-models:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
## [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)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* 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))
|
|
16
|
+
|
|
3
17
|
## [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)
|
|
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,7 +19,7 @@
|
|
|
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
|
|
|
@@ -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,15 +114,29 @@ 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
|
|
|
123
137
|
`Promise`\<`void`\>
|
|
124
138
|
|
|
125
|
-
|
|
139
|
+
A promise that resolves when the document has been updated.
|
|
126
140
|
|
|
127
141
|
***
|
|
128
142
|
|
|
@@ -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`
|
|
@@ -258,7 +278,7 @@ By default extraction will auto detect the mime type of the document, this can b
|
|
|
258
278
|
|
|
259
279
|
`Promise`\<[`IDocument`](IDocument.md)\>
|
|
260
280
|
|
|
261
|
-
The
|
|
281
|
+
The document for the specified revision.
|
|
262
282
|
|
|
263
283
|
***
|
|
264
284
|
|
|
@@ -287,7 +307,7 @@ The revision of the document to remove.
|
|
|
287
307
|
|
|
288
308
|
`Promise`\<`void`\>
|
|
289
309
|
|
|
290
|
-
|
|
310
|
+
A promise that resolves when the revision has been removed.
|
|
291
311
|
|
|
292
312
|
***
|
|
293
313
|
|
|
@@ -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`
|
|
@@ -100,7 +112,7 @@ By default extraction will auto detect the mime type of the document, this can b
|
|
|
100
112
|
|
|
101
113
|
> `optional` **limit?**: `string`
|
|
102
114
|
|
|
103
|
-
|
|
115
|
+
Limit the number of items to return, defaults to 1 so only most recent is returned.
|
|
104
116
|
|
|
105
117
|
##### Default
|
|
106
118
|
|
|
@@ -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.
|
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.17",
|
|
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",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"schemas"
|
|
58
58
|
],
|
|
59
59
|
"bugs": {
|
|
60
|
-
"url": "git+https://github.com/iotaledger/document-management/issues"
|
|
60
|
+
"url": "git+https://github.com/iotaledger/twin-document-management/issues"
|
|
61
61
|
},
|
|
62
62
|
"homepage": "https://twindev.org"
|
|
63
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.
|