From 1d52365ece21f759ad350ad6f234b10f7c97d69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Mon, 24 Jul 2023 23:30:01 +0200 Subject: [PATCH] [fix] output:backend-typescript --- source/outputs/backend_typescript.ts | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/source/outputs/backend_typescript.ts b/source/outputs/backend_typescript.ts index 2ecb751..9e74ca4 100644 --- a/source/outputs/backend_typescript.ts +++ b/source/outputs/backend_typescript.ts @@ -75,28 +75,32 @@ namespace _sindri.outputs.backend.typescript prog_output.render_program( new lib_plankton.prog.struct_program( [] + /* // conf .concat( [ new lib_plankton.prog.struct_statement_declaration( - true, + false, "conf", - null, - new lib_plankton.prog.struct_expression_dict( + new lib_plankton.prog.struct_type_record( [ { - "key": "database_path", - "value": new lib_plankton.prog.struct_expression_literal(database_path), + "name": "database_path", + "type": new lib_plankton.prog.struct_type_string(), + "mandatory": true, }, { - "key": "server_port", - "value": new lib_plankton.prog.struct_expression_literal(8888), + "name": "server_port", + "type": new lib_plankton.prog.struct_type_string(), + "mandatory": true, }, ] - ) + ), + null ), ] ) + */ // entities .concat( input_data["domains"] @@ -243,7 +247,7 @@ namespace _sindri.outputs.backend.typescript "key": "key", "value": new lib_plankton.prog.struct_expression_projection( new lib_plankton.prog.struct_expression_variable("row"), - new lib_plankton.prog.struct_expression_literal(0) + new lib_plankton.prog.struct_expression_literal(domain.key_field.name) ), }, { @@ -255,7 +259,7 @@ namespace _sindri.outputs.backend.typescript "key": field.name, "value": new lib_plankton.prog.struct_expression_projection( new lib_plankton.prog.struct_expression_variable("row"), - new lib_plankton.prog.struct_expression_literal(index + 1) + new lib_plankton.prog.struct_expression_literal(field.name) ) }) ) @@ -367,7 +371,7 @@ namespace _sindri.outputs.backend.typescript "key": field.name, "value": new lib_plankton.prog.struct_expression_projection( new lib_plankton.prog.struct_expression_variable("row"), - new lib_plankton.prog.struct_expression_literal(index) + new lib_plankton.prog.struct_expression_literal(field.name) ) }) )