@lcap/nasl 3.3.3-beta.6 → 3.3.3-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/bak/translator.js +73 -15
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.d.ts +11 -0
- package/out/common/BaseNode.js +51 -0
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/index.d.ts +1 -0
- package/out/common/index.js +1 -0
- package/out/common/index.js.map +1 -1
- package/out/common/utils.d.ts +2 -0
- package/out/common/utils.js +18 -0
- package/out/common/utils.js.map +1 -0
- package/out/concepts/Abort__.d.ts +2 -2
- package/out/concepts/Abort__.js +6 -2
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.d.ts +2 -2
- package/out/concepts/Anchor__.js +11 -7
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +3 -3
- package/out/concepts/AnonymousFunction__.js +37 -23
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.js +137 -69
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +2 -2
- package/out/concepts/Argument__.js +18 -13
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +2 -2
- package/out/concepts/Assignee__.js +31 -19
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.d.ts +2 -2
- package/out/concepts/AssignmentLine__.js +3 -2
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +2 -2
- package/out/concepts/Assignment__.js +16 -12
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +6 -3
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.d.ts +2 -2
- package/out/concepts/AuthLogicForCallInterface__.js +62 -78
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/BackendVariable__.d.ts +5 -8
- package/out/concepts/BackendVariable__.js +23 -18
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.d.ts +4 -7
- package/out/concepts/Backend__.js +16 -11
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.d.ts +2 -2
- package/out/concepts/BatchAssignment__.js +30 -22
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +2 -2
- package/out/concepts/BinaryExpression__.js +30 -18
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +10 -4
- package/out/concepts/BindAttribute__.js +144 -43
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +2 -2
- package/out/concepts/BindDirective__.js +16 -11
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +4 -7
- package/out/concepts/BindEvent__.js +32 -24
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +2 -2
- package/out/concepts/BindStyle__.js +15 -10
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +2 -2
- package/out/concepts/BooleanLiteral__.js +2 -2
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +2 -2
- package/out/concepts/CallAuthInterface__.js +36 -31
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +2 -2
- package/out/concepts/CallConnector__.js +25 -23
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +2 -2
- package/out/concepts/CallFunction__.js +31 -22
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +2 -2
- package/out/concepts/CallInterface__.js +20 -29
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +2 -3
- package/out/concepts/CallLogic__.js +47 -50
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +4 -4
- package/out/concepts/CallQueryComponent__.js +50 -42
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.d.ts +2 -2
- package/out/concepts/Comment__.js +3 -2
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +6 -3
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +6 -3
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +4 -7
- package/out/concepts/ConfigProperty__.js +18 -13
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +6 -3
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.d.ts +4 -7
- package/out/concepts/Connection__.js +12 -8
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/Connector__.js +30 -15
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.d.ts +3 -3
- package/out/concepts/Constant__.js +18 -13
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +4 -7
- package/out/concepts/DataSource__.js +13 -9
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +3 -3
- package/out/concepts/Destination__.js +35 -29
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.d.ts +2 -2
- package/out/concepts/End__.js +17 -13
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +2 -2
- package/out/concepts/EntityIndex__.js +4 -3
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +2 -2
- package/out/concepts/EntityProperty__.js +22 -15
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +4 -7
- package/out/concepts/Entity__.js +29 -21
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +2 -2
- package/out/concepts/EnumItem__.js +4 -3
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +4 -7
- package/out/concepts/Enum__.js +16 -11
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +6 -3
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +2 -2
- package/out/concepts/ExternalDestination__.js +13 -8
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +2 -2
- package/out/concepts/ForEachStatement__.js +26 -18
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js +18 -10
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +4 -7
- package/out/concepts/Frontend__.js +37 -21
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.d.ts +3 -3
- package/out/concepts/Function__.js +52 -33
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +2 -2
- package/out/concepts/Identifier__.js +19 -18
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.d.ts +2 -2
- package/out/concepts/IfStatement__.js +18 -13
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.js +17 -9
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +2 -2
- package/out/concepts/InterfaceParam__.js +12 -8
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +4 -7
- package/out/concepts/Interface__.js +44 -33
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts +2 -2
- package/out/concepts/JSBlock__.js +3 -2
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +2 -2
- package/out/concepts/JavaLogic__.js +6 -2
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +2 -2
- package/out/concepts/LogicItem__.js +7 -3
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +8 -11
- package/out/concepts/Logic__.js +141 -136
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +2 -2
- package/out/concepts/MatchCase__.js +35 -27
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.d.ts +2 -2
- package/out/concepts/Match__.js +29 -24
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +2 -2
- package/out/concepts/MemberExpression__.js +34 -27
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MetadataType__.d.ts +4 -7
- package/out/concepts/MetadataType__.js +23 -15
- package/out/concepts/MetadataType__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.js +6 -3
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.js +6 -3
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/Namespace__.js +66 -33
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +5 -5
- package/out/concepts/NewComposite__.js +95 -82
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +5 -5
- package/out/concepts/NewList__.js +42 -32
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +4 -4
- package/out/concepts/NewMap__.js +51 -41
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.d.ts +2 -2
- package/out/concepts/New__.js +3 -2
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +2 -2
- package/out/concepts/NullLiteral__.js +2 -2
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +2 -2
- package/out/concepts/NumericLiteral__.js +12 -7
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +2 -2
- package/out/concepts/OqlQueryComponent__.js +22 -17
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +8 -11
- package/out/concepts/OverriddenLogic__.js +135 -130
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.d.ts +3 -3
- package/out/concepts/Param__.js +29 -24
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +12 -6
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +2 -2
- package/out/concepts/ProcessElement__.js +92 -66
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.d.ts +2 -1
- package/out/concepts/ProcessOutcome__.js +5 -4
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +2 -1
- package/out/concepts/ProcessOutcomes__.js +6 -5
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.d.ts +4 -7
- package/out/concepts/Process__.js +51 -34
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.d.ts +2 -2
- package/out/concepts/QueryAggregateExpression__.js +8 -5
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +2 -2
- package/out/concepts/QueryFieldExpression__.js +5 -4
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +2 -2
- package/out/concepts/QueryFromExpression__.js +14 -9
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +2 -1
- package/out/concepts/QueryGroupByExpression__.js +12 -8
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +2 -2
- package/out/concepts/QueryJoinExpression__.js +18 -13
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +2 -2
- package/out/concepts/QueryLimitExpression__.js +12 -8
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +2 -2
- package/out/concepts/QueryOrderByExpression__.js +12 -8
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +6 -3
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Return__.d.ts +3 -3
- package/out/concepts/Return__.js +21 -16
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +4 -7
- package/out/concepts/Role__.js +7 -6
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +2 -2
- package/out/concepts/SelectMembers__.js +9 -5
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js +6 -3
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +2 -2
- package/out/concepts/SqlQueryComponent__.js +18 -13
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.d.ts +2 -2
- package/out/concepts/Start__.js +2 -2
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +2 -2
- package/out/concepts/StringInterpolation__.js +13 -8
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +2 -2
- package/out/concepts/StringLiteral__.js +4 -3
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +2 -2
- package/out/concepts/StructureProperty__.js +14 -10
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +4 -7
- package/out/concepts/Structure__.js +22 -14
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +2 -2
- package/out/concepts/SwitchCase__.js +18 -13
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.d.ts +2 -2
- package/out/concepts/SwitchStatement__.js +14 -9
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/TriggerEvent__.js +6 -3
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.d.ts +4 -7
- package/out/concepts/TriggerLauncher__.js +7 -6
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +2 -2
- package/out/concepts/TypeAnnotation__.js +61 -29
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +2 -2
- package/out/concepts/TypeParam__.js +4 -3
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +2 -2
- package/out/concepts/UnaryExpression__.js +18 -10
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +2 -1
- package/out/concepts/Unparsed__.js +2 -2
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +2 -2
- package/out/concepts/ValidationRule__.js +17 -12
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +5 -8
- package/out/concepts/Variable__.js +23 -18
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +7 -6
- package/out/concepts/ViewElement__.js +139 -101
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +8 -9
- package/out/concepts/View__.js +73 -62
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.d.ts +2 -2
- package/out/concepts/WhileStatement__.js +9 -7
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/manager/diagnostic.d.ts +1 -1
- package/out/manager/diagnostic.js +2 -3
- package/out/manager/diagnostic.js.map +1 -1
- package/out/server/naslServer.d.ts +46 -55
- package/out/server/naslServer.js +302 -449
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +1 -1
- package/out/server/translator.js.map +1 -1
- package/out/templator/genCreateBlock.js +4 -4
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +6 -6
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +4 -4
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +2 -2
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +4 -4
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/translator/types.d.ts +16 -3
- package/out/translator/utils.d.ts +19 -1
- package/out/translator/utils.js +71 -2
- package/out/translator/utils.js.map +1 -1
- package/out/utils/time-slicing/constant.d.ts +35 -0
- package/out/utils/time-slicing/constant.js +40 -0
- package/out/utils/time-slicing/constant.js.map +1 -0
- package/out/utils/time-slicing/controller.d.ts +53 -0
- package/out/utils/time-slicing/controller.js +280 -0
- package/out/utils/time-slicing/controller.js.map +1 -0
- package/out/utils/time-slicing/index.d.ts +5 -0
- package/out/utils/time-slicing/index.js +26 -0
- package/out/utils/time-slicing/index.js.map +1 -0
- package/out/utils/time-slicing/page-state.d.ts +2 -0
- package/out/utils/time-slicing/page-state.js +14 -0
- package/out/utils/time-slicing/page-state.js.map +1 -0
- package/out/utils/time-slicing/performance.d.ts +11 -0
- package/out/utils/time-slicing/performance.js +51 -0
- package/out/utils/time-slicing/performance.js.map +1 -0
- package/out/utils/time-slicing/runner.d.ts +12 -0
- package/out/utils/time-slicing/runner.js +53 -0
- package/out/utils/time-slicing/runner.js.map +1 -0
- package/out/utils/time-slicing/tool.d.ts +24 -0
- package/out/utils/time-slicing/tool.js +47 -0
- package/out/utils/time-slicing/tool.js.map +1 -0
- package/out/utils/time-slicing/utils.d.ts +62 -0
- package/out/utils/time-slicing/utils.js +47 -0
- package/out/utils/time-slicing/utils.js.map +1 -0
- package/out/utils/time-slicing/wrapper.d.ts +18 -0
- package/out/utils/time-slicing/wrapper.js +55 -0
- package/out/utils/time-slicing/wrapper.js.map +1 -0
- package/out/utils/types.d.ts +7 -0
- package/package.json +1 -1
- package/src/bak/translator.js +75 -16
- package/src/common/BaseNode.ts +67 -6
- package/src/common/index.ts +1 -0
- package/src/common/utils.ts +17 -0
- package/src/concepts/Abort__.ts +12 -3
- package/src/concepts/Anchor__.ts +21 -8
- package/src/concepts/AnonymousFunction__.ts +45 -31
- package/src/concepts/App__.ts +137 -69
- package/src/concepts/Argument__.ts +31 -14
- package/src/concepts/Assignee__.ts +42 -21
- package/src/concepts/AssignmentLine__.ts +13 -3
- package/src/concepts/Assignment__.ts +26 -14
- package/src/concepts/Attribute__.ts +6 -3
- package/src/concepts/AuthLogicForCallInterface__.ts +69 -87
- package/src/concepts/BackendVariable__.ts +34 -19
- package/src/concepts/Backend__.ts +33 -12
- package/src/concepts/BatchAssignment__.ts +41 -23
- package/src/concepts/BinaryExpression__.ts +40 -20
- package/src/concepts/BindAttribute__.ts +151 -49
- package/src/concepts/BindDirective__.ts +25 -12
- package/src/concepts/BindEvent__.ts +43 -32
- package/src/concepts/BindStyle__.ts +24 -11
- package/src/concepts/BooleanLiteral__.ts +11 -3
- package/src/concepts/CallAuthInterface__.ts +45 -34
- package/src/concepts/CallConnector__.ts +34 -26
- package/src/concepts/CallFunction__.ts +34 -23
- package/src/concepts/CallInterface__.ts +33 -42
- package/src/concepts/CallLogic__.ts +60 -67
- package/src/concepts/CallQueryComponent__.ts +60 -52
- package/src/concepts/Comment__.ts +13 -3
- package/src/concepts/CompletionProperty__.ts +6 -3
- package/src/concepts/ConfigGroup__.ts +6 -3
- package/src/concepts/ConfigProperty__.ts +28 -15
- package/src/concepts/Configuration__.ts +6 -3
- package/src/concepts/Connection__.ts +28 -9
- package/src/concepts/Connector__.ts +30 -15
- package/src/concepts/Constant__.ts +28 -14
- package/src/concepts/DataSource__.ts +22 -10
- package/src/concepts/Destination__.ts +45 -36
- package/src/concepts/End__.ts +24 -15
- package/src/concepts/EntityIndex__.ts +13 -4
- package/src/concepts/EntityProperty__.ts +33 -17
- package/src/concepts/Entity__.ts +40 -25
- package/src/concepts/EnumItem__.ts +13 -4
- package/src/concepts/Enum__.ts +27 -13
- package/src/concepts/Event__.ts +6 -3
- package/src/concepts/ExternalDestination__.ts +22 -10
- package/src/concepts/ForEachStatement__.ts +36 -20
- package/src/concepts/FrontendLibrary__.ts +18 -10
- package/src/concepts/Frontend__.ts +48 -22
- package/src/concepts/Function__.ts +60 -36
- package/src/concepts/Identifier__.ts +28 -23
- package/src/concepts/IfStatement__.ts +28 -17
- package/src/concepts/Integration__.ts +17 -9
- package/src/concepts/InterfaceParam__.ts +22 -9
- package/src/concepts/Interface__.ts +55 -37
- package/src/concepts/JSBlock__.ts +12 -3
- package/src/concepts/JavaLogic__.ts +13 -3
- package/src/concepts/LogicItem__.ts +13 -4
- package/src/concepts/Logic__.ts +159 -149
- package/src/concepts/MatchCase__.ts +45 -32
- package/src/concepts/Match__.ts +39 -28
- package/src/concepts/MemberExpression__.ts +43 -28
- package/src/concepts/MetadataType__.ts +34 -16
- package/src/concepts/MsgTriggerEvent__.ts +6 -3
- package/src/concepts/MsgTriggerLauncher__.ts +6 -3
- package/src/concepts/Namespace__.ts +66 -33
- package/src/concepts/NewComposite__.ts +106 -87
- package/src/concepts/NewList__.ts +52 -38
- package/src/concepts/NewMap__.ts +61 -48
- package/src/concepts/New__.ts +13 -3
- package/src/concepts/NullLiteral__.ts +11 -3
- package/src/concepts/NumericLiteral__.ts +21 -8
- package/src/concepts/OqlQueryComponent__.ts +32 -21
- package/src/concepts/OverriddenLogic__.ts +153 -143
- package/src/concepts/Param__.ts +48 -34
- package/src/concepts/ProcessComponent__.ts +12 -6
- package/src/concepts/ProcessElement__.ts +102 -76
- package/src/concepts/ProcessOutcome__.ts +16 -8
- package/src/concepts/ProcessOutcomes__.ts +17 -9
- package/src/concepts/Process__.ts +62 -41
- package/src/concepts/QueryAggregateExpression__.ts +17 -6
- package/src/concepts/QueryFieldExpression__.ts +14 -5
- package/src/concepts/QueryFromExpression__.ts +24 -10
- package/src/concepts/QueryGroupByExpression__.ts +20 -9
- package/src/concepts/QueryJoinExpression__.ts +28 -14
- package/src/concepts/QueryLimitExpression__.ts +22 -9
- package/src/concepts/QueryOrderByExpression__.ts +23 -9
- package/src/concepts/QuerySelectExpression__.ts +6 -3
- package/src/concepts/Return__.ts +31 -17
- package/src/concepts/Role__.ts +17 -8
- package/src/concepts/SelectMembers__.ts +19 -6
- package/src/concepts/Slot__.ts +6 -3
- package/src/concepts/SqlQueryComponent__.ts +28 -14
- package/src/concepts/Start__.ts +11 -3
- package/src/concepts/StringInterpolation__.ts +16 -8
- package/src/concepts/StringLiteral__.ts +13 -4
- package/src/concepts/StructureProperty__.ts +24 -11
- package/src/concepts/Structure__.ts +33 -16
- package/src/concepts/SwitchCase__.ts +28 -17
- package/src/concepts/SwitchStatement__.ts +23 -10
- package/src/concepts/TriggerEvent__.ts +6 -3
- package/src/concepts/TriggerLauncher__.ts +17 -7
- package/src/concepts/TypeAnnotation__.ts +46 -30
- package/src/concepts/TypeParam__.ts +13 -4
- package/src/concepts/UnaryExpression__.ts +28 -12
- package/src/concepts/Unparsed__.ts +10 -3
- package/src/concepts/ValidationRule__.ts +27 -20
- package/src/concepts/Variable__.ts +34 -19
- package/src/concepts/ViewElement__.ts +165 -125
- package/src/concepts/View__.ts +108 -89
- package/src/concepts/WhileStatement__.ts +19 -10
- package/src/concepts/types__.ts +1 -1
- package/src/manager/diagnostic.ts +3 -4
- package/src/server/naslServer.ts +676 -729
- package/src/server/translator.ts +1 -1
- package/src/templator/genCreateBlock.ts +4 -4
- package/src/templator/genCurdEditMultipleKeyBlock.ts +6 -6
- package/src/templator/genCurdMultipleKeyBlock.ts +4 -4
- package/src/templator/genEditTableBlock.ts +2 -2
- package/src/templator/genUpdateBlock.ts +4 -4
- package/src/translator/types.ts +20 -5
- package/src/translator/utils.ts +78 -4
- package/src/utils/time-slicing/constant.ts +37 -0
- package/src/utils/time-slicing/controller.ts +342 -0
- package/src/utils/time-slicing/index.ts +6 -0
- package/src/utils/time-slicing/page-state.ts +12 -0
- package/src/utils/time-slicing/performance.ts +56 -0
- package/src/utils/time-slicing/runner.ts +54 -0
- package/src/utils/time-slicing/tool.ts +45 -0
- package/src/utils/time-slicing/utils.ts +90 -0
- package/src/utils/time-slicing/wrapper.ts +58 -0
- package/src/utils/types.ts +9 -0
- package/test/concepts/anonymous-function/__snapshots__/toEmbeddedTS.spec.ts.snap +8 -0
- package/test/concepts/anonymous-function/__snapshots__/toJS.spec.ts.snap +3 -0
- package/test/concepts/anonymous-function/__snapshots__/toVue.spec.ts.snap +6 -0
- package/test/concepts/anonymous-function/constant.ts +5 -0
- package/test/concepts/anonymous-function/fixtures/simple.json +85 -0
- package/test/concepts/anonymous-function/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/anonymous-function/toJS.spec.ts +14 -0
- package/test/concepts/anonymous-function/toVue.spec.ts +14 -0
- package/test/concepts/assignment/__snapshots__/toEmbeddedTS.spec.ts.snap +21 -0
- package/test/concepts/assignment/__snapshots__/toJS.spec.ts.snap +9 -0
- package/test/concepts/assignment/__snapshots__/toVue.spec.ts.snap +21 -0
- package/test/concepts/assignment/constant.ts +5 -0
- package/test/concepts/assignment/fixtures/both-space.json +4 -0
- package/test/concepts/assignment/fixtures/left-space.json +14 -0
- package/test/concepts/assignment/fixtures/right-space.json +8 -0
- package/test/concepts/assignment/fixtures/simple.json +12 -0
- package/test/concepts/assignment/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/assignment/toJS.spec.ts +14 -0
- package/test/concepts/assignment/toVue.spec.ts +14 -0
- package/test/concepts/batch-assignment/__snapshots__/toEmbeddedTS.spec.ts.snap +28 -0
- package/test/concepts/batch-assignment/__snapshots__/toJS.spec.ts.snap +13 -0
- package/test/concepts/batch-assignment/__snapshots__/toVue.spec.ts.snap +14 -0
- package/test/concepts/batch-assignment/constant.ts +5 -0
- package/test/concepts/batch-assignment/fixtures/muli-var-muli-value.json +144 -0
- package/test/concepts/batch-assignment/fixtures/simple-var-simple-value.json +36 -0
- package/test/concepts/batch-assignment/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/batch-assignment/toJS.spec.ts +14 -0
- package/test/concepts/batch-assignment/toVue.spec.ts +14 -0
- package/test/concepts/binary-expression/__snapshots__/toEmbeddedTS.spec.ts.snap +25 -0
- package/test/concepts/binary-expression/__snapshots__/toJS.spec.ts.snap +17 -0
- package/test/concepts/binary-expression/__snapshots__/toVue.spec.ts.snap +19 -0
- package/test/concepts/binary-expression/constant.ts +5 -0
- package/test/concepts/binary-expression/fixtures/constant-nested.json +36 -0
- package/test/concepts/binary-expression/fixtures/constant-simple.json +12 -0
- package/test/concepts/binary-expression/fixtures/variable-nested.json +69 -0
- package/test/concepts/binary-expression/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/binary-expression/toJS.spec.ts +14 -0
- package/test/concepts/binary-expression/toVue.spec.ts +14 -0
- package/test/concepts/boolean-literal/toEmbeddedTS.spec.ts +4 -3
- package/test/concepts/boolean-literal/toJS.spec.ts +2 -2
- package/test/concepts/boolean-literal/toVue.spec.ts +2 -2
- package/test/concepts/call-function/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/call-interface/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/call-logic/getQuickInfoOffset.spec.ts +2 -1
- package/test/concepts/call-logic/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/data-source/__snapshots__/toEmbeddedTS.spec.ts.snap +8 -0
- package/test/concepts/data-source/__snapshots__/toEmbeddedTSFile.spec.ts.snap +12 -0
- package/test/concepts/data-source/constant.ts +5 -0
- package/test/concepts/data-source/fixtures/normal.json +289 -0
- package/test/concepts/data-source/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/data-source/toEmbeddedTSFile.spec.ts +16 -0
- package/test/concepts/entity/__snapshots__/toEmbeddedTS.spec.ts.snap +74 -0
- package/test/concepts/entity/__snapshots__/toEmbeddedTSFile.spec.ts.snap +3 -0
- package/test/concepts/entity/constant.ts +5 -0
- package/test/concepts/entity/fixtures/normal.json +469 -0
- package/test/concepts/entity/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/entity/toEmbeddedTSFile.spec.ts +14 -0
- package/test/concepts/identifier/toEmbeddedTS.spec.ts +4 -3
- package/test/concepts/identifier/toJS.spec.ts +2 -2
- package/test/concepts/identifier/toVue.spec.ts +2 -2
- package/test/concepts/match/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/member-expression/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/member-expression/toVue.spec.ts +2 -2
- package/test/concepts/null-literal/toEmbeddedTS.spec.ts +4 -3
- package/test/concepts/null-literal/toJS.spec.ts +2 -2
- package/test/concepts/null-literal/toVue.spec.ts +2 -2
- package/test/concepts/numeric-literal/toEmbeddedTS.spec.ts +4 -3
- package/test/concepts/numeric-literal/toJS.spec.ts +2 -2
- package/test/concepts/numeric-literal/toVue.spec.ts +2 -2
- package/test/concepts/string-literal/toEmbeddedTS.spec.ts +4 -3
- package/test/concepts/string-literal/toJS.spec.ts +2 -2
- package/test/concepts/string-literal/toVue.spec.ts +2 -2
- package/test/concepts/validation-rule/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/validation-rule/validation-rule.spec.ts +2 -1
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +0 -2
- package/test/concepts/view-element/toEmbeddedTS.spec.ts +2 -1
- package/test/time-slicing/runner.spec.ts +28 -0
- package/test/time-slicing/time-slicing-nodejs.spec.ts +27 -0
- package/test/time-slicing/utils.ts +7 -0
- package/test/time-slicing/wrapper.spec.ts +92 -0
- package/ts-worker/lib/tsserver.js +10 -1
- package/ts-worker/package.json +1 -0
- package/ts-worker/src/index.js +13 -12
- package/ts-worker/webpack.config.js +1 -1
- package/out/utils/time-slicing.d.ts +0 -41
- package/out/utils/time-slicing.js +0 -82
- package/out/utils/time-slicing.js.map +0 -1
- package/src/utils/time-slicing.ts +0 -111
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
import type { EmbeddedTSFileGenerator } from '../utils';
|
|
1
2
|
import { getNodeByNodeCallee } from '../automate/engine/utils';
|
|
2
3
|
import type { Connector } from './Connector__';
|
|
3
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
TranslatorState,
|
|
6
|
+
shiftState,
|
|
7
|
+
withSourceMap,
|
|
8
|
+
createCompilerState,
|
|
9
|
+
indent,
|
|
10
|
+
withSourceMapGenerator,
|
|
11
|
+
withGenerator,
|
|
12
|
+
TranslatorGenerator,
|
|
13
|
+
} from '../translator';
|
|
4
14
|
|
|
5
15
|
//================================================================================
|
|
6
16
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -346,9 +356,12 @@ export class Connection extends BaseNode {
|
|
|
346
356
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
347
357
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
348
358
|
params.index = index;
|
|
349
|
-
} else
|
|
350
|
-
|
|
351
|
-
(
|
|
359
|
+
} else {
|
|
360
|
+
const q = (t as any)[parentKey];
|
|
361
|
+
if ((q.__v_raw || q) === n) {
|
|
362
|
+
params.index = 0;
|
|
363
|
+
(this as any)[parentKey] = undefined;
|
|
364
|
+
}
|
|
352
365
|
}
|
|
353
366
|
}
|
|
354
367
|
return params;
|
|
@@ -385,12 +398,12 @@ export class Connection extends BaseNode {
|
|
|
385
398
|
return 'app.connections';
|
|
386
399
|
}
|
|
387
400
|
|
|
388
|
-
toEmbeddedTSFile() {
|
|
401
|
+
*toEmbeddedTSFile(): EmbeddedTSFileGenerator {
|
|
389
402
|
let code = `namespace ${this.getTsNamespace()} {\n`;
|
|
390
403
|
|
|
391
404
|
const state = createCompilerState(code, { tabSize: 1 });
|
|
392
405
|
try {
|
|
393
|
-
code += this.toEmbeddedTS(state);
|
|
406
|
+
code += yield* this.toEmbeddedTS(state);
|
|
394
407
|
} catch (err) {
|
|
395
408
|
console.log(err, '有问题翻译失败');
|
|
396
409
|
code += '';
|
|
@@ -404,10 +417,16 @@ export class Connection extends BaseNode {
|
|
|
404
417
|
};
|
|
405
418
|
}
|
|
406
419
|
|
|
407
|
-
@
|
|
408
|
-
toEmbeddedTS(
|
|
420
|
+
@withSourceMapGenerator
|
|
421
|
+
*toEmbeddedTS(
|
|
422
|
+
state = createCompilerState(),
|
|
423
|
+
prependCode?: string,
|
|
424
|
+
noName?: boolean,
|
|
425
|
+
prefix?: boolean,
|
|
426
|
+
): TranslatorGenerator {
|
|
427
|
+
const self = this;
|
|
409
428
|
let code = '';
|
|
410
|
-
code += `export function ${
|
|
429
|
+
code += `export function ${self.tsName}<T extends (...args: any[]) => any>(`;
|
|
411
430
|
code += 'cb: T';
|
|
412
431
|
code += `): ReturnType<T> {\n`;
|
|
413
432
|
code += '\n';
|
|
@@ -1104,9 +1104,12 @@ export class Connector extends Module {
|
|
|
1104
1104
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1105
1105
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1106
1106
|
params.index = index;
|
|
1107
|
-
} else
|
|
1108
|
-
|
|
1109
|
-
(
|
|
1107
|
+
} else {
|
|
1108
|
+
const q = (t as any)[parentKey];
|
|
1109
|
+
if ((q.__v_raw || q) === n) {
|
|
1110
|
+
params.index = 0;
|
|
1111
|
+
(this as any)[parentKey] = undefined;
|
|
1112
|
+
}
|
|
1110
1113
|
}
|
|
1111
1114
|
}
|
|
1112
1115
|
return params;
|
|
@@ -1207,9 +1210,12 @@ export class Connector extends Module {
|
|
|
1207
1210
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1208
1211
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1209
1212
|
params.index = index;
|
|
1210
|
-
} else
|
|
1211
|
-
|
|
1212
|
-
(
|
|
1213
|
+
} else {
|
|
1214
|
+
const q = (t as any)[parentKey];
|
|
1215
|
+
if ((q.__v_raw || q) === n) {
|
|
1216
|
+
params.index = 0;
|
|
1217
|
+
(this as any)[parentKey] = undefined;
|
|
1218
|
+
}
|
|
1213
1219
|
}
|
|
1214
1220
|
}
|
|
1215
1221
|
return params;
|
|
@@ -1260,9 +1266,12 @@ export class Connector extends Module {
|
|
|
1260
1266
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1261
1267
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1262
1268
|
params.index = index;
|
|
1263
|
-
} else
|
|
1264
|
-
|
|
1265
|
-
(
|
|
1269
|
+
} else {
|
|
1270
|
+
const q = (t as any)[parentKey];
|
|
1271
|
+
if ((q.__v_raw || q) === n) {
|
|
1272
|
+
params.index = 0;
|
|
1273
|
+
(this as any)[parentKey] = undefined;
|
|
1274
|
+
}
|
|
1266
1275
|
}
|
|
1267
1276
|
}
|
|
1268
1277
|
return params;
|
|
@@ -1313,9 +1322,12 @@ export class Connector extends Module {
|
|
|
1313
1322
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1314
1323
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1315
1324
|
params.index = index;
|
|
1316
|
-
} else
|
|
1317
|
-
|
|
1318
|
-
(
|
|
1325
|
+
} else {
|
|
1326
|
+
const q = (t as any)[parentKey];
|
|
1327
|
+
if ((q.__v_raw || q) === n) {
|
|
1328
|
+
params.index = 0;
|
|
1329
|
+
(this as any)[parentKey] = undefined;
|
|
1330
|
+
}
|
|
1319
1331
|
}
|
|
1320
1332
|
}
|
|
1321
1333
|
return params;
|
|
@@ -1366,9 +1378,12 @@ export class Connector extends Module {
|
|
|
1366
1378
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1367
1379
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1368
1380
|
params.index = index;
|
|
1369
|
-
} else
|
|
1370
|
-
|
|
1371
|
-
(
|
|
1381
|
+
} else {
|
|
1382
|
+
const q = (t as any)[parentKey];
|
|
1383
|
+
if ((q.__v_raw || q) === n) {
|
|
1384
|
+
params.index = 0;
|
|
1385
|
+
(this as any)[parentKey] = undefined;
|
|
1386
|
+
}
|
|
1372
1387
|
}
|
|
1373
1388
|
}
|
|
1374
1389
|
return params;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
2
|
+
import {
|
|
3
|
+
TranslatorState,
|
|
4
|
+
shiftState,
|
|
5
|
+
withSourceMap,
|
|
6
|
+
createCompilerState,
|
|
7
|
+
withSourceMapGenerator,
|
|
8
|
+
withGenerator,
|
|
9
|
+
TranslatorGenerator,
|
|
10
|
+
} from '../translator';
|
|
2
11
|
import { ElementToVueOptions } from './ViewElement__';
|
|
3
12
|
//================================================================================
|
|
4
13
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -220,9 +229,12 @@ export class Constant extends BaseNode {
|
|
|
220
229
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
221
230
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
222
231
|
params.index = index;
|
|
223
|
-
} else
|
|
224
|
-
|
|
225
|
-
(
|
|
232
|
+
} else {
|
|
233
|
+
const q = (t as any)[parentKey];
|
|
234
|
+
if ((q.__v_raw || q) === n) {
|
|
235
|
+
params.index = 0;
|
|
236
|
+
(this as any)[parentKey] = undefined;
|
|
237
|
+
}
|
|
226
238
|
}
|
|
227
239
|
}
|
|
228
240
|
return params;
|
|
@@ -244,12 +256,13 @@ export class Constant extends BaseNode {
|
|
|
244
256
|
return this.name;
|
|
245
257
|
}
|
|
246
258
|
|
|
247
|
-
@
|
|
248
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
249
|
-
|
|
250
|
-
|
|
259
|
+
@withSourceMapGenerator
|
|
260
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
261
|
+
const self = this;
|
|
262
|
+
let code = self.name;
|
|
263
|
+
if (self.typeAnnotation) {
|
|
251
264
|
code += ': ';
|
|
252
|
-
code +=
|
|
265
|
+
code += yield* self.typeAnnotation.toEmbeddedTS(shiftState(state, code));
|
|
253
266
|
}
|
|
254
267
|
// if (this.defaultValue) {
|
|
255
268
|
// code += ` = ${this.defaultValue}`;
|
|
@@ -257,12 +270,13 @@ export class Constant extends BaseNode {
|
|
|
257
270
|
return code;
|
|
258
271
|
}
|
|
259
272
|
|
|
260
|
-
@
|
|
261
|
-
toEmbeddedTSInProcess(state
|
|
262
|
-
|
|
263
|
-
|
|
273
|
+
@withSourceMapGenerator
|
|
274
|
+
*toEmbeddedTSInProcess(state = createCompilerState()): TranslatorGenerator {
|
|
275
|
+
const self = this;
|
|
276
|
+
let code = self.name;
|
|
277
|
+
if (self.typeAnnotation) {
|
|
264
278
|
code += ': undefined as ';
|
|
265
|
-
code +=
|
|
279
|
+
code += yield* self.typeAnnotation.toEmbeddedTS(shiftState(state, code));
|
|
266
280
|
}
|
|
267
281
|
// if (this.defaultValue) {
|
|
268
282
|
// code += ` : ${this.defaultValue}`;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { EmbeddedTSFileGenerator } from '../utils';
|
|
2
|
+
import {
|
|
3
|
+
TranslatorState,
|
|
4
|
+
withSourceMap,
|
|
5
|
+
createCompilerState,
|
|
6
|
+
withSourceMapGenerator,
|
|
7
|
+
withGenerator,
|
|
8
|
+
TranslatorGenerator,
|
|
9
|
+
} from '../translator';
|
|
2
10
|
import datasourceService from '../service/datasource';
|
|
3
11
|
|
|
4
12
|
//================================================================================
|
|
@@ -306,9 +314,12 @@ export class DataSource extends BaseNode {
|
|
|
306
314
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
307
315
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
308
316
|
params.index = index;
|
|
309
|
-
} else
|
|
310
|
-
|
|
311
|
-
(
|
|
317
|
+
} else {
|
|
318
|
+
const q = (t as any)[parentKey];
|
|
319
|
+
if ((q.__v_raw || q) === n) {
|
|
320
|
+
params.index = 0;
|
|
321
|
+
(this as any)[parentKey] = undefined;
|
|
322
|
+
}
|
|
312
323
|
}
|
|
313
324
|
}
|
|
314
325
|
return params;
|
|
@@ -428,21 +439,22 @@ export class DataSource extends BaseNode {
|
|
|
428
439
|
return `/embedded/${this.rootNode?.name || this.parentNode.name}/datasources/${name}.ts`;
|
|
429
440
|
}
|
|
430
441
|
|
|
431
|
-
@
|
|
432
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
433
|
-
|
|
442
|
+
@withSourceMapGenerator
|
|
443
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
444
|
+
const self = this;
|
|
445
|
+
let code = `export namespace ${self.name} {\n`;
|
|
434
446
|
code += 'const name = ';
|
|
435
|
-
code += `"${
|
|
447
|
+
code += `"${self.name}";\n`;
|
|
436
448
|
code += '}\n';
|
|
437
449
|
return code;
|
|
438
450
|
}
|
|
439
451
|
|
|
440
|
-
toEmbeddedTSFile() {
|
|
452
|
+
*toEmbeddedTSFile(): EmbeddedTSFileGenerator {
|
|
441
453
|
let code = `namespace ${this.getNamespace()} {\n`;
|
|
442
454
|
|
|
443
455
|
const state = createCompilerState(code, { tabSize: 1 });
|
|
444
456
|
try {
|
|
445
|
-
code += this.toEmbeddedTS(state);
|
|
457
|
+
code += yield* this.toEmbeddedTS(state);
|
|
446
458
|
} catch (err) {
|
|
447
459
|
code += '';
|
|
448
460
|
console.error(err);
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach, returnOrigin } from '../utils/time-slicing';
|
|
1
2
|
import View from './View__';
|
|
2
3
|
import { getNodeByNodeCallee } from '../automate/engine/utils';
|
|
3
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
TranslatorState,
|
|
6
|
+
shiftState,
|
|
7
|
+
withSourceMap,
|
|
8
|
+
indent,
|
|
9
|
+
createCompilerState,
|
|
10
|
+
withSourceMapGenerator,
|
|
11
|
+
withGenerator,
|
|
12
|
+
TranslatorGenerator,
|
|
13
|
+
} from '../translator';
|
|
4
14
|
import { ElementToVueOptions } from './ViewElement__';
|
|
5
15
|
import { BindAttribute, Param } from '..';
|
|
6
16
|
|
|
@@ -294,9 +304,12 @@ export class Destination extends LogicItem {
|
|
|
294
304
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
295
305
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
296
306
|
params.index = index;
|
|
297
|
-
} else
|
|
298
|
-
|
|
299
|
-
(
|
|
307
|
+
} else {
|
|
308
|
+
const q = (t as any)[parentKey];
|
|
309
|
+
if ((q.__v_raw || q) === n) {
|
|
310
|
+
params.index = 0;
|
|
311
|
+
(this as any)[parentKey] = undefined;
|
|
312
|
+
}
|
|
300
313
|
}
|
|
301
314
|
}
|
|
302
315
|
return params;
|
|
@@ -675,22 +688,23 @@ export class Destination extends LogicItem {
|
|
|
675
688
|
return `/${viewNameAttr.join('/')}`;
|
|
676
689
|
}
|
|
677
690
|
|
|
678
|
-
@
|
|
679
|
-
toEmbeddedTSInProcess(state
|
|
691
|
+
@withSourceMapGenerator
|
|
692
|
+
*toEmbeddedTSInProcess(state = createCompilerState(), prependCode: string): TranslatorGenerator {
|
|
693
|
+
const self = this;
|
|
680
694
|
// const tab = indent((state?.tabSize || 0));
|
|
681
|
-
if (
|
|
682
|
-
const destinationName =
|
|
695
|
+
if (self.tsCalleeNamespace && self.tsName) {
|
|
696
|
+
const destinationName = self.parentNode.name.replace('-', '_');
|
|
683
697
|
let code = `${destinationName}: function() {\n`;
|
|
684
698
|
code += prependCode;
|
|
685
699
|
code += '\n';
|
|
686
|
-
if (
|
|
687
|
-
code += `${
|
|
688
|
-
if (Array.isArray(
|
|
689
|
-
|
|
690
|
-
code += `${argument.toEmbeddedTS(shiftState(state, code), false, true)}, `;
|
|
700
|
+
if (self.tsCalleeNamespace && self.viewName) {
|
|
701
|
+
code += `${self.tsCalleeNamespace}.${self.viewName}.$destination({`;
|
|
702
|
+
if (Array.isArray(self.arguments)) {
|
|
703
|
+
yield* wrapForEach(self.arguments, function* warpForEachGenerator(argument: Argument) {
|
|
704
|
+
code += `${yield* argument.toEmbeddedTS(shiftState(state, code), false, true)}, `;
|
|
691
705
|
});
|
|
692
706
|
}
|
|
693
|
-
code +=
|
|
707
|
+
code += yield* self.anchor?.toEmbeddedTS?.(shiftState(state, code), true) ?? returnOrigin('');
|
|
694
708
|
code += `});\n`;
|
|
695
709
|
}
|
|
696
710
|
code += `${indent((state?.tabSize || 0) + 1)}}\n`;
|
|
@@ -699,53 +713,48 @@ export class Destination extends LogicItem {
|
|
|
699
713
|
return 'destinationEmpty(){ const __destinationEmpty__: any = null}';
|
|
700
714
|
}
|
|
701
715
|
|
|
702
|
-
@
|
|
703
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
716
|
+
@withSourceMapGenerator
|
|
717
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
718
|
+
const self = this;
|
|
704
719
|
let code = '';
|
|
705
|
-
|
|
706
|
-
const node = this.viewNode;
|
|
720
|
+
const node = self.viewNode;
|
|
707
721
|
let logicParam: Param[] = [];
|
|
708
722
|
if (node?.params) {
|
|
709
723
|
logicParam = node.params;
|
|
710
724
|
}
|
|
711
725
|
const logicParamLength = logicParam.length;
|
|
712
|
-
|
|
713
|
-
if (this.parentNode instanceof BindAttribute) {
|
|
726
|
+
if (self.parentNode instanceof BindAttribute) {
|
|
714
727
|
code += indent((state?.tabSize || 0) + 2);
|
|
715
|
-
if (
|
|
716
|
-
code += `${
|
|
717
|
-
if (Array.isArray(
|
|
718
|
-
|
|
728
|
+
if (self.tsCalleeNamespace && self.tsName) {
|
|
729
|
+
code += `${self.tsCalleeNamespace}.${self.tsName}.$destination({`;
|
|
730
|
+
if (Array.isArray(self.arguments)) {
|
|
731
|
+
yield* wrapForEach(self.arguments, function* warpForEachGenerator(argument: Argument, index) {
|
|
719
732
|
const oldName = argument.keyword;
|
|
720
733
|
if (index >= logicParamLength) {
|
|
721
734
|
argument.keyword = '__unknown__';
|
|
722
735
|
}
|
|
723
|
-
code += `${argument.toEmbeddedTS(shiftState(state, code), false, true)}, `;
|
|
736
|
+
code += `${yield* argument.toEmbeddedTS(shiftState(state, code), false, true)}, `;
|
|
724
737
|
argument.keyword = oldName;
|
|
725
738
|
});
|
|
726
739
|
}
|
|
727
|
-
|
|
728
|
-
code += this.anchor?.toEmbeddedTS(shiftState(state, code), true) || '';
|
|
729
|
-
|
|
740
|
+
code += yield* self.anchor?.toEmbeddedTS?.(shiftState(state, code), true) ?? returnOrigin('');
|
|
730
741
|
code += `});\n`;
|
|
731
742
|
}
|
|
732
743
|
return code;
|
|
733
744
|
}
|
|
734
|
-
if (
|
|
735
|
-
code += `${
|
|
736
|
-
if (Array.isArray(
|
|
737
|
-
|
|
745
|
+
if (self.tsCalleeNamespace && self.tsName) {
|
|
746
|
+
code += `${self.tsCalleeNamespace}.${self.tsName}.$destination({`;
|
|
747
|
+
if (Array.isArray(self.arguments)) {
|
|
748
|
+
yield* wrapForEach(self.arguments, function* warpForEachGenerator(argument: Argument, index) {
|
|
738
749
|
const oldName = argument.keyword;
|
|
739
750
|
if (index >= logicParamLength) {
|
|
740
751
|
argument.keyword = '__unknown__';
|
|
741
752
|
}
|
|
742
|
-
code += `${argument.toEmbeddedTS(shiftState(state, code), false, true)}, `;
|
|
753
|
+
code += `${yield* argument.toEmbeddedTS(shiftState(state, code), false, true)}, `;
|
|
743
754
|
argument.keyword = oldName;
|
|
744
755
|
});
|
|
745
756
|
}
|
|
746
|
-
|
|
747
|
-
code += this.anchor?.toEmbeddedTS(shiftState(state, code), true) || '';
|
|
748
|
-
|
|
757
|
+
code += yield* self.anchor?.toEmbeddedTS?.(shiftState(state, code), true) ?? returnOrigin('');
|
|
749
758
|
code += `});\n`;
|
|
750
759
|
} else {
|
|
751
760
|
code += '__IDENTIFIER__';
|
package/src/concepts/End__.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
TranslatorState,
|
|
3
|
+
indent,
|
|
4
|
+
createCompilerState,
|
|
5
|
+
withSourceMapGenerator,
|
|
6
|
+
withGenerator,
|
|
7
|
+
TranslatorGenerator,
|
|
8
|
+
} from '../translator';
|
|
2
9
|
import Return from './Return__';
|
|
3
10
|
import Logic from './Logic__';
|
|
4
11
|
//================================================================================
|
|
@@ -64,39 +71,41 @@ export class End extends LogicItem {
|
|
|
64
71
|
return code;
|
|
65
72
|
}
|
|
66
73
|
|
|
67
|
-
|
|
74
|
+
@withGenerator
|
|
75
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
76
|
+
const self = this;
|
|
68
77
|
let code = '';
|
|
69
78
|
let ret;
|
|
70
79
|
let logic;
|
|
71
|
-
switch (
|
|
80
|
+
switch (self.parentNode.concept) {
|
|
72
81
|
case 'Logic':
|
|
73
|
-
ret =
|
|
82
|
+
ret = self.logic.returns[0];
|
|
74
83
|
break;
|
|
75
84
|
case 'AuthLogic':
|
|
76
|
-
ret =
|
|
85
|
+
ret = self.AuthLogic.returns[0];
|
|
77
86
|
break;
|
|
78
87
|
case 'AuthLogicForCallInterface':
|
|
79
88
|
// 导出接口鉴权参数返回值固定为下面逻辑;
|
|
80
|
-
ret = `${indent(state?.tabSize || 0)}let ${
|
|
89
|
+
ret = `${indent(state?.tabSize || 0)}let ${self.parentNode.name}Result: ApiReturn; \n ${indent(
|
|
81
90
|
state?.tabSize || 0,
|
|
82
|
-
)}return ${
|
|
91
|
+
)}return ${self.parentNode.name}Result;\n`;
|
|
83
92
|
break;
|
|
84
93
|
case 'OverriddenLogic':
|
|
85
|
-
ret =
|
|
94
|
+
ret = self.OverriddenLogic.returns[0];
|
|
86
95
|
break;
|
|
87
96
|
default:
|
|
88
97
|
// 旧逻辑默认走这里,
|
|
89
98
|
// 期望后期可以直接走完整的case, default 直接抛出异常好更明确定位错误
|
|
90
|
-
logic =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
logic =
|
|
100
|
+
self.parentNode.getAncestor('Logic') ||
|
|
101
|
+
self.parentNode.getAncestor('AuthLogic') ||
|
|
102
|
+
self.parentNode.getAncestor('AuthLogicForCallInterface') ||
|
|
103
|
+
self.parentNode.getAncestor('OverriddenLogic');
|
|
95
104
|
ret = (logic as Logic).returns[0];
|
|
96
105
|
}
|
|
97
|
-
if (ret &&
|
|
106
|
+
if (ret && self.parentNode.concept === 'AuthLogicForCallInterface') {
|
|
98
107
|
code += ret;
|
|
99
|
-
} else if (ret &&
|
|
108
|
+
} else if (ret && self.parentNode.concept !== 'AuthLogicForCallInterface') {
|
|
100
109
|
code += `${indent(state?.tabSize || 0)}return ${(ret as Return).name};`;
|
|
101
110
|
} else {
|
|
102
111
|
code += `${indent(state?.tabSize || 0)}return;`;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
2
|
+
import {
|
|
3
|
+
TranslatorState,
|
|
4
|
+
withSourceMap,
|
|
5
|
+
createCompilerState,
|
|
6
|
+
withSourceMapGenerator,
|
|
7
|
+
withGenerator,
|
|
8
|
+
TranslatorGenerator,
|
|
9
|
+
} from '../translator';
|
|
2
10
|
|
|
3
11
|
type changeType = 'up' | 'down';
|
|
4
12
|
|
|
@@ -180,9 +188,10 @@ export class EntityIndex extends BaseNode {
|
|
|
180
188
|
});
|
|
181
189
|
}
|
|
182
190
|
|
|
183
|
-
@
|
|
184
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
185
|
-
|
|
191
|
+
@withSourceMapGenerator
|
|
192
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
193
|
+
const self = this;
|
|
194
|
+
return `{ ${self.name}: [${self.propertyNames.map((item) => `this.${item}`).join(', ')}] },`;
|
|
186
195
|
}
|
|
187
196
|
|
|
188
197
|
/**
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
1
2
|
import { dataTypesMap } from './basics/types';
|
|
2
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
TranslatorState,
|
|
5
|
+
shiftState,
|
|
6
|
+
withSourceMap,
|
|
7
|
+
indent,
|
|
8
|
+
createCompilerState,
|
|
9
|
+
withSourceMapGenerator,
|
|
10
|
+
withGenerator,
|
|
11
|
+
TranslatorGenerator,
|
|
12
|
+
} from '../translator';
|
|
3
13
|
import CallQueryComponent from './CallQueryComponent__';
|
|
4
14
|
|
|
5
15
|
type changeType = 'up' | 'down';
|
|
@@ -346,9 +356,12 @@ export class EntityProperty extends BaseNode {
|
|
|
346
356
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
347
357
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
348
358
|
params.index = index;
|
|
349
|
-
} else
|
|
350
|
-
|
|
351
|
-
(
|
|
359
|
+
} else {
|
|
360
|
+
const q = (t as any)[parentKey];
|
|
361
|
+
if ((q.__v_raw || q) === n) {
|
|
362
|
+
params.index = 0;
|
|
363
|
+
(this as any)[parentKey] = undefined;
|
|
364
|
+
}
|
|
352
365
|
}
|
|
353
366
|
}
|
|
354
367
|
return params;
|
|
@@ -399,9 +412,12 @@ export class EntityProperty extends BaseNode {
|
|
|
399
412
|
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
400
413
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
401
414
|
params.index = index;
|
|
402
|
-
} else
|
|
403
|
-
|
|
404
|
-
(
|
|
415
|
+
} else {
|
|
416
|
+
const q = (t as any)[parentKey];
|
|
417
|
+
if ((q.__v_raw || q) === n) {
|
|
418
|
+
params.index = 0;
|
|
419
|
+
(this as any)[parentKey] = undefined;
|
|
420
|
+
}
|
|
405
421
|
}
|
|
406
422
|
}
|
|
407
423
|
return params;
|
|
@@ -578,22 +594,22 @@ export class EntityProperty extends BaseNode {
|
|
|
578
594
|
}
|
|
579
595
|
}
|
|
580
596
|
|
|
581
|
-
@
|
|
582
|
-
toEmbeddedTS(state = createCompilerState()):
|
|
597
|
+
@withSourceMapGenerator
|
|
598
|
+
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
599
|
+
const self = this;
|
|
583
600
|
let code = '';
|
|
584
|
-
if (
|
|
585
|
-
code += `@nasl.annotation.EntityRelation(new ${
|
|
601
|
+
if (self.relationNamespace && self.relationEntity && self.relationProperty) {
|
|
602
|
+
code += `@nasl.annotation.EntityRelation(new ${self.relationNamespace}.${self.relationEntity}().${self.relationProperty})\n`;
|
|
586
603
|
code += indent((state?.tabSize || 0) + 2);
|
|
587
604
|
// code += indent((state?.tabSize || 0) + 1);
|
|
588
605
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
if (this.typeAnnotation) {
|
|
606
|
+
code += self.name;
|
|
607
|
+
if (self.typeAnnotation) {
|
|
592
608
|
code += ': ';
|
|
593
|
-
code +=
|
|
609
|
+
code += yield* self.typeAnnotation.toEmbeddedTS(shiftState(state, code));
|
|
594
610
|
}
|
|
595
|
-
if (
|
|
596
|
-
code += `= ${
|
|
611
|
+
if (self.defaultValue) {
|
|
612
|
+
code += `= ${self.typeAnnotation.getDefaultValue(self.defaultValue)}`;
|
|
597
613
|
}
|
|
598
614
|
return code;
|
|
599
615
|
}
|