@twin.org/auditable-item-graph-service 0.9.2 → 0.10.0

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.
@@ -1,5 +1,3 @@
1
- // Copyright 2024 IOTA Stiftung.
2
- // SPDX-License-Identifier: Apache-2.0.
3
1
  import { JsonLdTypes } from "@twin.org/data-json-ld";
4
2
  import { entity, property, SortDirection } from "@twin.org/entity";
5
3
  /**
@@ -22,6 +20,10 @@ let AuditableItemGraphVertex = class AuditableItemGraphVertex {
22
20
  * The date/time of when the vertex was last modified.
23
21
  */
24
22
  dateModified;
23
+ /**
24
+ * How the mutations of the vertex are recorded, when absent the vertex behaves as audited.
25
+ */
26
+ auditMode;
25
27
  /**
26
28
  * Combined alias index for the vertex used for querying.
27
29
  */
@@ -72,6 +74,10 @@ __decorate([
72
74
  }),
73
75
  __metadata("design:type", String)
74
76
  ], AuditableItemGraphVertex.prototype, "dateModified", void 0);
77
+ __decorate([
78
+ property({ type: "string", optional: true }),
79
+ __metadata("design:type", String)
80
+ ], AuditableItemGraphVertex.prototype, "auditMode", void 0);
75
81
  __decorate([
76
82
  property({ type: "string", isSecondary: true, optional: true }),
77
83
  __metadata("design:type", String)
@@ -101,7 +107,7 @@ __decorate([
101
107
  __metadata("design:type", Number)
102
108
  ], AuditableItemGraphVertex.prototype, "version", void 0);
103
109
  AuditableItemGraphVertex = __decorate([
104
- entity()
110
+ entity({ version: 1 })
105
111
  ], AuditableItemGraphVertex);
106
112
  export { AuditableItemGraphVertex };
107
113
  //# sourceMappingURL=auditableItemGraphVertex.js.map
@@ -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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AAU,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
+ {"version":3,"file":"auditableItemGraphVertex.js","sourceRoot":"","sources":["../../../src/entities/auditableItemGraphVertex.ts"],"names":[],"mappings":"AAGA,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;I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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;AA5EZ,wBAAwB;IADpC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;GACV,wBAAwB,CA6EpC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { AuditableItemGraphAuditMode } from \"@twin.org/auditable-item-graph-models\";\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({ version: 1 })\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 * How the mutations of the vertex are recorded, when absent the vertex behaves as audited.\n\t */\n\t@property({ type: \"string\", optional: true })\n\tpublic auditMode?: AuditableItemGraphAuditMode;\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"]}
@@ -0,0 +1,107 @@
1
+ // Copyright 2026 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { JsonLdTypes } from "@twin.org/data-json-ld";
4
+ import { entity, property, SortDirection } from "@twin.org/entity";
5
+ /**
6
+ * Class describing the auditable item graph vertex, version 0.
7
+ */
8
+ let AuditableItemGraphVertexV0 = class AuditableItemGraphVertexV0 {
9
+ /**
10
+ * The id of the vertex.
11
+ */
12
+ id;
13
+ /**
14
+ * The identity of the organization which controls the vertex.
15
+ */
16
+ organizationIdentity;
17
+ /**
18
+ * The date/time of when the vertex was created.
19
+ */
20
+ dateCreated;
21
+ /**
22
+ * The date/time of when the vertex was last modified.
23
+ */
24
+ dateModified;
25
+ /**
26
+ * Combined alias index for the vertex used for querying.
27
+ */
28
+ aliasIndex;
29
+ /**
30
+ * Combined resource type index for the vertex used for querying.
31
+ */
32
+ resourceTypeIndex;
33
+ /**
34
+ * Object to associate with the vertex as JSON-LD.
35
+ */
36
+ annotationObject;
37
+ /**
38
+ * Alternative aliases that can be used to identify the vertex.
39
+ */
40
+ aliases;
41
+ /**
42
+ * The resources attached to the vertex.
43
+ */
44
+ resources;
45
+ /**
46
+ * Edges connected to the vertex.
47
+ */
48
+ edges;
49
+ /**
50
+ * The current version of the vertex, incremented on each changeset.
51
+ */
52
+ version;
53
+ };
54
+ __decorate([
55
+ property({ type: "string", isPrimary: true }),
56
+ __metadata("design:type", String)
57
+ ], AuditableItemGraphVertexV0.prototype, "id", void 0);
58
+ __decorate([
59
+ property({ type: "string" }),
60
+ __metadata("design:type", String)
61
+ ], AuditableItemGraphVertexV0.prototype, "organizationIdentity", void 0);
62
+ __decorate([
63
+ property({ type: "string", format: "date-time", sortDirection: SortDirection.Descending }),
64
+ __metadata("design:type", String)
65
+ ], AuditableItemGraphVertexV0.prototype, "dateCreated", void 0);
66
+ __decorate([
67
+ property({
68
+ type: "string",
69
+ format: "date-time",
70
+ sortDirection: SortDirection.Descending,
71
+ optional: true
72
+ }),
73
+ __metadata("design:type", String)
74
+ ], AuditableItemGraphVertexV0.prototype, "dateModified", void 0);
75
+ __decorate([
76
+ property({ type: "string", isSecondary: true, optional: true }),
77
+ __metadata("design:type", String)
78
+ ], AuditableItemGraphVertexV0.prototype, "aliasIndex", void 0);
79
+ __decorate([
80
+ property({ type: "string", isSecondary: true, optional: true }),
81
+ __metadata("design:type", String)
82
+ ], AuditableItemGraphVertexV0.prototype, "resourceTypeIndex", void 0);
83
+ __decorate([
84
+ property({ type: "object", itemTypeRef: JsonLdTypes.NodeObject, optional: true }),
85
+ __metadata("design:type", Object)
86
+ ], AuditableItemGraphVertexV0.prototype, "annotationObject", void 0);
87
+ __decorate([
88
+ property({ type: "array", itemType: "string", optional: true }),
89
+ __metadata("design:type", Array)
90
+ ], AuditableItemGraphVertexV0.prototype, "aliases", void 0);
91
+ __decorate([
92
+ property({ type: "array", itemTypeRef: "AuditableItemGraphResource", optional: true }),
93
+ __metadata("design:type", Array)
94
+ ], AuditableItemGraphVertexV0.prototype, "resources", void 0);
95
+ __decorate([
96
+ property({ type: "array", itemTypeRef: "AuditableItemGraphEdge", optional: true }),
97
+ __metadata("design:type", Array)
98
+ ], AuditableItemGraphVertexV0.prototype, "edges", void 0);
99
+ __decorate([
100
+ property({ type: "integer", optional: true }),
101
+ __metadata("design:type", Number)
102
+ ], AuditableItemGraphVertexV0.prototype, "version", void 0);
103
+ AuditableItemGraphVertexV0 = __decorate([
104
+ entity({ version: 0 })
105
+ ], AuditableItemGraphVertexV0);
106
+ export { AuditableItemGraphVertexV0 };
107
+ //# sourceMappingURL=auditableItemGraphVertexV0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auditableItemGraphVertexV0.js","sourceRoot":"","sources":["../../../src/entities/auditableItemGraphVertexV0.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,0BAA0B,GAAhC,MAAM,0BAA0B;IACtC;;OAEG;IAEI,EAAE,CAAU;IAEnB;;OAEG;IAEI,oBAAoB,CAAU;IAErC;;OAEG;IAEI,WAAW,CAAU;IAE5B;;OAEG;IAOI,YAAY,CAAU;IAE7B;;OAE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,EAAE,WAAW,EAAE,4BAA4B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6DACvC;AAMzC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDAC3C;AAMjC;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACtB;AAtEZ,0BAA0B;IADtC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;GACV,0BAA0B,CAuEtC","sourcesContent":["// Copyright 2026 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, version 0.\n */\n@entity({ version: 0 })\nexport class AuditableItemGraphVertexV0 {\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"]}
package/dist/es/index.js CHANGED
@@ -8,6 +8,7 @@ export * from "./entities/auditableItemGraphEdge.js";
8
8
  export * from "./entities/auditableItemGraphPatch.js";
9
9
  export * from "./entities/auditableItemGraphResource.js";
10
10
  export * from "./entities/auditableItemGraphVertex.js";
11
+ export * from "./entities/auditableItemGraphVertexV0.js";
11
12
  export * from "./models/IAuditableItemGraphServiceConfig.js";
12
13
  export * from "./models/IAuditableItemGraphServiceConstructorOptions.js";
13
14
  export * from "./restEntryPoints.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0DAA0D,CAAC;AACzE,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./auditableItemGraphRoutes.js\";\nexport * from \"./auditableItemGraphService.js\";\nexport * from \"./entities/auditableItemGraphAlias.js\";\nexport * from \"./entities/auditableItemGraphChangeset.js\";\nexport * from \"./entities/auditableItemGraphEdge.js\";\nexport * from \"./entities/auditableItemGraphPatch.js\";\nexport * from \"./entities/auditableItemGraphResource.js\";\nexport * from \"./entities/auditableItemGraphVertex.js\";\nexport * from \"./models/IAuditableItemGraphServiceConfig.js\";\nexport * from \"./models/IAuditableItemGraphServiceConstructorOptions.js\";\nexport * from \"./restEntryPoints.js\";\nexport * from \"./schema.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0DAA0D,CAAC;AACzE,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./auditableItemGraphRoutes.js\";\nexport * from \"./auditableItemGraphService.js\";\nexport * from \"./entities/auditableItemGraphAlias.js\";\nexport * from \"./entities/auditableItemGraphChangeset.js\";\nexport * from \"./entities/auditableItemGraphEdge.js\";\nexport * from \"./entities/auditableItemGraphPatch.js\";\nexport * from \"./entities/auditableItemGraphResource.js\";\nexport * from \"./entities/auditableItemGraphVertex.js\";\nexport * from \"./entities/auditableItemGraphVertexV0.js\";\nexport * from \"./models/IAuditableItemGraphServiceConfig.js\";\nexport * from \"./models/IAuditableItemGraphServiceConstructorOptions.js\";\nexport * from \"./restEntryPoints.js\";\nexport * from \"./schema.js\";\n"]}
