@twin.org/auditable-item-graph-rest-client 0.0.3-next.11 → 0.0.3-next.13

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/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # TWIN Auditable Item Graph REST Client
2
2
 
3
- Auditable Item Graph contract implementation which can connect to REST endpoints.
3
+ This package offers a straightforward client for sending auditable graph requests to compatible HTTP endpoints.
4
+
5
+ It helps applications consume graph, changeset, and query operations without reimplementing request and response handling.
4
6
 
5
7
  ## Installation
6
8
 
@@ -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;AAIxE,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/E,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,4BAA4B,CAAC,UAAU,CAAC;IAChD,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,MAAM,CAAC,MAiBnB;QACA,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAChC,GAAG,EACH,MAAM,EACN;YACC,IAAI,EAAE,MAAM;SACZ,CACD,CAAC;QAEF,OAAO,QAAQ,CAAC,OAAO,CA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AC,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 { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\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: {\n\t\tannotationObject?: IJsonLdNodeObject;\n\t\taliases?: {\n\t\t\tid: string;\n\t\t\taliasFormat?: string;\n\t\t\tunique?: boolean;\n\t\t\tannotationObject?: IJsonLdNodeObject;\n\t\t}[];\n\t\tresources?: {\n\t\t\tid?: string;\n\t\t\tresourceObject?: IJsonLdNodeObject;\n\t\t}[];\n\t\tedges?: {\n\t\t\ttargetId: string;\n\t\t\tedgeRelationships: string[];\n\t\t\tannotationObject?: IJsonLdNodeObject;\n\t\t}[];\n\t}): 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: {\n\t\tid: string;\n\t\tannotationObject?: IJsonLdNodeObject;\n\t\taliases?: {\n\t\t\tid: string;\n\t\t\taliasFormat?: string;\n\t\t\tunique?: boolean;\n\t\t\tannotationObject?: IJsonLdNodeObject;\n\t\t}[];\n\t\tresources?: {\n\t\t\tid?: string;\n\t\t\tresourceObject?: IJsonLdNodeObject;\n\t\t}[];\n\t\tedges?: {\n\t\t\tid?: string;\n\t\t\ttargetId: string;\n\t\t\tedgeRelationships: string[];\n\t\t\tannotationObject?: IJsonLdNodeObject;\n\t\t}[];\n\t}): 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":"AA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B,EAC1B,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\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,7 +1,6 @@
1
1
  import { BaseRestClient } from "@twin.org/api-core";
2
2
  import { type IBaseRestClientConfig } from "@twin.org/api-models";
3
3
  import type { IAuditableItemGraphChangeset, IAuditableItemGraphChangesetList, IAuditableItemGraphComponent, IAuditableItemGraphVertex, IAuditableItemGraphVertexList, VerifyDepth } from "@twin.org/auditable-item-graph-models";
4
- import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
5
4
  import type { IComparator, SortDirection } from "@twin.org/entity";
6
5
  /**
7
6
  * Client for performing auditable item graph through to REST endpoints.
@@ -30,24 +29,7 @@ export declare class AuditableItemGraphRestClient extends BaseRestClient impleme
30
29
  * @param vertex.edges The edges connected to the vertex.
31
30
  * @returns The id of the new graph item.
32
31
  */
33
- create(vertex: {
34
- annotationObject?: IJsonLdNodeObject;
35
- aliases?: {
36
- id: string;
37
- aliasFormat?: string;
38
- unique?: boolean;
39
- annotationObject?: IJsonLdNodeObject;
40
- }[];
41
- resources?: {
42
- id?: string;
43
- resourceObject?: IJsonLdNodeObject;
44
- }[];
45
- edges?: {
46
- targetId: string;
47
- edgeRelationships: string[];
48
- annotationObject?: IJsonLdNodeObject;
49
- }[];
50
- }): Promise<string>;
32
+ create(vertex: Omit<IAuditableItemGraphVertex, "id">): Promise<string>;
51
33
  /**
52
34
  * Get a graph vertex.
53
35
  * @param id The id of the vertex to get.
@@ -97,26 +79,7 @@ export declare class AuditableItemGraphRestClient extends BaseRestClient impleme
97
79
  * @param vertex.edges The edges connected to the vertex.
98
80
  * @returns Nothing.
99
81
  */
