@twin.org/auditable-item-graph-models 0.0.3-next.15 → 0.0.3-next.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"IAuditableItemGraphComponent.js","sourceRoot":"","sources":["../../../src/models/IAuditableItemGraphComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IComparator, SortDirection } from \"@twin.org/entity\";\nimport type { IAuditableItemGraphChangeset } from \"./IAuditableItemGraphChangeset.js\";\nimport type { IAuditableItemGraphChangesetList } from \"./IAuditableItemGraphChangesetList.js\";\nimport type { IAuditableItemGraphVertex } from \"./IAuditableItemGraphVertex.js\";\nimport type { IAuditableItemGraphVertexList } from \"./IAuditableItemGraphVertexList.js\";\nimport type { IAuditableItemGraphVertexVersionList } from \"./IAuditableItemGraphVertexVersionList.js\";\nimport type { VerifyDepth } from \"./verifyDepth.js\";\n\n/**\n * Interface describing an auditable item graph contract.\n */\nexport interface IAuditableItemGraphComponent extends IComponent {\n\t/**\n\t * Create a new graph vertex.\n\t * @param vertex The vertex to create.\n\t * @param vertex.annotationObject The annotation object for the vertex as JSON-LD.\n\t * @param vertex.aliases Alternative aliases that can be used to identify the vertex.\n\t * @param vertex.resources The resources attached to the vertex.\n\t * @param vertex.edges The edges connected to the vertex.\n\t * @returns The id of the new graph item.\n\t */\n\tcreate(vertex: Omit<IAuditableItemGraphVertex, \"id\">): Promise<string>;\n\n\t/**\n\t * Update a graph vertex.\n\t * @param vertex The vertex to update.\n\t * @param vertex.id The id of the vertex to update.\n\t * @param vertex.annotationObject The annotation object for the vertex as JSON-LD.\n\t * @param vertex.aliases Alternative aliases that can be used to identify the vertex.\n\t * @param vertex.resources The resources attached to the vertex.\n\t * @param vertex.edges The edges connected to the vertex.\n\t * @returns Nothing.\n\t */\n\tupdate(vertex: IAuditableItemGraphVertex): Promise<void>;\n\n\t/**\n\t * Get a graph vertex.\n\t * @param id The id of the vertex to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.includeDeleted Whether to include deleted aliases, resource, edges, defaults to false.\n\t * @param options.verifySignatureDepth How many signatures to verify, defaults to \"none\".\n\t * @returns The vertex if found.\n\t * @throws NotFoundError if the vertex is not found.\n\t */\n\tget(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tincludeDeleted?: boolean;\n\t\t\tverifySignatureDepth?: VerifyDepth;\n\t\t}\n\t): Promise<IAuditableItemGraphVertex>;\n\n\t/**\n\t * Get a graph vertex changeset list.\n\t * @param id The id of the vertex to get.\n\t * @param cursor The optional cursor to get next chunk.\n\t * @param limit Limit the number of entities to return.\n\t * @param options Additional options for the get operation.\n\t * @param options.verifySignatureDepth How many signatures to verify, defaults to \"none\".\n\t * @returns The changeset if found.\n\t * @throws NotFoundError if the vertex is not found.\n\t */\n\tgetChangesets(\n\t\tid: string,\n\t\tcursor?: string,\n\t\tlimit?: number,\n\t\toptions?: {\n\t\t\tverifySignatureDepth?: VerifyDepth;\n\t\t}\n\t): Promise<{\n\t\tchangesets: IAuditableItemGraphChangesetList;\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Get a graph vertex changeset.\n\t * @param id The id of the vertex to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.verifySignatureDepth How many signatures to verify, defaults to \"none\".\n\t * @returns The changeset if found.\n\t * @throws NotFoundError if the vertex or changeset is not found.\n\t */\n\tgetChangeset(\n\t\tid: string,\n\t\toptions?: { verifySignatureDepth?: VerifyDepth }\n\t): Promise<IAuditableItemGraphChangeset>;\n\n\t/**\n\t * Get a graph vertex at a specific version.\n\t * @param id The id of the vertex.\n\t * @param versionId The id of the version (changeset id) to retrieve.\n\t * @returns The vertex reconstructed at that version.\n\t * @throws NotFoundError if the vertex or version is not found.\n\t */\n\tgetVersion(id: string, versionId: string): Promise<IAuditableItemGraphVertex>;\n\n\t/**\n\t * Get all versions of a graph vertex.\n\t * @param id The id of the vertex.\n\t * @param options Additional options for the operation.\n\t * @param options.after Only return versions created after this ISO 8601 timestamp (exclusive).\n\t * @param options.before Only return versions created before this ISO 8601 timestamp (exclusive).\n\t * @returns The list of vertex versions.\n\t * @throws NotFoundError if the vertex is not found.\n\t */\n\tgetVersions(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tafter?: string;\n\t\t\tbefore?: string;\n\t\t}\n\t): Promise<IAuditableItemGraphVertexVersionList>;\n\n\t/**\n\t * Remove the verifiable storage for an item.\n\t * @param id The id of the vertex to remove the storage from.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the vertex is not found.\n\t */\n\tremoveVerifiable(id: string): Promise<void>;\n\n\t/**\n\t * Query the graph for vertices.\n\t * @param options The query options.\n\t * @param options.id The optional id to look for.\n\t * @param options.idMode Look in id, alias or both, defaults to both.\n\t * @param options.idExact Find only exact matches, default to false meaning partial matching.\n\t * @param options.resourceTypes Include vertices with specific resource types.\n\t * @param conditions Conditions to use in the query.\n\t * @param orderBy The order for the results, defaults to dateCreated.\n\t * @param orderByDirection The direction for the order, defaults to descending.\n\t * @param properties The properties to return, if not provided defaults to id, dateCreated, aliases and object.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns The entities, which can be partial if a limited keys list was provided.\n\t */\n\tquery(\n\t\toptions?: {\n\t\t\tid?: string;\n\t\t\tidMode?: \"id\" | \"alias\" | \"both\";\n\t\t\tidExact?: boolean;\n\t\t\tresourceTypes?: string[];\n\t\t},\n\t\tconditions?: IComparator[],\n\t\torderBy?: keyof Pick<IAuditableItemGraphVertex, \"dateCreated\" | \"dateModified\">,\n\t\torderByDirection?: SortDirection,\n\t\tproperties?: (keyof IAuditableItemGraphVertex)[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAuditableItemGraphVertexList;\n\t\tcursor?: string;\n\t}>;\n}\n"]}
1
+ {"version":3,"file":"IAuditableItemGraphComponent.js","sourceRoot":"","sources":["../../../src/models/IAuditableItemGraphComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IComparator, SortDirection } from \"@twin.org/entity\";\nimport type { IAuditableItemGraphChangeset } from \"./IAuditableItemGraphChangeset.js\";\nimport type { IAuditableItemGraphChangesetList } from \"./IAuditableItemGraphChangesetList.js\";\nimport type { IAuditableItemGraphVertex } from \"./IAuditableItemGraphVertex.js\";\nimport type { IAuditableItemGraphVertexList } from \"./IAuditableItemGraphVertexList.js\";\nimport type { IAuditableItemGraphVertexVersionList } from \"./IAuditableItemGraphVertexVersionList.js\";\nimport type { VerifyDepth } from \"./verifyDepth.js\";\n\n/**\n * Interface describing an auditable item graph contract.\n */\nexport interface IAuditableItemGraphComponent extends IComponent {\n\t/**\n\t * Create a new graph vertex.\n\t * @param vertex The vertex to create.\n\t * @param vertex.annotationObject The annotation object for the vertex as JSON-LD.\n\t * @param vertex.aliases Alternative aliases that can be used to identify the vertex.\n\t * @param vertex.resources The resources attached to the vertex.\n\t * @param vertex.edges The edges connected to the vertex.\n\t * @returns The id of the new graph item.\n\t */\n\tcreate(vertex: Omit<IAuditableItemGraphVertex, \"id\">): Promise<string>;\n\n\t/**\n\t * Update a graph vertex.\n\t * @param vertex The vertex to update.\n\t * @param vertex.id The id of the vertex to update.\n\t * @param vertex.annotationObject The annotation object for the vertex as JSON-LD.\n\t * @param vertex.aliases Alternative aliases that can be used to identify the vertex.\n\t * @param vertex.resources The resources attached to the vertex.\n\t * @param vertex.edges The edges connected to the vertex.\n\t * @returns Nothing.\n\t */\n\tupdate(vertex: IAuditableItemGraphVertex): Promise<void>;\n\n\t/**\n\t * Get a graph vertex.\n\t * @param id The id of the vertex to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.includeDeleted Whether to include deleted aliases, resource, edges, defaults to false.\n\t * @param options.verifySignatureDepth How many signatures to verify, defaults to \"none\".\n\t * @returns The vertex if found.\n\t * @throws NotFoundError if the vertex is not found.\n\t */\n\tget(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tincludeDeleted?: boolean;\n\t\t\tverifySignatureDepth?: VerifyDepth;\n\t\t}\n\t): Promise<IAuditableItemGraphVertex>;\n\n\t/**\n\t * Get a graph vertex changeset list.\n\t * @param id The id of the vertex to get.\n\t * @param cursor The optional cursor to get next chunk.\n\t * @param limit Limit the number of entities to return.\n\t * @param options Additional options for the get operation.\n\t * @param options.verifySignatureDepth How many signatures to verify, defaults to \"none\".\n\t * @returns The changeset if found.\n\t * @throws NotFoundError if the vertex is not found.\n\t */\n\tgetChangesets(\n\t\tid: string,\n\t\tcursor?: string,\n\t\tlimit?: number,\n\t\toptions?: {\n\t\t\tverifySignatureDepth?: VerifyDepth;\n\t\t}\n\t): Promise<{\n\t\tchangesets: IAuditableItemGraphChangesetList;\n\t\tcursor?: string;\n\t}>;\n\n\t/**\n\t * Get a graph vertex changeset.\n\t * @param id The id of the vertex to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.verifySignatureDepth How many signatures to verify, defaults to \"none\".\n\t * @returns The changeset if found.\n\t * @throws NotFoundError if the vertex or changeset is not found.\n\t */\n\tgetChangeset(\n\t\tid: string,\n\t\toptions?: { verifySignatureDepth?: VerifyDepth }\n\t): Promise<IAuditableItemGraphChangeset>;\n\n\t/**\n\t * Get a graph vertex at a specific version.\n\t * @param id The id of the vertex.\n\t * @param version The version number to retrieve.\n\t * @returns The vertex reconstructed at that version.\n\t * @throws NotFoundError if the vertex or version is not found.\n\t */\n\tgetVersion(id: string, version: number): Promise<IAuditableItemGraphVertex>;\n\n\t/**\n\t * Get all versions of a graph vertex.\n\t * @param id The id of the vertex.\n\t * @param options Additional options for the operation.\n\t * @param options.after Only return versions created after this ISO 8601 timestamp (exclusive).\n\t * @param options.before Only return versions created before this ISO 8601 timestamp (exclusive).\n\t * @returns The list of vertex versions.\n\t * @throws NotFoundError if the vertex is not found.\n\t */\n\tgetVersions(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tafter?: string;\n\t\t\tbefore?: string;\n\t\t}\n\t): Promise<IAuditableItemGraphVertexVersionList>;\n\n\t/**\n\t * Remove the verifiable storage for an item.\n\t * @param id The id of the vertex to remove the storage from.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the vertex is not found.\n\t */\n\tremoveVerifiable(id: string): Promise<void>;\n\n\t/**\n\t * Query the graph for vertices.\n\t * @param options The query options.\n\t * @param options.id The optional id to look for.\n\t * @param options.idMode Look in id, alias or both, defaults to both.\n\t * @param options.idExact Find only exact matches, default to false meaning partial matching.\n\t * @param options.resourceTypes Include vertices with specific resource types.\n\t * @param conditions Conditions to use in the query.\n\t * @param orderBy The order for the results, defaults to dateCreated.\n\t * @param orderByDirection The direction for the order, defaults to descending.\n\t * @param properties The properties to return, if not provided defaults to id, dateCreated, aliases and object.\n\t * @param cursor The cursor to request the next chunk of entities.\n\t * @param limit Limit the number of entities to return.\n\t * @returns The entities, which can be partial if a limited keys list was provided.\n\t */\n\tquery(\n\t\toptions?: {\n\t\t\tid?: string;\n\t\t\tidMode?: \"id\" | \"alias\" | \"both\";\n\t\t\tidExact?: boolean;\n\t\t\tresourceTypes?: string[];\n\t\t},\n\t\tconditions?: IComparator[],\n\t\torderBy?: keyof Pick<IAuditableItemGraphVertex, \"dateCreated\" | \"dateModified\">,\n\t\torderByDirection?: SortDirection,\n\t\tproperties?: (keyof IAuditableItemGraphVertex)[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAuditableItemGraphVertexList;\n\t\tcursor?: string;\n\t}>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IAuditableItemGraphVertexVersionList.js","sourceRoot":"","sources":["../../../src/models/IAuditableItemGraphVertexVersionList.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { SchemaOrgContexts, SchemaOrgTypes } from \"@twin.org/standards-schema-org\";\nimport type { AuditableItemGraphContexts } from \"./auditableItemGraphContexts.js\";\nimport type { AuditableItemGraphTypes } from \"./auditableItemGraphTypes.js\";\n\n/**\n * Interface describing a list of auditable item graph vertex version numbers.\n */\nexport interface IAuditableItemGraphVertexVersionList {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof SchemaOrgContexts.Context,\n\t\ttypeof AuditableItemGraphContexts.Context,\n\t\t...IJsonLdContextDefinitionElement[]\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: [typeof SchemaOrgTypes.ItemList, typeof AuditableItemGraphTypes.VertexVersionList];\n\n\t/**\n\t * The list of version numbers.\n\t * @json-ld namespace:sch\n\t */\n\t[SchemaOrgTypes.ItemListElement]: number[];\n}\n"]}
1
+ {"version":3,"file":"IAuditableItemGraphVertexVersionList.js","sourceRoot":"","sources":["../../../src/models/IAuditableItemGraphVertexVersionList.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { SchemaOrgContexts, SchemaOrgTypes } from \"@twin.org/standards-schema-org\";\nimport type { AuditableItemGraphContexts } from \"./auditableItemGraphContexts.js\";\nimport type { AuditableItemGraphTypes } from \"./auditableItemGraphTypes.js\";\n\n/**\n * Interface describing a list of auditable item graph vertex version numbers.\n */\nexport interface IAuditableItemGraphVertexVersionList {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof SchemaOrgContexts.Context,\n\t\ttypeof AuditableItemGraphContexts.Context,\n\t\t...IJsonLdContextDefinitionElement[]\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: [typeof SchemaOrgTypes.ItemList, typeof AuditableItemGraphTypes.VertexVersionList];\n\n\t/**\n\t * The list of versions.\n\t * @json-ld namespace:sch\n\t */\n\t[SchemaOrgTypes.ItemListElement]: { version: number; dateCreated: string }[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IAuditableItemGraphVersionGetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAuditableItemGraphVersionGetRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Get an auditable item graph vertex at a specific version.\n */\nexport interface IAuditableItemGraphVersionGetRequest {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The parameters from the path.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the vertex.\n\t\t */\n\t\tid: string;\n\n\t\t/**\n\t\t * The id of the version (changeset id) to get.\n\t\t */\n\t\tversionId: string;\n\t};\n}\n"]}
1
+ {"version":3,"file":"IAuditableItemGraphVersionGetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IAuditableItemGraphVersionGetRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Get an auditable item graph vertex at a specific version.\n */\nexport interface IAuditableItemGraphVersionGetRequest {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The parameters from the path.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the vertex.\n\t\t */\n\t\tid: string;\n\n\t\t/**\n\t\t * The version number to get.\n\t\t */\n\t\tversion: string;\n\t};\n}\n"]}
@@ -74,11 +74,11 @@ export interface IAuditableItemGraphComponent extends IComponent {
74
74
  /**
75
75
  * Get a graph vertex at a specific version.
76
76
  * @param id The id of the vertex.
77
- * @param versionId The id of the version (changeset id) to retrieve.
77
+ * @param version The version number to retrieve.
78
78
  * @returns The vertex reconstructed at that version.
79
79
  * @throws NotFoundError if the vertex or version is not found.
80
80
  */
81
- getVersion(id: string, versionId: string): Promise<IAuditableItemGraphVertex>;
81
+ getVersion(id: string, version: number): Promise<IAuditableItemGraphVertex>;
82
82
  /**
83
83
  * Get all versions of a graph vertex.
84
84
  * @param id The id of the vertex.
@@ -19,8 +19,11 @@ export interface IAuditableItemGraphVertexVersionList {
19
19
  */
20
20
  type: [typeof SchemaOrgTypes.ItemList, typeof AuditableItemGraphTypes.VertexVersionList];
21
21
  /**
22
- * The list of version numbers.
22
+ * The list of versions.
23
23
  * @json-ld namespace:sch
24
24
  */
25
- [SchemaOrgTypes.ItemListElement]: number[];
25
+ [SchemaOrgTypes.ItemListElement]: {
26
+ version: number;
27
+ dateCreated: string;
28
+ }[];
26
29
  }