package/dist/es/schema.js CHANGED
@@ -7,11 +7,13 @@ import { AuditableItemGraphEdge } from "./entities/auditableItemGraphEdge.js";
7
7
  import { AuditableItemGraphPatch } from "./entities/auditableItemGraphPatch.js";
8
8
  import { AuditableItemGraphResource } from "./entities/auditableItemGraphResource.js";
9
9
  import { AuditableItemGraphVertex } from "./entities/auditableItemGraphVertex.js";
10
+ import { AuditableItemGraphVertexV0 } from "./entities/auditableItemGraphVertexV0.js";
10
11
  /**
11
12
  * Initialize the schema for the auditable item graph entity storage connector.
12
13
  */
13
14
  export function initSchema() {
14
15
  EntitySchemaFactory.register("AuditableItemGraphVertex", () => EntitySchemaHelper.getSchema(AuditableItemGraphVertex));
16
+ EntitySchemaFactory.register("AuditableItemGraphVertexV0", () => EntitySchemaHelper.getSchema(AuditableItemGraphVertexV0));
15
17
  EntitySchemaFactory.register("AuditableItemGraphAlias", () => EntitySchemaHelper.getSchema(AuditableItemGraphAlias));
16
18
  EntitySchemaFactory.register("AuditableItemGraphResource", () => EntitySchemaHelper.getSchema(AuditableItemGraphResource));
17
19
  EntitySchemaFactory.register("AuditableItemGraphEdge", () => EntitySchemaHelper.getSchema(AuditableItemGraphEdge));
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAElF;;GAEG;AACH,MAAM,UAAU,UAAU;IACzB,mBAAmB,CAAC,QAAQ,6BAAqC,GAAG,EAAE,CACrE,kBAAkB,CAAC,SAAS,CAAC,wBAAwB,CAAC,CACtD,CAAC;IACF,mBAAmB,CAAC,QAAQ,4BAAoC,GAAG,EAAE,CACpE,kBAAkB,CAAC,SAAS,CAAC,uBAAuB,CAAC,CACrD,CAAC;IACF,mBAAmB,CAAC,QAAQ,+BAAuC,GAAG,EAAE,CACvE,kBAAkB,CAAC,SAAS,CAAC,0BAA0B,CAAC,CACxD,CAAC;IACF,mBAAmB,CAAC,QAAQ,2BAAmC,GAAG,EAAE,CACnE,kBAAkB,CAAC,SAAS,CAAC,sBAAsB,CAAC,CACpD,CAAC;IACF,mBAAmB,CAAC,QAAQ,gCAAwC,GAAG,EAAE,CACxE,kBAAkB,CAAC,SAAS,CAAC,2BAA2B,CAAC,CACzD,CAAC;IACF,mBAAmB,CAAC,QAAQ,4BAAoC,GAAG,EAAE,CACpE,kBAAkB,CAAC,SAAS,CAAC,uBAAuB,CAAC,CACrD,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { EntitySchemaFactory, EntitySchemaHelper } from \"@twin.org/entity\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { AuditableItemGraphAlias } from \"./entities/auditableItemGraphAlias.js\";\nimport { AuditableItemGraphChangeset } from \"./entities/auditableItemGraphChangeset.js\";\nimport { AuditableItemGraphEdge } from \"./entities/auditableItemGraphEdge.js\";\nimport { AuditableItemGraphPatch } from \"./entities/auditableItemGraphPatch.js\";\nimport { AuditableItemGraphResource } from \"./entities/auditableItemGraphResource.js\";\nimport { AuditableItemGraphVertex } from \"./entities/auditableItemGraphVertex.js\";\n\n/**\n * Initialize the schema for the auditable item graph entity storage connector.\n */\nexport function initSchema(): void {\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphVertex>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphVertex)\n\t);\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphAlias>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphAlias)\n\t);\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphResource>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphResource)\n\t);\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphEdge>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphEdge)\n\t);\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphChangeset>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphChangeset)\n\t);\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphPatch>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphPatch)\n\t);\n}\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/schema.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAEtF;;GAEG;AACH,MAAM,UAAU,UAAU;IACzB,mBAAmB,CAAC,QAAQ,6BAAqC,GAAG,EAAE,CACrE,kBAAkB,CAAC,SAAS,CAAC,wBAAwB,CAAC,CACtD,CAAC;IACF,mBAAmB,CAAC,QAAQ,+BAAuC,GAAG,EAAE,CACvE,kBAAkB,CAAC,SAAS,CAAC,0BAA0B,CAAC,CACxD,CAAC;IACF,mBAAmB,CAAC,QAAQ,4BAAoC,GAAG,EAAE,CACpE,kBAAkB,CAAC,SAAS,CAAC,uBAAuB,CAAC,CACrD,CAAC;IACF,mBAAmB,CAAC,QAAQ,+BAAuC,GAAG,EAAE,CACvE,kBAAkB,CAAC,SAAS,CAAC,0BAA0B,CAAC,CACxD,CAAC;IACF,mBAAmB,CAAC,QAAQ,2BAAmC,GAAG,EAAE,CACnE,kBAAkB,CAAC,SAAS,CAAC,sBAAsB,CAAC,CACpD,CAAC;IACF,mBAAmB,CAAC,QAAQ,gCAAwC,GAAG,EAAE,CACxE,kBAAkB,CAAC,SAAS,CAAC,2BAA2B,CAAC,CACzD,CAAC;IACF,mBAAmB,CAAC,QAAQ,4BAAoC,GAAG,EAAE,CACpE,kBAAkB,CAAC,SAAS,CAAC,uBAAuB,CAAC,CACrD,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { EntitySchemaFactory, EntitySchemaHelper } from \"@twin.org/entity\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { AuditableItemGraphAlias } from \"./entities/auditableItemGraphAlias.js\";\nimport { AuditableItemGraphChangeset } from \"./entities/auditableItemGraphChangeset.js\";\nimport { AuditableItemGraphEdge } from \"./entities/auditableItemGraphEdge.js\";\nimport { AuditableItemGraphPatch } from \"./entities/auditableItemGraphPatch.js\";\nimport { AuditableItemGraphResource } from \"./entities/auditableItemGraphResource.js\";\nimport { AuditableItemGraphVertex } from \"./entities/auditableItemGraphVertex.js\";\nimport { AuditableItemGraphVertexV0 } from \"./entities/auditableItemGraphVertexV0.js\";\n\n/**\n * Initialize the schema for the auditable item graph entity storage connector.\n */\nexport function initSchema(): void {\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphVertex>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphVertex)\n\t);\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphVertexV0>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphVertexV0)\n\t);\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphAlias>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphAlias)\n\t);\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphResource>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphResource)\n\t);\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphEdge>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphEdge)\n\t);\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphChangeset>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphChangeset)\n\t);\n\tEntitySchemaFactory.register(nameof<AuditableItemGraphPatch>(), () =>\n\t\tEntitySchemaHelper.getSchema(AuditableItemGraphPatch)\n\t);\n}\n"]}
@@ -43,6 +43,7 @@ export declare class AuditableItemGraphService implements IAuditableItemGraphCom
43
43
  /**
44
44
  * Create a new graph vertex.
45
45
  * @param vertex The vertex to create.
46
+ * @param vertex.auditMode How the mutations of the vertex are recorded, defaults to audited.
46
47
  * @param vertex.annotationObject The annotation object for the vertex as JSON-LD.
47
48
  * @param vertex.aliases Alternative aliases that can be used to identify the vertex.
48
49
  * @param vertex.resources The resources attached to the vertex.
@@ -55,6 +56,7 @@ export declare class AuditableItemGraphService implements IAuditableItemGraphCom
55
56
  * Concurrent updates for the same vertex are serialized via `Mutex` on the vertex id.
56
57
  * @param vertex The vertex to update.
57
58
  * @returns A promise that resolves when the vertex has been updated.
59
+ * @throws GeneralError If a bypass vertex is being switched back to audited.
58
60
  */
