diff --git a/packages/miroir-core/src/0_interfaces/1_core/bootstrapJzodSchemas/getMiroirFundamentalJzodSchema.ts b/packages/miroir-core/src/0_interfaces/1_core/bootstrapJzodSchemas/getMiroirFundamentalJzodSchema.ts index cc7b6ea2..11413ce3 100644 --- a/packages/miroir-core/src/0_interfaces/1_core/bootstrapJzodSchemas/getMiroirFundamentalJzodSchema.ts +++ b/packages/miroir-core/src/0_interfaces/1_core/bootstrapJzodSchemas/getMiroirFundamentalJzodSchema.ts @@ -1549,7 +1549,7 @@ export function getMiroirFundamentalJzodSchema( // type: "schemaReference", // definition: { // absolutePath: "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - // relativePath: "queryExtractorTransformer", + // relativePath: "queryExtractorRuntimeTransformer", // }, // }, type: "schemaReference", @@ -1557,7 +1557,7 @@ export function getMiroirFundamentalJzodSchema( definition: { absolutePath: "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", relativePath: "miroirSelectQueriesRecord", - // relativePath: "queryExtractorTransformer", + // relativePath: "queryExtractorRuntimeTransformer", }, }, runtimeTransformers: { @@ -1567,7 +1567,7 @@ export function getMiroirFundamentalJzodSchema( type: "schemaReference", definition: { absolutePath: "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - relativePath: "queryExtractorTransformer", + relativePath: "queryExtractorRuntimeTransformer", }, }, // type: "schemaReference", @@ -2264,7 +2264,7 @@ export function getMiroirFundamentalJzodSchema( metaModel: (miroirFundamentalJzodSchema as any).definition.context.metaModel, objectTemplateInnerReference: (transformerJzodSchema as any).definition.context.objectTemplateInnerReference, objectBuildTemplate: (transformerJzodSchema as any).definition.context.objectBuildTemplate, - objectRuntimeTemplate: (transformerJzodSchema as any).definition.context.objectRuntimeTemplate, + runtimeTransformer: (transformerJzodSchema as any).definition.context.runtimeTransformer, indexedDbStoreSectionConfiguration: (miroirFundamentalJzodSchema as any).definition.context .indexedDbStoreSectionConfiguration, filesystemDbStoreSectionConfiguration: (miroirFundamentalJzodSchema as any).definition.context @@ -2320,9 +2320,8 @@ export function getMiroirFundamentalJzodSchema( querySelectExtractorWrapper: (miroirFundamentalJzodSchema as any).definition.context.querySelectExtractorWrapper, queryExtractorTransformerAbstract: (miroirFundamentalJzodSchema as any).definition.context.queryExtractorTransformerAbstract, queryExtractorTransformerUnique: (miroirFundamentalJzodSchema as any).definition.context.queryExtractorTransformerUnique, - queryExtractorRuntimeTransformer: (miroirFundamentalJzodSchema as any).definition.context.queryExtractorRuntimeTransformer, queryExtractorTransformerCount: (miroirFundamentalJzodSchema as any).definition.context.queryExtractorTransformerCount, - queryExtractorTransformer: (miroirFundamentalJzodSchema as any).definition.context.queryExtractorTransformer, + queryExtractorRuntimeTransformer: (miroirFundamentalJzodSchema as any).definition.context.queryExtractorRuntimeTransformer, querySelectObject: (miroirFundamentalJzodSchema as any).definition.context.querySelectObject, querySelectObjectList: (miroirFundamentalJzodSchema as any).definition.context.querySelectObjectList, querySelectByQueryCombiner: (miroirFundamentalJzodSchema as any).definition.context.querySelectByQueryCombiner, diff --git a/packages/miroir-core/src/0_interfaces/1_core/preprocessor-generated/miroirFundamentalJzodSchema.ts b/packages/miroir-core/src/0_interfaces/1_core/preprocessor-generated/miroirFundamentalJzodSchema.ts index e3c494bb..35a8f058 100644 --- a/packages/miroir-core/src/0_interfaces/1_core/preprocessor-generated/miroirFundamentalJzodSchema.ts +++ b/packages/miroir-core/src/0_interfaces/1_core/preprocessor-generated/miroirFundamentalJzodSchema.ts @@ -2534,7 +2534,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "definition": { @@ -2679,7 +2679,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "selectData": { @@ -2725,7 +2725,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "selectData": { @@ -2836,7 +2836,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "section": { @@ -3127,7 +3127,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "definition": { @@ -3272,7 +3272,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "selectData": { @@ -3318,7 +3318,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "selectData": { @@ -3432,7 +3432,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "section": { @@ -4677,20 +4677,12 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "objectRuntimeTemplate" + "relativePath": "runtimeTransformer" }, "context": {} } } }, - "queryExtractorTransformer": { - "type": "schemaReference", - "definition": { - "relativePath": "queryExtractorRuntimeTransformer", - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739" - }, - "context": {} - }, "querySelect": { "type": "union", "discriminator": "queryType", @@ -4703,14 +4695,6 @@ export const miroirFundamentalJzodSchema = { }, "context": {} }, - { - "type": "schemaReference", - "definition": { - "relativePath": "queryExtractorTransformer", - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739" - }, - "context": {} - }, { "type": "object", "definition": { @@ -5436,7 +5420,7 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } } } @@ -8280,7 +8264,7 @@ export const miroirFundamentalJzodSchema = { } ] }, - "objectRuntimeTemplate": { + "runtimeTransformer": { "type": "union", "discriminator": "templateType", "definition": [ @@ -16057,7 +16041,7 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "optional": true, "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer" }, "context": {} }, @@ -16465,7 +16449,7 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "optional": true, "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer" }, "context": {} }, @@ -16603,7 +16587,7 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "optional": true, "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer" }, "context": {} }, @@ -16920,7 +16904,7 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "optional": true, "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer" }, "context": {} }, @@ -17307,7 +17291,7 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "optional": true, "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer" }, "context": {} }, @@ -17718,7 +17702,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" }, "context": {} }, @@ -17858,7 +17842,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" }, "context": {} }, @@ -18193,7 +18177,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" }, "context": {} }, @@ -19089,7 +19073,7 @@ export const miroirFundamentalJzodSchema = { } ] }, - "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectRuntimeTemplate": { + "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_runtimeTransformer": { "type": "union", "discriminator": "templateType", "definition": [ @@ -25539,7 +25523,7 @@ export const miroirFundamentalJzodSchema = { } ] }, - "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer": { + "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerCount": { "type": "union", "definition": [ { @@ -25564,7 +25548,7 @@ export const miroirFundamentalJzodSchema = { "definition": [ { "type": "literal", - "definition": "actionRuntimeTransformer" + "definition": "count" }, { "type": "schemaReference", @@ -25574,15 +25558,13 @@ export const miroirFundamentalJzodSchema = { } ] }, - "actionRuntimeTransformer": { + "groupBy": { "type": "union", + "optional": true, "definition": [ { - "type": "schemaReference", - "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectRuntimeTemplate" - }, - "context": {} + "type": "string", + "optional": true }, { "type": "schemaReference", @@ -25596,7 +25578,7 @@ export const miroirFundamentalJzodSchema = { } ] }, - "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerCount": { + "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer": { "type": "union", "definition": [ { @@ -25621,7 +25603,7 @@ export const miroirFundamentalJzodSchema = { "definition": [ { "type": "literal", - "definition": "count" + "definition": "actionRuntimeTransformer" }, { "type": "schemaReference", @@ -25631,13 +25613,15 @@ export const miroirFundamentalJzodSchema = { } ] }, - "groupBy": { + "actionRuntimeTransformer": { "type": "union", - "optional": true, "definition": [ { - "type": "string", - "optional": true + "type": "schemaReference", + "definition": { + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_runtimeTransformer" + }, + "context": {} }, { "type": "schemaReference", @@ -25651,24 +25635,6 @@ export const miroirFundamentalJzodSchema = { } ] }, - "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer": { - "type": "union", - "definition": [ - { - "type": "schemaReference", - "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer" - }, - "context": {} - }, - { - "type": "schemaReference", - "definition": { - "relativePath": "carryOnObject" - } - } - ] - }, "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObject": { "type": "union", "discriminator": "queryType", @@ -25907,24 +25873,6 @@ export const miroirFundamentalJzodSchema = { } ] }, - { - "type": "union", - "definition": [ - { - "type": "schemaReference", - "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" - }, - "context": {} - }, - { - "type": "schemaReference", - "definition": { - "relativePath": "carryOnObject" - } - } - ] - }, { "type": "object", "definition": { @@ -26511,7 +26459,7 @@ export const miroirFundamentalJzodSchema = { { "type": "schemaReference", "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer" }, "context": {} }, diff --git a/packages/miroir-core/src/0_interfaces/1_core/preprocessor-generated/miroirFundamentalType.ts b/packages/miroir-core/src/0_interfaces/1_core/preprocessor-generated/miroirFundamentalType.ts index 63d1c36b..67cc9870 100644 --- a/packages/miroir-core/src/0_interfaces/1_core/preprocessor-generated/miroirFundamentalType.ts +++ b/packages/miroir-core/src/0_interfaces/1_core/preprocessor-generated/miroirFundamentalType.ts @@ -641,7 +641,7 @@ export type Menu = { export type ObjectInstanceReportSection = { type: "objectInstanceReportSection"; combiners?: MiroirSelectQueriesRecord | undefined; - runtimeTransformers?: QueryExtractorTransformer | undefined; + runtimeTransformers?: QueryExtractorRuntimeTransformer | undefined; definition: { label?: string | undefined; parentUuid: string; @@ -663,14 +663,14 @@ export type ObjectListReportSection = { export type GridReportSection = { type: "grid"; combiners?: MiroirSelectQueriesRecord | undefined; - runtimeTransformers?: QueryExtractorTransformer | undefined; + runtimeTransformers?: QueryExtractorRuntimeTransformer | undefined; selectData?: MiroirSelectQueriesRecord | undefined; definition: ReportSection[][]; }; export type ListReportSection = { type: "list"; combiners?: MiroirSelectQueriesRecord | undefined; - runtimeTransformers?: QueryExtractorTransformer | undefined; + runtimeTransformers?: QueryExtractorRuntimeTransformer | undefined; selectData?: MiroirSelectQueriesRecord | undefined; definition: (ObjectInstanceReportSection | ObjectListReportSection)[]; }; @@ -686,7 +686,7 @@ export type RootReportSection = { [x: string]: QuerySelectExtractorWrapper; } | undefined; combiners?: MiroirSelectQueriesRecord | undefined; - runtimeTransformers?: QueryExtractorTransformer | undefined; + runtimeTransformers?: QueryExtractorRuntimeTransformer | undefined; section: ReportSection; }; export type JzodObjectOrReference = JzodReference | JzodObject; @@ -722,7 +722,7 @@ export type Report = { [x: string]: QuerySelectExtractorWrapper; } | undefined; combiners?: MiroirSelectQueriesRecord | undefined; - runtimeTransformers?: QueryExtractorTransformer | undefined; + runtimeTransformers?: QueryExtractorRuntimeTransformer | undefined; section: ReportSection; }; }; @@ -946,10 +946,9 @@ export type QueryExtractorRuntimeTransformer = { referencedExtractor: string; orderBy?: string | undefined; queryName: "actionRuntimeTransformer"; - actionRuntimeTransformer: ObjectRuntimeTemplate; + actionRuntimeTransformer: RuntimeTransformer; }; -export type QueryExtractorTransformer = QueryExtractorRuntimeTransformer; -export type QuerySelect = QuerySelectExtractorWrapper | QueryExtractorTransformer | { +export type QuerySelect = QuerySelectExtractorWrapper | { queryType: "wrapperReturningObject"; definition: { [x: string]: QuerySelect; @@ -1073,7 +1072,7 @@ export type ExtractorForRecordOfExtractors = { } | undefined; combiners?: MiroirSelectQueriesRecord | undefined; runtimeTransformers?: { - [x: string]: QueryExtractorTransformer; + [x: string]: QueryExtractorRuntimeTransformer; } | undefined; }; export type DomainModelGetEntityDefinitionExtractor = { @@ -1527,7 +1526,7 @@ export type ObjectTemplateInnerReference = { templateType: "parameterReference"; referenceName: string; }; -export type ObjectRuntimeTemplate = { +export type RuntimeTransformer = { templateType: "count"; interpolation: "runtime"; referencedExtractor: string; @@ -2247,7 +2246,7 @@ export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_jzodObjectOrReference = export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectInstanceReportSection = CarryOnObject | { type: "objectInstanceReportSection" | CarryOnObject; combiners?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; - runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer | undefined) | CarryOnObject) | undefined; + runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer | undefined) | CarryOnObject) | undefined; definition: CarryOnObject | { label?: ((string | undefined) | CarryOnObject) | undefined; parentUuid: string | CarryOnObject; @@ -2269,14 +2268,14 @@ export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectListReportSection export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_gridReportSection = CarryOnObject | { type: "grid" | CarryOnObject; combiners?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; - runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer | undefined) | CarryOnObject) | undefined; + runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer | undefined) | CarryOnObject) | undefined; selectData?: ((MiroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; definition: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_reportSection | CarryOnObject)[] | CarryOnObject)[] | CarryOnObject; }; export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_listReportSection = CarryOnObject | { type: "list" | CarryOnObject; combiners?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; - runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer | undefined) | CarryOnObject) | undefined; + runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer | undefined) | CarryOnObject) | undefined; selectData?: ((MiroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; definition: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectInstanceReportSection | CarryOnObject) | (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectListReportSection | CarryOnObject) | CarryOnObject)[] | CarryOnObject; }; @@ -2292,7 +2291,7 @@ export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_rootReportSection = Car [x: string]: CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapper | CarryOnObject; } | undefined) | CarryOnObject) | undefined; combiners?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; - runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer | undefined) | CarryOnObject) | undefined; + runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer | undefined) | CarryOnObject) | undefined; section: CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_reportSection | CarryOnObject; }; export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_report = CarryOnObject | { @@ -2354,7 +2353,7 @@ export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectBuildTemplate = ( attributeValue: CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectBuildTemplate | CarryOnObject; })[] | CarryOnObject; } | CarryOnObject; -export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectRuntimeTemplate = { +export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_runtimeTransformer = { templateType: "count" | CarryOnObject; interpolation: "runtime" | CarryOnObject; referencedExtractor: string | CarryOnObject; @@ -2761,21 +2760,20 @@ export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransform queryName: "unique" | CarryOnObject; attribute: string | CarryOnObject; }; -export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer = CarryOnObject | { +export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerCount = CarryOnObject | { queryType: "extractorTransformer" | CarryOnObject; referencedExtractor: string | CarryOnObject; orderBy?: ((string | undefined) | CarryOnObject) | undefined; - queryName: "actionRuntimeTransformer" | CarryOnObject; - actionRuntimeTransformer: CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectRuntimeTemplate | CarryOnObject; + queryName: "count" | CarryOnObject; + groupBy?: ((string | undefined) | CarryOnObject) | undefined; }; -export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerCount = CarryOnObject | { +export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer = CarryOnObject | { queryType: "extractorTransformer" | CarryOnObject; referencedExtractor: string | CarryOnObject; orderBy?: ((string | undefined) | CarryOnObject) | undefined; - queryName: "count" | CarryOnObject; - groupBy?: ((string | undefined) | CarryOnObject) | undefined; + queryName: "actionRuntimeTransformer" | CarryOnObject; + actionRuntimeTransformer: CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_runtimeTransformer | CarryOnObject; }; -export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer = CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer | CarryOnObject; export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObject = (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectByRelation | CarryOnObject) | (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractObjectByDirectReference | CarryOnObject) | CarryOnObject; export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectList = (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractObjectListByEntity | CarryOnObject) | (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectListByRelation | CarryOnObject) | (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectListByManyToManyRelation | CarryOnObject) | CarryOnObject; export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectByQueryCombiner = CarryOnObject | { @@ -2786,7 +2784,7 @@ export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectByQueryCombi rootQueryObjectTransformer: CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_recordOfTransformers | CarryOnObject; }; }; -export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelect = (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapper | CarryOnObject) | (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer | CarryOnObject) | { +export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelect = (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapper | CarryOnObject) | { queryType: "wrapperReturningObject" | CarryOnObject; definition: { [x: string]: CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelect | CarryOnObject; @@ -2832,7 +2830,7 @@ export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractorForRecordOfExt } | undefined) | CarryOnObject) | undefined; combiners?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; runtimeTransformers?: (({ - [x: string]: CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer | CarryOnObject; + [x: string]: CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer | CarryOnObject; } | undefined) | CarryOnObject) | undefined; }; export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryAction = CarryOnObject | { @@ -2926,15 +2924,15 @@ export const simpleMenu: z.ZodType = z.object({menuType:z.literal("s export const complexMenu: z.ZodType = z.object({menuType:z.literal("complexMenu"), definition:z.array(z.lazy(() =>sectionOfMenu))}).strict(); export const menuDefinition: z.ZodType = z.union([z.lazy(() =>simpleMenu), z.lazy(() =>complexMenu)]); export const menu: z.ZodType = z.object({uuid:z.string().uuid(), parentName:z.string().optional(), parentUuid:z.string().uuid(), parentDefinitionVersionUuid:z.string().uuid().optional(), name:z.string(), defaultLabel:z.string(), description:z.string().optional(), definition:z.lazy(() =>menuDefinition)}).strict(); -export const objectInstanceReportSection: z.ZodType = z.object({type:z.literal("objectInstanceReportSection"), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.lazy(() =>queryExtractorTransformer).optional(), definition:z.object({label:z.string().optional(), parentUuid:z.string(), fetchedDataReference:z.string().optional(), query:z.lazy(() =>querySelectObject).optional()}).strict()}).strict(); +export const objectInstanceReportSection: z.ZodType = z.object({type:z.literal("objectInstanceReportSection"), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.lazy(() =>queryExtractorRuntimeTransformer).optional(), definition:z.object({label:z.string().optional(), parentUuid:z.string(), fetchedDataReference:z.string().optional(), query:z.lazy(() =>querySelectObject).optional()}).strict()}).strict(); export const objectListReportSection: z.ZodType = z.object({type:z.literal("objectListReportSection"), definition:z.object({label:z.string().optional(), parentName:z.string().optional(), parentUuid:z.string().uuid(), fetchedDataReference:z.string().optional(), query:z.lazy(() =>querySelectObject).optional(), sortByAttribute:z.string().optional()}).strict()}).strict(); -export const gridReportSection: z.ZodType = z.object({type:z.literal("grid"), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.lazy(() =>queryExtractorTransformer).optional(), selectData:z.lazy(() =>miroirSelectQueriesRecord).optional(), definition:z.array(z.array(z.lazy(() =>reportSection)))}).strict(); -export const listReportSection: z.ZodType = z.object({type:z.literal("list"), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.lazy(() =>queryExtractorTransformer).optional(), selectData:z.lazy(() =>miroirSelectQueriesRecord).optional(), definition:z.array(z.union([z.lazy(() =>objectInstanceReportSection), z.lazy(() =>objectListReportSection)]))}).strict(); +export const gridReportSection: z.ZodType = z.object({type:z.literal("grid"), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.lazy(() =>queryExtractorRuntimeTransformer).optional(), selectData:z.lazy(() =>miroirSelectQueriesRecord).optional(), definition:z.array(z.array(z.lazy(() =>reportSection)))}).strict(); +export const listReportSection: z.ZodType = z.object({type:z.literal("list"), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.lazy(() =>queryExtractorRuntimeTransformer).optional(), selectData:z.lazy(() =>miroirSelectQueriesRecord).optional(), definition:z.array(z.union([z.lazy(() =>objectInstanceReportSection), z.lazy(() =>objectListReportSection)]))}).strict(); export const reportSection: z.ZodType = z.union([z.lazy(() =>gridReportSection), z.lazy(() =>listReportSection), z.lazy(() =>objectListReportSection), z.lazy(() =>objectInstanceReportSection)]); -export const rootReportSection: z.ZodType = z.object({reportParametersToFetchQueryParametersTransformer:z.record(z.string(),z.string()).optional(), reportParameters:z.record(z.string(),z.string()).optional(), extractors:z.record(z.string(),z.lazy(() =>querySelectExtractorWrapper)).optional(), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.lazy(() =>queryExtractorTransformer).optional(), section:z.lazy(() =>reportSection)}).strict(); +export const rootReportSection: z.ZodType = z.object({reportParametersToFetchQueryParametersTransformer:z.record(z.string(),z.string()).optional(), reportParameters:z.record(z.string(),z.string()).optional(), extractors:z.record(z.string(),z.lazy(() =>querySelectExtractorWrapper)).optional(), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.lazy(() =>queryExtractorRuntimeTransformer).optional(), section:z.lazy(() =>reportSection)}).strict(); export const jzodObjectOrReference: z.ZodType = z.union([z.lazy(() =>jzodReference), z.lazy(() =>jzodObject)]); export const jzodSchema: z.ZodType = z.object({uuid:z.string().uuid(), parentName:z.string(), parentUuid:z.string().uuid(), parentDefinitionVersionUuid:z.string().uuid().optional(), name:z.string(), conceptLevel:z.enum(["MetaModel","Model","Data"]).optional(), defaultLabel:z.string().optional(), description:z.string().optional(), definition:z.lazy(() =>jzodObjectOrReference).optional()}).strict(); -export const report: z.ZodType = z.object({uuid:z.string().uuid(), parentName:z.string().optional(), parentUuid:z.string().uuid(), parentDefinitionVersionUuid:z.string().uuid().optional(), conceptLevel:z.enum(["MetaModel","Model","Data"]).optional(), name:z.string(), defaultLabel:z.string(), type:z.enum(["list","grid"]).optional(), application:z.string().uuid().optional(), definition:z.object({reportParametersToFetchQueryParametersTransformer:z.record(z.string(),z.string()).optional(), reportParameters:z.record(z.string(),z.string()).optional(), extractors:z.record(z.string(),z.lazy(() =>querySelectExtractorWrapper)).optional(), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.lazy(() =>queryExtractorTransformer).optional(), section:z.lazy(() =>reportSection)}).strict()}).strict(); +export const report: z.ZodType = z.object({uuid:z.string().uuid(), parentName:z.string().optional(), parentUuid:z.string().uuid(), parentDefinitionVersionUuid:z.string().uuid().optional(), conceptLevel:z.enum(["MetaModel","Model","Data"]).optional(), name:z.string(), defaultLabel:z.string(), type:z.enum(["list","grid"]).optional(), application:z.string().uuid().optional(), definition:z.object({reportParametersToFetchQueryParametersTransformer:z.record(z.string(),z.string()).optional(), reportParameters:z.record(z.string(),z.string()).optional(), extractors:z.record(z.string(),z.lazy(() =>querySelectExtractorWrapper)).optional(), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.lazy(() =>queryExtractorRuntimeTransformer).optional(), section:z.lazy(() =>reportSection)}).strict()}).strict(); export const metaModel: z.ZodType = z.object({applicationVersions:z.array(z.lazy(() =>applicationVersion)), applicationVersionCrossEntityDefinition:z.array(z.object({uuid:z.string().uuid(), parentName:z.string().optional(), parentUuid:z.string().uuid(), conceptLevel:z.enum(["MetaModel","Model","Data"]).optional(), applicationVersion:z.string().uuid(), entityDefinition:z.string().uuid()}).strict()), configuration:z.array(z.lazy(() =>storeBasedConfiguration)), entities:z.array(z.lazy(() =>entity)), entityDefinitions:z.array(z.lazy(() =>entityDefinition)), jzodSchemas:z.array(z.lazy(() =>jzodSchema)), menus:z.array(z.lazy(() =>menu)), reports:z.array(z.lazy(() =>report))}).strict(); export const _________________________________configuration_and_bundles_________________________________: z.ZodType<_________________________________configuration_and_bundles_________________________________> = z.never(); export const indexedDbStoreSectionConfiguration: z.ZodType = z.object({emulatedServerType:z.literal("indexedDb"), indexedDbName:z.string()}).strict(); @@ -2973,9 +2971,8 @@ export const querySelectExtractorWrapper: z.ZodType export const queryExtractorTransformerAbstract: z.ZodType = z.object({queryType:z.literal("extractorTransformer"), referencedExtractor:z.string(), orderBy:z.string().optional()}).strict(); export const queryExtractorTransformerUnique: z.ZodType = z.object({queryType:z.literal("extractorTransformer"), referencedExtractor:z.string(), orderBy:z.string().optional()}).strict().extend({queryName:z.literal("unique"), attribute:z.string()}).strict(); export const queryExtractorTransformerCount: z.ZodType = z.object({queryType:z.literal("extractorTransformer"), referencedExtractor:z.string(), orderBy:z.string().optional()}).strict().extend({queryName:z.literal("count"), groupBy:z.string().optional()}).strict(); -export const queryExtractorRuntimeTransformer: z.ZodType = z.object({queryType:z.literal("extractorTransformer"), referencedExtractor:z.string(), orderBy:z.string().optional()}).strict().extend({queryName:z.literal("actionRuntimeTransformer"), actionRuntimeTransformer:z.lazy(() =>objectRuntimeTemplate)}).strict(); -export const queryExtractorTransformer: z.ZodType = z.lazy(() =>queryExtractorRuntimeTransformer); -export const querySelect: z.ZodType = z.union([z.lazy(() =>querySelectExtractorWrapper), z.lazy(() =>queryExtractorTransformer), z.object({queryType:z.literal("wrapperReturningObject"), definition:z.record(z.string(),z.lazy(() =>querySelect))}).strict(), z.object({queryType:z.literal("wrapperReturningList"), definition:z.array(z.lazy(() =>querySelect))}).strict(), z.lazy(() =>extractObjectByDirectReference), z.lazy(() =>querySelectObjectList), z.lazy(() =>querySelectObjectByRelation), z.lazy(() =>querySelectObjectListByRelation), z.lazy(() =>querySelectObjectListByManyToManyRelation), z.lazy(() =>querySelectByQueryCombiner), z.object({queryType:z.literal("literal"), definition:z.string()}).strict(), z.object({queryType:z.literal("queryContextReference"), queryReference:z.string()}).strict()]); +export const queryExtractorRuntimeTransformer: z.ZodType = z.object({queryType:z.literal("extractorTransformer"), referencedExtractor:z.string(), orderBy:z.string().optional()}).strict().extend({queryName:z.literal("actionRuntimeTransformer"), actionRuntimeTransformer:z.lazy(() =>runtimeTransformer)}).strict(); +export const querySelect: z.ZodType = z.union([z.lazy(() =>querySelectExtractorWrapper), z.object({queryType:z.literal("wrapperReturningObject"), definition:z.record(z.string(),z.lazy(() =>querySelect))}).strict(), z.object({queryType:z.literal("wrapperReturningList"), definition:z.array(z.lazy(() =>querySelect))}).strict(), z.lazy(() =>extractObjectByDirectReference), z.lazy(() =>querySelectObjectList), z.lazy(() =>querySelectObjectByRelation), z.lazy(() =>querySelectObjectListByRelation), z.lazy(() =>querySelectObjectListByManyToManyRelation), z.lazy(() =>querySelectByQueryCombiner), z.object({queryType:z.literal("literal"), definition:z.string()}).strict(), z.object({queryType:z.literal("queryContextReference"), queryReference:z.string()}).strict()]); export const miroirSelectQueriesRecord: z.ZodType = z.record(z.string(),z.lazy(() =>querySelect)); export const domainElementVoid: z.ZodType = z.object({elementType:z.literal("void"), elementValue:z.void()}).strict(); export const domainElementAny: z.ZodType = z.object({elementType:z.literal("any"), elementValue:z.any()}).strict(); @@ -2999,7 +2996,7 @@ export const domainModelRootExtractor: z.ZodType = z.o export const extractorForSingleObject: z.ZodType = z.object({deploymentUuid:z.string().uuid(), pageParams:z.lazy(() =>domainElementObject), queryParams:z.lazy(() =>domainElementObject), contextResults:z.lazy(() =>domainElementObject)}).strict().extend({queryType:z.literal("domainModelSingleExtractor"), select:z.lazy(() =>querySelectObject)}).strict(); export const extractorForSingleObjectList: z.ZodType = z.object({deploymentUuid:z.string().uuid(), pageParams:z.lazy(() =>domainElementObject), queryParams:z.lazy(() =>domainElementObject), contextResults:z.lazy(() =>domainElementObject)}).strict().extend({queryType:z.literal("domainModelSingleExtractor"), select:z.lazy(() =>querySelectObjectList)}).strict(); export const domainModelSingleExtractor: z.ZodType = z.union([z.lazy(() =>extractorForSingleObject), z.lazy(() =>extractorForSingleObjectList)]); -export const extractorForRecordOfExtractors: z.ZodType = z.object({deploymentUuid:z.string().uuid(), pageParams:z.lazy(() =>domainElementObject), queryParams:z.lazy(() =>domainElementObject), contextResults:z.lazy(() =>domainElementObject)}).strict().extend({queryType:z.literal("extractorForRecordOfExtractors"), extractors:z.record(z.string(),z.lazy(() =>querySelectExtractorWrapper)).optional(), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.record(z.string(),z.lazy(() =>queryExtractorTransformer)).optional()}).strict(); +export const extractorForRecordOfExtractors: z.ZodType = z.object({deploymentUuid:z.string().uuid(), pageParams:z.lazy(() =>domainElementObject), queryParams:z.lazy(() =>domainElementObject), contextResults:z.lazy(() =>domainElementObject)}).strict().extend({queryType:z.literal("extractorForRecordOfExtractors"), extractors:z.record(z.string(),z.lazy(() =>querySelectExtractorWrapper)).optional(), combiners:z.lazy(() =>miroirSelectQueriesRecord).optional(), runtimeTransformers:z.record(z.string(),z.lazy(() =>queryExtractorRuntimeTransformer)).optional()}).strict(); export const domainModelGetEntityDefinitionExtractor: z.ZodType = z.object({deploymentUuid:z.string().uuid(), pageParams:z.lazy(() =>domainElementObject), queryParams:z.lazy(() =>domainElementObject), contextResults:z.lazy(() =>domainElementObject)}).strict().extend({queryType:z.literal("getEntityDefinition"), deploymentUuid:z.string().uuid(), entityUuid:z.string().uuid()}).strict(); export const domainModelGetFetchParamJzodSchemaExtractor: z.ZodType = z.object({deploymentUuid:z.string().uuid(), pageParams:z.lazy(() =>domainElementObject), queryParams:z.lazy(() =>domainElementObject), contextResults:z.lazy(() =>domainElementObject)}).strict().extend({queryType:z.literal("getFetchParamsJzodSchema"), fetchParams:z.lazy(() =>extractorForRecordOfExtractors)}).strict(); export const domainModelGetSingleSelectQueryJzodSchemaExtractor: z.ZodType = z.object({deploymentUuid:z.string().uuid(), pageParams:z.lazy(() =>domainElementObject), queryParams:z.lazy(() =>domainElementObject), contextResults:z.lazy(() =>domainElementObject)}).strict().extend({queryType:z.literal("getSingleSelectQueryJzodSchema"), select:z.lazy(() =>querySelect)}).strict(); @@ -3039,7 +3036,7 @@ export const queryAction: z.ZodType = z.object({actionType:z.litera export const compositeAction: z.ZodType = z.object({actionType:z.literal("compositeAction"), actionName:z.literal("sequence"), deploymentUuid:z.string().uuid().optional(), definition:z.array(z.union([z.object({compositeActionType:z.literal("action"), action:z.lazy(() =>domainAction)}).strict(), z.object({compositeActionType:z.literal("query"), query:z.lazy(() =>queryAction)}).strict()]))}).strict(); export const domainAction: z.ZodType = z.union([z.lazy(() =>undoRedoAction), z.lazy(() =>storeOrBundleAction), z.lazy(() =>modelAction), z.lazy(() =>instanceAction), z.object({actionType:z.literal("transactionalInstanceAction"), deploymentUuid:z.string().uuid().optional(), instanceAction:z.lazy(() =>instanceCUDAction)}).strict(), z.object({actionType:z.literal("compositeAction"), actionName:z.literal("sequence"), deploymentUuid:z.string().uuid().optional(), definition:z.array(z.union([z.object({compositeActionType:z.literal("action"), action:z.lazy(() =>domainAction)}).strict(), z.object({compositeActionType:z.literal("query"), query:z.lazy(() =>queryAction)}).strict()]))}).strict()]); export const objectTemplateInnerReference: z.ZodType = z.union([z.object({templateType:z.literal("constantUuid"), constantUuidValue:z.string()}).strict(), z.object({templateType:z.literal("contextReference"), referenceName:z.string()}).strict(), z.object({templateType:z.literal("parameterReference"), referenceName:z.string()}).strict()]); -export const objectRuntimeTemplate: z.ZodType = z.union([z.object({templateType:z.literal("count"), interpolation:z.literal("runtime"), referencedExtractor:z.string(), orderBy:z.string().optional(), groupBy:z.string().optional()}).strict(), z.object({templateType:z.literal("unique"), interpolation:z.literal("runtime"), referencedExtractor:z.string(), orderBy:z.string().optional(), attribute:z.string()}).strict()]); +export const runtimeTransformer: z.ZodType = z.union([z.object({templateType:z.literal("count"), interpolation:z.literal("runtime"), referencedExtractor:z.string(), orderBy:z.string().optional(), groupBy:z.string().optional()}).strict(), z.object({templateType:z.literal("unique"), interpolation:z.literal("runtime"), referencedExtractor:z.string(), orderBy:z.string().optional(), attribute:z.string()}).strict()]); export const objectBuildTemplate: z.ZodType = z.union([z.lazy(() =>objectTemplateInnerReference), z.object({templateType:z.literal("mustacheStringTemplate"), definition:z.string()}).strict(), z.object({templateType:z.literal("fullObjectTemplate"), definition:z.array(z.object({attributeKey:z.lazy(() =>objectTemplateInnerReference), attributeValue:z.lazy(() =>objectBuildTemplate)}).strict())}).strict()]); export const actionHandler: z.ZodType = z.object({interface:z.object({actionJzodObjectSchema:z.lazy(() =>jzodObject)}).strict(), implementation:z.object({templates:z.record(z.string(),z.any()).optional(), compositeActionTemplate:z.lazy(() =>compositeActionTemplate)}).strict()}).strict(); export const modelActionReplayableAction: z.ZodType = z.union([z.lazy(() =>modelActionAlterEntityAttribute), z.lazy(() =>modelActionCreateEntity), z.lazy(() =>modelActionDropEntity), z.lazy(() =>modelActionRenameEntity)]); @@ -3110,19 +3107,19 @@ export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_sectionOfMenu: z.ZodTy export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_simpleMenu: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({menuType:z.union([z.literal("simpleMenu"), z.lazy(() =>carryOnObject)]), definition:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_menuItemArray), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_complexMenu: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({menuType:z.union([z.literal("complexMenu"), z.lazy(() =>carryOnObject)]), definition:z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_sectionOfMenu), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_jzodObjectOrReference: z.ZodType = z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_jzodReference), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_jzodObject), z.lazy(() =>carryOnObject)]), z.lazy(() =>carryOnObject)]); -export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectInstanceReportSection: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({type:z.union([z.literal("objectInstanceReportSection"), z.lazy(() =>carryOnObject)]), combiners:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), runtimeTransformers:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer).optional(), z.lazy(() =>carryOnObject)]).optional(), definition:z.union([z.lazy(() =>carryOnObject), z.object({label:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), parentUuid:z.union([z.string(), z.lazy(() =>carryOnObject)]), fetchedDataReference:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), query:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObject).optional(), z.lazy(() =>carryOnObject)]).optional()}).strict()])}).strict()]); +export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectInstanceReportSection: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({type:z.union([z.literal("objectInstanceReportSection"), z.lazy(() =>carryOnObject)]), combiners:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), runtimeTransformers:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer).optional(), z.lazy(() =>carryOnObject)]).optional(), definition:z.union([z.lazy(() =>carryOnObject), z.object({label:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), parentUuid:z.union([z.string(), z.lazy(() =>carryOnObject)]), fetchedDataReference:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), query:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObject).optional(), z.lazy(() =>carryOnObject)]).optional()}).strict()])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectListReportSection: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({type:z.union([z.literal("objectListReportSection"), z.lazy(() =>carryOnObject)]), definition:z.union([z.lazy(() =>carryOnObject), z.object({label:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), parentName:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), parentUuid:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)]), fetchedDataReference:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), query:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObject).optional(), z.lazy(() =>carryOnObject)]).optional(), sortByAttribute:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional()}).strict()])}).strict()]); -export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_gridReportSection: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({type:z.union([z.literal("grid"), z.lazy(() =>carryOnObject)]), combiners:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), runtimeTransformers:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer).optional(), z.lazy(() =>carryOnObject)]).optional(), selectData:z.union([z.lazy(() =>miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), definition:z.union([z.array(z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_reportSection), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])}).strict()]); -export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_listReportSection: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({type:z.union([z.literal("list"), z.lazy(() =>carryOnObject)]), combiners:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), runtimeTransformers:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer).optional(), z.lazy(() =>carryOnObject)]).optional(), selectData:z.union([z.lazy(() =>miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), definition:z.union([z.array(z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectInstanceReportSection), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectListReportSection), z.lazy(() =>carryOnObject)]), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])}).strict()]); +export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_gridReportSection: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({type:z.union([z.literal("grid"), z.lazy(() =>carryOnObject)]), combiners:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), runtimeTransformers:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer).optional(), z.lazy(() =>carryOnObject)]).optional(), selectData:z.union([z.lazy(() =>miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), definition:z.union([z.array(z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_reportSection), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])}).strict()]); +export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_listReportSection: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({type:z.union([z.literal("list"), z.lazy(() =>carryOnObject)]), combiners:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), runtimeTransformers:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer).optional(), z.lazy(() =>carryOnObject)]).optional(), selectData:z.union([z.lazy(() =>miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), definition:z.union([z.array(z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectInstanceReportSection), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectListReportSection), z.lazy(() =>carryOnObject)]), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_reportSection: z.ZodType = z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_gridReportSection), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_listReportSection), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectListReportSection), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectInstanceReportSection), z.lazy(() =>carryOnObject)]), z.lazy(() =>carryOnObject)]); -export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_rootReportSection: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({reportParametersToFetchQueryParametersTransformer:z.union([z.record(z.string(),z.union([z.string(), z.lazy(() =>carryOnObject)])).optional(), z.lazy(() =>carryOnObject)]).optional(), reportParameters:z.union([z.record(z.string(),z.union([z.string(), z.lazy(() =>carryOnObject)])).optional(), z.lazy(() =>carryOnObject)]).optional(), extractors:z.union([z.record(z.string(),z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapper), z.lazy(() =>carryOnObject)])).optional(), z.lazy(() =>carryOnObject)]).optional(), combiners:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), runtimeTransformers:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer).optional(), z.lazy(() =>carryOnObject)]).optional(), section:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_reportSection), z.lazy(() =>carryOnObject)])}).strict()]); +export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_rootReportSection: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({reportParametersToFetchQueryParametersTransformer:z.union([z.record(z.string(),z.union([z.string(), z.lazy(() =>carryOnObject)])).optional(), z.lazy(() =>carryOnObject)]).optional(), reportParameters:z.union([z.record(z.string(),z.union([z.string(), z.lazy(() =>carryOnObject)])).optional(), z.lazy(() =>carryOnObject)]).optional(), extractors:z.union([z.record(z.string(),z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapper), z.lazy(() =>carryOnObject)])).optional(), z.lazy(() =>carryOnObject)]).optional(), combiners:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), runtimeTransformers:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer).optional(), z.lazy(() =>carryOnObject)]).optional(), section:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_reportSection), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_report: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({uuid:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)]), parentName:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), parentUuid:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)]), parentDefinitionVersionUuid:z.union([z.string().uuid().optional(), z.lazy(() =>carryOnObject)]).optional(), conceptLevel:z.union([z.enum(["MetaModel","Model","Data"]).optional(), z.lazy(() =>carryOnObject)]).optional(), name:z.union([z.string(), z.lazy(() =>carryOnObject)]), defaultLabel:z.union([z.string(), z.lazy(() =>carryOnObject)]), type:z.union([z.enum(["list","grid"]).optional(), z.lazy(() =>carryOnObject)]).optional(), application:z.union([z.string().uuid().optional(), z.lazy(() =>carryOnObject)]).optional(), definition:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_rootReportSection), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_transformer: z.ZodType = z.union([z.object({transformerType:z.union([z.literal("objectTransformer"), z.lazy(() =>carryOnObject)]), attributeName:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict(), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_recordOfTransformers), z.lazy(() =>carryOnObject)]), z.lazy(() =>carryOnObject)]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_recordOfTransformers: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({transformerType:z.union([z.literal("recordOfTransformers"), z.lazy(() =>carryOnObject)]), definition:z.union([z.record(z.string(),z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_transformer), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_metaModel: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({applicationVersions:z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_applicationVersion), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)]), applicationVersionCrossEntityDefinition:z.union([z.array(z.union([z.lazy(() =>carryOnObject), z.object({uuid:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)]), parentName:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), parentUuid:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)]), conceptLevel:z.union([z.enum(["MetaModel","Model","Data"]).optional(), z.lazy(() =>carryOnObject)]).optional(), applicationVersion:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)]), entityDefinition:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)])}).strict()])), z.lazy(() =>carryOnObject)]), configuration:z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_storeBasedConfiguration), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)]), entities:z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_entity), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)]), entityDefinitions:z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_entityDefinition), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)]), jzodSchemas:z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_jzodSchema), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)]), menus:z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_menu), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)]), reports:z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_report), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectTemplateInnerReference: z.ZodType = z.union([z.object({templateType:z.union([z.literal("constantUuid"), z.lazy(() =>carryOnObject)]), constantUuidValue:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict(), z.object({templateType:z.union([z.literal("contextReference"), z.lazy(() =>carryOnObject)]), referenceName:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict(), z.object({templateType:z.union([z.literal("parameterReference"), z.lazy(() =>carryOnObject)]), referenceName:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict(), z.lazy(() =>carryOnObject)]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectBuildTemplate: z.ZodType = z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectTemplateInnerReference), z.lazy(() =>carryOnObject)]), z.object({templateType:z.union([z.literal("mustacheStringTemplate"), z.lazy(() =>carryOnObject)]), definition:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict(), z.object({templateType:z.union([z.literal("fullObjectTemplate"), z.lazy(() =>carryOnObject)]), definition:z.union([z.array(z.union([z.lazy(() =>carryOnObject), z.object({attributeKey:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectTemplateInnerReference), z.lazy(() =>carryOnObject)]), attributeValue:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectBuildTemplate), z.lazy(() =>carryOnObject)])}).strict()])), z.lazy(() =>carryOnObject)])}).strict(), z.lazy(() =>carryOnObject)]); -export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectRuntimeTemplate: z.ZodType = z.union([z.object({templateType:z.union([z.literal("count"), z.lazy(() =>carryOnObject)]), interpolation:z.union([z.literal("runtime"), z.lazy(() =>carryOnObject)]), referencedExtractor:z.union([z.string(), z.lazy(() =>carryOnObject)]), orderBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), groupBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional()}).strict(), z.object({templateType:z.union([z.literal("unique"), z.lazy(() =>carryOnObject)]), interpolation:z.union([z.literal("runtime"), z.lazy(() =>carryOnObject)]), referencedExtractor:z.union([z.string(), z.lazy(() =>carryOnObject)]), orderBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), attribute:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict(), z.lazy(() =>carryOnObject)]); +export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_runtimeTransformer: z.ZodType = z.union([z.object({templateType:z.union([z.literal("count"), z.lazy(() =>carryOnObject)]), interpolation:z.union([z.literal("runtime"), z.lazy(() =>carryOnObject)]), referencedExtractor:z.union([z.string(), z.lazy(() =>carryOnObject)]), orderBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), groupBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional()}).strict(), z.object({templateType:z.union([z.literal("unique"), z.lazy(() =>carryOnObject)]), interpolation:z.union([z.literal("runtime"), z.lazy(() =>carryOnObject)]), referencedExtractor:z.union([z.string(), z.lazy(() =>carryOnObject)]), orderBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional(), attribute:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict(), z.lazy(() =>carryOnObject)]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_indexedDbStoreSectionConfiguration: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({emulatedServerType:z.union([z.literal("indexedDb"), z.lazy(() =>carryOnObject)]), indexedDbName:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_filesystemDbStoreSectionConfiguration: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({emulatedServerType:z.union([z.literal("filesystem"), z.lazy(() =>carryOnObject)]), directory:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_sqlDbStoreSectionConfiguration: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({emulatedServerType:z.union([z.literal("sql"), z.lazy(() =>carryOnObject)]), connectionString:z.union([z.string(), z.lazy(() =>carryOnObject)]), schema:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict()]); @@ -3157,18 +3154,17 @@ export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWr export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapper: z.ZodType = z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapperReturningObject), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapperReturningList), z.lazy(() =>carryOnObject)]), z.lazy(() =>carryOnObject)]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerAbstract: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({queryType:z.union([z.literal("extractorTransformer"), z.lazy(() =>carryOnObject)]), referencedExtractor:z.union([z.string(), z.lazy(() =>carryOnObject)]), orderBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional()}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerUnique: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({queryType:z.union([z.literal("extractorTransformer"), z.lazy(() =>carryOnObject)]), referencedExtractor:z.union([z.string(), z.lazy(() =>carryOnObject)]), orderBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional()}).strict().extend({queryName:z.union([z.literal("unique"), z.lazy(() =>carryOnObject)]), attribute:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict()]); -export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({queryType:z.union([z.literal("extractorTransformer"), z.lazy(() =>carryOnObject)]), referencedExtractor:z.union([z.string(), z.lazy(() =>carryOnObject)]), orderBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional()}).strict().extend({queryName:z.union([z.literal("actionRuntimeTransformer"), z.lazy(() =>carryOnObject)]), actionRuntimeTransformer:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_objectRuntimeTemplate), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerCount: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({queryType:z.union([z.literal("extractorTransformer"), z.lazy(() =>carryOnObject)]), referencedExtractor:z.union([z.string(), z.lazy(() =>carryOnObject)]), orderBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional()}).strict().extend({queryName:z.union([z.literal("count"), z.lazy(() =>carryOnObject)]), groupBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional()}).strict()]); -export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer: z.ZodType = z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer), z.lazy(() =>carryOnObject)]); +export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({queryType:z.union([z.literal("extractorTransformer"), z.lazy(() =>carryOnObject)]), referencedExtractor:z.union([z.string(), z.lazy(() =>carryOnObject)]), orderBy:z.union([z.string().optional(), z.lazy(() =>carryOnObject)]).optional()}).strict().extend({queryName:z.union([z.literal("actionRuntimeTransformer"), z.lazy(() =>carryOnObject)]), actionRuntimeTransformer:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_runtimeTransformer), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObject: z.ZodType = z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectByRelation), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractObjectByDirectReference), z.lazy(() =>carryOnObject)]), z.lazy(() =>carryOnObject)]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectList: z.ZodType = z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractObjectListByEntity), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectListByRelation), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectListByManyToManyRelation), z.lazy(() =>carryOnObject)]), z.lazy(() =>carryOnObject)]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectByQueryCombiner: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({queryType:z.union([z.literal("queryCombiner"), z.lazy(() =>carryOnObject)]), rootQuery:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelect), z.lazy(() =>carryOnObject)]), subQuery:z.union([z.lazy(() =>carryOnObject), z.object({query:z.union([z.lazy(() =>querySelect), z.lazy(() =>carryOnObject)]), rootQueryObjectTransformer:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_recordOfTransformers), z.lazy(() =>carryOnObject)])}).strict()])}).strict()]); -export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelect: z.ZodType = z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapper), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer), z.lazy(() =>carryOnObject)]), z.object({queryType:z.union([z.literal("wrapperReturningObject"), z.lazy(() =>carryOnObject)]), definition:z.union([z.record(z.string(),z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelect), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])}).strict(), z.object({queryType:z.union([z.literal("wrapperReturningList"), z.lazy(() =>carryOnObject)]), definition:z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelect), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])}).strict(), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractObjectByDirectReference), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectList), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectByRelation), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectListByRelation), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectListByManyToManyRelation), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectByQueryCombiner), z.lazy(() =>carryOnObject)]), z.object({queryType:z.union([z.literal("literal"), z.lazy(() =>carryOnObject)]), definition:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict(), z.object({queryType:z.union([z.literal("queryContextReference"), z.lazy(() =>carryOnObject)]), queryReference:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict(), z.lazy(() =>carryOnObject)]); +export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelect: z.ZodType = z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapper), z.lazy(() =>carryOnObject)]), z.object({queryType:z.union([z.literal("wrapperReturningObject"), z.lazy(() =>carryOnObject)]), definition:z.union([z.record(z.string(),z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelect), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])}).strict(), z.object({queryType:z.union([z.literal("wrapperReturningList"), z.lazy(() =>carryOnObject)]), definition:z.union([z.array(z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelect), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)])}).strict(), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractObjectByDirectReference), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectList), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectByRelation), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectListByRelation), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectListByManyToManyRelation), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectByQueryCombiner), z.lazy(() =>carryOnObject)]), z.object({queryType:z.union([z.literal("literal"), z.lazy(() =>carryOnObject)]), definition:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict(), z.object({queryType:z.union([z.literal("queryContextReference"), z.lazy(() =>carryOnObject)]), queryReference:z.union([z.string(), z.lazy(() =>carryOnObject)])}).strict(), z.lazy(() =>carryOnObject)]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord: z.ZodType = z.union([z.record(z.string(),z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelect), z.lazy(() =>carryOnObject)])), z.lazy(() =>carryOnObject)]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractorForSingleObject: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({deploymentUuid:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)]), pageParams:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_domainElementObject), z.lazy(() =>carryOnObject)]), queryParams:z.union([z.lazy(() =>domainElementObject), z.lazy(() =>carryOnObject)]), contextResults:z.union([z.lazy(() =>domainElementObject), z.lazy(() =>carryOnObject)])}).strict().extend({queryType:z.union([z.literal("domainModelSingleExtractor"), z.lazy(() =>carryOnObject)]), select:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObject), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractorForSingleObjectList: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({deploymentUuid:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)]), pageParams:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_domainElementObject), z.lazy(() =>carryOnObject)]), queryParams:z.union([z.lazy(() =>domainElementObject), z.lazy(() =>carryOnObject)]), contextResults:z.union([z.lazy(() =>domainElementObject), z.lazy(() =>carryOnObject)])}).strict().extend({queryType:z.union([z.literal("domainModelSingleExtractor"), z.lazy(() =>carryOnObject)]), select:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectObjectList), z.lazy(() =>carryOnObject)])}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_domainModelSingleExtractor: z.ZodType = z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractorForSingleObject), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractorForSingleObjectList), z.lazy(() =>carryOnObject)]), z.lazy(() =>carryOnObject)]); -export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractorForRecordOfExtractors: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({deploymentUuid:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)]), pageParams:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_domainElementObject), z.lazy(() =>carryOnObject)]), queryParams:z.union([z.lazy(() =>domainElementObject), z.lazy(() =>carryOnObject)]), contextResults:z.union([z.lazy(() =>domainElementObject), z.lazy(() =>carryOnObject)])}).strict().extend({queryType:z.union([z.literal("extractorForRecordOfExtractors"), z.lazy(() =>carryOnObject)]), extractors:z.union([z.record(z.string(),z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapper), z.lazy(() =>carryOnObject)])).optional(), z.lazy(() =>carryOnObject)]).optional(), combiners:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), runtimeTransformers:z.union([z.record(z.string(),z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer), z.lazy(() =>carryOnObject)])).optional(), z.lazy(() =>carryOnObject)]).optional()}).strict()]); +export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractorForRecordOfExtractors: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({deploymentUuid:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)]), pageParams:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_domainElementObject), z.lazy(() =>carryOnObject)]), queryParams:z.union([z.lazy(() =>domainElementObject), z.lazy(() =>carryOnObject)]), contextResults:z.union([z.lazy(() =>domainElementObject), z.lazy(() =>carryOnObject)])}).strict().extend({queryType:z.union([z.literal("extractorForRecordOfExtractors"), z.lazy(() =>carryOnObject)]), extractors:z.union([z.record(z.string(),z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_querySelectExtractorWrapper), z.lazy(() =>carryOnObject)])).optional(), z.lazy(() =>carryOnObject)]).optional(), combiners:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRecord).optional(), z.lazy(() =>carryOnObject)]).optional(), runtimeTransformers:z.union([z.record(z.string(),z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer), z.lazy(() =>carryOnObject)])).optional(), z.lazy(() =>carryOnObject)]).optional()}).strict()]); export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryAction: z.ZodType = z.union([z.lazy(() =>carryOnObject), z.object({actionType:z.union([z.literal("queryAction"), z.lazy(() =>carryOnObject)]), actionName:z.union([z.literal("runQuery"), z.lazy(() =>carryOnObject)]), endpoint:z.union([z.literal("9e404b3c-368c-40cb-be8b-e3c28550c25e"), z.lazy(() =>carryOnObject)]), applicationSection:z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_applicationSection).optional(), z.lazy(() =>carryOnObject)]).optional(), deploymentUuid:z.union([z.string().uuid(), z.lazy(() =>carryOnObject)]), query:z.union([z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_domainModelSingleExtractor), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractorForRecordOfExtractors), z.lazy(() =>carryOnObject)]), z.lazy(() =>carryOnObject)])}).strict()]); export const compositeInstanceActionTemplate: z.ZodType = z.object({actionType:z.literal("compositeInstanceAction"), actionName:z.literal("instanceActionSequence"), definition:z.array(z.union([z.object({compositeActionType:z.literal("action"), action:z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_instanceAction)}).strict(), z.object({compositeActionType:z.literal("queryAction"), nameGivenToResult:z.string(), queryAction:z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryAction)}).strict()]))}).strict(); export const carryOnObject: z.ZodType = z.union([z.lazy(() =>objectTemplateInnerReference), z.object({templateType:z.literal("mustacheStringTemplate"), definition:z.string()}).strict(), z.object({templateType:z.literal("fullObjectTemplate"), definition:z.array(z.object({attributeKey:z.lazy(() =>objectTemplateInnerReference), attributeValue:z.lazy(() =>objectBuildTemplate)}).strict())}).strict()]); diff --git a/packages/miroir-core/src/0_interfaces/2_domain/ExtractorRunnerInterface.ts b/packages/miroir-core/src/0_interfaces/2_domain/ExtractorRunnerInterface.ts index 4f675ef4..9557de0a 100644 --- a/packages/miroir-core/src/0_interfaces/2_domain/ExtractorRunnerInterface.ts +++ b/packages/miroir-core/src/0_interfaces/2_domain/ExtractorRunnerInterface.ts @@ -16,7 +16,7 @@ import { ApplicationSection, QueryAction, ActionReturnType, - QueryExtractorTransformer, + QueryExtractorRuntimeTransformer, DomainElementObject } from "../1_core/preprocessor-generated/miroirFundamentalType.js"; @@ -75,7 +75,7 @@ export type AsyncExtractorRunnerMap = { DomainElementInstanceUuidIndexOrFailed >, applyExtractorTransformer( - query: QueryExtractorTransformer, + query: QueryExtractorRuntimeTransformer, queryParams: DomainElementObject, newFetchedData: DomainElementObject, extractors: Record, diff --git a/packages/miroir-core/src/2_domain/AsyncQuerySelectors.ts b/packages/miroir-core/src/2_domain/AsyncQuerySelectors.ts index 53689a4e..553f2b4c 100644 --- a/packages/miroir-core/src/2_domain/AsyncQuerySelectors.ts +++ b/packages/miroir-core/src/2_domain/AsyncQuerySelectors.ts @@ -10,7 +10,7 @@ import { ExtractorForRecordOfExtractors, ExtractorForSingleObject, ExtractorForSingleObjectList, - QueryExtractorTransformer, + QueryExtractorRuntimeTransformer, QuerySelect } from "../0_interfaces/1_core/preprocessor-generated/miroirFundamentalType.js"; import { @@ -78,7 +78,7 @@ export const asyncExtractEntityInstanceUuidIndexWithObjectListExtractor // ################################################################################################ export async function asyncApplyExtractorTransformerInMemory( - query: QueryExtractorTransformer, + query: QueryExtractorRuntimeTransformer, queryParams: DomainElementObject, newFetchedData: DomainElementObject, extractors: Record, @@ -246,10 +246,10 @@ export function asyncInnerSelectElementFromQuery/*ExtractorRunner*/( break; } - case "extractorTransformer": { - // return processExtractorTransformerInMemory(query, queryParams, newFetchedData, extractors); - return extractorRunnerMap.applyExtractorTransformer(query, queryParams, newFetchedData, extractors); - } + // case "extractorTransformer": { + // // return processExtractorTransformerInMemory(query, queryParams, newFetchedData, extractors); + // return extractorRunnerMap.applyExtractorTransformer(query, queryParams, newFetchedData, extractors); + // } case "queryContextReference": { return newFetchedData && newFetchedData.elementType == "object" && newFetchedData.elementValue[query.queryReference] ? Promise.resolve(newFetchedData.elementValue[query.queryReference]) @@ -373,29 +373,77 @@ export const asyncExtractWithManyExtractors = async ( return context; }); - const combinerAndtransformerPromises = Object.entries(selectorParams.extractor.combiners ?? {}) - .concat(Object.entries(selectorParams.extractor.runtimeTransformers ?? {})) - .map((query: [string, QuerySelect]) => { - return asyncInnerSelectElementFromQuery( - state, - context, - selectorParams.extractor.pageParams, - { - elementType: "object", - elementValue: { - ...selectorParams.extractor.pageParams.elementValue, - ...selectorParams.extractor.queryParams.elementValue, - }, + const combinerPromises = Object.entries(selectorParams.extractor.combiners ?? {}) + .map((query: [string, QuerySelect]) => { + return asyncInnerSelectElementFromQuery( + state, + context, + selectorParams.extractor.pageParams, + { + elementType: "object", + elementValue: { + ...selectorParams.extractor.pageParams.elementValue, + ...selectorParams.extractor.queryParams.elementValue, }, - localSelectorMap as any, - selectorParams.extractor.deploymentUuid, - selectorParams.extractor.extractors ?? ({} as any), - query[1] - ).then((result): [string, DomainElement] => { + }, + localSelectorMap as any, + selectorParams.extractor.deploymentUuid, + selectorParams.extractor.extractors ?? ({} as any), + query[1] + ).then((result): [string, DomainElement] => { + return [query[0], result]; + }); + }); + + await Promise.all(combinerPromises).then((results) => { + results.forEach((result) => { + context.elementValue[result[0]] = result[1]; // does side effect! + }); + return context; + }); + + const transformerPromises = Object.entries(selectorParams.extractor.runtimeTransformers ?? {}) + .map((query: [string, QueryExtractorRuntimeTransformer]) => { + // export function asyncInnerSelectElementFromQuery/*ExtractorRunner*/( + // state: StateType, + // newFetchedData: DomainElementObject, + // pageParams: DomainElementObject, + // queryParams: DomainElementObject, + // extractorRunnerMap:AsyncExtractorRunnerMap, + // deploymentUuid: Uuid, + // extractors: Record, + // query: QuerySelect + // ): Promise { + // return asyncInnerSelectElementFromQuery( + // state, + // context, + // selectorParams.extractor.pageParams, + // { + // elementType: "object", + // elementValue: { + // ...selectorParams.extractor.pageParams.elementValue, + // ...selectorParams.extractor.queryParams.elementValue, + // }, + // }, + // localSelectorMap as any, + // selectorParams.extractor.deploymentUuid, + // selectorParams.extractor.extractors ?? ({} as any), + // query[1] + // ).then((result): [string, DomainElement] => { + // return [query[0], result]; + // }); + return localSelectorMap.applyExtractorTransformer(query[1], { + elementType: "object", + elementValue: { + ...selectorParams.extractor.pageParams.elementValue, + ...selectorParams.extractor.queryParams.elementValue, + }, + }, context, selectorParams.extractor.extractors ?? ({} as any)).then((result): [string, DomainElement] => { return [query[0], result]; - }); + });; + }); - await Promise.all(combinerAndtransformerPromises).then((results) => { + await Promise.all(transformerPromises).then((results) => { results.forEach((result) => { context.elementValue[result[0]] = result[1]; // does side effect! }); diff --git a/packages/miroir-core/src/2_domain/QuerySelectors.ts b/packages/miroir-core/src/2_domain/QuerySelectors.ts index 862f81b8..3c3a8a24 100644 --- a/packages/miroir-core/src/2_domain/QuerySelectors.ts +++ b/packages/miroir-core/src/2_domain/QuerySelectors.ts @@ -27,7 +27,7 @@ import { QuerySelectObjectList, ExtractObjectListByEntity, DomainModelSingleExtractor, - QueryExtractorTransformer, + QueryExtractorRuntimeTransformer, } from "../0_interfaces/1_core/preprocessor-generated/miroirFundamentalType.js"; import { SyncExtractorRunnerParams, @@ -358,7 +358,7 @@ export const extractEntityInstanceUuidIndexWithObjectListExtractor // ################################################################################################ export const applyExtractorTransformer = ( - query: QueryExtractorTransformer, + query: QueryExtractorRuntimeTransformer, queryParams: DomainElementObject, newFetchedData: DomainElementObject ): DomainElement => { @@ -567,10 +567,10 @@ export function innerSelectElementFromQuery/*ExtractorRunner*/( } break; } - case "extractorTransformer": { - return applyExtractorTransformer(query, queryParams, newFetchedData); - break; - } + // case "extractorTransformer": { + // return applyExtractorTransformer(query, queryParams, newFetchedData); + // break; + // } case "queryContextReference": { return newFetchedData && newFetchedData.elementType == "object" && newFetchedData.elementValue[query.queryReference] ? newFetchedData.elementValue[query.queryReference] @@ -709,21 +709,38 @@ export const extractWithManyExtractors = ( Object.entries( selectorParams.extractor.runtimeTransformers ?? {} )) { - let result = innerSelectElementFromQuery( - state, - context, - selectorParams.extractor.pageParams, - { - elementType: "object", - elementValue: { - ...selectorParams.extractor.pageParams.elementValue, - ...selectorParams.extractor.queryParams.elementValue, - }, + + // export function innerSelectElementFromQuery/*ExtractorRunner*/( + // state: StateType, + // newFetchedData: DomainElementObject, + // pageParams: DomainElementObject, + // queryParams: DomainElementObject, + // extractorRunnerMap:SyncExtractorRunnerMap, + // deploymentUuid: Uuid, + // query: QuerySelect + // ): + // let result = innerSelectElementFromQuery( + // state, + // context, + // selectorParams.extractor.pageParams, + // { + // elementType: "object", + // elementValue: { + // ...selectorParams.extractor.pageParams.elementValue, + // ...selectorParams.extractor.queryParams.elementValue, + // }, + // }, + // localSelectorMap as any, + // selectorParams.extractor.deploymentUuid, + // query[1] + // ); + let result = applyExtractorTransformer(query[1], { + elementType: "object", + elementValue: { + ...selectorParams.extractor.pageParams.elementValue, + ...selectorParams.extractor.queryParams.elementValue, }, - localSelectorMap as any, - selectorParams.extractor.deploymentUuid, - query[1] - ); + }, context) context.elementValue[query[0]] = result; // does side effect! // log.info("extractWithManyExtractors done for entry", entry[0], "query", entry[1], "result=", result); } @@ -752,7 +769,7 @@ export const extractzodSchemaForSingleSelectQuery = ( if ( selectorParams.query.select.queryType=="literal" || selectorParams.query.select.queryType=="queryContextReference" || - selectorParams.query.select.queryType=="extractorTransformer" || + // selectorParams.query.select.queryType=="extractorTransformer" || selectorParams.query.select.queryType=="extractorWrapperReturningObject" || selectorParams.query.select.queryType=="wrapperReturningObject" || selectorParams.query.select.queryType=="extractorWrapperReturningList" || @@ -845,8 +862,10 @@ export const extractFetchQueryJzodSchema = ( // log.info("selectFetchQueryJzodSchemaFromDomainState called", selectorParams.query); const fetchQueryJzodSchema = Object.fromEntries( - Object.entries(localFetchParams?.combiners??{}).concat( - Object.entries(localFetchParams?.runtimeTransformers??{})).map((entry: [string, QuerySelect]) => [ + Object.entries(localFetchParams?.combiners??{}) + // .concat( + // Object.entries(localFetchParams?.runtimeTransformers??{})) + .map((entry: [string, QuerySelect]) => [ entry[0], selectorParams.extractorRunnerMap.extractzodSchemaForSingleSelectQuery(deploymentEntityState, { extractorRunnerMap:selectorParams.extractorRunnerMap, diff --git a/packages/miroir-core/src/2_domain/Templates.ts b/packages/miroir-core/src/2_domain/Templates.ts index aee4c51c..c130d28d 100644 --- a/packages/miroir-core/src/2_domain/Templates.ts +++ b/packages/miroir-core/src/2_domain/Templates.ts @@ -8,7 +8,7 @@ import { ActionReturnType, ObjectTemplateInnerReference, ObjectBuildTemplate, - ObjectRuntimeTemplate, + RuntimeTransformer, DomainElementObjectOrFailed, DomainElementObject, } from "../0_interfaces/1_core/preprocessor-generated/miroirFundamentalType.js"; @@ -126,16 +126,16 @@ export type ActionTemplate = any; // ################################################################################################ export function renderObjectRuntimeTemplate( objectName: string, - objectRuntimeTemplate: ObjectRuntimeTemplate, + runtimeTransformer: RuntimeTransformer, queryParams: DomainElementObject, contextResults?: DomainElementObject, ): DomainElement { // log.info("renderObjectBuildTemplate called for object named", objectName,"template", objectBuildTemplate, "queryParams", queryParams); - if (typeof objectRuntimeTemplate == "object") { + if (typeof runtimeTransformer == "object") { // log.info("renderObjectBuildTemplate for template object named", objectName, "templateType", objectBuildTemplate.templateType); - if (Array.isArray(objectRuntimeTemplate)) { - // return objectRuntimeTemplate.map((e, index) => renderObjectRuntimeTemplate(index.toString(), e, queryParams, contextResults)); - const subObject = objectRuntimeTemplate.map((e, index) => renderObjectBuildTemplate(index.toString(), e, queryParams, contextResults)); + if (Array.isArray(runtimeTransformer)) { + // return runtimeTransformer.map((e, index) => renderObjectRuntimeTemplate(index.toString(), e, queryParams, contextResults)); + const subObject = runtimeTransformer.map((e, index) => renderObjectBuildTemplate(index.toString(), e, queryParams, contextResults)); const failureIndex = subObject.findIndex((e) => e.elementType == "failure"); if (failureIndex == -1) { return { @@ -151,17 +151,17 @@ export function renderObjectRuntimeTemplate( "no " + objectName + " in " + - objectRuntimeTemplate, + runtimeTransformer, }, }; } } else { - if (objectRuntimeTemplate.templateType) { - switch (objectRuntimeTemplate.templateType) { + if (runtimeTransformer.templateType) { + switch (runtimeTransformer.templateType) { case "count": { const resolvedReference = resolveActionTemplateContextReference( - { templateType: "contextReference", referenceName:objectRuntimeTemplate.referencedExtractor }, + { templateType: "contextReference", referenceName:runtimeTransformer.referencedExtractor }, queryParams, contextResults ); @@ -175,19 +175,19 @@ export function renderObjectRuntimeTemplate( log.error("innerSelectElementFromQuery extractorTransformer count referencedExtractor resolvedReference", resolvedReference); return { elementType: "failure", elementValue: { queryFailure: "QueryNotExecutable" } }; // TODO: improve error message / queryFailure } - const sortByAttribute = objectRuntimeTemplate.orderBy + const sortByAttribute = runtimeTransformer.orderBy ? (a: any[]) => a.sort((a, b) => - a[objectRuntimeTemplate.orderBy ?? ""].localeCompare(b[objectRuntimeTemplate.orderBy ?? ""], "en", { + a[runtimeTransformer.orderBy ?? ""].localeCompare(b[runtimeTransformer.orderBy ?? ""], "en", { sensitivity: "base", }) ) : (a: any[]) => a; - if (objectRuntimeTemplate.groupBy) { + if (runtimeTransformer.groupBy) { const result = new Map(); for (const entry of Object.entries(resolvedReference.elementValue)) { - const key = (entry[1] as any)[objectRuntimeTemplate.groupBy]; + const key = (entry[1] as any)[runtimeTransformer.groupBy]; if (result.has(key)) { result.set(key, (result.get(key)??0) + 1); } else { @@ -196,7 +196,7 @@ export function renderObjectRuntimeTemplate( } return { elementType: "any", - elementValue: sortByAttribute([...result.entries()].map((e) => ({ [objectRuntimeTemplate.groupBy as any]: e[0], count: e[1] }))), + elementValue: sortByAttribute([...result.entries()].map((e) => ({ [runtimeTransformer.groupBy as any]: e[0], count: e[1] }))), }; } else { return { elementType: "any" /* TODO: number? */, elementValue: [{count: Object.keys(resolvedReference.elementValue).length}] }; @@ -205,7 +205,7 @@ export function renderObjectRuntimeTemplate( } case "unique": { const resolvedReference = resolveActionTemplateContextReference( - { templateType: "contextReference", referenceName:objectRuntimeTemplate.referencedExtractor }, + { templateType: "contextReference", referenceName:runtimeTransformer.referencedExtractor }, queryParams, contextResults ); @@ -220,28 +220,28 @@ export function renderObjectRuntimeTemplate( return { elementType: "failure", elementValue: { queryFailure: "QueryNotExecutable" } }; // TODO: improve error message / queryFailure } - const sortByAttribute = objectRuntimeTemplate.orderBy + const sortByAttribute = runtimeTransformer.orderBy ? (a: any[]) => a.sort((a, b) => - a[objectRuntimeTemplate.orderBy ?? ""].localeCompare(b[objectRuntimeTemplate.orderBy ?? ""], "en", { + a[runtimeTransformer.orderBy ?? ""].localeCompare(b[runtimeTransformer.orderBy ?? ""], "en", { sensitivity: "base", }) ) : (a: any[]) => a; const result = new Set(); for (const entry of Object.entries(resolvedReference.elementValue)) { - result.add((entry[1] as any)[objectRuntimeTemplate.attribute]); + result.add((entry[1] as any)[runtimeTransformer.attribute]); } return { elementType: "any", - elementValue: sortByAttribute([...result].map((e) => ({ [objectRuntimeTemplate.attribute]: e }))), + elementValue: sortByAttribute([...result].map((e) => ({ [runtimeTransformer.attribute]: e }))), }; break; } // case "fullObjectTemplate": { // const result = Object.fromEntries( - // objectRuntimeTemplate.definition.map( + // runtimeTransformer.definition.map( // (innerEntry: { attributeKey: ObjectTemplateInnerReference; attributeValue: ObjectBuildTemplate }) => { // // log.info("renderObjectBuildTemplate for object named",objectName,"innerEntry index", innerEntry[0], "innerEntry value", innerEntry[1]); @@ -283,10 +283,10 @@ export function renderObjectRuntimeTemplate( // break; // } // case "mustacheStringTemplate": { - // const result = Mustache.render(objectRuntimeTemplate.definition, queryParams); + // const result = Mustache.render(runtimeTransformer.definition, queryParams); // log.info( // "renderObjectBuildTemplate mustacheStringTemplate for", - // objectRuntimeTemplate, + // runtimeTransformer, // "queryParams", // queryParams, // "result", @@ -299,13 +299,13 @@ export function renderObjectRuntimeTemplate( // case "contextReference": // case "parameterReference": default: { - throw new Error("could not render objectRuntimeTemplate" + JSON.stringify(objectRuntimeTemplate, null, 2)); - // const rawValue = objectRuntimeTemplate.templateType - // ? resolveActionTemplateContextReference(objectRuntimeTemplate, queryParams, contextResults) - // : objectRuntimeTemplate; + throw new Error("could not render runtimeTransformer" + JSON.stringify(runtimeTransformer, null, 2)); + // const rawValue = runtimeTransformer.templateType + // ? resolveActionTemplateContextReference(runtimeTransformer, queryParams, contextResults) + // : runtimeTransformer; // const value = - // typeof objectRuntimeTemplate == "object" && (objectRuntimeTemplate as any).applyFunction - // ? (objectRuntimeTemplate as any).applyFunction(rawValue) + // typeof runtimeTransformer == "object" && (runtimeTransformer as any).applyFunction + // ? (runtimeTransformer as any).applyFunction(rawValue) // : rawValue; // // log.info("renderObjectBuildTemplate default case for", objectBuildTemplate, "rawvalue", rawValue, "value", value); // return value; @@ -315,7 +315,7 @@ export function renderObjectRuntimeTemplate( } else { // log.info("renderObjectBuildTemplate converting plain object", objectBuildTemplate); const result = Object.fromEntries( - Object.entries(objectRuntimeTemplate).map((objectTemplateEntry: [string, any]) => { + Object.entries(runtimeTransformer).map((objectTemplateEntry: [string, any]) => { return [ objectTemplateEntry[0], renderObjectBuildTemplate(objectTemplateEntry[0], objectTemplateEntry[1], queryParams, contextResults), @@ -327,7 +327,7 @@ export function renderObjectRuntimeTemplate( } } else { // plain value - return objectRuntimeTemplate; + return runtimeTransformer; } } diff --git a/packages/miroir-core/src/assets/miroir_data/5e81e1b9-38be-487c-b3e5-53796c57fccf/a97756cf-dd93-42b9-a021-91a629b187b9.json b/packages/miroir-core/src/assets/miroir_data/5e81e1b9-38be-487c-b3e5-53796c57fccf/a97756cf-dd93-42b9-a021-91a629b187b9.json index a88dbf31..d72eeb71 100644 --- a/packages/miroir-core/src/assets/miroir_data/5e81e1b9-38be-487c-b3e5-53796c57fccf/a97756cf-dd93-42b9-a021-91a629b187b9.json +++ b/packages/miroir-core/src/assets/miroir_data/5e81e1b9-38be-487c-b3e5-53796c57fccf/a97756cf-dd93-42b9-a021-91a629b187b9.json @@ -49,7 +49,7 @@ } ] }, - "objectRuntimeTemplate": { + "runtimeTransformer": { "type": "union", "discriminator": "templateType", "definition": [ diff --git a/packages/miroir-core/src/assets/miroir_model/54b9c72f-d4f3-4db9-9e0e-0dc840b530bd/359f1f9b-7260-4d76-a864-72c839b9711b.json b/packages/miroir-core/src/assets/miroir_model/54b9c72f-d4f3-4db9-9e0e-0dc840b530bd/359f1f9b-7260-4d76-a864-72c839b9711b.json index d64a22e0..4e286623 100644 --- a/packages/miroir-core/src/assets/miroir_model/54b9c72f-d4f3-4db9-9e0e-0dc840b530bd/359f1f9b-7260-4d76-a864-72c839b9711b.json +++ b/packages/miroir-core/src/assets/miroir_model/54b9c72f-d4f3-4db9-9e0e-0dc840b530bd/359f1f9b-7260-4d76-a864-72c839b9711b.json @@ -615,17 +615,11 @@ "type": "schemaReference", "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "objectRuntimeTemplate" + "relativePath": "runtimeTransformer" } } } }, - "queryExtractorTransformer": { - "type": "schemaReference", - "definition": { - "relativePath": "queryExtractorRuntimeTransformer" - } - }, "querySelect": { "type": "union", "discriminator": "queryType", @@ -636,12 +630,6 @@ "relativePath": "querySelectExtractorWrapper" } }, - { - "type": "schemaReference", - "definition": { - "relativePath": "queryExtractorTransformer" - } - }, { "type": "object", "definition": { diff --git a/packages/miroir-core/src/assets/miroir_model/54b9c72f-d4f3-4db9-9e0e-0dc840b530bd/952d2c65-4da2-45c2-9394-a0920ceedfb6.json b/packages/miroir-core/src/assets/miroir_model/54b9c72f-d4f3-4db9-9e0e-0dc840b530bd/952d2c65-4da2-45c2-9394-a0920ceedfb6.json index a2dd9cec..9835c97b 100644 --- a/packages/miroir-core/src/assets/miroir_model/54b9c72f-d4f3-4db9-9e0e-0dc840b530bd/952d2c65-4da2-45c2-9394-a0920ceedfb6.json +++ b/packages/miroir-core/src/assets/miroir_model/54b9c72f-d4f3-4db9-9e0e-0dc840b530bd/952d2c65-4da2-45c2-9394-a0920ceedfb6.json @@ -85,7 +85,7 @@ "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "definition": { @@ -190,7 +190,7 @@ "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "selectData": { @@ -236,7 +236,7 @@ "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "selectData": { @@ -350,7 +350,7 @@ "optional":true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "queryExtractorTransformer" + "relativePath": "queryExtractorRuntimeTransformer" } }, "section": { diff --git a/packages/miroir-core/src/index.ts b/packages/miroir-core/src/index.ts index 0abdb46a..9b23beed 100644 --- a/packages/miroir-core/src/index.ts +++ b/packages/miroir-core/src/index.ts @@ -255,7 +255,7 @@ export { extractorForSingleObjectList, DomainModelSingleExtractor, domainModelSingleExtractor, - QueryExtractorTransformer, + QueryExtractorRuntimeTransformer, queryExtractorTransformerUnique, QuerySelectExtractorWrapper, querySelectExtractorWrapper, diff --git a/packages/miroir-core/src/tests/2_domain/templates.unit.test.ts b/packages/miroir-core/src/tests/2_domain/templates.unit.test.ts index 724eb515..66ad5a91 100644 --- a/packages/miroir-core/src/tests/2_domain/templates.unit.test.ts +++ b/packages/miroir-core/src/tests/2_domain/templates.unit.test.ts @@ -7,7 +7,7 @@ import { StoreUnitConfiguration, ObjectBuildTemplate, DomainElementObject, - ObjectRuntimeTemplate, + RuntimeTransformer, EntityInstance, } from "../../0_interfaces/1_core/preprocessor-generated/miroirFundamentalType.js"; import { book1, book2, book3, book4, book5, book6 } from '../../index.js'; @@ -170,7 +170,7 @@ describe("templates.unit.test", () => { console.log("convert mustache string START") const newApplicationName = "test"; - const uniqueRuntimeTemplate:ObjectRuntimeTemplate = { + const uniqueRuntimeTemplate:RuntimeTransformer = { templateType: "unique", interpolation: "runtime", referencedExtractor: "books", @@ -224,7 +224,7 @@ describe("templates.unit.test", () => { console.log("count books by author runtime template START") const newApplicationName = "test"; - const uniqueRuntimeTemplate:ObjectRuntimeTemplate = { + const uniqueRuntimeTemplate:RuntimeTransformer = { templateType: "count", interpolation: "runtime", referencedExtractor: "books", diff --git a/packages/miroir-standalone-app/tests/4_storage/PersistenceStoreController.integ.test.tsx b/packages/miroir-standalone-app/tests/4_storage/PersistenceStoreController.integ.test.tsx index b0185fc0..28322c58 100644 --- a/packages/miroir-standalone-app/tests/4_storage/PersistenceStoreController.integ.test.tsx +++ b/packages/miroir-standalone-app/tests/4_storage/PersistenceStoreController.integ.test.tsx @@ -638,7 +638,7 @@ describe.sequential("PersistenceStoreController.unit.test", () => { "actualTest_getInstancesAndCheckResult", {}, async () => localAppPersistenceStoreController.getInstances("data",entityAuthor.uuid), - (a) => ignorePostgresExtraAttributesOnList((a as any).returnedDomainElement.elementValue.instances), + (a) => ignorePostgresExtraAttributesOnList((a as any).returnedDomainElement.elementValue.instances, ["birthDate", "deathDate", "conceptLevel", "icons", "language" ]), undefined, // name to give to result "entityInstanceCollection", [author1] @@ -668,7 +668,7 @@ describe.sequential("PersistenceStoreController.unit.test", () => { "actualTest_getInstancesAndCheckResult", {}, async () => localAppPersistenceStoreController.getInstances("data",entityAuthor.uuid), - (a) => ignorePostgresExtraAttributesOnList((a as any).returnedDomainElement.elementValue.instances), + (a) => ignorePostgresExtraAttributesOnList((a as any).returnedDomainElement.elementValue.instances, ["birthDate", "deathDate", "conceptLevel", "icons", "language" ]), undefined, // name to give to result "entityInstanceCollection", [{...author1, "name": author1.name + "ssss"}] diff --git a/packages/miroir-standalone-app/tests/utils/tests-utils.tsx b/packages/miroir-standalone-app/tests/utils/tests-utils.tsx index bc4dec40..440624b8 100644 --- a/packages/miroir-standalone-app/tests/utils/tests-utils.tsx +++ b/packages/miroir-standalone-app/tests/utils/tests-utils.tsx @@ -73,13 +73,14 @@ export function ignorePostgresExtraAttributesOnRecord(instances: Record ignorePostgresExtraAttributesOnObject(i)) +export function ignorePostgresExtraAttributesOnList(instances: EntityInstance[], furtherIgnore: string[] = []){ + return instances.map(i => ignorePostgresExtraAttributesOnObject(i, furtherIgnore)) } // ################################################################################################ -export function ignorePostgresExtraAttributesOnObject(instance: EntityInstance){ - return Object.fromEntries(Object.entries(instance).filter(e=>!["createdAt", "updatedAt", "author"].includes(e[0]))) +export function ignorePostgresExtraAttributesOnObject(instance: EntityInstance, furtherIgnore: string[] = []){ + const ignore = ["createdAt", "updatedAt", "author", ...furtherIgnore] + return Object.fromEntries(Object.entries(instance).filter(e=>!ignore.includes(e[0]))) } // ################################################################################################ diff --git a/packages/miroir-store-postgres/src/4_services/SqlDbExtractorRunner.ts b/packages/miroir-store-postgres/src/4_services/SqlDbExtractorRunner.ts index d6b403cb..c37a5b93 100644 --- a/packages/miroir-store-postgres/src/4_services/SqlDbExtractorRunner.ts +++ b/packages/miroir-store-postgres/src/4_services/SqlDbExtractorRunner.ts @@ -1,28 +1,58 @@ -import { ActionEntityInstanceCollectionReturnType, ActionReturnType, ApplicationSection, asyncExtractEntityInstanceUuidIndexWithObjectListExtractor, AsyncExtractorRunner, AsyncExtractorRunnerMap, AsyncExtractorRunnerParams, asyncExtractWithExtractor, asyncExtractWithManyExtractors, DomainElement, DomainElementEntityInstanceOrFailed, DomainElementInstanceUuidIndexOrFailed, DomainElementObject, DomainState, ExtractorForRecordOfExtractors, ExtractorForSingleObject, ExtractorForSingleObjectList, ExtractorRunnerMapForJzodSchema, getLoggerName, LoggerInterface, MiroirLoggerFactory, QueryAction, QueryExtractorTransformer, QuerySelectObject, resolveContextReference, selectEntityJzodSchemaFromDomainStateNew, selectFetchQueryJzodSchemaFromDomainStateNew, selectJzodSchemaByDomainModelQueryFromDomainStateNew, selectJzodSchemaBySingleSelectQueryFromDomainStateNew } from "miroir-core"; +import { + ActionEntityInstanceCollectionReturnType, + ActionReturnType, + ApplicationSection, + asyncExtractEntityInstanceUuidIndexWithObjectListExtractor, + AsyncExtractorRunner, + AsyncExtractorRunnerMap, + AsyncExtractorRunnerParams, + asyncExtractWithExtractor, + asyncExtractWithManyExtractors, + DomainElement, + DomainElementEntityInstanceOrFailed, + DomainElementInstanceUuidIndexOrFailed, + DomainElementObject, + DomainState, + ExtractorForRecordOfExtractors, + ExtractorForSingleObject, + ExtractorForSingleObjectList, + ExtractorRunnerMapForJzodSchema, + getLoggerName, + LoggerInterface, + MiroirLoggerFactory, + QueryAction, + QueryExtractorRuntimeTransformer, + QuerySelectObject, + resolveContextReference, + selectEntityJzodSchemaFromDomainStateNew, + selectFetchQueryJzodSchemaFromDomainStateNew, + selectJzodSchemaByDomainModelQueryFromDomainStateNew, + selectJzodSchemaBySingleSelectQueryFromDomainStateNew, +} from "miroir-core"; import { packageName } from "../constants.js"; import { cleanLevel } from "./constants.js"; import { SqlDbDataStoreSection } from "./SqlDbDataStoreSection.js"; import { SqlDbModelStoreSection } from "./SqlDbModelStoreSection.js"; -const loggerName: string = getLoggerName(packageName, cleanLevel,"PostgresExtractorRunner"); -let log:LoggerInterface = console as any as LoggerInterface; -MiroirLoggerFactory.asyncCreateLogger(loggerName).then( - (value: LoggerInterface) => { - log = value; - } -); +const loggerName: string = getLoggerName(packageName, cleanLevel, "PostgresExtractorRunner"); +let log: LoggerInterface = console as any as LoggerInterface; +MiroirLoggerFactory.asyncCreateLogger(loggerName).then((value: LoggerInterface) => { + log = value; +}); -export type RecursiveStringRecords = string | {[x: string]: RecursiveStringRecords}; +export type RecursiveStringRecords = string | { [x: string]: RecursiveStringRecords }; export class SqlDbExtractRunner { private logHeader: string; private extractorRunnerMap: AsyncExtractorRunnerMap; constructor( - private persistenceStoreController: SqlDbDataStoreSection | SqlDbModelStoreSection /* concrete types for MixedSqlDbInstanceStoreSection */ - // private persistenceStoreController: typeof MixedSqlDbInstanceStoreSection // does not work - ){ - this.logHeader = 'PersistenceStoreController '+ persistenceStoreController.getStoreName(); + private persistenceStoreController: + | SqlDbDataStoreSection + | SqlDbModelStoreSection /* concrete types for MixedSqlDbInstanceStoreSection */ + ) // private persistenceStoreController: typeof MixedSqlDbInstanceStoreSection // does not work + { + this.logHeader = "PersistenceStoreController " + persistenceStoreController.getStoreName(); const InMemoryImplementationExtractorRunnerMap: AsyncExtractorRunnerMap = { extractorType: "async", extractEntityInstanceUuidIndex: this.extractEntityInstanceUuidIndex.bind(this), @@ -36,7 +66,8 @@ export class SqlDbExtractRunner { extractorType: "async", extractEntityInstanceUuidIndex: this.extractEntityInstanceUuidIndex.bind(this), extractEntityInstance: this.extractEntityInstance.bind(this), - extractEntityInstanceUuidIndexWithObjectListExtractor: this.asyncSqlDbExtractEntityInstanceUuidIndexWithObjectListExtractor.bind(this), + extractEntityInstanceUuidIndexWithObjectListExtractor: + this.asyncSqlDbExtractEntityInstanceUuidIndexWithObjectListExtractor.bind(this), extractWithManyExtractors: asyncExtractWithManyExtractors, extractWithExtractor: asyncExtractWithExtractor, applyExtractorTransformer: this.applyExtractorTransformerSql.bind(this), @@ -48,25 +79,24 @@ export class SqlDbExtractRunner { // ################################################################################################ async applyExtractorTransformerSql( - query: QueryExtractorTransformer, + query: QueryExtractorRuntimeTransformer, queryParams: DomainElementObject, newFetchedData: DomainElementObject, - extractors: Record, + extractors: Record ): Promise { // log.info("SqlDbExtractRunner applyExtractorTransformerSql extractors", extractors); log.info("SqlDbExtractRunner applyExtractorTransformerSql query", JSON.stringify(query, null, 2)); // const referenceName = typeof query.referencedExtractor == "string"?query.referencedExtractor:(query.referencedExtractor as any).referenceName; const referenceName = query.referencedExtractor; - + const resolvedReference = resolveContextReference( - { queryTemplateType: "queryContextReference", referenceName:query.referencedExtractor }, + { queryTemplateType: "queryContextReference", referenceName: query.referencedExtractor }, queryParams, newFetchedData ); - - log.info("SqlDbExtractRunner applyExtractorTransformerSql resolvedReference", resolvedReference); + log.info("SqlDbExtractRunner applyExtractorTransformerSql resolvedReference", resolvedReference); // for (const ex of Object.entries(extractors)) { // log.info("applyExtractorTransformerSql getting sqlForExtractor", ex[0], ex[1]); @@ -76,14 +106,9 @@ export class SqlDbExtractRunner { // // log.info("applyExtractorTransformerSql rawResult", rawResult); // } - const extractorRawQueries = Object.entries(extractors).map( - ([key, value]) => { - return [ - key, - this.persistenceStoreController.sqlForExtractor(value) - ] - } - ) + const extractorRawQueries = Object.entries(extractors).map(([key, value]) => { + return [key, this.persistenceStoreController.sqlForExtractor(value)]; + }); log.info("applyExtractorTransformerSql extractorRawQueries", extractorRawQueries); @@ -92,26 +117,30 @@ export class SqlDbExtractRunner { } switch (query.queryName) { - case "actionRuntimeTransformer":{ - const orderBy = query.actionRuntimeTransformer.orderBy ? `ORDER BY ${query.actionRuntimeTransformer.orderBy}` : ""; + case "actionRuntimeTransformer": { + const orderBy = query.actionRuntimeTransformer.orderBy + ? `ORDER BY ${query.actionRuntimeTransformer.orderBy}` + : ""; switch (query.actionRuntimeTransformer.templateType) { case "unique": { log.info("applyExtractorTransformerSql query.attribute", query.actionRuntimeTransformer.attribute); // TODO: resolve query.referencedExtractor.referenceName properly const aggregateRawQuery = ` - WITH ${extractorRawQueries.map(q => "\"" + q[0] + "\" AS (" + q[1] + " )").join(", ")} - SELECT DISTINCT ON ("${query.actionRuntimeTransformer.attribute}") "${query.actionRuntimeTransformer.attribute}" FROM "${referenceName}" + WITH ${extractorRawQueries.map((q) => '"' + q[0] + '" AS (' + q[1] + " )").join(", ")} + SELECT DISTINCT ON ("${query.actionRuntimeTransformer.attribute}") "${ + query.actionRuntimeTransformer.attribute + }" FROM "${referenceName}" ${orderBy} - ` + `; log.info("applyExtractorTransformerSql unique aggregateRawQuery", aggregateRawQuery); - + const rawResult = await this.persistenceStoreController.executeRawQuery(aggregateRawQuery); log.info("applyExtractorTransformerSql unique rawResult", JSON.stringify(rawResult)); - + if (rawResult.status == "error") { return Promise.resolve({ elementType: "failure", elementValue: { queryFailure: "QueryNotExecutable" } }); } - + const sqlResult = rawResult.returnedDomainElement.elementValue; log.info("applyExtractorTransformerSql unique sqlResult", JSON.stringify(sqlResult)); return Promise.resolve({ elementType: "any", elementValue: sqlResult }); @@ -120,26 +149,29 @@ export class SqlDbExtractRunner { case "count": { log.info("applyExtractorTransformerSql count query.groupBy", query.actionRuntimeTransformer.groupBy); // TODO: resolve query.referencedExtractor.referenceName properly - const aggregateRawQuery = query.actionRuntimeTransformer.groupBy ? - `WITH ${extractorRawQueries.map(q => "\"" + q[0] + "\" AS (" + q[1] + " )").join(", ")} + const aggregateRawQuery = query.actionRuntimeTransformer.groupBy + ? `WITH ${extractorRawQueries.map((q) => '"' + q[0] + '" AS (' + q[1] + " )").join(", ")} SELECT "${query.actionRuntimeTransformer.groupBy}", COUNT("uuid") FROM ${referenceName} GROUP BY "${query.actionRuntimeTransformer.groupBy}" ${orderBy} - ` : - `WITH ${extractorRawQueries.map(q => "\"" + q[0] + "\" AS (" + q[1] + " )").join(", ")} + ` + : `WITH ${extractorRawQueries.map((q) => '"' + q[0] + '" AS (' + q[1] + " )").join(", ")} SELECT COUNT("uuid") FROM "${referenceName}" ${orderBy} `; log.info("applyExtractorTransformerSql count aggregateRawQuery", aggregateRawQuery); - + const rawResult = await this.persistenceStoreController.executeRawQuery(aggregateRawQuery); log.info("applyExtractorTransformerSql count rawResult", JSON.stringify(rawResult)); - + if (rawResult.status == "error") { return Promise.resolve({ elementType: "failure", elementValue: { queryFailure: "QueryNotExecutable" } }); } - - const sqlResult = rawResult.returnedDomainElement.elementValue.map((e:Record)=>({...e,count:Number(e.count)})); + + const sqlResult = rawResult.returnedDomainElement.elementValue.map((e: Record) => ({ + ...e, + count: Number(e.count), + })); // log.info("applyExtractorTransformerSql count sqlResult", JSON.stringify(sqlResult)); log.info("applyExtractorTransformerSql count sqlResult", sqlResult); return Promise.resolve({ elementType: "any", elementValue: sqlResult }); @@ -158,60 +190,60 @@ export class SqlDbExtractRunner { return Promise.resolve({ elementType: "failure", elementValue: { queryFailure: "QueryNotExecutable" } }); } - + // ################################################################################################ -/** - * returns an Entity Instance List, from a ListQuery - * @param deploymentEntityState - * @param selectorParams - * @returns - */ - private asyncSqlDbExtractEntityInstanceUuidIndexWithObjectListExtractor -= ( - state: StateType, - selectorParams: AsyncExtractorRunnerParams -): Promise => { - // ( - // state: any, - // selectorParams: AsyncExtractorRunnerParams - // ): Promise { - let result: Promise; - switch (selectorParams.extractor.select.queryType) { - case "extractObjectListByEntity": { - return this.extractEntityInstanceUuidIndexWithFilter(state, selectorParams) - } - case "selectObjectListByRelation": - case "selectObjectListByManyToManyRelation": { - return this.extractorRunnerMap.extractEntityInstanceUuidIndexWithObjectListExtractor(state, { - extractorRunnerMap: this.extractorRunnerMap, - extractor: { - queryType: "domainModelSingleExtractor", - deploymentUuid: selectorParams.extractor.deploymentUuid, - contextResults: selectorParams.extractor.contextResults, - pageParams: selectorParams.extractor.pageParams, - queryParams: selectorParams.extractor.queryParams, - select: selectorParams.extractor.select.applicationSection - ? selectorParams.extractor.select - : { - ...selectorParams.extractor.select, - applicationSection: selectorParams.extractor.pageParams.elementValue.applicationSection.elementValue as ApplicationSection, - }, - }, - }); - break; - } - default: { - return Promise.resolve({ - elementType: "failure", - elementValue: { - queryFailure: "IncorrectParameters", - queryParameters: JSON.stringify(selectorParams), - }, - }); - break; + /** + * returns an Entity Instance List, from a ListQuery + * @param deploymentEntityState + * @param selectorParams + * @returns + */ + private asyncSqlDbExtractEntityInstanceUuidIndexWithObjectListExtractor = ( + state: StateType, + selectorParams: AsyncExtractorRunnerParams + ): Promise => { + // ( + // state: any, + // selectorParams: AsyncExtractorRunnerParams + // ): Promise { + let result: Promise; + switch (selectorParams.extractor.select.queryType) { + case "extractObjectListByEntity": { + return this.extractEntityInstanceUuidIndexWithFilter(state, selectorParams); + } + case "selectObjectListByRelation": + case "selectObjectListByManyToManyRelation": { + return this.extractorRunnerMap.extractEntityInstanceUuidIndexWithObjectListExtractor(state, { + extractorRunnerMap: this.extractorRunnerMap, + extractor: { + queryType: "domainModelSingleExtractor", + deploymentUuid: selectorParams.extractor.deploymentUuid, + contextResults: selectorParams.extractor.contextResults, + pageParams: selectorParams.extractor.pageParams, + queryParams: selectorParams.extractor.queryParams, + select: selectorParams.extractor.select.applicationSection + ? selectorParams.extractor.select + : { + ...selectorParams.extractor.select, + applicationSection: selectorParams.extractor.pageParams.elementValue.applicationSection + .elementValue as ApplicationSection, + }, + }, + }); + break; + } + default: { + return Promise.resolve({ + elementType: "failure", + elementValue: { + queryFailure: "IncorrectParameters", + queryParameters: JSON.stringify(selectorParams), + }, + }); + break; + } } - } -}; + }; // ############################################################################################## async handleQuery(queryAction: QueryAction): Promise { @@ -219,23 +251,17 @@ export class SqlDbExtractRunner { let queryResult: DomainElement; switch (queryAction.query.queryType) { case "domainModelSingleExtractor": { - queryResult = await this.extractorRunnerMap.extractWithExtractor( - undefined /* domainState*/, - { - extractor: queryAction.query, - extractorRunnerMap: this.extractorRunnerMap, - } - ); + queryResult = await this.extractorRunnerMap.extractWithExtractor(undefined /* domainState*/, { + extractor: queryAction.query, + extractorRunnerMap: this.extractorRunnerMap, + }); break; } case "extractorForRecordOfExtractors": { - queryResult = await this.extractorRunnerMap.extractWithManyExtractors( - undefined /* domainState*/, - { - extractor: queryAction.query, - extractorRunnerMap: this.extractorRunnerMap, - } - ); + queryResult = await this.extractorRunnerMap.extractWithManyExtractors(undefined /* domainState*/, { + extractor: queryAction.query, + extractorRunnerMap: this.extractorRunnerMap, + }); break; } default: { @@ -259,8 +285,10 @@ export class SqlDbExtractRunner { } // ############################################################################################## - public extractEntityInstance:AsyncExtractorRunner< - ExtractorForSingleObject, any, DomainElementEntityInstanceOrFailed + public extractEntityInstance: AsyncExtractorRunner< + ExtractorForSingleObject, + any, + DomainElementEntityInstanceOrFailed > = async ( deploymentEntityState: any, selectorParams: AsyncExtractorRunnerParams @@ -269,7 +297,8 @@ export class SqlDbExtractRunner { const deploymentUuid = selectorParams.extractor.deploymentUuid; const applicationSection: ApplicationSection = selectorParams.extractor.select.applicationSection ?? - ((selectorParams.extractor.pageParams?.elementValue?.applicationSection?.elementValue ?? "data") as ApplicationSection); + ((selectorParams.extractor.pageParams?.elementValue?.applicationSection?.elementValue ?? + "data") as ApplicationSection); const entityUuidReference: DomainElement = resolveContextReference( querySelectorParams.parentUuid, @@ -277,7 +306,13 @@ export class SqlDbExtractRunner { selectorParams.extractor.contextResults ); - log.info("selectEntityInstanceFromDeploymentEntityState params", querySelectorParams, deploymentUuid, applicationSection, entityUuidReference); + log.info( + "selectEntityInstanceFromDeploymentEntityState params", + querySelectorParams, + deploymentUuid, + applicationSection, + entityUuidReference + ); // log.info("selectEntityInstanceFromDeploymentEntityState found entityUuidReference", JSON.stringify(entityUuidReference)) if (entityUuidReference.elementType != "string" && entityUuidReference.elementType != "instanceUuid") { @@ -321,11 +356,9 @@ export class SqlDbExtractRunner { const result = await this.persistenceStoreController.getInstance( // applicationSection, entityUuidReference.elementValue, - (referenceObject.elementValue as any)[ - querySelectorParams.AttributeOfObjectToCompareToReferenceUuid - ] + (referenceObject.elementValue as any)[querySelectorParams.AttributeOfObjectToCompareToReferenceUuid] ); - + if (result.status == "error") { return { elementType: "failure", @@ -352,11 +385,11 @@ export class SqlDbExtractRunner { return { elementType: "instance", elementValue: result.returnedDomainElement.elementValue, - // deploymentEntityState[index].entities[ - // (referenceObject.elementValue as any)[ - // querySelectorParams.AttributeOfObjectToCompareToReferenceUuid - // ] - // ], + // deploymentEntityState[index].entities[ + // (referenceObject.elementValue as any)[ + // querySelectorParams.AttributeOfObjectToCompareToReferenceUuid + // ] + // ], }; break; } @@ -368,11 +401,14 @@ export class SqlDbExtractRunner { ); // log.info("selectEntityInstanceFromDeploymentEntityState selectObjectByDirectReference found domainState", JSON.stringify(domainState)) - log.info("selectEntityInstanceFromDeploymentEntityState found instanceUuid", JSON.stringify(instanceDomainElement)) + log.info( + "selectEntityInstanceFromDeploymentEntityState found instanceUuid", + JSON.stringify(instanceDomainElement) + ); // if (instanceUuid.elementType != "string" && instanceUuid.elementType != "instanceUuid") { if (instanceDomainElement.elementType == "instance") { - return instanceDomainElement /* QueryResults, elementType == "failure" */ + return instanceDomainElement; /* QueryResults, elementType == "failure" */ } if (instanceDomainElement.elementType != "string" && instanceDomainElement.elementType != "instanceUuid") { return { @@ -414,7 +450,7 @@ export class SqlDbExtractRunner { entityUuidReference.elementValue, instanceDomainElement.elementValue ); - + if (result.status == "error") { return { elementType: "failure", @@ -427,7 +463,8 @@ export class SqlDbExtractRunner { }, }; } - log.info("selectEntityInstanceFromDeploymentEntityState selectObjectByDirectReference, ############# reference", + log.info( + "selectEntityInstanceFromDeploymentEntityState selectObjectByDirectReference, ############# reference", querySelectorParams, "entityUuidReference", entityUuidReference, @@ -443,7 +480,7 @@ export class SqlDbExtractRunner { return { elementType: "instance", elementValue: result.returnedDomainElement.elementValue, - // deploymentEntityState[index].entities[instanceDomainElement.elementValue], + // deploymentEntityState[index].entities[instanceDomainElement.elementValue], }; break; } @@ -457,15 +494,17 @@ export class SqlDbExtractRunner { } }; - // ############################################################################################## - public extractEntityInstanceUuidIndex: AsyncExtractorRunner< - ExtractorForSingleObjectList, any, DomainElementInstanceUuidIndexOrFailed + // ############################################################################################## + public extractEntityInstanceUuidIndex: AsyncExtractorRunner< + ExtractorForSingleObjectList, + any, + DomainElementInstanceUuidIndexOrFailed > = async ( domainState: any, extractorRunnerParams: AsyncExtractorRunnerParams ): Promise => { const deploymentUuid = extractorRunnerParams.extractor.deploymentUuid; - const applicationSection = extractorRunnerParams.extractor.select.applicationSection??"data"; + const applicationSection = extractorRunnerParams.extractor.select.applicationSection ?? "data"; const entityUuid: DomainElement = resolveContextReference( extractorRunnerParams.extractor.select.parentUuid, @@ -477,7 +516,8 @@ export class SqlDbExtractRunner { // log.info("selectEntityInstanceUuidIndexFromDomainState domainState", domainState); if (!deploymentUuid || !applicationSection || !entityUuid) { - return { // new object + return { + // new object elementType: "failure", elementValue: { queryFailure: "IncorrectParameters", @@ -490,10 +530,11 @@ export class SqlDbExtractRunner { switch (entityUuid.elementType) { case "string": case "instanceUuid": { - const entityInstanceCollection: ActionEntityInstanceCollectionReturnType = await this.persistenceStoreController.getInstances( - // applicationSection, - entityUuid.elementValue - ); + const entityInstanceCollection: ActionEntityInstanceCollectionReturnType = + await this.persistenceStoreController.getInstances( + // applicationSection, + entityUuid.elementValue + ); if (entityInstanceCollection.status == "error") { // return data; @@ -506,9 +547,10 @@ export class SqlDbExtractRunner { entityUuid: entityUuid.elementValue, }, }; - } - const entityInstanceUuidIndex = Object.fromEntries(entityInstanceCollection.returnedDomainElement.elementValue.instances.map(i => [i.uuid, i])); + const entityInstanceUuidIndex = Object.fromEntries( + entityInstanceCollection.returnedDomainElement.elementValue.instances.map((i) => [i.uuid, i]) + ); return { elementType: "instanceUuidIndex", elementValue: entityInstanceUuidIndex }; break; } @@ -530,7 +572,9 @@ export class SqlDbExtractRunner { break; } default: { - throw new Error("selectEntityInstanceUuidIndexFromDomainState could not handle reference entityUuid=" + entityUuid); + throw new Error( + "selectEntityInstanceUuidIndexFromDomainState could not handle reference entityUuid=" + entityUuid + ); break; } } @@ -538,13 +582,15 @@ export class SqlDbExtractRunner { // ############################################################################################## public extractEntityInstanceUuidIndexWithFilter: AsyncExtractorRunner< - ExtractorForSingleObjectList, any, DomainElementInstanceUuidIndexOrFailed + ExtractorForSingleObjectList, + any, + DomainElementInstanceUuidIndexOrFailed > = async ( domainState: any, extractorRunnerParams: AsyncExtractorRunnerParams ): Promise => { const deploymentUuid = extractorRunnerParams.extractor.deploymentUuid; - const applicationSection = extractorRunnerParams.extractor.select.applicationSection??"data"; + const applicationSection = extractorRunnerParams.extractor.select.applicationSection ?? "data"; const entityUuid: DomainElement = resolveContextReference( extractorRunnerParams.extractor.select.parentUuid, @@ -556,7 +602,8 @@ export class SqlDbExtractRunner { // log.info("selectEntityInstanceUuidIndexFromDomainState domainState", domainState); if (!deploymentUuid || !applicationSection || !entityUuid) { - return { // new object + return { + // new object elementType: "failure", elementValue: { queryFailure: "IncorrectParameters", @@ -570,7 +617,10 @@ export class SqlDbExtractRunner { case "string": case "instanceUuid": { let entityInstanceCollection: ActionEntityInstanceCollectionReturnType; - if (extractorRunnerParams.extractor.select.queryType == "extractObjectListByEntity" && extractorRunnerParams.extractor.select.filter) { + if ( + extractorRunnerParams.extractor.select.queryType == "extractObjectListByEntity" && + extractorRunnerParams.extractor.select.filter + ) { // TODO: resolve filter value // const resolvedFilterValue: DomainElement = resolveContextReference( // extractorRunnerParams.extractor.select.parentUuid, @@ -635,9 +685,10 @@ export class SqlDbExtractRunner { entityUuid: entityUuid.elementValue, }, }; - } - const entityInstanceUuidIndex = Object.fromEntries(entityInstanceCollection.returnedDomainElement.elementValue.instances.map(i => [i.uuid, i])); + const entityInstanceUuidIndex = Object.fromEntries( + entityInstanceCollection.returnedDomainElement.elementValue.instances.map((i) => [i.uuid, i]) + ); return { elementType: "instanceUuidIndex", elementValue: entityInstanceUuidIndex }; break; } @@ -659,7 +710,9 @@ export class SqlDbExtractRunner { break; } default: { - throw new Error("selectEntityInstanceUuidIndexFromDomainState could not handle reference entityUuid=" + entityUuid); + throw new Error( + "selectEntityInstanceUuidIndexFromDomainState could not handle reference entityUuid=" + entityUuid + ); break; } } @@ -669,14 +722,8 @@ export class SqlDbExtractRunner { public getSelectorMap(): AsyncExtractorRunnerMap { return this.extractorRunnerMap; } - - } - - - - export function getJzodSchemaSelectorMap(): ExtractorRunnerMapForJzodSchema { return { extractJzodSchemaForDomainModelQuery: selectJzodSchemaByDomainModelQueryFromDomainStateNew,