@xyo-network/diviner-jsonpath-aggregate-model 2.83.0
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/LICENSE +165 -0
- package/README.md +13 -0
- package/dist/browser/Config.d.cts +27 -0
- package/dist/browser/Config.d.cts.map +1 -0
- package/dist/browser/Config.d.mts +27 -0
- package/dist/browser/Config.d.mts.map +1 -0
- package/dist/browser/Config.d.ts +27 -0
- package/dist/browser/Config.d.ts.map +1 -0
- package/dist/browser/Params.d.cts +8 -0
- package/dist/browser/Params.d.cts.map +1 -0
- package/dist/browser/Params.d.mts +8 -0
- package/dist/browser/Params.d.mts.map +1 -0
- package/dist/browser/Params.d.ts +8 -0
- package/dist/browser/Params.d.ts.map +1 -0
- package/dist/browser/Schema.d.cts +9 -0
- package/dist/browser/Schema.d.cts.map +1 -0
- package/dist/browser/Schema.d.mts +9 -0
- package/dist/browser/Schema.d.mts.map +1 -0
- package/dist/browser/Schema.d.ts +9 -0
- package/dist/browser/Schema.d.ts.map +1 -0
- package/dist/browser/index.cjs +33 -0
- package/dist/browser/index.cjs.map +1 -0
- package/dist/browser/index.d.cts +5 -0
- package/dist/browser/index.d.cts.map +1 -0
- package/dist/browser/index.d.mts +5 -0
- package/dist/browser/index.d.mts.map +1 -0
- package/dist/browser/index.d.ts +5 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +10 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/jsonpath/JsonPathTransformExpression.d.cts +20 -0
- package/dist/browser/jsonpath/JsonPathTransformExpression.d.cts.map +1 -0
- package/dist/browser/jsonpath/JsonPathTransformExpression.d.mts +20 -0
- package/dist/browser/jsonpath/JsonPathTransformExpression.d.mts.map +1 -0
- package/dist/browser/jsonpath/JsonPathTransformExpression.d.ts +20 -0
- package/dist/browser/jsonpath/JsonPathTransformExpression.d.ts.map +1 -0
- package/dist/browser/jsonpath/PayloadTransformer.d.cts +3 -0
- package/dist/browser/jsonpath/PayloadTransformer.d.cts.map +1 -0
- package/dist/browser/jsonpath/PayloadTransformer.d.mts +3 -0
- package/dist/browser/jsonpath/PayloadTransformer.d.mts.map +1 -0
- package/dist/browser/jsonpath/PayloadTransformer.d.ts +3 -0
- package/dist/browser/jsonpath/PayloadTransformer.d.ts.map +1 -0
- package/dist/browser/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.cts +12 -0
- package/dist/browser/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.cts.map +1 -0
- package/dist/browser/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.mts +12 -0
- package/dist/browser/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.mts.map +1 -0
- package/dist/browser/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.ts +12 -0
- package/dist/browser/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.ts.map +1 -0
- package/dist/browser/jsonpath/SchemaToPayloadTransformersDictionary.d.cts +8 -0
- package/dist/browser/jsonpath/SchemaToPayloadTransformersDictionary.d.cts.map +1 -0
- package/dist/browser/jsonpath/SchemaToPayloadTransformersDictionary.d.mts +8 -0
- package/dist/browser/jsonpath/SchemaToPayloadTransformersDictionary.d.mts.map +1 -0
- package/dist/browser/jsonpath/SchemaToPayloadTransformersDictionary.d.ts +8 -0
- package/dist/browser/jsonpath/SchemaToPayloadTransformersDictionary.d.ts.map +1 -0
- package/dist/browser/jsonpath/index.d.cts +5 -0
- package/dist/browser/jsonpath/index.d.cts.map +1 -0
- package/dist/browser/jsonpath/index.d.mts +5 -0
- package/dist/browser/jsonpath/index.d.mts.map +1 -0
- package/dist/browser/jsonpath/index.d.ts +5 -0
- package/dist/browser/jsonpath/index.d.ts.map +1 -0
- package/dist/node/Config.d.cts +27 -0
- package/dist/node/Config.d.cts.map +1 -0
- package/dist/node/Config.d.mts +27 -0
- package/dist/node/Config.d.mts.map +1 -0
- package/dist/node/Config.d.ts +27 -0
- package/dist/node/Config.d.ts.map +1 -0
- package/dist/node/Params.d.cts +8 -0
- package/dist/node/Params.d.cts.map +1 -0
- package/dist/node/Params.d.mts +8 -0
- package/dist/node/Params.d.mts.map +1 -0
- package/dist/node/Params.d.ts +8 -0
- package/dist/node/Params.d.ts.map +1 -0
- package/dist/node/Schema.d.cts +9 -0
- package/dist/node/Schema.d.cts.map +1 -0
- package/dist/node/Schema.d.mts +9 -0
- package/dist/node/Schema.d.mts.map +1 -0
- package/dist/node/Schema.d.ts +9 -0
- package/dist/node/Schema.d.ts.map +1 -0
- package/dist/node/index.d.cts +5 -0
- package/dist/node/index.d.cts.map +1 -0
- package/dist/node/index.d.mts +5 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.d.ts +5 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +38 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +10 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/jsonpath/JsonPathTransformExpression.d.cts +20 -0
- package/dist/node/jsonpath/JsonPathTransformExpression.d.cts.map +1 -0
- package/dist/node/jsonpath/JsonPathTransformExpression.d.mts +20 -0
- package/dist/node/jsonpath/JsonPathTransformExpression.d.mts.map +1 -0
- package/dist/node/jsonpath/JsonPathTransformExpression.d.ts +20 -0
- package/dist/node/jsonpath/JsonPathTransformExpression.d.ts.map +1 -0
- package/dist/node/jsonpath/PayloadTransformer.d.cts +3 -0
- package/dist/node/jsonpath/PayloadTransformer.d.cts.map +1 -0
- package/dist/node/jsonpath/PayloadTransformer.d.mts +3 -0
- package/dist/node/jsonpath/PayloadTransformer.d.mts.map +1 -0
- package/dist/node/jsonpath/PayloadTransformer.d.ts +3 -0
- package/dist/node/jsonpath/PayloadTransformer.d.ts.map +1 -0
- package/dist/node/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.cts +12 -0
- package/dist/node/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.cts.map +1 -0
- package/dist/node/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.mts +12 -0
- package/dist/node/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.mts.map +1 -0
- package/dist/node/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.ts +12 -0
- package/dist/node/jsonpath/SchemaToJsonPathTransformExpressionDictionary.d.ts.map +1 -0
- package/dist/node/jsonpath/SchemaToPayloadTransformersDictionary.d.cts +8 -0
- package/dist/node/jsonpath/SchemaToPayloadTransformersDictionary.d.cts.map +1 -0
- package/dist/node/jsonpath/SchemaToPayloadTransformersDictionary.d.mts +8 -0
- package/dist/node/jsonpath/SchemaToPayloadTransformersDictionary.d.mts.map +1 -0
- package/dist/node/jsonpath/SchemaToPayloadTransformersDictionary.d.ts +8 -0
- package/dist/node/jsonpath/SchemaToPayloadTransformersDictionary.d.ts.map +1 -0
- package/dist/node/jsonpath/index.d.cts +5 -0
- package/dist/node/jsonpath/index.d.cts.map +1 -0
- package/dist/node/jsonpath/index.d.mts +5 -0
- package/dist/node/jsonpath/index.d.mts.map +1 -0
- package/dist/node/jsonpath/index.d.ts +5 -0
- package/dist/node/jsonpath/index.d.ts.map +1 -0
- package/package.json +64 -0
- package/src/Config.ts +29 -0
- package/src/Params.ts +9 -0
- package/src/Schema.ts +8 -0
- package/src/index.ts +4 -0
- package/src/jsonpath/JsonPathTransformExpression.ts +20 -0
- package/src/jsonpath/PayloadTransformer.ts +3 -0
- package/src/jsonpath/SchemaToJsonPathTransformExpressionDictionary.ts +8 -0
- package/src/jsonpath/SchemaToPayloadTransformersDictionary.ts +6 -0
- package/src/jsonpath/index.ts +4 -0
- package/typedoc.json +5 -0
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xyo-network/diviner-jsonpath-aggregate-model",
|
|
3
|
+
"author": {
|
|
4
|
+
"email": "support@xyo.network",
|
|
5
|
+
"name": "XYO Development Team",
|
|
6
|
+
"url": "https://xyo.network"
|
|
7
|
+
},
|
|
8
|
+
"bugs": {
|
|
9
|
+
"email": "support@xyo.network",
|
|
10
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@xyo-network/core": "~2.83.0",
|
|
14
|
+
"@xyo-network/diviner-model": "~2.83.0",
|
|
15
|
+
"@xyo-network/module-model": "~2.83.0",
|
|
16
|
+
"@xyo-network/payload-model": "~2.83.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@xylabs/ts-scripts-yarn3": "^3.2.10",
|
|
20
|
+
"@xylabs/tsconfig": "^3.2.10",
|
|
21
|
+
"typescript": "^5.3.2"
|
|
22
|
+
},
|
|
23
|
+
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
24
|
+
"docs": "dist/docs.json",
|
|
25
|
+
"types": "dist/node/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"browser": {
|
|
29
|
+
"require": {
|
|
30
|
+
"types": "./dist/browser/index.d.cts",
|
|
31
|
+
"default": "./dist/browser/index.cjs"
|
|
32
|
+
},
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./dist/browser/index.d.mts",
|
|
35
|
+
"default": "./dist/browser/index.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"node": {
|
|
39
|
+
"require": {
|
|
40
|
+
"types": "./dist/node/index.d.ts",
|
|
41
|
+
"default": "./dist/node/index.js"
|
|
42
|
+
},
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./dist/node/index.d.mts",
|
|
45
|
+
"default": "./dist/node/index.mjs"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"./package.json": "./package.json"
|
|
50
|
+
},
|
|
51
|
+
"main": "dist/node/index.js",
|
|
52
|
+
"module": "dist/node/index.mjs",
|
|
53
|
+
"homepage": "https://xyo.network",
|
|
54
|
+
"license": "LGPL-3.0-only",
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"repository": {
|
|
59
|
+
"type": "git",
|
|
60
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
61
|
+
},
|
|
62
|
+
"sideEffects": false,
|
|
63
|
+
"version": "2.83.0"
|
|
64
|
+
}
|
package/src/Config.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DivinerConfig } from '@xyo-network/diviner-model'
|
|
2
|
+
|
|
3
|
+
import { SchemaToJsonPathTransformExpressionsDictionary } from './jsonpath'
|
|
4
|
+
import { JsonPathAggregateDivinerSchema } from './Schema'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The config schema type for the JSON Path diviner
|
|
8
|
+
*/
|
|
9
|
+
export type JsonPathAggregateDivinerConfigSchema = `${JsonPathAggregateDivinerSchema}.config`
|
|
10
|
+
/**
|
|
11
|
+
* The config schema for the JSON Path diviner
|
|
12
|
+
*/
|
|
13
|
+
export const JsonPathAggregateDivinerConfigSchema: JsonPathAggregateDivinerConfigSchema = `${JsonPathAggregateDivinerSchema}.config`
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The configuration for the JSON Path diviner
|
|
17
|
+
*/
|
|
18
|
+
export type JsonPathAggregateDivinerConfig = DivinerConfig<
|
|
19
|
+
{
|
|
20
|
+
/**
|
|
21
|
+
* The schema to use for the destination payloads
|
|
22
|
+
*/
|
|
23
|
+
destinationSchema?: string
|
|
24
|
+
/**
|
|
25
|
+
* The JSON Path transform expressions to apply to the payloads
|
|
26
|
+
*/
|
|
27
|
+
schemaTransforms?: SchemaToJsonPathTransformExpressionsDictionary
|
|
28
|
+
} & { schema: JsonPathAggregateDivinerConfigSchema }
|
|
29
|
+
>
|
package/src/Params.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DivinerParams } from '@xyo-network/diviner-model'
|
|
2
|
+
import { AnyConfigSchema } from '@xyo-network/module-model'
|
|
3
|
+
|
|
4
|
+
import { JsonPathAggregateDivinerConfig } from './Config'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The params type the JSON Path diviner
|
|
8
|
+
**/
|
|
9
|
+
export type JsonPathAggregateDivinerParams = DivinerParams<AnyConfigSchema<JsonPathAggregateDivinerConfig>>
|
package/src/Schema.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The schema type used for the JSONPath Diviner.
|
|
3
|
+
*/
|
|
4
|
+
export type JsonPathAggregateDivinerSchema = 'network.xyo.diviner.jsonpath'
|
|
5
|
+
/**
|
|
6
|
+
* The schema used for the JSONPath Diviner.
|
|
7
|
+
*/
|
|
8
|
+
export const JsonPathAggregateDivinerSchema: JsonPathAggregateDivinerSchema = 'network.xyo.diviner.jsonpath'
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JsonValue } from '@xyo-network/core'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Describes the JSON-path transformation to retrieve a field on a source object
|
|
5
|
+
* and the target field to store the value to on a destination object
|
|
6
|
+
*/
|
|
7
|
+
export interface JsonPathTransformExpression {
|
|
8
|
+
/**
|
|
9
|
+
* The default value to use if the source field does not exist
|
|
10
|
+
*/
|
|
11
|
+
defaultValue?: JsonValue
|
|
12
|
+
/**
|
|
13
|
+
* The target field to store the source field into on the destination object
|
|
14
|
+
*/
|
|
15
|
+
destinationField: string
|
|
16
|
+
/**
|
|
17
|
+
* The JSON path expressions for the source field on the source object
|
|
18
|
+
*/
|
|
19
|
+
sourcePathExpression: string
|
|
20
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JsonPathTransformExpression } from './JsonPathTransformExpression'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A dictionary of schema to JSON Path transform expressions.
|
|
5
|
+
*/
|
|
6
|
+
export type SchemaToJsonPathTransformExpressionsDictionary<T extends { [schema: string]: unknown } = { [schema: string]: unknown }> = {
|
|
7
|
+
[key in keyof T]: JsonPathTransformExpression[]
|
|
8
|
+
}
|