@lcap/nasl 3.2.0-beta.3 → 3.3.0-alpha
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/automate/engine/utils.js +4 -0
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/upgrader/2.20.js +1 -1
- package/out/automate/upgrader/2.20.js.map +1 -1
- package/out/bak/translator.js +11 -15
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/generator/AfterStartNode.js +3 -1
- package/out/breakpoint/generator/AfterStartNode.js.map +1 -1
- package/out/breakpoint/generator/BeforeEndNode.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.d.ts +1 -0
- package/out/breakpoint/generator/BreakpointNode.js +48 -15
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/generator/CallbackNode.d.ts +4 -0
- package/out/breakpoint/generator/CallbackNode.js +22 -0
- package/out/breakpoint/generator/CallbackNode.js.map +1 -0
- package/out/breakpoint/generator/FragmentNode.d.ts +4 -0
- package/out/breakpoint/generator/FragmentNode.js +18 -0
- package/out/breakpoint/generator/FragmentNode.js.map +1 -0
- package/out/breakpoint/generator/index.js +25 -4
- package/out/breakpoint/generator/index.js.map +1 -1
- package/out/breakpoint/shared/constants.d.ts +3 -0
- package/out/breakpoint/shared/constants.js +6 -1
- package/out/breakpoint/shared/constants.js.map +1 -1
- package/out/breakpoint/shared/operations.js.map +1 -1
- package/out/breakpoint/shared/socket.d.ts +1 -1
- package/out/breakpoint/shared/socket.js +36 -7
- package/out/breakpoint/shared/socket.js.map +1 -1
- package/out/breakpoint/shared/utils.d.ts +2 -0
- package/out/breakpoint/shared/utils.js +15 -2
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/breakpoint/store/core.d.ts +48 -2
- package/out/breakpoint/store/core.js +58 -32
- package/out/breakpoint/store/core.js.map +1 -1
- package/out/breakpoint/store/dock.js +1 -1
- package/out/breakpoint/store/dock.js.map +1 -1
- package/out/common/BaseNode.d.ts +2 -2
- package/out/common/BaseNode.js +110 -53
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.d.ts +13 -2
- package/out/common/Command.js +37 -9
- package/out/common/Command.js.map +1 -1
- package/out/common/EventEmitter.js.map +1 -1
- package/out/common/Messager.d.ts +3 -3
- package/out/common/Messager.js +6 -7
- package/out/common/Messager.js.map +1 -1
- package/out/common/asyncFuncMap.js.map +1 -1
- package/out/concepts/Abort__.js +6 -5
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.d.ts +4 -3
- package/out/concepts/Anchor__.js +24 -7
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +22 -21
- package/out/concepts/AnonymousFunction__.js +48 -22
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +421 -247
- package/out/concepts/App__.js +288 -54
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +4 -3
- package/out/concepts/Argument__.js +42 -11
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +45 -45
- package/out/concepts/Assignee__.js +15 -15
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js +6 -5
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +7 -6
- package/out/concepts/Assignment__.js +41 -23
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.d.ts +3 -3
- package/out/concepts/Attribute__.js +8 -7
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthInterface__.js +4 -3
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.d.ts +15 -15
- package/out/concepts/AuthLogicForCallInterface__.js +46 -27
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.js +27 -13
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BackendVariable__.d.ts +5 -5
- package/out/concepts/BackendVariable__.js +23 -26
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.d.ts +18 -18
- package/out/concepts/Backend__.js +13 -13
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.d.ts +34 -33
- package/out/concepts/BatchAssignment__.js +83 -43
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +7 -6
- package/out/concepts/BinaryExpression__.js +60 -24
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +37 -37
- package/out/concepts/BindAttribute__.js +102 -58
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +13 -13
- package/out/concepts/BindDirective__.js +23 -21
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +28 -28
- package/out/concepts/BindEvent__.js +150 -57
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +14 -15
- package/out/concepts/BindStyle__.js +16 -16
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +1 -0
- package/out/concepts/BooleanLiteral__.js +12 -5
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +15 -15
- package/out/concepts/CallAuthInterface__.js +23 -22
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +11 -9
- package/out/concepts/CallConnector__.js +79 -36
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +17 -16
- package/out/concepts/CallFunction__.js +95 -63
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +9 -8
- package/out/concepts/CallInterface__.js +109 -80
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +24 -20
- package/out/concepts/CallLogic__.js +209 -162
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +51 -51
- package/out/concepts/CallQueryComponent__.js +66 -63
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.d.ts +1 -0
- package/out/concepts/Comment__.js +13 -6
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.d.ts +3 -3
- package/out/concepts/CompletionProperty__.js +16 -8
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +15 -15
- package/out/concepts/ConfigGroup__.js +9 -9
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js +4 -3
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +15 -15
- package/out/concepts/ConfigProperty__.js +10 -10
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +15 -15
- package/out/concepts/Configuration__.js +9 -9
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.d.ts +166 -0
- package/out/concepts/Connection__.js +332 -0
- package/out/concepts/Connection__.js.map +1 -0
- package/out/concepts/ConnectorTrigger__.js +4 -3
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Connector__.d.ts +66 -66
- package/out/concepts/Connector__.js +16 -15
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.d.ts +3 -3
- package/out/concepts/Constant__.js +8 -7
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.d.ts +3 -3
- package/out/concepts/DataElement__.js +6 -5
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +15 -15
- package/out/concepts/DataSource__.js +55 -39
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.js +4 -3
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +12 -11
- package/out/concepts/Destination__.js +93 -36
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +15 -13
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +1 -1
- package/out/concepts/EntityIndex__.js +6 -5
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +8 -7
- package/out/concepts/EntityProperty__.js +39 -24
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +31 -30
- package/out/concepts/Entity__.js +40 -16
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +1 -0
- package/out/concepts/EnumItem__.js +12 -5
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +9 -8
- package/out/concepts/Enum__.js +24 -11
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.d.ts +15 -15
- package/out/concepts/Event__.js +6 -5
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +6 -6
- package/out/concepts/ExternalDestination__.js +12 -11
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +25 -24
- package/out/concepts/ForEachStatement__.js +101 -36
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +30 -30
- package/out/concepts/FrontendLibrary__.js +12 -13
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/FrontendVariable__.js +4 -3
- package/out/concepts/FrontendVariable__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +64 -65
- package/out/concepts/Frontend__.js +23 -27
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.d.ts +64 -63
- package/out/concepts/Function__.js +49 -21
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +37 -31
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.d.ts +20 -19
- package/out/concepts/IfStatement__.js +64 -34
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.d.ts +3 -3
- package/out/concepts/Integration__.js +8 -7
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +3 -3
- package/out/concepts/InterfaceParam__.js +7 -6
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +33 -33
- package/out/concepts/Interface__.js +19 -20
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts +1 -0
- package/out/concepts/JSBlock__.js +12 -5
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.js +10 -9
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +6 -0
- package/out/concepts/LogicItem__.js +14 -5
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +80 -79
- package/out/concepts/Logic__.js +204 -58
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +39 -38
- package/out/concepts/MatchCase__.js +122 -37
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.d.ts +13 -11
- package/out/concepts/Match__.js +128 -60
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +7 -6
- package/out/concepts/MemberExpression__.js +52 -22
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MicroApp__.js +4 -3
- package/out/concepts/MicroApp__.js.map +1 -1
- package/out/concepts/Module__.d.ts +242 -154
- package/out/concepts/Module__.js +139 -33
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.d.ts +15 -15
- package/out/concepts/MsgTriggerEvent__.js +6 -5
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.d.ts +23 -15
- package/out/concepts/MsgTriggerLauncher__.js +24 -5
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +180 -180
- package/out/concepts/Namespace__.js +33 -34
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +49 -48
- package/out/concepts/NewComposite__.js +164 -49
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +19 -18
- package/out/concepts/NewList__.js +29 -12
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +34 -33
- package/out/concepts/NewMap__.js +81 -72
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.js +6 -5
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.js +6 -5
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +4 -3
- package/out/concepts/NumericLiteral__.js +15 -8
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +4 -3
- package/out/concepts/OqlQueryComponent__.js +25 -16
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +79 -79
- package/out/concepts/OverriddenLogic__.js +79 -58
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.d.ts +6 -5
- package/out/concepts/Param__.js +66 -29
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js +4 -3
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.d.ts +30 -30
- package/out/concepts/ProcessComponent__.js +8 -7
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +96 -96
- package/out/concepts/ProcessElement__.js +34 -34
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +6 -5
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js +6 -5
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.d.ts +75 -75
- package/out/concepts/Process__.js +33 -30
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.d.ts +3 -3
- package/out/concepts/QueryAggregateExpression__.js +8 -7
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +7 -6
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +8 -8
- package/out/concepts/QueryFromExpression__.js +8 -7
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +3 -3
- package/out/concepts/QueryGroupByExpression__.js +9 -10
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +23 -23
- package/out/concepts/QueryJoinExpression__.js +11 -10
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +6 -6
- package/out/concepts/QueryLimitExpression__.js +9 -8
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +6 -6
- package/out/concepts/QueryOrderByExpression__.js +9 -8
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +30 -30
- package/out/concepts/QuerySelectExpression__.js +9 -8
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js +4 -3
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +4 -3
- package/out/concepts/Return__.js +37 -18
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +9 -9
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +18 -18
- package/out/concepts/SelectMembers__.js +10 -9
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.d.ts +3 -3
- package/out/concepts/Slot__.js +6 -5
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +4 -3
- package/out/concepts/SqlQueryComponent__.js +21 -12
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js +6 -5
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +16 -15
- package/out/concepts/StringInterpolation__.js +37 -14
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -0
- package/out/concepts/StringLiteral__.js +13 -8
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +4 -3
- package/out/concepts/StructureProperty__.js +22 -9
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +31 -30
- package/out/concepts/Structure__.js +27 -15
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +12 -11
- package/out/concepts/SwitchCase__.js +69 -31
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.d.ts +9 -8
- package/out/concepts/SwitchStatement__.js +27 -7
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js +4 -3
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js +4 -3
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TriggerEvent__.d.ts +15 -15
- package/out/concepts/TriggerEvent__.js +6 -5
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.d.ts +15 -10
- package/out/concepts/TriggerLauncher__.js +54 -32
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +28 -27
- package/out/concepts/TypeAnnotation__.js +144 -124
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +1 -0
- package/out/concepts/TypeParam__.js +12 -5
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +4 -3
- package/out/concepts/UnaryExpression__.js +31 -20
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +1 -0
- package/out/concepts/Unparsed__.js +12 -5
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js +4 -3
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +14 -14
- package/out/concepts/ValidationRule__.js +19 -17
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +4 -3
- package/out/concepts/Variable__.js +39 -23
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.js +4 -3
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponent__.d.ts +90 -90
- package/out/concepts/ViewComponent__.js +16 -15
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +92 -86
- package/out/concepts/ViewElement__.js +258 -200
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +92 -92
- package/out/concepts/View__.js +173 -63
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.d.ts +12 -11
- package/out/concepts/WhileStatement__.js +46 -23
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/index.js +17 -1
- package/out/concepts/basics/stdlib/index.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.browser.js +36 -0
- package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.event.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.event.js +23 -0
- package/out/concepts/basics/stdlib/nasl.event.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.ui.js +45 -0
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +6 -22
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +2 -1
- package/out/concepts/index__.js +2 -1
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/types__.d.ts +2 -1
- package/out/decorators/index.d.ts +1 -1
- package/out/decorators/index.js +20 -7
- package/out/decorators/index.js.map +1 -1
- package/out/decorators/promise.d.ts +7 -0
- package/out/decorators/promise.js +28 -0
- package/out/decorators/promise.js.map +1 -0
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/enums/LEVEL_NAME_MAP.js.map +1 -1
- package/out/generator/compileComponent.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +4 -1
- package/out/generator/genBundleFiles.js +15 -11
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genHash.js.map +1 -1
- package/out/generator/genMetaData.js +12 -8
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/genReleaseBody.js +33 -35
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/microApp.js +2 -1
- package/out/generator/microApp.js.map +1 -1
- package/out/generator/permission.js +31 -30
- package/out/generator/permission.js.map +1 -1
- package/out/generator/styleReplacer.js +4 -7
- package/out/generator/styleReplacer.js.map +1 -1
- package/out/index.d.ts +0 -2
- package/out/index.js +0 -3
- package/out/index.js.map +1 -1
- package/out/manager/diagnostic.d.ts +1 -1
- package/out/manager/diagnostic.js.map +1 -1
- package/out/manager/stepRecorder.js +13 -9
- package/out/manager/stepRecorder.js.map +1 -1
- package/out/natural/RequirementAnalyzer.d.ts +22 -0
- package/out/natural/RequirementAnalyzer.js +196 -0
- package/out/natural/RequirementAnalyzer.js.map +1 -0
- package/out/natural/RequirementExecutor.d.ts +51 -0
- package/out/natural/RequirementExecutor.js +692 -0
- package/out/natural/RequirementExecutor.js.map +1 -0
- package/out/natural/componentData.d.ts +31 -0
- package/out/natural/componentData.js +85 -0
- package/out/natural/componentData.js.map +1 -0
- package/out/natural/genNaturalTS.d.ts +3 -0
- package/out/natural/genNaturalTS.js +76 -0
- package/out/natural/genNaturalTS.js.map +1 -0
- package/out/natural/index.d.ts +4 -0
- package/out/natural/index.js +21 -0
- package/out/natural/index.js.map +1 -0
- package/out/natural/knowledgeMap.d.ts +4 -0
- package/out/natural/knowledgeMap.js +40 -0
- package/out/natural/knowledgeMap.js.map +1 -0
- package/out/natural/naslStdlibMap.d.ts +2 -0
- package/out/natural/naslStdlibMap.js +26 -0
- package/out/natural/naslStdlibMap.js.map +1 -0
- package/out/natural/transformTSCode.d.ts +7 -0
- package/out/natural/transformTSCode.js +760 -0
- package/out/natural/transformTSCode.js.map +1 -0
- package/out/sentry/index.d.ts +2 -1
- package/out/sentry/index.js.map +1 -1
- package/out/server/createUiTs.js +28 -16
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/entity2LogicNamespace.js +24 -22
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/event.d.ts +12 -0
- package/out/server/event.js +52 -28
- package/out/server/event.js.map +1 -1
- package/out/server/extendBaseNode.js +55 -70
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.js +46 -50
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getConnector.d.ts +3 -3
- package/out/server/getConnector.js +7 -8
- package/out/server/getConnector.js.map +1 -1
- package/out/server/getExtensionModules.js +2 -2
- package/out/server/getExtensionModules.js.map +1 -1
- package/out/server/getFunctions.js.map +1 -1
- package/out/server/getInterfaces.js.map +1 -1
- package/out/server/getLogging.js.map +1 -1
- package/out/server/getLogics.d.ts +1 -1
- package/out/server/getLogics.js +55 -8
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +13 -10
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcessComponents.js.map +1 -1
- package/out/server/getProcesses.js +21 -29
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/getScope.js.map +1 -1
- package/out/server/getValidates.js.map +1 -1
- package/out/server/index.js +0 -1
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +99 -94
- package/out/server/naslServer.js +490 -469
- package/out/server/naslServer.js.map +1 -1
- package/out/server/naslStdlibMap.js +6 -2
- package/out/server/naslStdlibMap.js.map +1 -1
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.d.ts +1 -1
- package/out/server/translator.js +52 -47
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +15 -1
- package/out/service/storage/init.js +65 -56
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCallComponentLogic.js +1 -2
- package/out/templator/genCallComponentLogic.js.map +1 -1
- package/out/templator/genCreateBlock.js +14 -9
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +23 -14
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +26 -30
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.d.ts +1 -1
- package/out/templator/genEditTableBlock.js +14 -19
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genEnumSelectBlock.js +1 -1
- package/out/templator/genEnumSelectBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +2 -2
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.d.ts +2 -2
- package/out/templator/genGridViewBlock.js +18 -28
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.d.ts +2 -2
- package/out/templator/genListViewBlock.js +9 -16
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +22 -15
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.d.ts +2 -2
- package/out/templator/genSelectBlock.js +21 -48
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.d.ts +1 -1
- package/out/templator/genTableBlock.js +11 -17
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +13 -8
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/index.d.ts +4 -2
- package/out/templator/index.js +2 -2
- package/out/templator/index.js.map +1 -1
- package/out/templator/utils.d.ts +9 -2
- package/out/templator/utils.js +22 -22
- package/out/templator/utils.js.map +1 -1
- package/out/translator/index.js +27 -28
- package/out/translator/index.js.map +1 -1
- package/out/utils/index.d.ts +2 -1
- package/out/utils/index.js +8 -14
- package/out/utils/index.js.map +1 -1
- package/out/utils/logger.js.map +1 -1
- package/out/utils/sortTsString.js +3 -1
- package/out/utils/sortTsString.js.map +1 -1
- package/out/utils/string.js +8 -11
- package/out/utils/string.js.map +1 -1
- package/out/utils/time-slicing.d.ts +41 -0
- package/out/utils/time-slicing.js +81 -0
- package/out/utils/time-slicing.js.map +1 -0
- package/out/utils/traverse.js +4 -6
- package/out/utils/traverse.js.map +1 -1
- package/package.json +22 -20
- package/sandbox/stdlib/nasl.auth.ts +49 -46
- package/sandbox/stdlib/nasl.browser.ts +1 -0
- package/sandbox/stdlib/nasl.event.ts +4 -0
- package/sandbox/stdlib/nasl.http.ts +29 -31
- package/sandbox/stdlib/nasl.ui.definition.ts +13 -1
- package/sandbox/stdlib/nasl.ui.ts +11 -0
- package/sandbox-natural/stdlib/nasl.core.ts +36 -0
- package/sandbox-natural/stdlib/nasl.oql.ts +8 -0
- package/sandbox-natural/stdlib/nasl.ui.ts +56 -0
- package/sandbox-natural/stdlib/nasl.util.ts +26 -0
- package/sandbox-natural/tsconfig.json +12 -0
- package/src/automate/engine/utils.js +3 -0
- package/src/automate/upgrader/2.20.js +1 -1
- package/src/bak/translator.js +92 -99
- package/src/breakpoint/generator/AfterStartNode.ts +19 -17
- package/src/breakpoint/generator/BeforeEndNode.ts +17 -17
- package/src/breakpoint/generator/BreakpointNode.ts +243 -195
- package/src/breakpoint/generator/CallbackNode.ts +20 -0
- package/src/breakpoint/generator/FragmentNode.ts +14 -0
- package/src/breakpoint/generator/index.ts +107 -80
- package/src/breakpoint/shared/constants.ts +59 -53
- package/src/breakpoint/shared/operations.ts +6 -6
- package/src/breakpoint/shared/socket.ts +277 -223
- package/src/breakpoint/shared/utils.ts +166 -146
- package/src/breakpoint/store/core.ts +326 -297
- package/src/breakpoint/store/dock.ts +103 -103
- package/src/breakpoint/types/index.d.ts +11 -11
- package/src/common/BaseNode.ts +1103 -1020
- package/src/common/Command.ts +46 -16
- package/src/common/ComponentAPI.ts +72 -72
- package/src/common/EventEmitter.ts +80 -76
- package/src/common/Messager.ts +223 -224
- package/src/common/asyncFuncMap.ts +12 -12
- package/src/concepts/Abort__.ts +53 -60
- package/src/concepts/Anchor__.ts +158 -149
- package/src/concepts/AnonymousFunction__.ts +584 -551
- package/src/concepts/App__.ts +4278 -3669
- package/src/concepts/Argument__.ts +234 -210
- package/src/concepts/Assignee__.ts +680 -656
- package/src/concepts/AssignmentLine__.ts +80 -84
- package/src/concepts/Assignment__.ts +276 -264
- package/src/concepts/Attribute__.ts +183 -184
- package/src/concepts/AuthInterface__.ts +61 -63
- package/src/concepts/AuthLogicForCallInterface__.ts +540 -511
- package/src/concepts/AuthLogic__.ts +210 -194
- package/src/concepts/BackendVariable__.ts +414 -415
- package/src/concepts/Backend__.ts +317 -303
- package/src/concepts/BatchAssignment__.ts +987 -939
- package/src/concepts/BinaryExpression__.ts +370 -341
- package/src/concepts/BindAttribute__.ts +1056 -1011
- package/src/concepts/BindDirective__.ts +540 -542
- package/src/concepts/BindEvent__.ts +992 -866
- package/src/concepts/BindStyle__.ts +442 -451
- package/src/concepts/BooleanLiteral__.ts +89 -90
- package/src/concepts/CallAuthInterface__.ts +458 -433
- package/src/concepts/CallConnector__.ts +209 -164
- package/src/concepts/CallFunction__.ts +600 -600
- package/src/concepts/CallInterface__.ts +752 -725
- package/src/concepts/CallLogic__.ts +1328 -1236
- package/src/concepts/CallQueryComponent__.ts +1580 -1501
- package/src/concepts/Comment__.ts +69 -68
- package/src/concepts/CompletionProperty__.ts +250 -250
- package/src/concepts/ConfigGroup__.ts +312 -296
- package/src/concepts/ConfigPropertyValue__.ts +81 -82
- package/src/concepts/ConfigProperty__.ts +374 -357
- package/src/concepts/Configuration__.ts +288 -276
- package/src/concepts/Connection__.ts +426 -0
- package/src/concepts/ConnectorTrigger__.ts +146 -142
- package/src/concepts/Connector__.ts +1090 -1048
- package/src/concepts/Constant__.ts +226 -219
- package/src/concepts/DataElement__.ts +108 -115
- package/src/concepts/DataSource__.ts +508 -472
- package/src/concepts/DatabaseTypeAnnotation__.ts +53 -59
- package/src/concepts/Destination__.ts +808 -746
- package/src/concepts/End__.ts +85 -89
- package/src/concepts/EntityIndex__.ts +206 -202
- package/src/concepts/EntityProperty__.ts +825 -791
- package/src/concepts/Entity__.ts +921 -864
- package/src/concepts/EnumItem__.ts +133 -125
- package/src/concepts/Enum__.ts +347 -337
- package/src/concepts/Event__.ts +305 -292
- package/src/concepts/ExternalDestination__.ts +269 -280
- package/src/concepts/ForEachStatement__.ts +583 -531
- package/src/concepts/FrontendLibrary__.ts +507 -485
- package/src/concepts/FrontendVariable__.ts +44 -49
- package/src/concepts/Frontend__.ts +1239 -1187
- package/src/concepts/Function__.ts +1110 -1045
- package/src/concepts/Identifier__.ts +276 -272
- package/src/concepts/IfStatement__.ts +467 -436
- package/src/concepts/Integration__.ts +136 -137
- package/src/concepts/InterfaceParam__.ts +239 -238
- package/src/concepts/Interface__.ts +969 -948
- package/src/concepts/JSBlock__.ts +83 -83
- package/src/concepts/JavaLogic__.ts +101 -106
- package/src/concepts/LogicItem__.ts +307 -237
- package/src/concepts/Logic__.ts +2301 -2088
- package/src/concepts/MatchCase__.ts +886 -779
- package/src/concepts/Match__.ts +728 -659
- package/src/concepts/MemberExpression__.ts +330 -311
- package/src/concepts/MicroApp__.ts +91 -97
- package/src/concepts/Module__.ts +2590 -2275
- package/src/concepts/MsgTriggerEvent__.ts +297 -281
- package/src/concepts/MsgTriggerLauncher__.ts +286 -256
- package/src/concepts/Namespace__.ts +2579 -2466
- package/src/concepts/NewComposite__.ts +1487 -1350
- package/src/concepts/NewList__.ts +464 -450
- package/src/concepts/NewMap__.ts +691 -674
- package/src/concepts/New__.ts +42 -49
- package/src/concepts/NullLiteral__.ts +66 -72
- package/src/concepts/NumericLiteral__.ts +169 -169
- package/src/concepts/OqlQueryComponent__.ts +282 -279
- package/src/concepts/OverriddenLogic__.ts +2142 -2097
- package/src/concepts/Param__.ts +500 -442
- package/src/concepts/Point__.ts +53 -59
- package/src/concepts/ProcessComponent__.ts +497 -475
- package/src/concepts/ProcessElement__.ts +1852 -1780
- package/src/concepts/ProcessOutcome__.ts +59 -64
- package/src/concepts/ProcessOutcomes__.ts +59 -64
- package/src/concepts/Process__.ts +1491 -1428
- package/src/concepts/QueryAggregateExpression__.ts +135 -142
- package/src/concepts/QueryFieldExpression__.ts +138 -142
- package/src/concepts/QueryFromExpression__.ts +246 -254
- package/src/concepts/QueryGroupByExpression__.ts +130 -136
- package/src/concepts/QueryJoinExpression__.ts +441 -438
- package/src/concepts/QueryLimitExpression__.ts +159 -166
- package/src/concepts/QueryOrderByExpression__.ts +173 -180
- package/src/concepts/QuerySelectExpression__.ts +464 -439
- package/src/concepts/Rect__.ts +73 -79
- package/src/concepts/Return__.ts +366 -345
- package/src/concepts/Role__.ts +146 -147
- package/src/concepts/SelectMembers__.ts +358 -350
- package/src/concepts/Slot__.ts +152 -153
- package/src/concepts/SqlQueryComponent__.ts +230 -228
- package/src/concepts/Start__.ts +45 -52
- package/src/concepts/StringInterpolation__.ts +323 -296
- package/src/concepts/StringLiteral__.ts +113 -115
- package/src/concepts/StructureProperty__.ts +306 -295
- package/src/concepts/Structure__.ts +615 -578
- package/src/concepts/SwitchCase__.ts +326 -290
- package/src/concepts/SwitchStatement__.ts +236 -229
- package/src/concepts/Theme__.ts +64 -68
- package/src/concepts/Transactional__.ts +159 -153
- package/src/concepts/TriggerEvent__.ts +285 -274
- package/src/concepts/TriggerLauncher__.ts +232 -196
- package/src/concepts/TypeAnnotation__.ts +1049 -1011
- package/src/concepts/TypeParam__.ts +48 -50
- package/src/concepts/UnaryExpression__.ts +163 -153
- package/src/concepts/Unparsed__.ts +81 -82
- package/src/concepts/UseComponent__.ts +53 -59
- package/src/concepts/ValidationRule__.ts +524 -544
- package/src/concepts/Variable__.ts +419 -397
- package/src/concepts/ViewBlock__.ts +58 -64
- package/src/concepts/ViewComponent__.ts +1323 -1261
- package/src/concepts/ViewElement__.ts +2537 -2351
- package/src/concepts/View__.ts +2461 -2245
- package/src/concepts/WhileStatement__.ts +293 -272
- package/src/concepts/basics/stdlib/index.ts +17 -1
- package/src/concepts/basics/stdlib/nasl.browser.ts +36 -0
- package/src/concepts/basics/stdlib/nasl.event.ts +18 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +45 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +6 -22
- package/src/concepts/index__.ts +2 -1
- package/src/concepts/types__.ts +123 -121
- package/src/decorators/index.ts +75 -77
- package/src/decorators/promise.ts +28 -0
- package/src/enums/KEYWORDS.ts +1228 -1228
- package/src/enums/LEVEL_NAME_MAP.ts +24 -24
- package/src/generator/compileComponent.ts +10 -10
- package/src/generator/genBundleFiles.ts +300 -291
- package/src/generator/genHash.ts +2 -2
- package/src/generator/genMetaData.ts +280 -261
- package/src/generator/genReleaseBody.ts +312 -291
- package/src/generator/icestark.ts +1 -1
- package/src/generator/microApp.ts +17 -20
- package/src/generator/permission.ts +241 -232
- package/src/generator/qiankun.ts +1 -1
- package/src/generator/styleReplacer.ts +28 -31
- package/src/index.ts +0 -3
- package/src/manager/diagnostic.ts +84 -82
- package/src/manager/stepRecorder.ts +106 -94
- package/src/natural/RequirementAnalyzer.ts +208 -0
- package/src/natural/RequirementExecutor.ts +685 -0
- package/src/natural/componentData.ts +81 -0
- package/src/natural/genNaturalTS.ts +77 -0
- package/src/natural/index.ts +4 -0
- package/src/natural/knowledgeMap.ts +39 -0
- package/src/natural/naslStdlibMap.ts +24 -0
- package/src/natural/transformTSCode.ts +692 -0
- package/src/sentry/index.ts +109 -104
- package/src/server/createUiTs.ts +190 -184
- package/src/server/entity2LogicNamespace.ts +379 -359
- package/src/server/event.js +145 -121
- package/src/server/extendBaseNode.ts +461 -456
- package/src/server/formatTsUtils.ts +712 -713
- package/src/server/getConnector.ts +33 -33
- package/src/server/getExtensionModules.ts +23 -22
- package/src/server/getFunctions.ts +6 -6
- package/src/server/getInterfaces.ts +38 -37
- package/src/server/getLogging.ts +1 -1
- package/src/server/getLogics.ts +391 -312
- package/src/server/getMemberIdentifier.ts +286 -281
- package/src/server/getProcessComponents.ts +2 -2
- package/src/server/getProcesses.ts +548 -534
- package/src/server/getScope.ts +51 -51
- package/src/server/getValidates.ts +3 -3
- package/src/server/index.ts +29 -30
- package/src/server/naslServer.ts +4303 -4222
- package/src/server/naslStdlibMap.ts +43 -39
- package/src/server/process2LogicNamespace.ts +97 -97
- package/src/server/translator.ts +740 -746
- package/src/service/storage/init.ts +761 -728
- package/src/templator/genCallComponentLogic.ts +14 -15
- package/src/templator/genCreateBlock.ts +257 -229
- package/src/templator/genCurdEditMultipleKeyBlock.ts +333 -317
- package/src/templator/genCurdMultipleKeyBlock.ts +503 -475
- package/src/templator/genEditTableBlock.ts +194 -187
- package/src/templator/genEnumSelectBlock.ts +13 -7
- package/src/templator/genGetBlock.ts +57 -55
- package/src/templator/genGridViewBlock.ts +195 -211
- package/src/templator/genListViewBlock.ts +62 -72
- package/src/templator/genQueryComponent.ts +337 -287
- package/src/templator/genSelectBlock.ts +283 -297
- package/src/templator/genTableBlock.ts +160 -166
- package/src/templator/genUpdateBlock.ts +269 -255
- package/src/templator/index.ts +4 -4
- package/src/templator/utils.ts +491 -463
- package/src/translator/index.ts +84 -84
- package/src/translator/lsp.ts +22 -22
- package/src/translator/tsp.ts +6 -6
- package/src/utils/index.ts +115 -117
- package/src/utils/logger.ts +3 -4
- package/src/utils/sortTsString.ts +34 -32
- package/src/utils/string.ts +47 -48
- package/src/utils/time-slicing.ts +109 -0
- package/src/utils/traverse.ts +114 -126
- package/test/concepts/call-interface/__snapshots__/toEmbeddedTS.spec.ts.snap +71 -0
- package/test/concepts/call-interface/__snapshots__/toJS.spec.ts.snap +140 -0
- package/test/concepts/call-interface/constant.ts +5 -0
- package/test/concepts/call-interface/fixtures/only-interface.json +158 -0
- package/test/concepts/call-interface/fixtures/with-body-complex-argument.json +455 -0
- package/test/concepts/call-interface/fixtures/with-body-no-argument.json +187 -0
- package/test/concepts/call-interface/fixtures/with-body-simple-argument.json +225 -0
- package/test/concepts/call-interface/fixtures/with-headers-no-argument.json +213 -0
- package/test/concepts/call-interface/fixtures/with-headers.json +192 -0
- package/test/concepts/call-interface/fixtures/with-query-no-argument.json +213 -0
- package/test/concepts/call-interface/fixtures/with-query.json +192 -0
- package/test/concepts/call-interface/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/call-interface/toJS.spec.ts +14 -0
- package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +74 -0
- package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +141 -0
- package/test/concepts/call-logic/constant.ts +5 -0
- package/test/concepts/call-logic/fixtures/entries-get-with-arguments.json +223 -0
- package/test/concepts/call-logic/fixtures/entries-update-with-arguments.json +359 -0
- package/test/concepts/call-logic/fixtures/global-logic-argument-no-expression.json +209 -0
- package/test/concepts/call-logic/fixtures/global-logic-argument-some-expression.json +311 -0
- package/test/concepts/call-logic/fixtures/only-call-logic.json +10 -0
- package/test/concepts/call-logic/fixtures/view-buildin-logic-with-argument.json +128 -0
- package/test/concepts/call-logic/fixtures/view-component-logic-no-argument.json +126 -0
- package/test/concepts/call-logic/fixtures/view-component-with-validation.json +244 -0
- package/test/concepts/call-logic/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/call-logic/toJS.spec.ts +14 -0
- package/test/concepts/match/__snapshots__/toEmbeddedTS.spec.ts.snap +66 -0
- package/test/concepts/match/__snapshots__/toJS.spec.ts.snap +40 -0
- package/test/concepts/match/constant.ts +5 -0
- package/test/concepts/match/fixtures/isExpression.json +259 -0
- package/test/concepts/match/fixtures/lastBodyIf.json +268 -0
- package/test/concepts/match/fixtures/noExpression.json +176 -0
- package/test/concepts/match/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/match/toJS.spec.ts +14 -0
- package/test/concepts/utils.ts +76 -3
- package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +3 -3
- package/test/concepts/validation-rule/__snapshots__/toJS.spec.ts.snap +16 -0
- package/test/concepts/validation-rule/constant.ts +5 -0
- package/test/concepts/validation-rule/toEmbeddedTS.spec.ts +10 -17
- package/test/concepts/validation-rule/toJS.spec.ts +14 -0
- package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +68 -0
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +44 -0
- package/test/concepts/view-element/constant.ts +5 -0
- package/test/concepts/view-element/fixtures/default-not-found.json +322 -0
- package/test/concepts/view-element/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/view-element/toVue.spec.ts +14 -0
- package/test/setup.ts +7 -0
- package/ts-worker/src/index.js +0 -2
- package/tsconfig.json +21 -21
- package/bin/naslc +0 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
1
2
|
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
3
|
import QueryJoinExpression from './QueryJoinExpression__';
|
|
3
4
|
import Entity from './Entity__';
|
|
@@ -7,15 +8,14 @@ import CompletionProperty from './CompletionProperty__';
|
|
|
7
8
|
import QueryFieldExpression from './QueryFieldExpression__';
|
|
8
9
|
import Identifier from './Identifier__';
|
|
9
10
|
import MemberExpression from './MemberExpression__';
|
|
10
|
-
|
|
11
|
+
//= ===============================================================================
|
|
11
12
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
12
13
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
13
|
-
|
|
14
|
+
//= ===============================================================================
|
|
14
15
|
import { EventPayload, Params } from '../common/EventEmitter';
|
|
15
16
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
16
17
|
|
|
17
18
|
import * as utils from '../utils';
|
|
18
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
19
19
|
import BaseNode from '../common/BaseNode';
|
|
20
20
|
import classMap from '../common/classMap';
|
|
21
21
|
import TypeAnnotation from './TypeAnnotation__';
|
|
@@ -31,1564 +31,1643 @@ import QueryLimitExpression from './QueryLimitExpression__';
|
|
|
31
31
|
*/
|
|
32
32
|
@concept('数据查询')
|
|
33
33
|
export class CallQueryComponent extends LogicItem {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
34
|
+
/**
|
|
35
|
+
* 产品概念
|
|
36
|
+
*/
|
|
37
|
+
@property()
|
|
38
|
+
concept: 'CallQueryComponent' = 'CallQueryComponent';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 类型
|
|
42
|
+
*/
|
|
43
|
+
@property('TypeAnnotation')
|
|
44
|
+
typeAnnotation: TypeAnnotation = undefined;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* select
|
|
48
|
+
*/
|
|
49
|
+
@property('QuerySelectExpression')
|
|
50
|
+
select: QuerySelectExpression = undefined;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* from
|
|
54
|
+
*/
|
|
55
|
+
@property('QueryFromExpression')
|
|
56
|
+
from: QueryFromExpression = undefined;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* where
|
|
60
|
+
*/
|
|
61
|
+
@property('LogicItem')
|
|
62
|
+
where: LogicItem = undefined;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* where 草稿态
|
|
66
|
+
*/
|
|
67
|
+
@property('LogicItem')
|
|
68
|
+
wherePlayground: Array<LogicItem> = [];
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* groupBy
|
|
72
|
+
*/
|
|
73
|
+
@property('QueryGroupByExpression')
|
|
74
|
+
groupBy: Array<QueryGroupByExpression> = [];
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* having
|
|
78
|
+
*/
|
|
79
|
+
@property('LogicItem')
|
|
80
|
+
having: LogicItem = undefined;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* having 草稿态
|
|
84
|
+
*/
|
|
85
|
+
@property('LogicItem')
|
|
86
|
+
havingPlayground: Array<LogicItem> = [];
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* orderBy
|
|
90
|
+
*/
|
|
91
|
+
@property('QueryOrderByExpression')
|
|
92
|
+
orderBy: Array<QueryOrderByExpression> = [];
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* limit
|
|
96
|
+
*/
|
|
97
|
+
@property('QueryLimitExpression')
|
|
98
|
+
limit: QueryLimitExpression = undefined;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 查询组件的局部版本
|
|
102
|
+
*/
|
|
103
|
+
@property()
|
|
104
|
+
ideVersion: string = undefined;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @param source 需要合并的部分参数
|
|
108
|
+
*/
|
|
109
|
+
constructor(source?: Partial<CallQueryComponent>) {
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
source = { ...CallQueryComponent.getDefaultOptions(), ...source };
|
|
112
|
+
super(source);
|
|
113
|
+
super.subConstructor(source);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
getClassName() {
|
|
117
|
+
return 'CallQueryComponent';
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
static from(source: any, parentNode?: any, parentKey?: string): CallQueryComponent {
|
|
121
|
+
return super.from(source, parentNode, parentKey) as CallQueryComponent;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* 设置select
|
|
126
|
+
*/
|
|
127
|
+
setSelect(select: QuerySelectExpression) {
|
|
128
|
+
select._delete();
|
|
129
|
+
const relationOptions = { parentNode: this, parentKey: 'select' };
|
|
130
|
+
Object.assign(select, relationOptions);
|
|
131
|
+
const object = {
|
|
132
|
+
select,
|
|
133
|
+
};
|
|
134
|
+
this.update({
|
|
135
|
+
...object,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 设置from
|
|
141
|
+
*/
|
|
142
|
+
setFrom(from: QueryFromExpression) {
|
|
143
|
+
from._delete();
|
|
144
|
+
const relationOptions = { parentNode: this, parentKey: 'from' };
|
|
145
|
+
Object.assign(from, relationOptions);
|
|
146
|
+
const object = {
|
|
147
|
+
from,
|
|
148
|
+
};
|
|
149
|
+
this.update({
|
|
150
|
+
...object,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* 设置where
|
|
156
|
+
*/
|
|
157
|
+
setWhere(where: LogicItem) {
|
|
158
|
+
where._delete();
|
|
159
|
+
const relationOptions = { parentNode: this, parentKey: 'where' };
|
|
160
|
+
Object.assign(where, relationOptions);
|
|
161
|
+
const object = {
|
|
162
|
+
where,
|
|
163
|
+
};
|
|
164
|
+
this.update({
|
|
165
|
+
...object,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* 设置groupBy
|
|
171
|
+
*/
|
|
172
|
+
setGroupBy(groupBy: Array<QueryGroupByExpression>) {
|
|
173
|
+
const object = {
|
|
174
|
+
groupBy,
|
|
175
|
+
};
|
|
176
|
+
this.update({
|
|
177
|
+
...object,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* 设置having
|
|
183
|
+
*/
|
|
184
|
+
setHaving(having: LogicItem) {
|
|
185
|
+
having._delete();
|
|
186
|
+
const relationOptions = { parentNode: this, parentKey: 'having' };
|
|
187
|
+
Object.assign(having, relationOptions);
|
|
188
|
+
const object = {
|
|
189
|
+
having,
|
|
190
|
+
};
|
|
191
|
+
this.update({
|
|
192
|
+
...object,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* 设置orderBy
|
|
198
|
+
*/
|
|
199
|
+
setOrderBy(orderBy: Array<QueryOrderByExpression>) {
|
|
200
|
+
const object = {
|
|
201
|
+
orderBy,
|
|
202
|
+
};
|
|
203
|
+
this.update({
|
|
204
|
+
...object,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* 设置limit
|
|
210
|
+
*/
|
|
211
|
+
setLimit(limit: QueryLimitExpression) {
|
|
212
|
+
limit._delete();
|
|
213
|
+
const relationOptions = { parentNode: this, parentKey: 'limit' };
|
|
214
|
+
Object.assign(limit, relationOptions);
|
|
215
|
+
const object = {
|
|
216
|
+
limit,
|
|
217
|
+
};
|
|
218
|
+
this.update({
|
|
219
|
+
...object,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* 插入逻辑项
|
|
225
|
+
* @internal
|
|
226
|
+
* @param logicItemOptions 逻辑项参数
|
|
227
|
+
*/
|
|
228
|
+
_insertItemInWherePlaygroundAt(logicItemOptions: Partial<LogicItem>, index: number): LogicItem;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* 插入逻辑项
|
|
232
|
+
* @internal
|
|
233
|
+
* @param logicItem 已有的逻辑项实例
|
|
234
|
+
*/
|
|
235
|
+
_insertItemInWherePlaygroundAt(logicItem: LogicItem, index: number): LogicItem;
|
|
236
|
+
|
|
237
|
+
_insertItemInWherePlaygroundAt(options: Partial<LogicItem> | LogicItem, index: number) {
|
|
238
|
+
const logicItemOptions: any = {};
|
|
239
|
+
const relationOptions = { parentNode: this, parentKey: 'wherePlayground' };
|
|
240
|
+
let logicItem: LogicItem;
|
|
241
|
+
if (options instanceof LogicItem) {
|
|
242
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
243
|
+
logicItem = options;
|
|
244
|
+
Object.assign(logicItem, relationOptions);
|
|
245
|
+
} else {
|
|
246
|
+
logicItem = LogicItem.from(
|
|
247
|
+
{
|
|
248
|
+
...logicItemOptions,
|
|
249
|
+
...options,
|
|
250
|
+
},
|
|
251
|
+
this,
|
|
252
|
+
'wherePlayground'
|
|
253
|
+
);
|
|
204
254
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
255
|
+
this.wherePlayground.splice(index, 0, logicItem);
|
|
256
|
+
return logicItem;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* 插入逻辑项
|
|
261
|
+
* @param logicItemOptions 逻辑项参数
|
|
262
|
+
*/
|
|
263
|
+
insertItemInWherePlaygroundAt(logicItemOptions: Partial<LogicItem>, index: number): LogicItem;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* 插入逻辑项
|
|
267
|
+
* @param logicItem 已有的逻辑项实例
|
|
268
|
+
*/
|
|
269
|
+
insertItemInWherePlaygroundAt(logicItem: LogicItem, index: number): LogicItem;
|
|
270
|
+
|
|
271
|
+
insertItemInWherePlaygroundAt(options: Partial<LogicItem> | LogicItem, index: number) {
|
|
272
|
+
const node = this._insertItemInWherePlaygroundAt(options as any, index);
|
|
273
|
+
node.create({
|
|
274
|
+
index,
|
|
275
|
+
parentNode: this,
|
|
276
|
+
parentKey: 'wherePlayground',
|
|
277
|
+
});
|
|
278
|
+
return node;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* 添加逻辑项
|
|
283
|
+
* @internal
|
|
284
|
+
* @param logicItemOptions 逻辑项参数
|
|
285
|
+
*/
|
|
286
|
+
_addItemInWherePlayground(logicItemOptions: Partial<LogicItem>): LogicItem;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* 添加逻辑项
|
|
290
|
+
* @internal
|
|
291
|
+
* @param logicItem 已有的逻辑项实例
|
|
292
|
+
*/
|
|
293
|
+
_addItemInWherePlayground(logicItem: LogicItem): LogicItem;
|
|
294
|
+
|
|
295
|
+
_addItemInWherePlayground(options?: Partial<LogicItem> | LogicItem) {
|
|
296
|
+
const index = this.wherePlayground.length;
|
|
297
|
+
return this._insertItemInWherePlaygroundAt(options as any, index);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* 添加逻辑项
|
|
302
|
+
* @param logicItemOptions 逻辑项参数
|
|
303
|
+
*/
|
|
304
|
+
addItemInWherePlayground(logicItemOptions: Partial<LogicItem>): LogicItem;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* 添加逻辑项
|
|
308
|
+
* @param logicItem 已有的逻辑项实例
|
|
309
|
+
*/
|
|
310
|
+
addItemInWherePlayground(logicItem: LogicItem): LogicItem;
|
|
311
|
+
|
|
312
|
+
addItemInWherePlayground(options?: Partial<LogicItem> | LogicItem) {
|
|
313
|
+
const node = this._addItemInWherePlayground(options as any);
|
|
314
|
+
const index = this.wherePlayground.indexOf(node);
|
|
315
|
+
node.create({
|
|
316
|
+
index,
|
|
317
|
+
parentNode: this,
|
|
318
|
+
parentKey: 'wherePlayground',
|
|
319
|
+
});
|
|
320
|
+
return node;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* 插入查询分组
|
|
325
|
+
* @internal
|
|
326
|
+
* @param queryGroupByExpressionOptions 查询分组参数
|
|
327
|
+
*/
|
|
328
|
+
_insertQueryGroupByExpressionInGroupByAt(queryGroupByExpressionOptions: Partial<QueryGroupByExpression>, index: number): QueryGroupByExpression;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* 插入查询分组
|
|
332
|
+
* @internal
|
|
333
|
+
* @param queryGroupByExpression 已有的查询分组实例
|
|
334
|
+
*/
|
|
335
|
+
_insertQueryGroupByExpressionInGroupByAt(queryGroupByExpression: QueryGroupByExpression, index: number): QueryGroupByExpression;
|
|
336
|
+
|
|
337
|
+
_insertQueryGroupByExpressionInGroupByAt(options: Partial<QueryGroupByExpression> | QueryGroupByExpression, index: number) {
|
|
338
|
+
const queryGroupByExpressionOptions: any = {};
|
|
339
|
+
const relationOptions = { parentNode: this, parentKey: 'groupBy' };
|
|
340
|
+
let queryGroupByExpression: QueryGroupByExpression;
|
|
341
|
+
if (options instanceof QueryGroupByExpression) {
|
|
342
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
343
|
+
queryGroupByExpression = options;
|
|
344
|
+
Object.assign(queryGroupByExpression, relationOptions);
|
|
345
|
+
} else {
|
|
346
|
+
queryGroupByExpression = QueryGroupByExpression.from(
|
|
347
|
+
{
|
|
348
|
+
...queryGroupByExpressionOptions,
|
|
349
|
+
...options,
|
|
350
|
+
},
|
|
351
|
+
this,
|
|
352
|
+
'groupBy'
|
|
353
|
+
);
|
|
219
354
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
355
|
+
this.groupBy.splice(index, 0, queryGroupByExpression);
|
|
356
|
+
return queryGroupByExpression;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* 插入查询分组
|
|
361
|
+
* @param queryGroupByExpressionOptions 查询分组参数
|
|
362
|
+
*/
|
|
363
|
+
insertQueryGroupByExpressionInGroupByAt(queryGroupByExpressionOptions: Partial<QueryGroupByExpression>, index: number): QueryGroupByExpression;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* 插入查询分组
|
|
367
|
+
* @param queryGroupByExpression 已有的查询分组实例
|
|
368
|
+
*/
|
|
369
|
+
insertQueryGroupByExpressionInGroupByAt(queryGroupByExpression: QueryGroupByExpression, index: number): QueryGroupByExpression;
|
|
370
|
+
|
|
371
|
+
insertQueryGroupByExpressionInGroupByAt(options: Partial<QueryGroupByExpression> | QueryGroupByExpression, index: number) {
|
|
372
|
+
const node = this._insertQueryGroupByExpressionInGroupByAt(options as any, index);
|
|
373
|
+
node.create({
|
|
374
|
+
index,
|
|
375
|
+
parentNode: this,
|
|
376
|
+
parentKey: 'groupBy',
|
|
377
|
+
});
|
|
378
|
+
return node;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* 添加查询分组
|
|
383
|
+
* @internal
|
|
384
|
+
* @param queryGroupByExpressionOptions 查询分组参数
|
|
385
|
+
*/
|
|
386
|
+
_addQueryGroupByExpressionInGroupBy(queryGroupByExpressionOptions: Partial<QueryGroupByExpression>): QueryGroupByExpression;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* 添加查询分组
|
|
390
|
+
* @internal
|
|
391
|
+
* @param queryGroupByExpression 已有的查询分组实例
|
|
392
|
+
*/
|
|
393
|
+
_addQueryGroupByExpressionInGroupBy(queryGroupByExpression: QueryGroupByExpression): QueryGroupByExpression;
|
|
394
|
+
|
|
395
|
+
_addQueryGroupByExpressionInGroupBy(options?: Partial<QueryGroupByExpression> | QueryGroupByExpression) {
|
|
396
|
+
const index = this.groupBy.length;
|
|
397
|
+
return this._insertQueryGroupByExpressionInGroupByAt(options as any, index);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* 添加查询分组
|
|
402
|
+
* @param queryGroupByExpressionOptions 查询分组参数
|
|
403
|
+
*/
|
|
404
|
+
addQueryGroupByExpressionInGroupBy(queryGroupByExpressionOptions: Partial<QueryGroupByExpression>): QueryGroupByExpression;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* 添加查询分组
|
|
408
|
+
* @param queryGroupByExpression 已有的查询分组实例
|
|
409
|
+
*/
|
|
410
|
+
addQueryGroupByExpressionInGroupBy(queryGroupByExpression: QueryGroupByExpression): QueryGroupByExpression;
|
|
411
|
+
|
|
412
|
+
addQueryGroupByExpressionInGroupBy(options?: Partial<QueryGroupByExpression> | QueryGroupByExpression) {
|
|
413
|
+
const node = this._addQueryGroupByExpressionInGroupBy(options as any);
|
|
414
|
+
const index = this.groupBy.indexOf(node);
|
|
415
|
+
node.create({
|
|
416
|
+
index,
|
|
417
|
+
parentNode: this,
|
|
418
|
+
parentKey: 'groupBy',
|
|
419
|
+
});
|
|
420
|
+
return node;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* 插入逻辑项
|
|
425
|
+
* @internal
|
|
426
|
+
* @param logicItemOptions 逻辑项参数
|
|
427
|
+
*/
|
|
428
|
+
_insertItemInHavingPlaygroundAt(logicItemOptions: Partial<LogicItem>, index: number): LogicItem;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* 插入逻辑项
|
|
432
|
+
* @internal
|
|
433
|
+
* @param logicItem 已有的逻辑项实例
|
|
434
|
+
*/
|
|
435
|
+
_insertItemInHavingPlaygroundAt(logicItem: LogicItem, index: number): LogicItem;
|
|
436
|
+
|
|
437
|
+
_insertItemInHavingPlaygroundAt(options: Partial<LogicItem> | LogicItem, index: number) {
|
|
438
|
+
const logicItemOptions: any = {};
|
|
439
|
+
const relationOptions = { parentNode: this, parentKey: 'havingPlayground' };
|
|
440
|
+
let logicItem: LogicItem;
|
|
441
|
+
if (options instanceof LogicItem) {
|
|
442
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
443
|
+
logicItem = options;
|
|
444
|
+
Object.assign(logicItem, relationOptions);
|
|
445
|
+
} else {
|
|
446
|
+
logicItem = LogicItem.from(
|
|
447
|
+
{
|
|
448
|
+
...logicItemOptions,
|
|
449
|
+
...options,
|
|
450
|
+
},
|
|
451
|
+
this,
|
|
452
|
+
'havingPlayground'
|
|
453
|
+
);
|
|
251
454
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
455
|
+
this.havingPlayground.splice(index, 0, logicItem);
|
|
456
|
+
return logicItem;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* 插入逻辑项
|
|
461
|
+
* @param logicItemOptions 逻辑项参数
|
|
462
|
+
*/
|
|
463
|
+
insertItemInHavingPlaygroundAt(logicItemOptions: Partial<LogicItem>, index: number): LogicItem;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* 插入逻辑项
|
|
467
|
+
* @param logicItem 已有的逻辑项实例
|
|
468
|
+
*/
|
|
469
|
+
insertItemInHavingPlaygroundAt(logicItem: LogicItem, index: number): LogicItem;
|
|
470
|
+
|
|
471
|
+
insertItemInHavingPlaygroundAt(options: Partial<LogicItem> | LogicItem, index: number) {
|
|
472
|
+
const node = this._insertItemInHavingPlaygroundAt(options as any, index);
|
|
473
|
+
node.create({
|
|
474
|
+
index,
|
|
475
|
+
parentNode: this,
|
|
476
|
+
parentKey: 'havingPlayground',
|
|
477
|
+
});
|
|
478
|
+
return node;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* 添加逻辑项
|
|
483
|
+
* @internal
|
|
484
|
+
* @param logicItemOptions 逻辑项参数
|
|
485
|
+
*/
|
|
486
|
+
_addItemInHavingPlayground(logicItemOptions: Partial<LogicItem>): LogicItem;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* 添加逻辑项
|
|
490
|
+
* @internal
|
|
491
|
+
* @param logicItem 已有的逻辑项实例
|
|
492
|
+
*/
|
|
493
|
+
_addItemInHavingPlayground(logicItem: LogicItem): LogicItem;
|
|
494
|
+
|
|
495
|
+
_addItemInHavingPlayground(options?: Partial<LogicItem> | LogicItem) {
|
|
496
|
+
const index = this.havingPlayground.length;
|
|
497
|
+
return this._insertItemInHavingPlaygroundAt(options as any, index);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* 添加逻辑项
|
|
502
|
+
* @param logicItemOptions 逻辑项参数
|
|
503
|
+
*/
|
|
504
|
+
addItemInHavingPlayground(logicItemOptions: Partial<LogicItem>): LogicItem;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* 添加逻辑项
|
|
508
|
+
* @param logicItem 已有的逻辑项实例
|
|
509
|
+
*/
|
|
510
|
+
addItemInHavingPlayground(logicItem: LogicItem): LogicItem;
|
|
511
|
+
|
|
512
|
+
addItemInHavingPlayground(options?: Partial<LogicItem> | LogicItem) {
|
|
513
|
+
const node = this._addItemInHavingPlayground(options as any);
|
|
514
|
+
const index = this.havingPlayground.indexOf(node);
|
|
515
|
+
node.create({
|
|
516
|
+
index,
|
|
517
|
+
parentNode: this,
|
|
518
|
+
parentKey: 'havingPlayground',
|
|
519
|
+
});
|
|
520
|
+
return node;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* 插入查询排序子句
|
|
525
|
+
* @internal
|
|
526
|
+
* @param queryOrderByExpressionOptions 查询排序子句参数
|
|
527
|
+
*/
|
|
528
|
+
_insertQueryOrderByExpressionInOrderByAt(queryOrderByExpressionOptions: Partial<QueryOrderByExpression>, index: number): QueryOrderByExpression;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* 插入查询排序子句
|
|
532
|
+
* @internal
|
|
533
|
+
* @param queryOrderByExpression 已有的查询排序子句实例
|
|
534
|
+
*/
|
|
535
|
+
_insertQueryOrderByExpressionInOrderByAt(queryOrderByExpression: QueryOrderByExpression, index: number): QueryOrderByExpression;
|
|
536
|
+
|
|
537
|
+
_insertQueryOrderByExpressionInOrderByAt(options: Partial<QueryOrderByExpression> | QueryOrderByExpression, index: number) {
|
|
538
|
+
const queryOrderByExpressionOptions: any = {};
|
|
539
|
+
const relationOptions = { parentNode: this, parentKey: 'orderBy' };
|
|
540
|
+
let queryOrderByExpression: QueryOrderByExpression;
|
|
541
|
+
if (options instanceof QueryOrderByExpression) {
|
|
542
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
543
|
+
queryOrderByExpression = options;
|
|
544
|
+
Object.assign(queryOrderByExpression, relationOptions);
|
|
545
|
+
} else {
|
|
546
|
+
queryOrderByExpression = QueryOrderByExpression.from(
|
|
547
|
+
{
|
|
548
|
+
...queryOrderByExpressionOptions,
|
|
549
|
+
...options,
|
|
550
|
+
},
|
|
551
|
+
this,
|
|
552
|
+
'orderBy'
|
|
553
|
+
);
|
|
273
554
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
555
|
+
this.orderBy.splice(index, 0, queryOrderByExpression);
|
|
556
|
+
return queryOrderByExpression;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* 插入查询排序子句
|
|
561
|
+
* @param queryOrderByExpressionOptions 查询排序子句参数
|
|
562
|
+
*/
|
|
563
|
+
insertQueryOrderByExpressionInOrderByAt(queryOrderByExpressionOptions: Partial<QueryOrderByExpression>, index: number): QueryOrderByExpression;
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* 插入查询排序子句
|
|
567
|
+
* @param queryOrderByExpression 已有的查询排序子句实例
|
|
568
|
+
*/
|
|
569
|
+
insertQueryOrderByExpressionInOrderByAt(queryOrderByExpression: QueryOrderByExpression, index: number): QueryOrderByExpression;
|
|
570
|
+
|
|
571
|
+
insertQueryOrderByExpressionInOrderByAt(options: Partial<QueryOrderByExpression> | QueryOrderByExpression, index: number) {
|
|
572
|
+
const node = this._insertQueryOrderByExpressionInOrderByAt(options as any, index);
|
|
573
|
+
node.create({
|
|
574
|
+
index,
|
|
575
|
+
parentNode: this,
|
|
576
|
+
parentKey: 'orderBy',
|
|
577
|
+
});
|
|
578
|
+
return node;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* 添加查询排序子句
|
|
583
|
+
* @internal
|
|
584
|
+
* @param queryOrderByExpressionOptions 查询排序子句参数
|
|
585
|
+
*/
|
|
586
|
+
_addQueryOrderByExpressionInOrderBy(queryOrderByExpressionOptions: Partial<QueryOrderByExpression>): QueryOrderByExpression;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* 添加查询排序子句
|
|
590
|
+
* @internal
|
|
591
|
+
* @param queryOrderByExpression 已有的查询排序子句实例
|
|
592
|
+
*/
|
|
593
|
+
_addQueryOrderByExpressionInOrderBy(queryOrderByExpression: QueryOrderByExpression): QueryOrderByExpression;
|
|
594
|
+
|
|
595
|
+
_addQueryOrderByExpressionInOrderBy(options?: Partial<QueryOrderByExpression> | QueryOrderByExpression) {
|
|
596
|
+
const index = this.orderBy.length;
|
|
597
|
+
return this._insertQueryOrderByExpressionInOrderByAt(options as any, index);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* 添加查询排序子句
|
|
602
|
+
* @param queryOrderByExpressionOptions 查询排序子句参数
|
|
603
|
+
*/
|
|
604
|
+
addQueryOrderByExpressionInOrderBy(queryOrderByExpressionOptions: Partial<QueryOrderByExpression>): QueryOrderByExpression;
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* 添加查询排序子句
|
|
608
|
+
* @param queryOrderByExpression 已有的查询排序子句实例
|
|
609
|
+
*/
|
|
610
|
+
addQueryOrderByExpressionInOrderBy(queryOrderByExpression: QueryOrderByExpression): QueryOrderByExpression;
|
|
611
|
+
|
|
612
|
+
addQueryOrderByExpressionInOrderBy(options?: Partial<QueryOrderByExpression> | QueryOrderByExpression) {
|
|
613
|
+
const node = this._addQueryOrderByExpressionInOrderBy(options as any);
|
|
614
|
+
const index = this.orderBy.indexOf(node);
|
|
615
|
+
node.create({
|
|
616
|
+
index,
|
|
617
|
+
parentNode: this,
|
|
618
|
+
parentKey: 'orderBy',
|
|
619
|
+
});
|
|
620
|
+
return node;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* 删除类型标注
|
|
625
|
+
* @param name 类型标注名称
|
|
626
|
+
*/
|
|
627
|
+
removeTypeAnnotation(name: string): void;
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* 删除类型标注
|
|
631
|
+
* @param typeAnnotation 已有的类型标注实例
|
|
632
|
+
*/
|
|
633
|
+
removeTypeAnnotation(typeAnnotation: TypeAnnotation): void;
|
|
634
|
+
|
|
635
|
+
removeTypeAnnotation(options: string | TypeAnnotation) {
|
|
636
|
+
let typeAnnotation: TypeAnnotation;
|
|
637
|
+
if (typeof options === 'string') {
|
|
638
|
+
typeAnnotation = this.typeAnnotation;
|
|
639
|
+
if (!typeAnnotation) {
|
|
640
|
+
throw new Error(`找不到类型标注 ${options}`);
|
|
641
|
+
}
|
|
642
|
+
} else {
|
|
643
|
+
typeAnnotation = options;
|
|
292
644
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
const index = this.
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
645
|
+
return typeAnnotation.delete();
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
__removeTypeAnnotation(typeAnnotation: TypeAnnotation) {
|
|
649
|
+
const { parentKey } = typeAnnotation;
|
|
650
|
+
const params: Params = {
|
|
651
|
+
parentNode: this,
|
|
652
|
+
parentKey,
|
|
653
|
+
index: -1,
|
|
654
|
+
object: null,
|
|
655
|
+
oldObject: typeAnnotation,
|
|
656
|
+
};
|
|
657
|
+
if (parentKey) {
|
|
658
|
+
params.parentKey = parentKey;
|
|
659
|
+
if (Array.isArray((this as any)[parentKey])) {
|
|
660
|
+
const index = (this as any)[parentKey].indexOf(typeAnnotation);
|
|
661
|
+
~index && (this as any)[parentKey].splice(index, 1);
|
|
662
|
+
params.index = index;
|
|
663
|
+
} else if ((this as any)[parentKey] === typeAnnotation) {
|
|
664
|
+
params.index = 0;
|
|
665
|
+
(this as any)[parentKey] = undefined;
|
|
666
|
+
}
|
|
315
667
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
queryGroupByExpression = QueryGroupByExpression.from({
|
|
341
|
-
...queryGroupByExpressionOptions,
|
|
342
|
-
...options,
|
|
343
|
-
}, this, 'groupBy');
|
|
344
|
-
}
|
|
345
|
-
this.groupBy.splice(index, 0, queryGroupByExpression);
|
|
346
|
-
return queryGroupByExpression;
|
|
668
|
+
return params;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* 删除查询选择子句
|
|
673
|
+
* @param name 查询选择子句名称
|
|
674
|
+
*/
|
|
675
|
+
removeSelect(name: string): void;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* 删除查询选择子句
|
|
679
|
+
* @param select 已有的查询选择子句实例
|
|
680
|
+
*/
|
|
681
|
+
removeSelect(select: QuerySelectExpression): void;
|
|
682
|
+
|
|
683
|
+
removeSelect(options: string | QuerySelectExpression) {
|
|
684
|
+
let select: QuerySelectExpression;
|
|
685
|
+
if (typeof options === 'string') {
|
|
686
|
+
select = this.select;
|
|
687
|
+
if (!select) {
|
|
688
|
+
throw new Error(`找不到查询选择子句 ${options}`);
|
|
689
|
+
}
|
|
690
|
+
} else {
|
|
691
|
+
select = options;
|
|
347
692
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
693
|
+
return select.delete();
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* 删除查询 From 子句
|
|
698
|
+
* @param name 查询 From 子句名称
|
|
699
|
+
*/
|
|
700
|
+
removeFrom(name: string): void;
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* 删除查询 From 子句
|
|
704
|
+
* @param from 已有的查询 From 子句实例
|
|
705
|
+
*/
|
|
706
|
+
removeFrom(from: QueryFromExpression): void;
|
|
707
|
+
|
|
708
|
+
removeFrom(options: string | QueryFromExpression) {
|
|
709
|
+
let from: QueryFromExpression;
|
|
710
|
+
if (typeof options === 'string') {
|
|
711
|
+
from = this.from;
|
|
712
|
+
if (!from) {
|
|
713
|
+
throw new Error(`找不到查询 From 子句 ${options}`);
|
|
714
|
+
}
|
|
715
|
+
} else {
|
|
716
|
+
from = options;
|
|
369
717
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
718
|
+
return from.delete();
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* 删除逻辑项
|
|
723
|
+
* @param name 逻辑项名称
|
|
724
|
+
*/
|
|
725
|
+
removeWhere(name: string): void;
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* 删除逻辑项
|
|
729
|
+
* @param where 已有的逻辑项实例
|
|
730
|
+
*/
|
|
731
|
+
removeWhere(where: LogicItem): void;
|
|
732
|
+
|
|
733
|
+
removeWhere(options: string | LogicItem) {
|
|
734
|
+
let where: LogicItem;
|
|
735
|
+
if (typeof options === 'string') {
|
|
736
|
+
where = this.where;
|
|
737
|
+
if (!where) {
|
|
738
|
+
throw new Error(`找不到逻辑项 ${options}`);
|
|
739
|
+
}
|
|
740
|
+
} else {
|
|
741
|
+
where = options;
|
|
388
742
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
743
|
+
return where.delete();
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* 删除逻辑项
|
|
748
|
+
* @param logicItem 已有的逻辑项实例
|
|
749
|
+
*/
|
|
750
|
+
removeItemInWherePlayground(logicItem: LogicItem): void;
|
|
751
|
+
|
|
752
|
+
removeItemInWherePlayground(options: LogicItem) {
|
|
753
|
+
const logicItem: LogicItem = options;
|
|
754
|
+
return logicItem.delete();
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* 删除查询分组
|
|
759
|
+
* @param queryGroupByExpression 已有的查询分组实例
|
|
760
|
+
*/
|
|
761
|
+
removeQueryGroupByExpressionInGroupBy(queryGroupByExpression: QueryGroupByExpression): void;
|
|
762
|
+
|
|
763
|
+
removeQueryGroupByExpressionInGroupBy(options: QueryGroupByExpression) {
|
|
764
|
+
const queryGroupByExpression: QueryGroupByExpression = options;
|
|
765
|
+
return queryGroupByExpression.delete();
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* 删除逻辑项
|
|
770
|
+
* @param name 逻辑项名称
|
|
771
|
+
*/
|
|
772
|
+
removeHaving(name: string): void;
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* 删除逻辑项
|
|
776
|
+
* @param having 已有的逻辑项实例
|
|
777
|
+
*/
|
|
778
|
+
removeHaving(having: LogicItem): void;
|
|
779
|
+
|
|
780
|
+
removeHaving(options: string | LogicItem) {
|
|
781
|
+
let having: LogicItem;
|
|
782
|
+
if (typeof options === 'string') {
|
|
783
|
+
having = this.having;
|
|
784
|
+
if (!having) {
|
|
785
|
+
throw new Error(`找不到逻辑项 ${options}`);
|
|
786
|
+
}
|
|
787
|
+
} else {
|
|
788
|
+
having = options;
|
|
411
789
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
790
|
+
return having.delete();
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* 删除逻辑项
|
|
795
|
+
* @param logicItem 已有的逻辑项实例
|
|
796
|
+
*/
|
|
797
|
+
removeItemInHavingPlayground(logicItem: LogicItem): void;
|
|
798
|
+
|
|
799
|
+
removeItemInHavingPlayground(options: LogicItem) {
|
|
800
|
+
const logicItem: LogicItem = options;
|
|
801
|
+
return logicItem.delete();
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* 删除查询排序子句
|
|
806
|
+
* @param queryOrderByExpression 已有的查询排序子句实例
|
|
807
|
+
*/
|
|
808
|
+
removeQueryOrderByExpressionInOrderBy(queryOrderByExpression: QueryOrderByExpression): void;
|
|
809
|
+
|
|
810
|
+
removeQueryOrderByExpressionInOrderBy(options: QueryOrderByExpression) {
|
|
811
|
+
const queryOrderByExpression: QueryOrderByExpression = options;
|
|
812
|
+
return queryOrderByExpression.delete();
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* 删除查询分页子句
|
|
817
|
+
* @param name 查询分页子句名称
|
|
818
|
+
*/
|
|
819
|
+
removeLimit(name: string): void;
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* 删除查询分页子句
|
|
823
|
+
* @param limit 已有的查询分页子句实例
|
|
824
|
+
*/
|
|
825
|
+
removeLimit(limit: QueryLimitExpression): void;
|
|
826
|
+
|
|
827
|
+
removeLimit(options: string | QueryLimitExpression) {
|
|
828
|
+
let limit: QueryLimitExpression;
|
|
829
|
+
if (typeof options === 'string') {
|
|
830
|
+
limit = this.limit;
|
|
831
|
+
if (!limit) {
|
|
832
|
+
throw new Error(`找不到查询分页子句 ${options}`);
|
|
833
|
+
}
|
|
834
|
+
} else {
|
|
835
|
+
limit = options;
|
|
443
836
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
837
|
+
return limit.delete();
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
__removeLogicItem(logicItem: LogicItem) {
|
|
841
|
+
const { parentKey } = logicItem;
|
|
842
|
+
const params: Params = {
|
|
843
|
+
parentNode: this,
|
|
844
|
+
parentKey,
|
|
845
|
+
index: -1,
|
|
846
|
+
object: null,
|
|
847
|
+
oldObject: logicItem,
|
|
848
|
+
};
|
|
849
|
+
if (parentKey) {
|
|
850
|
+
params.parentKey = parentKey;
|
|
851
|
+
if (Array.isArray((this as any)[parentKey])) {
|
|
852
|
+
const index = (this as any)[parentKey].indexOf(logicItem);
|
|
853
|
+
~index && (this as any)[parentKey].splice(index, 1);
|
|
854
|
+
params.index = index;
|
|
855
|
+
} else if ((this as any)[parentKey] === logicItem) {
|
|
856
|
+
params.index = 0;
|
|
857
|
+
(this as any)[parentKey] = undefined;
|
|
858
|
+
}
|
|
465
859
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
860
|
+
return params;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
//= ===============================================================================
|
|
864
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
865
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
866
|
+
//= ===============================================================================
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* 获取添加时的默认选项
|
|
870
|
+
* @returns
|
|
871
|
+
*/
|
|
872
|
+
public static getDefaultOptions(): any {
|
|
873
|
+
return {
|
|
874
|
+
kind: 'Statement',
|
|
875
|
+
concept: 'CallQueryComponent',
|
|
876
|
+
label: '数据查询',
|
|
877
|
+
select: {
|
|
878
|
+
concept: 'QuerySelectExpression',
|
|
879
|
+
label: '查询组件Select子句',
|
|
880
|
+
distinct: false,
|
|
881
|
+
star: true,
|
|
882
|
+
selectElements: [],
|
|
883
|
+
},
|
|
884
|
+
from: null,
|
|
885
|
+
where: null,
|
|
886
|
+
groupBy: [],
|
|
887
|
+
having: null,
|
|
888
|
+
orderBy: [],
|
|
889
|
+
limit: {
|
|
890
|
+
concept: 'QueryLimitExpression',
|
|
891
|
+
label: '查询组件Limit子句',
|
|
892
|
+
pageElement: {
|
|
893
|
+
concept: 'NumericLiteral',
|
|
894
|
+
value: 1,
|
|
895
|
+
},
|
|
896
|
+
pageSizeElement: {
|
|
897
|
+
concept: 'NumericLiteral',
|
|
898
|
+
value: 1000,
|
|
899
|
+
},
|
|
900
|
+
},
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
toEmbeddedTSOfSubPart<T extends { toEmbeddedTS: (state?: TranslatorState) => string }>(
|
|
905
|
+
key: string,
|
|
906
|
+
list: Array<T>,
|
|
907
|
+
options: {
|
|
908
|
+
code: string;
|
|
909
|
+
state: TranslatorState;
|
|
910
|
+
multipleErrorType?: '__WHERE_MULTIPLE_CONDITION__' | '__HAVING_MULTIPLE_CONDITION__';
|
|
484
911
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
addItemInHavingPlayground(options?: Partial<LogicItem> | LogicItem) {
|
|
499
|
-
const node = this._addItemInHavingPlayground(options as any);
|
|
500
|
-
const index = this.havingPlayground.indexOf(node);
|
|
501
|
-
node.create({
|
|
502
|
-
index,
|
|
503
|
-
parentNode: this,
|
|
504
|
-
parentKey: 'havingPlayground',
|
|
505
|
-
});
|
|
506
|
-
return node;
|
|
912
|
+
) {
|
|
913
|
+
let { code, state, multipleErrorType } = options;
|
|
914
|
+
if (list.length === 0) return code;
|
|
915
|
+
|
|
916
|
+
code += `${indent((state?.tabSize || 0) + 1)}.${key}(() => `;
|
|
917
|
+
list.forEach((item, index) => {
|
|
918
|
+
if (index > 0) code += `,\n${indent((state?.tabSize || 0) + 2)}() => `;
|
|
919
|
+
code += item?.toEmbeddedTS?.(shiftState(state, code, { tabSize: 0 }));
|
|
920
|
+
});
|
|
921
|
+
if (list.length > 1) {
|
|
922
|
+
if (multipleErrorType) code += `,\n${indent((state?.tabSize || 0) + 2)}() => ${multipleErrorType}`;
|
|
923
|
+
code += `\n${indent((state?.tabSize || 0) + 1)}`;
|
|
507
924
|
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
*/
|
|
551
|
-
insertQueryOrderByExpressionInOrderByAt(queryOrderByExpression: QueryOrderByExpression, index: number): QueryOrderByExpression;
|
|
552
|
-
|
|
553
|
-
insertQueryOrderByExpressionInOrderByAt(options: Partial<QueryOrderByExpression> | QueryOrderByExpression, index: number) {
|
|
554
|
-
const node = this._insertQueryOrderByExpressionInOrderByAt(options as any, index);
|
|
555
|
-
node.create({
|
|
556
|
-
index,
|
|
557
|
-
parentNode: this,
|
|
558
|
-
parentKey: 'orderBy',
|
|
559
|
-
});
|
|
560
|
-
return node;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
* 添加查询排序子句
|
|
565
|
-
* @internal
|
|
566
|
-
* @param queryOrderByExpressionOptions 查询排序子句参数
|
|
567
|
-
*/
|
|
568
|
-
_addQueryOrderByExpressionInOrderBy(queryOrderByExpressionOptions: Partial<QueryOrderByExpression>): QueryOrderByExpression;
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* 添加查询排序子句
|
|
572
|
-
* @internal
|
|
573
|
-
* @param queryOrderByExpression 已有的查询排序子句实例
|
|
574
|
-
*/
|
|
575
|
-
_addQueryOrderByExpressionInOrderBy(queryOrderByExpression: QueryOrderByExpression): QueryOrderByExpression;
|
|
576
|
-
|
|
577
|
-
_addQueryOrderByExpressionInOrderBy(options?: Partial<QueryOrderByExpression> | QueryOrderByExpression) {
|
|
578
|
-
const index = this.orderBy.length;
|
|
579
|
-
return this._insertQueryOrderByExpressionInOrderByAt(options as any, index);
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* 添加查询排序子句
|
|
584
|
-
* @param queryOrderByExpressionOptions 查询排序子句参数
|
|
585
|
-
*/
|
|
586
|
-
addQueryOrderByExpressionInOrderBy(queryOrderByExpressionOptions: Partial<QueryOrderByExpression>): QueryOrderByExpression;
|
|
587
|
-
|
|
588
|
-
/**
|
|
589
|
-
* 添加查询排序子句
|
|
590
|
-
* @param queryOrderByExpression 已有的查询排序子句实例
|
|
591
|
-
*/
|
|
592
|
-
addQueryOrderByExpressionInOrderBy(queryOrderByExpression: QueryOrderByExpression): QueryOrderByExpression;
|
|
593
|
-
|
|
594
|
-
addQueryOrderByExpressionInOrderBy(options?: Partial<QueryOrderByExpression> | QueryOrderByExpression) {
|
|
595
|
-
const node = this._addQueryOrderByExpressionInOrderBy(options as any);
|
|
596
|
-
const index = this.orderBy.indexOf(node);
|
|
597
|
-
node.create({
|
|
598
|
-
index,
|
|
599
|
-
parentNode: this,
|
|
600
|
-
parentKey: 'orderBy',
|
|
601
|
-
});
|
|
602
|
-
return node;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* 删除类型标注
|
|
607
|
-
* @param name 类型标注名称
|
|
608
|
-
*/
|
|
609
|
-
removeTypeAnnotation(name: string): void;
|
|
610
|
-
|
|
611
|
-
/**
|
|
612
|
-
* 删除类型标注
|
|
613
|
-
* @param typeAnnotation 已有的类型标注实例
|
|
614
|
-
*/
|
|
615
|
-
removeTypeAnnotation(typeAnnotation: TypeAnnotation): void;
|
|
616
|
-
|
|
617
|
-
removeTypeAnnotation(options: string | TypeAnnotation) {
|
|
618
|
-
let typeAnnotation: TypeAnnotation;
|
|
619
|
-
if (typeof options === 'string') {
|
|
620
|
-
typeAnnotation = this.typeAnnotation;
|
|
621
|
-
if (!typeAnnotation) {
|
|
622
|
-
throw new Error('找不到类型标注 ' + options);
|
|
623
|
-
}
|
|
624
|
-
} else {
|
|
625
|
-
typeAnnotation = options;
|
|
626
|
-
}
|
|
627
|
-
return typeAnnotation.delete();
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
__removeTypeAnnotation(typeAnnotation: TypeAnnotation) {
|
|
631
|
-
const parentKey = typeAnnotation.parentKey;
|
|
632
|
-
const params: Params = {
|
|
633
|
-
parentNode: this,
|
|
634
|
-
parentKey,
|
|
635
|
-
index: -1,
|
|
636
|
-
object: null,
|
|
637
|
-
oldObject: typeAnnotation,
|
|
638
|
-
};
|
|
639
|
-
if (parentKey) {
|
|
640
|
-
params.parentKey = parentKey;
|
|
641
|
-
if (Array.isArray((this as any)[parentKey])) {
|
|
642
|
-
const index = (this as any)[parentKey].indexOf(typeAnnotation);
|
|
643
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
644
|
-
params.index = index;
|
|
645
|
-
} else if ((this as any)[parentKey] === typeAnnotation) {
|
|
646
|
-
params.index = 0;
|
|
647
|
-
(this as any)[parentKey] = undefined;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
return params;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* 删除查询选择子句
|
|
655
|
-
* @param name 查询选择子句名称
|
|
656
|
-
*/
|
|
657
|
-
removeSelect(name: string): void;
|
|
658
|
-
|
|
659
|
-
/**
|
|
660
|
-
* 删除查询选择子句
|
|
661
|
-
* @param select 已有的查询选择子句实例
|
|
662
|
-
*/
|
|
663
|
-
removeSelect(select: QuerySelectExpression): void;
|
|
664
|
-
|
|
665
|
-
removeSelect(options: string | QuerySelectExpression) {
|
|
666
|
-
let select: QuerySelectExpression;
|
|
667
|
-
if (typeof options === 'string') {
|
|
668
|
-
select = this.select;
|
|
669
|
-
if (!select) {
|
|
670
|
-
throw new Error('找不到查询选择子句 ' + options);
|
|
671
|
-
}
|
|
672
|
-
} else {
|
|
673
|
-
select = options;
|
|
674
|
-
}
|
|
675
|
-
return select.delete();
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* 删除查询 From 子句
|
|
680
|
-
* @param name 查询 From 子句名称
|
|
681
|
-
*/
|
|
682
|
-
removeFrom(name: string): void;
|
|
683
|
-
|
|
684
|
-
/**
|
|
685
|
-
* 删除查询 From 子句
|
|
686
|
-
* @param from 已有的查询 From 子句实例
|
|
687
|
-
*/
|
|
688
|
-
removeFrom(from: QueryFromExpression): void;
|
|
689
|
-
|
|
690
|
-
removeFrom(options: string | QueryFromExpression) {
|
|
691
|
-
let from: QueryFromExpression;
|
|
692
|
-
if (typeof options === 'string') {
|
|
693
|
-
from = this.from;
|
|
694
|
-
if (!from) {
|
|
695
|
-
throw new Error('找不到查询 From 子句 ' + options);
|
|
696
|
-
}
|
|
697
|
-
} else {
|
|
698
|
-
from = options;
|
|
699
|
-
}
|
|
700
|
-
return from.delete();
|
|
925
|
+
code += ')\n';
|
|
926
|
+
|
|
927
|
+
return code;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
toJS() {
|
|
931
|
+
return '';
|
|
932
|
+
// const { entityName } = this.from;
|
|
933
|
+
// return `await this.$services["_custom"]["load${entityName}"]({
|
|
934
|
+
// config: {
|
|
935
|
+
// download: false,
|
|
936
|
+
// },
|
|
937
|
+
// path: {},
|
|
938
|
+
// query: {},
|
|
939
|
+
// headers: {},
|
|
940
|
+
// body: {
|
|
941
|
+
// },
|
|
942
|
+
// })`;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// 2.11版本,自动推断返回类型
|
|
946
|
+
isAutoInfer() {
|
|
947
|
+
return this.ideVersion === '2.11' || this.ideVersion === '2.22';
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
// 2.22版本,实体支持列筛选 2.11版本不支持列筛选,需要运维select.selectElements
|
|
951
|
+
get entityPropertySelectable() {
|
|
952
|
+
return this.ideVersion === '2.22';
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
@withSourceMap()
|
|
956
|
+
toEmbeddedTS(state?: TranslatorState): string {
|
|
957
|
+
if (!this.typeAnnotation)
|
|
958
|
+
return `(function () {
|
|
959
|
+
return;
|
|
960
|
+
})()`;
|
|
961
|
+
let code = `(function(): `;
|
|
962
|
+
if (this.isAutoInfer()) {
|
|
963
|
+
code += `${this.typeAnnotation.toEmbeddedTS(shiftState(state, code))} {\n`;
|
|
964
|
+
} else {
|
|
965
|
+
code += `{ list: nasl.collection.List<`;
|
|
966
|
+
code += `${this.typeAnnotation.toEmbeddedTS(shiftState(state, code))}>, total: nasl.core.Long } {\n`;
|
|
701
967
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
let where: LogicItem;
|
|
717
|
-
if (typeof options === 'string') {
|
|
718
|
-
where = this.where;
|
|
719
|
-
if (!where) {
|
|
720
|
-
throw new Error('找不到逻辑项 ' + options);
|
|
721
|
-
}
|
|
722
|
-
} else {
|
|
723
|
-
where = options;
|
|
724
|
-
}
|
|
725
|
-
return where.delete();
|
|
968
|
+
// 2.11版本后 分组使用别名
|
|
969
|
+
if (this.isAutoInfer()) {
|
|
970
|
+
// 分组别名(列别名)
|
|
971
|
+
this.groupBy.forEach((item, index, array) => {
|
|
972
|
+
code += indent(state.tabSize + 1);
|
|
973
|
+
const groupElement = item.groupElement as QueryFieldExpression;
|
|
974
|
+
if (groupElement.asName) code += `const __${groupElement.asName} = `;
|
|
975
|
+
if (groupElement.propertyName) {
|
|
976
|
+
code += groupElement.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
977
|
+
code += ';\n';
|
|
978
|
+
} else code += `__EMPTY_GROUP_BY_NAME__;\n`;
|
|
979
|
+
|
|
980
|
+
if (index === array.length - 1) code += '\n';
|
|
981
|
+
});
|
|
726
982
|
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
983
|
+
// 聚合属性别名
|
|
984
|
+
this.select.selectAggregateElements.forEach((item, index, array) => {
|
|
985
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
986
|
+
const { asName, aggregateName, aggregateParam } = item;
|
|
987
|
+
if (asName) code += `const __${asName} = `;
|
|
988
|
+
if (aggregateName) {
|
|
989
|
+
code += `nasl.langUtil.${aggregateName}(`;
|
|
990
|
+
code += aggregateParam.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
991
|
+
code += ');\n';
|
|
992
|
+
} else code += `__EMPTY_AGGREGATE_NAME__;\n`;
|
|
993
|
+
|
|
994
|
+
if (index === array.length - 1) code += '\n';
|
|
995
|
+
});
|
|
996
|
+
|
|
997
|
+
if (this.from) code += this.from.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
998
|
+
else code += `${indent((state?.tabSize || 0) + 1)}nasl.langUtil.FROM()\n`;
|
|
999
|
+
|
|
1000
|
+
// where 子句
|
|
1001
|
+
code = this.toEmbeddedTSOfSubPart('WHERE', this.where ? [this.where] : [], {
|
|
1002
|
+
code,
|
|
1003
|
+
state,
|
|
1004
|
+
multipleErrorType: '__WHERE_MULTIPLE_CONDITION__',
|
|
1005
|
+
});
|
|
1006
|
+
|
|
1007
|
+
if (this.select.selectAggregateElements.length) {
|
|
1008
|
+
// 聚合属性
|
|
1009
|
+
code = this.toEmbeddedTSOfSubPart('SELECT', this.select.selectAggregateElements, {
|
|
1010
|
+
code,
|
|
1011
|
+
state,
|
|
1012
|
+
});
|
|
1013
|
+
} else {
|
|
1014
|
+
// select实体字段
|
|
1015
|
+
code = this.toEmbeddedTSOfSubPart('SELECT', this.select.selectFieldElements, {
|
|
1016
|
+
code,
|
|
1017
|
+
state,
|
|
1018
|
+
});
|
|
737
1019
|
}
|
|
738
1020
|
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
1021
|
+
// 分组属性(Group by)
|
|
1022
|
+
code = this.toEmbeddedTSOfSubPart('GROUP_BY', this.groupBy, {
|
|
1023
|
+
code,
|
|
1024
|
+
state,
|
|
1025
|
+
});
|
|
1026
|
+
|
|
1027
|
+
// 聚合属性过滤(Having)
|
|
1028
|
+
code = this.toEmbeddedTSOfSubPart('HAVING', this.having ? [this.having] : [], {
|
|
1029
|
+
code,
|
|
1030
|
+
state,
|
|
1031
|
+
multipleErrorType: '__HAVING_MULTIPLE_CONDITION__',
|
|
1032
|
+
});
|
|
1033
|
+
|
|
1034
|
+
// 排序规则
|
|
1035
|
+
code = this.toEmbeddedTSOfSubPart('ORDER_BY', this.orderBy, {
|
|
1036
|
+
code,
|
|
1037
|
+
state,
|
|
1038
|
+
});
|
|
1039
|
+
|
|
1040
|
+
// 分页参数
|
|
1041
|
+
code = this.toEmbeddedTSOfSubPart('LIMIT', this.limit ? [this.limit] : [], {
|
|
1042
|
+
code,
|
|
1043
|
+
state,
|
|
1044
|
+
});
|
|
1045
|
+
|
|
1046
|
+
code += '\n';
|
|
1047
|
+
code += `${indent((state?.tabSize || 0) + 1)}return;\n`;
|
|
1048
|
+
code += `${indent(state?.tabSize || 0)}})()`;
|
|
1049
|
+
if (
|
|
1050
|
+
this.parentNode.concept !== 'Argument' &&
|
|
1051
|
+
this.parentKey !== 'test' &&
|
|
1052
|
+
this.parentKey !== 'patterns' &&
|
|
1053
|
+
this.parentNode.concept !== 'Assignment' &&
|
|
1054
|
+
this.parentNode.concept !== 'ForEachStatement' &&
|
|
1055
|
+
this.parentNode.concept !== 'SelectMembers' &&
|
|
1056
|
+
this.parentNode.concept !== 'UnaryExpression' &&
|
|
1057
|
+
this.parentNode.concept !== 'BinaryExpression' &&
|
|
1058
|
+
this.parentNode.concept !== 'StringInterpolation' &&
|
|
1059
|
+
this.parentNode.concept !== 'MemberExpression' &&
|
|
1060
|
+
['NewMap', 'NewList'].includes(this.parentNode.concept) &&
|
|
1061
|
+
this.parentKey !== 'returnExpression'
|
|
1062
|
+
) {
|
|
1063
|
+
code += ';';
|
|
748
1064
|
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
1065
|
+
code += '\n';
|
|
1066
|
+
return code;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
genPropertiesFrom(node: QueryFromExpression | QueryJoinExpression, properties: StructureProperty[] = []) {
|
|
1070
|
+
if (!node) return [];
|
|
1071
|
+
|
|
1072
|
+
const { entityName } = node;
|
|
1073
|
+
const { entityNamespace } = node;
|
|
1074
|
+
// 生成整个实体类型 { entity1: Entity1 } 在2.11属于默认情况;在2.22勾选实体节点(isDotStar=true)时
|
|
1075
|
+
if (!this.entityPropertySelectable || this.select.selectFieldElements.some((item) => item.entityAsName === entityName && item.isDotStar)) {
|
|
1076
|
+
properties.push(
|
|
1077
|
+
StructureProperty.from({
|
|
1078
|
+
name: utils.firstLowerCase(entityName),
|
|
1079
|
+
typeAnnotation: TypeAnnotation.from({
|
|
1080
|
+
concept: 'TypeAnnotation',
|
|
1081
|
+
typeKind: 'reference',
|
|
1082
|
+
typeName: entityName,
|
|
1083
|
+
typeNamespace: entityNamespace,
|
|
1084
|
+
}),
|
|
1085
|
+
})
|
|
1086
|
+
);
|
|
1087
|
+
} else if (this.select.selectFieldElements.some((item) => item.entityAsName === entityName && item.propertyName)) {
|
|
1088
|
+
// 2.22 选择字段时,生成选择字段的匿名数据结构 { entity1: { prop1, prop2 } }
|
|
1089
|
+
const entity: Entity = this.app.findNodeByCompleteName(`${entityNamespace}.${entityName}`);
|
|
1090
|
+
entity &&
|
|
1091
|
+
properties.push(
|
|
1092
|
+
StructureProperty.from({
|
|
1093
|
+
name: utils.firstLowerCase(entityName),
|
|
1094
|
+
typeAnnotation: TypeAnnotation.from({
|
|
1095
|
+
concept: 'TypeAnnotation',
|
|
1096
|
+
typeKind: 'anonymousStructure',
|
|
1097
|
+
properties: this.select.selectFieldElements
|
|
1098
|
+
.filter((sel) => sel.entityAsName === entityName && sel.propertyName)
|
|
1099
|
+
.map((item) => {
|
|
1100
|
+
const property = entity.properties.find((prop) => prop.name === item.propertyName);
|
|
1101
|
+
return (
|
|
1102
|
+
property &&
|
|
1103
|
+
StructureProperty.from({
|
|
1104
|
+
name: item.propertyName,
|
|
1105
|
+
typeAnnotation: TypeAnnotation.from(property.typeAnnotation),
|
|
1106
|
+
})
|
|
1107
|
+
);
|
|
1108
|
+
})
|
|
1109
|
+
.filter(Boolean),
|
|
1110
|
+
}),
|
|
1111
|
+
})
|
|
1112
|
+
);
|
|
1113
|
+
} else {
|
|
1114
|
+
/* 实体或属性都不选择时,不生成数据结构 */
|
|
773
1115
|
}
|
|
774
1116
|
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
* @param logicItem 已有的逻辑项实例
|
|
778
|
-
*/
|
|
779
|
-
removeItemInHavingPlayground(logicItem: LogicItem): void;
|
|
780
|
-
|
|
781
|
-
removeItemInHavingPlayground(options: LogicItem) {
|
|
782
|
-
const logicItem: LogicItem = options;
|
|
783
|
-
return logicItem.delete();
|
|
1117
|
+
for (const sub of node.joinParts) {
|
|
1118
|
+
this.genPropertiesFrom(sub, properties);
|
|
784
1119
|
}
|
|
785
1120
|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
1121
|
+
return properties;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
genPropertyListOfFrom(node: QueryFromExpression | QueryJoinExpression, entities: any[] = []) {
|
|
1125
|
+
if (!node) return [];
|
|
1126
|
+
|
|
1127
|
+
const { entityName } = node;
|
|
1128
|
+
const { entityNamespace } = node;
|
|
1129
|
+
entities.push({
|
|
1130
|
+
concept: 'StructureProperty',
|
|
1131
|
+
name: utils.firstLowerCase(entityName),
|
|
1132
|
+
typeAnnotation: {
|
|
1133
|
+
concept: 'TypeAnnotation',
|
|
1134
|
+
typeKind: 'reference',
|
|
1135
|
+
typeName: entityName,
|
|
1136
|
+
typeNamespace: entityNamespace,
|
|
1137
|
+
},
|
|
1138
|
+
});
|
|
1139
|
+
|
|
1140
|
+
for (const sub of node.joinParts) {
|
|
1141
|
+
this.genPropertyListOfFrom(sub, entities);
|
|
795
1142
|
}
|
|
796
1143
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
1144
|
+
return entities;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
genPropertyListOfAggregate(node: CallQueryComponent, entities: Entity[]) {
|
|
1148
|
+
return node.select.selectAggregateElements
|
|
1149
|
+
.filter((item) => item.aggregateName && item.asName)
|
|
1150
|
+
.map((item) => {
|
|
1151
|
+
let typeName;
|
|
1152
|
+
if (['COUNT', 'COUNTD'].includes(item.aggregateName)) {
|
|
1153
|
+
typeName = 'Long';
|
|
1154
|
+
} else if (['AVG'].includes(item.aggregateName)) {
|
|
1155
|
+
const { entityAsName, propertyName } = item.aggregateParam;
|
|
1156
|
+
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1157
|
+
const property = entity?.properties.find((item: any) => item.name === propertyName);
|
|
1158
|
+
const propertyTypeName = property?.typeAnnotation?.typeName;
|
|
1159
|
+
if (propertyTypeName === 'Decimal') {
|
|
1160
|
+
typeName = 'Decimal';
|
|
1161
|
+
} else {
|
|
1162
|
+
typeName = 'Decimal';
|
|
1163
|
+
}
|
|
816
1164
|
} else {
|
|
817
|
-
|
|
1165
|
+
const { entityAsName, propertyName } = item.aggregateParam;
|
|
1166
|
+
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1167
|
+
const property = entity?.properties.find((item) => item.name === propertyName);
|
|
1168
|
+
typeName = property?.typeAnnotation?.typeName;
|
|
818
1169
|
}
|
|
819
|
-
return
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
object: null,
|
|
829
|
-
oldObject: logicItem,
|
|
1170
|
+
return {
|
|
1171
|
+
concept: 'StructureProperty',
|
|
1172
|
+
name: item.asName,
|
|
1173
|
+
typeAnnotation: {
|
|
1174
|
+
concept: 'TypeAnnotation',
|
|
1175
|
+
typeKind: 'primitive',
|
|
1176
|
+
typeNamespace: 'nasl.core',
|
|
1177
|
+
typeName,
|
|
1178
|
+
},
|
|
830
1179
|
};
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
//================================================================================
|
|
846
|
-
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
847
|
-
// 自动生成的代码已结束。下面可以手动编写。
|
|
848
|
-
//================================================================================
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
genPropertyListOfGroupBy(node: CallQueryComponent, entities: Entity[]) {
|
|
1184
|
+
return node.groupBy
|
|
1185
|
+
.filter(
|
|
1186
|
+
(item) => item.groupElement && (item.groupElement as QueryFieldExpression).propertyName && (item.groupElement as QueryFieldExpression).asName
|
|
1187
|
+
)
|
|
1188
|
+
.map((item) => {
|
|
1189
|
+
const { entityAsName, propertyName, asName } = item.groupElement as QueryFieldExpression;
|
|
1190
|
+
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1191
|
+
const property = entity?.properties.find((item) => item.name === propertyName);
|
|
1192
|
+
const propertyTypeAnnotation = property?.typeAnnotation;
|
|
849
1193
|
|
|
850
|
-
/**
|
|
851
|
-
* 获取添加时的默认选项
|
|
852
|
-
* @returns
|
|
853
|
-
*/
|
|
854
|
-
public static getDefaultOptions(): any {
|
|
855
1194
|
return {
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
selectElements: [],
|
|
865
|
-
},
|
|
866
|
-
from: null,
|
|
867
|
-
where: null,
|
|
868
|
-
groupBy: [],
|
|
869
|
-
having: null,
|
|
870
|
-
orderBy: [],
|
|
871
|
-
limit: {
|
|
872
|
-
concept: 'QueryLimitExpression',
|
|
873
|
-
label: '查询组件Limit子句',
|
|
874
|
-
pageElement: {
|
|
875
|
-
concept: 'NumericLiteral',
|
|
876
|
-
value: 1,
|
|
877
|
-
},
|
|
878
|
-
pageSizeElement: {
|
|
879
|
-
concept: 'NumericLiteral',
|
|
880
|
-
value: 1000,
|
|
881
|
-
},
|
|
882
|
-
},
|
|
1195
|
+
concept: 'StructureProperty',
|
|
1196
|
+
name: asName,
|
|
1197
|
+
typeAnnotation: {
|
|
1198
|
+
concept: propertyTypeAnnotation.concept,
|
|
1199
|
+
typeKind: propertyTypeAnnotation.typeKind,
|
|
1200
|
+
typeName: propertyTypeAnnotation.typeName,
|
|
1201
|
+
typeNamespace: propertyTypeAnnotation.typeNamespace,
|
|
1202
|
+
},
|
|
883
1203
|
};
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
genStructure(structureName?: string, properties: any[] = []) {
|
|
1208
|
+
const logic = this.logic || this.AuthLogic || this.AuthLogicForCallInterface;
|
|
1209
|
+
return Structure.from({
|
|
1210
|
+
concept: 'Structure',
|
|
1211
|
+
name: structureName || this.typeAnnotation?.typeName || `${utils.firstUpperCase(logic.name)}Structure`,
|
|
1212
|
+
origin: 'CallQueryComponent',
|
|
1213
|
+
properties,
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
saveStructure() {
|
|
1218
|
+
// 没有数据源时不初始化数据结构
|
|
1219
|
+
if (!this.entityInfos.length) {
|
|
1220
|
+
return;
|
|
884
1221
|
}
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
code: string;
|
|
891
|
-
state: TranslatorState;
|
|
892
|
-
multipleErrorType?: '__WHERE_MULTIPLE_CONDITION__' | '__HAVING_MULTIPLE_CONDITION__';
|
|
893
|
-
}) {
|
|
894
|
-
let { code, state, multipleErrorType } = options;
|
|
895
|
-
if (list.length === 0)
|
|
896
|
-
return code;
|
|
897
|
-
|
|
898
|
-
code += indent((state?.tabSize || 0) + 1) + `.${key}(() => `;
|
|
899
|
-
list.forEach((item, index) => {
|
|
900
|
-
if (index > 0)
|
|
901
|
-
code += `,\n${indent((state?.tabSize || 0) + 2)}() => `;
|
|
902
|
-
code += item?.toEmbeddedTS?.(shiftState(state, code, { tabSize: 0 }));
|
|
903
|
-
});
|
|
904
|
-
if (list.length > 1) {
|
|
905
|
-
if (multipleErrorType)
|
|
906
|
-
code += `,\n${indent((state?.tabSize || 0) + 2)}() => ${multipleErrorType}`;
|
|
907
|
-
code += `\n${indent((state?.tabSize || 0) + 1)}`;
|
|
908
|
-
}
|
|
909
|
-
code += ')\n';
|
|
910
|
-
|
|
911
|
-
return code;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
toJS() {
|
|
915
|
-
return '';
|
|
916
|
-
// const { entityName } = this.from;
|
|
917
|
-
// return `await this.$services["_custom"]["load${entityName}"]({
|
|
918
|
-
// config: {
|
|
919
|
-
// download: false,
|
|
920
|
-
// },
|
|
921
|
-
// path: {},
|
|
922
|
-
// query: {},
|
|
923
|
-
// headers: {},
|
|
924
|
-
// body: {
|
|
925
|
-
// },
|
|
926
|
-
// })`;
|
|
1222
|
+
const entityNamespace = this.from?.entityNamespace;
|
|
1223
|
+
const entities = this.app.findNodeByCompleteName(entityNamespace);
|
|
1224
|
+
if (!this.isAutoInfer()) {
|
|
1225
|
+
// 存量应用走之前的逻辑
|
|
1226
|
+
return this.saveStructureNoInfer(entities);
|
|
927
1227
|
}
|
|
928
1228
|
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
if (this.isAutoInfer()) {
|
|
946
|
-
code += `${this.typeAnnotation.toEmbeddedTS(shiftState(state, code))} {\n`;
|
|
947
|
-
} else {
|
|
948
|
-
code += `{ list: nasl.collection.List<`;
|
|
949
|
-
code += `${this.typeAnnotation.toEmbeddedTS(shiftState(state, code))}>, total: nasl.core.Long } {\n`;
|
|
950
|
-
}
|
|
951
|
-
// 2.11版本后 分组使用别名
|
|
952
|
-
if (this.isAutoInfer()) {
|
|
953
|
-
// 分组别名(列别名)
|
|
954
|
-
this.groupBy.forEach((item, index, array) => {
|
|
955
|
-
code += indent(state.tabSize + 1);
|
|
956
|
-
const groupElement = item.groupElement as QueryFieldExpression;
|
|
957
|
-
if (groupElement.asName)
|
|
958
|
-
code += `const __${groupElement.asName} = `;
|
|
959
|
-
if (groupElement.propertyName) {
|
|
960
|
-
code += groupElement.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
961
|
-
code += ';\n';
|
|
962
|
-
} else
|
|
963
|
-
code += `__EMPTY_GROUP_BY_NAME__;\n`;
|
|
964
|
-
|
|
965
|
-
if (index === array.length - 1)
|
|
966
|
-
code += '\n';
|
|
967
|
-
});
|
|
968
|
-
}
|
|
969
|
-
// 聚合属性别名
|
|
970
|
-
this.select.selectAggregateElements.forEach((item, index, array) => {
|
|
971
|
-
code += indent((state?.tabSize || 0) + 1);
|
|
972
|
-
const { asName, aggregateName, aggregateParam } = item;
|
|
973
|
-
if (asName)
|
|
974
|
-
code += `const __${asName} = `;
|
|
975
|
-
if (aggregateName) {
|
|
976
|
-
code += `nasl.langUtil.${aggregateName}(`;
|
|
977
|
-
code += aggregateParam.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
978
|
-
code += ');\n';
|
|
979
|
-
} else
|
|
980
|
-
code += `__EMPTY_AGGREGATE_NAME__;\n`;
|
|
981
|
-
|
|
982
|
-
if (index === array.length - 1)
|
|
983
|
-
code += '\n';
|
|
984
|
-
});
|
|
985
|
-
|
|
986
|
-
if (this.from)
|
|
987
|
-
code += this.from.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
988
|
-
else
|
|
989
|
-
code += `${indent((state?.tabSize || 0) + 1)}nasl.langUtil.FROM()\n`;
|
|
990
|
-
|
|
991
|
-
// where 子句
|
|
992
|
-
code = this.toEmbeddedTSOfSubPart('WHERE', this.where ? [this.where] : [], {
|
|
993
|
-
code,
|
|
994
|
-
state,
|
|
995
|
-
multipleErrorType: '__WHERE_MULTIPLE_CONDITION__',
|
|
996
|
-
});
|
|
997
|
-
|
|
998
|
-
if (this.select.selectAggregateElements.length) {
|
|
999
|
-
// 聚合属性
|
|
1000
|
-
code = this.toEmbeddedTSOfSubPart('SELECT', this.select.selectAggregateElements, {
|
|
1001
|
-
code,
|
|
1002
|
-
state,
|
|
1003
|
-
});
|
|
1004
|
-
} else {
|
|
1005
|
-
// select实体字段
|
|
1006
|
-
code = this.toEmbeddedTSOfSubPart('SELECT', this.select.selectFieldElements, {
|
|
1007
|
-
code,
|
|
1008
|
-
state,
|
|
1009
|
-
});
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
// 分组属性(Group by)
|
|
1013
|
-
code = this.toEmbeddedTSOfSubPart('GROUP_BY', this.groupBy, {
|
|
1014
|
-
code,
|
|
1015
|
-
state,
|
|
1016
|
-
});
|
|
1017
|
-
|
|
1018
|
-
// 聚合属性过滤(Having)
|
|
1019
|
-
code = this.toEmbeddedTSOfSubPart('HAVING', this.having ? [this.having] : [], {
|
|
1020
|
-
code,
|
|
1021
|
-
state,
|
|
1022
|
-
multipleErrorType: '__HAVING_MULTIPLE_CONDITION__',
|
|
1023
|
-
});
|
|
1024
|
-
|
|
1025
|
-
// 排序规则
|
|
1026
|
-
code = this.toEmbeddedTSOfSubPart('ORDER_BY', this.orderBy, {
|
|
1027
|
-
code,
|
|
1028
|
-
state,
|
|
1029
|
-
});
|
|
1030
|
-
|
|
1031
|
-
// 分页参数
|
|
1032
|
-
code = this.toEmbeddedTSOfSubPart('LIMIT', this.limit ? [this.limit] : [], {
|
|
1033
|
-
code,
|
|
1034
|
-
state,
|
|
1035
|
-
});
|
|
1036
|
-
|
|
1037
|
-
code += '\n';
|
|
1038
|
-
code += indent((state?.tabSize || 0) + 1) + 'return;\n';
|
|
1039
|
-
code += indent((state?.tabSize || 0)) + '})()';
|
|
1040
|
-
if (this.parentNode.concept !== 'Argument'
|
|
1041
|
-
&& this.parentKey !== 'test'
|
|
1042
|
-
&& this.parentKey !== 'patterns'
|
|
1043
|
-
&& this.parentNode.concept !== 'Assignment'
|
|
1044
|
-
&& this.parentNode.concept !== 'ForEachStatement'
|
|
1045
|
-
&& this.parentNode.concept !== 'SelectMembers'
|
|
1046
|
-
&& this.parentNode.concept !== 'UnaryExpression'
|
|
1047
|
-
&& this.parentNode.concept !== 'BinaryExpression'
|
|
1048
|
-
&& this.parentNode.concept !== 'StringInterpolation'
|
|
1049
|
-
&& this.parentNode.concept !== 'MemberExpression'
|
|
1050
|
-
&& ['NewMap', 'NewList'].includes(this.parentNode.concept)
|
|
1051
|
-
&& this.parentKey !== 'returnExpression') {
|
|
1052
|
-
code += ';';
|
|
1229
|
+
const { groupBy } = this;
|
|
1230
|
+
const selectElements = this.select.selectAggregateElements;
|
|
1231
|
+
let structureName;
|
|
1232
|
+
let typeAnnotation;
|
|
1233
|
+
|
|
1234
|
+
// remove structure
|
|
1235
|
+
if (this.typeAnnotation) {
|
|
1236
|
+
const { typeNamespace, typeName, typeArguments } = this.typeAnnotation;
|
|
1237
|
+
if (typeNamespace === 'app.structures') {
|
|
1238
|
+
structureName = typeName;
|
|
1239
|
+
this.removeStructure(structureName);
|
|
1240
|
+
} else if (typeNamespace === 'nasl.collection' && typeName === 'PageOf') {
|
|
1241
|
+
// PageOf<Structures>
|
|
1242
|
+
if (typeArguments[0].typeNamespace === 'app.structures') {
|
|
1243
|
+
structureName = typeArguments[0].typeName;
|
|
1244
|
+
this.removeStructure(structureName);
|
|
1053
1245
|
}
|
|
1054
|
-
|
|
1055
|
-
return code;
|
|
1246
|
+
}
|
|
1056
1247
|
}
|
|
1057
1248
|
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1249
|
+
const logic = this.logic || this.AuthLogic || this.AuthLogicForCallInterface || this.OverriddenLogic;
|
|
1250
|
+
structureName = structureName || utils.unique(`${utils.firstUpperCase(logic?.name)}Structure`, this.app.getStructureExistingNames());
|
|
1251
|
+
const groupByLength = groupBy.filter(
|
|
1252
|
+
(item) => (item.groupElement as QueryFieldExpression)?.propertyName && (item.groupElement as QueryFieldExpression).asName
|
|
1253
|
+
).length;
|
|
1254
|
+
const aggregateLength = selectElements.filter((item) => item.aggregateName && item.asName).length;
|
|
1255
|
+
|
|
1256
|
+
// 1. 有分组
|
|
1257
|
+
if (groupByLength) {
|
|
1258
|
+
if (!aggregateLength && groupByLength === 1) {
|
|
1259
|
+
// 1.1 单分组无聚合:`{ list: List<列的类型>, total: Long }`
|
|
1260
|
+
const { entityAsName, propertyName } = groupBy[0].groupElement as QueryFieldExpression;
|
|
1261
|
+
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1262
|
+
const property = entity?.properties.find((item: any) => item.name === propertyName);
|
|
1263
|
+
const propertyTypeAnnotation = property.typeAnnotation;
|
|
1264
|
+
|
|
1265
|
+
typeAnnotation = TypeAnnotation.from(
|
|
1266
|
+
{
|
|
1267
|
+
concept: 'TypeAnnotation',
|
|
1268
|
+
typeKind: 'anonymousStructure',
|
|
1269
|
+
properties: [
|
|
1270
|
+
StructureProperty.from({
|
|
1271
|
+
name: 'list',
|
|
1272
|
+
typeAnnotation: TypeAnnotation.from(
|
|
1273
|
+
{
|
|
1069
1274
|
concept: 'TypeAnnotation',
|
|
1070
|
-
typeKind: '
|
|
1071
|
-
typeName:
|
|
1072
|
-
typeNamespace:
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
} else if (this.select.selectFieldElements.some((item) => item.entityAsName === entityName && item.propertyName)) {
|
|
1076
|
-
// 2.22 选择字段时,生成选择字段的匿名数据结构 { entity1: { prop1, prop2 } }
|
|
1077
|
-
const entity: Entity = this.app.findNodeByCompleteName(entityNamespace + '.' + entityName);
|
|
1078
|
-
entity && properties.push(StructureProperty.from({
|
|
1079
|
-
name: utils.firstLowerCase(entityName),
|
|
1080
|
-
typeAnnotation: TypeAnnotation.from({
|
|
1081
|
-
concept: 'TypeAnnotation',
|
|
1082
|
-
typeKind: 'anonymousStructure',
|
|
1083
|
-
properties: this.select.selectFieldElements
|
|
1084
|
-
.filter((sel) => sel.entityAsName === entityName && sel.propertyName)
|
|
1085
|
-
.map((item) => {
|
|
1086
|
-
const property = entity.properties.find((prop) => prop.name === item.propertyName);
|
|
1087
|
-
return property && StructureProperty.from({
|
|
1088
|
-
name: item.propertyName,
|
|
1089
|
-
typeAnnotation: TypeAnnotation.from(property.typeAnnotation),
|
|
1090
|
-
});
|
|
1091
|
-
}).filter(Boolean),
|
|
1092
|
-
}),
|
|
1093
|
-
}));
|
|
1094
|
-
} else { /* 实体或属性都不选择时,不生成数据结构 */ }
|
|
1095
|
-
|
|
1096
|
-
for (const sub of node.joinParts) {
|
|
1097
|
-
this.genPropertiesFrom(sub, properties);
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
return properties;
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
genPropertyListOfFrom(node: QueryFromExpression | QueryJoinExpression, entities: any[] = []) {
|
|
1104
|
-
if (!node)
|
|
1105
|
-
return [];
|
|
1106
|
-
|
|
1107
|
-
const entityName = node.entityName;
|
|
1108
|
-
const entityNamespace = node.entityNamespace;
|
|
1109
|
-
entities.push({
|
|
1110
|
-
concept: 'StructureProperty',
|
|
1111
|
-
name: utils.firstLowerCase(entityName),
|
|
1112
|
-
typeAnnotation: {
|
|
1113
|
-
concept: 'TypeAnnotation',
|
|
1114
|
-
typeKind: 'reference',
|
|
1115
|
-
typeName: entityName,
|
|
1116
|
-
typeNamespace: entityNamespace,
|
|
1117
|
-
},
|
|
1118
|
-
});
|
|
1119
|
-
|
|
1120
|
-
for (const sub of node.joinParts) {
|
|
1121
|
-
this.genPropertyListOfFrom(sub, entities);
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
return entities;
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
genPropertyListOfAggregate(node: CallQueryComponent, entities: Entity[]) {
|
|
1128
|
-
return node.select.selectAggregateElements
|
|
1129
|
-
.filter((item) => item.aggregateName && item.asName)
|
|
1130
|
-
.map((item) => {
|
|
1131
|
-
let typeName;
|
|
1132
|
-
if (['COUNT', 'COUNTD'].includes(item.aggregateName)) {
|
|
1133
|
-
typeName = 'Long';
|
|
1134
|
-
} else if (['AVG'].includes(item.aggregateName)) {
|
|
1135
|
-
const { entityAsName, propertyName } = item.aggregateParam;
|
|
1136
|
-
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1137
|
-
const property = entity?.properties.find((item: any) => item.name === propertyName);
|
|
1138
|
-
const propertyTypeName = property?.typeAnnotation?.typeName;
|
|
1139
|
-
if (propertyTypeName === 'Decimal') {
|
|
1140
|
-
typeName = 'Decimal';
|
|
1141
|
-
} else {
|
|
1142
|
-
typeName = 'Decimal';
|
|
1143
|
-
}
|
|
1144
|
-
} else {
|
|
1145
|
-
const { entityAsName, propertyName } = item.aggregateParam;
|
|
1146
|
-
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1147
|
-
const property = entity?.properties.find((item) => item.name === propertyName);
|
|
1148
|
-
typeName = property?.typeAnnotation?.typeName;
|
|
1149
|
-
}
|
|
1150
|
-
return {
|
|
1151
|
-
concept: 'StructureProperty',
|
|
1152
|
-
name: item.asName,
|
|
1153
|
-
typeAnnotation: {
|
|
1154
|
-
concept: 'TypeAnnotation',
|
|
1155
|
-
typeKind: 'primitive',
|
|
1156
|
-
typeNamespace: 'nasl.core',
|
|
1157
|
-
typeName,
|
|
1158
|
-
},
|
|
1159
|
-
};
|
|
1160
|
-
});
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
genPropertyListOfGroupBy(node: CallQueryComponent, entities: Entity[]) {
|
|
1164
|
-
return node.groupBy
|
|
1165
|
-
.filter((item) => item.groupElement && (item.groupElement as QueryFieldExpression).propertyName && (item.groupElement as QueryFieldExpression).asName)
|
|
1166
|
-
.map((item) => {
|
|
1167
|
-
const { entityAsName, propertyName, asName } = item.groupElement as QueryFieldExpression;
|
|
1168
|
-
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1169
|
-
const property = entity?.properties.find((item) => item.name === propertyName);
|
|
1170
|
-
const propertyTypeAnnotation = property?.typeAnnotation;
|
|
1171
|
-
|
|
1172
|
-
return {
|
|
1173
|
-
concept: 'StructureProperty',
|
|
1174
|
-
name: asName,
|
|
1175
|
-
typeAnnotation: {
|
|
1275
|
+
typeKind: 'generic',
|
|
1276
|
+
typeName: 'List',
|
|
1277
|
+
typeNamespace: 'nasl.collection',
|
|
1278
|
+
typeArguments: [
|
|
1279
|
+
TypeAnnotation.from({
|
|
1176
1280
|
concept: propertyTypeAnnotation.concept,
|
|
1177
1281
|
typeKind: propertyTypeAnnotation.typeKind,
|
|
1178
1282
|
typeName: propertyTypeAnnotation.typeName,
|
|
1179
1283
|
typeNamespace: propertyTypeAnnotation.typeNamespace,
|
|
1180
|
-
|
|
1181
|
-
};
|
|
1182
|
-
});
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
genStructure(structureName?: string, properties: any[] = []) {
|
|
1186
|
-
const logic = this.logic || this.AuthLogic || this.AuthLogicForCallInterface;
|
|
1187
|
-
return Structure.from({
|
|
1188
|
-
concept: 'Structure',
|
|
1189
|
-
name: structureName || this.typeAnnotation?.typeName || `${utils.firstUpperCase(logic.name)}Structure`,
|
|
1190
|
-
origin: 'CallQueryComponent',
|
|
1191
|
-
properties,
|
|
1192
|
-
});
|
|
1193
|
-
}
|
|
1194
|
-
|
|
1195
|
-
saveStructure() {
|
|
1196
|
-
// 没有数据源时不初始化数据结构
|
|
1197
|
-
if (!this.entityInfos.length) {
|
|
1198
|
-
return;
|
|
1199
|
-
}
|
|
1200
|
-
const entityNamespace = this.from?.entityNamespace;
|
|
1201
|
-
const entities = this.app.findNodeByCompleteName(entityNamespace);
|
|
1202
|
-
if (!this.isAutoInfer()) {
|
|
1203
|
-
// 存量应用走之前的逻辑
|
|
1204
|
-
return this.saveStructureNoInfer(entities);
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
const groupBy = this.groupBy;
|
|
1208
|
-
const selectElements = this.select.selectAggregateElements;
|
|
1209
|
-
let structureName;
|
|
1210
|
-
let typeAnnotation;
|
|
1211
|
-
|
|
1212
|
-
// remove structure
|
|
1213
|
-
if (this.typeAnnotation) {
|
|
1214
|
-
const { typeNamespace, typeName, typeArguments } = this.typeAnnotation;
|
|
1215
|
-
if (typeNamespace === 'app.structures') {
|
|
1216
|
-
structureName = typeName;
|
|
1217
|
-
this.removeStructure(structureName);
|
|
1218
|
-
} else if (typeNamespace === 'nasl.collection' && typeName === 'PageOf') {
|
|
1219
|
-
// PageOf<Structures>
|
|
1220
|
-
if (typeArguments[0].typeNamespace === 'app.structures') {
|
|
1221
|
-
structureName = typeArguments[0].typeName;
|
|
1222
|
-
this.removeStructure(structureName);
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
const logic = this.logic || this.AuthLogic || this.AuthLogicForCallInterface || this.OverriddenLogic;
|
|
1228
|
-
structureName = structureName || utils.unique(`${utils.firstUpperCase(logic?.name)}Structure`, this.app.getStructureExistingNames());
|
|
1229
|
-
const groupByLength = groupBy.filter((item) => (item.groupElement as QueryFieldExpression)?.propertyName && (item.groupElement as QueryFieldExpression).asName).length;
|
|
1230
|
-
const aggregateLength = selectElements.filter((item) => item.aggregateName && item.asName).length;
|
|
1231
|
-
|
|
1232
|
-
// 1. 有分组
|
|
1233
|
-
if (groupByLength) {
|
|
1234
|
-
if (!aggregateLength && groupByLength === 1) {
|
|
1235
|
-
// 1.1 单分组无聚合:`{ list: List<列的类型>, total: Long }`
|
|
1236
|
-
const { entityAsName, propertyName } = groupBy[0].groupElement as QueryFieldExpression;
|
|
1237
|
-
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1238
|
-
const property = entity?.properties.find((item: any) => item.name === propertyName);
|
|
1239
|
-
const propertyTypeAnnotation = property.typeAnnotation;
|
|
1240
|
-
|
|
1241
|
-
typeAnnotation = TypeAnnotation.from({
|
|
1242
|
-
concept: 'TypeAnnotation',
|
|
1243
|
-
typeKind: 'anonymousStructure',
|
|
1244
|
-
properties: [
|
|
1245
|
-
StructureProperty.from({
|
|
1246
|
-
name: 'list',
|
|
1247
|
-
typeAnnotation: TypeAnnotation.from({
|
|
1248
|
-
concept: 'TypeAnnotation',
|
|
1249
|
-
typeKind: 'generic',
|
|
1250
|
-
typeName: 'List',
|
|
1251
|
-
typeNamespace: 'nasl.collection',
|
|
1252
|
-
typeArguments: [TypeAnnotation.from({
|
|
1253
|
-
concept: propertyTypeAnnotation.concept,
|
|
1254
|
-
typeKind: propertyTypeAnnotation.typeKind,
|
|
1255
|
-
typeName: propertyTypeAnnotation.typeName,
|
|
1256
|
-
typeNamespace: propertyTypeAnnotation.typeNamespace,
|
|
1257
|
-
})],
|
|
1258
|
-
}, this.typeAnnotation, 'typeAnnotation'),
|
|
1259
|
-
}),
|
|
1260
|
-
StructureProperty.from({
|
|
1261
|
-
name: 'total',
|
|
1262
|
-
typeAnnotation: TypeAnnotation.from({
|
|
1263
|
-
concept: 'TypeAnnotation',
|
|
1264
|
-
typeKind: 'primitive',
|
|
1265
|
-
typeNamespace: 'nasl.core',
|
|
1266
|
-
typeName: 'Long',
|
|
1267
|
-
}, this.typeAnnotation, 'typeAnnotation'),
|
|
1268
|
-
}),
|
|
1284
|
+
}),
|
|
1269
1285
|
],
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1286
|
+
},
|
|
1287
|
+
this.typeAnnotation,
|
|
1288
|
+
'typeAnnotation'
|
|
1289
|
+
),
|
|
1290
|
+
}),
|
|
1291
|
+
StructureProperty.from({
|
|
1292
|
+
name: 'total',
|
|
1293
|
+
typeAnnotation: TypeAnnotation.from(
|
|
1294
|
+
{
|
|
1274
1295
|
concept: 'TypeAnnotation',
|
|
1275
|
-
typeKind: '
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
],
|
|
1306
|
-
}, this, 'typeAnnotation');
|
|
1307
|
-
}
|
|
1308
|
-
} else { // 2. 无分组
|
|
1309
|
-
if (aggregateLength) {
|
|
1310
|
-
if (aggregateLength === 1) {
|
|
1311
|
-
// 2.1 单聚合:`基本类型`
|
|
1312
|
-
let typeName;
|
|
1313
|
-
if (['COUNT', 'COUNTD'].includes(selectElements[0].aggregateName)) {
|
|
1314
|
-
// 2.1.1. `COUNT`、`COUNTD` 返回 `Long`
|
|
1315
|
-
typeName = 'Long';
|
|
1316
|
-
} else if (['AVG'].includes(selectElements[0].aggregateName)) {
|
|
1317
|
-
const { entityAsName, propertyName } = selectElements[0].aggregateParam;
|
|
1318
|
-
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1319
|
-
const property = entity?.properties.find((item: any) => item.name === propertyName);
|
|
1320
|
-
const propertyTypeName = property?.typeAnnotation?.typeName;
|
|
1321
|
-
if (propertyTypeName === 'Decimal') {
|
|
1322
|
-
typeName = 'Decimal';
|
|
1323
|
-
} else {
|
|
1324
|
-
typeName = 'Double';
|
|
1325
|
-
}
|
|
1326
|
-
} else {
|
|
1327
|
-
// 2.1.3. 其他返回列类型,包含:`Long`、`Long`、`Double`
|
|
1328
|
-
const { entityAsName, propertyName } = selectElements[0].aggregateParam;
|
|
1329
|
-
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1330
|
-
const property = entity?.properties.find((item: any) => item.name === propertyName);
|
|
1331
|
-
typeName = property?.typeAnnotation?.typeName;
|
|
1332
|
-
}
|
|
1333
|
-
typeAnnotation = TypeAnnotation.from({
|
|
1334
|
-
concept: 'TypeAnnotation',
|
|
1335
|
-
typeKind: 'primitive',
|
|
1336
|
-
typeName,
|
|
1337
|
-
typeNamespace: 'nasl.core',
|
|
1338
|
-
}, this, 'typeAnnotation');
|
|
1339
|
-
} else {
|
|
1340
|
-
// 2.2 多聚合:`{ Structure }`
|
|
1341
|
-
typeAnnotation = TypeAnnotation.from({
|
|
1296
|
+
typeKind: 'primitive',
|
|
1297
|
+
typeNamespace: 'nasl.core',
|
|
1298
|
+
typeName: 'Long',
|
|
1299
|
+
},
|
|
1300
|
+
this.typeAnnotation,
|
|
1301
|
+
'typeAnnotation'
|
|
1302
|
+
),
|
|
1303
|
+
}),
|
|
1304
|
+
],
|
|
1305
|
+
},
|
|
1306
|
+
this,
|
|
1307
|
+
'typeAnnotation'
|
|
1308
|
+
);
|
|
1309
|
+
} else {
|
|
1310
|
+
// 1.2 多分组:`{ list: List<anonymousStructure>, total: Long }`
|
|
1311
|
+
typeAnnotation = TypeAnnotation.from(
|
|
1312
|
+
{
|
|
1313
|
+
concept: 'TypeAnnotation',
|
|
1314
|
+
typeKind: 'anonymousStructure',
|
|
1315
|
+
properties: [
|
|
1316
|
+
StructureProperty.from({
|
|
1317
|
+
name: 'list',
|
|
1318
|
+
typeAnnotation: TypeAnnotation.from(
|
|
1319
|
+
{
|
|
1320
|
+
concept: 'TypeAnnotation',
|
|
1321
|
+
typeKind: 'generic',
|
|
1322
|
+
typeName: 'List',
|
|
1323
|
+
typeNamespace: 'nasl.collection',
|
|
1324
|
+
typeArguments: [
|
|
1325
|
+
TypeAnnotation.from({
|
|
1342
1326
|
concept: 'TypeAnnotation',
|
|
1343
1327
|
typeKind: 'anonymousStructure',
|
|
1344
|
-
properties: [...this.genPropertyListOfAggregate(this, entities)],
|
|
1345
|
-
|
|
1346
|
-
}
|
|
1347
|
-
} else {
|
|
1348
|
-
// 2.3 无分组&&无聚合 (默认情况):`{ list: List<Structure>, total: Long }`
|
|
1349
|
-
typeAnnotation = TypeAnnotation.from({
|
|
1350
|
-
concept: 'TypeAnnotation',
|
|
1351
|
-
typeKind: 'anonymousStructure',
|
|
1352
|
-
properties: [
|
|
1353
|
-
StructureProperty.from({
|
|
1354
|
-
name: 'list',
|
|
1355
|
-
typeAnnotation: TypeAnnotation.from({
|
|
1356
|
-
concept: 'TypeAnnotation',
|
|
1357
|
-
typeKind: 'generic',
|
|
1358
|
-
typeName: 'List',
|
|
1359
|
-
typeNamespace: 'nasl.collection',
|
|
1360
|
-
typeArguments: [
|
|
1361
|
-
TypeAnnotation.from({
|
|
1362
|
-
concept: 'TypeAnnotation',
|
|
1363
|
-
typeKind: 'anonymousStructure',
|
|
1364
|
-
properties: this.genPropertiesFrom(this.from),
|
|
1365
|
-
}),
|
|
1366
|
-
],
|
|
1367
|
-
}, this.typeAnnotation, 'typeAnnotation'),
|
|
1368
|
-
}),
|
|
1369
|
-
StructureProperty.from({
|
|
1370
|
-
name: 'total',
|
|
1371
|
-
typeAnnotation: TypeAnnotation.from({
|
|
1372
|
-
concept: 'TypeAnnotation',
|
|
1373
|
-
typeKind: 'primitive',
|
|
1374
|
-
typeNamespace: 'nasl.core',
|
|
1375
|
-
typeName: 'Long',
|
|
1376
|
-
}, this.typeAnnotation, 'typeAnnotation'),
|
|
1377
|
-
}),
|
|
1328
|
+
properties: [...this.genPropertyListOfGroupBy(this, entities), ...this.genPropertyListOfAggregate(this, entities)],
|
|
1329
|
+
}),
|
|
1378
1330
|
],
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
...this.genPropertyListOfFrom(this.from),
|
|
1389
|
-
...this.genPropertyListOfAggregate(this, entities),
|
|
1390
|
-
]);
|
|
1391
|
-
if (this.typeAnnotation) {
|
|
1392
|
-
// 老版本没有 ListTotal 结构,支持匿名数据结构
|
|
1393
|
-
if (this.typeAnnotation.typeKind === 'anonymousStructure') {
|
|
1394
|
-
const typeAnnotation = TypeAnnotation.from({
|
|
1331
|
+
},
|
|
1332
|
+
this.typeAnnotation,
|
|
1333
|
+
'typeAnnotation'
|
|
1334
|
+
),
|
|
1335
|
+
}),
|
|
1336
|
+
StructureProperty.from({
|
|
1337
|
+
name: 'total',
|
|
1338
|
+
typeAnnotation: TypeAnnotation.from(
|
|
1339
|
+
{
|
|
1395
1340
|
concept: 'TypeAnnotation',
|
|
1396
|
-
typeKind: '
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1341
|
+
typeKind: 'primitive',
|
|
1342
|
+
typeNamespace: 'nasl.core',
|
|
1343
|
+
typeName: 'Long',
|
|
1344
|
+
},
|
|
1345
|
+
this.typeAnnotation,
|
|
1346
|
+
'typeAnnotation'
|
|
1347
|
+
),
|
|
1348
|
+
}),
|
|
1349
|
+
],
|
|
1350
|
+
},
|
|
1351
|
+
this,
|
|
1352
|
+
'typeAnnotation'
|
|
1353
|
+
);
|
|
1354
|
+
}
|
|
1355
|
+
} else {
|
|
1356
|
+
// 2. 无分组
|
|
1357
|
+
if (aggregateLength) {
|
|
1358
|
+
if (aggregateLength === 1) {
|
|
1359
|
+
// 2.1 单聚合:`基本类型`
|
|
1360
|
+
let typeName;
|
|
1361
|
+
if (['COUNT', 'COUNTD'].includes(selectElements[0].aggregateName)) {
|
|
1362
|
+
// 2.1.1. `COUNT`、`COUNTD` 返回 `Long`
|
|
1363
|
+
typeName = 'Long';
|
|
1364
|
+
} else if (['AVG'].includes(selectElements[0].aggregateName)) {
|
|
1365
|
+
const { entityAsName, propertyName } = selectElements[0].aggregateParam;
|
|
1366
|
+
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1367
|
+
const property = entity?.properties.find((item: any) => item.name === propertyName);
|
|
1368
|
+
const propertyTypeName = property?.typeAnnotation?.typeName;
|
|
1369
|
+
if (propertyTypeName === 'Decimal') {
|
|
1370
|
+
typeName = 'Decimal';
|
|
1400
1371
|
} else {
|
|
1401
|
-
|
|
1402
|
-
if (structure) {
|
|
1403
|
-
const properties = source.properties.map((property) => StructureProperty.from(property, structure, 'properties'));
|
|
1404
|
-
structure.update({
|
|
1405
|
-
properties,
|
|
1406
|
-
});
|
|
1407
|
-
} else
|
|
1408
|
-
this.app.addStructure(source);
|
|
1372
|
+
typeName = 'Double';
|
|
1409
1373
|
}
|
|
1374
|
+
} else {
|
|
1375
|
+
// 2.1.3. 其他返回列类型,包含:`Long`、`Long`、`Double`
|
|
1376
|
+
const { entityAsName, propertyName } = selectElements[0].aggregateParam;
|
|
1377
|
+
const entity = entities.find((item: Entity) => item.name === entityAsName);
|
|
1378
|
+
const property = entity?.properties.find((item: any) => item.name === propertyName);
|
|
1379
|
+
typeName = property?.typeAnnotation?.typeName;
|
|
1380
|
+
}
|
|
1381
|
+
typeAnnotation = TypeAnnotation.from(
|
|
1382
|
+
{
|
|
1383
|
+
concept: 'TypeAnnotation',
|
|
1384
|
+
typeKind: 'primitive',
|
|
1385
|
+
typeName,
|
|
1386
|
+
typeNamespace: 'nasl.core',
|
|
1387
|
+
},
|
|
1388
|
+
this,
|
|
1389
|
+
'typeAnnotation'
|
|
1390
|
+
);
|
|
1410
1391
|
} else {
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
});
|
|
1392
|
+
// 2.2 多聚合:`{ Structure }`
|
|
1393
|
+
typeAnnotation = TypeAnnotation.from(
|
|
1394
|
+
{
|
|
1395
|
+
concept: 'TypeAnnotation',
|
|
1396
|
+
typeKind: 'anonymousStructure',
|
|
1397
|
+
properties: [...this.genPropertyListOfAggregate(this, entities)],
|
|
1398
|
+
},
|
|
1399
|
+
this,
|
|
1400
|
+
'typeAnnotation'
|
|
1401
|
+
);
|
|
1422
1402
|
}
|
|
1403
|
+
} else {
|
|
1404
|
+
// 2.3 无分组&&无聚合 (默认情况):`{ list: List<Structure>, total: Long }`
|
|
1405
|
+
typeAnnotation = TypeAnnotation.from(
|
|
1406
|
+
{
|
|
1407
|
+
concept: 'TypeAnnotation',
|
|
1408
|
+
typeKind: 'anonymousStructure',
|
|
1409
|
+
properties: [
|
|
1410
|
+
StructureProperty.from({
|
|
1411
|
+
name: 'list',
|
|
1412
|
+
typeAnnotation: TypeAnnotation.from(
|
|
1413
|
+
{
|
|
1414
|
+
concept: 'TypeAnnotation',
|
|
1415
|
+
typeKind: 'generic',
|
|
1416
|
+
typeName: 'List',
|
|
1417
|
+
typeNamespace: 'nasl.collection',
|
|
1418
|
+
typeArguments: [
|
|
1419
|
+
TypeAnnotation.from({
|
|
1420
|
+
concept: 'TypeAnnotation',
|
|
1421
|
+
typeKind: 'anonymousStructure',
|
|
1422
|
+
properties: this.genPropertiesFrom(this.from),
|
|
1423
|
+
}),
|
|
1424
|
+
],
|
|
1425
|
+
},
|
|
1426
|
+
this.typeAnnotation,
|
|
1427
|
+
'typeAnnotation'
|
|
1428
|
+
),
|
|
1429
|
+
}),
|
|
1430
|
+
StructureProperty.from({
|
|
1431
|
+
name: 'total',
|
|
1432
|
+
typeAnnotation: TypeAnnotation.from(
|
|
1433
|
+
{
|
|
1434
|
+
concept: 'TypeAnnotation',
|
|
1435
|
+
typeKind: 'primitive',
|
|
1436
|
+
typeNamespace: 'nasl.core',
|
|
1437
|
+
typeName: 'Long',
|
|
1438
|
+
},
|
|
1439
|
+
this.typeAnnotation,
|
|
1440
|
+
'typeAnnotation'
|
|
1441
|
+
),
|
|
1442
|
+
}),
|
|
1443
|
+
],
|
|
1444
|
+
},
|
|
1445
|
+
this,
|
|
1446
|
+
'typeAnnotation'
|
|
1447
|
+
);
|
|
1448
|
+
}
|
|
1423
1449
|
}
|
|
1424
1450
|
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
if (
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1451
|
+
this.update({ typeAnnotation });
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
saveStructureNoInfer(entities: any[] = []) {
|
|
1455
|
+
const source = this.genStructure(null, [...this.genPropertyListOfFrom(this.from), ...this.genPropertyListOfAggregate(this, entities)]);
|
|
1456
|
+
if (this.typeAnnotation) {
|
|
1457
|
+
// 老版本没有 ListTotal 结构,支持匿名数据结构
|
|
1458
|
+
if (this.typeAnnotation.typeKind === 'anonymousStructure') {
|
|
1459
|
+
const typeAnnotation = TypeAnnotation.from(
|
|
1460
|
+
{
|
|
1461
|
+
concept: 'TypeAnnotation',
|
|
1462
|
+
typeKind: 'anonymousStructure',
|
|
1463
|
+
properties: source.properties,
|
|
1464
|
+
},
|
|
1465
|
+
this,
|
|
1466
|
+
'typeAnnotation'
|
|
1467
|
+
);
|
|
1468
|
+
this.update({ typeAnnotation });
|
|
1469
|
+
} else {
|
|
1470
|
+
const structure = this.app.structures.find((item) => item.name === this.typeAnnotation.typeName);
|
|
1471
|
+
if (structure) {
|
|
1472
|
+
const properties = source.properties.map((property) => StructureProperty.from(property, structure, 'properties'));
|
|
1473
|
+
structure.update({
|
|
1474
|
+
properties,
|
|
1475
|
+
});
|
|
1476
|
+
} else this.app.addStructure(source);
|
|
1477
|
+
}
|
|
1478
|
+
} else {
|
|
1479
|
+
source.name = utils.unique(source.name, this.app.getStructureExistingNames());
|
|
1480
|
+
this.app.addStructure(source);
|
|
1481
|
+
const typeAnnotation = TypeAnnotation.from(
|
|
1482
|
+
{
|
|
1483
|
+
concept: 'TypeAnnotation',
|
|
1484
|
+
typeKind: 'reference',
|
|
1485
|
+
typeName: source.name,
|
|
1486
|
+
typeNamespace: `app.structures`,
|
|
1487
|
+
},
|
|
1488
|
+
this,
|
|
1489
|
+
'typeAnnotation'
|
|
1490
|
+
);
|
|
1491
|
+
this.update({
|
|
1492
|
+
typeAnnotation,
|
|
1493
|
+
});
|
|
1459
1494
|
}
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
name: property.name,
|
|
1477
|
-
value: `${entity.name}.${property.name}`,
|
|
1478
|
-
entityAsName: entity.name,
|
|
1479
|
-
propertyName: property.name,
|
|
1480
|
-
});
|
|
1481
|
-
expression.parentNode = this;
|
|
1482
|
-
const completionProperty = new CompletionProperty({
|
|
1483
|
-
concept: 'CompletionProperty',
|
|
1484
|
-
name: property.name,
|
|
1485
|
-
value: `${entity.name}.${property.name}`,
|
|
1486
|
-
expression,
|
|
1487
|
-
});
|
|
1488
|
-
completionProperty.icon = 'property';
|
|
1489
|
-
// 标记实体属性是否是符合类型
|
|
1490
|
-
Object.assign(completionProperty, { isComplexType: property.typeAnnotation.isComplexType() });
|
|
1491
|
-
return completionProperty;
|
|
1492
|
-
}),
|
|
1493
|
-
}));
|
|
1494
|
-
if (children.length) {
|
|
1495
|
-
return {
|
|
1496
|
-
name: '实体',
|
|
1497
|
-
icon: 'category',
|
|
1498
|
-
children,
|
|
1499
|
-
};
|
|
1500
|
-
}
|
|
1501
|
-
}
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
removeStructure(structureName?: string) {
|
|
1498
|
+
try {
|
|
1499
|
+
if (this.typeAnnotation) {
|
|
1500
|
+
const { typeNamespace, typeName, typeArguments } = this.typeAnnotation;
|
|
1501
|
+
if (typeNamespace === 'app.structures') {
|
|
1502
|
+
// Structures
|
|
1503
|
+
structureName = typeName;
|
|
1504
|
+
this.app.removeStructure(structureName);
|
|
1505
|
+
} else if (typeNamespace === 'nasl.collection' && typeName === 'PageOf') {
|
|
1506
|
+
// PageOf<Structures>
|
|
1507
|
+
if (typeArguments[0].typeNamespace === 'app.structures') {
|
|
1508
|
+
structureName = typeArguments[0].typeName;
|
|
1509
|
+
this.app.removeStructure(structureName);
|
|
1510
|
+
}
|
|
1502
1511
|
}
|
|
1512
|
+
}
|
|
1513
|
+
} catch {}
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
getEntityInfos(node: QueryFromExpression | QueryJoinExpression, set = new Set()) {
|
|
1517
|
+
if (node?.entityName)
|
|
1518
|
+
set.add({
|
|
1519
|
+
namespace: node.entityNamespace,
|
|
1520
|
+
name: node.entityName,
|
|
1521
|
+
});
|
|
1522
|
+
|
|
1523
|
+
node?.joinParts?.forEach((child) => {
|
|
1524
|
+
this.getEntityInfos(child, set);
|
|
1525
|
+
});
|
|
1526
|
+
return Array.from(set);
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
get entityInfos() {
|
|
1530
|
+
return this.getEntityInfos(this.from);
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
getCompletionPropertyOfEntities() {
|
|
1534
|
+
const firstEntityInfo: any = this.entityInfos[0];
|
|
1535
|
+
if (firstEntityInfo) {
|
|
1536
|
+
const { namespace } = firstEntityInfo;
|
|
1537
|
+
const entities: Entity[] = this.app.findNodeByCompleteName(namespace);
|
|
1538
|
+
if (Array.isArray(entities)) {
|
|
1539
|
+
const children = this.entityInfos
|
|
1540
|
+
.map(({ name }) => entities.find((item) => item.name === name))
|
|
1541
|
+
.filter((item) => item)
|
|
1542
|
+
.map((entity) => ({
|
|
1543
|
+
concept: 'Entity',
|
|
1544
|
+
name: entity.name,
|
|
1545
|
+
children: entity.properties.map((property) => {
|
|
1546
|
+
const expression = LogicItem.from({
|
|
1547
|
+
concept: 'QueryFieldExpression',
|
|
1548
|
+
name: property.name,
|
|
1549
|
+
value: `${entity.name}.${property.name}`,
|
|
1550
|
+
entityAsName: entity.name,
|
|
1551
|
+
propertyName: property.name,
|
|
1552
|
+
});
|
|
1553
|
+
expression.parentNode = this;
|
|
1554
|
+
const completionProperty = new CompletionProperty({
|
|
1555
|
+
concept: 'CompletionProperty',
|
|
1556
|
+
name: property.name,
|
|
1557
|
+
value: `${entity.name}.${property.name}`,
|
|
1558
|
+
expression,
|
|
1559
|
+
});
|
|
1560
|
+
completionProperty.icon = 'property';
|
|
1561
|
+
// 标记实体属性是否是符合类型
|
|
1562
|
+
Object.assign(completionProperty, { isComplexType: property.typeAnnotation.isComplexType() });
|
|
1563
|
+
return completionProperty;
|
|
1564
|
+
}),
|
|
1565
|
+
}));
|
|
1566
|
+
if (children.length) {
|
|
1567
|
+
return {
|
|
1568
|
+
name: '实体',
|
|
1569
|
+
icon: 'category',
|
|
1570
|
+
children,
|
|
1571
|
+
};
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1503
1574
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
}
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
}
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
getCompletionPropertyOfAggregateAsNames() {
|
|
1578
|
+
const children = this.select?.selectElements
|
|
1579
|
+
?.filter((item) => item.concept === 'QueryAggregateExpression' && item.asName)
|
|
1580
|
+
.map(
|
|
1581
|
+
(item) =>
|
|
1582
|
+
new CompletionProperty({
|
|
1583
|
+
concept: 'CompletionProperty',
|
|
1584
|
+
name: item.asName,
|
|
1585
|
+
value: `inner.${item.asName}`,
|
|
1586
|
+
expression: LogicItem.from({
|
|
1587
|
+
concept: 'Identifier',
|
|
1588
|
+
name: item.asName,
|
|
1589
|
+
namespace: 'inner',
|
|
1590
|
+
}),
|
|
1591
|
+
})
|
|
1592
|
+
);
|
|
1593
|
+
if (!children || children.length === 0) return;
|
|
1594
|
+
|
|
1595
|
+
children.forEach((item) => {
|
|
1596
|
+
item.icon = 'variable';
|
|
1597
|
+
});
|
|
1598
|
+
return { name: '聚合属性别名', icon: 'category', children, expanded: true };
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
getCompletionPropertyOfGroupByAsNames() {
|
|
1602
|
+
const children = this.groupBy
|
|
1603
|
+
?.filter((item) => item.concept === 'QueryGroupByExpression' && (item.groupElement as QueryFieldExpression)?.asName)
|
|
1604
|
+
.map(
|
|
1605
|
+
(item) =>
|
|
1606
|
+
new CompletionProperty({
|
|
1607
|
+
concept: 'CompletionProperty',
|
|
1608
|
+
name: (item.groupElement as QueryFieldExpression).asName,
|
|
1609
|
+
value: `inner.${(item.groupElement as QueryFieldExpression).asName}`,
|
|
1610
|
+
expression: LogicItem.from({
|
|
1611
|
+
concept: 'Identifier',
|
|
1612
|
+
name: (item.groupElement as QueryFieldExpression).asName,
|
|
1613
|
+
namespace: 'inner',
|
|
1614
|
+
}),
|
|
1615
|
+
})
|
|
1616
|
+
);
|
|
1617
|
+
if (!children || children.length === 0) return;
|
|
1618
|
+
|
|
1619
|
+
children.forEach((item) => {
|
|
1620
|
+
item.icon = 'variable';
|
|
1621
|
+
});
|
|
1622
|
+
return { name: '分组属性别名', icon: 'category', children, expanded: true };
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
/**
|
|
1626
|
+
* 获取当前内部使用到的变量
|
|
1627
|
+
*/
|
|
1628
|
+
getContentVariable() {
|
|
1629
|
+
const contentVariables: Array<Identifier | MemberExpression> = [];
|
|
1630
|
+
utils.traverse(
|
|
1631
|
+
({ node }) => {
|
|
1632
|
+
if ((node as any)?.parentNode?.concept !== 'MemberExpression') {
|
|
1633
|
+
if ((node as any)?.concept === 'MemberExpression') {
|
|
1634
|
+
contentVariables.push(node as any);
|
|
1635
|
+
} else if ((node as any)?.concept === 'Identifier') {
|
|
1636
|
+
// 因为要是父级是MemberExpression, 就放入了父级,子级就不需要了
|
|
1637
|
+
contentVariables.push(node as any);
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
},
|
|
1641
|
+
{ node: this },
|
|
1642
|
+
{
|
|
1643
|
+
mode: 'anyObject',
|
|
1644
|
+
excludedKeySet: new Set(['parentNode', '_events', 'globalDataMap', 'havingPlayground', 'wherePlayground']),
|
|
1645
|
+
}
|
|
1646
|
+
);
|
|
1647
|
+
return contentVariables;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
// 临时升级脚本
|
|
1651
|
+
// 将所有from的实体,在selectElements中初始化一个isDotStar=true的QueryFieldExpression
|
|
1652
|
+
initFieldSelectElement(node: CallQueryComponent = this) {
|
|
1653
|
+
const loop = (from: QueryFromExpression | QueryJoinExpression) => {
|
|
1654
|
+
node.select.addQueryFieldExpressionInSelectElements({
|
|
1655
|
+
entityAsName: from.entityName,
|
|
1656
|
+
isDotStar: true,
|
|
1657
|
+
});
|
|
1658
|
+
from.joinParts?.forEach(loop);
|
|
1659
|
+
};
|
|
1660
|
+
loop(node.from);
|
|
1661
|
+
}
|
|
1662
|
+
//= ===============================================================================
|
|
1663
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
1664
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
1665
|
+
//= ===============================================================================
|
|
1587
1666
|
}
|
|
1588
1667
|
|
|
1589
1668
|
classMap.CallQueryComponent = CallQueryComponent;
|
|
1590
1669
|
export default CallQueryComponent;
|
|
1591
|
-
|
|
1670
|
+
//= ===============================================================================
|
|
1592
1671
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1593
1672
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
1594
|
-
|
|
1673
|
+
//= ===============================================================================
|