@twin.org/data-processing-rest-client 0.0.1-next.13 → 0.0.1-next.14
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/dist/cjs/index.cjs
CHANGED
|
@@ -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);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -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,19 @@
|
|
|
1
1
|
# @twin.org/data-processing-rest-client - Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* 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))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/data-processing-models bumped from 0.0.1-next.13 to 0.0.1-next.14
|
|
16
|
+
|
|
3
17
|
## [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)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -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`\>
|
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.
|
|
3
|
+
"version": "0.0.1-next.14",
|
|
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.
|
|
20
|
+
"@twin.org/data-processing-models": "0.0.1-next.14",
|
|
21
21
|
"@twin.org/entity": "next",
|
|
22
22
|
"@twin.org/nameof": "next",
|
|
23
23
|
"@twin.org/web": "next"
|