From 8678b9dd1b454d70f85c4f6f09c21a481dde6eec Mon Sep 17 00:00:00 2001 From: Miroir Framework Date: Tue, 27 Aug 2024 10:34:05 +0200 Subject: [PATCH] create basic elements for Miroir Action Script (MAS), migrate Tools.submit to MAS #28. Refactor handling of runtimeTransformers in sqlDbExtractorRunner: allow only QueryExtractorTransformers as runtimeTransformers (and not MiroirSelectQueriesRecord). Also, QueryExtractorTransformers are not part of MiroirSelectQueriesRecord anymore. --- .../getMiroirFundamentalJzodSchema.ts | 25 ++- .../miroirFundamentalJzodSchema.ts | 163 ++++++------------ .../miroirFundamentalType.ts | 56 +++--- .../src/2_domain/AsyncQuerySelectors.ts | 18 -- .../src/2_domain/QuerySelectors.ts | 58 +++---- .../359f1f9b-7260-4d76-a864-72c839b9711b.json | 26 +-- .../952d2c65-4da2-45c2-9394-a0920ceedfb6.json | 8 +- .../2_domain/domainSelector.unit.test.ts | 29 ++-- .../src/miroir-fwk/4_view/Importer.tsx | 16 +- .../src/4_services/SqlDbExtractorRunner.ts | 52 ------ 10 files changed, 160 insertions(+), 291 deletions(-) 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 6e58f3f5..cc7b6ea2 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 @@ -1561,22 +1561,21 @@ export function getMiroirFundamentalJzodSchema( }, }, runtimeTransformers: { - // type: "record", - // optional: true, - // definition: { - // type: "schemaReference", - // definition: { - // absolutePath: "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - // relativePath: "queryExtractorTransformer", - // }, - // }, - type: "schemaReference", + type: "record", optional: true, definition: { - absolutePath: "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - relativePath: "miroirSelectQueriesRecord", - // relativePath: "queryExtractorTransformer", + type: "schemaReference", + definition: { + absolutePath: "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", + relativePath: "queryExtractorTransformer", + }, }, + // type: "schemaReference", + // optional: true, + // definition: { + // absolutePath: "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", + // relativePath: "miroirSelectQueriesRecord", + // }, }, }, }, 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 21c18e4a..e3c494bb 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": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "definition": { @@ -2679,7 +2679,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "selectData": { @@ -2725,7 +2725,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "selectData": { @@ -2836,7 +2836,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "section": { @@ -3127,7 +3127,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "definition": { @@ -3272,7 +3272,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "selectData": { @@ -3318,7 +3318,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "selectData": { @@ -3432,7 +3432,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "section": { @@ -4684,34 +4684,12 @@ export const miroirFundamentalJzodSchema = { } }, "queryExtractorTransformer": { - "type": "union", - "discriminator": "queryName", - "definition": [ - { - "type": "schemaReference", - "definition": { - "relativePath": "queryExtractorRuntimeTransformer", - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739" - }, - "context": {} - }, - { - "type": "schemaReference", - "definition": { - "relativePath": "queryExtractorTransformerUnique", - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739" - }, - "context": {} - }, - { - "type": "schemaReference", - "definition": { - "relativePath": "queryExtractorTransformerCount", - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739" - }, - "context": {} - } - ] + "type": "schemaReference", + "definition": { + "relativePath": "queryExtractorRuntimeTransformer", + "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739" + }, + "context": {} }, "querySelect": { "type": "union", @@ -5452,11 +5430,14 @@ export const miroirFundamentalJzodSchema = { } }, "runtimeTransformers": { - "type": "schemaReference", + "type": "record", "optional": true, "definition": { - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "type": "schemaReference", + "definition": { + "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", + "relativePath": "queryExtractorTransformer" + } } } } @@ -16076,8 +16057,7 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "optional": true, "definition": { - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" }, "context": {} }, @@ -16485,8 +16465,7 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "optional": true, "definition": { - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" }, "context": {} }, @@ -16624,8 +16603,7 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "optional": true, "definition": { - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" }, "context": {} }, @@ -16942,8 +16920,7 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "optional": true, "definition": { - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" }, "context": {} }, @@ -17330,8 +17307,7 @@ export const miroirFundamentalJzodSchema = { "type": "schemaReference", "optional": true, "definition": { - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" }, "context": {} }, @@ -17742,7 +17718,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" }, "context": {} }, @@ -17882,7 +17858,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" }, "context": {} }, @@ -18217,7 +18193,7 @@ export const miroirFundamentalJzodSchema = { "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" }, "context": {} }, @@ -25677,61 +25653,13 @@ export const miroirFundamentalJzodSchema = { }, "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer": { "type": "union", - "discriminator": "queryName", "definition": [ { - "type": "union", - "definition": [ - { - "type": "schemaReference", - "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer" - }, - "context": {} - }, - { - "type": "schemaReference", - "definition": { - "relativePath": "carryOnObject" - } - } - ] - }, - { - "type": "union", - "definition": [ - { - "type": "schemaReference", - "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerUnique" - }, - "context": {} - }, - { - "type": "schemaReference", - "definition": { - "relativePath": "carryOnObject" - } - } - ] - }, - { - "type": "union", - "definition": [ - { - "type": "schemaReference", - "definition": { - "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerCount" - }, - "context": {} - }, - { - "type": "schemaReference", - "definition": { - "relativePath": "carryOnObject" - } - } - ] + "type": "schemaReference", + "definition": { + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer" + }, + "context": {} }, { "type": "schemaReference", @@ -26571,17 +26499,30 @@ export const miroirFundamentalJzodSchema = { ] }, "runtimeTransformers": { - "optional": true, "type": "union", + "optional": true, "definition": [ { - "type": "schemaReference", + "type": "record", "optional": true, "definition": { - "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" - }, - "context": {} + "type": "union", + "definition": [ + { + "type": "schemaReference", + "definition": { + "relativePath": "carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer" + }, + "context": {} + }, + { + "type": "schemaReference", + "definition": { + "relativePath": "carryOnObject" + } + } + ] + } }, { "type": "schemaReference", 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 7db0518f..63d1c36b 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?: MiroirSelectQueriesRecord | undefined; + runtimeTransformers?: QueryExtractorTransformer | undefined; definition: { label?: string | undefined; parentUuid: string; @@ -663,14 +663,14 @@ export type ObjectListReportSection = { export type GridReportSection = { type: "grid"; combiners?: MiroirSelectQueriesRecord | undefined; - runtimeTransformers?: MiroirSelectQueriesRecord | undefined; + runtimeTransformers?: QueryExtractorTransformer | undefined; selectData?: MiroirSelectQueriesRecord | undefined; definition: ReportSection[][]; }; export type ListReportSection = { type: "list"; combiners?: MiroirSelectQueriesRecord | undefined; - runtimeTransformers?: MiroirSelectQueriesRecord | undefined; + runtimeTransformers?: QueryExtractorTransformer | undefined; selectData?: MiroirSelectQueriesRecord | undefined; definition: (ObjectInstanceReportSection | ObjectListReportSection)[]; }; @@ -686,7 +686,7 @@ export type RootReportSection = { [x: string]: QuerySelectExtractorWrapper; } | undefined; combiners?: MiroirSelectQueriesRecord | undefined; - runtimeTransformers?: MiroirSelectQueriesRecord | undefined; + runtimeTransformers?: QueryExtractorTransformer | undefined; section: ReportSection; }; export type JzodObjectOrReference = JzodReference | JzodObject; @@ -722,7 +722,7 @@ export type Report = { [x: string]: QuerySelectExtractorWrapper; } | undefined; combiners?: MiroirSelectQueriesRecord | undefined; - runtimeTransformers?: MiroirSelectQueriesRecord | undefined; + runtimeTransformers?: QueryExtractorTransformer | undefined; section: ReportSection; }; }; @@ -948,7 +948,7 @@ export type QueryExtractorRuntimeTransformer = { queryName: "actionRuntimeTransformer"; actionRuntimeTransformer: ObjectRuntimeTemplate; }; -export type QueryExtractorTransformer = QueryExtractorRuntimeTransformer | QueryExtractorTransformerUnique | QueryExtractorTransformerCount; +export type QueryExtractorTransformer = QueryExtractorRuntimeTransformer; export type QuerySelect = QuerySelectExtractorWrapper | QueryExtractorTransformer | { queryType: "wrapperReturningObject"; definition: { @@ -1072,7 +1072,9 @@ export type ExtractorForRecordOfExtractors = { [x: string]: QuerySelectExtractorWrapper; } | undefined; combiners?: MiroirSelectQueriesRecord | undefined; - runtimeTransformers?: MiroirSelectQueriesRecord | undefined; + runtimeTransformers?: { + [x: string]: QueryExtractorTransformer; + } | undefined; }; export type DomainModelGetEntityDefinitionExtractor = { deploymentUuid: string; @@ -2245,7 +2247,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?: ((MiroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; + runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer | undefined) | CarryOnObject) | undefined; definition: CarryOnObject | { label?: ((string | undefined) | CarryOnObject) | undefined; parentUuid: string | CarryOnObject; @@ -2267,14 +2269,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?: ((MiroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; + runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer | 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?: ((MiroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; + runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer | 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; }; @@ -2290,7 +2292,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?: ((MiroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; + runtimeTransformers?: ((CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer | undefined) | CarryOnObject) | undefined; section: CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_reportSection | CarryOnObject; }; export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_report = CarryOnObject | { @@ -2773,7 +2775,7 @@ export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransform queryName: "count" | CarryOnObject; groupBy?: ((string | undefined) | CarryOnObject) | undefined; }; -export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer = (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer | CarryOnObject) | (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerUnique | CarryOnObject) | (CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerCount | CarryOnObject) | 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 | { @@ -2829,7 +2831,9 @@ export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_extractorForRecordOfExt [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?: ((MiroirSelectQueriesRecord | undefined) | CarryOnObject) | undefined; + runtimeTransformers?: (({ + [x: string]: CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformer | CarryOnObject; + } | undefined) | CarryOnObject) | undefined; }; export type CarryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryAction = CarryOnObject | { actionType: "queryAction" | CarryOnObject; @@ -2922,15 +2926,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(() =>miroirSelectQueriesRecord).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(() =>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 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(() =>miroirSelectQueriesRecord).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(() =>miroirSelectQueriesRecord).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(() =>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 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(() =>miroirSelectQueriesRecord).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(() =>queryExtractorTransformer).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(() =>miroirSelectQueriesRecord).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(() =>queryExtractorTransformer).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(); @@ -2970,7 +2974,7 @@ export const queryExtractorTransformerAbstract: 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.union([z.lazy(() =>queryExtractorRuntimeTransformer), z.lazy(() =>queryExtractorTransformerUnique), z.lazy(() =>queryExtractorTransformerCount)]); +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 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(); @@ -2995,7 +2999,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.lazy(() =>miroirSelectQueriesRecord).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(() =>queryExtractorTransformer)).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(); @@ -3106,12 +3110,12 @@ 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(() =>miroirSelectQueriesRecord).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_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_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(() =>miroirSelectQueriesRecord).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(() =>miroirSelectQueriesRecord).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_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_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(() =>miroirSelectQueriesRecord).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_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_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()]); @@ -3155,7 +3159,7 @@ export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransfor 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.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorRuntimeTransformer), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerUnique), z.lazy(() =>carryOnObject)]), z.union([z.lazy(() =>carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_queryExtractorTransformerCount), z.lazy(() =>carryOnObject)]), z.lazy(() =>carryOnObject)]); +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_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()]); @@ -3164,7 +3168,7 @@ export const carryOn_fe9b7d99$f216$44de$bb6e$60e1a1ebb739_miroirSelectQueriesRec 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.lazy(() =>miroirSelectQueriesRecord).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_queryExtractorTransformer), 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/2_domain/AsyncQuerySelectors.ts b/packages/miroir-core/src/2_domain/AsyncQuerySelectors.ts index 27baaab1..53689a4e 100644 --- a/packages/miroir-core/src/2_domain/AsyncQuerySelectors.ts +++ b/packages/miroir-core/src/2_domain/AsyncQuerySelectors.ts @@ -84,24 +84,6 @@ export async function asyncApplyExtractorTransformerInMemory( extractors: Record, ): Promise { return Promise.resolve(applyExtractorTransformer(query, queryParams, newFetchedData)); - // const resolvedReference = resolveContextReference( - // query.referencedExtractor, - // queryParams, - // newFetchedData - // ); - - // log.info("asyncInnerSelectElementFromQuery extractorTransformer resolvedReference", resolvedReference); - - // const result = new Set(); - // if (resolvedReference.elementType == "instanceUuidIndex") { - // for (const entry of Object.entries(resolvedReference.elementValue)) { - // result.add((entry[1] as any)[query.attribute]); - // } - // log.info("asyncInnerSelectElementFromQuery extractorTransformer result", JSON.stringify(Array.from(result.values()))); - // return Promise.resolve({ elementType: "any", elementValue: [...result] }); - // } - - // return Promise.resolve({ elementType: "failure", elementValue: { queryFailure: "QueryNotExecutable" } }); } // ################################################################################################ diff --git a/packages/miroir-core/src/2_domain/QuerySelectors.ts b/packages/miroir-core/src/2_domain/QuerySelectors.ts index 23aa9d62..862f81b8 100644 --- a/packages/miroir-core/src/2_domain/QuerySelectors.ts +++ b/packages/miroir-core/src/2_domain/QuerySelectors.ts @@ -376,41 +376,41 @@ export const applyExtractorTransformer = ( return { elementType: "failure", elementValue: { queryFailure: "QueryNotExecutable" } }; // TODO: improve error message / queryFailure } - const sortByAttribute = query.orderBy?(a: any[])=>a.sort((a, b) => a[query.orderBy??""].localeCompare(b[query.orderBy??""], "en", { sensitivity: "base" })):(a: any[])=>a; + // const sortByAttribute = query.orderBy?(a: any[])=>a.sort((a, b) => a[query.orderBy??""].localeCompare(b[query.orderBy??""], "en", { sensitivity: "base" })):(a: any[])=>a; switch (query.queryName) { case "actionRuntimeTransformer": { // return { elementType: "failure", elementValue: { queryFailure: "QueryNotExecutable" } }; return renderObjectRuntimeTemplate("ROOT"/**WHAT?? */, query.actionRuntimeTransformer, queryParams, newFetchedData); break; } - case "unique": { - const result = new Set(); - for (const entry of Object.entries(resolvedReference.elementValue)) { - result.add((entry[1] as any)[query.attribute]); - } - return { elementType: "any", elementValue: sortByAttribute([...result].map(e => ({[query.attribute]: e}))) }; - break; - } - case "count": { - if (query.groupBy) { - const result = new Map(); - for (const entry of Object.entries(resolvedReference.elementValue)) { - const key = (entry[1] as any)[query.groupBy]; - if (result.has(key)) { - result.set(key, (result.get(key)??0) + 1); - } else { - result.set(key, 1); - } - } - return { - elementType: "any", - elementValue: sortByAttribute([...result.entries()].map((e) => ({ [query.groupBy as any]: e[0], count: e[1] }))), - }; - } else { - return { elementType: "any" /* TODO: number? */, elementValue: [{count: Object.keys(resolvedReference.elementValue).length}] }; - } - break; - } + // case "unique": { + // const result = new Set(); + // for (const entry of Object.entries(resolvedReference.elementValue)) { + // result.add((entry[1] as any)[query.attribute]); + // } + // return { elementType: "any", elementValue: sortByAttribute([...result].map(e => ({[query.attribute]: e}))) }; + // break; + // } + // case "count": { + // if (query.groupBy) { + // const result = new Map(); + // for (const entry of Object.entries(resolvedReference.elementValue)) { + // const key = (entry[1] as any)[query.groupBy]; + // if (result.has(key)) { + // result.set(key, (result.get(key)??0) + 1); + // } else { + // result.set(key, 1); + // } + // } + // return { + // elementType: "any", + // elementValue: sortByAttribute([...result.entries()].map((e) => ({ [query.groupBy as any]: e[0], count: e[1] }))), + // }; + // } else { + // return { elementType: "any" /* TODO: number? */, elementValue: [{count: Object.keys(resolvedReference.elementValue).length}] }; + // } + // break; + // } default: { return { elementType: "failure", elementValue: { queryFailure: "QueryNotExecutable" } }; break; 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 069343ca..d64a22e0 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 @@ -621,28 +621,10 @@ } }, "queryExtractorTransformer": { - "type": "union", - "discriminator": "queryName", - "definition": [ - { - "type": "schemaReference", - "definition": { - "relativePath": "queryExtractorRuntimeTransformer" - } - }, - { - "type": "schemaReference", - "definition": { - "relativePath": "queryExtractorTransformerUnique" - } - }, - { - "type": "schemaReference", - "definition": { - "relativePath": "queryExtractorTransformerCount" - } - } - ] + "type": "schemaReference", + "definition": { + "relativePath": "queryExtractorRuntimeTransformer" + } }, "querySelect": { "type": "union", 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 7bd35385..a2dd9cec 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": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "definition": { @@ -190,7 +190,7 @@ "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "selectData": { @@ -236,7 +236,7 @@ "optional": true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "selectData": { @@ -350,7 +350,7 @@ "optional":true, "definition": { "absolutePath": "fe9b7d99-f216-44de-bb6e-60e1a1ebb739", - "relativePath": "miroirSelectQueriesRecord" + "relativePath": "queryExtractorTransformer" } }, "section": { diff --git a/packages/miroir-core/src/tests/2_domain/domainSelector.unit.test.ts b/packages/miroir-core/src/tests/2_domain/domainSelector.unit.test.ts index 9763a256..d4c3030c 100644 --- a/packages/miroir-core/src/tests/2_domain/domainSelector.unit.test.ts +++ b/packages/miroir-core/src/tests/2_domain/domainSelector.unit.test.ts @@ -26,7 +26,7 @@ describe("domainSelector", () => { contextResults: { elementType: "object", elementValue: {} }, pageParams: { elementType: "object", elementValue: {} }, queryParams: { elementType: "object", elementValue: {} }, - runtimeTransformers: { + extractors: { book: { queryType: "selectObjectByDirectReference", parentName: "Book", @@ -70,7 +70,7 @@ describe("domainSelector", () => { contextResults: { elementType: "object", elementValue: {} }, pageParams: { elementType: "object", elementValue: {} }, queryParams: { elementType: "object", elementValue: {} }, - runtimeTransformers: { + extractors: { book: { queryType: "selectObjectByDirectReference", parentName: "Book", @@ -115,7 +115,7 @@ describe("domainSelector", () => { "contextResults": { elementType: "object", elementValue: {} }, pageParams: { elementType: "object", elementValue: {} }, queryParams: { elementType: "object", elementValue: {} }, - "runtimeTransformers": { + "extractors": { "book": { queryType: "selectObjectByDirectReference", parentName: "Book", @@ -209,7 +209,7 @@ describe("domainSelector", () => { }, }, }, - runtimeTransformers: { + combiners: { book2: { queryType: "queryContextReference", queryReference: "book", @@ -282,7 +282,7 @@ describe("domainSelector", () => { }, }, }, - runtimeTransformers: { + combiners: { publisher: { queryType: "selectObjectByRelation", parentName: "Publisher", @@ -297,6 +297,8 @@ describe("domainSelector", () => { AttributeOfObjectToCompareToReferenceUuid: "publisher", }, }, + runtimeTransformers: { + }, }; const queryResult:any = extractWithExtractorFromDomainState(domainState, getSelectorParams(queryParam)); @@ -471,7 +473,7 @@ describe("domainSelector", () => { }, }, }, - runtimeTransformers: { + combiners: { publisher: { queryType: "selectObjectByRelation", parentName: "Publisher", @@ -499,6 +501,8 @@ describe("domainSelector", () => { AttributeOfListObjectToCompareToReferenceUuid: "publisher", }, }, + runtimeTransformers: { + }, }; const queryResult:any = extractWithExtractorFromDomainState(domainState, getSelectorParams(queryParam)); @@ -545,7 +549,7 @@ describe("domainSelector", () => { }, }, }, - runtimeTransformers: { + combiners: { publisher: { queryType: "selectObjectByRelation", parentName: "Publisher", @@ -635,7 +639,7 @@ describe("domainSelector", () => { }, }, }, - runtimeTransformers: { + combiners: { instancesOfEntities: { queryType: "queryCombiner", // heteronomous many-to-many join, not possible with SQL rootQuery: { @@ -712,13 +716,18 @@ describe("domainSelector", () => { runtimeTransformers: { publishers: { queryType: "extractorTransformer", - queryName: "unique", + queryName: "actionRuntimeTransformer", referencedExtractor: "books", + actionRuntimeTransformer: { + templateType: "unique", + interpolation: "runtime", + referencedExtractor: "books", + attribute: "publisher", + } // referencedExtractor: { // queryTemplateType: "queryContextReference", // referenceName: "books", // }, - attribute: "publisher", }, }, }; diff --git a/packages/miroir-standalone-app/src/miroir-fwk/4_view/Importer.tsx b/packages/miroir-standalone-app/src/miroir-fwk/4_view/Importer.tsx index fad4c034..580ec173 100644 --- a/packages/miroir-standalone-app/src/miroir-fwk/4_view/Importer.tsx +++ b/packages/miroir-standalone-app/src/miroir-fwk/4_view/Importer.tsx @@ -1193,13 +1193,17 @@ export const Importer:FC = (props:ImporterCoreProps) => { runtimeTransformers: { uniqueSplittedEntityInstances: { queryType: "extractorTransformer", - queryName: "unique", + queryName: "actionRuntimeTransformer", + actionRuntimeTransformer: { + interpolation: "runtime", + templateType: "unique", + referencedExtractor: { + queryTemplateType: "parameterReference", + referenceName: "splittedEntityName", + }, + attribute: splittedEntityAttribute + } // referencedExtractor: splittedEntityName, - referencedExtractor: { - queryTemplateType: "parameterReference", - referenceName: "splittedEntityName", - }, - attribute: splittedEntityAttribute } } } diff --git a/packages/miroir-store-postgres/src/4_services/SqlDbExtractorRunner.ts b/packages/miroir-store-postgres/src/4_services/SqlDbExtractorRunner.ts index 1b95b8cb..d6b403cb 100644 --- a/packages/miroir-store-postgres/src/4_services/SqlDbExtractorRunner.ts +++ b/packages/miroir-store-postgres/src/4_services/SqlDbExtractorRunner.ts @@ -150,58 +150,6 @@ export class SqlDbExtractRunner { } break; } - case "unique": { - const orderBy = query.orderBy ? `ORDER BY ${query.orderBy}` : ""; - log.info("applyExtractorTransformerSql query.attribute", query.attribute); - // TODO: resolve query.referencedExtractor.referenceName properly - const aggregateRawQuery = ` - WITH ${extractorRawQueries.map(q => "\"" + q[0] + "\" AS (" + q[1] + " )").join(", ")} - SELECT DISTINCT ON ("${query.attribute}") "${query.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 }); - break; - } - case "count": { - log.info("applyExtractorTransformerSql count query.groupBy", query.groupBy); - // TODO: resolve query.referencedExtractor.referenceName properly - const orderBy = query.orderBy ? `ORDER BY ${query.orderBy}` : ""; - const aggregateRawQuery = query.groupBy ? - `WITH ${extractorRawQueries.map(q => "\"" + q[0] + "\" AS (" + q[1] + " )").join(", ")} - SELECT "${query.groupBy}", COUNT("uuid") FROM ${referenceName} - GROUP BY "${query.groupBy}" - ${orderBy} - ` : - `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)})); - // log.info("applyExtractorTransformerSql count sqlResult", JSON.stringify(sqlResult)); - log.info("applyExtractorTransformerSql count sqlResult", sqlResult); - return Promise.resolve({ elementType: "any", elementValue: sqlResult }); - break; - } default: { throw new Error("applyExtractorTransformerSql could not handle query" + query); break;