@twin.org/data-processing-rest-client 0.0.1-next.9 → 0.0.2-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.
@@ -77,16 +77,18 @@ class DataProcessingClient extends apiCore.BaseRestClient {
77
77
  * @param ruleGroupId The id of the rule group to use to extract data.
78
78
  * @param data The data to extract from.
79
79
  * @param overrideExtractorType An optional override for the extractor type.
80
+ * @param overrideMimeType An optional override for the mime type for conversion, will auto detect if not provided.
80
81
  * @returns The extracted data.
81
82
  */
82
- async extract(ruleGroupId, data, overrideExtractorType) {
83
+ async extract(ruleGroupId, data, overrideExtractorType, overrideMimeType) {
83
84
  core.Guards.stringValue(this.CLASS_NAME, "ruleGroupId", ruleGroupId);
84
85
  core.Guards.uint8Array(this.CLASS_NAME, "data", data);
85
86
  const result = await this.fetch("/extract", "POST", {
86
87
  body: {
87
88
  ruleGroupId,
88
89
  data: core.Converter.bytesToBase64(data),
89
- overrideExtractorType
90
+ overrideExtractorType,
91
+ overrideMimeType
90
92
  }
91
93
  });
92
94
  return core.ObjectHelper.fromExtended(result.body);
@@ -75,16 +75,18 @@ class DataProcessingClient extends BaseRestClient {
75
75
  * @param ruleGroupId The id of the rule group to use to extract data.
76
76
  * @param data The data to extract from.
77
77
  * @param overrideExtractorType An optional override for the extractor type.
78
+ * @param overrideMimeType An optional override for the mime type for conversion, will auto detect if not provided.
78
79
  * @returns The extracted data.
79
80
  */
80
- async extract(ruleGroupId, data, overrideExtractorType) {
81
+ async extract(ruleGroupId, data, overrideExtractorType, overrideMimeType) {
81
82
  Guards.stringValue(this.CLASS_NAME, "ruleGroupId", ruleGroupId);
82
83
  Guards.uint8Array(this.CLASS_NAME, "data", data);
83
84
  const result = await this.fetch("/extract", "POST", {
84
85
  body: {
85
86
  ruleGroupId,
86
87
  data: Converter.bytesToBase64(data),
87
- overrideExtractorType
88
+ overrideExtractorType,
89
+ overrideMimeType
88
90
  }
89
91
  });
90
92
  return ObjectHelper.fromExtended(result.body);
@@ -37,9 +37,10 @@ export declare class DataProcessingClient extends BaseRestClient implements IDat
37
37
  * @param ruleGroupId The id of the rule group to use to extract data.
38
38
  * @param data The data to extract from.
39
39
  * @param overrideExtractorType An optional override for the extractor type.
40
+ * @param overrideMimeType An optional override for the mime type for conversion, will auto detect if not provided.
40
41
  * @returns The extracted data.
41
42
  */
42
- extract(ruleGroupId: string, data: Uint8Array, overrideExtractorType?: string): Promise<unknown>;
43
+ extract(ruleGroupId: string, data: Uint8Array, overrideExtractorType?: string, overrideMimeType?: string): Promise<unknown>;
43
44
  /**
44
45
  * Converts data from the provided input to a structured JSON document.
45
46
  * @param data The data to convert.
package/docs/changelog.md CHANGED
@@ -1,5 +1,140 @@
1
1
  # @twin.org/data-processing-rest-client - Changelog
2
2
 
3
- ## v0.0.1-next.9
3
+ ## [0.0.2-next.1](https://github.com/twinfoundation/data-processing/compare/data-processing-rest-client-v0.0.2-next.0...data-processing-rest-client-v0.0.2-next.1) (2025-08-20)
4
+
5
+
6
+ ### Features
7
+
8
+ * Add rule group query functionality ([#2](https://github.com/twinfoundation/data-processing/issues/2)) ([0fbbfb0](https://github.com/twinfoundation/data-processing/commit/0fbbfb065b6ecc293920b25f97ba011743105486))
9
+ * pass the mimeTypeOverride through the component extract method ([#9](https://github.com/twinfoundation/data-processing/issues/9)) ([a2b36de](https://github.com/twinfoundation/data-processing/commit/a2b36de5c19c56e4172d3f22b176aa83e1df84c8))
10
+ * update dependencies ([21b8e80](https://github.com/twinfoundation/data-processing/commit/21b8e8007c87136a09f0a8e35ffde13a07ff4711))
11
+ * update framework core ([96f6e80](https://github.com/twinfoundation/data-processing/commit/96f6e8016a4ef0fb873f6775e750b4ab42e9f491))
12
+ * use shared store mechanism ([#6](https://github.com/twinfoundation/data-processing/issues/6)) ([6009228](https://github.com/twinfoundation/data-processing/commit/600922880acef07cc2f818dee7645c342929108b))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * Update endpoint for fetching rule group list ([#3](https://github.com/twinfoundation/data-processing/issues/3)) ([919c1b4](https://github.com/twinfoundation/data-processing/commit/919c1b435e760251ca57f96ed9f701b08542f318))
18
+
19
+
20
+ ### Dependencies
21
+
22
+ * The following workspace dependencies were updated
23
+ * dependencies
24
+ * @twin.org/data-processing-models bumped from 0.0.2-next.0 to 0.0.2-next.1
25
+
26
+ ## 0.0.1 (2025-07-08)
27
+
28
+
29
+ ### Features
30
+
31
+ * Add rule group query functionality ([#2](https://github.com/twinfoundation/data-processing/issues/2)) ([0fbbfb0](https://github.com/twinfoundation/data-processing/commit/0fbbfb065b6ecc293920b25f97ba011743105486))
32
+ * pass the mimeTypeOverride through the component extract method ([#9](https://github.com/twinfoundation/data-processing/issues/9)) ([a2b36de](https://github.com/twinfoundation/data-processing/commit/a2b36de5c19c56e4172d3f22b176aa83e1df84c8))
33
+ * release to production ([531ba89](https://github.com/twinfoundation/data-processing/commit/531ba89dea2deb2810870b72851dca3081f9d2ce))
34
+ * update dependencies ([21b8e80](https://github.com/twinfoundation/data-processing/commit/21b8e8007c87136a09f0a8e35ffde13a07ff4711))
35
+ * use shared store mechanism ([#6](https://github.com/twinfoundation/data-processing/issues/6)) ([6009228](https://github.com/twinfoundation/data-processing/commit/600922880acef07cc2f818dee7645c342929108b))
36
+
37
+
38
+ ### Bug Fixes
39
+
40
+ * Update endpoint for fetching rule group list ([#3](https://github.com/twinfoundation/data-processing/issues/3)) ([919c1b4](https://github.com/twinfoundation/data-processing/commit/919c1b435e760251ca57f96ed9f701b08542f318))
41
+
42
+
43
+ ### Dependencies
44
+
45
+ * The following workspace dependencies were updated
46
+ * dependencies
47
+ * @twin.org/data-processing-models bumped from ^0.0.0 to ^0.0.1
48
+
49
+ ## [0.0.1-next.16](https://github.com/twinfoundation/data-processing/compare/data-processing-rest-client-v0.0.1-next.15...data-processing-rest-client-v0.0.1-next.16) (2025-06-20)
50
+
51
+
52
+ ### Miscellaneous Chores
53
+
54
+ * **data-processing-rest-client:** Synchronize repo versions
55
+
56
+
57
+ ### Dependencies
58
+
59
+ * The following workspace dependencies were updated
60
+ * dependencies
61
+ * @twin.org/data-processing-models bumped from 0.0.1-next.15 to 0.0.1-next.16
62
+
63
+ ## [0.0.1-next.15](https://github.com/twinfoundation/data-processing/compare/data-processing-rest-client-v0.0.1-next.14...data-processing-rest-client-v0.0.1-next.15) (2025-06-12)
64
+
65
+
66
+ ### Features
67
+
68
+ * update dependencies ([21b8e80](https://github.com/twinfoundation/data-processing/commit/21b8e8007c87136a09f0a8e35ffde13a07ff4711))
69
+
70
+
71
+ ### Dependencies
72
+
73
+ * The following workspace dependencies were updated
74
+ * dependencies
75
+ * @twin.org/data-processing-models bumped from 0.0.1-next.14 to 0.0.1-next.15
76
+
77
+ ## [0.0.1-next.14](https://github.com/twinfoundation/data-processing/compare/data-processing-rest-client-v0.0.1-next.13...data-processing-rest-client-v0.0.1-next.14) (2025-04-28)
78
+
79
+
80
+ ### Features
81
+
82
+ * pass the mimeTypeOverride through the component extract method ([#9](https://github.com/twinfoundation/data-processing/issues/9)) ([a2b36de](https://github.com/twinfoundation/data-processing/commit/a2b36de5c19c56e4172d3f22b176aa83e1df84c8))
83
+
84
+
85
+ ### Dependencies
86
+
87
+ * The following workspace dependencies were updated
88
+ * dependencies
89
+ * @twin.org/data-processing-models bumped from 0.0.1-next.13 to 0.0.1-next.14
90
+
91
+ ## [0.0.1-next.13](https://github.com/twinfoundation/data-processing/compare/data-processing-rest-client-v0.0.1-next.12...data-processing-rest-client-v0.0.1-next.13) (2025-04-24)
92
+
93
+
94
+ ### Miscellaneous Chores
95
+
96
+ * **data-processing-rest-client:** Synchronize repo versions
97
+
98
+
99
+ ### Dependencies
100
+
101
+ * The following workspace dependencies were updated
102
+ * dependencies
103
+ * @twin.org/data-processing-models bumped from 0.0.1-next.12 to 0.0.1-next.13
104
+
105
+ ## [0.0.1-next.12](https://github.com/twinfoundation/data-processing/compare/data-processing-rest-client-v0.0.1-next.11...data-processing-rest-client-v0.0.1-next.12) (2025-04-17)
106
+
107
+
108
+ ### Features
109
+
110
+ * use shared store mechanism ([#6](https://github.com/twinfoundation/data-processing/issues/6)) ([6009228](https://github.com/twinfoundation/data-processing/commit/600922880acef07cc2f818dee7645c342929108b))
111
+
112
+
113
+ ### Dependencies
114
+
115
+ * The following workspace dependencies were updated
116
+ * dependencies
117
+ * @twin.org/data-processing-models bumped from 0.0.1-next.11 to 0.0.1-next.12
118
+
119
+ ## [0.0.1-next.11](https://github.com/twinfoundation/data-processing/compare/data-processing-rest-client-v0.0.1-next.10...data-processing-rest-client-v0.0.1-next.11) (2025-03-28)
120
+
121
+
122
+ ### Features
123
+
124
+ * Add rule group query functionality ([#2](https://github.com/twinfoundation/data-processing/issues/2)) ([0fbbfb0](https://github.com/twinfoundation/data-processing/commit/0fbbfb065b6ecc293920b25f97ba011743105486))
125
+
126
+
127
+ ### Bug Fixes
128
+
129
+ * Update endpoint for fetching rule group list ([#3](https://github.com/twinfoundation/data-processing/issues/3)) ([919c1b4](https://github.com/twinfoundation/data-processing/commit/919c1b435e760251ca57f96ed9f701b08542f318))
130
+
131
+
132
+ ### Dependencies
133
+
134
+ * The following workspace dependencies were updated
135
+ * dependencies
136
+ * @twin.org/data-processing-models bumped from 0.0.1-next.10 to 0.0.1-next.11
137
+
138
+ ## v0.0.1-next.10
4
139
 
5
140
  - Initial Release
@@ -12,9 +12,9 @@ Client for performing data processing through to REST endpoints.
12
12
 
13
13
  ## Constructors
14
14
 
15
- ### new DataProcessingClient()
15
+ ### Constructor
16
16
 
17
- > **new DataProcessingClient**(`config`): [`DataProcessingClient`](DataProcessingClient.md)
17
+ > **new DataProcessingClient**(`config`): `DataProcessingClient`
18
18
 
19
19
  Create a new instance of DataProcessingClient.
20
20
 
@@ -28,7 +28,7 @@ The configuration for the client.
28
28
 
29
29
  #### Returns
30
30
 
31
- [`DataProcessingClient`](DataProcessingClient.md)
31
+ `DataProcessingClient`
32
32
 
33
33
  #### Overrides
34
34
 
@@ -128,7 +128,7 @@ Nothing.
128
128
 
129
129
  ### extract()
130
130
 
131
- > **extract**(`ruleGroupId`, `data`, `overrideExtractorType`?): `Promise`\<`unknown`\>
131
+ > **extract**(`ruleGroupId`, `data`, `overrideExtractorType?`, `overrideMimeType?`): `Promise`\<`unknown`\>
132
132
 
133
133
  Extracts data from the provided input.
134
134
 
@@ -152,6 +152,12 @@ The data to extract from.
152
152
 
153
153
  An optional override for the extractor type.
154
154
 
155
+ ##### overrideMimeType?
156
+
157
+ `string`
158
+
159
+ An optional override for the mime type for conversion, will auto detect if not provided.
160
+
155
161
  #### Returns
156
162
 
157
163
  `Promise`\<`unknown`\>
@@ -166,7 +172,7 @@ The extracted data.
166
172
 
167
173
  ### convert()
168
174
 
169
- > **convert**(`data`, `overrideMimeType`?): `Promise`\<`unknown`\>
175
+ > **convert**(`data`, `overrideMimeType?`): `Promise`\<`unknown`\>
170
176
 
171
177
  Converts data from the provided input to a structured JSON document.
172
178
 
@@ -198,7 +204,7 @@ The converted data.
198
204
 
199
205
  ### query()
200
206
 
201
- > **query**(`cursor`?, `pageSize`?): `Promise`\<\{ `entities`: `IRuleGroup`[]; `cursor`: `string`; \}\>
207
+ > **query**(`cursor?`, `pageSize?`): `Promise`\<\{ `entities`: `IRuleGroup`[]; `cursor?`: `string`; \}\>
202
208
 
203
209
  Query the rule group entries.
204
210
 
@@ -218,7 +224,7 @@ The maximum number of entities in a page.
218
224
 
219
225
  #### Returns
220
226
 
221
- `Promise`\<\{ `entities`: `IRuleGroup`[]; `cursor`: `string`; \}\>
227
+ `Promise`\<\{ `entities`: `IRuleGroup`[]; `cursor?`: `string`; \}\>
222
228
 
223
229
  All the entities for the storage matching the conditions,
224
230
  and a cursor which can be used to request more entities.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/data-processing-rest-client",
3
- "version": "0.0.1-next.9",
3
+ "version": "0.0.2-next.1",
4
4
  "description": "Data processing contract implementation which can connect to REST endpoints",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  "@twin.org/api-core": "next",
18
18
  "@twin.org/api-models": "next",
19
19
  "@twin.org/core": "next",
20
- "@twin.org/data-processing-models": "0.0.1-next.9",
20
+ "@twin.org/data-processing-models": "0.0.2-next.1",
21
21
  "@twin.org/entity": "next",
22
22
  "@twin.org/nameof": "next",
23
23
  "@twin.org/web": "next"