100
- update(vertex: {
101
- id: string;
102
- annotationObject?: IJsonLdNodeObject;
103
- aliases?: {
104
- id: string;
105
- aliasFormat?: string;
106
- unique?: boolean;
107
- annotationObject?: IJsonLdNodeObject;
108
- }[];
109
- resources?: {
110
- id?: string;
111
- resourceObject?: IJsonLdNodeObject;
112
- }[];
113
- edges?: {
114
- id?: string;
115
- targetId: string;
116
- edgeRelationships: string[];
117
- annotationObject?: IJsonLdNodeObject;
118
- }[];
119
- }): Promise<void>;
82
+ update(vertex: IAuditableItemGraphVertex): Promise<void>;
120
83
  /**
121
84
  * Remove the verifiable storage for an item, not supported on client.
122
85
  * @param id The id of the vertex to get.
package/docs/changelog.md CHANGED
@@ -1,6 +1,34 @@
1
- # @twin.org/auditable-item-graph-rest-client - Changelog
1
+ # Changelog
2
2
 
3
- ## [0.0.3-next.11](https://github.com/twinfoundation/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)
3
+ ## [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)
4
+
5
+
6
+ ### Features
7
+
8
+ * typescript 6 update ([2483c31](https://github.com/iotaledger/twin-auditable-item-graph/commit/2483c3171cff4c5ecedc83d958ab551291a4a487))
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.12 to 0.0.3-next.13
16
+
17
+ ## [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)
18
+
19
+
20
+ ### Features
21
+
22
+ * 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))
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.11 to 0.0.3-next.12
30
+
31
+ ## [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)
4
32
 
5
33
 
6
34
  ### Miscellaneous Chores
@@ -14,31 +42,31 @@
14
42
  * dependencies
15
43
  * @twin.org/auditable-item-graph-models bumped from 0.0.3-next.10 to 0.0.3-next.11
16
44
 
17
- ## [0.0.3-next.10](https://github.com/twinfoundation/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)
45
+ ## [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)
18
46
 
19
47
 
20
48
  ### Features
21
49
 
22
- * add context id features ([#30](https://github.com/twinfoundation/auditable-item-graph/issues/30)) ([a35d37c](https://github.com/twinfoundation/auditable-item-graph/commit/a35d37c0db62a240adde493965c0a9f7971fec45))
23
- * add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/twinfoundation/auditable-item-graph/commit/33dbd19cabd9fbfaba81032f1d1a6527584c3f5a))
24
- * add validate-locales ([e76e6f6](https://github.com/twinfoundation/auditable-item-graph/commit/e76e6f6b3ec9c447a04315d353442e32233601d3))
25
- * changeset endpoints ([#44](https://github.com/twinfoundation/auditable-item-graph/issues/44)) ([7c854de](https://github.com/twinfoundation/auditable-item-graph/commit/7c854de39b247d6f24cd94a04a9f99fa9edde51d))
26
- * eslint migration to flat config ([1b42a3a](https://github.com/twinfoundation/auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
27
- * id optional in edge updates ([6b63fe3](https://github.com/twinfoundation/auditable-item-graph/commit/6b63fe34553104843ae15aa5066775f5872859e9))
28
- * replace nextItem property with Link header ([#39](https://github.com/twinfoundation/auditable-item-graph/issues/39)) ([b29a333](https://github.com/twinfoundation/auditable-item-graph/commit/b29a333ca78ca2091e54e3e6f4355f84c350007d))
29
- * rest client expose remove verifiable ([a22a743](https://github.com/twinfoundation/auditable-item-graph/commit/a22a743ddc39377630ea0a51ca3f6e97890832c9))
30
- * update background task service ([e483ddb](https://github.com/twinfoundation/auditable-item-graph/commit/e483ddbc948f035334f92b8342248caa6abbe441))
31
- * update dependencies ([6986689](https://github.com/twinfoundation/auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
32
- * update edges to use targetId instead of id ([6c5d0e3](https://github.com/twinfoundation/auditable-item-graph/commit/6c5d0e31b6e2ea74bfa2f3344e4be628e5f237af))
33
- * update framework core ([88ad4e6](https://github.com/twinfoundation/auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
34
- * use new nameof operators ([3921c4c](https://github.com/twinfoundation/auditable-item-graph/commit/3921c4c9ac53e42459e45f10d9e702afb2797a23))
35
- * use shared store mechanism ([#10](https://github.com/twinfoundation/auditable-item-graph/issues/10)) ([da035e5](https://github.com/twinfoundation/auditable-item-graph/commit/da035e5eb8f157482b4eb2bdbc689c6c0647ff7d))
50
+ * 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))
51
+ * add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/iotaledger/twin-auditable-item-graph/commit/33dbd19cabd9fbfaba81032f1d1a6527584c3f5a))
52
+ * add validate-locales ([e76e6f6](https://github.com/iotaledger/twin-auditable-item-graph/commit/e76e6f6b3ec9c447a04315d353442e32233601d3))
53
+ * changeset endpoints ([#44](https://github.com/iotaledger/twin-auditable-item-graph/issues/44)) ([7c854de](https://github.com/iotaledger/twin-auditable-item-graph/commit/7c854de39b247d6f24cd94a04a9f99fa9edde51d))
54
+ * eslint migration to flat config ([1b42a3a](https://github.com/iotaledger/twin-auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
55
+ * id optional in edge updates ([6b63fe3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6b63fe34553104843ae15aa5066775f5872859e9))
56
+ * 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))
57
+ * rest client expose remove verifiable ([a22a743](https://github.com/iotaledger/twin-auditable-item-graph/commit/a22a743ddc39377630ea0a51ca3f6e97890832c9))
58
+ * update background task service ([e483ddb](https://github.com/iotaledger/twin-auditable-item-graph/commit/e483ddbc948f035334f92b8342248caa6abbe441))
59
+ * update dependencies ([6986689](https://github.com/iotaledger/twin-auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
60
+ * update edges to use targetId instead of id ([6c5d0e3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6c5d0e31b6e2ea74bfa2f3344e4be628e5f237af))
61
+ * update framework core ([88ad4e6](https://github.com/iotaledger/twin-auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
62
+ * use new nameof operators ([3921c4c](https://github.com/iotaledger/twin-auditable-item-graph/commit/3921c4c9ac53e42459e45f10d9e702afb2797a23))
63
+ * 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))
36
64
 
37
65
 
38
66
  ### Bug Fixes
39
67
 
40
- * only include alias in index if not deleted ([#6](https://github.com/twinfoundation/auditable-item-graph/issues/6)) ([5da3c41](https://github.com/twinfoundation/auditable-item-graph/commit/5da3c419fafa2afefd34b1c570d103012b888a75))
41
- * query params force coercion ([2dd9afe](https://github.com/twinfoundation/auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
68
+ * 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))
69
+ * query params force coercion ([2dd9afe](https://github.com/iotaledger/twin-auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
42
70
 
43
71
 
44
72
  ### Dependencies
@@ -47,7 +75,7 @@
47
75
  * dependencies
48
76
  * @twin.org/auditable-item-graph-models bumped from 0.0.3-next.9 to 0.0.3-next.10
49
77
 
50
- ## [0.0.3-next.9](https://github.com/twinfoundation/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)
78
+ ## [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)
51
79
 
52
80
 
53
81
  ### Miscellaneous Chores
@@ -61,7 +89,7 @@
61
89
  * dependencies
62
90
  * @twin.org/auditable-item-graph-models bumped from 0.0.3-next.8 to 0.0.3-next.9
63
91
 
64
- ## [0.0.3-next.8](https://github.com/twinfoundation/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)
92
+ ## [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)
65
93
 
66
94
 
67
95
  ### Miscellaneous Chores
@@ -75,12 +103,12 @@
75
103
  * dependencies
76
104
  * @twin.org/auditable-item-graph-models bumped from 0.0.3-next.7 to 0.0.3-next.8
77
105
 
78
- ## [0.0.3-next.7](https://github.com/twinfoundation/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)
106
+ ## [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)
79
107
 
80
108
 
81
109
  ### Features
82
110
 
83
- * changeset endpoints ([#44](https://github.com/twinfoundation/auditable-item-graph/issues/44)) ([7c854de](https://github.com/twinfoundation/auditable-item-graph/commit/7c854de39b247d6f24cd94a04a9f99fa9edde51d))
111
+ * changeset endpoints ([#44](https://github.com/iotaledger/twin-auditable-item-graph/issues/44)) ([7c854de](https://github.com/iotaledger/twin-auditable-item-graph/commit/7c854de39b247d6f24cd94a04a9f99fa9edde51d))
84
112
 
85
113
 
86
114
  ### Dependencies
@@ -89,7 +117,7 @@
89
117
  * dependencies
90
118
  * @twin.org/auditable-item-graph-models bumped from 0.0.3-next.6 to 0.0.3-next.7
91
119
 
92
- ## [0.0.3-next.6](https://github.com/twinfoundation/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)
120
+ ## [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)
93
121
 
94
122
 
95
123
  ### Miscellaneous Chores
@@ -103,12 +131,12 @@
103
131
  * dependencies
104
132
  * @twin.org/auditable-item-graph-models bumped from 0.0.3-next.5 to 0.0.3-next.6
105
133
 
106
- ## [0.0.3-next.5](https://github.com/twinfoundation/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)
134
+ ## [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)
107
135
 
108
136
 
109
137
  ### Features
110
138
 
111
- * replace nextItem property with Link header ([#39](https://github.com/twinfoundation/auditable-item-graph/issues/39)) ([b29a333](https://github.com/twinfoundation/auditable-item-graph/commit/b29a333ca78ca2091e54e3e6f4355f84c350007d))
139
+ * 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))
112
140
 
113
141
 
114
142
  ### Dependencies
@@ -117,7 +145,7 @@
117
145
  * dependencies
118
146
  * @twin.org/auditable-item-graph-models bumped from 0.0.3-next.4 to 0.0.3-next.5
119
147
 
120
- ## [0.0.3-next.4](https://github.com/twinfoundation/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)
148
+ ## [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)
121
149
 
122
150
 
123
151
  ### Miscellaneous Chores
@@ -131,7 +159,7 @@
131
159
  * dependencies
132
160
  * @twin.org/auditable-item-graph-models bumped from 0.0.3-next.3 to 0.0.3-next.4
133
161
 
134
- ## [0.0.3-next.3](https://github.com/twinfoundation/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)
162
+ ## [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)
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.2 to 0.0.3-next.3
147
175
 
148
- ## [0.0.3-next.2](https://github.com/twinfoundation/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)
176
+ ## [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)
149
177
 
150
178
 
151
179
  ### Miscellaneous Chores
@@ -159,29 +187,29 @@
159
187
  * dependencies
160
188
  * @twin.org/auditable-item-graph-models bumped from 0.0.3-next.1 to 0.0.3-next.2
161
189
 
162
- ## [0.0.3-next.1](https://github.com/twinfoundation/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)
190
+ ## [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)
163
191
 
164
192
 
165
193
  ### Features
166
194
 
167
- * add context id features ([#30](https://github.com/twinfoundation/auditable-item-graph/issues/30)) ([a35d37c](https://github.com/twinfoundation/auditable-item-graph/commit/a35d37c0db62a240adde493965c0a9f7971fec45))
168
- * add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/twinfoundation/auditable-item-graph/commit/33dbd19cabd9fbfaba81032f1d1a6527584c3f5a))
169
- * add validate-locales ([e76e6f6](https://github.com/twinfoundation/auditable-item-graph/commit/e76e6f6b3ec9c447a04315d353442e32233601d3))
170
- * eslint migration to flat config ([1b42a3a](https://github.com/twinfoundation/auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
171
- * id optional in edge updates ([6b63fe3](https://github.com/twinfoundation/auditable-item-graph/commit/6b63fe34553104843ae15aa5066775f5872859e9))
172
- * rest client expose remove verifiable ([a22a743](https://github.com/twinfoundation/auditable-item-graph/commit/a22a743ddc39377630ea0a51ca3f6e97890832c9))
173
- * update background task service ([e483ddb](https://github.com/twinfoundation/auditable-item-graph/commit/e483ddbc948f035334f92b8342248caa6abbe441))
174
- * update dependencies ([6986689](https://github.com/twinfoundation/auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
175
- * update edges to use targetId instead of id ([6c5d0e3](https://github.com/twinfoundation/auditable-item-graph/commit/6c5d0e31b6e2ea74bfa2f3344e4be628e5f237af))
176
- * update framework core ([88ad4e6](https://github.com/twinfoundation/auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
177
- * use new nameof operators ([3921c4c](https://github.com/twinfoundation/auditable-item-graph/commit/3921c4c9ac53e42459e45f10d9e702afb2797a23))
178
- * use shared store mechanism ([#10](https://github.com/twinfoundation/auditable-item-graph/issues/10)) ([da035e5](https://github.com/twinfoundation/auditable-item-graph/commit/da035e5eb8f157482b4eb2bdbc689c6c0647ff7d))
195
+ * 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))
196
+ * add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/iotaledger/twin-auditable-item-graph/commit/33dbd19cabd9fbfaba81032f1d1a6527584c3f5a))
197
+ * add validate-locales ([e76e6f6](https://github.com/iotaledger/twin-auditable-item-graph/commit/e76e6f6b3ec9c447a04315d353442e32233601d3))
198
+ * eslint migration to flat config ([1b42a3a](https://github.com/iotaledger/twin-auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
199
+ * id optional in edge updates ([6b63fe3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6b63fe34553104843ae15aa5066775f5872859e9))
200
+ * rest client expose remove verifiable ([a22a743](https://github.com/iotaledger/twin-auditable-item-graph/commit/a22a743ddc39377630ea0a51ca3f6e97890832c9))
201
+ * update background task service ([e483ddb](https://github.com/iotaledger/twin-auditable-item-graph/commit/e483ddbc948f035334f92b8342248caa6abbe441))
202
+ * update dependencies ([6986689](https://github.com/iotaledger/twin-auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
203
+ * update edges to use targetId instead of id ([6c5d0e3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6c5d0e31b6e2ea74bfa2f3344e4be628e5f237af))
204
+ * update framework core ([88ad4e6](https://github.com/iotaledger/twin-auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
205
+ * use new nameof operators ([3921c4c](https://github.com/iotaledger/twin-auditable-item-graph/commit/3921c4c9ac53e42459e45f10d9e702afb2797a23))
206
+ * 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))
179
207
 
180
208
 
181
209
  ### Bug Fixes
182
210
 
183
- * only include alias in index if not deleted ([#6](https://github.com/twinfoundation/auditable-item-graph/issues/6)) ([5da3c41](https://github.com/twinfoundation/auditable-item-graph/commit/5da3c419fafa2afefd34b1c570d103012b888a75))
184
- * query params force coercion ([2dd9afe](https://github.com/twinfoundation/auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
211
+ * 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))
212
+ * query params force coercion ([2dd9afe](https://github.com/iotaledger/twin-auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
185
213
 
186
214
 
187
215
  ### Dependencies
@@ -190,12 +218,12 @@
190
218
  * dependencies
191
219
  * @twin.org/auditable-item-graph-models bumped from 0.0.3-next.0 to 0.0.3-next.1
192
220
 
193
- ## [0.0.2-next.8](https://github.com/twinfoundation/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)
221
+ ## [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)
194
222
 
195
223
 
196
224
  ### Features
197
225
 
198
- * add validate-locales ([e76e6f6](https://github.com/twinfoundation/auditable-item-graph/commit/e76e6f6b3ec9c447a04315d353442e32233601d3))
226
+ * add validate-locales ([e76e6f6](https://github.com/iotaledger/twin-auditable-item-graph/commit/e76e6f6b3ec9c447a04315d353442e32233601d3))
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.2-next.7 to 0.0.2-next.8
206
234
 
207
- ## [0.0.2-next.7](https://github.com/twinfoundation/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)
235
+ ## [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)
208
236
 
209
237
 
210
238
  ### Features
211
239
 
212
- * id optional in edge updates ([6b63fe3](https://github.com/twinfoundation/auditable-item-graph/commit/6b63fe34553104843ae15aa5066775f5872859e9))
240
+ * id optional in edge updates ([6b63fe3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6b63fe34553104843ae15aa5066775f5872859e9))
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.6 to 0.0.2-next.7
220
248
 
221
- ## [0.0.2-next.6](https://github.com/twinfoundation/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)
249
+ ## [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)
222
250
 
223
251
 
224
252
  ### Features
225
253
 
226
- * use new nameof operators ([3921c4c](https://github.com/twinfoundation/auditable-item-graph/commit/3921c4c9ac53e42459e45f10d9e702afb2797a23))
254
+ * use new nameof operators ([3921c4c](https://github.com/iotaledger/twin-auditable-item-graph/commit/3921c4c9ac53e42459e45f10d9e702afb2797a23))
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.5 to 0.0.2-next.6
234
262
 
235
- ## [0.0.2-next.5](https://github.com/twinfoundation/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)
263
+ ## [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)
236
264
 
237
265
 
238
266
  ### Features
239
267
 
240
- * update edges to use targetId instead of id ([6c5d0e3](https://github.com/twinfoundation/auditable-item-graph/commit/6c5d0e31b6e2ea74bfa2f3344e4be628e5f237af))
268
+ * update edges to use targetId instead of id ([6c5d0e3](https://github.com/iotaledger/twin-auditable-item-graph/commit/6c5d0e31b6e2ea74bfa2f3344e4be628e5f237af))
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.4 to 0.0.2-next.5
248
276
 
249
- ## [0.0.2-next.4](https://github.com/twinfoundation/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)
277
+ ## [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)
250
278
 
251
279
 
252
280
  ### Features
253
281
 
254
- * add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/twinfoundation/auditable-item-graph/commit/33dbd19cabd9fbfaba81032f1d1a6527584c3f5a))
282
+ * add unique flag for alias, and exact match option for id query ([33dbd19](https://github.com/iotaledger/twin-auditable-item-graph/commit/33dbd19cabd9fbfaba81032f1d1a6527584c3f5a))
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.3 to 0.0.2-next.4
262
290
 
263
- ## [0.0.2-next.3](https://github.com/twinfoundation/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)
291
+ ## [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)
264
292
 
265
293
 
266
294
  ### Features
267
295
 
268
- * eslint migration to flat config ([1b42a3a](https://github.com/twinfoundation/auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
296
+ * eslint migration to flat config ([1b42a3a](https://github.com/iotaledger/twin-auditable-item-graph/commit/1b42a3a27bd6e32d7816de406b92b6332472edf6))
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.2 to 0.0.2-next.3
276
304
 
277
- ## [0.0.2-next.2](https://github.com/twinfoundation/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)
305
+ ## [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)
278
306
 
279
307
 
280
308
  ### Features
281
309
 
282
- * update framework core ([88ad4e6](https://github.com/twinfoundation/auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
310
+ * update framework core ([88ad4e6](https://github.com/iotaledger/twin-auditable-item-graph/commit/88ad4e6421132c3c6c45579b078d982a26f16990))
283
311
 
284
312
 
285
313
  ### Dependencies
@@ -288,20 +316,20 @@
288
316
  * dependencies
289
317
  * @twin.org/auditable-item-graph-models bumped from 0.0.2-next.1 to 0.0.2-next.2
290
318
 
291
- ## [0.0.2-next.1](https://github.com/twinfoundation/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)
319
+ ## [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)
292
320
 
293
321
 
294
322
  ### Features
295
323
 
296
- * rest client expose remove verifiable ([a22a743](https://github.com/twinfoundation/auditable-item-graph/commit/a22a743ddc39377630ea0a51ca3f6e97890832c9))
297
- * update dependencies ([6986689](https://github.com/twinfoundation/auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
298
- * use shared store mechanism ([#10](https://github.com/twinfoundation/auditable-item-graph/issues/10)) ([da035e5](https://github.com/twinfoundation/auditable-item-graph/commit/da035e5eb8f157482b4eb2bdbc689c6c0647ff7d))
324
+ * rest client expose remove verifiable ([a22a743](https://github.com/iotaledger/twin-auditable-item-graph/commit/a22a743ddc39377630ea0a51ca3f6e97890832c9))
325
+ * update dependencies ([6986689](https://github.com/iotaledger/twin-auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
326
+ * 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))
299
327
 
300
328
 
301
329
  ### Bug Fixes
302
330
 
303
- * only include alias in index if not deleted ([#6](https://github.com/twinfoundation/auditable-item-graph/issues/6)) ([5da3c41](https://github.com/twinfoundation/auditable-item-graph/commit/5da3c419fafa2afefd34b1c570d103012b888a75))
304
- * query params force coercion ([2dd9afe](https://github.com/twinfoundation/auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
331
+ * 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))
332
+ * query params force coercion ([2dd9afe](https://github.com/iotaledger/twin-auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
305
333
 
306
334
 
307
335
  ### Dependencies
@@ -315,7 +343,7 @@
315
343
 
316
344
  ### Features
317
345
 
318
- * release to production ([0ce06f7](https://github.com/twinfoundation/auditable-item-graph/commit/0ce06f7825aa72d04b7a2ffd8c98cb56290b9d16))
346
+ * release to production ([0ce06f7](https://github.com/iotaledger/twin-auditable-item-graph/commit/0ce06f7825aa72d04b7a2ffd8c98cb56290b9d16))
319
347
 
320
348
 
321
349
  ### Dependencies
@@ -324,12 +352,12 @@
324
352
  * dependencies
325
353
  * @twin.org/auditable-item-graph-models bumped from ^0.0.0 to ^0.0.1
326
354
 
327
- ## [0.0.1-next.44](https://github.com/twinfoundation/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)
355
+ ## [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)
328
356
 
329
357
 
330
358
  ### Bug Fixes
331
359
 
332
- * query params force coercion ([2dd9afe](https://github.com/twinfoundation/auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
360
+ * query params force coercion ([2dd9afe](https://github.com/iotaledger/twin-auditable-item-graph/commit/2dd9afe9ec37e2a91c110317fe289f7495c187a0))
333
361
 
334
362
 
335
363
  ### Dependencies
@@ -338,7 +366,7 @@
338
366
  * dependencies
339
367
  * @twin.org/auditable-item-graph-models bumped from 0.0.1-next.43 to 0.0.1-next.44
340
368
 
341
- ## [0.0.1-next.43](https://github.com/twinfoundation/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)
369
+ ## [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)
342
370
 
343
371
 
344
372
  ### Miscellaneous Chores
@@ -352,12 +380,12 @@
352
380
  * dependencies
353
381
  * @twin.org/auditable-item-graph-models bumped from 0.0.1-next.42 to 0.0.1-next.43
354
382
 
355
- ## [0.0.1-next.42](https://github.com/twinfoundation/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)
383
+ ## [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)
356
384
 
357
385
 
358
386
  ### Features
359
387
 
360
- * update dependencies ([6986689](https://github.com/twinfoundation/auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
388
+ * update dependencies ([6986689](https://github.com/iotaledger/twin-auditable-item-graph/commit/698668957a1fcb7f85ce2f117914d5980043924f))
361
389
 
362
390
 
363
391
  ### Dependencies
@@ -366,7 +394,7 @@
366
394
  * dependencies
367
395
  * @twin.org/auditable-item-graph-models bumped from 0.0.1-next.41 to 0.0.1-next.42
368
396
 
369
- ## [0.0.1-next.41](https://github.com/twinfoundation/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)
397
+ ## [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)
370
398
 
371
399
 
372
400
  ### Miscellaneous Chores
@@ -380,7 +408,7 @@
380
408
  * dependencies
381
409
  * @twin.org/auditable-item-graph-models bumped from 0.0.1-next.40 to 0.0.1-next.41
382
410
 
383
- ## [0.0.1-next.40](https://github.com/twinfoundation/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)
411
+ ## [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)
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.39 to 0.0.1-next.40
396
424
 
397
- ## [0.0.1-next.39](https://github.com/twinfoundation/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)
425
+ ## [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)
398
426
 
399
427
 
400
428
  ### Miscellaneous Chores
@@ -408,12 +436,12 @@
408
436
  * dependencies
409
437
  * @twin.org/auditable-item-graph-models bumped from 0.0.1-next.38 to 0.0.1-next.39
410
438
 
411
- ## [0.0.1-next.38](https://github.com/twinfoundation/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)
439
+ ## [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)
412
440
 
413
441
 
414
442
  ### Features
415
443
 
416
- * use shared store mechanism ([#10](https://github.com/twinfoundation/auditable-item-graph/issues/10)) ([da035e5](https://github.com/twinfoundation/auditable-item-graph/commit/da035e5eb8f157482b4eb2bdbc689c6c0647ff7d))
444
+ * 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))
417
445
 
418
446
 
419
447
  ### Dependencies
@@ -422,12 +450,12 @@
422
450
  * dependencies
423
451
  * @twin.org/auditable-item-graph-models bumped from 0.0.1-next.37 to 0.0.1-next.38
424
452
 
425
- ## [0.0.1-next.37](https://github.com/twinfoundation/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)
453
+ ## [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)
426
454
 
427
455
 
428
456
  ### Bug Fixes
429
457
 
430
- * only include alias in index if not deleted ([#6](https://github.com/twinfoundation/auditable-item-graph/issues/6)) ([5da3c41](https://github.com/twinfoundation/auditable-item-graph/commit/5da3c419fafa2afefd34b1c570d103012b888a75))
458
+ * 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))
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.36 to 0.0.1-next.37
438
466
 
439
- ## [0.0.1-next.36](https://github.com/twinfoundation/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)
467
+ ## [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)
440
468
 
441
469
 
442
470
  ### Bug Fixes
443
471
 
444
- * only include alias in index if not deleted ([#6](https://github.com/twinfoundation/auditable-item-graph/issues/6)) ([5da3c41](https://github.com/twinfoundation/auditable-item-graph/commit/5da3c419fafa2afefd34b1c570d103012b888a75))
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,7 +478,7 @@
450
478
  * dependencies
451
479
  * @twin.org/auditable-item-graph-models bumped from 0.0.1-next.35 to 0.0.1-next.36
452
480
 
453
- ## [0.0.1-next.35](https://github.com/twinfoundation/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)
481
+ ## [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)
454
482
 
455
483
 
456
484
  ### Miscellaneous Chores
@@ -464,7 +492,7 @@
464
492
  * dependencies
465
493
  * @twin.org/auditable-item-graph-models bumped from 0.0.1-next.34 to 0.0.1-next.35
466
494
 
467
- ## [0.0.1-next.34](https://github.com/twinfoundation/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)
495
+ ## [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)
468
496
 
469
497
 
470
498
  ### Miscellaneous Chores
package/docs/examples.md CHANGED
@@ -1 +1,119 @@
1
- # @twin.org/auditable-item-graph-rest-client - Examples
1
+ # Auditable Item Graph REST Client Examples
2
+
3
+ These snippets show practical request flows for creating, reading, updating, and querying graph items through HTTP endpoints.
4
+
5
+ ## AuditableItemGraphRestClient
6
+
7
+ ```typescript
8
+ import { AuditableItemGraphRestClient } from '@twin.org/auditable-item-graph-rest-client';
9
+
10
+ const client = new AuditableItemGraphRestClient({ endpoint: 'http://localhost:8080' });
11
+
12
+ console.log(client.className()); // AuditableItemGraphRestClient
13
+ ```
14
+
15
+ ```typescript
16
+ import { VerifyDepth } from '@twin.org/auditable-item-graph-models';
17
+ import { AuditableItemGraphRestClient } from '@twin.org/auditable-item-graph-rest-client';
18
+
19
+ const client = new AuditableItemGraphRestClient({ endpoint: 'http://localhost:8080' });
20
+
21
+ const id = await client.create({
22
+ annotationObject: {
23
+ '@context': 'https://www.w3.org/ns/activitystreams',
24
+ type: 'Create',
25
+ actor: {
26
+ type: 'Person',
27
+ id: 'acct:alex@example.org',
28
+ name: 'Alex'
29
+ },
30
+ object: {
31
+ type: 'Note',
32
+ content: 'Created through the REST client'
33
+ }
34
+ },
35
+ aliases: [{ id: 'ticket-2026-0007', aliasFormat: 'externalRef', unique: true }],
36
+ resources: [
37
+ { resourceObject: { '@context': 'https://schema.org', type: 'Thing', name: 'Asset A' } }
38
+ ]
39
+ });
40
+
41
+ const vertex = await client.get(id, {
42
+ includeDeleted: false,
43
+ verifySignatureDepth: VerifyDepth.Current
44
+ });
45
+
46
+ console.log(id); // aig:018f5a6cfd9444d58c7c2d4df1fd0a23
47
+ console.log(vertex.id); // aig:018f5a6cfd9444d58c7c2d4df1fd0a23
48
+ ```
49
+
50
+ ```typescript
51
+ import { VerifyDepth } from '@twin.org/auditable-item-graph-models';
52
+ import { AuditableItemGraphRestClient } from '@twin.org/auditable-item-graph-rest-client';
53
+
54
+ const client = new AuditableItemGraphRestClient({ endpoint: 'http://localhost:8080' });
55
+
56
+ const id = 'aig:018f5a6cfd9444d58c7c2d4df1fd0a23';
57
+
58
+ await client.update({
59
+ id,
60
+ aliases: [{ id: 'ticket-2026-0007', aliasFormat: 'externalRef' }],
61
+ resources: [
62
+ {
63
+ id: 'resource-1',
64
+ resourceObject: { '@context': 'https://schema.org', type: 'Thing', name: 'Asset A v2' }
65
+ }
66
+ ],
67
+ edges: [{ targetId: 'aig:018f5a6cfd9444d58c7c2d4df1fd0999', edgeRelationships: ['dependsOn'] }]
68
+ });
69
+
70
+ const changesetChunk = await client.getChangesets(id, undefined, 20, {
71
+ verifySignatureDepth: VerifyDepth.Current
72
+ });
73
+
74
+ const firstChangeset = changesetChunk.changesets.itemListElement?.[0];
75
+
76
+ if (firstChangeset?.id) {
77
+ const changeset = await client.getChangeset(firstChangeset.id, {
78
+ verifySignatureDepth: VerifyDepth.Current
79
+ });
80
+
81
+ console.log(changeset.id); // aig:018f5a6cfd9444d58c7c2d4df1fd0a23:changeset:018f5a6cfd9444d58c7c2d4df1fd0b10
82
+ }
83
+ ```
84
+
85
+ ```typescript
86
+ import { AuditableItemGraphRestClient } from '@twin.org/auditable-item-graph-rest-client';
87
+ import { ComparisonOperator, SortDirection } from '@twin.org/entity';
88
+
89
+ const client = new AuditableItemGraphRestClient({ endpoint: 'http://localhost:8080' });
90
+
91
+ const result = await client.query(
92
+ {
93
+ id: 'ticket-2026',
94
+ idMode: 'alias',
95
+ idExact: false,
96
+ resourceTypes: ['Thing']
97
+ },
98
+ [
99
+ {
100
+ field: 'dateCreated',
101
+ comparison: ComparisonOperator.GreaterThan,
102
+ value: '2026-01-01T00:00:00.000Z'
103
+ }
104
+ ],
105
+ 'dateCreated',
106
+ SortDirection.Descending,
107
+ ['id', 'dateCreated', 'aliases'],
108
+ undefined,
109
+ 10
110
+ );
111
+
112
+ console.log(result.entries.itemListElement?.length ?? 0); // 2
113
+
114
+ try {
115
+ await client.removeVerifiable('aig:018f5a6cfd9444d58c7c2d4df1fd0a23');
116
+ } catch (error) {
117
+ console.log(error instanceof Error ? error.message : 'Unknown error'); // Not supported on client
118
+ }
119
+ ```
@@ -36,7 +36,7 @@ The configuration for the client.
36
36
 
37
37
  ## Properties
38
38
 
39
- ### CLASS\_NAME
39
+ ### CLASS\_NAME {#class_name}
40
40
 
41
41
  > `readonly` `static` **CLASS\_NAME**: `string`
42
42
 
@@ -44,7 +44,7 @@ Runtime name for the class.
44
44
 
45
45
  ## Methods
46
46
 
47
- ### className()
47
+ ### className() {#classname}
48
48
 
49
49
  > **className**(): `string`
50
50
 
@@ -62,7 +62,7 @@ The class name of the component.
62
62
 
63
63
  ***
64
64
 
65
- ### create()
65
+ ### create() {#create}
66
66
 
67
67
  > **create**(`vertex`): `Promise`\<`string`\>
68
68
 
@@ -72,31 +72,9 @@ Create a new graph vertex.
72
72
 
73
73
  ##### vertex
74
74
 
75
- The vertex to create.
76
-
77
- ###### annotationObject?
78
-
79
- `IJsonLdNodeObject`
80
-
81
- The annotation object for the vertex as JSON-LD.
82
-
83
- ###### aliases?
84
-
85
- `object`[]
86
-
87
- Alternative aliases that can be used to identify the vertex.
88
-
89
- ###### resources?
75
+ `Omit`\<`IAuditableItemGraphVertex`, `"id"`\>
90
76
 
91
- `object`[]
92
-
93
- The resources attached to the vertex.
94
-
95
- ###### edges?
96
-
97
- `object`[]
98
-
99
- The edges connected to the vertex.
77
+ The vertex to create.
100
78
 
101
79
  #### Returns
102
80
 
@@ -110,7 +88,7 @@ The id of the new graph item.
110
88
 
111
89
  ***
112
90
 
113
- ### get()
91
+ ### get() {#get}
114
92
 
115
93
  > **get**(`id`, `options?`): `Promise`\<`IAuditableItemGraphVertex`\>
116
94
 
@@ -156,7 +134,7 @@ NotFoundError if the vertex is not found.
156
134
 
157
135
  ***
158
136
 
159
- ### getChangesets()
137
+ ### getChangesets() {#getchangesets}
160
138
 
161
139
  > **getChangesets**(`id`, `cursor?`, `limit?`, `options?`): `Promise`\<\{ `changesets`: `IAuditableItemGraphChangesetList`; `cursor?`: `string`; \}\>
162
140
 
@@ -204,7 +182,7 @@ The changesets if found.
204
182
 
205
183
  ***
206
184
 
207
- ### getChangeset()
185
+ ### getChangeset() {#getchangeset}
208
186
 
209
187
  > **getChangeset**(`id`, `options?`): `Promise`\<`IAuditableItemGraphChangeset`\>
210
188
 
@@ -244,7 +222,7 @@ NotFoundError if the vertex or changeset is not found.
244
222
 
245
223
  ***
246
224
 
247
- ### update()
225
+ ### update() {#update}
248
226
 
249
227
  > **update**(`vertex`): `Promise`\<`void`\>
250
228
 
@@ -254,37 +232,9 @@ Update a graph vertex.
254
232
 
255
233
  ##### vertex
256
234
 
257
- The vertex to update.
258
-
259
- ###### id
260
-
261
- `string`
262
-
263
- The id of the vertex to update.
264
-
265
- ###### annotationObject?
266
-
267
- `IJsonLdNodeObject`
268
-
269
- The annotation object for the vertex as JSON-LD.
270
-
271
- ###### aliases?
272
-
273
- `object`[]
274
-
275
- Alternative aliases that can be used to identify the vertex.
235
+ `IAuditableItemGraphVertex`
276
236
 
277
- ###### resources?
278
-
279
- `object`[]
280
-
281
- The resources attached to the vertex.
282
-
283
- ###### edges?
284
-
285
- `object`[]
286
-
287
- The edges connected to the vertex.
237
+ The vertex to update.
288
238
 
289
239
  #### Returns
290
240
 
@@ -298,7 +248,7 @@ Nothing.
298
248
 
299
249
  ***
300
250
 
301
- ### removeVerifiable()
251
+ ### removeVerifiable() {#removeverifiable}
302
252
 
303
253
  > **removeVerifiable**(`id`): `Promise`\<`void`\>
304
254
 
@@ -328,7 +278,7 @@ NotFoundError if the vertex is not found.
328
278
 
329
279
  ***
330
280
 
331
- ### query()
281
+ ### query() {#query}
332
282
 
333
283
  > **query**(`options?`, `conditions?`, `orderBy?`, `orderByDirection?`, `properties?`, `cursor?`, `limit?`): `Promise`\<\{ `entries`: `IAuditableItemGraphVertexList`; `cursor?`: `string`; \}\>
334
284
 
@@ -372,9 +322,9 @@ Conditions to use in the query.
372
322
 
373
323
  ##### orderBy?
374
324
 
375
- The order for the results, defaults to created.
325
+ `"dateCreated"` \| `"dateModified"`
376
326
 
377
- `"dateCreated"` | `"dateModified"`
327
+ The order for the results, defaults to created.
378
328
 
379
329
  ##### orderByDirection?
380
330
 
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.11",
4
- "description": "Auditable Item Graph contract implementation which can connect to REST endpoints",
3
+ "version": "0.0.3-next.13",
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/twinfoundation/auditable-item-graph.git",
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.11",
19
+ "@twin.org/auditable-item-graph-models": "0.0.3-next.13",
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/twinfoundation/auditable-item-graph/issues"
52
+ "url": "git+https://github.com/iotaledger/auditable-item-graph/issues"
53
53
  },
54
54
  "homepage": "https://twindev.org"
55
55
  }