@@ -18,8 +18,8 @@ export interface IAuditableItemGraphVersionGetRequest {
18
18
  */
19
19
  id: string;
20
20
  /**
21
- * The id of the version (changeset id) to get.
21
+ * The version number to get.
22
22
  */
23
- versionId: string;
23
+ version: string;
24
24
  };
25
25
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.3-next.16](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-models-v0.0.3-next.15...auditable-item-graph-models-v0.0.3-next.16) (2026-05-22)
4
+
5
+
6
+ ### Features
7
+
8
+ * improved versioning ([#66](https://github.com/iotaledger/twin-auditable-item-graph/issues/66)) ([1b497cd](https://github.com/iotaledger/twin-auditable-item-graph/commit/1b497cdc88eec9b6707b097283773e109baae3aa))
9
+
3
10
  ## [0.0.3-next.15](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-models-v0.0.3-next.14...auditable-item-graph-models-v0.0.3-next.15) (2026-05-20)
4
11
 
5
12
 
@@ -180,7 +180,7 @@ NotFoundError if the vertex or changeset is not found.
180
180
 
181
181
  ### getVersion() {#getversion}
182
182
 
183
- > **getVersion**(`id`, `versionId`): `Promise`\<[`IAuditableItemGraphVertex`](IAuditableItemGraphVertex.md)\>
183
+ > **getVersion**(`id`, `version`): `Promise`\<[`IAuditableItemGraphVertex`](IAuditableItemGraphVertex.md)\>
184
184
 
185
185
  Get a graph vertex at a specific version.
186
186
 
@@ -192,11 +192,11 @@ Get a graph vertex at a specific version.
192
192
 
193
193
  The id of the vertex.
194
194
 
195
- ##### versionId
195
+ ##### version
196
196
 
197
- `string`
197
+ `number`
198
198
 
199
- The id of the version (changeset id) to retrieve.
199
+ The version number to retrieve.
200
200
 
201
201
  #### Returns
202
202
 
@@ -28,8 +28,8 @@ The parameters from the path.
28
28
 
29
29
  The id of the vertex.
30
30
 
31
- #### versionId
31
+ #### version
32
32
 
33
- > **versionId**: `string`
33
+ > **version**: `string`
34
34
 
35
- The id of the version (changeset id) to get.
35
+ The version number to get.
@@ -22,6 +22,14 @@ JSON-LD Type.
22
22
 
23
23
  ### itemListElement {#itemlistelement}
24
24
 
25
- > **itemListElement**: `number`[]
25
+ > **itemListElement**: `object`[]
26
26
 
27
- The list of version numbers.
27
+ The list of versions.
28
+
29
+ #### version
30
+
31
+ > **version**: `number`
32
+
33
+ #### dateCreated
34
+
35
+ > **dateCreated**: `string`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/auditable-item-graph-models",
3
- "version": "0.0.3-next.15",
3
+ "version": "0.0.3-next.16",
4
4
  "description": "Defines shared graph data contracts, JSON schemas, and JSON-LD contexts for consistent interoperability.",
5
5
  "repository": {
6
6
  "type": "git",