@twin.org/auditable-item-graph-service 0.0.3-next.8 → 0.9.0-next.2
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/README.md +3 -1
- package/dist/es/auditableItemGraphRoutes.js +309 -8
- package/dist/es/auditableItemGraphRoutes.js.map +1 -1
- package/dist/es/auditableItemGraphService.js +576 -95
- package/dist/es/auditableItemGraphService.js.map +1 -1
- package/dist/es/entities/auditableItemGraphAlias.js +8 -0
- package/dist/es/entities/auditableItemGraphAlias.js.map +1 -1
- package/dist/es/entities/auditableItemGraphChangeset.js +8 -0
- package/dist/es/entities/auditableItemGraphChangeset.js.map +1 -1
- package/dist/es/entities/auditableItemGraphVertex.js +9 -1
- package/dist/es/entities/auditableItemGraphVertex.js.map +1 -1
- package/dist/es/models/IAuditableItemGraphServiceConfig.js.map +1 -1
- package/dist/es/models/IAuditableItemGraphServiceConstructorOptions.js.map +1 -1
- package/dist/es/models/IAuditableItemGraphServiceContext.js +2 -0
- package/dist/es/models/IAuditableItemGraphServiceContext.js.map +1 -1
- package/dist/es/restEntryPoints.js +3 -0
- package/dist/es/restEntryPoints.js.map +1 -1
- package/dist/types/auditableItemGraphRoutes.d.ts +34 -2
- package/dist/types/auditableItemGraphService.d.ts +50 -71
- package/dist/types/entities/auditableItemGraphAlias.d.ts +4 -0
- package/dist/types/entities/auditableItemGraphChangeset.d.ts +4 -0
- package/dist/types/entities/auditableItemGraphVertex.d.ts +5 -1
- package/dist/types/models/IAuditableItemGraphServiceConfig.d.ts +4 -0
- package/dist/types/models/IAuditableItemGraphServiceConstructorOptions.d.ts +4 -0
- package/dist/types/models/IAuditableItemGraphServiceContext.d.ts +6 -3
- package/dist/types/restEntryPoints.d.ts +3 -0
- package/docs/changelog.md +437 -84
- package/docs/examples.md +241 -1
- package/docs/open-api/spec.json +845 -268
- package/docs/reference/classes/AuditableItemGraphAlias.md +18 -10
- package/docs/reference/classes/AuditableItemGraphChangeset.md +16 -8
- package/docs/reference/classes/AuditableItemGraphEdge.md +10 -10
- package/docs/reference/classes/AuditableItemGraphPatch.md +6 -6
- package/docs/reference/classes/AuditableItemGraphResource.md +9 -9
- package/docs/reference/classes/AuditableItemGraphService.md +135 -57
- package/docs/reference/classes/AuditableItemGraphVertex.md +26 -18
- package/docs/reference/functions/auditableItemGraphRemoveProof.md +31 -0
- package/docs/reference/functions/auditableItemGraphUpdate.md +1 -1
- package/docs/reference/functions/auditableItemGraphUpdatePartial.md +31 -0
- package/docs/reference/functions/auditableItemGraphVersionGet.md +31 -0
- package/docs/reference/functions/auditableItemGraphVersionList.md +31 -0
- package/docs/reference/index.md +4 -0
- package/docs/reference/interfaces/IAuditableItemGraphServiceConfig.md +8 -0
- package/docs/reference/interfaces/IAuditableItemGraphServiceConstructorOptions.md +18 -10
- package/docs/reference/variables/restEntryPoints.md +2 -0
- package/locales/en.json +6 -2
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auditableItemGraphVertex.js","sourceRoot":"","sources":["../../../src/entities/auditableItemGraphVertex.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,WAAW,EAA0B,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKnE;;GAEG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACpC;;OAEG;IAEI,EAAE,CAAU;IAEnB;;OAEG;IAEI,oBAAoB,CAAU;IAErC;;OAEG;IAEI,WAAW,CAAU;IAE5B;;OAEG;IAOI,YAAY,CAAU;IAE7B;;OAEG;IAEI,UAAU,CAAU;IAE3B;;OAEG;IAEI,iBAAiB,CAAU;IAElC;;OAEG;IAEI,gBAAgB,CAAqB;IAE5C;;OAEG;IAEI,OAAO,CAA6B;IAE3C;;OAEG;IAEI,SAAS,CAAgC;IAEhD;;OAEG;IAEI,KAAK,CAA4B;
|
|
1
|
+
{"version":3,"file":"auditableItemGraphVertex.js","sourceRoot":"","sources":["../../../src/entities/auditableItemGraphVertex.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,WAAW,EAA0B,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKnE;;GAEG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACpC;;OAEG;IAEI,EAAE,CAAU;IAEnB;;OAEG;IAEI,oBAAoB,CAAU;IAErC;;OAEG;IAEI,WAAW,CAAU;IAE5B;;OAEG;IAOI,YAAY,CAAU;IAE7B;;OAEG;IAEI,UAAU,CAAU;IAE3B;;OAEG;IAEI,iBAAiB,CAAU;IAElC;;OAEG;IAEI,gBAAgB,CAAqB;IAE5C;;OAEG;IAEI,OAAO,CAA6B;IAE3C;;OAEG;IAEI,SAAS,CAAgC;IAEhD;;OAEG;IAEI,KAAK,CAA4B;IAExC;;OAEG;IAEI,OAAO,CAAU;CACxB,CAAA;AAlEO;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;oDAC3B;AAMZ;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;sEACQ;AAM9B;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,CAAC,UAAU,EAAE,CAAC;;6DAC/D;AAWrB;IANN,QAAQ,CAAC;QACT,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,WAAW;QACnB,aAAa,EAAE,aAAa,CAAC,UAAU;QACvC,QAAQ,EAAE,IAAI;KACd,CAAC;;8DAC2B;AAMtB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACrC;AAMpB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mEAC9B;AAM3B;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kEACtC;AAMrC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACrB;AAMpC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,4BAA4B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACvC;AAMzC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDAC3C;AAMjC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACtB;AAtEZ,wBAAwB;IADpC,MAAM,EAAE;GACI,wBAAwB,CAuEpC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { JsonLdTypes, type IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport { entity, property, SortDirection } from \"@twin.org/entity\";\nimport type { AuditableItemGraphAlias } from \"./auditableItemGraphAlias.js\";\nimport type { AuditableItemGraphEdge } from \"./auditableItemGraphEdge.js\";\nimport type { AuditableItemGraphResource } from \"./auditableItemGraphResource.js\";\n\n/**\n * Class describing the auditable item graph vertex.\n */\n@entity()\nexport class AuditableItemGraphVertex {\n\t/**\n\t * The id of the vertex.\n\t */\n\t@property({ type: \"string\", isPrimary: true })\n\tpublic id!: string;\n\n\t/**\n\t * The identity of the organization which controls the vertex.\n\t */\n\t@property({ type: \"string\" })\n\tpublic organizationIdentity!: string;\n\n\t/**\n\t * The date/time of when the vertex was created.\n\t */\n\t@property({ type: \"string\", format: \"date-time\", sortDirection: SortDirection.Descending })\n\tpublic dateCreated!: string;\n\n\t/**\n\t * The date/time of when the vertex was last modified.\n\t */\n\t@property({\n\t\ttype: \"string\",\n\t\tformat: \"date-time\",\n\t\tsortDirection: SortDirection.Descending,\n\t\toptional: true\n\t})\n\tpublic dateModified?: string;\n\n\t/**\n\t * Combined alias index for the vertex used for querying.\n\t */\n\t@property({ type: \"string\", isSecondary: true, optional: true })\n\tpublic aliasIndex?: string;\n\n\t/**\n\t * Combined resource type index for the vertex used for querying.\n\t */\n\t@property({ type: \"string\", isSecondary: true, optional: true })\n\tpublic resourceTypeIndex?: string;\n\n\t/**\n\t * Object to associate with the vertex as JSON-LD.\n\t */\n\t@property({ type: \"object\", itemTypeRef: JsonLdTypes.NodeObject, optional: true })\n\tpublic annotationObject?: IJsonLdNodeObject;\n\n\t/**\n\t * Alternative aliases that can be used to identify the vertex.\n\t */\n\t@property({ type: \"array\", itemType: \"string\", optional: true })\n\tpublic aliases?: AuditableItemGraphAlias[];\n\n\t/**\n\t * The resources attached to the vertex.\n\t */\n\t@property({ type: \"array\", itemTypeRef: \"AuditableItemGraphResource\", optional: true })\n\tpublic resources?: AuditableItemGraphResource[];\n\n\t/**\n\t * Edges connected to the vertex.\n\t */\n\t@property({ type: \"array\", itemTypeRef: \"AuditableItemGraphEdge\", optional: true })\n\tpublic edges?: AuditableItemGraphEdge[];\n\n\t/**\n\t * The current version of the vertex, incremented on each changeset.\n\t */\n\t@property({ type: \"integer\", optional: true })\n\tpublic version?: number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAuditableItemGraphServiceConfig.js","sourceRoot":"","sources":["../../../src/models/IAuditableItemGraphServiceConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Configuration for the auditable item graph service.\n */\
|
|
1
|
+
{"version":3,"file":"IAuditableItemGraphServiceConfig.js","sourceRoot":"","sources":["../../../src/models/IAuditableItemGraphServiceConfig.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Configuration for the auditable item graph service.\n */\nexport interface IAuditableItemGraphServiceConfig {\n\t/**\n\t * Timeout in milliseconds for acquiring a mutex lock.\n\t */\n\tmutexTimeoutMs?: number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAuditableItemGraphServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IAuditableItemGraphServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuditableItemGraphServiceConfig } from \"./IAuditableItemGraphServiceConfig.js\";\n\n/**\n * Options for the constructor of the auditable item graph service.\n */\nexport interface IAuditableItemGraphServiceConstructorOptions {\n\t/**\n\t * The immutable proof component type.\n\t * @default immutable-proof\n\t */\n\timmutableProofComponentType?: string;\n\n\t/**\n\t * The entity storage for vertices.\n\t * @default auditable-item-graph-vertex\n\t */\n\tvertexEntityStorageType?: string;\n\n\t/**\n\t * The entity storage for changesets.\n\t * @default auditable-item-graph-changeset\n\t */\n\tchangesetEntityStorageType?: string;\n\n\t/**\n\t * The event bus component type, defaults to no event bus.\n\t */\n\teventBusComponentType?: string;\n\n\t/**\n\t * The configuration for the service.\n\t */\n\tconfig?: IAuditableItemGraphServiceConfig;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IAuditableItemGraphServiceConstructorOptions.js","sourceRoot":"","sources":["../../../src/models/IAuditableItemGraphServiceConstructorOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAuditableItemGraphServiceConfig } from \"./IAuditableItemGraphServiceConfig.js\";\n\n/**\n * Options for the constructor of the auditable item graph service.\n */\nexport interface IAuditableItemGraphServiceConstructorOptions {\n\t/**\n\t * The immutable proof component type.\n\t * @default immutable-proof\n\t */\n\timmutableProofComponentType?: string;\n\n\t/**\n\t * The entity storage for vertices.\n\t * @default auditable-item-graph-vertex\n\t */\n\tvertexEntityStorageType?: string;\n\n\t/**\n\t * The entity storage for changesets.\n\t * @default auditable-item-graph-changeset\n\t */\n\tchangesetEntityStorageType?: string;\n\n\t/**\n\t * The event bus component type, defaults to no event bus.\n\t */\n\teventBusComponentType?: string;\n\n\t/**\n\t * The component type for the optional telemetry component used for event metrics, defaults to no telemetry.\n\t */\n\ttelemetryComponentType?: string;\n\n\t/**\n\t * The configuration for the service.\n\t */\n\tconfig?: IAuditableItemGraphServiceConfig;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAuditableItemGraphServiceContext.js","sourceRoot":"","sources":["../../../src/models/IAuditableItemGraphServiceContext.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\
|
|
1
|
+
{"version":3,"file":"IAuditableItemGraphServiceContext.js","sourceRoot":"","sources":["../../../src/models/IAuditableItemGraphServiceContext.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Context for the auditable item graph service.\n */\nexport interface IAuditableItemGraphServiceContext {\n\t/**\n\t * The current date/time.\n\t */\n\tnow: string;\n\n\t/**\n\t * The organization identity for the operation.\n\t */\n\torganizationIdentity: string;\n\n\t/**\n\t * The user identity for the operation.\n\t */\n\tuserIdentity?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restEntryPoints.js","sourceRoot":"","sources":["../../src/restEntryPoints.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,oCAAoC,EACpC,sBAAsB,EACtB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,eAAe,GAA2B;IACtD;QACC,IAAI,EAAE,sBAAsB;QAC5B,gBAAgB,EAAE,sBAAsB;QACxC,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE,oCAAoC;KACpD;CACD,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRestRouteEntryPoint } from \"@twin.org/api-models\";\nimport {\n\tgenerateRestRoutesAuditableItemGraph,\n\ttagsAuditableItemGraph\n} from \"./auditableItemGraphRoutes.js\";\n\nexport const restEntryPoints: IRestRouteEntryPoint[] = [\n\t{\n\t\tname: \"auditable-item-graph\",\n\t\tdefaultBaseRoute: \"auditable-item-graph\",\n\t\ttags: tagsAuditableItemGraph,\n\t\tgenerateRoutes: generateRestRoutesAuditableItemGraph\n\t}\n];\n"]}
|
|
1
|
+
{"version":3,"file":"restEntryPoints.js","sourceRoot":"","sources":["../../src/restEntryPoints.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,oCAAoC,EACpC,sBAAsB,EACtB,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAA2B;IACtD;QACC,IAAI,EAAE,sBAAsB;QAC5B,gBAAgB,EAAE,sBAAsB;QACxC,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE,oCAAoC;KACpD;CACD,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IRestRouteEntryPoint } from \"@twin.org/api-models\";\nimport {\n\tgenerateRestRoutesAuditableItemGraph,\n\ttagsAuditableItemGraph\n} from \"./auditableItemGraphRoutes.js\";\n\n/**\n * The REST entry points for the auditable item graph service.\n */\nexport const restEntryPoints: IRestRouteEntryPoint[] = [\n\t{\n\t\tname: \"auditable-item-graph\",\n\t\tdefaultBaseRoute: \"auditable-item-graph\",\n\t\ttags: tagsAuditableItemGraph,\n\t\tgenerateRoutes: generateRestRoutesAuditableItemGraph\n\t}\n];\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ICreatedResponse, type IHttpRequestContext, type INoContentResponse, type IRestRoute, type ITag } from "@twin.org/api-models";
|
|
2
|
-
import { type IAuditableItemGraphChangesetGetRequest, type IAuditableItemGraphChangesetGetResponse, type IAuditableItemGraphChangesetListRequest, type IAuditableItemGraphChangesetListResponse, type IAuditableItemGraphCreateRequest, type IAuditableItemGraphGetRequest, type IAuditableItemGraphGetResponse, type IAuditableItemGraphListRequest, type IAuditableItemGraphListResponse, type IAuditableItemGraphUpdateRequest } from "@twin.org/auditable-item-graph-models";
|
|
2
|
+
import { type IAuditableItemGraphChangesetGetRequest, type IAuditableItemGraphChangesetGetResponse, type IAuditableItemGraphChangesetListRequest, type IAuditableItemGraphChangesetListResponse, type IAuditableItemGraphCreateRequest, type IAuditableItemGraphGetRequest, type IAuditableItemGraphGetResponse, type IAuditableItemGraphListRequest, type IAuditableItemGraphListResponse, type IAuditableItemGraphRemoveProofRequest, type IAuditableItemGraphUpdatePartialRequest, type IAuditableItemGraphUpdateRequest, type IAuditableItemGraphVersionGetRequest, type IAuditableItemGraphVersionGetResponse, type IAuditableItemGraphVersionListRequest, type IAuditableItemGraphVersionListResponse } from "@twin.org/auditable-item-graph-models";
|
|
3
3
|
/**
|
|
4
4
|
* The tag to associate with the routes.
|
|
5
5
|
*/
|
|
@@ -44,13 +44,21 @@ export declare function auditableItemGraphChangesetList(httpRequestContext: IHtt
|
|
|
44
44
|
*/
|
|
45
45
|
export declare function auditableItemGraphChangesetGet(httpRequestContext: IHttpRequestContext, componentName: string, request: IAuditableItemGraphChangesetGetRequest): Promise<IAuditableItemGraphChangesetGetResponse>;
|
|
46
46
|
/**
|
|
47
|
-
* Update the graph vertex.
|
|
47
|
+
* Update the graph vertex (PUT — full replacement of vertex state).
|
|
48
48
|
* @param httpRequestContext The request context for the API.
|
|
49
49
|
* @param componentName The name of the component to use in the routes.
|
|
50
50
|
* @param request The request.
|
|
51
51
|
* @returns The response object with additional http response properties.
|
|
52
52
|
*/
|
|
53
53
|
export declare function auditableItemGraphUpdate(httpRequestContext: IHttpRequestContext, componentName: string, request: IAuditableItemGraphUpdateRequest): Promise<INoContentResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Partially update the graph vertex (PATCH — optional scalars; list fields use `{ add, remove }`).
|
|
56
|
+
* @param httpRequestContext The request context for the API.
|
|
57
|
+
* @param componentName The name of the component to use in the routes.
|
|
58
|
+
* @param request The request.
|
|
59
|
+
* @returns The response object with additional http response properties.
|
|
60
|
+
*/
|
|
61
|
+
export declare function auditableItemGraphUpdatePartial(httpRequestContext: IHttpRequestContext, componentName: string, request: IAuditableItemGraphUpdatePartialRequest): Promise<INoContentResponse>;
|
|
54
62
|
/**
|
|
55
63
|
* Query the graph vertices.
|
|
56
64
|
* @param httpRequestContext The request context for the API.
|
|
@@ -59,3 +67,27 @@ export declare function auditableItemGraphUpdate(httpRequestContext: IHttpReques
|
|
|
59
67
|
* @returns The response object with additional http response properties.
|
|
60
68
|
*/
|
|
61
69
|
export declare function auditableItemGraphList(httpRequestContext: IHttpRequestContext, componentName: string, request: IAuditableItemGraphListRequest): Promise<IAuditableItemGraphListResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* Get the graph vertex at a specific version.
|
|
72
|
+
* @param httpRequestContext The request context for the API.
|
|
73
|
+
* @param componentName The name of the component to use in the routes.
|
|
74
|
+
* @param request The request.
|
|
75
|
+
* @returns The response object with additional http response properties.
|
|
76
|
+
*/
|
|
77
|
+
export declare function auditableItemGraphVersionGet(httpRequestContext: IHttpRequestContext, componentName: string, request: IAuditableItemGraphVersionGetRequest): Promise<IAuditableItemGraphVersionGetResponse>;
|
|
78
|
+
/**
|
|
79
|
+
* Remove the notarization proof from all changesets of a graph vertex.
|
|
80
|
+
* @param httpRequestContext The request context for the API.
|
|
81
|
+
* @param componentName The name of the component to use in the routes.
|
|
82
|
+
* @param request The request.
|
|
83
|
+
* @returns The response object with additional http response properties.
|
|
84
|
+
*/
|
|
85
|
+
export declare function auditableItemGraphRemoveProof(httpRequestContext: IHttpRequestContext, componentName: string, request: IAuditableItemGraphRemoveProofRequest): Promise<INoContentResponse>;
|
|
86
|
+
/**
|
|
87
|
+
* Get all versions of a graph vertex.
|
|
88
|
+
* @param httpRequestContext The request context for the API.
|
|
89
|
+
* @param componentName The name of the component to use in the routes.
|
|
90
|
+
* @param request The request.
|
|
91
|
+
* @returns The response object with additional http response properties.
|
|
92
|
+
*/
|
|
93
|
+
export declare function auditableItemGraphVersionList(httpRequestContext: IHttpRequestContext, componentName: string, request: IAuditableItemGraphVersionListRequest): Promise<IAuditableItemGraphVersionListResponse>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { VerifyDepth, type IAuditableItemGraphChangeset, type IAuditableItemGraphChangesetList, type IAuditableItemGraphComponent, type IAuditableItemGraphVertex, type IAuditableItemGraphVertexList } from "@twin.org/auditable-item-graph-models";
|
|
2
|
-
import { type
|
|
3
|
-
import { SortDirection, type IComparator } from "@twin.org/entity";
|
|
1
|
+
import { VerifyDepth, type IAuditableItemGraphChangeset, type IAuditableItemGraphChangesetList, type IAuditableItemGraphComponent, type IAuditableItemGraphPartialVertex, type IAuditableItemGraphVertex, type IAuditableItemGraphVertexList, type IAuditableItemGraphVertexVersionList } from "@twin.org/auditable-item-graph-models";
|
|
2
|
+
import { type EntityCondition, SortDirection } from "@twin.org/entity";
|
|
4
3
|
import type { IAuditableItemGraphServiceConstructorOptions } from "./models/IAuditableItemGraphServiceConstructorOptions.js";
|
|
5
4
|
/**
|
|
6
5
|
* Class for performing auditable item graph operations.
|
|
@@ -28,6 +27,11 @@ export declare class AuditableItemGraphService implements IAuditableItemGraphCom
|
|
|
28
27
|
* @returns The class name of the component.
|
|
29
28
|
*/
|
|
30
29
|
className(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Register all AIG metrics with the telemetry component.
|
|
32
|
+
* @returns A promise that resolves when all metrics have been registered.
|
|
33
|
+
*/
|
|
34
|
+
start(): Promise<void>;
|
|
31
35
|
/**
|
|
32
36
|
* Create a new graph vertex.
|
|
33
37
|
* @param vertex The vertex to create.
|
|
@@ -37,24 +41,21 @@ export declare class AuditableItemGraphService implements IAuditableItemGraphCom
|
|
|
37
41
|
* @param vertex.edges The edges connected to the vertex.
|
|
38
42
|
* @returns The id of the new graph item.
|
|
39
43
|
*/
|
|
40
|
-
create(vertex:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
annotationObject?: IJsonLdNodeObject;
|
|
56
|
-
}[];
|
|
57
|
-
}): Promise<string>;
|
|
44
|
+
create(vertex: Omit<IAuditableItemGraphVertex, "id">): Promise<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Update a graph vertex (PUT — full replacement of vertex state).
|
|
47
|
+
* Concurrent updates for the same vertex are serialized via `Mutex` on the vertex id.
|
|
48
|
+
* @param vertex The vertex to update.
|
|
49
|
+
* @returns A promise that resolves when the vertex has been updated.
|
|
50
|
+
*/
|
|
51
|
+
update(vertex: IAuditableItemGraphVertex): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Partially update a graph vertex (PATCH — explicit list patches; only defined properties applied).
|
|
54
|
+
* Serialized with `update` via `Mutex` on the same vertex id within this instance.
|
|
55
|
+
* @param partial The partial vertex update.
|
|
56
|
+
* @returns A promise that resolves when the partial update has been applied.
|
|
57
|
+
*/
|
|
58
|
+
updatePartial(partial: IAuditableItemGraphPartialVertex): Promise<void>;
|
|
58
59
|
/**
|
|
59
60
|
* Get a graph vertex.
|
|
60
61
|
* @param id The id of the vertex to get.
|
|
@@ -96,48 +97,40 @@ export declare class AuditableItemGraphService implements IAuditableItemGraphCom
|
|
|
96
97
|
verifySignatureDepth?: VerifyDepth;
|
|
97
98
|
}): Promise<IAuditableItemGraphChangeset>;
|
|
98
99
|
/**
|
|
99
|
-
*
|
|
100
|
-
* @param
|
|
101
|
-
* @param
|
|
102
|
-
* @
|
|
103
|
-
* @
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
aliasFormat?: string;
|
|
114
|
-
annotationObject?: IJsonLdNodeObject;
|
|
115
|
-
}[];
|
|
116
|
-
resources?: {
|
|
117
|
-
id?: string;
|
|
118
|
-
resourceObject?: IJsonLdNodeObject;
|
|
119
|
-
}[];
|
|
120
|
-
edges?: {
|
|
121
|
-
id?: string;
|
|
122
|
-
targetId: string;
|
|
123
|
-
edgeRelationships: string[];
|
|
124
|
-
annotationObject?: IJsonLdNodeObject;
|
|
125
|
-
}[];
|
|
126
|
-
}): Promise<void>;
|
|
127
|
-
/**
|
|
128
|
-
* Remove the verifiable storage for an item.
|
|
129
|
-
* @param id The id of the vertex to get.
|
|
130
|
-
* @returns Nothing.
|
|
100
|
+
* Get a graph vertex at a specific version.
|
|
101
|
+
* @param id The id of the vertex.
|
|
102
|
+
* @param version The version number to retrieve.
|
|
103
|
+
* @returns The vertex reconstructed at that version.
|
|
104
|
+
* @throws NotFoundError if the vertex or version is not found.
|
|
105
|
+
*/
|
|
106
|
+
getVersion(id: string, version: number): Promise<IAuditableItemGraphVertex>;
|
|
107
|
+
/**
|
|
108
|
+
* Get all versions of a graph vertex.
|
|
109
|
+
* @param id The id of the vertex.
|
|
110
|
+
* @param options Additional options for the operation.
|
|
111
|
+
* @param options.after Only return versions created after this ISO 8601 timestamp (exclusive).
|
|
112
|
+
* @param options.before Only return versions created before this ISO 8601 timestamp (exclusive).
|
|
113
|
+
* @returns The list of vertex versions.
|
|
131
114
|
* @throws NotFoundError if the vertex is not found.
|
|
132
115
|
*/
|
|
133
|
-
|
|
116
|
+
getVersions(id: string, options?: {
|
|
117
|
+
after?: string;
|
|
118
|
+
before?: string;
|
|
119
|
+
}): Promise<IAuditableItemGraphVertexVersionList>;
|
|
120
|
+
/**
|
|
121
|
+
* Remove the proof for an item.
|
|
122
|
+
* @param id The id of the vertex to remove the proof from.
|
|
123
|
+
* @returns A promise that resolves when the proof has been removed from all changesets.
|
|
124
|
+
* @throws NotFoundError if the vertex is not found.
|
|
125
|
+
*/
|
|
126
|
+
removeProof(id: string): Promise<void>;
|
|
134
127
|
/**
|
|
135
128
|
* Query the graph for vertices.
|
|
136
129
|
* @param options The query options.
|
|
137
130
|
* @param options.id The optional id to look for.
|
|
138
131
|
* @param options.idMode Look in id, alias or both, defaults to both.
|
|
139
132
|
* @param options.idExact Find only exact matches, default to false meaning partial matching.
|
|
140
|
-
* @param options.
|
|
133
|
+
* @param options.resourceTypes Include vertices with specific resource types.
|
|
141
134
|
* @param conditions Conditions to use in the query.
|
|
142
135
|
* @param orderBy The order for the results, defaults to created.
|
|
143
136
|
* @param orderByDirection The direction for the order, defaults to desc.
|
|
@@ -150,23 +143,9 @@ export declare class AuditableItemGraphService implements IAuditableItemGraphCom
|
|
|
150
143
|
id?: string;
|
|
151
144
|
idMode?: "id" | "alias" | "both";
|
|
152
145
|
idExact?: boolean;
|
|
153
|
-
|
|
154
|
-
}, conditions?:
|
|
146
|
+
resourceTypes?: string[];
|
|
147
|
+
}, conditions?: EntityCondition<IAuditableItemGraphVertex>, orderBy?: keyof Pick<IAuditableItemGraphVertex, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, properties?: (keyof IAuditableItemGraphVertex)[], cursor?: string, limit?: number): Promise<{
|
|
155
148
|
entries: IAuditableItemGraphVertexList;
|
|
156
149
|
cursor?: string;
|
|
157
150
|
}>;
|
|
158
|
-
/**
|
|
159
|
-
* Verify the signature of a changeset and add the verification result to the changeset JSON-LD.
|
|
160
|
-
* @param storedChangeset The changeset to verify.
|
|
161
|
-
* @returns Whether the changeset is verified.
|
|
162
|
-
*/
|
|
163
|
-
private verifyChangesetSignature;
|
|
164
|
-
/**
|
|
165
|
-
* Get the resource id from a resource object.
|
|
166
|
-
* @param resource The resource.
|
|
167
|
-
* @param resource.id The id of the resource.
|
|
168
|
-
* @param resource.resourceObject The resource object.
|
|
169
|
-
* @returns The resource id if it can find one.
|
|
170
|
-
*/
|
|
171
|
-
private getResourceId;
|
|
172
151
|
}
|
|
@@ -27,4 +27,8 @@ export declare class AuditableItemGraphAlias {
|
|
|
27
27
|
* Object to associate with the alias as JSON-LD.
|
|
28
28
|
*/
|
|
29
29
|
annotationObject?: IJsonLdNodeObject;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the alias should be unique across the graph, meaning that no other vertex can have the same alias. Defaults to false.
|
|
32
|
+
*/
|
|
33
|
+
unique?: boolean;
|
|
30
34
|
}
|
|
@@ -27,4 +27,8 @@ export declare class AuditableItemGraphChangeset {
|
|
|
27
27
|
* The immutable proof id which contains the signature for this changeset.
|
|
28
28
|
*/
|
|
29
29
|
proofId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The version number of the vertex after this changeset was applied.
|
|
32
|
+
*/
|
|
33
|
+
version?: number;
|
|
30
34
|
}
|
|
@@ -13,7 +13,7 @@ export declare class AuditableItemGraphVertex {
|
|
|
13
13
|
/**
|
|
14
14
|
* The identity of the organization which controls the vertex.
|
|
15
15
|
*/
|
|
16
|
-
organizationIdentity
|
|
16
|
+
organizationIdentity: string;
|
|
17
17
|
/**
|
|
18
18
|
* The date/time of when the vertex was created.
|
|
19
19
|
*/
|
|
@@ -46,4 +46,8 @@ export declare class AuditableItemGraphVertex {
|
|
|
46
46
|
* Edges connected to the vertex.
|
|
47
47
|
*/
|
|
48
48
|
edges?: AuditableItemGraphEdge[];
|
|
49
|
+
/**
|
|
50
|
+
* The current version of the vertex, incremented on each changeset.
|
|
51
|
+
*/
|
|
52
|
+
version?: number;
|
|
49
53
|
}
|
|
@@ -22,6 +22,10 @@ export interface IAuditableItemGraphServiceConstructorOptions {
|
|
|
22
22
|
* The event bus component type, defaults to no event bus.
|
|
23
23
|
*/
|
|
24
24
|
eventBusComponentType?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The component type for the optional telemetry component used for event metrics, defaults to no telemetry.
|
|
27
|
+
*/
|
|
28
|
+
telemetryComponentType?: string;
|
|
25
29
|
/**
|
|
26
30
|
* The configuration for the service.
|
|
27
31
|
*/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { IContextIds } from "@twin.org/context";
|
|
2
1
|
/**
|
|
3
2
|
* Context for the auditable item graph service.
|
|
4
3
|
*/
|
|
@@ -8,7 +7,11 @@ export interface IAuditableItemGraphServiceContext {
|
|
|
8
7
|
*/
|
|
9
8
|
now: string;
|
|
10
9
|
/**
|
|
11
|
-
* The
|
|
10
|
+
* The organization identity for the operation.
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
organizationIdentity: string;
|
|
13
|
+
/**
|
|
14
|
+
* The user identity for the operation.
|
|
15
|
+
*/
|
|
16
|
+
userIdentity?: string;
|
|
14
17
|
}
|