@xyo-network/diviner-jsonpath-aggregate-memory 5.2.18 → 5.2.20
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/neutral/index.mjs +2 -2
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +19 -20
- package/src/Diviner.ts +1 -1
- package/src/jsonpath/reducePayloads.ts +1 -1
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/Diviner.ts
|
|
2
|
-
import { assertEx } from "@xylabs/
|
|
2
|
+
import { assertEx } from "@xylabs/sdk-js";
|
|
3
3
|
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
4
4
|
import { AbstractDiviner } from "@xyo-network/diviner-abstract";
|
|
5
5
|
import { JsonPathAggregateDivinerConfigSchema } from "@xyo-network/diviner-jsonpath-aggregate-model";
|
|
@@ -19,7 +19,7 @@ var jsonPathToTransformersDictionary = (schemaTransforms) => {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
// src/jsonpath/reducePayloads.ts
|
|
22
|
-
import { exists } from "@xylabs/
|
|
22
|
+
import { exists } from "@xylabs/sdk-js";
|
|
23
23
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
24
24
|
var reducePayloads = async (payloads, payloadTransformers, destinationSchema, excludeSources = false) => {
|
|
25
25
|
const payloadFields = payloads.filter(exists).flatMap((payload) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Diviner.ts","../../src/jsonpath/jsonPathToTransformersDictionary.ts","../../src/jsonpath/reducePayloads.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type {\n JsonPathAggregateDivinerParams,\n PayloadTransformer,\n SchemaToJsonPathTransformExpressionsDictionary,\n SchemaToPayloadTransformersDictionary,\n} from '@xyo-network/diviner-jsonpath-aggregate-model'\nimport { JsonPathAggregateDivinerConfigSchema } from '@xyo-network/diviner-jsonpath-aggregate-model'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { PayloadSchema } from '@xyo-network/payload-model'\nimport { combinationsByBoundwitness, combinationsBySchema } from '@xyo-network/payload-utils'\n\nimport { jsonPathToTransformersDictionary, reducePayloads } from './jsonpath/index.ts'\n\nconst moduleName = 'JsonPathAggregateDiviner'\n\nexport class JsonPathAggregateDiviner<\n TParams extends JsonPathAggregateDivinerParams = JsonPathAggregateDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, JsonPathAggregateDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = JsonPathAggregateDivinerConfigSchema\n\n protected _transforms: PayloadTransformer[] | undefined\n\n private _payloadTransformers: SchemaToPayloadTransformersDictionary | undefined\n private _transformableSchemas: string[] | undefined\n\n /**\n * The schema to use for the destination payloads\n */\n protected get destinationSchema(): string {\n return this.config.destinationSchema ?? PayloadSchema\n }\n\n /**\n * Dictionary of schemas to payload transformers\n */\n protected get payloadTransformers(): SchemaToPayloadTransformersDictionary {\n if (!this._payloadTransformers) this._payloadTransformers = jsonPathToTransformersDictionary(this.schemaTransforms)\n return this._payloadTransformers\n }\n\n /**\n * The dictionary of schemas to JSON Path transform expressions\n */\n protected get schemaTransforms(): SchemaToJsonPathTransformExpressionsDictionary {\n return assertEx(this.config?.schemaTransforms, () => `${moduleName}: Missing config.schemaTransforms section`)\n }\n\n /**\n * List of transformable schemas for this diviner\n */\n protected get transformableSchemas(): string[] {\n if (!this._transformableSchemas) this._transformableSchemas = Object.keys(this.schemaTransforms)\n return this._transformableSchemas\n }\n\n protected override async divineHandler(payloads?: TIn[]): Promise<TOut[]> {\n if (!payloads) return []\n const strippedPayloads = payloads.map((payload) => {\n const p = { ...payload } as TIn\n return PayloadBuilder.omitMeta(p as TIn)\n })\n const combinations\n = this.transformableSchemas.includes(BoundWitnessSchema)\n ? await combinationsByBoundwitness(strippedPayloads)\n : await combinationsBySchema(strippedPayloads, this.transformableSchemas)\n return await Promise.all(\n combinations.map((combination) => {\n return reducePayloads<TOut>(combination, this.payloadTransformers, this.destinationSchema, this.config.excludeSources ?? false)\n }),\n )\n }\n\n /**\n * Identifies if a payload is one that is transformed by this diviner\n * @param x The candidate payload\n * @returns True if the payload is one transformed by this diviner, false otherwise\n */\n protected isTransformablePayload = (x: Payload) => {\n return this.transformableSchemas.includes(x?.schema)\n }\n\n /**\n * Identifies if a schema is one that is transformed by this diviner\n * @param schema The candidate schema\n * @returns True if this schema is one transformed by this diviner, false otherwise\n */\n protected isTransformableSchema = (schema?: string | null) => {\n return typeof schema === 'string' ? this.transformableSchemas.includes(schema) : false\n }\n}\n","import type { SchemaToJsonPathTransformExpressionsDictionary, SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-aggregate-model'\nimport { toPayloadTransformer } from '@xyo-network/diviner-jsonpath-memory'\n\n/**\n * Materializes the JSON-path expressions into memoized functions by converting a\n * dictionary of schema to JSON Path transform expressions to a dictionary\n * of schema to payload transformers\n * @param schemaTransforms The schema transforms to convert\n * @returns A dictionary of schema to payload transformers\n */\nexport const jsonPathToTransformersDictionary = (\n schemaTransforms: SchemaToJsonPathTransformExpressionsDictionary,\n): SchemaToPayloadTransformersDictionary => {\n return Object.fromEntries(\n Object.entries(schemaTransforms).map(([schema, jsonPathTransformerExpressions]) => {\n const transformers = jsonPathTransformerExpressions.map(toPayloadTransformer)\n return [schema, transformers]\n }),\n )\n}\n","import { exists } from '@xylabs/exists'\nimport type { SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-aggregate-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, WithoutSchema } from '@xyo-network/payload-model'\n\n/**\n * Reduces the payloads to a single payload using the supplied transformers\n * @param payloads The payloads to reduce\n * @param payloadTransformers The transformers to use to convert the payloads to the destination payload\n * @param destinationSchema The schema of the destination payload\n * @param excludeSources Exclude the source hashes from the destination payload\n * @returns The reduced payload\n */\nexport const reducePayloads = async <T extends Payload = Payload>(\n payloads: Payload[],\n payloadTransformers: SchemaToPayloadTransformersDictionary,\n destinationSchema: string,\n excludeSources = false,\n): Promise<T> => {\n // Use the payload transformers to convert the fields from the source payloads to the destination fields\n const payloadFields = payloads.filter(exists).flatMap<WithoutSchema<Payload>[]>((payload) => {\n // Find the transformers for this payload\n const transformers = payloadTransformers[payload.schema]\n // If transformers exist, apply them to the payload otherwise return an empty array\n return transformers ? transformers.map(transform => transform(payload)) : []\n })\n // Include all the sources for reference\n const baseObject = excludeSources ? {} : { sources: await PayloadBuilder.dataHashes(payloads) }\n // Build and return the payload\n return new PayloadBuilder<T>({ schema: destinationSchema }).fields(Object.assign(baseObject, ...payloadFields)).build()\n}\n\n/**\n * Reduces the arrays of payload arrays to an array of payloads using the supplied transformers\n * @param payloadsArray The arrays of payloads to reduce\n * @param payloadTransformers The transformers to use to convert the payloads to the destination payloads\n * @param excludeSources Exclude the source hashes from the destination payload\n * @returns The reduced payloads\n */\nexport const reducePayloadsArray = async <T extends Payload = Payload>(\n payloadsArray: Payload[][],\n payloadTransformers: SchemaToPayloadTransformersDictionary,\n destinationSchema: string,\n excludeSources = false,\n): Promise<T[]> => {\n return await Promise.all(\n payloadsArray.map(async (payloads) => {\n return await reducePayloads<T>(payloads, payloadTransformers, destinationSchema, excludeSources)\n }),\n )\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;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AAW,WAAW,KAAK,qBAAqB,SAAS,MAAM,IAAI;AAAA,EACnF;AACF;","names":["PayloadBuilder","PayloadBuilder"]}
|
|
1
|
+
{"version":3,"sources":["../../src/Diviner.ts","../../src/jsonpath/jsonPathToTransformersDictionary.ts","../../src/jsonpath/reducePayloads.ts"],"sourcesContent":["import { assertEx } from '@xylabs/sdk-js'\nimport { BoundWitnessSchema } from '@xyo-network/boundwitness-model'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type {\n JsonPathAggregateDivinerParams,\n PayloadTransformer,\n SchemaToJsonPathTransformExpressionsDictionary,\n SchemaToPayloadTransformersDictionary,\n} from '@xyo-network/diviner-jsonpath-aggregate-model'\nimport { JsonPathAggregateDivinerConfigSchema } from '@xyo-network/diviner-jsonpath-aggregate-model'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { PayloadSchema } from '@xyo-network/payload-model'\nimport { combinationsByBoundwitness, combinationsBySchema } from '@xyo-network/payload-utils'\n\nimport { jsonPathToTransformersDictionary, reducePayloads } from './jsonpath/index.ts'\n\nconst moduleName = 'JsonPathAggregateDiviner'\n\nexport class JsonPathAggregateDiviner<\n TParams extends JsonPathAggregateDivinerParams = JsonPathAggregateDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, JsonPathAggregateDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = JsonPathAggregateDivinerConfigSchema\n\n protected _transforms: PayloadTransformer[] | undefined\n\n private _payloadTransformers: SchemaToPayloadTransformersDictionary | undefined\n private _transformableSchemas: string[] | undefined\n\n /**\n * The schema to use for the destination payloads\n */\n protected get destinationSchema(): string {\n return this.config.destinationSchema ?? PayloadSchema\n }\n\n /**\n * Dictionary of schemas to payload transformers\n */\n protected get payloadTransformers(): SchemaToPayloadTransformersDictionary {\n if (!this._payloadTransformers) this._payloadTransformers = jsonPathToTransformersDictionary(this.schemaTransforms)\n return this._payloadTransformers\n }\n\n /**\n * The dictionary of schemas to JSON Path transform expressions\n */\n protected get schemaTransforms(): SchemaToJsonPathTransformExpressionsDictionary {\n return assertEx(this.config?.schemaTransforms, () => `${moduleName}: Missing config.schemaTransforms section`)\n }\n\n /**\n * List of transformable schemas for this diviner\n */\n protected get transformableSchemas(): string[] {\n if (!this._transformableSchemas) this._transformableSchemas = Object.keys(this.schemaTransforms)\n return this._transformableSchemas\n }\n\n protected override async divineHandler(payloads?: TIn[]): Promise<TOut[]> {\n if (!payloads) return []\n const strippedPayloads = payloads.map((payload) => {\n const p = { ...payload } as TIn\n return PayloadBuilder.omitMeta(p as TIn)\n })\n const combinations\n = this.transformableSchemas.includes(BoundWitnessSchema)\n ? await combinationsByBoundwitness(strippedPayloads)\n : await combinationsBySchema(strippedPayloads, this.transformableSchemas)\n return await Promise.all(\n combinations.map((combination) => {\n return reducePayloads<TOut>(combination, this.payloadTransformers, this.destinationSchema, this.config.excludeSources ?? false)\n }),\n )\n }\n\n /**\n * Identifies if a payload is one that is transformed by this diviner\n * @param x The candidate payload\n * @returns True if the payload is one transformed by this diviner, false otherwise\n */\n protected isTransformablePayload = (x: Payload) => {\n return this.transformableSchemas.includes(x?.schema)\n }\n\n /**\n * Identifies if a schema is one that is transformed by this diviner\n * @param schema The candidate schema\n * @returns True if this schema is one transformed by this diviner, false otherwise\n */\n protected isTransformableSchema = (schema?: string | null) => {\n return typeof schema === 'string' ? this.transformableSchemas.includes(schema) : false\n }\n}\n","import type { SchemaToJsonPathTransformExpressionsDictionary, SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-aggregate-model'\nimport { toPayloadTransformer } from '@xyo-network/diviner-jsonpath-memory'\n\n/**\n * Materializes the JSON-path expressions into memoized functions by converting a\n * dictionary of schema to JSON Path transform expressions to a dictionary\n * of schema to payload transformers\n * @param schemaTransforms The schema transforms to convert\n * @returns A dictionary of schema to payload transformers\n */\nexport const jsonPathToTransformersDictionary = (\n schemaTransforms: SchemaToJsonPathTransformExpressionsDictionary,\n): SchemaToPayloadTransformersDictionary => {\n return Object.fromEntries(\n Object.entries(schemaTransforms).map(([schema, jsonPathTransformerExpressions]) => {\n const transformers = jsonPathTransformerExpressions.map(toPayloadTransformer)\n return [schema, transformers]\n }),\n )\n}\n","import { exists } from '@xylabs/sdk-js'\nimport type { SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-aggregate-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, WithoutSchema } from '@xyo-network/payload-model'\n\n/**\n * Reduces the payloads to a single payload using the supplied transformers\n * @param payloads The payloads to reduce\n * @param payloadTransformers The transformers to use to convert the payloads to the destination payload\n * @param destinationSchema The schema of the destination payload\n * @param excludeSources Exclude the source hashes from the destination payload\n * @returns The reduced payload\n */\nexport const reducePayloads = async <T extends Payload = Payload>(\n payloads: Payload[],\n payloadTransformers: SchemaToPayloadTransformersDictionary,\n destinationSchema: string,\n excludeSources = false,\n): Promise<T> => {\n // Use the payload transformers to convert the fields from the source payloads to the destination fields\n const payloadFields = payloads.filter(exists).flatMap<WithoutSchema<Payload>[]>((payload) => {\n // Find the transformers for this payload\n const transformers = payloadTransformers[payload.schema]\n // If transformers exist, apply them to the payload otherwise return an empty array\n return transformers ? transformers.map(transform => transform(payload)) : []\n })\n // Include all the sources for reference\n const baseObject = excludeSources ? {} : { sources: await PayloadBuilder.dataHashes(payloads) }\n // Build and return the payload\n return new PayloadBuilder<T>({ schema: destinationSchema }).fields(Object.assign(baseObject, ...payloadFields)).build()\n}\n\n/**\n * Reduces the arrays of payload arrays to an array of payloads using the supplied transformers\n * @param payloadsArray The arrays of payloads to reduce\n * @param payloadTransformers The transformers to use to convert the payloads to the destination payloads\n * @param excludeSources Exclude the source hashes from the destination payload\n * @returns The reduced payloads\n */\nexport const reducePayloadsArray = async <T extends Payload = Payload>(\n payloadsArray: Payload[][],\n payloadTransformers: SchemaToPayloadTransformersDictionary,\n destinationSchema: string,\n excludeSources = false,\n): Promise<T[]> => {\n return await Promise.all(\n payloadsArray.map(async (payloads) => {\n return await reducePayloads<T>(payloads, payloadTransformers, destinationSchema, excludeSources)\n }),\n )\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAOhC,SAAS,4CAA4C;AAErD,SAAS,kBAAAA,uBAAsB;AAE/B,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B,4BAA4B;;;ACbjE,SAAS,4BAA4B;AAS9B,IAAM,mCAAmC,CAC9C,qBAC0C;AAC1C,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQ,gBAAgB,EAAE,IAAI,CAAC,CAAC,QAAQ,8BAA8B,MAAM;AACjF,YAAM,eAAe,+BAA+B,IAAI,oBAAoB;AAC5E,aAAO,CAAC,QAAQ,YAAY;AAAA,IAC9B,CAAC;AAAA,EACH;AACF;;;ACnBA,SAAS,cAAc;AAEvB,SAAS,sBAAsB;AAWxB,IAAM,iBAAiB,OAC5B,UACA,qBACA,mBACA,iBAAiB,UACF;AAEf,QAAM,gBAAgB,SAAS,OAAO,MAAM,EAAE,QAAkC,CAAC,YAAY;AAE3F,UAAM,eAAe,oBAAoB,QAAQ,MAAM;AAEvD,WAAO,eAAe,aAAa,IAAI,eAAa,UAAU,OAAO,CAAC,IAAI,CAAC;AAAA,EAC7E,CAAC;AAED,QAAM,aAAa,iBAAiB,CAAC,IAAI,EAAE,SAAS,MAAM,eAAe,WAAW,QAAQ,EAAE;AAE9F,SAAO,IAAI,eAAkB,EAAE,QAAQ,kBAAkB,CAAC,EAAE,OAAO,OAAO,OAAO,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AAkB,KAAK,oBAAoB;AAC5E,WAAO,MAAM,QAAQ;AAAA,MACnB,aAAa,IAAI,CAAC,gBAAgB;AAChC,eAAO,eAAqB,aAAa,KAAK,qBAAqB,KAAK,mBAAmB,KAAK,OAAO,kBAAkB,KAAK;AAAA,MAChI,CAAC;AAAA,IACH;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOU,yBAAyB,CAAC,MAAe;AACjD,WAAO,KAAK,qBAAqB,SAAS,GAAG,MAAM;AAAA,EACrD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOU,wBAAwB,CAAC,WAA2B;AAC5D,WAAO,OAAO,WAAW,WAAW,KAAK,qBAAqB,SAAS,MAAM,IAAI;AAAA,EACnF;AACF;","names":["PayloadBuilder","PayloadBuilder"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/diviner-jsonpath-aggregate-memory",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.20",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -36,29 +36,28 @@
|
|
|
36
36
|
"!**/*.test.*"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@xylabs/
|
|
40
|
-
"@
|
|
41
|
-
"@xyo-network/
|
|
42
|
-
"@xyo-network/diviner-
|
|
43
|
-
"@xyo-network/diviner-jsonpath-
|
|
44
|
-
"@xyo-network/diviner-
|
|
45
|
-
"@xyo-network/
|
|
46
|
-
"@xyo-network/payload-
|
|
47
|
-
"@xyo-network/payload-
|
|
48
|
-
"@xyo-network/payload-utils": "~5.2.18"
|
|
39
|
+
"@xylabs/sdk-js": "~5.0.61",
|
|
40
|
+
"@xyo-network/boundwitness-model": "workspace:~",
|
|
41
|
+
"@xyo-network/diviner-abstract": "workspace:~",
|
|
42
|
+
"@xyo-network/diviner-jsonpath-aggregate-model": "workspace:~",
|
|
43
|
+
"@xyo-network/diviner-jsonpath-memory": "workspace:~",
|
|
44
|
+
"@xyo-network/diviner-model": "workspace:~",
|
|
45
|
+
"@xyo-network/payload-builder": "workspace:~",
|
|
46
|
+
"@xyo-network/payload-model": "workspace:~",
|
|
47
|
+
"@xyo-network/payload-utils": "workspace:~"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
|
-
"@xylabs/ts-scripts-yarn3": "~7.2.
|
|
52
|
-
"@xylabs/tsconfig": "~7.2.
|
|
53
|
-
"@xylabs/vitest-extended": "~5.0.
|
|
54
|
-
"@xyo-network/account": "
|
|
55
|
-
"@xyo-network/account-model": "
|
|
56
|
-
"@xyo-network/boundwitness-builder": "
|
|
57
|
-
"@xyo-network/diviner-jsonpath-model": "
|
|
50
|
+
"@xylabs/ts-scripts-yarn3": "~7.2.32",
|
|
51
|
+
"@xylabs/tsconfig": "~7.2.32",
|
|
52
|
+
"@xylabs/vitest-extended": "~5.0.61",
|
|
53
|
+
"@xyo-network/account": "workspace:~",
|
|
54
|
+
"@xyo-network/account-model": "workspace:~",
|
|
55
|
+
"@xyo-network/boundwitness-builder": "workspace:~",
|
|
56
|
+
"@xyo-network/diviner-jsonpath-model": "workspace:~",
|
|
58
57
|
"typescript": "~5.9.3",
|
|
59
|
-
"vitest": "~4.0.
|
|
58
|
+
"vitest": "~4.0.16"
|
|
60
59
|
},
|
|
61
60
|
"publishConfig": {
|
|
62
61
|
"access": "public"
|
|
63
62
|
}
|
|
64
|
-
}
|
|
63
|
+
}
|
package/src/Diviner.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { exists } from '@xylabs/
|
|
1
|
+
import { exists } from '@xylabs/sdk-js'
|
|
2
2
|
import type { SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-aggregate-model'
|
|
3
3
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
4
4
|
import type { Payload, WithoutSchema } from '@xyo-network/payload-model'
|