@twin.org/auditable-item-graph-rest-client 0.9.0 → 0.9.1-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
3
|
import { BaseRestClient } from "@twin.org/api-core";
|
|
4
|
-
import { HttpParameterHelper } from "@twin.org/api-models";
|
|
4
|
+
import { HttpHeaderHelper, HttpParameterHelper } from "@twin.org/api-models";
|
|
5
5
|
import { Coerce, Guards, Urn } from "@twin.org/core";
|
|
6
|
-
import {
|
|
6
|
+
import { HeaderTypes, HttpMethod, MimeTypes } from "@twin.org/web";
|
|
7
7
|
/**
|
|
8
8
|
* Client for performing auditable item graph through to REST endpoints.
|
|
9
9
|
*/
|
|
@@ -36,10 +36,10 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
36
36
|
* @returns The id of the new graph item.
|
|
37
37
|
*/
|
|
38
38
|
async create(vertex) {
|
|
39
|
-
const response = await this.fetch("/",
|
|
39
|
+
const response = await this.fetch("/", HttpMethod.POST, {
|
|
40
40
|
body: vertex
|
|
41
41
|
});
|
|
42
|
-
return response.headers
|
|
42
|
+
return HttpHeaderHelper.extractId(response.headers);
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Get a graph vertex.
|
|
@@ -52,7 +52,7 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
52
52
|
*/
|
|
53
53
|
async get(id, options) {
|
|
54
54
|
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "id", id);
|
|
55
|
-
const response = await this.fetch("/:id",
|
|
55
|
+
const response = await this.fetch("/:id", HttpMethod.GET, {
|
|
56
56
|
headers: {
|
|
57
57
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
58
58
|
},
|
|
@@ -77,7 +77,7 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
77
77
|
*/
|
|
78
78
|
async getChangesets(id, cursor, limit, options) {
|
|
79
79
|
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "id", id);
|
|
80
|
-
const response = await this.fetch("/:id/changesets",
|
|
80
|
+
const response = await this.fetch("/:id/changesets", HttpMethod.GET, {
|
|
81
81
|
headers: {
|
|
82
82
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
83
83
|
},
|
|
@@ -92,8 +92,7 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
92
92
|
});
|
|
93
93
|
return {
|
|
94
94
|
changesets: response.body,
|
|
95
|
-
cursor:
|
|
96
|
-
?.urlQueryParams?.cursor
|
|
95
|
+
cursor: HttpHeaderHelper.extractCursor(response.headers)
|
|
97
96
|
};
|
|
98
97
|
}
|
|
99
98
|
/**
|
|
@@ -112,7 +111,7 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
112
111
|
const changesetId = namespaceSpecificParts[2];
|
|
113
112
|
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "vertexId", vertexId);
|
|
114
113
|
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "changesetId", changesetId);
|
|
115
|
-
const response = await this.fetch("/:id/changesets/:changesetId",
|
|
114
|
+
const response = await this.fetch("/:id/changesets/:changesetId", HttpMethod.GET, {
|
|
116
115
|
headers: {
|
|
117
116
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
118
117
|
},
|
|
@@ -139,7 +138,7 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
139
138
|
const urnParsed = Urn.fromValidString(id);
|
|
140
139
|
const vertexId = urnParsed.namespaceSpecific(0);
|
|
141
140
|
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "vertexId", vertexId);
|
|
142
|
-
const response = await this.fetch("/:id/versions/:version",
|
|
141
|
+
const response = await this.fetch("/:id/versions/:version", HttpMethod.GET, {
|
|
143
142
|
headers: {
|
|
144
143
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
145
144
|
},
|
|
@@ -161,7 +160,7 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
161
160
|
*/
|
|
162
161
|
async getVersions(id, options) {
|
|
163
162
|
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "id", id);
|
|
164
|
-
const response = await this.fetch("/:id/versions",
|
|
163
|
+
const response = await this.fetch("/:id/versions", HttpMethod.GET, {
|
|
165
164
|
headers: {
|
|
166
165
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
167
166
|
},
|
|
@@ -191,7 +190,7 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
191
190
|
Guards.object(AuditableItemGraphRestClient.CLASS_NAME, "vertex", vertex);
|
|
192
191
|
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "vertex.id", vertex.id);
|
|
193
192
|
const { id, ...rest } = vertex;
|
|
194
|
-
await this.fetch("/:id",
|
|
193
|
+
await this.fetch("/:id", HttpMethod.PUT, {
|
|
195
194
|
pathParams: {
|
|
196
195
|
id
|
|
197
196
|
},
|
|
@@ -207,7 +206,7 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
207
206
|
Guards.object(AuditableItemGraphRestClient.CLASS_NAME, "partial", partial);
|
|
208
207
|
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "partial.id", partial.id);
|
|
209
208
|
const { id, ...body } = partial;
|
|
210
|
-
await this.fetch("/:id",
|
|
209
|
+
await this.fetch("/:id", HttpMethod.PATCH, {
|
|
211
210
|
pathParams: {
|
|
212
211
|
id
|
|
213
212
|
},
|
|
@@ -221,7 +220,7 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
221
220
|
*/
|
|
222
221
|
async removeProof(id) {
|
|
223
222
|
Guards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, "id", id);
|
|
224
|
-
await this.fetch("/:id/proof",
|
|
223
|
+
await this.fetch("/:id/proof", HttpMethod.DELETE, {
|
|
225
224
|
pathParams: { id }
|
|
226
225
|
});
|
|
227
226
|
}
|
|
@@ -241,7 +240,7 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
241
240
|
* @returns The entities, which can be partial if a limited keys list was provided.
|
|
242
241
|
*/
|
|
243
242
|
async query(options, conditions, orderBy, orderByDirection, properties, cursor, limit) {
|
|
244
|
-
const response = await this.fetch("/",
|
|
243
|
+
const response = await this.fetch("/", HttpMethod.GET, {
|
|
245
244
|
headers: {
|
|
246
245
|
[HeaderTypes.Accept]: MimeTypes.JsonLd
|
|
247
246
|
},
|
|
@@ -260,8 +259,7 @@ export class AuditableItemGraphRestClient extends BaseRestClient {
|
|
|
260
259
|
});
|
|
261
260
|
return {
|
|
262
261
|
entries: response.body,
|
|
263
|
-
cursor:
|
|
264
|
-
?.urlQueryParams?.cursor
|
|
262
|
+
cursor: HttpHeaderHelper.extractCursor(response.headers)
|
|
265
263
|
};
|
|
266
264
|
}
|
|
267
265
|
}
|
|
@@ -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;AA2B9B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGrD,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,sBAAsB,CAAC,CAAC;IAC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IACI,KAAK,CAAC,KAAK,CACjB,OAKC,EACD,UAAuD,EACvD,OAA+E,EAC/E,gBAAgC,EAChC,UAAgD,EAChD,MAAe,EACf,KAAc;QAKd,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAG/B,GAAG,EAAE,KAAK,EAAE;YACb,OAAO,EAAE;gBACR,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM;aACtC;YACD,KAAK,EAAE;gBACN,EAAE,EAAE,OAAO,EAAE,EAAE;gBACf,MAAM,EAAE,OAAO,EAAE,MAAM;gBACvB,OAAO,EAAE,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\tIAuditableItemGraphPartialVertex,\n\tIAuditableItemGraphRemoveProofRequest,\n\tIAuditableItemGraphUpdatePartialRequest,\n\tIAuditableItemGraphUpdateRequest,\n\tIAuditableItemGraphVersionGetRequest,\n\tIAuditableItemGraphVersionGetResponse,\n\tIAuditableItemGraphVersionListRequest,\n\tIAuditableItemGraphVersionListResponse,\n\tIAuditableItemGraphVertex,\n\tIAuditableItemGraphVertexList,\n\tIAuditableItemGraphVertexVersionList,\n\tVerifyDepth\n} from \"@twin.org/auditable-item-graph-models\";\nimport { Coerce, Guards, Urn } from \"@twin.org/core\";\nimport type { EntityCondition, 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 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\tpublic async getVersion(id: string, version: number): Promise<IAuditableItemGraphVertex> {\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\t\tGuards.integer(AuditableItemGraphRestClient.CLASS_NAME, nameof(version), version);\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/:version\", \"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\tversion: version.toString()\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 (PUT — full replacement of vertex state).\n\t * The server serializes concurrent updates for the same vertex via `Mutex` on the vertex id;\n\t * requests load-balanced across replicas can still race.\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 A promise that resolves when the vertex has been updated.\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 * Partially update a graph vertex (PATCH — optional scalars; list fields use `{ add, remove }`).\n\t * @param partial The partial vertex update (must include `id`).\n\t * @returns A promise that resolves when the partial update has been applied.\n\t */\n\tpublic async updatePartial(partial: IAuditableItemGraphPartialVertex): Promise<void> {\n\t\tGuards.object(AuditableItemGraphRestClient.CLASS_NAME, nameof(partial), partial);\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(partial.id), partial.id);\n\n\t\tconst { id, ...body } = partial;\n\n\t\tawait this.fetch<IAuditableItemGraphUpdatePartialRequest, INoContentResponse>(\"/:id\", \"PATCH\", {\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t},\n\t\t\tbody\n\t\t});\n\t}\n\n\t/**\n\t * Remove the notarization proof from all changesets of a graph vertex.\n\t * @param id The id of the vertex.\n\t * @returns A promise that resolves when the proof has been removed.\n\t */\n\tpublic async removeProof(id: string): Promise<void> {\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tawait this.fetch<IAuditableItemGraphRemoveProofRequest, INoContentResponse>(\n\t\t\t\"/:id/proof\",\n\t\t\t\"DELETE\",\n\t\t\t{\n\t\t\t\tpathParams: { id }\n\t\t\t}\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?: EntityCondition<IAuditableItemGraphVertex>,\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,uC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QAEH,OAAO;YACN,OAAO,EAAE,QAAQ,CAAC,IAAI;YACtB,MAAM,EAAE,gBAAgB,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC;SACxD,CAAC;IACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport {\n\tHttpHeaderHelper,\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\tIAuditableItemGraphPartialVertex,\n\tIAuditableItemGraphRemoveProofRequest,\n\tIAuditableItemGraphUpdatePartialRequest,\n\tIAuditableItemGraphUpdateRequest,\n\tIAuditableItemGraphVersionGetRequest,\n\tIAuditableItemGraphVersionGetResponse,\n\tIAuditableItemGraphVersionListRequest,\n\tIAuditableItemGraphVersionListResponse,\n\tIAuditableItemGraphVertex,\n\tIAuditableItemGraphVertexList,\n\tIAuditableItemGraphVertexVersionList,\n\tVerifyDepth\n} from \"@twin.org/auditable-item-graph-models\";\nimport { Coerce, Guards, Urn } from \"@twin.org/core\";\nimport type { EntityCondition, SortDirection } from \"@twin.org/entity\";\nimport { nameof } from \"@twin.org/nameof\";\nimport { HeaderTypes, HttpMethod, 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\tHttpMethod.POST,\n\t\t\t{\n\t\t\t\tbody: vertex\n\t\t\t}\n\t\t);\n\n\t\treturn HttpHeaderHelper.extractId(response.headers);\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\", HttpMethod.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\", HttpMethod.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: HttpHeaderHelper.extractCursor(response.headers)\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\", HttpMethod.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 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\tpublic async getVersion(id: string, version: number): Promise<IAuditableItemGraphVertex> {\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\t\tGuards.integer(AuditableItemGraphRestClient.CLASS_NAME, nameof(version), version);\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/:version\", HttpMethod.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\tversion: version.toString()\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\", HttpMethod.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 (PUT — full replacement of vertex state).\n\t * The server serializes concurrent updates for the same vertex via `Mutex` on the vertex id;\n\t * requests load-balanced across replicas can still race.\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 A promise that resolves when the vertex has been updated.\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\", HttpMethod.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 * Partially update a graph vertex (PATCH — optional scalars; list fields use `{ add, remove }`).\n\t * @param partial The partial vertex update (must include `id`).\n\t * @returns A promise that resolves when the partial update has been applied.\n\t */\n\tpublic async updatePartial(partial: IAuditableItemGraphPartialVertex): Promise<void> {\n\t\tGuards.object(AuditableItemGraphRestClient.CLASS_NAME, nameof(partial), partial);\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(partial.id), partial.id);\n\n\t\tconst { id, ...body } = partial;\n\n\t\tawait this.fetch<IAuditableItemGraphUpdatePartialRequest, INoContentResponse>(\n\t\t\t\"/:id\",\n\t\t\tHttpMethod.PATCH,\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid\n\t\t\t\t},\n\t\t\t\tbody\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Remove the notarization proof from all changesets of a graph vertex.\n\t * @param id The id of the vertex.\n\t * @returns A promise that resolves when the proof has been removed.\n\t */\n\tpublic async removeProof(id: string): Promise<void> {\n\t\tGuards.stringValue(AuditableItemGraphRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tawait this.fetch<IAuditableItemGraphRemoveProofRequest, INoContentResponse>(\n\t\t\t\"/:id/proof\",\n\t\t\tHttpMethod.DELETE,\n\t\t\t{\n\t\t\t\tpathParams: { id }\n\t\t\t}\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?: EntityCondition<IAuditableItemGraphVertex>,\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>(\"/\", HttpMethod.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: HttpHeaderHelper.extractCursor(response.headers)\n\t\t};\n\t}\n}\n"]}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.1-next.2](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.9.1-next.1...auditable-item-graph-rest-client-v0.9.1-next.2) (2026-06-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* 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))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/auditable-item-graph-models bumped from 0.9.1-next.1 to 0.9.1-next.2
|
|
16
|
+
|
|
17
|
+
## [0.9.1-next.1](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.9.1-next.0...auditable-item-graph-rest-client-v0.9.1-next.1) (2026-06-26)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* 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))
|
|
23
|
+
* add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/iotaledger/twin-auditable-item-graph/commit/33dbd19cabd9fbfaba81032f1d1a6527584c3f5a))
|
|
24
|
+
* add validate-locales ([e76e6f6](https://github.com/iotaledger/twin-auditable-item-graph/commit/e76e6f6b3ec9c447a04315d353442e32233601d3))
|
|
25
|
+
* add versions ([#60](https://github.com/iotaledger/twin-auditable-item-graph/issues/60)) ([5c36f94](https://github.com/iotaledger/twin-auditable-item-graph/commit/5c36f94b1155c01dddbc8d62f3f65d599916c521))
|
|
26
|
+
* 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))
|
|
27
|
+
* 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))
|
|
28
|
+
* changeset endpoints ([#44](https://github.com/iotaledger/twin-auditable-item-graph/issues/44)) ([7c854de](https://github.com/iotaledger/twin-auditable-item-graph/commit/7c854de39b247d6f24cd94a04a9f99fa9edde51d))
|
|
29
|
+
* eslint migration to flat config ([1b42a3a](https://github.com/iotaledger/twin-auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
|
|
30
|
+
* id optional in edge updates ([6b63fe3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6b63fe34553104843ae15aa5066775f5872859e9))
|
|
31
|
+
* improved versioning ([#66](https://github.com/iotaledger/twin-auditable-item-graph/issues/66)) ([1b497cd](https://github.com/iotaledger/twin-auditable-item-graph/commit/1b497cdc88eec9b6707b097283773e109baae3aa))
|
|
32
|
+
* 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))
|
|
33
|
+
* rest client expose remove verifiable ([a22a743](https://github.com/iotaledger/twin-auditable-item-graph/commit/a22a743ddc39377630ea0a51ca3f6e97890832c9))
|
|
34
|
+
* typescript 6 update ([2483c31](https://github.com/iotaledger/twin-auditable-item-graph/commit/2483c3171cff4c5ecedc83d958ab551291a4a487))
|
|
35
|
+
* update background task service ([e483ddb](https://github.com/iotaledger/twin-auditable-item-graph/commit/e483ddbc948f035334f92b8342248caa6abbe441))
|
|
36
|
+
* update dependencies ([6986689](https://github.com/iotaledger/twin-auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
|
|
37
|
+
* update edges to use targetId instead of id ([6c5d0e3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6c5d0e31b6e2ea74bfa2f3344e4be628e5f237af))
|
|
38
|
+
* update framework core ([88ad4e6](https://github.com/iotaledger/twin-auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
|
|
39
|
+
* 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))
|
|
40
|
+
* use new nameof operators ([3921c4c](https://github.com/iotaledger/twin-auditable-item-graph/commit/3921c4c9ac53e42459e45f10d9e702afb2797a23))
|
|
41
|
+
* 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))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* 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))
|
|
47
|
+
* 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))
|
|
48
|
+
* 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))
|
|
49
|
+
* query params force coercion ([2dd9afe](https://github.com/iotaledger/twin-auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Dependencies
|
|
53
|
+
|
|
54
|
+
* The following workspace dependencies were updated
|
|
55
|
+
* dependencies
|
|
56
|
+
* @twin.org/auditable-item-graph-models bumped from 0.9.1-next.0 to 0.9.1-next.1
|
|
57
|
+
|
|
3
58
|
## [0.9.0](https://github.com/iotaledger/twin-auditable-item-graph/compare/auditable-item-graph-rest-client-v0.9.0...auditable-item-graph-rest-client-v0.9.0) (2026-06-25)
|
|
4
59
|
|
|
5
60
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/auditable-item-graph-rest-client",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1-next.2",
|
|
4
4
|
"description": "Provides a client for interacting with auditable graph endpoints over HTTP.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-core": "
|
|
18
|
-
"@twin.org/api-models": "
|
|
19
|
-
"@twin.org/auditable-item-graph-models": "
|
|
20
|
-
"@twin.org/core": "
|
|
21
|
-
"@twin.org/data-json-ld": "
|
|
22
|
-
"@twin.org/entity": "
|
|
23
|
-
"@twin.org/immutable-proof-models": "
|
|
24
|
-
"@twin.org/nameof": "
|
|
25
|
-
"@twin.org/web": "
|
|
17
|
+
"@twin.org/api-core": "next",
|
|
18
|
+
"@twin.org/api-models": "next",
|
|
19
|
+
"@twin.org/auditable-item-graph-models": "0.9.1-next.2",
|
|
20
|
+
"@twin.org/core": "next",
|
|
21
|
+
"@twin.org/data-json-ld": "next",
|
|
22
|
+
"@twin.org/entity": "next",
|
|
23
|
+
"@twin.org/immutable-proof-models": "next",
|
|
24
|
+
"@twin.org/nameof": "next",
|
|
25
|
+
"@twin.org/web": "next"
|
|
26
26
|
},
|
|
27
27
|
"main": "./dist/es/index.js",
|
|
28
28
|
"types": "./dist/types/index.d.ts",
|