@twin.org/auditable-item-stream-rest-client 0.0.3-next.8 → 0.0.3-next.9

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.
@@ -146,7 +146,7 @@ export class AuditableItemStreamRestClient extends BaseRestClient {
146
146
  */
147
147
  async createEntry(id, entryObject) {
148
148
  Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
149
- const response = await this.fetch("/:id", "POST", {
149
+ const response = await this.fetch("/:id/entries", "POST", {
150
150
  pathParams: {
151
151
  id
152
152
  },
@@ -168,7 +168,7 @@ export class AuditableItemStreamRestClient extends BaseRestClient {
168
168
  async getEntry(id, entryId, options) {
169
169
  Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
170
170
  Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
171
- const response = await this.fetch("/:id/:entryId", "GET", {
171
+ const response = await this.fetch("/:id/entries/:entryId", "GET", {
172
172
  headers: {
173
173
  [HeaderTypes.Accept]: MimeTypes.JsonLd
174
174
  },
@@ -192,7 +192,7 @@ export class AuditableItemStreamRestClient extends BaseRestClient {
192
192
  async getEntryObject(id, entryId) {
193
193
  Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
194
194
  Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
195
- const response = await this.fetch("/:id/:entryId/object", "GET", {
195
+ const response = await this.fetch("/:id/entries/:entryId/object", "GET", {
196
196
  headers: {
197
197
  [HeaderTypes.Accept]: MimeTypes.JsonLd
198
198
  },
@@ -213,7 +213,7 @@ export class AuditableItemStreamRestClient extends BaseRestClient {
213
213
  async updateEntry(id, entryId, entryObject) {
214
214
  Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
215
215
  Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
216
- await this.fetch("/:id/:entryId", "PUT", {
216
+ await this.fetch("/:id/entries/:entryId", "PUT", {
217
217
  pathParams: {
218
218
  id,
219
219
  entryId
@@ -232,7 +232,7 @@ export class AuditableItemStreamRestClient extends BaseRestClient {
232
232
  async removeEntry(id, entryId) {
233
233
  Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "id", id);
234
234
  Guards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, "entryId", entryId);
235
- await this.fetch("/:id/:entryId", "DELETE", {
235
+ await this.fetch("/:id/entries/:entryId", "DELETE", {
236
236
  pathParams: {
237
237
  id,
238
238
  entryId
@@ -1 +1 @@
1
- {"version":3,"file":"auditableItemStreamRestClient.js","sourceRoot":"","sources":["../../src/auditableItemStreamRestClient.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,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAInE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAErE;;GAEG;AACH,MAAM,OAAO,6BACZ,SAAQ,cAAc;IAGtB;;OAEG;IACI,MAAM,CAAU,UAAU,mCAAmD;IAEpF;;;OAGG;IACH,YAAY,MAA6B;QACxC,KAAK,kCAA0C,MAAM,EAAE,uBAAuB,CAAC,CAAC;IACjF,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,6BAA6B,CAAC,UAAU,CAAC;IACjD,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,MAAM,CAClB,MAKC,EACD,OAEC;QAED,MAAM,CAAC,MAAM,CAAC,6BAA6B,CAAC,UAAU,YAAkB,MAAM,CAAC,CAAC;QAChF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAChC,GAAG,EACH,MAAM,EACN;YACC,IAAI,EAAE;gBAC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AAC;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;IAED;;;;;OAKG;IACI,KAAK,CAAC,gBAAgB,CAAC,EAAU;QACvC,MAAM,IAAI,iBAAiB,CAAC,6BAA6B,CAAC,UAAU,EAAE,sBAAsB,EAAE;YAC7F,UAAU,EAAE,kBAAkB;SAC9B,CAAC,CAAC;IACJ,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\tIAuditableItemStream,\n\tIAuditableItemStreamComponent,\n\tIAuditableItemStreamCreateEntryRequest,\n\tIAuditableItemStreamCreateRequest,\n\tIAuditableItemStreamDeleteEntryRequest,\n\tIAuditableItemStreamDeleteRequest,\n\tIAuditableItemStreamEntry,\n\tIAuditableItemStreamEntryList,\n\tIAuditableItemStreamEntryObjectList,\n\tIAuditableItemStreamGetEntryObjectRequest,\n\tIAuditableItemStreamGetEntryObjectResponse,\n\tIAuditableItemStreamGetEntryRequest,\n\tIAuditableItemStreamGetEntryResponse,\n\tIAuditableItemStreamGetRequest,\n\tIAuditableItemStreamGetResponse,\n\tIAuditableItemStreamList,\n\tIAuditableItemStreamListEntriesRequest,\n\tIAuditableItemStreamListEntriesResponse,\n\tIAuditableItemStreamListEntryObjectsRequest,\n\tIAuditableItemStreamListEntryObjectsResponse,\n\tIAuditableItemStreamListRequest,\n\tIAuditableItemStreamListResponse,\n\tIAuditableItemStreamUpdateEntryRequest,\n\tIAuditableItemStreamUpdateRequest\n} from \"@twin.org/auditable-item-stream-models\";\nimport { Coerce, Guards, NotSupportedError } 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 stream through to REST endpoints.\n */\nexport class AuditableItemStreamRestClient\n\textends BaseRestClient\n\timplements IAuditableItemStreamComponent\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<AuditableItemStreamRestClient>();\n\n\t/**\n\t * Create a new instance of AuditableItemStreamRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(nameof<AuditableItemStreamRestClient>(), config, \"auditable-item-stream\");\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 AuditableItemStreamRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create a new stream.\n\t * @param stream The stream to create.\n\t * @param stream.annotationObject The object for the stream as JSON-LD.\n\t * @param stream.entries Entries to store in the stream.\n\t * @param options Options for creating the stream.\n\t * @param options.immutableInterval After how many entries do we add immutable checks, defaults to service configured value.\n\t * A value of 0 will disable integrity checks, 1 will be every item, or any other integer for an interval.\n\t * @returns The id of the new stream item.\n\t */\n\tpublic async create(\n\t\tstream: {\n\t\t\tannotationObject?: IJsonLdNodeObject;\n\t\t\tentries?: {\n\t\t\t\tentryObject: IJsonLdNodeObject;\n\t\t\t}[];\n\t\t},\n\t\toptions?: {\n\t\t\timmutableInterval?: number;\n\t\t}\n\t): Promise<string> {\n\t\tGuards.object(AuditableItemStreamRestClient.CLASS_NAME, nameof(stream), stream);\n\t\tconst response = await this.fetch<IAuditableItemStreamCreateRequest, ICreatedResponse>(\n\t\t\t\"/\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\tbody: {\n\t\t\t\t\t...stream,\n\t\t\t\t\timmutableInterval: options?.immutableInterval\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.headers[HeaderTypes.Location];\n\t}\n\n\t/**\n\t * Get a stream header without the entries.\n\t * @param id The id of the stream to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.includeEntries Whether to include the entries, defaults to false.\n\t * @param options.includeDeleted Whether to include deleted entries, defaults to false.\n\t * @param options.verifyStream Should the stream be verified, defaults to false.\n\t * @param options.verifyEntries Should the entries be verified, defaults to false.\n\t * @returns The stream and entries if found.\n\t * @throws NotFoundError if the stream is not found\n\t */\n\tpublic async get(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tincludeEntries?: boolean;\n\t\t\tincludeDeleted?: boolean;\n\t\t\tverifyStream?: boolean;\n\t\t\tverifyEntries?: boolean;\n\t\t}\n\t): Promise<IAuditableItemStream> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamGetRequest,\n\t\t\tIAuditableItemStreamGetResponse\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\tincludeEntries: Coerce.string(options?.includeEntries),\n\t\t\t\tincludeDeleted: Coerce.string(options?.includeDeleted),\n\t\t\t\tverifyStream: Coerce.string(options?.verifyStream),\n\t\t\t\tverifyEntries: Coerce.string(options?.verifyEntries)\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Update a stream.\n\t * @param stream The stream to update.\n\t * @param stream.id The id of the stream to update.\n\t * @param stream.annotationObject The object for the stream as JSON-LD.\n\t * @returns Nothing.\n\t */\n\tpublic async update(stream: { id: string; annotationObject?: IJsonLdNodeObject }): Promise<void> {\n\t\tGuards.object(AuditableItemStreamRestClient.CLASS_NAME, nameof(stream), stream);\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(stream.id), stream.id);\n\n\t\tconst { id, annotationObject } = stream;\n\t\tawait this.fetch<IAuditableItemStreamUpdateRequest, INoContentResponse>(\"/:id\", \"PUT\", {\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t},\n\t\t\tbody: {\n\t\t\t\tannotationObject\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Delete the stream.\n\t * @param id The id of the stream to remove.\n\t * @returns Nothing.\n\t */\n\tpublic async remove(id: string): Promise<void> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tawait this.fetch<IAuditableItemStreamDeleteRequest, INoContentResponse>(\"/:id\", \"DELETE\", {\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Query all the streams, will not return entries.\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 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\tconditions?: IComparator[],\n\t\torderBy?: keyof Pick<IAuditableItemStream, \"dateCreated\" | \"dateModified\">,\n\t\torderByDirection?: SortDirection,\n\t\tproperties?: (keyof IAuditableItemStream)[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAuditableItemStreamList;\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamListRequest,\n\t\t\tIAuditableItemStreamListResponse\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\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\t/**\n\t * Create an entry in the stream.\n\t * @param id The id of the stream to update.\n\t * @param entryObject The object for the stream as JSON-LD.\n\t * @returns The id of the created entry, if not provided.\n\t */\n\tpublic async createEntry(id: string, entryObject: IJsonLdNodeObject): Promise<string> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<IAuditableItemStreamCreateEntryRequest, ICreatedResponse>(\n\t\t\t\"/:id\",\n\t\t\t\"POST\",\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\t\tentryObject\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.headers[HeaderTypes.Location];\n\t}\n\n\t/**\n\t * Get the entry from the stream.\n\t * @param id The id of the stream to get.\n\t * @param entryId The id of the stream entry to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.verifyEntry Should the entry be verified, defaults to false.\n\t * @returns The stream and entries if found.\n\t * @throws NotFoundError if the stream is not found.\n\t */\n\tpublic async getEntry(\n\t\tid: string,\n\t\tentryId: string,\n\t\toptions?: {\n\t\t\tverifyEntry?: boolean;\n\t\t}\n\t): Promise<IAuditableItemStreamEntry> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(entryId), entryId);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamGetEntryRequest,\n\t\t\tIAuditableItemStreamGetEntryResponse\n\t\t>(\"/:id/:entryId\", \"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\tverifyEntry: Coerce.string(options?.verifyEntry)\n\t\t\t},\n\t\t\tpathParams: {\n\t\t\t\tid,\n\t\t\t\tentryId\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Get the entry object from the stream.\n\t * @param id The id of the stream to get.\n\t * @param entryId The id of the stream entry to get.\n\t * @returns The stream and entries if found.\n\t * @throws NotFoundError if the stream is not found.\n\t */\n\tpublic async getEntryObject(id: string, entryId: string): Promise<IJsonLdNodeObject> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(entryId), entryId);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamGetEntryObjectRequest,\n\t\t\tIAuditableItemStreamGetEntryObjectResponse\n\t\t>(\"/:id/:entryId/object\", \"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\tentryId\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Update an entry in the stream.\n\t * @param id The id of the stream to update.\n\t * @param entryId The id of the entry to update.\n\t * @param entryObject The object for the entry as JSON-LD.\n\t * @returns Nothing.\n\t */\n\tpublic async updateEntry(\n\t\tid: string,\n\t\tentryId: string,\n\t\tentryObject: IJsonLdNodeObject\n\t): Promise<void> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(entryId), entryId);\n\n\t\tawait this.fetch<IAuditableItemStreamUpdateEntryRequest, INoContentResponse>(\n\t\t\t\"/:id/:entryId\",\n\t\t\t\"PUT\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid,\n\t\t\t\t\tentryId\n\t\t\t\t},\n\t\t\t\tbody: {\n\t\t\t\t\tentryObject\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Remove from the stream.\n\t * @param id The id of the stream to remove from.\n\t * @param entryId The id of the entry to remove.\n\t * @returns Nothing.\n\t */\n\tpublic async removeEntry(id: string, entryId: string): Promise<void> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(entryId), entryId);\n\n\t\tawait this.fetch<IAuditableItemStreamDeleteEntryRequest, INoContentResponse>(\n\t\t\t\"/:id/:entryId\",\n\t\t\t\"DELETE\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid,\n\t\t\t\t\tentryId\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Get the entries for the stream.\n\t * @param id The id of the stream to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.conditions The conditions to filter the stream.\n\t * @param options.includeDeleted Whether to include deleted entries, defaults to false.\n\t * @param options.verifyEntries Should the entries be verified, defaults to false.\n\t * @param options.limit How many entries to return.\n\t * @param options.cursor Cursor to use for next chunk of data.\n\t * @param options.order Retrieve the entries in ascending/descending time order, defaults to Ascending.\n\t * @returns The stream and entries if found.\n\t * @throws NotFoundError if the stream is not found.\n\t */\n\tpublic async getEntries(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tconditions?: IComparator[];\n\t\t\tincludeDeleted?: boolean;\n\t\t\tverifyEntries?: boolean;\n\t\t\tlimit?: number;\n\t\t\tcursor?: string;\n\t\t\torder?: SortDirection;\n\t\t}\n\t): Promise<{\n\t\tentries: IAuditableItemStreamEntryList;\n\t\tcursor?: string;\n\t}> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamListEntriesRequest,\n\t\t\tIAuditableItemStreamListEntriesResponse\n\t\t>(\"/:id/entries\", \"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\tconditions: HttpParameterHelper.objectToString(options?.conditions),\n\t\t\t\tincludeDeleted: Coerce.string(options?.includeDeleted),\n\t\t\t\tverifyEntries: Coerce.string(options?.verifyEntries),\n\t\t\t\tlimit: Coerce.string(options?.limit),\n\t\t\t\tcursor: options?.cursor,\n\t\t\t\torder: options?.order\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\t/**\n\t * Get the entry objects for the stream.\n\t * @param id The id of the stream to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.conditions The conditions to filter the stream.\n\t * @param options.includeDeleted Whether to include deleted entries, defaults to false.\n\t * @param options.limit How many entries to return.\n\t * @param options.cursor Cursor to use for next chunk of data.\n\t * @param options.order Retrieve the entries in ascending/descending time order, defaults to Ascending.\n\t * @returns The stream and entries if found.\n\t * @throws NotFoundError if the stream is not found.\n\t */\n\tpublic async getEntryObjects(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tconditions?: IComparator[];\n\t\t\tincludeDeleted?: boolean;\n\t\t\tlimit?: number;\n\t\t\tcursor?: string;\n\t\t\torder?: SortDirection;\n\t\t}\n\t): Promise<{\n\t\tentries: IAuditableItemStreamEntryObjectList;\n\t\tcursor?: string;\n\t}> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamListEntryObjectsRequest,\n\t\t\tIAuditableItemStreamListEntryObjectsResponse\n\t\t>(\"/:id/entries/objects\", \"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\tconditions: HttpParameterHelper.objectToString(options?.conditions),\n\t\t\t\tincludeDeleted: Coerce.string(options?.includeDeleted),\n\t\t\t\tlimit: Coerce.string(options?.limit),\n\t\t\t\tcursor: Coerce.string(options?.cursor),\n\t\t\t\torder: options?.order\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\t/**\n\t * Remove the verifiable storage for the stream and entries, not supported on client.\n\t * @param id The id of the stream to remove the storage from.\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(AuditableItemStreamRestClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"removeVerifiable\"\n\t\t});\n\t}\n}\n"]}
1
+ {"version":3,"file":"auditableItemStreamRestClient.js","sourceRoot":"","sources":["../../src/auditableItemStreamRestClient.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,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAInE,OAAO,EAAE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,QAAc,EAAE,CAAC,CAAC;QAE7E,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAG/B,sBAAsB,EAAE,KAAK,EAAE;YAChC,OAAO,EAAE;gBACR,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM;aACtC;YACD,UAAU,EAAE;gBACX,EAAE;aACF;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,mBAAmB,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,CAAC;gBACnE,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC;gBACtD,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;gBACpC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC;gBACtC,KAAK,EAAE,OAAO,EAAE,KAAK;aACrB;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;IAED;;;;;OAKG;IACI,KAAK,CAAC,gBAAgB,CAAC,EAAU;QACvC,MAAM,IAAI,iBAAiB,CAAC,6BAA6B,CAAC,UAAU,EAAE,sBAAsB,EAAE;YAC7F,UAAU,EAAE,kBAAkB;SAC9B,CAAC,CAAC;IACJ,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\tIAuditableItemStream,\n\tIAuditableItemStreamComponent,\n\tIAuditableItemStreamCreateEntryRequest,\n\tIAuditableItemStreamCreateRequest,\n\tIAuditableItemStreamDeleteEntryRequest,\n\tIAuditableItemStreamDeleteRequest,\n\tIAuditableItemStreamEntry,\n\tIAuditableItemStreamEntryList,\n\tIAuditableItemStreamEntryObjectList,\n\tIAuditableItemStreamGetEntryObjectRequest,\n\tIAuditableItemStreamGetEntryObjectResponse,\n\tIAuditableItemStreamGetEntryRequest,\n\tIAuditableItemStreamGetEntryResponse,\n\tIAuditableItemStreamGetRequest,\n\tIAuditableItemStreamGetResponse,\n\tIAuditableItemStreamList,\n\tIAuditableItemStreamListEntriesRequest,\n\tIAuditableItemStreamListEntriesResponse,\n\tIAuditableItemStreamListEntryObjectsRequest,\n\tIAuditableItemStreamListEntryObjectsResponse,\n\tIAuditableItemStreamListRequest,\n\tIAuditableItemStreamListResponse,\n\tIAuditableItemStreamUpdateEntryRequest,\n\tIAuditableItemStreamUpdateRequest\n} from \"@twin.org/auditable-item-stream-models\";\nimport { Coerce, Guards, NotSupportedError } 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 stream through to REST endpoints.\n */\nexport class AuditableItemStreamRestClient\n\textends BaseRestClient\n\timplements IAuditableItemStreamComponent\n{\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<AuditableItemStreamRestClient>();\n\n\t/**\n\t * Create a new instance of AuditableItemStreamRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(nameof<AuditableItemStreamRestClient>(), config, \"auditable-item-stream\");\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 AuditableItemStreamRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Create a new stream.\n\t * @param stream The stream to create.\n\t * @param stream.annotationObject The object for the stream as JSON-LD.\n\t * @param stream.entries Entries to store in the stream.\n\t * @param options Options for creating the stream.\n\t * @param options.immutableInterval After how many entries do we add immutable checks, defaults to service configured value.\n\t * A value of 0 will disable integrity checks, 1 will be every item, or any other integer for an interval.\n\t * @returns The id of the new stream item.\n\t */\n\tpublic async create(\n\t\tstream: {\n\t\t\tannotationObject?: IJsonLdNodeObject;\n\t\t\tentries?: {\n\t\t\t\tentryObject: IJsonLdNodeObject;\n\t\t\t}[];\n\t\t},\n\t\toptions?: {\n\t\t\timmutableInterval?: number;\n\t\t}\n\t): Promise<string> {\n\t\tGuards.object(AuditableItemStreamRestClient.CLASS_NAME, nameof(stream), stream);\n\t\tconst response = await this.fetch<IAuditableItemStreamCreateRequest, ICreatedResponse>(\n\t\t\t\"/\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\tbody: {\n\t\t\t\t\t...stream,\n\t\t\t\t\timmutableInterval: options?.immutableInterval\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.headers[HeaderTypes.Location];\n\t}\n\n\t/**\n\t * Get a stream header without the entries.\n\t * @param id The id of the stream to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.includeEntries Whether to include the entries, defaults to false.\n\t * @param options.includeDeleted Whether to include deleted entries, defaults to false.\n\t * @param options.verifyStream Should the stream be verified, defaults to false.\n\t * @param options.verifyEntries Should the entries be verified, defaults to false.\n\t * @returns The stream and entries if found.\n\t * @throws NotFoundError if the stream is not found\n\t */\n\tpublic async get(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tincludeEntries?: boolean;\n\t\t\tincludeDeleted?: boolean;\n\t\t\tverifyStream?: boolean;\n\t\t\tverifyEntries?: boolean;\n\t\t}\n\t): Promise<IAuditableItemStream> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamGetRequest,\n\t\t\tIAuditableItemStreamGetResponse\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\tincludeEntries: Coerce.string(options?.includeEntries),\n\t\t\t\tincludeDeleted: Coerce.string(options?.includeDeleted),\n\t\t\t\tverifyStream: Coerce.string(options?.verifyStream),\n\t\t\t\tverifyEntries: Coerce.string(options?.verifyEntries)\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Update a stream.\n\t * @param stream The stream to update.\n\t * @param stream.id The id of the stream to update.\n\t * @param stream.annotationObject The object for the stream as JSON-LD.\n\t * @returns Nothing.\n\t */\n\tpublic async update(stream: { id: string; annotationObject?: IJsonLdNodeObject }): Promise<void> {\n\t\tGuards.object(AuditableItemStreamRestClient.CLASS_NAME, nameof(stream), stream);\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(stream.id), stream.id);\n\n\t\tconst { id, annotationObject } = stream;\n\t\tawait this.fetch<IAuditableItemStreamUpdateRequest, INoContentResponse>(\"/:id\", \"PUT\", {\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t},\n\t\t\tbody: {\n\t\t\t\tannotationObject\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Delete the stream.\n\t * @param id The id of the stream to remove.\n\t * @returns Nothing.\n\t */\n\tpublic async remove(id: string): Promise<void> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tawait this.fetch<IAuditableItemStreamDeleteRequest, INoContentResponse>(\"/:id\", \"DELETE\", {\n\t\t\tpathParams: {\n\t\t\t\tid\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Query all the streams, will not return entries.\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 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\tconditions?: IComparator[],\n\t\torderBy?: keyof Pick<IAuditableItemStream, \"dateCreated\" | \"dateModified\">,\n\t\torderByDirection?: SortDirection,\n\t\tproperties?: (keyof IAuditableItemStream)[],\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\tentries: IAuditableItemStreamList;\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamListRequest,\n\t\t\tIAuditableItemStreamListResponse\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\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\t/**\n\t * Create an entry in the stream.\n\t * @param id The id of the stream to update.\n\t * @param entryObject The object for the stream as JSON-LD.\n\t * @returns The id of the created entry, if not provided.\n\t */\n\tpublic async createEntry(id: string, entryObject: IJsonLdNodeObject): Promise<string> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<IAuditableItemStreamCreateEntryRequest, ICreatedResponse>(\n\t\t\t\"/:id/entries\",\n\t\t\t\"POST\",\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\t\tentryObject\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn response.headers[HeaderTypes.Location];\n\t}\n\n\t/**\n\t * Get the entry from the stream.\n\t * @param id The id of the stream to get.\n\t * @param entryId The id of the stream entry to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.verifyEntry Should the entry be verified, defaults to false.\n\t * @returns The stream and entries if found.\n\t * @throws NotFoundError if the stream is not found.\n\t */\n\tpublic async getEntry(\n\t\tid: string,\n\t\tentryId: string,\n\t\toptions?: {\n\t\t\tverifyEntry?: boolean;\n\t\t}\n\t): Promise<IAuditableItemStreamEntry> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(entryId), entryId);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamGetEntryRequest,\n\t\t\tIAuditableItemStreamGetEntryResponse\n\t\t>(\"/:id/entries/:entryId\", \"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\tverifyEntry: Coerce.string(options?.verifyEntry)\n\t\t\t},\n\t\t\tpathParams: {\n\t\t\t\tid,\n\t\t\t\tentryId\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Get the entry object from the stream.\n\t * @param id The id of the stream to get.\n\t * @param entryId The id of the stream entry to get.\n\t * @returns The stream and entries if found.\n\t * @throws NotFoundError if the stream is not found.\n\t */\n\tpublic async getEntryObject(id: string, entryId: string): Promise<IJsonLdNodeObject> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(entryId), entryId);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamGetEntryObjectRequest,\n\t\t\tIAuditableItemStreamGetEntryObjectResponse\n\t\t>(\"/:id/entries/:entryId/object\", \"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\tentryId\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Update an entry in the stream.\n\t * @param id The id of the stream to update.\n\t * @param entryId The id of the entry to update.\n\t * @param entryObject The object for the entry as JSON-LD.\n\t * @returns Nothing.\n\t */\n\tpublic async updateEntry(\n\t\tid: string,\n\t\tentryId: string,\n\t\tentryObject: IJsonLdNodeObject\n\t): Promise<void> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(entryId), entryId);\n\n\t\tawait this.fetch<IAuditableItemStreamUpdateEntryRequest, INoContentResponse>(\n\t\t\t\"/:id/entries/:entryId\",\n\t\t\t\"PUT\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid,\n\t\t\t\t\tentryId\n\t\t\t\t},\n\t\t\t\tbody: {\n\t\t\t\t\tentryObject\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Remove from the stream.\n\t * @param id The id of the stream to remove from.\n\t * @param entryId The id of the entry to remove.\n\t * @returns Nothing.\n\t */\n\tpublic async removeEntry(id: string, entryId: string): Promise<void> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(entryId), entryId);\n\n\t\tawait this.fetch<IAuditableItemStreamDeleteEntryRequest, INoContentResponse>(\n\t\t\t\"/:id/entries/:entryId\",\n\t\t\t\"DELETE\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid,\n\t\t\t\t\tentryId\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Get the entries for the stream.\n\t * @param id The id of the stream to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.conditions The conditions to filter the stream.\n\t * @param options.includeDeleted Whether to include deleted entries, defaults to false.\n\t * @param options.verifyEntries Should the entries be verified, defaults to false.\n\t * @param options.limit How many entries to return.\n\t * @param options.cursor Cursor to use for next chunk of data.\n\t * @param options.order Retrieve the entries in ascending/descending time order, defaults to Ascending.\n\t * @returns The stream and entries if found.\n\t * @throws NotFoundError if the stream is not found.\n\t */\n\tpublic async getEntries(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tconditions?: IComparator[];\n\t\t\tincludeDeleted?: boolean;\n\t\t\tverifyEntries?: boolean;\n\t\t\tlimit?: number;\n\t\t\tcursor?: string;\n\t\t\torder?: SortDirection;\n\t\t}\n\t): Promise<{\n\t\tentries: IAuditableItemStreamEntryList;\n\t\tcursor?: string;\n\t}> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamListEntriesRequest,\n\t\t\tIAuditableItemStreamListEntriesResponse\n\t\t>(\"/:id/entries\", \"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\tconditions: HttpParameterHelper.objectToString(options?.conditions),\n\t\t\t\tincludeDeleted: Coerce.string(options?.includeDeleted),\n\t\t\t\tverifyEntries: Coerce.string(options?.verifyEntries),\n\t\t\t\tlimit: Coerce.string(options?.limit),\n\t\t\t\tcursor: options?.cursor,\n\t\t\t\torder: options?.order\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\t/**\n\t * Get the entry objects for the stream.\n\t * @param id The id of the stream to get.\n\t * @param options Additional options for the get operation.\n\t * @param options.conditions The conditions to filter the stream.\n\t * @param options.includeDeleted Whether to include deleted entries, defaults to false.\n\t * @param options.limit How many entries to return.\n\t * @param options.cursor Cursor to use for next chunk of data.\n\t * @param options.order Retrieve the entries in ascending/descending time order, defaults to Ascending.\n\t * @returns The stream and entries if found.\n\t * @throws NotFoundError if the stream is not found.\n\t */\n\tpublic async getEntryObjects(\n\t\tid: string,\n\t\toptions?: {\n\t\t\tconditions?: IComparator[];\n\t\t\tincludeDeleted?: boolean;\n\t\t\tlimit?: number;\n\t\t\tcursor?: string;\n\t\t\torder?: SortDirection;\n\t\t}\n\t): Promise<{\n\t\tentries: IAuditableItemStreamEntryObjectList;\n\t\tcursor?: string;\n\t}> {\n\t\tGuards.stringValue(AuditableItemStreamRestClient.CLASS_NAME, nameof(id), id);\n\n\t\tconst response = await this.fetch<\n\t\t\tIAuditableItemStreamListEntryObjectsRequest,\n\t\t\tIAuditableItemStreamListEntryObjectsResponse\n\t\t>(\"/:id/entries/objects\", \"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\tconditions: HttpParameterHelper.objectToString(options?.conditions),\n\t\t\t\tincludeDeleted: Coerce.string(options?.includeDeleted),\n\t\t\t\tlimit: Coerce.string(options?.limit),\n\t\t\t\tcursor: Coerce.string(options?.cursor),\n\t\t\t\torder: options?.order\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\t/**\n\t * Remove the verifiable storage for the stream and entries, not supported on client.\n\t * @param id The id of the stream to remove the storage from.\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(AuditableItemStreamRestClient.CLASS_NAME, \"notSupportedOnClient\", {\n\t\t\tmethodName: \"removeVerifiable\"\n\t\t});\n\t}\n}\n"]}
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @twin.org/auditable-item-stream-rest-client - Changelog
2
2
 
3
+ ## [0.0.3-next.9](https://github.com/twinfoundation/auditable-item-stream/compare/auditable-item-stream-rest-client-v0.0.3-next.8...auditable-item-stream-rest-client-v0.0.3-next.9) (2026-02-12)
4
+
5
+
6
+ ### Features
7
+
8
+ * add number of items ([#47](https://github.com/twinfoundation/auditable-item-stream/issues/47)) ([149fc9f](https://github.com/twinfoundation/auditable-item-stream/commit/149fc9f505a86af0578551c09f7e8aa763f01be7))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/auditable-item-stream-models bumped from 0.0.3-next.8 to 0.0.3-next.9
16
+
3
17
  ## [0.0.3-next.8](https://github.com/twinfoundation/auditable-item-stream/compare/auditable-item-stream-rest-client-v0.0.3-next.7...auditable-item-stream-rest-client-v0.0.3-next.8) (2026-02-11)
4
18
 
5
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/auditable-item-stream-rest-client",
3
- "version": "0.0.3-next.8",
3
+ "version": "0.0.3-next.9",
4
4
  "description": "Auditable Item Stream contract implementation which can connect to REST endpoints",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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-stream-models": "0.0.3-next.8",
19
+ "@twin.org/auditable-item-stream-models": "0.0.3-next.9",
20
20
  "@twin.org/core": "next",
21
21
  "@twin.org/data-json-ld": "next",
22
22
  "@twin.org/entity": "next",