59
61
  update(vertex: IAuditableItemGraphVertex): Promise<void>;
60
62
  /**
@@ -62,6 +64,7 @@ export declare class AuditableItemGraphService implements IAuditableItemGraphCom
62
64
  * Serialized with `update` via `Mutex` on the same vertex id within this instance.
63
65
  * @param partial The partial vertex update.
64
66
  * @returns A promise that resolves when the partial update has been applied.
67
+ * @throws GeneralError If a bypass vertex is being switched back to audited.
65
68
  */
66
69
  updatePartial(partial: IAuditableItemGraphPartialVertex): Promise<void>;
67
70
  /**
@@ -109,7 +112,7 @@ export declare class AuditableItemGraphService implements IAuditableItemGraphCom
109
112
  * @param id The id of the vertex.
110
113
  * @param version The version number to retrieve.
111
114
  * @returns The vertex reconstructed at that version.
112
- * @throws NotFoundError if the vertex or version is not found.
115
+ * @throws NotFoundError if the vertex or version is not found, a bypass vertex never has versions.
113
116
  */
114
117
  getVersion(id: string, version: number): Promise<IAuditableItemGraphVertex>;
115
118
  /**
@@ -118,7 +121,8 @@ export declare class AuditableItemGraphService implements IAuditableItemGraphCom
118
121
  * @param options Additional options for the operation.
119
122
  * @param options.after Only return versions created after this ISO 8601 timestamp (exclusive).
120
123
  * @param options.before Only return versions created before this ISO 8601 timestamp (exclusive).
121
- * @returns The list of vertex versions.
124
+ * @returns The list of vertex versions, a bypass vertex returns a single baseline entry for its
125
+ * current state when that falls within the requested range.
122
126
  * @throws NotFoundError if the vertex is not found.
123
127
  */
