@twin.org/auditable-item-graph-rest-client 0.0.3-next.12 → 0.0.3-next.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/auditableItemGraphRestClient.js +49 -0
- package/dist/es/auditableItemGraphRestClient.js.map +1 -1
- package/dist/types/auditableItemGraphRestClient.d.ts +22 -1
- package/docs/changelog.md +110 -82
- package/docs/reference/classes/AuditableItemGraphRestClient.md +82 -0
- package/package.json +4 -4
|
@@ -126,6 +126,55 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
126
126
|
});
|
|
127
127
|
return response.body;
|
|
128
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Get a graph vertex at a specific version.
|
|
131
|
+
* @param id The id of the vertex.
|
|
132
|
+
* @param versionId The id of the version (changeset id) to retrieve.
|
|
133
|
+
* @returns The vertex reconstructed at that version.
|
|
134
|
+
* @throws NotFoundError if the vertex or version is not found.
|
|
135
|
+
*/
|
|
136
|
+
async getVersion(id, versionId) {
|
|
137
|
+
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "id", id);
|
|
138
|
+
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "versionId", versionId);
|
|
139
|
+
const urnParsed = Urn.fromValidString(id);
|
|
140
|
+
const vertexId = urnParsed.namespaceSpecific(0);
|
|
141
|
+
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "vertexId", vertexId);
|
|
142
|
+
const response = await this.fetch("/:id/versions/:versionId", "GET", {
|
|
143
|
+
headers: {
|
|
144
|
+
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
145
|
+
},
|
|
146
|
+
pathParams: {
|
|
147
|
+
id: vertexId,
|
|
148
|
+
versionId
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return response.body;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get all versions of a graph vertex.
|
|
155
|
+
* @param id The id of the vertex.
|
|
156
|
+
* @param options Additional options for the operation.
|
|
157
|
+
* @param options.after Only return versions created after this ISO 8601 timestamp (exclusive).
|
|
158
|
+
* @param options.before Only return versions created before this ISO 8601 timestamp (exclusive).
|
|
159
|
+
* @returns The list of vertex versions.
|
|
160
|
+
* @throws NotFoundError if the vertex is not found.
|
|
161
|
+
*/
|
|
162
|
+
async getVersions(id, options) {
|
|
163
|
+
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "id", id);
|
|
164
|
+
const response = await this.fetch("/:id/versions", "GET", {
|
|
165
|
+
headers: {
|
|
166
|
+
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
167
|
+
},
|
|
168
|
+
pathParams: {
|
|
169
|
+
id
|
|
170
|
+
},
|
|
171
|
+
query: {
|
|
172
|
+
after: options?.after,
|
|
173
|
+
before: options?.before
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
return response.body;
|
|
177
|
+
}
|
|
129
178
|
/**
|
|
130
179
|
* Update a graph vertex.
|
|
131
180
|
* @param vertex The vertex to update.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auditableItemGraphRestClient.js","sourceRoot":"","sources":["../../src/auditableItemGraphRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACN,mBAAmB,EAInB,MAAM,sBAAsB,CAAC;AAmB9B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAErE;;GAEG;AACH,MAAM,OAAO,4BACZ,SAAQ,cAAc;IAGtB;;OAEG;IACI,MAAM,CAAU,UAAU,kCAAkD;IAEnF;;;OAGG;IACH,YAAY,MAA6B;QACxC,KAAK,iCAAyC,MAAM,EAAE,sBAA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ACxE,UAAU,EAAE,mBAAmB,CAAC,cAAc,CAAC,UAAU,CAAC;gBAC1D,OAAO;gBACP,gBAAgB;gBAChB,UAAU,EAAE,mBAAmB,CAAC,aAAa,CAAC,UAAU,CAAC;gBACzD,MAAM;gBACN,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;aAC3B;SACD,CAAC,CAAC;QAEH,OAAO;YACN,OAAO,EAAE,QAAQ,CAAC,IAAI;YACtB,MAAM,EAAE,YAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAC3F,EAAE,cAAc,EAAE,MAAM;SACzB,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport {\n\tHttpParameterHelper,\n\ttype IBaseRestClientConfig,\n\ttype ICreatedResponse,\n\ttype INoContentResponse\n} from \"@twin.org/api-models\";\nimport type {\n\tIAuditableItemGraphChangeset,\n\tIAuditableItemGraphChangesetGetRequest,\n\tIAuditableItemGraphChangesetGetResponse,\n\tIAuditableItemGraphChangesetList,\n\tIAuditableItemGraphChangesetListRequest,\n\tIAuditableItemGraphChangesetListResponse,\n\tIAuditableItemGraphComponent,\n\tIAuditableItemGraphCreateRequest,\n\tIAuditableItemGraphGetRequest,\n\tIAuditableItemGraphGetResponse,\n\tIAuditableItemGraphListRequest,\n\tIAuditableItemGraphListResponse,\n\tIAuditableItemGraphUpdateRequest,\n\tIAuditableItemGraphVertex,\n\tIAuditableItemGraphVertexList,\n\tVerifyDepth\n} from \"@twin.org/auditable-item-graph-models\";\nimport { Coerce, Guards, NotSupportedError, Urn } from \"@twin.org/core\";\nimport type { IComparator, SortDirection } from \"@twin.org/entity\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { HeaderHelper, HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Client for performing auditable item graph through to REST endpoints.\n */\nexport class AuditableItemGraphRestClient\n\textends BaseRestClient\n\timplements IAuditableItemGraphComponent\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<AuditableItemGraphRestClient>();\n\n\t/**\n\t * Create a new instance of AuditableItemGraphRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(nameof<AuditableItemGraphRestClient>(), config, \"auditable-item-graph\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn AuditableItemGraphRestClient.CLASS_NAME;\n\t}\n\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\tpublic async create(vertex: Omit<IAuditableItemGraphVertex, \"id\">): Promise<string> {\n\t\tconst response = await this.fetch<IAuditableItemGraphCreateRequest, ICreatedResponse>(\n\t\t\t\"/\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\tbody: vertex\n\t\t\t}\n\t\t);\n\n\t\treturn response.headers[HeaderTypes.Location];\n\t}\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/updated 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\tpublic async get(\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\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemGraphGetRequest,\n\t\t\tIAuditableItemGraphGetResponse\n\t\t>(\"/:id\", \"GET\", {\n\t\t\theaders: {\n\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t},\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tincludeDeleted: Coerce.string(options?.includeDeleted),\n\t\t\t\tverifySignatureDepth: options?.verifySignatureDepth\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\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 changesets if found.\n\t */\n\tpublic async getChangesets(\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\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemGraphChangesetListRequest,\n\t\t\tIAuditableItemGraphChangesetListResponse\n\t\t>(\"/:id/changesets\", \"GET\", {\n\t\t\theaders: {\n\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t},\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit),\n\t\t\t\tverifySignatureDepth: options?.verifySignatureDepth\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tchangesets: response.body,\n\t\t\tcursor: HeaderHelper.extractLinkHeaderRelation(response.headers?.[HeaderTypes.Link], \"next\")\n\t\t\t\t?.urlQueryParams?.cursor\n\t\t};\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\tpublic async getChangeset(\n\t\tid: string,\n\t\toptions?: { verifySignatureDepth?: VerifyDepth }\n\t): Promise<IAuditableItemGraphChangeset> {\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst urnParsed = Urn.fromValidString(id);\n\t\tconst namespaceSpecificParts = urnParsed.namespaceSpecificParts();\n\t\tconst vertexId = namespaceSpecificParts[0];\n\t\tconst changesetId = namespaceSpecificParts[2];\n\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, \"vertexId\", vertexId);\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, \"changesetId\", changesetId);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemGraphChangesetGetRequest,\n\t\t\tIAuditableItemGraphChangesetGetResponse\n\t\t>(\"/:id/changesets/:changesetId\", \"GET\", {\n\t\t\theaders: {\n\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t},\n\t\t\tpathParams: {\n\t\t\t\tid: vertexId,\n\t\t\t\tchangesetId\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tverifySignatureDepth: options?.verifySignatureDepth\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\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\tpublic async update(vertex: IAuditableItemGraphVertex): Promise<void> {\n\t\tGuards.object(AuditableItemGraphRestClient.CLASS_NAME, nameof(vertex), vertex);\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(vertex.id), vertex.id);\n\n\t\tconst { id, ...rest } = vertex;\n\n\t\tawait this.fetch<IAuditableItemGraphUpdateRequest, INoContentResponse>(\"/:id\", \"PUT\", {\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t},\n\t\t\tbody: rest\n\t\t});\n\t}\n\n\t/**\n\t * Remove the verifiable storage for an item, not supported on client.\n\t * @param id The id of the vertex to get.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the vertex is not found.\n\t */\n\tpublic async removeVerifiable(id: string): Promise<void> {\n\t\tthrow new NotSupportedError(AuditableItemGraphRestClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"removeVerifiable\"\n\t\t});\n\t}\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 created.\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, created, 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\tpublic async query(\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\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemGraphListRequest,\n\t\t\tIAuditableItemGraphListResponse\n\t\t>(\"/\", \"GET\", {\n\t\t\theaders: {\n\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tid: options?.id,\n\t\t\t\tidMode: options?.idMode,\n\t\t\t\tidExact: Coerce.string(options?.idExact),\n\t\t\t\tresourceTypes: HttpParameterHelper.arrayToString(options?.resourceTypes),\n\t\t\t\tconditions: HttpParameterHelper.objectToString(conditions),\n\t\t\t\torderBy,\n\t\t\t\torderByDirection,\n\t\t\t\tproperties: HttpParameterHelper.arrayToString(properties),\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tentries: response.body,\n\t\t\tcursor: HeaderHelper.extractLinkHeaderRelation(response.headers?.[HeaderTypes.Link], \"next\")\n\t\t\t\t?.urlQueryParams?.cursor\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"auditableItemGraphRestClient.js","sourceRoot":"","sources":["../../src/auditableItemGraphRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACN,mBAAmB,EAInB,MAAM,sBAAsB,CAAC;AAwB9B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAErE;;GAEG;AACH,MAAM,OAAO,4BACZ,SAAQ,cAAc;IA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MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;gBACxC,aAAa,EAAE,mBAAmB,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC;gBACxE,UAAU,EAAE,mBAAmB,CAAC,cAAc,CAAC,UAAU,CAAC;gBAC1D,OAAO;gBACP,gBAAgB;gBAChB,UAAU,EAAE,mBAAmB,CAAC,aAAa,CAAC,UAAU,CAAC;gBACzD,MAAM;gBACN,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;aAC3B;SACD,CAAC,CAAC;QAEH,OAAO;YACN,OAAO,EAAE,QAAQ,CAAC,IAAI;YACtB,MAAM,EAAE,YAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAC3F,EAAE,cAAc,EAAE,MAAM;SACzB,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport {\n\tHttpParameterHelper,\n\ttype IBaseRestClientConfig,\n\ttype ICreatedResponse,\n\ttype INoContentResponse\n} from \"@twin.org/api-models\";\nimport type {\n\tIAuditableItemGraphChangeset,\n\tIAuditableItemGraphChangesetGetRequest,\n\tIAuditableItemGraphChangesetGetResponse,\n\tIAuditableItemGraphChangesetList,\n\tIAuditableItemGraphChangesetListRequest,\n\tIAuditableItemGraphChangesetListResponse,\n\tIAuditableItemGraphComponent,\n\tIAuditableItemGraphCreateRequest,\n\tIAuditableItemGraphGetRequest,\n\tIAuditableItemGraphGetResponse,\n\tIAuditableItemGraphListRequest,\n\tIAuditableItemGraphListResponse,\n\tIAuditableItemGraphUpdateRequest,\n\tIAuditableItemGraphVertex,\n\tIAuditableItemGraphVertexList,\n\tIAuditableItemGraphVertexVersionList,\n\tIAuditableItemGraphVersionGetRequest,\n\tIAuditableItemGraphVersionGetResponse,\n\tIAuditableItemGraphVersionListRequest,\n\tIAuditableItemGraphVersionListResponse,\n\tVerifyDepth\n} from \"@twin.org/auditable-item-graph-models\";\nimport { Coerce, Guards, NotSupportedError, Urn } from \"@twin.org/core\";\nimport type { IComparator, SortDirection } from \"@twin.org/entity\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { HeaderHelper, HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Client for performing auditable item graph through to REST endpoints.\n */\nexport class AuditableItemGraphRestClient\n\textends BaseRestClient\n\timplements IAuditableItemGraphComponent\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<AuditableItemGraphRestClient>();\n\n\t/**\n\t * Create a new instance of AuditableItemGraphRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(nameof<AuditableItemGraphRestClient>(), config, \"auditable-item-graph\");\n\t}\n\n\t/**\n\t * Returns the class name of the component.\n\t * @returns The class name of the component.\n\t */\n\tpublic className(): string {\n\t\treturn AuditableItemGraphRestClient.CLASS_NAME;\n\t}\n\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\tpublic async create(vertex: Omit<IAuditableItemGraphVertex, \"id\">): Promise<string> {\n\t\tconst response = await this.fetch<IAuditableItemGraphCreateRequest, ICreatedResponse>(\n\t\t\t\"/\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\tbody: vertex\n\t\t\t}\n\t\t);\n\n\t\treturn response.headers[HeaderTypes.Location];\n\t}\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/updated 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\tpublic async get(\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\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemGraphGetRequest,\n\t\t\tIAuditableItemGraphGetResponse\n\t\t>(\"/:id\", \"GET\", {\n\t\t\theaders: {\n\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t},\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tincludeDeleted: Coerce.string(options?.includeDeleted),\n\t\t\t\tverifySignatureDepth: options?.verifySignatureDepth\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\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 changesets if found.\n\t */\n\tpublic async getChangesets(\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\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemGraphChangesetListRequest,\n\t\t\tIAuditableItemGraphChangesetListResponse\n\t\t>(\"/:id/changesets\", \"GET\", {\n\t\t\theaders: {\n\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t},\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit),\n\t\t\t\tverifySignatureDepth: options?.verifySignatureDepth\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tchangesets: response.body,\n\t\t\tcursor: HeaderHelper.extractLinkHeaderRelation(response.headers?.[HeaderTypes.Link], \"next\")\n\t\t\t\t?.urlQueryParams?.cursor\n\t\t};\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\tpublic async getChangeset(\n\t\tid: string,\n\t\toptions?: { verifySignatureDepth?: VerifyDepth }\n\t): Promise<IAuditableItemGraphChangeset> {\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst urnParsed = Urn.fromValidString(id);\n\t\tconst namespaceSpecificParts = urnParsed.namespaceSpecificParts();\n\t\tconst vertexId = namespaceSpecificParts[0];\n\t\tconst changesetId = namespaceSpecificParts[2];\n\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, \"vertexId\", vertexId);\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, \"changesetId\", changesetId);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemGraphChangesetGetRequest,\n\t\t\tIAuditableItemGraphChangesetGetResponse\n\t\t>(\"/:id/changesets/:changesetId\", \"GET\", {\n\t\t\theaders: {\n\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t},\n\t\t\tpathParams: {\n\t\t\t\tid: vertexId,\n\t\t\t\tchangesetId\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tverifySignatureDepth: options?.verifySignatureDepth\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\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\tpublic async getVersion(id: string, versionId: string): Promise<IAuditableItemGraphVertex> {\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(versionId), versionId);\n\n\t\tconst urnParsed = Urn.fromValidString(id);\n\t\tconst vertexId = urnParsed.namespaceSpecific(0);\n\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, \"vertexId\", vertexId);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemGraphVersionGetRequest,\n\t\t\tIAuditableItemGraphVersionGetResponse\n\t\t>(\"/:id/versions/:versionId\", \"GET\", {\n\t\t\theaders: {\n\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t},\n\t\t\tpathParams: {\n\t\t\t\tid: vertexId,\n\t\t\t\tversionId\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\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\tpublic async getVersions(\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\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemGraphVersionListRequest,\n\t\t\tIAuditableItemGraphVersionListResponse\n\t\t>(\"/:id/versions\", \"GET\", {\n\t\t\theaders: {\n\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t},\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tafter: options?.after,\n\t\t\t\tbefore: options?.before\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\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\tpublic async update(vertex: IAuditableItemGraphVertex): Promise<void> {\n\t\tGuards.object(AuditableItemGraphRestClient.CLASS_NAME, nameof(vertex), vertex);\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(vertex.id), vertex.id);\n\n\t\tconst { id, ...rest } = vertex;\n\n\t\tawait this.fetch<IAuditableItemGraphUpdateRequest, INoContentResponse>(\"/:id\", \"PUT\", {\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t},\n\t\t\tbody: rest\n\t\t});\n\t}\n\n\t/**\n\t * Remove the verifiable storage for an item, not supported on client.\n\t * @param id The id of the vertex to get.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the vertex is not found.\n\t */\n\tpublic async removeVerifiable(id: string): Promise<void> {\n\t\tthrow new NotSupportedError(AuditableItemGraphRestClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"removeVerifiable\"\n\t\t});\n\t}\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 created.\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, created, 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\tpublic async query(\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\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemGraphListRequest,\n\t\t\tIAuditableItemGraphListResponse\n\t\t>(\"/\", \"GET\", {\n\t\t\theaders: {\n\t\t\t\t[HeaderTypes.Accept]: MimeTypes.JsonLd\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tid: options?.id,\n\t\t\t\tidMode: options?.idMode,\n\t\t\t\tidExact: Coerce.string(options?.idExact),\n\t\t\t\tresourceTypes: HttpParameterHelper.arrayToString(options?.resourceTypes),\n\t\t\t\tconditions: HttpParameterHelper.objectToString(conditions),\n\t\t\t\torderBy,\n\t\t\t\torderByDirection,\n\t\t\t\tproperties: HttpParameterHelper.arrayToString(properties),\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tentries: response.body,\n\t\t\tcursor: HeaderHelper.extractLinkHeaderRelation(response.headers?.[HeaderTypes.Link], \"next\")\n\t\t\t\t?.urlQueryParams?.cursor\n\t\t};\n\t}\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseRestClient } from "@twin.org/api-core";
|
|
2
2
|
import { type IBaseRestClientConfig } from "@twin.org/api-models";
|
|
3
|
-
import type { IAuditableItemGraphChangeset, IAuditableItemGraphChangesetList, IAuditableItemGraphComponent, IAuditableItemGraphVertex, IAuditableItemGraphVertexList, VerifyDepth } from "@twin.org/auditable-item-graph-models";
|
|
3
|
+
import type { IAuditableItemGraphChangeset, IAuditableItemGraphChangesetList, IAuditableItemGraphComponent, IAuditableItemGraphVertex, IAuditableItemGraphVertexList, IAuditableItemGraphVertexVersionList, VerifyDepth } from "@twin.org/auditable-item-graph-models";
|
|
4
4
|
import type { IComparator, SortDirection } from "@twin.org/entity";
|
|
5
5
|
/**
|
|
6
6
|
* Client for performing auditable item graph through to REST endpoints.
|
|
@@ -69,6 +69,27 @@ export declare class AuditableItemGraphRestClient extends BaseRestClient impleme
|
|
|
69
69
|
getChangeset(id: string, options?: {
|
|
70
70
|
verifySignatureDepth?: VerifyDepth;
|
|
71
71
|
}): Promise<IAuditableItemGraphChangeset>;
|
|
72
|
+
/**
|
|
73
|
+
* Get a graph vertex at a specific version.
|
|
74
|
+
* @param id The id of the vertex.
|
|
75
|
+
* @param versionId The id of the version (changeset id) to retrieve.
|
|
76
|
+
* @returns The vertex reconstructed at that version.
|
|
77
|
+
* @throws NotFoundError if the vertex or version is not found.
|
|
78
|
+
*/
|
|
79
|
+
getVersion(id: string, versionId: string): Promise<IAuditableItemGraphVertex>;
|
|
80
|
+
/**
|
|
81
|
+
* Get all versions of a graph vertex.
|
|
82
|
+
* @param id The id of the vertex.
|
|
83
|
+
* @param options Additional options for the operation.
|
|
84
|
+
* @param options.after Only return versions created after this ISO 8601 timestamp (exclusive).
|
|
85
|
+
* @param options.before Only return versions created before this ISO 8601 timestamp (exclusive).
|
|
86
|
+
* @returns The list of vertex versions.
|
|
87
|
+
* @throws NotFoundError if the vertex is not found.
|
|
88
|
+
*/
|
|
89
|
+
getVersions(id: string, options?: {
|
|
90
|
+
after?: string;
|
|
91
|
+
before?: string;
|
|
92
|
+
}): Promise<IAuditableItemGraphVertexVersionList>;
|
|
72
93
|
/**
|
|
73
94
|
* Update a graph vertex.
|
|
74
95
|
* @param vertex The vertex to update.
|
package/docs/changelog.md
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.0.3-next.
|
|
3
|
+
## [0.0.3-next.14](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.13...auditable-item-graph-rest-client-v0.0.3-next.14) (2026-05-18)
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
### Features
|
|
7
7
|
|
|
8
|
-
* add
|
|
8
|
+
* add versions ([#60](https://github.com/iotaledger/twin-auditable-item-graph/issues/60)) ([5c36f94](https://github.com/iotaledger/twin-auditable-item-graph/commit/5c36f94b1155c01dddbc8d62f3f65d599916c521))
|
|
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.3-next.13 to 0.0.3-next.14
|
|
16
|
+
|
|
17
|
+
## [0.0.3-next.13](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.12...auditable-item-graph-rest-client-v0.0.3-next.13) (2026-05-12)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* typescript 6 update ([2483c31](https://github.com/iotaledger/twin-auditable-item-graph/commit/2483c3171cff4c5ecedc83d958ab551291a4a487))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.12 to 0.0.3-next.13
|
|
30
|
+
|
|
31
|
+
## [0.0.3-next.12](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.11...auditable-item-graph-rest-client-v0.0.3-next.12) (2026-03-24)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* 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))
|
|
9
37
|
|
|
10
38
|
|
|
11
39
|
### Dependencies
|
|
@@ -14,7 +42,7 @@
|
|
|
14
42
|
* dependencies
|
|
15
43
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.11 to 0.0.3-next.12
|
|
16
44
|
|
|
17
|
-
## [0.0.3-next.11](https://github.com/
|
|
45
|
+
## [0.0.3-next.11](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.10...auditable-item-graph-rest-client-v0.0.3-next.11) (2026-02-25)
|
|
18
46
|
|
|
19
47
|
|
|
20
48
|
### Miscellaneous Chores
|
|
@@ -28,31 +56,31 @@
|
|
|
28
56
|
* dependencies
|
|
29
57
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.10 to 0.0.3-next.11
|
|
30
58
|
|
|
31
|
-
## [0.0.3-next.10](https://github.com/
|
|
59
|
+
## [0.0.3-next.10](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.9...auditable-item-graph-rest-client-v0.0.3-next.10) (2026-02-24)
|
|
32
60
|
|
|
33
61
|
|
|
34
62
|
### Features
|
|
35
63
|
|
|
36
|
-
* add context id features ([#30](https://github.com/
|
|
37
|
-
* add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/
|
|
38
|
-
* add validate-locales ([e76e6f6](https://github.com/
|
|
39
|
-
* changeset endpoints ([#44](https://github.com/
|
|
40
|
-
* eslint migration to flat config ([1b42a3a](https://github.com/
|
|
41
|
-
* id optional in edge updates ([6b63fe3](https://github.com/
|
|
42
|
-
* replace nextItem property with Link header ([#39](https://github.com/
|
|
43
|
-
* rest client expose remove verifiable ([a22a743](https://github.com/
|
|
44
|
-
* update background task service ([e483ddb](https://github.com/
|
|
45
|
-
* update dependencies ([6986689](https://github.com/
|
|
46
|
-
* update edges to use targetId instead of id ([6c5d0e3](https://github.com/
|
|
47
|
-
* update framework core ([88ad4e6](https://github.com/
|
|
48
|
-
* use new nameof operators ([3921c4c](https://github.com/
|
|
49
|
-
* use shared store mechanism ([#10](https://github.com/
|
|
64
|
+
* 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))
|
|
65
|
+
* add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/iotaledger/twin-auditable-item-graph/commit/33dbd19cabd9fbfaba81032f1d1a6527584c3f5a))
|
|
66
|
+
* add validate-locales ([e76e6f6](https://github.com/iotaledger/twin-auditable-item-graph/commit/e76e6f6b3ec9c447a04315d353442e32233601d3))
|
|
67
|
+
* changeset endpoints ([#44](https://github.com/iotaledger/twin-auditable-item-graph/issues/44)) ([7c854de](https://github.com/iotaledger/twin-auditable-item-graph/commit/7c854de39b247d6f24cd94a04a9f99fa9edde51d))
|
|
68
|
+
* eslint migration to flat config ([1b42a3a](https://github.com/iotaledger/twin-auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
|
|
69
|
+
* id optional in edge updates ([6b63fe3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6b63fe34553104843ae15aa5066775f5872859e9))
|
|
70
|
+
* 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))
|
|
71
|
+
* rest client expose remove verifiable ([a22a743](https://github.com/iotaledger/twin-auditable-item-graph/commit/a22a743ddc39377630ea0a51ca3f6e97890832c9))
|
|
72
|
+
* update background task service ([e483ddb](https://github.com/iotaledger/twin-auditable-item-graph/commit/e483ddbc948f035334f92b8342248caa6abbe441))
|
|
73
|
+
* update dependencies ([6986689](https://github.com/iotaledger/twin-auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
|
|
74
|
+
* update edges to use targetId instead of id ([6c5d0e3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6c5d0e31b6e2ea74bfa2f3344e4be628e5f237af))
|
|
75
|
+
* update framework core ([88ad4e6](https://github.com/iotaledger/twin-auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
|
|
76
|
+
* use new nameof operators ([3921c4c](https://github.com/iotaledger/twin-auditable-item-graph/commit/3921c4c9ac53e42459e45f10d9e702afb2797a23))
|
|
77
|
+
* 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))
|
|
50
78
|
|
|
51
79
|
|
|
52
80
|
### Bug Fixes
|
|
53
81
|
|
|
54
|
-
* only include alias in index if not deleted ([#6](https://github.com/
|
|
55
|
-
* query params force coercion ([2dd9afe](https://github.com/
|
|
82
|
+
* 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))
|
|
83
|
+
* query params force coercion ([2dd9afe](https://github.com/iotaledger/twin-auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
|
|
56
84
|
|
|
57
85
|
|
|
58
86
|
### Dependencies
|
|
@@ -61,7 +89,7 @@
|
|
|
61
89
|
* dependencies
|
|
62
90
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.9 to 0.0.3-next.10
|
|
63
91
|
|
|
64
|
-
## [0.0.3-next.9](https://github.com/
|
|
92
|
+
## [0.0.3-next.9](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.8...auditable-item-graph-rest-client-v0.0.3-next.9) (2026-02-23)
|
|
65
93
|
|
|
66
94
|
|
|
67
95
|
### Miscellaneous Chores
|
|
@@ -75,7 +103,7 @@
|
|
|
75
103
|
* dependencies
|
|
76
104
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.8 to 0.0.3-next.9
|
|
77
105
|
|
|
78
|
-
## [0.0.3-next.8](https://github.com/
|
|
106
|
+
## [0.0.3-next.8](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.7...auditable-item-graph-rest-client-v0.0.3-next.8) (2026-02-11)
|
|
79
107
|
|
|
80
108
|
|
|
81
109
|
### Miscellaneous Chores
|
|
@@ -89,12 +117,12 @@
|
|
|
89
117
|
* dependencies
|
|
90
118
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.7 to 0.0.3-next.8
|
|
91
119
|
|
|
92
|
-
## [0.0.3-next.7](https://github.com/
|
|
120
|
+
## [0.0.3-next.7](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.6...auditable-item-graph-rest-client-v0.0.3-next.7) (2026-02-11)
|
|
93
121
|
|
|
94
122
|
|
|
95
123
|
### Features
|
|
96
124
|
|
|
97
|
-
* changeset endpoints ([#44](https://github.com/
|
|
125
|
+
* changeset endpoints ([#44](https://github.com/iotaledger/twin-auditable-item-graph/issues/44)) ([7c854de](https://github.com/iotaledger/twin-auditable-item-graph/commit/7c854de39b247d6f24cd94a04a9f99fa9edde51d))
|
|
98
126
|
|
|
99
127
|
|
|
100
128
|
### Dependencies
|
|
@@ -103,7 +131,7 @@
|
|
|
103
131
|
* dependencies
|
|
104
132
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
105
133
|
|
|
106
|
-
## [0.0.3-next.6](https://github.com/
|
|
134
|
+
## [0.0.3-next.6](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.5...auditable-item-graph-rest-client-v0.0.3-next.6) (2026-01-26)
|
|
107
135
|
|
|
108
136
|
|
|
109
137
|
### Miscellaneous Chores
|
|
@@ -117,12 +145,12 @@
|
|
|
117
145
|
* dependencies
|
|
118
146
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
119
147
|
|
|
120
|
-
## [0.0.3-next.5](https://github.com/
|
|
148
|
+
## [0.0.3-next.5](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.4...auditable-item-graph-rest-client-v0.0.3-next.5) (2026-01-23)
|
|
121
149
|
|
|
122
150
|
|
|
123
151
|
### Features
|
|
124
152
|
|
|
125
|
-
* replace nextItem property with Link header ([#39](https://github.com/
|
|
153
|
+
* 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))
|
|
126
154
|
|
|
127
155
|
|
|
128
156
|
### Dependencies
|
|
@@ -131,7 +159,7 @@
|
|
|
131
159
|
* dependencies
|
|
132
160
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.4 to 0.0.3-next.5
|
|
133
161
|
|
|
134
|
-
## [0.0.3-next.4](https://github.com/
|
|
162
|
+
## [0.0.3-next.4](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.3...auditable-item-graph-rest-client-v0.0.3-next.4) (2026-01-22)
|
|
135
163
|
|
|
136
164
|
|
|
137
165
|
### Miscellaneous Chores
|
|
@@ -145,7 +173,7 @@
|
|
|
145
173
|
* dependencies
|
|
146
174
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.3 to 0.0.3-next.4
|
|
147
175
|
|
|
148
|
-
## [0.0.3-next.3](https://github.com/
|
|
176
|
+
## [0.0.3-next.3](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.2...auditable-item-graph-rest-client-v0.0.3-next.3) (2026-01-21)
|
|
149
177
|
|
|
150
178
|
|
|
151
179
|
### Miscellaneous Chores
|
|
@@ -159,7 +187,7 @@
|
|
|
159
187
|
* dependencies
|
|
160
188
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.2 to 0.0.3-next.3
|
|
161
189
|
|
|
162
|
-
## [0.0.3-next.2](https://github.com/
|
|
190
|
+
## [0.0.3-next.2](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.1...auditable-item-graph-rest-client-v0.0.3-next.2) (2026-01-14)
|
|
163
191
|
|
|
164
192
|
|
|
165
193
|
### Miscellaneous Chores
|
|
@@ -173,29 +201,29 @@
|
|
|
173
201
|
* dependencies
|
|
174
202
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.1 to 0.0.3-next.2
|
|
175
203
|
|
|
176
|
-
## [0.0.3-next.1](https://github.com/
|
|
204
|
+
## [0.0.3-next.1](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.3-next.0...auditable-item-graph-rest-client-v0.0.3-next.1) (2025-11-28)
|
|
177
205
|
|
|
178
206
|
|
|
179
207
|
### Features
|
|
180
208
|
|
|
181
|
-
* add context id features ([#30](https://github.com/
|
|
182
|
-
* add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/
|
|
183
|
-
* add validate-locales ([e76e6f6](https://github.com/
|
|
184
|
-
* eslint migration to flat config ([1b42a3a](https://github.com/
|
|
185
|
-
* id optional in edge updates ([6b63fe3](https://github.com/
|
|
186
|
-
* rest client expose remove verifiable ([a22a743](https://github.com/
|
|
187
|
-
* update background task service ([e483ddb](https://github.com/
|
|
188
|
-
* update dependencies ([6986689](https://github.com/
|
|
189
|
-
* update edges to use targetId instead of id ([6c5d0e3](https://github.com/
|
|
190
|
-
* update framework core ([88ad4e6](https://github.com/
|
|
191
|
-
* use new nameof operators ([3921c4c](https://github.com/
|
|
192
|
-
* use shared store mechanism ([#10](https://github.com/
|
|
209
|
+
* 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))
|
|
210
|
+
* add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/iotaledger/twin-auditable-item-graph/commit/33dbd19cabd9fbfaba81032f1d1a6527584c3f5a))
|
|
211
|
+
* add validate-locales ([e76e6f6](https://github.com/iotaledger/twin-auditable-item-graph/commit/e76e6f6b3ec9c447a04315d353442e32233601d3))
|
|
212
|
+
* eslint migration to flat config ([1b42a3a](https://github.com/iotaledger/twin-auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
|
|
213
|
+
* id optional in edge updates ([6b63fe3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6b63fe34553104843ae15aa5066775f5872859e9))
|
|
214
|
+
* rest client expose remove verifiable ([a22a743](https://github.com/iotaledger/twin-auditable-item-graph/commit/a22a743ddc39377630ea0a51ca3f6e97890832c9))
|
|
215
|
+
* update background task service ([e483ddb](https://github.com/iotaledger/twin-auditable-item-graph/commit/e483ddbc948f035334f92b8342248caa6abbe441))
|
|
216
|
+
* update dependencies ([6986689](https://github.com/iotaledger/twin-auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
|
|
217
|
+
* update edges to use targetId instead of id ([6c5d0e3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6c5d0e31b6e2ea74bfa2f3344e4be628e5f237af))
|
|
218
|
+
* update framework core ([88ad4e6](https://github.com/iotaledger/twin-auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
|
|
219
|
+
* use new nameof operators ([3921c4c](https://github.com/iotaledger/twin-auditable-item-graph/commit/3921c4c9ac53e42459e45f10d9e702afb2797a23))
|
|
220
|
+
* 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))
|
|
193
221
|
|
|
194
222
|
|
|
195
223
|
### Bug Fixes
|
|
196
224
|
|
|
197
|
-
* only include alias in index if not deleted ([#6](https://github.com/
|
|
198
|
-
* query params force coercion ([2dd9afe](https://github.com/
|
|
225
|
+
* 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))
|
|
226
|
+
* query params force coercion ([2dd9afe](https://github.com/iotaledger/twin-auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
|
|
199
227
|
|
|
200
228
|
|
|
201
229
|
### Dependencies
|
|
@@ -204,12 +232,12 @@
|
|
|
204
232
|
* dependencies
|
|
205
233
|
* @twin.org/auditable-item-graph-models bumped from 0.0.3-next.0 to 0.0.3-next.1
|
|
206
234
|
|
|
207
|
-
## [0.0.2-next.8](https://github.com/
|
|
235
|
+
## [0.0.2-next.8](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.2-next.7...auditable-item-graph-rest-client-v0.0.2-next.8) (2025-10-09)
|
|
208
236
|
|
|
209
237
|
|
|
210
238
|
### Features
|
|
211
239
|
|
|
212
|
-
* add validate-locales ([e76e6f6](https://github.com/
|
|
240
|
+
* add validate-locales ([e76e6f6](https://github.com/iotaledger/twin-auditable-item-graph/commit/e76e6f6b3ec9c447a04315d353442e32233601d3))
|
|
213
241
|
|
|
214
242
|
|
|
215
243
|
### Dependencies
|
|
@@ -218,12 +246,12 @@
|
|
|
218
246
|
* dependencies
|
|
219
247
|
* @twin.org/auditable-item-graph-models bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
220
248
|
|
|
221
|
-
## [0.0.2-next.7](https://github.com/
|
|
249
|
+
## [0.0.2-next.7](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.2-next.6...auditable-item-graph-rest-client-v0.0.2-next.7) (2025-09-29)
|
|
222
250
|
|
|
223
251
|
|
|
224
252
|
### Features
|
|
225
253
|
|
|
226
|
-
* id optional in edge updates ([6b63fe3](https://github.com/
|
|
254
|
+
* id optional in edge updates ([6b63fe3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6b63fe34553104843ae15aa5066775f5872859e9))
|
|
227
255
|
|
|
228
256
|
|
|
229
257
|
### Dependencies
|
|
@@ -232,12 +260,12 @@
|
|
|
232
260
|
* dependencies
|
|
233
261
|
* @twin.org/auditable-item-graph-models bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
234
262
|
|
|
235
|
-
## [0.0.2-next.6](https://github.com/
|
|
263
|
+
## [0.0.2-next.6](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.2-next.5...auditable-item-graph-rest-client-v0.0.2-next.6) (2025-09-29)
|
|
236
264
|
|
|
237
265
|
|
|
238
266
|
### Features
|
|
239
267
|
|
|
240
|
-
* use new nameof operators ([3921c4c](https://github.com/
|
|
268
|
+
* use new nameof operators ([3921c4c](https://github.com/iotaledger/twin-auditable-item-graph/commit/3921c4c9ac53e42459e45f10d9e702afb2797a23))
|
|
241
269
|
|
|
242
270
|
|
|
243
271
|
### Dependencies
|
|
@@ -246,12 +274,12 @@
|
|
|
246
274
|
* dependencies
|
|
247
275
|
* @twin.org/auditable-item-graph-models bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
248
276
|
|
|
249
|
-
## [0.0.2-next.5](https://github.com/
|
|
277
|
+
## [0.0.2-next.5](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.2-next.4...auditable-item-graph-rest-client-v0.0.2-next.5) (2025-09-26)
|
|
250
278
|
|
|
251
279
|
|
|
252
280
|
### Features
|
|
253
281
|
|
|
254
|
-
* update edges to use targetId instead of id ([6c5d0e3](https://github.com/
|
|
282
|
+
* update edges to use targetId instead of id ([6c5d0e3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6c5d0e31b6e2ea74bfa2f3344e4be628e5f237af))
|
|
255
283
|
|
|
256
284
|
|
|
257
285
|
### Dependencies
|
|
@@ -260,12 +288,12 @@
|
|
|
260
288
|
* dependencies
|
|
261
289
|
* @twin.org/auditable-item-graph-models bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
262
290
|
|
|
263
|
-
## [0.0.2-next.4](https://github.com/
|
|
291
|
+
## [0.0.2-next.4](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.2-next.3...auditable-item-graph-rest-client-v0.0.2-next.4) (2025-09-24)
|
|
264
292
|
|
|
265
293
|
|
|
266
294
|
### Features
|
|
267
295
|
|
|
268
|
-
* add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/
|
|
296
|
+
* add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/iotaledger/twin-auditable-item-graph/commit/33dbd19cabd9fbfaba81032f1d1a6527584c3f5a))
|
|
269
297
|
|
|
270
298
|
|
|
271
299
|
### Dependencies
|
|
@@ -274,12 +302,12 @@
|
|
|
274
302
|
* dependencies
|
|
275
303
|
* @twin.org/auditable-item-graph-models bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
276
304
|
|
|
277
|
-
## [0.0.2-next.3](https://github.com/
|
|
305
|
+
## [0.0.2-next.3](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.2-next.2...auditable-item-graph-rest-client-v0.0.2-next.3) (2025-08-29)
|
|
278
306
|
|
|
279
307
|
|
|
280
308
|
### Features
|
|
281
309
|
|
|
282
|
-
* eslint migration to flat config ([1b42a3a](https://github.com/
|
|
310
|
+
* eslint migration to flat config ([1b42a3a](https://github.com/iotaledger/twin-auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
|
|
283
311
|
|
|
284
312
|
|
|
285
313
|
### Dependencies
|
|
@@ -288,12 +316,12 @@
|
|
|
288
316
|
* dependencies
|
|
289
317
|
* @twin.org/auditable-item-graph-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
290
318
|
|
|
291
|
-
## [0.0.2-next.2](https://github.com/
|
|
319
|
+
## [0.0.2-next.2](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.2-next.1...auditable-item-graph-rest-client-v0.0.2-next.2) (2025-08-20)
|
|
292
320
|
|
|
293
321
|
|
|
294
322
|
### Features
|
|
295
323
|
|
|
296
|
-
* update framework core ([88ad4e6](https://github.com/
|
|
324
|
+
* update framework core ([88ad4e6](https://github.com/iotaledger/twin-auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
|
|
297
325
|
|
|
298
326
|
|
|
299
327
|
### Dependencies
|
|
@@ -302,20 +330,20 @@
|
|
|
302
330
|
* dependencies
|
|
303
331
|
* @twin.org/auditable-item-graph-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
304
332
|
|
|
305
|
-
## [0.0.2-next.1](https://github.com/
|
|
333
|
+
## [0.0.2-next.1](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.2-next.0...auditable-item-graph-rest-client-v0.0.2-next.1) (2025-07-21)
|
|
306
334
|
|
|
307
335
|
|
|
308
336
|
### Features
|
|
309
337
|
|
|
310
|
-
* rest client expose remove verifiable ([a22a743](https://github.com/
|
|
311
|
-
* update dependencies ([6986689](https://github.com/
|
|
312
|
-
* use shared store mechanism ([#10](https://github.com/
|
|
338
|
+
* rest client expose remove verifiable ([a22a743](https://github.com/iotaledger/twin-auditable-item-graph/commit/a22a743ddc39377630ea0a51ca3f6e97890832c9))
|
|
339
|
+
* update dependencies ([6986689](https://github.com/iotaledger/twin-auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
|
|
340
|
+
* 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))
|
|
313
341
|
|
|
314
342
|
|
|
315
343
|
### Bug Fixes
|
|
316
344
|
|
|
317
|
-
* only include alias in index if not deleted ([#6](https://github.com/
|
|
318
|
-
* query params force coercion ([2dd9afe](https://github.com/
|
|
345
|
+
* 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))
|
|
346
|
+
* query params force coercion ([2dd9afe](https://github.com/iotaledger/twin-auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
|
|
319
347
|
|
|
320
348
|
|
|
321
349
|
### Dependencies
|
|
@@ -329,7 +357,7 @@
|
|
|
329
357
|
|
|
330
358
|
### Features
|
|
331
359
|
|
|
332
|
-
* release to production ([0ce06f7](https://github.com/
|
|
360
|
+
* release to production ([0ce06f7](https://github.com/iotaledger/twin-auditable-item-graph/commit/0ce06f7825aa72d04b7a2ffd8c98cb56290b9d16))
|
|
333
361
|
|
|
334
362
|
|
|
335
363
|
### Dependencies
|
|
@@ -338,12 +366,12 @@
|
|
|
338
366
|
* dependencies
|
|
339
367
|
* @twin.org/auditable-item-graph-models bumped from ^0.0.0 to ^0.0.1
|
|
340
368
|
|
|
341
|
-
## [0.0.1-next.44](https://github.com/
|
|
369
|
+
## [0.0.1-next.44](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.1-next.43...auditable-item-graph-rest-client-v0.0.1-next.44) (2025-06-20)
|
|
342
370
|
|
|
343
371
|
|
|
344
372
|
### Bug Fixes
|
|
345
373
|
|
|
346
|
-
* query params force coercion ([2dd9afe](https://github.com/
|
|
374
|
+
* query params force coercion ([2dd9afe](https://github.com/iotaledger/twin-auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
|
|
347
375
|
|
|
348
376
|
|
|
349
377
|
### Dependencies
|
|
@@ -352,7 +380,7 @@
|
|
|
352
380
|
* dependencies
|
|
353
381
|
* @twin.org/auditable-item-graph-models bumped from 0.0.1-next.43 to 0.0.1-next.44
|
|
354
382
|
|
|
355
|
-
## [0.0.1-next.43](https://github.com/
|
|
383
|
+
## [0.0.1-next.43](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.1-next.42...auditable-item-graph-rest-client-v0.0.1-next.43) (2025-06-17)
|
|
356
384
|
|
|
357
385
|
|
|
358
386
|
### Miscellaneous Chores
|
|
@@ -366,12 +394,12 @@
|
|
|
366
394
|
* dependencies
|
|
367
395
|
* @twin.org/auditable-item-graph-models bumped from 0.0.1-next.42 to 0.0.1-next.43
|
|
368
396
|
|
|
369
|
-
## [0.0.1-next.42](https://github.com/
|
|
397
|
+
## [0.0.1-next.42](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.1-next.41...auditable-item-graph-rest-client-v0.0.1-next.42) (2025-06-12)
|
|
370
398
|
|
|
371
399
|
|
|
372
400
|
### Features
|
|
373
401
|
|
|
374
|
-
* update dependencies ([6986689](https://github.com/
|
|
402
|
+
* update dependencies ([6986689](https://github.com/iotaledger/twin-auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
|
|
375
403
|
|
|
376
404
|
|
|
377
405
|
### Dependencies
|
|
@@ -380,7 +408,7 @@
|
|
|
380
408
|
* dependencies
|
|
381
409
|
* @twin.org/auditable-item-graph-models bumped from 0.0.1-next.41 to 0.0.1-next.42
|
|
382
410
|
|
|
383
|
-
## [0.0.1-next.41](https://github.com/
|
|
411
|
+
## [0.0.1-next.41](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.1-next.40...auditable-item-graph-rest-client-v0.0.1-next.41) (2025-06-03)
|
|
384
412
|
|
|
385
413
|
|
|
386
414
|
### Miscellaneous Chores
|
|
@@ -394,7 +422,7 @@
|
|
|
394
422
|
* dependencies
|
|
395
423
|
* @twin.org/auditable-item-graph-models bumped from 0.0.1-next.40 to 0.0.1-next.41
|
|
396
424
|
|
|
397
|
-
## [0.0.1-next.40](https://github.com/
|
|
425
|
+
## [0.0.1-next.40](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.1-next.39...auditable-item-graph-rest-client-v0.0.1-next.40) (2025-05-28)
|
|
398
426
|
|
|
399
427
|
|
|
400
428
|
### Miscellaneous Chores
|
|
@@ -408,7 +436,7 @@
|
|
|
408
436
|
* dependencies
|
|
409
437
|
* @twin.org/auditable-item-graph-models bumped from 0.0.1-next.39 to 0.0.1-next.40
|
|
410
438
|
|
|
411
|
-
## [0.0.1-next.39](https://github.com/
|
|
439
|
+
## [0.0.1-next.39](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.1-next.38...auditable-item-graph-rest-client-v0.0.1-next.39) (2025-05-08)
|
|
412
440
|
|
|
413
441
|
|
|
414
442
|
### Miscellaneous Chores
|
|
@@ -422,12 +450,12 @@
|
|
|
422
450
|
* dependencies
|
|
423
451
|
* @twin.org/auditable-item-graph-models bumped from 0.0.1-next.38 to 0.0.1-next.39
|
|
424
452
|
|
|
425
|
-
## [0.0.1-next.38](https://github.com/
|
|
453
|
+
## [0.0.1-next.38](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.1-next.37...auditable-item-graph-rest-client-v0.0.1-next.38) (2025-04-17)
|
|
426
454
|
|
|
427
455
|
|
|
428
456
|
### Features
|
|
429
457
|
|
|
430
|
-
* use shared store mechanism ([#10](https://github.com/
|
|
458
|
+
* 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))
|
|
431
459
|
|
|
432
460
|
|
|
433
461
|
### Dependencies
|
|
@@ -436,12 +464,12 @@
|
|
|
436
464
|
* dependencies
|
|
437
465
|
* @twin.org/auditable-item-graph-models bumped from 0.0.1-next.37 to 0.0.1-next.38
|
|
438
466
|
|
|
439
|
-
## [0.0.1-next.37](https://github.com/
|
|
467
|
+
## [0.0.1-next.37](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.1-next.36...auditable-item-graph-rest-client-v0.0.1-next.37) (2025-04-11)
|
|
440
468
|
|
|
441
469
|
|
|
442
470
|
### Bug Fixes
|
|
443
471
|
|
|
444
|
-
* only include alias in index if not deleted ([#6](https://github.com/
|
|
472
|
+
* 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))
|
|
445
473
|
|
|
446
474
|
|
|
447
475
|
### Dependencies
|
|
@@ -450,12 +478,12 @@
|
|
|
450
478
|
* dependencies
|
|
451
479
|
* @twin.org/auditable-item-graph-models bumped from 0.0.1-next.36 to 0.0.1-next.37
|
|
452
480
|
|
|
453
|
-
## [0.0.1-next.36](https://github.com/
|
|
481
|
+
## [0.0.1-next.36](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.1-next.35...auditable-item-graph-rest-client-v0.0.1-next.36) (2025-04-11)
|
|
454
482
|
|
|
455
483
|
|
|
456
484
|
### Bug Fixes
|
|
457
485
|
|
|
458
|
-
* only include alias in index if not deleted ([#6](https://github.com/
|
|
486
|
+
* 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))
|
|
459
487
|
|
|
460
488
|
|
|
461
489
|
### Dependencies
|
|
@@ -464,7 +492,7 @@
|
|
|
464
492
|
* dependencies
|
|
465
493
|
* @twin.org/auditable-item-graph-models bumped from 0.0.1-next.35 to 0.0.1-next.36
|
|
466
494
|
|
|
467
|
-
## [0.0.1-next.35](https://github.com/
|
|
495
|
+
## [0.0.1-next.35](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.1-next.34...auditable-item-graph-rest-client-v0.0.1-next.35) (2025-04-10)
|
|
468
496
|
|
|
469
497
|
|
|
470
498
|
### Miscellaneous Chores
|
|
@@ -478,7 +506,7 @@
|
|
|
478
506
|
* dependencies
|
|
479
507
|
* @twin.org/auditable-item-graph-models bumped from 0.0.1-next.34 to 0.0.1-next.35
|
|
480
508
|
|
|
481
|
-
## [0.0.1-next.34](https://github.com/
|
|
509
|
+
## [0.0.1-next.34](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.0.1-next.33...auditable-item-graph-rest-client-v0.0.1-next.34) (2025-03-28)
|
|
482
510
|
|
|
483
511
|
|
|
484
512
|
### Miscellaneous Chores
|
|
@@ -222,6 +222,88 @@ NotFoundError if the vertex or changeset is not found.
|
|
|
222
222
|
|
|
223
223
|
***
|
|
224
224
|
|
|
225
|
+
### getVersion() {#getversion}
|
|
226
|
+
|
|
227
|
+
> **getVersion**(`id`, `versionId`): `Promise`\<`IAuditableItemGraphVertex`\>
|
|
228
|
+
|
|
229
|
+
Get a graph vertex at a specific version.
|
|
230
|
+
|
|
231
|
+
#### Parameters
|
|
232
|
+
|
|
233
|
+
##### id
|
|
234
|
+
|
|
235
|
+
`string`
|
|
236
|
+
|
|
237
|
+
The id of the vertex.
|
|
238
|
+
|
|
239
|
+
##### versionId
|
|
240
|
+
|
|
241
|
+
`string`
|
|
242
|
+
|
|
243
|
+
The id of the version (changeset id) to retrieve.
|
|
244
|
+
|
|
245
|
+
#### Returns
|
|
246
|
+
|
|
247
|
+
`Promise`\<`IAuditableItemGraphVertex`\>
|
|
248
|
+
|
|
249
|
+
The vertex reconstructed at that version.
|
|
250
|
+
|
|
251
|
+
#### Throws
|
|
252
|
+
|
|
253
|
+
NotFoundError if the vertex or version is not found.
|
|
254
|
+
|
|
255
|
+
#### Implementation of
|
|
256
|
+
|
|
257
|
+
`IAuditableItemGraphComponent.getVersion`
|
|
258
|
+
|
|
259
|
+
***
|
|
260
|
+
|
|
261
|
+
### getVersions() {#getversions}
|
|
262
|
+
|
|
263
|
+
> **getVersions**(`id`, `options?`): `Promise`\<`IAuditableItemGraphVertexVersionList`\>
|
|
264
|
+
|
|
265
|
+
Get all versions of a graph vertex.
|
|
266
|
+
|
|
267
|
+
#### Parameters
|
|
268
|
+
|
|
269
|
+
##### id
|
|
270
|
+
|
|
271
|
+
`string`
|
|
272
|
+
|
|
273
|
+
The id of the vertex.
|
|
274
|
+
|
|
275
|
+
##### options?
|
|
276
|
+
|
|
277
|
+
Additional options for the operation.
|
|
278
|
+
|
|
279
|
+
###### after?
|
|
280
|
+
|
|
281
|
+
`string`
|
|
282
|
+
|
|
283
|
+
Only return versions created after this ISO 8601 timestamp (exclusive).
|
|
284
|
+
|
|
285
|
+
###### before?
|
|
286
|
+
|
|
287
|
+
`string`
|
|
288
|
+
|
|
289
|
+
Only return versions created before this ISO 8601 timestamp (exclusive).
|
|
290
|
+
|
|
291
|
+
#### Returns
|
|
292
|
+
|
|
293
|
+
`Promise`\<`IAuditableItemGraphVertexVersionList`\>
|
|
294
|
+
|
|
295
|
+
The list of vertex versions.
|
|
296
|
+
|
|
297
|
+
#### Throws
|
|
298
|
+
|
|
299
|
+
NotFoundError if the vertex is not found.
|
|
300
|
+
|
|
301
|
+
#### Implementation of
|
|
302
|
+
|
|
303
|
+
`IAuditableItemGraphComponent.getVersions`
|
|
304
|
+
|
|
305
|
+
***
|
|
306
|
+
|
|
225
307
|
### update() {#update}
|
|
226
308
|
|
|
227
309
|
> **update**(`vertex`): `Promise`\<`void`\>
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/auditable-item-graph-rest-client",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.14",
|
|
4
4
|
"description": "Provides a client for interacting with auditable graph endpoints over HTTP.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/iotaledger/auditable-item-graph.git",
|
|
8
8
|
"directory": "packages/auditable-item-graph-rest-client"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/api-core": "next",
|
|
18
18
|
"@twin.org/api-models": "next",
|
|
19
|
-
"@twin.org/auditable-item-graph-models": "0.0.3-next.
|
|
19
|
+
"@twin.org/auditable-item-graph-models": "0.0.3-next.14",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/data-json-ld": "next",
|
|
22
22
|
"@twin.org/entity": "next",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"auditable-item-graph"
|
|
50
50
|
],
|
|
51
51
|
"bugs": {
|
|
52
|
-
"url": "git+https://github.com/
|
|
52
|
+
"url": "git+https://github.com/iotaledger/auditable-item-graph/issues"
|
|
53
53
|
},
|
|
54
54
|
"homepage": "https://twindev.org"
|
|
55
55
|
}
|