@twin.org/auditable-item-graph-service 0.0.2-next.1 → 0.0.2-next.3
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/cjs/index.cjs
CHANGED
|
@@ -537,16 +537,18 @@ async function auditableItemGraphList(httpRequestContext, componentName, request
|
|
|
537
537
|
* Class for performing auditable item graph operations.
|
|
538
538
|
*/
|
|
539
539
|
class AuditableItemGraphService {
|
|
540
|
-
/**
|
|
541
|
-
* The namespace for the service.
|
|
542
|
-
*/
|
|
543
|
-
static NAMESPACE = "aig";
|
|
544
540
|
/**
|
|
545
541
|
* The namespace for the service changeset.
|
|
546
542
|
*/
|
|
547
543
|
static NAMESPACE_CHANGESET = "changeset";
|
|
544
|
+
/**
|
|
545
|
+
* The namespace for the service.
|
|
546
|
+
* @internal
|
|
547
|
+
*/
|
|
548
|
+
static _NAMESPACE = "aig";
|
|
548
549
|
/**
|
|
549
550
|
* The keys to pick when creating the proof for the stream.
|
|
551
|
+
* @internal
|
|
550
552
|
*/
|
|
551
553
|
static _PROOF_KEYS_CHANGESET = [
|
|
552
554
|
"id",
|
|
@@ -637,7 +639,7 @@ class AuditableItemGraphService {
|
|
|
637
639
|
...vertexModel,
|
|
638
640
|
...this.buildIndexes(vertexModel)
|
|
639
641
|
});
|
|
640
|
-
const fullId = new core.Urn(AuditableItemGraphService.
|
|
642
|
+
const fullId = new core.Urn(AuditableItemGraphService._NAMESPACE, id).toString();
|
|
641
643
|
await this._eventBusComponent?.publish(auditableItemGraphModels.AuditableItemGraphTopics.VertexCreated, { id: fullId });
|
|
642
644
|
return fullId;
|
|
643
645
|
}
|
|
@@ -658,9 +660,9 @@ class AuditableItemGraphService {
|
|
|
658
660
|
async get(id, options) {
|
|
659
661
|
core.Guards.stringValue(this.CLASS_NAME, "id", id);
|
|
660
662
|
const urnParsed = core.Urn.fromValidString(id);
|
|
661
|
-
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService.
|
|
663
|
+
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService._NAMESPACE) {
|
|
662
664
|
throw new core.GeneralError(this.CLASS_NAME, "namespaceMismatch", {
|
|
663
|
-
namespace: AuditableItemGraphService.
|
|
665
|
+
namespace: AuditableItemGraphService._NAMESPACE,
|
|
664
666
|
id
|
|
665
667
|
});
|
|
666
668
|
}
|
|
@@ -733,9 +735,9 @@ class AuditableItemGraphService {
|
|
|
733
735
|
core.Guards.stringValue(this.CLASS_NAME, "userIdentity", userIdentity);
|
|
734
736
|
core.Guards.stringValue(this.CLASS_NAME, "nodeIdentity", nodeIdentity);
|
|
735
737
|
const urnParsed = core.Urn.fromValidString(vertex.id);
|
|
736
|
-
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService.
|
|
738
|
+
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService._NAMESPACE) {
|
|
737
739
|
throw new core.GeneralError(this.CLASS_NAME, "namespaceMismatch", {
|
|
738
|
-
namespace: AuditableItemGraphService.
|
|
740
|
+
namespace: AuditableItemGraphService._NAMESPACE,
|
|
739
741
|
id: vertex.id
|
|
740
742
|
});
|
|
741
743
|
}
|
|
@@ -788,9 +790,9 @@ class AuditableItemGraphService {
|
|
|
788
790
|
core.Guards.stringValue(this.CLASS_NAME, "id", id);
|
|
789
791
|
core.Guards.stringValue(this.CLASS_NAME, "nodeIdentity", nodeIdentity);
|
|
790
792
|
const urnParsed = core.Urn.fromValidString(id);
|
|
791
|
-
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService.
|
|
793
|
+
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService._NAMESPACE) {
|
|
792
794
|
throw new core.GeneralError(this.CLASS_NAME, "namespaceMismatch", {
|
|
793
|
-
namespace: AuditableItemGraphService.
|
|
795
|
+
namespace: AuditableItemGraphService._NAMESPACE,
|
|
794
796
|
id
|
|
795
797
|
});
|
|
796
798
|
}
|
|
@@ -923,7 +925,7 @@ class AuditableItemGraphService {
|
|
|
923
925
|
standardsSchemaOrg.SchemaOrgContexts.ContextRoot
|
|
924
926
|
],
|
|
925
927
|
type: auditableItemGraphModels.AuditableItemGraphTypes.Vertex,
|
|
926
|
-
id: new core.Urn(AuditableItemGraphService.
|
|
928
|
+
id: new core.Urn(AuditableItemGraphService._NAMESPACE, vertexEntity.id).toString(),
|
|
927
929
|
dateCreated: vertexEntity.dateCreated,
|
|
928
930
|
dateModified: vertexEntity.dateModified,
|
|
929
931
|
nodeIdentity: vertexEntity.nodeIdentity,
|
|
@@ -1238,7 +1240,7 @@ class AuditableItemGraphService {
|
|
|
1238
1240
|
// this is a subset of fixed properties from the changeset object.
|
|
1239
1241
|
const reducedChangesetJsonLd = await this.changesetEntityToJsonLd({
|
|
1240
1242
|
...core.ObjectHelper.pick(changesetEntity, AuditableItemGraphService._PROOF_KEYS_CHANGESET),
|
|
1241
|
-
id: `${AuditableItemGraphService.
|
|
1243
|
+
id: `${AuditableItemGraphService._NAMESPACE}:${updated.id}:${AuditableItemGraphService.NAMESPACE_CHANGESET}:${changesetEntity.id}`
|
|
1242
1244
|
});
|
|
1243
1245
|
// Create the proof for the changeset object
|
|
1244
1246
|
changesetEntity.proofId = await this._immutableProofComponent.create(reducedChangesetJsonLd, context.userIdentity, context.nodeIdentity);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -535,16 +535,18 @@ async function auditableItemGraphList(httpRequestContext, componentName, request
|
|
|
535
535
|
* Class for performing auditable item graph operations.
|
|
536
536
|
*/
|
|
537
537
|
class AuditableItemGraphService {
|
|
538
|
-
/**
|
|
539
|
-
* The namespace for the service.
|
|
540
|
-
*/
|
|
541
|
-
static NAMESPACE = "aig";
|
|
542
538
|
/**
|
|
543
539
|
* The namespace for the service changeset.
|
|
544
540
|
*/
|
|
545
541
|
static NAMESPACE_CHANGESET = "changeset";
|
|
542
|
+
/**
|
|
543
|
+
* The namespace for the service.
|
|
544
|
+
* @internal
|
|
545
|
+
*/
|
|
546
|
+
static _NAMESPACE = "aig";
|
|
546
547
|
/**
|
|
547
548
|
* The keys to pick when creating the proof for the stream.
|
|
549
|
+
* @internal
|
|
548
550
|
*/
|
|
549
551
|
static _PROOF_KEYS_CHANGESET = [
|
|
550
552
|
"id",
|
|
@@ -635,7 +637,7 @@ class AuditableItemGraphService {
|
|
|
635
637
|
...vertexModel,
|
|
636
638
|
...this.buildIndexes(vertexModel)
|
|
637
639
|
});
|
|
638
|
-
const fullId = new Urn(AuditableItemGraphService.
|
|
640
|
+
const fullId = new Urn(AuditableItemGraphService._NAMESPACE, id).toString();
|
|
639
641
|
await this._eventBusComponent?.publish(AuditableItemGraphTopics.VertexCreated, { id: fullId });
|
|
640
642
|
return fullId;
|
|
641
643
|
}
|
|
@@ -656,9 +658,9 @@ class AuditableItemGraphService {
|
|
|
656
658
|
async get(id, options) {
|
|
657
659
|
Guards.stringValue(this.CLASS_NAME, "id", id);
|
|
658
660
|
const urnParsed = Urn.fromValidString(id);
|
|
659
|
-
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService.
|
|
661
|
+
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService._NAMESPACE) {
|
|
660
662
|
throw new GeneralError(this.CLASS_NAME, "namespaceMismatch", {
|
|
661
|
-
namespace: AuditableItemGraphService.
|
|
663
|
+
namespace: AuditableItemGraphService._NAMESPACE,
|
|
662
664
|
id
|
|
663
665
|
});
|
|
664
666
|
}
|
|
@@ -731,9 +733,9 @@ class AuditableItemGraphService {
|
|
|
731
733
|
Guards.stringValue(this.CLASS_NAME, "userIdentity", userIdentity);
|
|
732
734
|
Guards.stringValue(this.CLASS_NAME, "nodeIdentity", nodeIdentity);
|
|
733
735
|
const urnParsed = Urn.fromValidString(vertex.id);
|
|
734
|
-
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService.
|
|
736
|
+
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService._NAMESPACE) {
|
|
735
737
|
throw new GeneralError(this.CLASS_NAME, "namespaceMismatch", {
|
|
736
|
-
namespace: AuditableItemGraphService.
|
|
738
|
+
namespace: AuditableItemGraphService._NAMESPACE,
|
|
737
739
|
id: vertex.id
|
|
738
740
|
});
|
|
739
741
|
}
|
|
@@ -786,9 +788,9 @@ class AuditableItemGraphService {
|
|
|
786
788
|
Guards.stringValue(this.CLASS_NAME, "id", id);
|
|
787
789
|
Guards.stringValue(this.CLASS_NAME, "nodeIdentity", nodeIdentity);
|
|
788
790
|
const urnParsed = Urn.fromValidString(id);
|
|
789
|
-
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService.
|
|
791
|
+
if (urnParsed.namespaceIdentifier() !== AuditableItemGraphService._NAMESPACE) {
|
|
790
792
|
throw new GeneralError(this.CLASS_NAME, "namespaceMismatch", {
|
|
791
|
-
namespace: AuditableItemGraphService.
|
|
793
|
+
namespace: AuditableItemGraphService._NAMESPACE,
|
|
792
794
|
id
|
|
793
795
|
});
|
|
794
796
|
}
|
|
@@ -921,7 +923,7 @@ class AuditableItemGraphService {
|
|
|
921
923
|
SchemaOrgContexts.ContextRoot
|
|
922
924
|
],
|
|
923
925
|
type: AuditableItemGraphTypes.Vertex,
|
|
924
|
-
id: new Urn(AuditableItemGraphService.
|
|
926
|
+
id: new Urn(AuditableItemGraphService._NAMESPACE, vertexEntity.id).toString(),
|
|
925
927
|
dateCreated: vertexEntity.dateCreated,
|
|
926
928
|
dateModified: vertexEntity.dateModified,
|
|
927
929
|
nodeIdentity: vertexEntity.nodeIdentity,
|
|
@@ -1236,7 +1238,7 @@ class AuditableItemGraphService {
|
|
|
1236
1238
|
// this is a subset of fixed properties from the changeset object.
|
|
1237
1239
|
const reducedChangesetJsonLd = await this.changesetEntityToJsonLd({
|
|
1238
1240
|
...ObjectHelper.pick(changesetEntity, AuditableItemGraphService._PROOF_KEYS_CHANGESET),
|
|
1239
|
-
id: `${AuditableItemGraphService.
|
|
1241
|
+
id: `${AuditableItemGraphService._NAMESPACE}:${updated.id}:${AuditableItemGraphService.NAMESPACE_CHANGESET}:${changesetEntity.id}`
|
|
1240
1242
|
});
|
|
1241
1243
|
// Create the proof for the changeset object
|
|
1242
1244
|
changesetEntity.proofId = await this._immutableProofComponent.create(reducedChangesetJsonLd, context.userIdentity, context.nodeIdentity);
|
|
@@ -6,18 +6,10 @@ import type { IAuditableItemGraphServiceConstructorOptions } from "./models/IAud
|
|
|
6
6
|
* Class for performing auditable item graph operations.
|
|
7
7
|
*/
|
|
8
8
|
export declare class AuditableItemGraphService implements IAuditableItemGraphComponent {
|
|
9
|
-
/**
|
|
10
|
-
* The namespace for the service.
|
|
11
|
-
*/
|
|
12
|
-
static readonly NAMESPACE: string;
|
|
13
9
|
/**
|
|
14
10
|
* The namespace for the service changeset.
|
|
15
11
|
*/
|
|
16
12
|
static readonly NAMESPACE_CHANGESET: string;
|
|
17
|
-
/**
|
|
18
|
-
* The keys to pick when creating the proof for the stream.
|
|
19
|
-
*/
|
|
20
|
-
private static readonly _PROOF_KEYS_CHANGESET;
|
|
21
13
|
/**
|
|
22
14
|
* Runtime name for the class.
|
|
23
15
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @twin.org/auditable-item-graph-service - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.3](https://github.com/twinfoundation/auditable-item-graph/compare/auditable-item-graph-service-v0.0.2-next.2...auditable-item-graph-service-v0.0.2-next.3) (2025-08-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* eslint migration to flat config ([1b42a3a](https://github.com/twinfoundation/auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/auditable-item-graph-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
16
|
+
|
|
17
|
+
## [0.0.2-next.2](https://github.com/twinfoundation/auditable-item-graph/compare/auditable-item-graph-service-v0.0.2-next.1...auditable-item-graph-service-v0.0.2-next.2) (2025-08-20)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* remove unused namespace ([ff1a3b4](https://github.com/twinfoundation/auditable-item-graph/commit/ff1a3b4e414fe2ee311a03027456ee40fbb580d7))
|
|
23
|
+
* update framework core ([88ad4e6](https://github.com/twinfoundation/auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @twin.org/auditable-item-graph-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
31
|
+
|
|
3
32
|
## [0.0.2-next.1](https://github.com/twinfoundation/auditable-item-graph/compare/auditable-item-graph-service-v0.0.2-next.0...auditable-item-graph-service-v0.0.2-next.1) (2025-07-21)
|
|
4
33
|
|
|
5
34
|
|
package/docs/open-api/spec.json
CHANGED
|
@@ -28,14 +28,6 @@ The dependencies for the auditable item graph connector.
|
|
|
28
28
|
|
|
29
29
|
## Properties
|
|
30
30
|
|
|
31
|
-
### NAMESPACE
|
|
32
|
-
|
|
33
|
-
> `readonly` `static` **NAMESPACE**: `string` = `"aig"`
|
|
34
|
-
|
|
35
|
-
The namespace for the service.
|
|
36
|
-
|
|
37
|
-
***
|
|
38
|
-
|
|
39
31
|
### NAMESPACE\_CHANGESET
|
|
40
32
|
|
|
41
33
|
> `readonly` `static` **NAMESPACE\_CHANGESET**: `string` = `"changeset"`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/auditable-item-graph-service",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.3",
|
|
4
4
|
"description": "Auditable Item Graph contract implementation and REST endpoint definitions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/api-models": "next",
|
|
18
|
-
"@twin.org/auditable-item-graph-models": "0.0.2-next.
|
|
18
|
+
"@twin.org/auditable-item-graph-models": "0.0.2-next.3",
|
|
19
19
|
"@twin.org/core": "next",
|
|
20
20
|
"@twin.org/crypto": "next",
|
|
21
21
|
"@twin.org/data-json-ld": "next",
|