124
128
  getVersions(id: string, options?: {
@@ -1,3 +1,4 @@
1
+ import type { AuditableItemGraphAuditMode } from "@twin.org/auditable-item-graph-models";
1
2
  import { type IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
3
  import type { AuditableItemGraphAlias } from "./auditableItemGraphAlias.js";
3
4
  import type { AuditableItemGraphEdge } from "./auditableItemGraphEdge.js";
@@ -22,6 +23,10 @@ export declare class AuditableItemGraphVertex {
22
23
  * The date/time of when the vertex was last modified.
23
24
  */
24
25
  dateModified?: string;
26
+ /**
27
+ * How the mutations of the vertex are recorded, when absent the vertex behaves as audited.
28
+ */
29
+ auditMode?: AuditableItemGraphAuditMode;
25
30
  /**
26
31
  * Combined alias index for the vertex used for querying.
27
32
  */
@@ -0,0 +1,53 @@
1
+ import { type IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
+ import type { AuditableItemGraphAlias } from "./auditableItemGraphAlias.js";
3
+ import type { AuditableItemGraphEdge } from "./auditableItemGraphEdge.js";
4
+ import type { AuditableItemGraphResource } from "./auditableItemGraphResource.js";
5
+ /**
6
+ * Class describing the auditable item graph vertex, version 0.
7
+ */
8
+ export declare class AuditableItemGraphVertexV0 {
9
+ /**
10
+ * The id of the vertex.
11
+ */
12
+ id: string;
13
+ /**
14
+ * The identity of the organization which controls the vertex.
15
+ */
16
+ organizationIdentity: string;
17
+ /**
18
+ * The date/time of when the vertex was created.
19
+ */
20
+ dateCreated: string;
21
+ /**
22
+ * The date/time of when the vertex was last modified.
23
+ */
24
+ dateModified?: string;
25
+ /**
26
+ * Combined alias index for the vertex used for querying.
27
+ */
28
+ aliasIndex?: string;
29
+ /**
30
+ * Combined resource type index for the vertex used for querying.
31
+ */
32
+ resourceTypeIndex?: string;
33
+ /**
34
+ * Object to associate with the vertex as JSON-LD.
35
+ */
36
+ annotationObject?: IJsonLdNodeObject;
37
+ /**
38
+ * Alternative aliases that can be used to identify the vertex.
39
+ */
40
+ aliases?: AuditableItemGraphAlias[];
41
+ /**
42
+ * The resources attached to the vertex.
43
+ */
44
+ resources?: AuditableItemGraphResource[];
45
+ /**
46
+ * Edges connected to the vertex.
47
+ */
48
+ edges?: AuditableItemGraphEdge[];
49
+ /**
50
+ * The current version of the vertex, incremented on each changeset.
51
+ */
52
+ version?: number;
53
+ }
@@ -6,6 +6,7 @@ export * from "./entities/auditableItemGraphEdge.js";
6
6
  export * from "./entities/auditableItemGraphPatch.js";
7
7
  export * from "./entities/auditableItemGraphResource.js";
8
8
  export * from "./entities/auditableItemGraphVertex.js";
9
+ export * from "./entities/auditableItemGraphVertexV0.js";
9
10
  export * from "./models/IAuditableItemGraphServiceConfig.js";
10
11
  export * from "./models/IAuditableItemGraphServiceConstructorOptions.js";
11
12
  export * from "./restEntryPoints.js";
package/docs/changelog.md CHANGED
@@ -1,5 +1,92 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.10.0](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-service-v0.10.0...auditable-item-graph-service-v0.10.0) (2026-09-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * release to production ([0ce06f7](https://github.com/iotaledger/twin-auditable-item-graph/commit/0ce06f7825aa72d04b7a2ffd8c98cb56290b9d16))
9
+ * release to production ([#110](https://github.com/iotaledger/twin-auditable-item-graph/issues/110)) ([3117da3](https://github.com/iotaledger/twin-auditable-item-graph/commit/3117da373b462d1c8dcb7e1416bcb223f2a28664))
10
+ * release to production ([#113](https://github.com/iotaledger/twin-auditable-item-graph/issues/113)) ([4efe407](https://github.com/iotaledger/twin-auditable-item-graph/commit/4efe40774803f01eb70043b8cfd607e8c050bc64))
11
+ * release to production ([#129](https://github.com/iotaledger/twin-auditable-item-graph/issues/129)) ([34417f9](https://github.com/iotaledger/twin-auditable-item-graph/commit/34417f9914b84379ea3df9017bc55cf770e938df))
12
+ * release to production ([#137](https://github.com/iotaledger/twin-auditable-item-graph/issues/137)) ([959187f](https://github.com/iotaledger/twin-auditable-item-graph/commit/959187f5dc6d7677edec9ce89d56735cefdebf50))
13
+ * release to production [skip ci] ([#146](https://github.com/iotaledger/twin-auditable-item-graph/issues/146)) ([2da3164](https://github.com/iotaledger/twin-auditable-item-graph/commit/2da3164d4e06fc0b40ca46433b9ef286786d822e))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * tests ([3875814](https://github.com/iotaledger/twin-auditable-item-graph/commit/387581441464c41c0bffb7ca4f45200d05a7d91f))
19
+
20
+ ## [0.9.3-next.1](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-service-v0.9.3-next.0...auditable-item-graph-service-v0.9.3-next.1) (2026-09-04)
21
+
22
+
23
+ ### Features
24
+
25
+ * add context id features ([#30](https://github.com/iotaledger/twin-auditable-item-graph/issues/30)) ([a35d37c](https://github.com/iotaledger/twin-auditable-item-graph/commit/a35d37c0db62a240adde493965c0a9f7971fec45))
26
+ * add data types with fully qualified name ([93e1ee7](https://github.com/iotaledger/twin-auditable-item-graph/commit/93e1ee7c0f7bad81f003787f797f363864e201af))
27
+ * add event-driven telemetry metrics ([#63](https://github.com/iotaledger/twin-auditable-item-graph/issues/63)) ([8fe6cdd](https://github.com/iotaledger/twin-auditable-item-graph/commit/8fe6cdd0d56496402b766c151f002f475ddb8c0e))
28
+ * add health provider ([#132](https://github.com/iotaledger/twin-auditable-item-graph/issues/132)) ([5183025](https://github.com/iotaledger/twin-auditable-item-graph/commit/51830259fe6480cd56d1aeade0b1889f2c59f711))
29
+ * add optional audit mode ([#140](https://github.com/iotaledger/twin-auditable-item-graph/issues/140)) ([95e8fba](https://github.com/iotaledger/twin-auditable-item-graph/commit/95e8fba664611fb9bc6ab18dea6020a2a4e40792))
30
+ * add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/iotaledger/twin-auditable-item-graph/commit/33dbd19cabd9fbfaba81032f1d1a6527584c3f5a))
31
+ * add validate-locales ([e76e6f6](https://github.com/iotaledger/twin-auditable-item-graph/commit/e76e6f6b3ec9c447a04315d353442e32233601d3))
32
+ * add versions ([#60](https://github.com/iotaledger/twin-auditable-item-graph/issues/60)) ([5c36f94](https://github.com/iotaledger/twin-auditable-item-graph/commit/5c36f94b1155c01dddbc8d62f3f65d599916c521))
33
+ * add vertex validation ([#54](https://github.com/iotaledger/twin-auditable-item-graph/issues/54)) ([d3ef124](https://github.com/iotaledger/twin-auditable-item-graph/commit/d3ef1241f60956dc296e22d063f188921255d68c))
34
+ * additional query conditions ([#100](https://github.com/iotaledger/twin-auditable-item-graph/issues/100)) ([4fc6b7a](https://github.com/iotaledger/twin-auditable-item-graph/commit/4fc6b7afd7a854806537954fcd334619304da49c))
35
+ * changeset endpoints ([#44](https://github.com/iotaledger/twin-auditable-item-graph/issues/44)) ([7c854de](https://github.com/iotaledger/twin-auditable-item-graph/commit/7c854de39b247d6f24cd94a04a9f99fa9edde51d))
36
+ * configurable timeout for mutex ([5178789](https://github.com/iotaledger/twin-auditable-item-graph/commit/5178789ba160bca95221ce26bf87d7bd8c0c8619))
37
+ * enhanced rest testing ([#119](https://github.com/iotaledger/twin-auditable-item-graph/issues/119)) ([11f5653](https://github.com/iotaledger/twin-auditable-item-graph/commit/11f5653d297066983b5787429a262eca6a6f3fa7))
38
+ * eslint migration to flat config ([1b42a3a](https://github.com/iotaledger/twin-auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
39
+ * id optional in edge updates ([6b63fe3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6b63fe34553104843ae15aa5066775f5872859e9))
40
+ * improve JSON schemas ([bec8dc1](https://github.com/iotaledger/twin-auditable-item-graph/commit/bec8dc1f270c6c9710623a192b984cf46f8a5613))
41
+ * improved versioning ([#66](https://github.com/iotaledger/twin-auditable-item-graph/issues/66)) ([1b497cd](https://github.com/iotaledger/twin-auditable-item-graph/commit/1b497cdc88eec9b6707b097283773e109baae3aa))
42
+ * mutex on remove proof operation ([d3697a0](https://github.com/iotaledger/twin-auditable-item-graph/commit/d3697a010997c2f9da1d13922a321be002ee27d3))
43
+ * only set dateModified after update ([#4](https://github.com/iotaledger/twin-auditable-item-graph/issues/4)) ([43ea6e5](https://github.com/iotaledger/twin-auditable-item-graph/commit/43ea6e5f2d0b9181a80f0bf2935db64b3263839a))
44
+ * organization identifiers ([#88](https://github.com/iotaledger/twin-auditable-item-graph/issues/88)) ([c58d35b](https://github.com/iotaledger/twin-auditable-item-graph/commit/c58d35bd5b878da0fa02862797c70b61e4f2a469))
45
+ * remove hosting component ([#91](https://github.com/iotaledger/twin-auditable-item-graph/issues/91)) ([d6180a8](https://github.com/iotaledger/twin-auditable-item-graph/commit/d6180a89a741314d81b44a9664aaff708c2d0ffa))
46
+ * remove unused namespace ([ff1a3b4](https://github.com/iotaledger/twin-auditable-item-graph/commit/ff1a3b4e414fe2ee311a03027456ee40fbb580d7))
47
+ * replace nextItem property with Link header ([#39](https://github.com/iotaledger/twin-auditable-item-graph/issues/39)) ([b29a333](https://github.com/iotaledger/twin-auditable-item-graph/commit/b29a333ca78ca2091e54e3e6f4355f84c350007d))
48
+ * rest enhancements ([1e51050](https://github.com/iotaledger/twin-auditable-item-graph/commit/1e51050af4c1a92f1f127054fe4c9da5e8cb591e))
49
+ * typescript 6 update ([2483c31](https://github.com/iotaledger/twin-auditable-item-graph/commit/2483c3171cff4c5ecedc83d958ab551291a4a487))
50
+ * update background task service ([e483ddb](https://github.com/iotaledger/twin-auditable-item-graph/commit/e483ddbc948f035334f92b8342248caa6abbe441))
51
+ * update contexts ([#35](https://github.com/iotaledger/twin-auditable-item-graph/issues/35)) ([cdf0989](https://github.com/iotaledger/twin-auditable-item-graph/commit/cdf0989fe4677a88b757e97e752b7d4c29013a7e))
52
+ * update contexts and namespaces ([#33](https://github.com/iotaledger/twin-auditable-item-graph/issues/33)) ([5dadb99](https://github.com/iotaledger/twin-auditable-item-graph/commit/5dadb99773d410aceacaba7ed92c1ccb8b46516b))
53
+ * update dependencies ([482c97e](https://github.com/iotaledger/twin-auditable-item-graph/commit/482c97e16109e504cb495084ef51e860a7f86669))
54
+ * update dependencies ([6986689](https://github.com/iotaledger/twin-auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
55
+ * update edges to use targetId instead of id ([6c5d0e3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6c5d0e31b6e2ea74bfa2f3344e4be628e5f237af))
56
+ * update framework core ([88ad4e6](https://github.com/iotaledger/twin-auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
57
+ * update immutable proof usage ([#73](https://github.com/iotaledger/twin-auditable-item-graph/issues/73)) ([a5181d1](https://github.com/iotaledger/twin-auditable-item-graph/commit/a5181d172cbc492c7cc964d22724cc10c46fc52e))
58
+ * update naming ([39210c4](https://github.com/iotaledger/twin-auditable-item-graph/commit/39210c45baddd3cd48805140a1c0049f3004653f))
59
+ * update schemas ([b00bcac](https://github.com/iotaledger/twin-auditable-item-graph/commit/b00bcac6551fa524e8871e1b573a712ed0f30943))
60
+ * use new hosting url for cursor links ([809cdc6](https://github.com/iotaledger/twin-auditable-item-graph/commit/809cdc623491bad91000d0b0f740e40dc019198d))
61
+ * use new nameof operators ([3921c4c](https://github.com/iotaledger/twin-auditable-item-graph/commit/3921c4c9ac53e42459e45f10d9e702afb2797a23))
62
+ * use shared store mechanism ([#10](https://github.com/iotaledger/twin-auditable-item-graph/issues/10)) ([da035e5](https://github.com/iotaledger/twin-auditable-item-graph/commit/da035e5eb8f157482b4eb2bdbc689c6c0647ff7d))
63
+ * use standard list json ld types ([8f53836](https://github.com/iotaledger/twin-auditable-item-graph/commit/8f53836d4c83a98d64d7f5fe0531bb9af09464ae))
64
+ * uuidv7 ([#46](https://github.com/iotaledger/twin-auditable-item-graph/issues/46)) ([d0179f8](https://github.com/iotaledger/twin-auditable-item-graph/commit/d0179f81290e0beae2f1c398a028aca6dd754023))
65
+
66
+
67
+ ### Bug Fixes
68
+
69
+ * aig concurrent resource regression tests ([#77](https://github.com/iotaledger/twin-auditable-item-graph/issues/77)) ([82b8725](https://github.com/iotaledger/twin-auditable-item-graph/commit/82b872585686e070dde0a0c8493ded6e40a7a1d9))
70
+ * context usage ([9c8f64d](https://github.com/iotaledger/twin-auditable-item-graph/commit/9c8f64d342e9fb40d3514b87fd547a824ce50676))
71
+ * gate immutable proof on vertex organizationIdentity in AIG ([#81](https://github.com/iotaledger/twin-auditable-item-graph/issues/81)) ([0e67b6f](https://github.com/iotaledger/twin-auditable-item-graph/commit/0e67b6fb3511ca903667e11da3bdbcecdad7b21d))
72
+ * implement removeProof on AuditableItemGraphRestClient and expose DELETE /:id/proof route ([#85](https://github.com/iotaledger/twin-auditable-item-graph/issues/85)) ([ed74458](https://github.com/iotaledger/twin-auditable-item-graph/commit/ed74458aff9bc8606b75657a7bff15af4884189e))
73
+ * incremental edge merge and per-vertex update queue ([#70](https://github.com/iotaledger/twin-auditable-item-graph/issues/70)) ([91eb51d](https://github.com/iotaledger/twin-auditable-item-graph/commit/91eb51d135d2e609eebce90de099670f08eb20ca))
74
+ * only include alias in index if not deleted ([#6](https://github.com/iotaledger/twin-auditable-item-graph/issues/6)) ([5da3c41](https://github.com/iotaledger/twin-auditable-item-graph/commit/5da3c419fafa2afefd34b1c570d103012b888a75))
75
+ * query fixed ordering ([#124](https://github.com/iotaledger/twin-auditable-item-graph/issues/124)) ([f28d46d](https://github.com/iotaledger/twin-auditable-item-graph/commit/f28d46dae9bd2706c0cb1562b992757b1f5012ec))
76
+ * query params force coercion ([2dd9afe](https://github.com/iotaledger/twin-auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
77
+ * query resource type property name ([b684b31](https://github.com/iotaledger/twin-auditable-item-graph/commit/b684b3108e1e16852ee319e47edd0e40d5a2fe99))
78
+ * support new compactArrays flag ([2809b2b](https://github.com/iotaledger/twin-auditable-item-graph/commit/2809b2b83a946a850ad8f87f390fc00265a3fe7d))
79
+ * update tests with new deterministic background tasks ([#8](https://github.com/iotaledger/twin-auditable-item-graph/issues/8)) ([a96721c](https://github.com/iotaledger/twin-auditable-item-graph/commit/a96721c28128781f9cbd983d013dcf4c5542158c))
80
+ * use async getStore in tests ([0a911c0](https://github.com/iotaledger/twin-auditable-item-graph/commit/0a911c0c2c8a92e89d284e8651c0ef44736dc396))
81
+ * use async getStore in tests ([8d2969b](https://github.com/iotaledger/twin-auditable-item-graph/commit/8d2969b45fdeef849456cfbf898c580b23ce676c))
82
+
83
+
84
+ ### Dependencies
85
+
86
+ * The following workspace dependencies were updated
87
+ * dependencies
88
+ * @twin.org/auditable-item-graph-models bumped from 0.9.3-next.0 to 0.9.3-next.1
89
+
3
90
  ## [0.9.2](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-service-v0.9.2...auditable-item-graph-service-v0.9.2) (2026-08-24)
4
91
 
5
92
 
package/docs/examples.md CHANGED
@@ -116,6 +116,38 @@ console.log(queryResult.entries.itemListElement?.length ?? 0); // 3
116
116
  await service.removeVerifiable('aig:018f5a6cfd9444d58c7c2d4df1fd0a23');
117
117
  ```
118
118
 
119
+ Vertices which only need their current state can opt out of versioning with `auditMode`. Bypass is a
120
+ terminal mode; switching an audited vertex to bypass compacts its history and removes the associated
121
+ proofs, and a bypass vertex can never return to audited.
122
+
123
+ ```typescript
124
+ import { AuditableItemGraphAuditMode } from '@twin.org/auditable-item-graph-models';
125
+ import { AuditableItemGraphService } from '@twin.org/auditable-item-graph-service';
126
+
127
+ const service = new AuditableItemGraphService();
128
+
129
+ const lookupId = await service.create({
130
+ auditMode: AuditableItemGraphAuditMode.Bypass,
131
+ aliases: [{ id: 'currency-rates', aliasFormat: 'lookupRef' }]
132
+ });
133
+
134
+ // Overwrites the stored state in place, no changeset is written.
135
+ await service.updatePartial({
136
+ id: lookupId,
137
+ annotationObject: { '@context': 'https://schema.org', type: 'Thing', name: 'Rates 2026-03-10' }
138
+ });
139
+
140
+ const changesets = await service.getChangesets(lookupId);
141
+
142
+ console.log(changesets.changesets.itemListElement?.length ?? 0); // 0
143
+
144
+ // Archive an existing audited vertex by compacting it to its current state.
145
+ await service.updatePartial({
146
+ id: 'aig:018f5a6cfd9444d58c7c2d4df1fd0a23',
147
+ auditMode: AuditableItemGraphAuditMode.Bypass
148
+ });
149
+ ```
150
+
119
151
  ## AuditableItemGraphVertex
120
152
 
121
153
  ```typescript
@@ -1924,6 +1924,9 @@
1924
1924
  "type": "string",
1925
1925
  "description": "The identity of the organization which controls the vertex."
1926
1926
  },
1927
+ "auditMode": {
1928
+ "$ref": "https://schema.twindev.org/aig/AuditableItemGraphAuditMode"
1929
+ },
1927
1930
  "annotationObject": {
1928
1931
  "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
1929
1932
  },
@@ -1950,11 +1953,11 @@
1950
1953
  },
1951
1954
  "verified": {
1952
1955
  "type": "boolean",
1953
- "description": "Is the vertex verified, will only be populated when verification is requested."
1956
+ "description": "Is the vertex verified, will only be populated when verification is requested.\nAlways undefined when the vertex is in bypass mode."
1954
1957
  },
1955
1958
  "version": {
1956
1959
  "type": "number",
1957
- "description": "The version of the vertex, populated only when getting a specific version.\nMaps to https://schema.org/version."
1960
+ "description": "The version of the vertex, populated only when getting a specific version.\nAlways undefined when the vertex is in bypass mode.\nMaps to https://schema.org/version."
1958
1961
  }
1959
1962
  },
1960
1963
  "required": [
@@ -1998,16 +2001,19 @@
1998
2001
  "type": "string",
1999
2002
  "description": "The identity of the organization which controls the vertex."
2000
2003
  },
2004
+ "auditMode": {
2005
+ "$ref": "https://schema.twindev.org/aig/AuditableItemGraphAuditMode"
2006
+ },
2001
2007
  "annotationObject": {
2002
2008
  "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
2003
2009
  },
2004
2010
  "verified": {
2005
2011
  "type": "boolean",
2006
- "description": "Is the vertex verified, will only be populated when verification is requested."
2012
+ "description": "Is the vertex verified, will only be populated when verification is requested.\nAlways undefined when the vertex is in bypass mode."
2007
2013
  },
2008
2014
  "version": {
2009
2015
  "type": "number",
2010
- "description": "The version of the vertex, populated only when getting a specific version.\nMaps to https://schema.org/version."
2016
+ "description": "The version of the vertex, populated only when getting a specific version.\nAlways undefined when the vertex is in bypass mode.\nMaps to https://schema.org/version."
2011
2017
  },
2012
2018
  "type": {
2013
2019
  "const": "AuditableItemGraphVertex",
@@ -2067,6 +2073,9 @@
2067
2073
  "type": "string",
2068
2074
  "description": "The identity of the organization which controls the vertex."
2069
2075
  },
2076
+ "auditMode": {
2077
+ "$ref": "https://schema.twindev.org/aig/AuditableItemGraphAuditMode"
2078
+ },
2070
2079
  "annotationObject": {
2071
2080
  "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
2072
2081
  },
@@ -2093,11 +2102,11 @@
2093
2102
  },
2094
2103
  "verified": {
2095
2104
  "type": "boolean",
2096
- "description": "Is the vertex verified, will only be populated when verification is requested."
2105
+ "description": "Is the vertex verified, will only be populated when verification is requested.\nAlways undefined when the vertex is in bypass mode."
2097
2106
  },
2098
2107
  "version": {
2099
2108
  "type": "number",
2100
- "description": "The version of the vertex, populated only when getting a specific version.\nMaps to https://schema.org/version."
2109
+ "description": "The version of the vertex, populated only when getting a specific version.\nAlways undefined when the vertex is in bypass mode.\nMaps to https://schema.org/version."
2101
2110
  }
2102
2111
  },
2103
2112
  "required": [
@@ -163,6 +163,10 @@ The vertex to update.
163
163
 
164
164
  A promise that resolves when the vertex has been updated.
165
165
 
166
+ #### Throws
167
+
168
+ GeneralError If a bypass vertex is being switched back to audited.
169
+
166
170
  #### Implementation of
167
171
 
168
172
  `IAuditableItemGraphComponent.update`
@@ -190,6 +194,10 @@ The partial vertex update.
190
194
 
191
195
  A promise that resolves when the partial update has been applied.
192
196
 
197
+ #### Throws
198
+
199
+ GeneralError If a bypass vertex is being switched back to audited.
200
+
193
201
  #### Implementation of
194
202
 
195
203
  `IAuditableItemGraphComponent.updatePartial`
@@ -362,7 +370,7 @@ The vertex reconstructed at that version.
362
370
 
363
371
  #### Throws
364
372
 
365
- NotFoundError if the vertex or version is not found.
373
+ NotFoundError if the vertex or version is not found, a bypass vertex never has versions.
366
374
 
367
375
  #### Implementation of
368
376
 
@@ -404,7 +412,8 @@ Only return versions created before this ISO 8601 timestamp (exclusive).
404
412
 
405
413
  `Promise`\<`IAuditableItemGraphVertexVersionList`\>
406
414
 
407
- The list of vertex versions.
415
+ The list of vertex versions, a bypass vertex returns a single baseline entry for its
416
+ current state when that falls within the requested range.
408
417
 
409
418
  #### Throws
410
419
 
@@ -46,6 +46,14 @@ The date/time of when the vertex was last modified.
46
46
 
47
47
  ***
48
48
 
49
+ ### auditMode? {#auditmode}
50
+
51
+ > `optional` **auditMode?**: `AuditableItemGraphAuditMode`
52
+
53
+ How the mutations of the vertex are recorded, when absent the vertex behaves as audited.
54
+
55
+ ***
56
+
49
57
  ### aliasIndex? {#aliasindex}
50
58
 
51
59
  > `optional` **aliasIndex?**: `string`