@twin.org/data-processing-extractors 0.0.2-next.1 → 0.0.2-next.3
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
|
@@ -16,7 +16,7 @@ class JsonPathExtractorConnector {
|
|
|
16
16
|
/**
|
|
17
17
|
* Runtime name for the class.
|
|
18
18
|
*/
|
|
19
|
-
CLASS_NAME = "JsonPathExtractorConnector";
|
|
19
|
+
static CLASS_NAME = "JsonPathExtractorConnector";
|
|
20
20
|
/**
|
|
21
21
|
* Extracts data from the provided input.
|
|
22
22
|
* @param data The object to extract from.
|
|
@@ -24,8 +24,8 @@ class JsonPathExtractorConnector {
|
|
|
24
24
|
* @returns The extracted data.
|
|
25
25
|
*/
|
|
26
26
|
async extract(data, rules) {
|
|
27
|
-
core.Guards.object(
|
|
28
|
-
core.Guards.array(
|
|
27
|
+
core.Guards.object(JsonPathExtractorConnector.CLASS_NAME, "data", data);
|
|
28
|
+
core.Guards.array(JsonPathExtractorConnector.CLASS_NAME, "rules", rules);
|
|
29
29
|
const outputObject = {};
|
|
30
30
|
for (const extractRule of rules) {
|
|
31
31
|
this.extractValue(data, extractRule, outputObject);
|
|
@@ -49,7 +49,7 @@ class JsonPathExtractorConnector {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
catch (err) {
|
|
52
|
-
throw new core.GeneralError(
|
|
52
|
+
throw new core.GeneralError(JsonPathExtractorConnector.CLASS_NAME, "invalidRule", {
|
|
53
53
|
rule: rule.source,
|
|
54
54
|
reason: core.BaseError.fromError(err).message
|
|
55
55
|
});
|
package/dist/esm/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ class JsonPathExtractorConnector {
|
|
|
14
14
|
/**
|
|
15
15
|
* Runtime name for the class.
|
|
16
16
|
*/
|
|
17
|
-
CLASS_NAME = "JsonPathExtractorConnector";
|
|
17
|
+
static CLASS_NAME = "JsonPathExtractorConnector";
|
|
18
18
|
/**
|
|
19
19
|
* Extracts data from the provided input.
|
|
20
20
|
* @param data The object to extract from.
|
|
@@ -22,8 +22,8 @@ class JsonPathExtractorConnector {
|
|
|
22
22
|
* @returns The extracted data.
|
|
23
23
|
*/
|
|
24
24
|
async extract(data, rules) {
|
|
25
|
-
Guards.object(
|
|
26
|
-
Guards.array(
|
|
25
|
+
Guards.object(JsonPathExtractorConnector.CLASS_NAME, "data", data);
|
|
26
|
+
Guards.array(JsonPathExtractorConnector.CLASS_NAME, "rules", rules);
|
|
27
27
|
const outputObject = {};
|
|
28
28
|
for (const extractRule of rules) {
|
|
29
29
|
this.extractValue(data, extractRule, outputObject);
|
|
@@ -47,7 +47,7 @@ class JsonPathExtractorConnector {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
catch (err) {
|
|
50
|
-
throw new GeneralError(
|
|
50
|
+
throw new GeneralError(JsonPathExtractorConnector.CLASS_NAME, "invalidRule", {
|
|
51
51
|
rule: rule.source,
|
|
52
52
|
reason: BaseError.fromError(err).message
|
|
53
53
|
});
|
|
@@ -10,7 +10,7 @@ export declare class JsonPathExtractorConnector implements IDataExtractorConnect
|
|
|
10
10
|
/**
|
|
11
11
|
* Runtime name for the class.
|
|
12
12
|
*/
|
|
13
|
-
readonly CLASS_NAME: string;
|
|
13
|
+
static readonly CLASS_NAME: string;
|
|
14
14
|
/**
|
|
15
15
|
* Extracts data from the provided input.
|
|
16
16
|
* @param data The object to extract from.
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @twin.org/data-processing-extractors - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.3](https://github.com/twinfoundation/data-processing/compare/data-processing-extractors-v0.0.2-next.2...data-processing-extractors-v0.0.2-next.3) (2025-10-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add validate-locales ([9af0874](https://github.com/twinfoundation/data-processing/commit/9af0874cd3f44a4cfca514dde8380f002e62337e))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/data-processing-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
16
|
+
|
|
17
|
+
## [0.0.2-next.2](https://github.com/twinfoundation/data-processing/compare/data-processing-extractors-v0.0.2-next.1...data-processing-extractors-v0.0.2-next.2) (2025-08-29)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* eslint migration to flat config ([a8138b0](https://github.com/twinfoundation/data-processing/commit/a8138b020ed58baeff162a822d4df207a6aeadc4))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* The following workspace dependencies were updated
|
|
28
|
+
* dependencies
|
|
29
|
+
* @twin.org/data-processing-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
30
|
+
|
|
3
31
|
## [0.0.2-next.1](https://github.com/twinfoundation/data-processing/compare/data-processing-extractors-v0.0.2-next.0...data-processing-extractors-v0.0.2-next.1) (2025-08-20)
|
|
4
32
|
|
|
5
33
|
|
|
@@ -28,14 +28,10 @@ The namespace supported by the data extractor connector.
|
|
|
28
28
|
|
|
29
29
|
### CLASS\_NAME
|
|
30
30
|
|
|
31
|
-
> `readonly` **CLASS\_NAME**: `string`
|
|
31
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
32
32
|
|
|
33
33
|
Runtime name for the class.
|
|
34
34
|
|
|
35
|
-
#### Implementation of
|
|
36
|
-
|
|
37
|
-
`IDataExtractorConnector.CLASS_NAME`
|
|
38
|
-
|
|
39
35
|
## Methods
|
|
40
36
|
|
|
41
37
|
### extract()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/data-processing-extractors",
|
|
3
|
-
"version": "0.0.2-next.
|
|
3
|
+
"version": "0.0.2-next.3",
|
|
4
4
|
"description": "Data extractor connector implementations",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
|
-
"@twin.org/data-processing-models": "0.0.2-next.
|
|
18
|
+
"@twin.org/data-processing-models": "0.0.2-next.3",
|
|
19
19
|
"@twin.org/nameof": "next",
|
|
20
20
|
"@twin.org/web": "next",
|
|
21
21
|
"json-p3": "2.2.2"
|
|
@@ -37,5 +37,21 @@
|
|
|
37
37
|
"dist/types",
|
|
38
38
|
"locales",
|
|
39
39
|
"docs"
|
|
40
|
-
]
|
|
40
|
+
],
|
|
41
|
+
"keywords": [
|
|
42
|
+
"twin",
|
|
43
|
+
"trade",
|
|
44
|
+
"iota",
|
|
45
|
+
"framework",
|
|
46
|
+
"blockchain",
|
|
47
|
+
"data-processing",
|
|
48
|
+
"data",
|
|
49
|
+
"processing",
|
|
50
|
+
"transformation",
|
|
51
|
+
"conversion"
|
|
52
|
+
],
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "git+https://github.com/twinfoundation/data-processing/issues"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://twindev.org"
|
|
41
57
|
}
|