@twin.org/data-processing-rest-client 0.0.3-next.2 → 0.9.0-next.1

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.
@@ -27,7 +27,7 @@ export class DataProcessingRestClient extends BaseRestClient {
27
27
  /**
28
28
  * Set an extraction rule group.
29
29
  * @param ruleGroup The rule group to store.
30
- * @returns Nothing.
30
+ * @returns A promise that resolves when the rule group has been stored.
31
31
  */
32
32
  async ruleGroupSet(ruleGroup) {
33
33
  Guards.object(DataProcessingRestClient.CLASS_NAME, "ruleGroup", ruleGroup);
@@ -61,7 +61,7 @@ export class DataProcessingRestClient extends BaseRestClient {
61
61
  /**
62
62
  * Remove a rule group.
63
63
  * @param ruleGroupId The id of the rule group to remove.
64
- * @returns Nothing.
64
+ * @returns A promise that resolves when the rule group has been removed.
65
65
  */
66
66
  async ruleGroupRemove(ruleGroupId) {
67
67
  Guards.stringValue(DataProcessingRestClient.CLASS_NAME, "ruleGroupId", ruleGroupId);
@@ -1 +1 @@
1
- {"version":3,"file":"dataProcessingRestClient.js","sourceRoot":"","sources":["../../src/dataProcessingRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAkBzE;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IAC3D;;OAEG;IACI,MAAM,CAAU,UAAU,8BAA8C;IAE/E;;;OAGG;IACH,YAAY,MAA6B;QACxC,KAAK,CAAC,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACvE,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,wBAAwB,CAAC,UAAU,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,YAAY,CAA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A Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport type { IBaseRestClientConfig, INoContentResponse } from \"@twin.org/api-models\";\nimport { Coerce, Converter, Guards, ObjectHelper } from \"@twin.org/core\";\nimport type {\n\tIDataProcessingComponent,\n\tIDataProcessingConvertRequest,\n\tIDataProcessingConvertResponse,\n\tIDataProcessingExtractRequest,\n\tIDataProcessingExtractResponse,\n\tIDataProcessingRuleGroupGetRequest,\n\tIDataProcessingRuleGroupGetResponse,\n\tIDataProcessingRuleGroupListRequest,\n\tIDataProcessingRuleGroupListResponse,\n\tIDataProcessingRuleGroupRemoveRequest,\n\tIDataProcessingRuleGroupSetRequest,\n\tIRule,\n\tIRuleGroup\n} from \"@twin.org/data-processing-models\";\nimport { nameof } from \"@twin.org/nameof\";\n\n/**\n * Client for performing data processing through to REST endpoints.\n */\nexport class DataProcessingRestClient extends BaseRestClient implements IDataProcessingComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DataProcessingRestClient>();\n\n\t/**\n\t * Create a new instance of DataProcessingRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(DataProcessingRestClient.CLASS_NAME, config, \"data-processing\");\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 DataProcessingRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Set an extraction rule group.\n\t * @param ruleGroup The rule group to store.\n\t * @returns Nothing.\n\t */\n\tpublic async ruleGroupSet(ruleGroup: IRuleGroup): Promise<void> {\n\t\tGuards.object<IRuleGroup>(DataProcessingRestClient.CLASS_NAME, nameof(ruleGroup), ruleGroup);\n\t\tGuards.stringValue(DataProcessingRestClient.CLASS_NAME, nameof(ruleGroup.id), ruleGroup.id);\n\t\tGuards.stringValue(\n\t\t\tDataProcessingRestClient.CLASS_NAME,\n\t\t\tnameof(ruleGroup.label),\n\t\t\truleGroup.label\n\t\t);\n\t\tGuards.array<IRule>(\n\t\t\tDataProcessingRestClient.CLASS_NAME,\n\t\t\tnameof(ruleGroup.rules),\n\t\t\truleGroup.rules\n\t\t);\n\n\t\tawait this.fetch<IDataProcessingRuleGroupSetRequest, INoContentResponse>(\n\t\t\t\"/rule-group/:id\",\n\t\t\t\"PUT\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid: ruleGroup.id\n\t\t\t\t},\n\t\t\t\tbody: {\n\t\t\t\t\tlabel: ruleGroup.label,\n\t\t\t\t\trules: ruleGroup.rules\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Get a rule group for extraction.\n\t * @param ruleGroupId The id of the rule group to get.\n\t * @returns The rule group.\n\t */\n\tpublic async ruleGroupGet(ruleGroupId: string): Promise<IRuleGroup> {\n\t\tGuards.stringValue(DataProcessingRestClient.CLASS_NAME, nameof(ruleGroupId), ruleGroupId);\n\n\t\tconst response = await this.fetch<\n\t\t\tIDataProcessingRuleGroupGetRequest,\n\t\t\tIDataProcessingRuleGroupGetResponse\n\t\t>(\"/rule-group/:id\", \"GET\", {\n\t\t\tpathParams: {\n\t\t\t\tid: ruleGroupId\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Remove a rule group.\n\t * @param ruleGroupId The id of the rule group to remove.\n\t * @returns Nothing.\n\t */\n\tpublic async ruleGroupRemove(ruleGroupId: string): Promise<void> {\n\t\tGuards.stringValue(DataProcessingRestClient.CLASS_NAME, nameof(ruleGroupId), ruleGroupId);\n\n\t\tawait this.fetch<IDataProcessingRuleGroupRemoveRequest, INoContentResponse>(\n\t\t\t\"/rule-group/:id\",\n\t\t\t\"DELETE\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid: ruleGroupId\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Extracts data from the provided input.\n\t * @param ruleGroupId The id of the rule group to use to extract data.\n\t * @param data The data to extract from.\n\t * @param overrideExtractorType An optional override for the extractor type.\n\t * @param overrideMimeType An optional override for the mime type for conversion, will auto detect if not provided.\n\t * @returns The extracted data.\n\t */\n\tpublic async extract(\n\t\truleGroupId: string,\n\t\tdata: Uint8Array,\n\t\toverrideExtractorType?: string,\n\t\toverrideMimeType?: string\n\t): Promise<unknown> {\n\t\tGuards.stringValue(DataProcessingRestClient.CLASS_NAME, nameof(ruleGroupId), ruleGroupId);\n\t\tGuards.uint8Array(DataProcessingRestClient.CLASS_NAME, nameof(data), data);\n\n\t\tconst result = await this.fetch<IDataProcessingExtractRequest, IDataProcessingExtractResponse>(\n\t\t\t\"/extract\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\tbody: {\n\t\t\t\t\truleGroupId,\n\t\t\t\t\tdata: Converter.bytesToBase64(data),\n\t\t\t\t\toverrideExtractorType,\n\t\t\t\t\toverrideMimeType\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn ObjectHelper.fromExtended(result.body);\n\t}\n\n\t/**\n\t * Converts data from the provided input to a structured JSON document.\n\t * @param data The data to convert.\n\t * @param overrideMimeType An optional override for the mime type, will auto detect if empty.\n\t * @returns The converted data.\n\t */\n\tpublic async convert(data: Uint8Array, overrideMimeType?: string): Promise<unknown> {\n\t\tGuards.uint8Array(DataProcessingRestClient.CLASS_NAME, nameof(data), data);\n\n\t\tconst result = await this.fetch<IDataProcessingConvertRequest, IDataProcessingConvertResponse>(\n\t\t\t\"/convert\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\tbody: {\n\t\t\t\t\tdata: Converter.bytesToBase64(data),\n\t\t\t\t\toverrideMimeType\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn ObjectHelper.fromExtended(result.body);\n\t}\n\n\t/**\n\t * Query the rule group entries.\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 All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t */\n\tpublic async query(\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The entities, which can be partial if a limited keys list was provided.\n\t\t */\n\t\tentities: IRuleGroup[];\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<\n\t\t\tIDataProcessingRuleGroupListRequest,\n\t\t\tIDataProcessingRuleGroupListResponse\n\t\t>(\"/rule-group\", \"GET\", {\n\t\t\tquery: {\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n}\n"]}
1
+ {"version":3,"file":"dataProcessingRestClient.js","sourceRoot":"","sources":["../../src/dataProcessingRestClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAkBzE;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IAC3D;;OAEG;IACI,MAAM,CAAU,UAAU,8BAA8C;IAE/E;;;OAGG;IACH,YAAY,MAA6B;QACxC,KAAK,CAAC,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACvE,CAAC;IAED;;;OAGG;IACI,SAAS;QACf,OAAO,wBAAwB,CAAC,UAAU,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,YAAY,CAAC,SAAqB;QAC9C,MAAM,CAAC,MAAM,CAAa,wBAAwB,CAAC,UAAU,eAAqB,SAAS,CAAC,CAAC;QAC7F,MAAM,CAAC,WAAW,CAAC,wBAAwB,CAAC,UAAU,kBAAwB,SAAS,CAAC,EA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AAwB,CAAC,UAAU,UAAgB,IAAI,CAAC,CAAC;QAE3E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAC9B,UAAU,EACV,MAAM,EACN;YACC,IAAI,EAAE;gBACL,WAAW;gBACX,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC;gBACnC,qBAAqB;gBACrB,gBAAgB;aAChB;SACD,CACD,CAAC;QAEF,OAAO,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO,CAAC,IAAgB,EAAE,gBAAyB;QAC/D,MAAM,CAAC,UAAU,CAAC,wBAAwB,CAAC,UAAU,UAAgB,IAAI,CAAC,CAAC;QAE3E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAC9B,UAAU,EACV,MAAM,EACN;YACC,IAAI,EAAE;gBACL,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC;gBACnC,gBAAgB;aAChB;SACD,CACD,CAAC;QAEF,OAAO,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,KAAK,CACjB,MAAe,EACf,KAAc;QAWd,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAG/B,aAAa,EAAE,KAAK,EAAE;YACvB,KAAK,EAAE;gBACN,MAAM;gBACN,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;aAC3B;SACD,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseRestClient } from \"@twin.org/api-core\";\nimport type { IBaseRestClientConfig, INoContentResponse } from \"@twin.org/api-models\";\nimport { Coerce, Converter, Guards, ObjectHelper } from \"@twin.org/core\";\nimport type {\n\tIDataProcessingComponent,\n\tIDataProcessingConvertRequest,\n\tIDataProcessingConvertResponse,\n\tIDataProcessingExtractRequest,\n\tIDataProcessingExtractResponse,\n\tIDataProcessingRuleGroupGetRequest,\n\tIDataProcessingRuleGroupGetResponse,\n\tIDataProcessingRuleGroupListRequest,\n\tIDataProcessingRuleGroupListResponse,\n\tIDataProcessingRuleGroupRemoveRequest,\n\tIDataProcessingRuleGroupSetRequest,\n\tIRule,\n\tIRuleGroup\n} from \"@twin.org/data-processing-models\";\nimport { nameof } from \"@twin.org/nameof\";\n\n/**\n * Client for performing data processing through to REST endpoints.\n */\nexport class DataProcessingRestClient extends BaseRestClient implements IDataProcessingComponent {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<DataProcessingRestClient>();\n\n\t/**\n\t * Create a new instance of DataProcessingRestClient.\n\t * @param config The configuration for the client.\n\t */\n\tconstructor(config: IBaseRestClientConfig) {\n\t\tsuper(DataProcessingRestClient.CLASS_NAME, config, \"data-processing\");\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 DataProcessingRestClient.CLASS_NAME;\n\t}\n\n\t/**\n\t * Set an extraction rule group.\n\t * @param ruleGroup The rule group to store.\n\t * @returns A promise that resolves when the rule group has been stored.\n\t */\n\tpublic async ruleGroupSet(ruleGroup: IRuleGroup): Promise<void> {\n\t\tGuards.object<IRuleGroup>(DataProcessingRestClient.CLASS_NAME, nameof(ruleGroup), ruleGroup);\n\t\tGuards.stringValue(DataProcessingRestClient.CLASS_NAME, nameof(ruleGroup.id), ruleGroup.id);\n\t\tGuards.stringValue(\n\t\t\tDataProcessingRestClient.CLASS_NAME,\n\t\t\tnameof(ruleGroup.label),\n\t\t\truleGroup.label\n\t\t);\n\t\tGuards.array<IRule>(\n\t\t\tDataProcessingRestClient.CLASS_NAME,\n\t\t\tnameof(ruleGroup.rules),\n\t\t\truleGroup.rules\n\t\t);\n\n\t\tawait this.fetch<IDataProcessingRuleGroupSetRequest, INoContentResponse>(\n\t\t\t\"/rule-group/:id\",\n\t\t\t\"PUT\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid: ruleGroup.id\n\t\t\t\t},\n\t\t\t\tbody: {\n\t\t\t\t\tlabel: ruleGroup.label,\n\t\t\t\t\trules: ruleGroup.rules\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Get a rule group for extraction.\n\t * @param ruleGroupId The id of the rule group to get.\n\t * @returns The rule group.\n\t */\n\tpublic async ruleGroupGet(ruleGroupId: string): Promise<IRuleGroup> {\n\t\tGuards.stringValue(DataProcessingRestClient.CLASS_NAME, nameof(ruleGroupId), ruleGroupId);\n\n\t\tconst response = await this.fetch<\n\t\t\tIDataProcessingRuleGroupGetRequest,\n\t\t\tIDataProcessingRuleGroupGetResponse\n\t\t>(\"/rule-group/:id\", \"GET\", {\n\t\t\tpathParams: {\n\t\t\t\tid: ruleGroupId\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n\n\t/**\n\t * Remove a rule group.\n\t * @param ruleGroupId The id of the rule group to remove.\n\t * @returns A promise that resolves when the rule group has been removed.\n\t */\n\tpublic async ruleGroupRemove(ruleGroupId: string): Promise<void> {\n\t\tGuards.stringValue(DataProcessingRestClient.CLASS_NAME, nameof(ruleGroupId), ruleGroupId);\n\n\t\tawait this.fetch<IDataProcessingRuleGroupRemoveRequest, INoContentResponse>(\n\t\t\t\"/rule-group/:id\",\n\t\t\t\"DELETE\",\n\t\t\t{\n\t\t\t\tpathParams: {\n\t\t\t\t\tid: ruleGroupId\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Extracts data from the provided input.\n\t * @param ruleGroupId The id of the rule group to use to extract data.\n\t * @param data The data to extract from.\n\t * @param overrideExtractorType An optional override for the extractor type.\n\t * @param overrideMimeType An optional override for the mime type for conversion, will auto detect if not provided.\n\t * @returns The extracted data.\n\t */\n\tpublic async extract(\n\t\truleGroupId: string,\n\t\tdata: Uint8Array,\n\t\toverrideExtractorType?: string,\n\t\toverrideMimeType?: string\n\t): Promise<unknown> {\n\t\tGuards.stringValue(DataProcessingRestClient.CLASS_NAME, nameof(ruleGroupId), ruleGroupId);\n\t\tGuards.uint8Array(DataProcessingRestClient.CLASS_NAME, nameof(data), data);\n\n\t\tconst result = await this.fetch<IDataProcessingExtractRequest, IDataProcessingExtractResponse>(\n\t\t\t\"/extract\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\tbody: {\n\t\t\t\t\truleGroupId,\n\t\t\t\t\tdata: Converter.bytesToBase64(data),\n\t\t\t\t\toverrideExtractorType,\n\t\t\t\t\toverrideMimeType\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn ObjectHelper.fromExtended(result.body);\n\t}\n\n\t/**\n\t * Converts data from the provided input to a structured JSON document.\n\t * @param data The data to convert.\n\t * @param overrideMimeType An optional override for the mime type, will auto detect if empty.\n\t * @returns The converted data.\n\t */\n\tpublic async convert(data: Uint8Array, overrideMimeType?: string): Promise<unknown> {\n\t\tGuards.uint8Array(DataProcessingRestClient.CLASS_NAME, nameof(data), data);\n\n\t\tconst result = await this.fetch<IDataProcessingConvertRequest, IDataProcessingConvertResponse>(\n\t\t\t\"/convert\",\n\t\t\t\"POST\",\n\t\t\t{\n\t\t\t\tbody: {\n\t\t\t\t\tdata: Converter.bytesToBase64(data),\n\t\t\t\t\toverrideMimeType\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn ObjectHelper.fromExtended(result.body);\n\t}\n\n\t/**\n\t * Query the rule group entries.\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 All the entities for the storage matching the conditions,\n\t * and a cursor which can be used to request more entities.\n\t */\n\tpublic async query(\n\t\tcursor?: string,\n\t\tlimit?: number\n\t): Promise<{\n\t\t/**\n\t\t * The entities, which can be partial if a limited keys list was provided.\n\t\t */\n\t\tentities: IRuleGroup[];\n\t\t/**\n\t\t * An optional cursor, when defined can be used to call find to get more entities.\n\t\t */\n\t\tcursor?: string;\n\t}> {\n\t\tconst response = await this.fetch<\n\t\t\tIDataProcessingRuleGroupListRequest,\n\t\t\tIDataProcessingRuleGroupListResponse\n\t\t>(\"/rule-group\", \"GET\", {\n\t\t\tquery: {\n\t\t\t\tcursor,\n\t\t\t\tlimit: Coerce.string(limit)\n\t\t\t}\n\t\t});\n\n\t\treturn response.body;\n\t}\n}\n"]}
@@ -22,7 +22,7 @@ export declare class DataProcessingRestClient extends BaseRestClient implements
22
22
  /**
23
23
  * Set an extraction rule group.
24
24
  * @param ruleGroup The rule group to store.
25
- * @returns Nothing.
25
+ * @returns A promise that resolves when the rule group has been stored.
26
26
  */
27
27
  ruleGroupSet(ruleGroup: IRuleGroup): Promise<void>;
28
28
  /**
@@ -34,7 +34,7 @@ export declare class DataProcessingRestClient extends BaseRestClient implements
34
34
  /**
35
35
  * Remove a rule group.
36
36
  * @param ruleGroupId The id of the rule group to remove.
37
- * @returns Nothing.
37
+ * @returns A promise that resolves when the rule group has been removed.
38
38
  */
39
39
  ruleGroupRemove(ruleGroupId: string): Promise<void>;
40
40
  /**
package/docs/changelog.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.0-next.1](https://github.com/iotaledger/twin-data-processing/compare/data-processing-rest-client-v0.9.0-next.0...data-processing-rest-client-v0.9.0-next.1) (2026-06-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * add context id features ([#25](https://github.com/iotaledger/twin-data-processing/issues/25)) ([2a2a955](https://github.com/iotaledger/twin-data-processing/commit/2a2a9559d54e8c703e97e2c05996e678416ef560))
9
+ * Add rule group query functionality ([#2](https://github.com/iotaledger/twin-data-processing/issues/2)) ([0fbbfb0](https://github.com/iotaledger/twin-data-processing/commit/0fbbfb065b6ecc293920b25f97ba011743105486))
10
+ * add validate-locales ([9af0874](https://github.com/iotaledger/twin-data-processing/commit/9af0874cd3f44a4cfca514dde8380f002e62337e))
11
+ * eslint migration to flat config ([a8138b0](https://github.com/iotaledger/twin-data-processing/commit/a8138b020ed58baeff162a822d4df207a6aeadc4))
12
+ * pass the mimeTypeOverride through the component extract method ([#9](https://github.com/iotaledger/twin-data-processing/issues/9)) ([a2b36de](https://github.com/iotaledger/twin-data-processing/commit/a2b36de5c19c56e4172d3f22b176aa83e1df84c8))
13
+ * typescript 6 update ([b67debb](https://github.com/iotaledger/twin-data-processing/commit/b67debb8aff83c0f3b179c6db038ed733f7308b1))
14
+ * update dependencies ([0b2e77d](https://github.com/iotaledger/twin-data-processing/commit/0b2e77d673ede6e92847ff0b50fdfcf4e9c08b3b))
15
+ * update dependencies ([21b8e80](https://github.com/iotaledger/twin-data-processing/commit/21b8e8007c87136a09f0a8e35ffde13a07ff4711))
16
+ * update framework core ([96f6e80](https://github.com/iotaledger/twin-data-processing/commit/96f6e8016a4ef0fb873f6775e750b4ab42e9f491))
17
+ * use shared store mechanism ([#6](https://github.com/iotaledger/twin-data-processing/issues/6)) ([6009228](https://github.com/iotaledger/twin-data-processing/commit/600922880acef07cc2f818dee7645c342929108b))
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * supporting array usage ([#20](https://github.com/iotaledger/twin-data-processing/issues/20)) ([d2c68cd](https://github.com/iotaledger/twin-data-processing/commit/d2c68cd3983622586cc073377545d6416b87a827))
23
+ * Update endpoint for fetching rule group list ([#3](https://github.com/iotaledger/twin-data-processing/issues/3)) ([919c1b4](https://github.com/iotaledger/twin-data-processing/commit/919c1b435e760251ca57f96ed9f701b08542f318))
24
+
25
+
26
+ ### Dependencies
27
+
28
+ * The following workspace dependencies were updated
29
+ * dependencies
30
+ * @twin.org/data-processing-models bumped from 0.9.0-next.0 to 0.9.0-next.1
31
+
32
+ ## [0.0.3-next.3](https://github.com/iotaledger/twin-data-processing/compare/data-processing-rest-client-v0.0.3-next.2...data-processing-rest-client-v0.0.3-next.3) (2026-05-20)
33
+
34
+
35
+ ### Features
36
+
37
+ * update dependencies ([0b2e77d](https://github.com/iotaledger/twin-data-processing/commit/0b2e77d673ede6e92847ff0b50fdfcf4e9c08b3b))
38
+
39
+
40
+ ### Dependencies
41
+
42
+ * The following workspace dependencies were updated
43
+ * dependencies
44
+ * @twin.org/data-processing-models bumped from 0.0.3-next.2 to 0.0.3-next.3
45
+
3
46
  ## [0.0.3-next.2](https://github.com/iotaledger/twin-data-processing/compare/data-processing-rest-client-v0.0.3-next.1...data-processing-rest-client-v0.0.3-next.2) (2026-05-11)
4
47
 
5
48
 
@@ -80,7 +80,7 @@ The rule group to store.
80
80
 
81
81
  `Promise`\<`void`\>
82
82
 
83
- Nothing.
83
+ A promise that resolves when the rule group has been stored.
84
84
 
85
85
  #### Implementation of
86
86
 
@@ -132,7 +132,7 @@ The id of the rule group to remove.
132
132
 
133
133
  `Promise`\<`void`\>
134
134
 
135
- Nothing.
135
+ A promise that resolves when the rule group has been removed.
136
136
 
137
137
  #### Implementation of
138
138
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@twin.org/data-processing-rest-client",
3
- "version": "0.0.3-next.2",
3
+ "version": "0.9.0-next.1",
4
4
  "description": "REST client for calling data processing service endpoints from applications",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/iotaledger/data-processing.git",
7
+ "url": "git+https://github.com/iotaledger/twin-data-processing.git",
8
8
  "directory": "packages/data-processing-rest-client"
9
9
  },
10
10
  "author": "martyn.janes@iota.org",
@@ -14,13 +14,13 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/api-core": "next",
18
- "@twin.org/api-models": "next",
19
- "@twin.org/core": "next",
20
- "@twin.org/data-processing-models": "0.0.3-next.2",
21
- "@twin.org/entity": "next",
22
- "@twin.org/nameof": "next",
23
- "@twin.org/web": "next"
17
+ "@twin.org/api-core": "0.9.0-next.1",
18
+ "@twin.org/api-models": "0.9.0-next.1",
19
+ "@twin.org/core": "0.9.0-next.1",
20
+ "@twin.org/data-processing-models": "0.9.0-next.1",
21
+ "@twin.org/entity": "0.9.0-next.1",
22
+ "@twin.org/nameof": "0.9.0-next.1",
23
+ "@twin.org/web": "0.9.0-next.1"
24
24
  },
25
25
  "main": "./dist/es/index.js",
26
26
  "types": "./dist/types/index.d.ts",
@@ -51,7 +51,7 @@
51
51
  "conversion"
52
52
  ],
53
53
  "bugs": {
54
- "url": "git+https://github.com/iotaledger/data-processing/issues"
54
+ "url": "git+https://github.com/iotaledger/twin-data-processing/issues"
55
55
  },
56
56
  "homepage": "https://twindev.org"
57
57
  }