@lcap/nasl 3.7.0-alpha.1 → 3.7.0-beta.1
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.d.ts +1 -1
- package/out/automate/engine/utils.js +3 -7
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/template/myProcess.js +65 -65
- package/out/automate/template/myProcess.js.map +1 -1
- package/out/bak/translator.js +42 -12
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.d.ts +2 -0
- package/out/breakpoint/generator/BreakpointNode.js +7 -0
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/shared/constants.js +1 -0
- package/out/breakpoint/shared/constants.js.map +1 -1
- package/out/breakpoint/shared/utils.js +1 -1
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/common/BaseNode.d.ts +4 -3
- package/out/common/BaseNode.js +61 -10
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/ComponentAPI.d.ts +5 -3
- package/out/common/EventEmitter.d.ts +1 -0
- package/out/common/EventEmitter.js.map +1 -1
- package/out/concepts/Abort__.d.ts +5 -4
- package/out/concepts/Abort__.js +5 -7
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/AbstractInterface__.d.ts +9 -6
- package/out/concepts/AbstractInterface__.js +8 -11
- package/out/concepts/AbstractInterface__.js.map +1 -1
- package/out/concepts/Anchor__.d.ts +5 -12
- package/out/concepts/Anchor__.js +5 -44
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +10 -47
- package/out/concepts/AnonymousFunction__.js +14 -159
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +321 -437
- package/out/concepts/App__.js +460 -986
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +5 -12
- package/out/concepts/Argument__.js +11 -46
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +8 -5
- package/out/concepts/Assignee__.js +9 -66
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.d.ts +5 -6
- package/out/concepts/AssignmentLine__.js +7 -11
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +5 -26
- package/out/concepts/Assignment__.js +5 -64
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.d.ts +14 -51
- package/out/concepts/Attribute__.js +36 -126
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthInterface__.d.ts +10 -10
- package/out/concepts/AuthInterface__.js +18 -13
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.d.ts +6 -3
- package/out/concepts/AuthLogicForCallInterface__.js +6 -32
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.d.ts +19 -19
- package/out/concepts/AuthLogic__.js +26 -25
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BackendVariable__.d.ts +19 -47
- package/out/concepts/BackendVariable__.js +43 -134
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.d.ts +6 -13
- package/out/concepts/Backend__.js +13 -50
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BaseSetter__.d.ts +25 -0
- package/out/concepts/BaseSetter__.js +53 -0
- package/out/concepts/BaseSetter__.js.map +1 -0
- package/out/concepts/BatchAssignment__.d.ts +9 -21
- package/out/concepts/BatchAssignment__.js +11 -86
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +5 -22
- package/out/concepts/BinaryExpression__.js +32 -59
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +60 -107
- package/out/concepts/BindAttribute__.js +144 -251
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +26 -42
- package/out/concepts/BindDirective__.js +63 -105
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +27 -36
- package/out/concepts/BindEvent__.js +50 -109
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +24 -41
- package/out/concepts/BindStyle__.js +48 -88
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/Block__.d.ts +5 -2
- package/out/concepts/Block__.js +5 -31
- package/out/concepts/Block__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +5 -0
- package/out/concepts/BooleanLiteral__.js +8 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/BusinessComponent__.d.ts +47 -49
- package/out/concepts/BusinessComponent__.js +122 -444
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/BusinessLogic__.d.ts +5 -0
- package/out/concepts/BusinessLogic__.js +8 -1
- package/out/concepts/BusinessLogic__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +6 -4
- package/out/concepts/CallAuthInterface__.js +6 -34
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +5 -0
- package/out/concepts/CallConnector__.js +11 -2
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallEvent__.d.ts +6 -7
- package/out/concepts/CallEvent__.js +11 -40
- package/out/concepts/CallEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +17 -9
- package/out/concepts/CallFunction__.js +84 -130
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +6 -7
- package/out/concepts/CallInterface__.js +14 -41
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +11 -24
- package/out/concepts/CallLogic__.js +68 -140
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +70 -126
- package/out/concepts/CallQueryComponent__.js +134 -308
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/CapsulesSetter__.d.ts +109 -0
- package/out/concepts/CapsulesSetter__.js +163 -0
- package/out/concepts/CapsulesSetter__.js.map +1 -0
- package/out/concepts/Comment__.d.ts +5 -0
- package/out/concepts/Comment__.js +8 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.d.ts +6 -26
- package/out/concepts/CompletionProperty__.js +24 -74
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +6 -13
- package/out/concepts/ConfigGroup__.js +13 -50
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.d.ts +5 -11
- package/out/concepts/ConfigPropertyValue__.js +11 -19
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +11 -18
- package/out/concepts/ConfigProperty__.js +25 -58
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +6 -13
- package/out/concepts/Configuration__.js +6 -49
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.d.ts +11 -18
- package/out/concepts/Connection__.js +25 -58
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/ConnectorTrigger__.d.ts +28 -34
- package/out/concepts/ConnectorTrigger__.js +55 -50
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Connector__.d.ts +106 -504
- package/out/concepts/Connector__.js +134 -791
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.d.ts +27 -55
- package/out/concepts/Constant__.js +45 -137
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/CountersignPolicy__.d.ts +6 -5
- package/out/concepts/CountersignPolicy__.js +8 -12
- package/out/concepts/CountersignPolicy__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +11 -18
- package/out/concepts/DataSource__.js +25 -58
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.d.ts +5 -6
- package/out/concepts/DatabaseTypeAnnotation__.js +11 -13
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/DefaultValue__.d.ts +7 -19
- package/out/concepts/DefaultValue__.js +6 -56
- package/out/concepts/DefaultValue__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +10 -21
- package/out/concepts/Destination__.js +15 -55
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.d.ts +5 -4
- package/out/concepts/End__.js +7 -8
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +20 -26
- package/out/concepts/EntityIndex__.js +40 -39
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +17 -56
- package/out/concepts/EntityProperty__.js +70 -181
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +18 -26
- package/out/concepts/Entity__.js +38 -98
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +15 -21
- package/out/concepts/EnumItem__.js +27 -31
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/EnumSelectSetter__.d.ts +109 -0
- package/out/concepts/EnumSelectSetter__.js +163 -0
- package/out/concepts/EnumSelectSetter__.js.map +1 -0
- package/out/concepts/Enum__.d.ts +10 -28
- package/out/concepts/Enum__.js +35 -102
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/EventDeclaration__.d.ts +41 -0
- package/out/concepts/EventDeclaration__.js +81 -0
- package/out/concepts/EventDeclaration__.js.map +1 -0
- package/out/concepts/Event__.d.ts +16 -27
- package/out/concepts/Event__.js +37 -78
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +8 -25
- package/out/concepts/ExternalDestination__.js +8 -58
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +7 -55
- package/out/concepts/ForEachStatement__.js +6 -128
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +38 -46
- package/out/concepts/FrontendLibrary__.js +55 -121
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/FrontendType__.d.ts +8 -12
- package/out/concepts/FrontendType__.js +15 -109
- package/out/concepts/FrontendType__.js.map +1 -1
- package/out/concepts/FrontendVariable__.d.ts +5 -0
- package/out/concepts/FrontendVariable__.js +8 -1
- package/out/concepts/FrontendVariable__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +9 -41
- package/out/concepts/Frontend__.js +36 -209
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.d.ts +13 -34
- package/out/concepts/Function__.js +22 -194
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/I18nInfo__.d.ts +6 -7
- package/out/concepts/I18nInfo__.js +14 -14
- package/out/concepts/I18nInfo__.js.map +1 -1
- package/out/concepts/IconSetter__.d.ts +29 -0
- package/out/concepts/IconSetter__.js +62 -0
- package/out/concepts/IconSetter__.js.map +1 -0
- package/out/concepts/Identifier__.d.ts +5 -0
- package/out/concepts/Identifier__.js +20 -6
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.d.ts +5 -12
- package/out/concepts/IfStatement__.js +5 -44
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/ImageSetter__.d.ts +25 -0
- package/out/concepts/ImageSetter__.js +53 -0
- package/out/concepts/ImageSetter__.js.map +1 -0
- package/out/concepts/ImportedInterface__.d.ts +9 -0
- package/out/concepts/ImportedInterface__.js +11 -1
- package/out/concepts/ImportedInterface__.js.map +1 -1
- package/out/concepts/InputSetter__.d.ts +29 -0
- package/out/concepts/InputSetter__.js +62 -0
- package/out/concepts/InputSetter__.js.map +1 -0
- package/out/concepts/Integration__.d.ts +7 -26
- package/out/concepts/Integration__.js +6 -93
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +34 -62
- package/out/concepts/InterfaceParam__.js +63 -147
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +42 -48
- package/out/concepts/Interface__.js +89 -158
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts +5 -4
- package/out/concepts/JSBlock__.js +8 -8
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +5 -0
- package/out/concepts/JavaLogic__.js +14 -3
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicDeclaration__.d.ts +289 -0
- package/out/concepts/LogicDeclaration__.js +352 -0
- package/out/concepts/LogicDeclaration__.js.map +1 -0
- package/out/concepts/LogicItem__.d.ts +39 -45
- package/out/concepts/LogicItem__.js +76 -62
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +45 -63
- package/out/concepts/Logic__.js +159 -280
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +6 -4
- package/out/concepts/MatchCase__.js +16 -68
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.d.ts +8 -14
- package/out/concepts/Match__.js +17 -49
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +8 -23
- package/out/concepts/MemberExpression__.js +85 -103
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MetadataType__.d.ts +36 -54
- package/out/concepts/MetadataType__.js +44 -119
- package/out/concepts/MetadataType__.js.map +1 -1
- package/out/concepts/MicroApp__.d.ts +5 -6
- package/out/concepts/MicroApp__.js +30 -18
- package/out/concepts/MicroApp__.js.map +1 -1
- package/out/concepts/Module__.d.ts +99 -128
- package/out/concepts/Module__.js +133 -532
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.d.ts +31 -33
- package/out/concepts/MsgTriggerEvent__.js +39 -67
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.d.ts +11 -14
- package/out/concepts/MsgTriggerLauncher__.js +18 -44
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/MultiApprovalPolicy__.d.ts +8 -9
- package/out/concepts/MultiApprovalPolicy__.js +7 -13
- package/out/concepts/MultiApprovalPolicy__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +112 -138
- package/out/concepts/Namespace__.js +122 -501
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +11 -21
- package/out/concepts/NewComposite__.js +48 -146
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +6 -14
- package/out/concepts/NewList__.js +7 -77
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +6 -14
- package/out/concepts/NewMap__.js +7 -77
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.d.ts +6 -0
- package/out/concepts/New__.js +9 -0
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +5 -0
- package/out/concepts/NullLiteral__.js +5 -0
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumberInputSetter__.d.ts +45 -0
- package/out/concepts/NumberInputSetter__.js +98 -0
- package/out/concepts/NumberInputSetter__.js.map +1 -0
- package/out/concepts/NumericLiteral__.d.ts +6 -13
- package/out/concepts/NumericLiteral__.js +8 -45
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +7 -17
- package/out/concepts/OqlQueryComponent__.js +16 -53
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +38 -59
- package/out/concepts/OverriddenLogic__.js +55 -252
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Paginate__.d.ts +59 -0
- package/out/concepts/Paginate__.js +158 -0
- package/out/concepts/Paginate__.js.map +1 -0
- package/out/concepts/ParamWithGroup__.d.ts +13 -10
- package/out/concepts/ParamWithGroup__.js +15 -6
- package/out/concepts/ParamWithGroup__.js.map +1 -1
- package/out/concepts/Param__.d.ts +33 -76
- package/out/concepts/Param__.js +63 -159
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.d.ts +5 -6
- package/out/concepts/Point__.js +11 -13
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.d.ts +12 -20
- package/out/concepts/ProcessComponent__.js +32 -90
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +21 -66
- package/out/concepts/ProcessElement__.js +48 -360
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.d.ts +5 -4
- package/out/concepts/ProcessOutcome__.js +8 -8
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +5 -4
- package/out/concepts/ProcessOutcomes__.js +6 -7
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.d.ts +16 -26
- package/out/concepts/Process__.js +29 -186
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/PropDeclaration__.d.ts +99 -0
- package/out/concepts/PropDeclaration__.js +183 -0
- package/out/concepts/PropDeclaration__.js.map +1 -0
- package/out/concepts/PropertySelectSetter__.d.ts +25 -0
- package/out/concepts/PropertySelectSetter__.js +53 -0
- package/out/concepts/PropertySelectSetter__.js.map +1 -0
- package/out/concepts/QueryAggregateExpression__.d.ts +6 -13
- package/out/concepts/QueryAggregateExpression__.js +11 -46
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +5 -0
- package/out/concepts/QueryFieldExpression__.js +17 -4
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +6 -3
- package/out/concepts/QueryFromExpression__.js +14 -34
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +5 -12
- package/out/concepts/QueryGroupByExpression__.js +5 -44
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +29 -26
- package/out/concepts/QueryJoinExpression__.js +34 -52
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +5 -22
- package/out/concepts/QueryLimitExpression__.js +5 -57
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +5 -22
- package/out/concepts/QueryOrderByExpression__.js +5 -57
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +37 -34
- package/out/concepts/QuerySelectExpression__.js +37 -59
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.d.ts +5 -6
- package/out/concepts/Rect__.js +17 -15
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +28 -56
- package/out/concepts/Return__.js +50 -139
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +5 -11
- package/out/concepts/Role__.js +21 -21
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +8 -20
- package/out/concepts/SelectMembers__.js +10 -58
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/SequentialPolicy__.d.ts +5 -0
- package/out/concepts/SequentialPolicy__.js +5 -0
- package/out/concepts/SequentialPolicy__.js.map +1 -1
- package/out/concepts/SetterOption__.d.ts +49 -0
- package/out/concepts/SetterOption__.js +99 -0
- package/out/concepts/SetterOption__.js.map +1 -0
- package/out/concepts/SlotDeclaration__.d.ts +213 -0
- package/out/concepts/SlotDeclaration__.js +287 -0
- package/out/concepts/SlotDeclaration__.js.map +1 -0
- package/out/concepts/Slot__.d.ts +7 -31
- package/out/concepts/Slot__.js +27 -72
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +6 -17
- package/out/concepts/SqlQueryComponent__.js +14 -54
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.d.ts +5 -4
- package/out/concepts/Start__.js +5 -7
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StaticString__.d.ts +6 -12
- package/out/concepts/StaticString__.js +14 -21
- package/out/concepts/StaticString__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +5 -2
- package/out/concepts/StringInterpolation__.js +7 -33
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +6 -1
- package/out/concepts/StringLiteral__.js +16 -2
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +13 -49
- package/out/concepts/StructureProperty__.js +35 -137
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +13 -21
- package/out/concepts/Structure__.js +28 -90
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +6 -13
- package/out/concepts/SwitchCase__.js +6 -45
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchSetter__.d.ts +25 -0
- package/out/concepts/SwitchSetter__.js +53 -0
- package/out/concepts/SwitchSetter__.js.map +1 -0
- package/out/concepts/SwitchStatement__.d.ts +6 -3
- package/out/concepts/SwitchStatement__.js +5 -31
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/ThemeVariable__.d.ts +29 -0
- package/out/concepts/ThemeVariable__.js +58 -0
- package/out/concepts/ThemeVariable__.js.map +1 -0
- package/out/concepts/Theme__.d.ts +5 -6
- package/out/concepts/Theme__.js +11 -13
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.d.ts +29 -35
- package/out/concepts/Transactional__.js +54 -56
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TriggerEvent__.d.ts +8 -20
- package/out/concepts/TriggerEvent__.js +13 -57
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.d.ts +12 -17
- package/out/concepts/TriggerLauncher__.js +30 -27
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +8 -11
- package/out/concepts/TypeAnnotation__.js +40 -89
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +5 -0
- package/out/concepts/TypeParam__.js +12 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +5 -12
- package/out/concepts/UnaryExpression__.js +8 -45
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +5 -0
- package/out/concepts/Unparsed__.js +8 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.d.ts +6 -7
- package/out/concepts/UseComponent__.js +11 -13
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +7 -28
- package/out/concepts/ValidationRule__.js +18 -71
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +30 -58
- package/out/concepts/Variable__.js +51 -140
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlockWithImage__.d.ts +33 -0
- package/out/concepts/ViewBlockWithImage__.js +63 -0
- package/out/concepts/ViewBlockWithImage__.js.map +1 -0
- package/out/concepts/ViewBlock__.d.ts +11 -12
- package/out/concepts/ViewBlock__.js +22 -18
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponentDeclaration__.d.ts +721 -0
- package/out/concepts/ViewComponentDeclaration__.js +808 -0
- package/out/concepts/ViewComponentDeclaration__.js.map +1 -0
- package/out/concepts/ViewElement__.d.ts +38 -37
- package/out/concepts/ViewElement__.js +415 -432
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +39 -46
- package/out/concepts/View__.js +509 -342
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.d.ts +6 -13
- package/out/concepts/WhileStatement__.js +6 -45
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +68 -33
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.process.js +101 -3
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +31 -31
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +24 -8
- package/out/concepts/index__.js +24 -8
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/utils/asserts.d.ts +1079 -313
- package/out/concepts/utils/asserts.js +1461 -441
- package/out/concepts/utils/asserts.js.map +1 -1
- package/out/concepts/utils/types.d.ts +82 -30
- package/out/config.d.ts +9 -0
- package/out/config.js +5 -0
- package/out/config.js.map +1 -1
- package/out/decorators/index.d.ts +1 -6
- package/out/decorators/index.js +7 -16
- package/out/decorators/index.js.map +1 -1
- package/out/enums/KEYWORDS.js +2 -0
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +2 -0
- package/out/generator/genBundleFiles.js +105 -25
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.d.ts +2 -4
- package/out/generator/genReleaseBody.js +0 -1
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/permission.d.ts +5 -1
- package/out/generator/permission.js +3 -2
- package/out/generator/permission.js.map +1 -1
- package/out/index.d.ts +1 -0
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/natural/genNaturalTS.js +2 -5
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/index.d.ts +2 -0
- package/out/natural/index.js +2 -0
- package/out/natural/index.js.map +1 -1
- package/out/natural/naslStdlibMap.d.ts +1 -2
- package/out/natural/naslStdlibMap.js +32 -23
- package/out/natural/naslStdlibMap.js.map +1 -1
- package/out/natural/prompt/analyzeClaims.d.ts +1 -0
- package/out/natural/prompt/analyzeClaims.js +21 -0
- package/out/natural/prompt/analyzeClaims.js.map +1 -0
- package/out/natural/prompt/executeClaims.d.ts +1 -0
- package/out/natural/prompt/executeClaims.js +73 -0
- package/out/natural/prompt/executeClaims.js.map +1 -0
- package/out/natural/transformTSCode.js +13 -2
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/createUiTs.d.ts +2 -1
- package/out/server/createUiTs.js +133 -161
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/entity2LogicNamespace.js +1 -15
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/extendBaseNode.js +36 -9
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.js +9 -9
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getConnector.d.ts +1 -0
- package/out/server/getConnector.js +38 -35
- package/out/server/getConnector.js.map +1 -1
- package/out/server/getFunctions.js +3 -3
- package/out/server/getFunctions.js.map +1 -1
- package/out/server/getLogics.js +51 -15
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +87 -144
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.d.ts +11 -1
- package/out/server/naslServer.js +118 -74
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +24 -5
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -0
- package/out/service/storage/init.js +12 -7
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +16 -16
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +23 -23
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.d.ts +2 -2
- package/out/templator/genCurdMultipleKeyBlock.js +28 -38
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +15 -15
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genEnumSelectBlock.js +8 -8
- package/out/templator/genEnumSelectBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +18 -20
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +10 -10
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +32 -37
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.js +10 -10
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +18 -10
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +15 -15
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +19 -24
- package/out/templator/utils.js +20 -30
- package/out/templator/utils.js.map +1 -1
- package/out/translator/types.d.ts +2 -0
- package/out/utils/index.d.ts +6 -1
- package/out/utils/index.js +37 -4
- package/out/utils/index.js.map +1 -1
- package/out/utils/string.d.ts +12 -0
- package/out/utils/string.js +15 -1
- package/out/utils/string.js.map +1 -1
- package/out/utils/time-slicing/performance.js +3 -3
- package/out/utils/time-slicing/performance.js.map +1 -1
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.auth.ts +4 -0
- package/sandbox/stdlib/nasl.collection.ts +5 -3
- package/sandbox/stdlib/nasl.core.ts +16 -1
- package/sandbox/stdlib/nasl.oql.ts +2 -2
- package/sandbox/stdlib/nasl.process.ts +18 -0
- package/sandbox/stdlib/nasl.ui.components.h5.ts +1751 -0
- package/sandbox/stdlib/nasl.ui.components.pc.ts +3479 -0
- package/sandbox/stdlib/nasl.ui.definition.ts +53 -2688
- package/sandbox/stdlib/nasl.ui.ts +2 -1
- package/sandbox/stdlib/nasl.util.ts +7 -5
- package/sandbox-natural/stdlib/nasl.core.ts +3 -0
- package/sandbox-natural/stdlib/nasl.oql.ts +4 -3
- package/src/automate/engine/utils.js +3 -7
- package/src/automate/template/myProcess.js +65 -65
- package/src/bak/translator.js +62 -29
- package/src/breakpoint/generator/BreakpointNode.ts +9 -0
- package/src/breakpoint/shared/constants.ts +1 -0
- package/src/breakpoint/shared/utils.ts +1 -1
- package/src/common/BaseNode.ts +71 -9
- package/src/common/ComponentAPI.ts +6 -3
- package/src/common/EventEmitter.ts +1 -0
- package/src/concepts/Abort__.ts +8 -8
- package/src/concepts/AbstractInterface__.ts +14 -14
- package/src/concepts/Anchor__.ts +8 -60
- package/src/concepts/AnonymousFunction__.ts +21 -198
- package/src/concepts/App__.ts +1151 -1837
- package/src/concepts/Argument__.ts +16 -64
- package/src/concepts/Assignee__.ts +14 -72
- package/src/concepts/AssignmentLine__.ts +9 -14
- package/src/concepts/Assignment__.ts +9 -92
- package/src/concepts/Attribute__.ts +49 -176
- package/src/concepts/AuthInterface__.ts +19 -20
- package/src/concepts/AuthLogicForCallInterface__.ts +9 -36
- package/src/concepts/AuthLogic__.ts +45 -46
- package/src/concepts/BackendVariable__.ts +45 -167
- package/src/concepts/Backend__.ts +13 -57
- package/src/concepts/BaseSetter__.ts +72 -0
- package/src/concepts/BatchAssignment__.ts +18 -105
- package/src/concepts/BinaryExpression__.ts +36 -89
- package/src/concepts/BindAttribute__.ts +194 -343
- package/src/concepts/BindDirective__.ts +80 -135
- package/src/concepts/BindEvent__.ts +62 -126
- package/src/concepts/BindStyle__.ts +59 -112
- package/src/concepts/Block__.ts +8 -34
- package/src/concepts/BooleanLiteral__.ts +12 -5
- package/src/concepts/BusinessComponent__.ts +201 -502
- package/src/concepts/BusinessLogic__.ts +15 -15
- package/src/concepts/CallAuthInterface__.ts +10 -39
- package/src/concepts/CallConnector__.ts +15 -6
- package/src/concepts/CallEvent__.ts +16 -45
- package/src/concepts/CallFunction__.ts +104 -134
- package/src/concepts/CallInterface__.ts +20 -47
- package/src/concepts/CallLogic__.ts +93 -175
- package/src/concepts/CallQueryComponent__.ts +226 -520
- package/src/concepts/CapsulesSetter__.ts +254 -0
- package/src/concepts/Comment__.ts +11 -5
- package/src/concepts/CompletionProperty__.ts +29 -100
- package/src/concepts/ConfigGroup__.ts +13 -57
- package/src/concepts/ConfigPropertyValue__.ts +14 -26
- package/src/concepts/ConfigProperty__.ts +28 -68
- package/src/concepts/Configuration__.ts +9 -56
- package/src/concepts/Connection__.ts +27 -68
- package/src/concepts/ConnectorTrigger__.ts +57 -65
- package/src/concepts/Connector__.ts +339 -1448
- package/src/concepts/Constant__.ts +59 -182
- package/src/concepts/CountersignPolicy__.ts +12 -18
- package/src/concepts/DataSource__.ts +29 -68
- package/src/concepts/DatabaseTypeAnnotation__.ts +14 -19
- package/src/concepts/DefaultValue__.ts +10 -74
- package/src/concepts/Destination__.ts +28 -80
- package/src/concepts/End__.ts +11 -9
- package/src/concepts/EntityIndex__.ts +44 -51
- package/src/concepts/EntityProperty__.ts +86 -238
- package/src/concepts/Entity__.ts +43 -111
- package/src/concepts/EnumItem__.ts +29 -40
- package/src/concepts/EnumSelectSetter__.ts +254 -0
- package/src/concepts/Enum__.ts +38 -129
- package/src/concepts/EventDeclaration__.ts +95 -0
- package/src/concepts/Event__.ts +43 -92
- package/src/concepts/ExternalDestination__.ts +17 -91
- package/src/concepts/ForEachStatement__.ts +15 -198
- package/src/concepts/FrontendLibrary__.ts +111 -161
- package/src/concepts/FrontendType__.ts +21 -118
- package/src/concepts/FrontendVariable__.ts +10 -4
- package/src/concepts/Frontend__.ts +44 -250
- package/src/concepts/Function__.ts +28 -220
- package/src/concepts/I18nInfo__.ts +18 -20
- package/src/concepts/IconSetter__.ts +72 -0
- package/src/concepts/Identifier__.ts +27 -16
- package/src/concepts/IfStatement__.ts +9 -60
- package/src/concepts/ImageSetter__.ts +65 -0
- package/src/concepts/ImportedInterface__.ts +17 -4
- package/src/concepts/InputSetter__.ts +72 -0
- package/src/concepts/Integration__.ts +10 -114
- package/src/concepts/InterfaceParam__.ts +67 -186
- package/src/concepts/Interface__.ts +106 -200
- package/src/concepts/JSBlock__.ts +11 -11
- package/src/concepts/JavaLogic__.ts +19 -9
- package/src/concepts/LogicDeclaration__.ts +657 -0
- package/src/concepts/LogicItem__.ts +91 -96
- package/src/concepts/Logic__.ts +287 -434
- package/src/concepts/MatchCase__.ts +22 -72
- package/src/concepts/Match__.ts +23 -67
- package/src/concepts/MemberExpression__.ts +136 -132
- package/src/concepts/MetadataType__.ts +72 -167
- package/src/concepts/MicroApp__.ts +34 -29
- package/src/concepts/Module__.ts +259 -681
- package/src/concepts/MsgTriggerEvent__.ts +44 -79
- package/src/concepts/MsgTriggerLauncher__.ts +21 -54
- package/src/concepts/MultiApprovalPolicy__.ts +10 -18
- package/src/concepts/Namespace__.ts +278 -652
- package/src/concepts/NewComposite__.ts +62 -170
- package/src/concepts/NewList__.ts +12 -94
- package/src/concepts/NewMap__.ts +12 -94
- package/src/concepts/New__.ts +13 -2
- package/src/concepts/NullLiteral__.ts +8 -2
- package/src/concepts/NumberInputSetter__.ts +104 -0
- package/src/concepts/NumericLiteral__.ts +13 -63
- package/src/concepts/OqlQueryComponent__.ts +23 -71
- package/src/concepts/OverriddenLogic__.ts +71 -287
- package/src/concepts/Paginate__.ts +185 -0
- package/src/concepts/ParamWithGroup__.ts +26 -17
- package/src/concepts/Param__.ts +70 -211
- package/src/concepts/Point__.ts +14 -19
- package/src/concepts/ProcessComponent__.ts +33 -104
- package/src/concepts/ProcessElement__.ts +67 -422
- package/src/concepts/ProcessOutcome__.ts +12 -11
- package/src/concepts/ProcessOutcomes__.ts +9 -9
- package/src/concepts/Process__.ts +36 -200
- package/src/concepts/PropDeclaration__.ts +209 -0
- package/src/concepts/PropertySelectSetter__.ts +65 -0
- package/src/concepts/QueryAggregateExpression__.ts +18 -65
- package/src/concepts/QueryFieldExpression__.ts +22 -10
- package/src/concepts/QueryFromExpression__.ts +21 -41
- package/src/concepts/QueryGroupByExpression__.ts +8 -60
- package/src/concepts/QueryJoinExpression__.ts +64 -101
- package/src/concepts/QueryLimitExpression__.ts +9 -86
- package/src/concepts/QueryOrderByExpression__.ts +9 -86
- package/src/concepts/QuerySelectExpression__.ts +70 -118
- package/src/concepts/Rect__.ts +22 -23
- package/src/concepts/Return__.ts +60 -185
- package/src/concepts/Role__.ts +22 -29
- package/src/concepts/SelectMembers__.ts +16 -77
- package/src/concepts/SequentialPolicy__.ts +7 -2
- package/src/concepts/SetterOption__.ts +111 -0
- package/src/concepts/SlotDeclaration__.ts +488 -0
- package/src/concepts/Slot__.ts +35 -105
- package/src/concepts/SqlQueryComponent__.ts +21 -73
- package/src/concepts/Start__.ts +7 -8
- package/src/concepts/StaticString__.ts +16 -26
- package/src/concepts/StringInterpolation__.ts +9 -36
- package/src/concepts/StringLiteral__.ts +16 -7
- package/src/concepts/StructureProperty__.ts +38 -176
- package/src/concepts/Structure__.ts +32 -102
- package/src/concepts/SwitchCase__.ts +10 -62
- package/src/concepts/SwitchSetter__.ts +65 -0
- package/src/concepts/SwitchStatement__.ts +9 -35
- package/src/concepts/ThemeVariable__.ts +71 -0
- package/src/concepts/Theme__.ts +15 -17
- package/src/concepts/Transactional__.ts +67 -77
- package/src/concepts/TriggerEvent__.ts +14 -76
- package/src/concepts/TriggerLauncher__.ts +34 -38
- package/src/concepts/TypeAnnotation__.ts +50 -100
- package/src/concepts/TypeParam__.ts +10 -5
- package/src/concepts/UnaryExpression__.ts +12 -62
- package/src/concepts/Unparsed__.ts +11 -5
- package/src/concepts/UseComponent__.ts +14 -19
- package/src/concepts/ValidationRule__.ts +26 -105
- package/src/concepts/Variable__.ts +71 -195
- package/src/concepts/ViewBlockWithImage__.ts +80 -0
- package/src/concepts/ViewBlock__.ts +24 -27
- package/src/concepts/ViewComponentDeclaration__.ts +1670 -0
- package/src/concepts/ViewElement__.ts +502 -486
- package/src/concepts/View__.ts +576 -389
- package/src/concepts/WhileStatement__.ts +11 -62
- package/src/concepts/basics/stdlib/nasl.auth.ts +97 -34
- package/src/concepts/basics/stdlib/nasl.process.ts +103 -7
- package/src/concepts/basics/stdlib/nasl.util.ts +31 -31
- package/src/concepts/index__.ts +24 -8
- package/src/concepts/utils/asserts.ts +1544 -446
- package/src/concepts/utils/types.ts +121 -41
- package/src/config.ts +6 -0
- package/src/decorators/index.ts +3 -8
- package/src/enums/KEYWORDS.ts +2 -0
- package/src/generator/genBundleFiles.ts +129 -29
- package/src/generator/genReleaseBody.ts +0 -2
- package/src/generator/permission.ts +2 -2
- package/src/index.ts +1 -0
- package/src/natural/genNaturalTS.ts +2 -2
- package/src/natural/index.ts +3 -0
- package/src/natural/naslStdlibMap.ts +25 -19
- package/src/natural/prompt/analyzeClaims.ts +16 -0
- package/src/natural/prompt/executeClaims.ts +69 -0
- package/src/natural/transformTSCode.ts +12 -2
- package/src/server/createUiTs.ts +121 -155
- package/src/server/entity2LogicNamespace.ts +1 -16
- package/src/server/extendBaseNode.ts +46 -15
- package/src/server/formatTsUtils.ts +13 -13
- package/src/server/getConnector.ts +43 -35
- package/src/server/getFunctions.ts +3 -3
- package/src/server/getLogics.ts +34 -17
- package/src/server/getMemberIdentifier.ts +101 -145
- package/src/server/naslServer.ts +136 -74
- package/src/server/translator.ts +23 -5
- package/src/service/storage/init.ts +15 -8
- package/src/templator/genCreateBlock.ts +16 -16
- package/src/templator/genCurdEditMultipleKeyBlock.ts +23 -23
- package/src/templator/genCurdMultipleKeyBlock.ts +34 -44
- package/src/templator/genEditTableBlock.ts +15 -15
- package/src/templator/genEnumSelectBlock.ts +8 -8
- package/src/templator/genGridViewBlock.ts +18 -20
- package/src/templator/genListViewBlock.ts +10 -10
- package/src/templator/genQueryComponent.ts +33 -38
- package/src/templator/genSelectBlock.ts +10 -10
- package/src/templator/genTableBlock.ts +20 -12
- package/src/templator/genUpdateBlock.ts +15 -15
- package/src/templator/utils.ts +21 -30
- package/src/translator/types.ts +4 -0
- package/src/utils/index.ts +40 -5
- package/src/utils/string.ts +14 -0
- package/src/utils/time-slicing/performance.ts +3 -3
- package/test/concepts/call-interface/__snapshots__/getQuickInfoOffset.spec.ts.snap +1 -1
- package/test/concepts/call-interface/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -1
- package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +7 -8
- package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +5 -5
- package/test/concepts/entity/__snapshots__/toEmbeddedTS.spec.ts.snap +2 -2
- package/test/concepts/member-expression/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -1
- package/test/concepts/member-expression/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/member-expression/fixtures/elements.table-view.data.json +363 -10
- package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +655 -611
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +127 -6
- package/test/concepts/view-element/fixtures/table-data-source-calllogic-with-server-validation.json +2074 -0
- package/test/concepts/view-element/toEmbeddedTS.spec.ts +11 -0
- package/test/concepts/view-element/toVue.spec.ts +0 -1
- package/ts-worker/src/start.js +1 -0
- package/out/concepts/ViewComponent__.d.ts +0 -568
- package/out/concepts/ViewComponent__.js +0 -809
- package/out/concepts/ViewComponent__.js.map +0 -1
- package/src/concepts/ViewComponent__.ts +0 -1444
package/src/concepts/Logic__.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
2
1
|
import {
|
|
3
2
|
wrapForEachToGenerator as wrapForEach,
|
|
4
3
|
wrapIteratorToGenerator as wrapIterator,
|
|
@@ -19,6 +18,7 @@ import {
|
|
|
19
18
|
withGenerator,
|
|
20
19
|
TranslatorGenerator,
|
|
21
20
|
} from '../translator';
|
|
21
|
+
import type App from './App__';
|
|
22
22
|
import type Namespace from './Namespace__';
|
|
23
23
|
import type CallQueryComponent from './CallQueryComponent__';
|
|
24
24
|
import type ForEachStatement from './ForEachStatement__';
|
|
@@ -35,31 +35,33 @@ import type CallLogic from './CallLogic__';
|
|
|
35
35
|
import { CUSTOM_CONNECTOR_EDITABLE_SUFFIX } from './basics/constants';
|
|
36
36
|
import type Interface from './Interface__';
|
|
37
37
|
import type BusinessComponent from './BusinessComponent__';
|
|
38
|
+
import type AnonymousFunction from './AnonymousFunction__';
|
|
38
39
|
|
|
40
|
+
import type Module from './Module__';
|
|
41
|
+
import type Connector from './Connector__';
|
|
42
|
+
import type View from './View__';
|
|
43
|
+
import type Frontend from './Frontend__';
|
|
44
|
+
import type ProcessElement from './ProcessElement__';
|
|
45
|
+
import type Process from './Process__';
|
|
46
|
+
import type CallFunction from './CallFunction__';
|
|
39
47
|
//================================================================================
|
|
40
48
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
41
49
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
42
50
|
//================================================================================
|
|
43
51
|
import { EventPayload, Params } from '../common/EventEmitter';
|
|
44
|
-
import { concept, excludedInJSON, property, getConceptConstructor
|
|
52
|
+
import { concept, excludedInJSON, property, getConceptConstructor } from '../decorators';
|
|
45
53
|
|
|
46
54
|
import * as utils from '../utils';
|
|
47
55
|
import * as types from './utils/types';
|
|
48
56
|
import * as asserts from './utils/asserts';
|
|
57
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
49
58
|
import BaseNode from '../common/BaseNode';
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import type Module from './Module__';
|
|
57
|
-
import type Connector from './Connector__';
|
|
58
|
-
import type View from './View__';
|
|
59
|
-
import type ProcessElement from './ProcessElement__';
|
|
60
|
-
import type App from './App__';
|
|
61
|
-
import type Frontend from './Frontend__';
|
|
62
|
-
import type Process from './Process__';
|
|
59
|
+
import Transactional from './Transactional__';
|
|
60
|
+
import TypeParam from './TypeParam__';
|
|
61
|
+
import Param from './Param__';
|
|
62
|
+
import Return from './Return__';
|
|
63
|
+
import Variable from './Variable__';
|
|
64
|
+
import LogicItem from './LogicItem__';
|
|
63
65
|
|
|
64
66
|
/**
|
|
65
67
|
* 逻辑
|
|
@@ -68,7 +70,11 @@ import type Process from './Process__';
|
|
|
68
70
|
export class Logic extends BaseNode {
|
|
69
71
|
/** 类名 */
|
|
70
72
|
static readonly ConceptName: string = 'Logic';
|
|
71
|
-
|
|
73
|
+
/**
|
|
74
|
+
* 是否为抽象类
|
|
75
|
+
* 抽象类不能产生 concept: string
|
|
76
|
+
*/
|
|
77
|
+
static isAbstract: boolean = false;
|
|
72
78
|
/** 继承链 */
|
|
73
79
|
static readonly inheritanceChain: string[] = ['BaseNode'];
|
|
74
80
|
|
|
@@ -78,42 +84,53 @@ export class Logic extends BaseNode {
|
|
|
78
84
|
@property('concept')
|
|
79
85
|
// @ts-ignore
|
|
80
86
|
readonly concept!: 'Logic' | 'AuthLogic' | 'AuthLogicForCallInterface' | 'BusinessLogic';
|
|
81
|
-
|
|
82
87
|
/**
|
|
83
88
|
* 逻辑名称
|
|
84
89
|
*/
|
|
85
|
-
@property(
|
|
86
|
-
|
|
90
|
+
@property({
|
|
91
|
+
objectRef: '',
|
|
92
|
+
})
|
|
93
|
+
name: string = '';
|
|
87
94
|
|
|
88
95
|
/**
|
|
89
96
|
* 逻辑标题
|
|
90
97
|
*/
|
|
91
|
-
@property(
|
|
92
|
-
|
|
98
|
+
@property({
|
|
99
|
+
objectRef: '',
|
|
100
|
+
})
|
|
101
|
+
title: string;
|
|
93
102
|
|
|
94
103
|
/**
|
|
95
104
|
* 逻辑描述
|
|
96
105
|
*/
|
|
97
|
-
@property(
|
|
98
|
-
|
|
106
|
+
@property({
|
|
107
|
+
objectRef: '',
|
|
108
|
+
})
|
|
109
|
+
description: string;
|
|
99
110
|
|
|
100
111
|
/**
|
|
101
112
|
* 触发方式
|
|
102
113
|
*/
|
|
103
|
-
@property(
|
|
104
|
-
|
|
114
|
+
@property({
|
|
115
|
+
objectRef: '',
|
|
116
|
+
})
|
|
117
|
+
triggerType: string;
|
|
105
118
|
|
|
106
119
|
/**
|
|
107
120
|
* 定时任务表达式
|
|
108
121
|
*/
|
|
109
|
-
@property(
|
|
110
|
-
|
|
122
|
+
@property({
|
|
123
|
+
objectRef: '',
|
|
124
|
+
})
|
|
125
|
+
cron: string;
|
|
111
126
|
|
|
112
127
|
/**
|
|
113
128
|
* 是否可覆写
|
|
114
129
|
*/
|
|
115
|
-
@property(
|
|
116
|
-
|
|
130
|
+
@property({
|
|
131
|
+
objectRef: '',
|
|
132
|
+
})
|
|
133
|
+
overridable: boolean;
|
|
117
134
|
|
|
118
135
|
/**
|
|
119
136
|
* 事务
|
|
@@ -121,7 +138,7 @@ export class Logic extends BaseNode {
|
|
|
121
138
|
@property({
|
|
122
139
|
objectRef: 'Transactional',
|
|
123
140
|
})
|
|
124
|
-
transactional
|
|
141
|
+
transactional: Transactional;
|
|
125
142
|
|
|
126
143
|
/**
|
|
127
144
|
* 类型参数列表
|
|
@@ -131,7 +148,7 @@ export class Logic extends BaseNode {
|
|
|
131
148
|
isArray: true,
|
|
132
149
|
defaultValue: null,
|
|
133
150
|
})
|
|
134
|
-
typeParams
|
|
151
|
+
typeParams?: Array<TypeParam> = null;
|
|
135
152
|
|
|
136
153
|
/**
|
|
137
154
|
* 输入参数列表
|
|
@@ -183,60 +200,11 @@ export class Logic extends BaseNode {
|
|
|
183
200
|
})
|
|
184
201
|
playground: Array<LogicItem> = [];
|
|
185
202
|
|
|
186
|
-
/**
|
|
187
|
-
* 祖先 Module
|
|
188
|
-
*/
|
|
189
|
-
get module() {
|
|
190
|
-
return this.getAncestor('Module') as Module;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* 祖先 App
|
|
195
|
-
*/
|
|
196
|
-
get app() {
|
|
197
|
-
return this.getAncestor('App') as App;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* 祖先 Connector
|
|
202
|
-
*/
|
|
203
|
-
get connector() {
|
|
204
|
-
return this.getAncestor('Connector') as Connector;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* 祖先 View
|
|
209
|
-
*/
|
|
210
|
-
get view() {
|
|
211
|
-
return this.getAncestor('View') as View;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* 祖先 Frontend
|
|
216
|
-
*/
|
|
217
|
-
get frontend() {
|
|
218
|
-
return this.getAncestor('Frontend') as Frontend;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* 祖先 ProcessElement
|
|
223
|
-
*/
|
|
224
|
-
get processElement() {
|
|
225
|
-
return this.getAncestor('ProcessElement') as ProcessElement;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* 祖先 Process
|
|
230
|
-
*/
|
|
231
|
-
get process() {
|
|
232
|
-
return this.getAncestor('Process') as Process;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
203
|
/**
|
|
236
204
|
* @param source 需要合并的部分参数
|
|
237
205
|
*/
|
|
238
206
|
constructor(source?: Partial<Logic>) {
|
|
239
|
-
source = {
|
|
207
|
+
source = Object.assign({}, Logic.getDefaultOptions(), source);
|
|
240
208
|
super(source);
|
|
241
209
|
super.subConstructor(source);
|
|
242
210
|
}
|
|
@@ -245,18 +213,6 @@ export class Logic extends BaseNode {
|
|
|
245
213
|
return super.from(source, parentNode, parentKey) as Logic;
|
|
246
214
|
}
|
|
247
215
|
|
|
248
|
-
/**
|
|
249
|
-
* 从父级删除该节点
|
|
250
|
-
* @internal
|
|
251
|
-
*/
|
|
252
|
-
_delete() {
|
|
253
|
-
let params: Params = null;
|
|
254
|
-
if (this.parentNode) {
|
|
255
|
-
params = (this.parentNode as any)?.__removeLogic?.(this);
|
|
256
|
-
}
|
|
257
|
-
return params;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
216
|
/**
|
|
261
217
|
* 设置逻辑名称
|
|
262
218
|
*/
|
|
@@ -347,9 +303,8 @@ export class Logic extends BaseNode {
|
|
|
347
303
|
|
|
348
304
|
getTypeParamExistingNames(excludedList: Array<TypeParam> = []) {
|
|
349
305
|
const excludedSet = new Set(excludedList);
|
|
350
|
-
return ((this.typeParams as TypeParam[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
306
|
+
return ((this.typeParams as TypeParam[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
351
307
|
}
|
|
352
|
-
|
|
353
308
|
getTypeParamUniqueName(name = 'typeParam1') {
|
|
354
309
|
return utils.unique(name, this.getTypeParamExistingNames(), undefined, false);
|
|
355
310
|
}
|
|
@@ -1152,62 +1107,6 @@ export class Logic extends BaseNode {
|
|
|
1152
1107
|
return node;
|
|
1153
1108
|
}
|
|
1154
1109
|
|
|
1155
|
-
/**
|
|
1156
|
-
* 删除事务
|
|
1157
|
-
* @param name 事务名称
|
|
1158
|
-
*/
|
|
1159
|
-
removeTransactional(name: string): void;
|
|
1160
|
-
|
|
1161
|
-
/**
|
|
1162
|
-
* 删除事务
|
|
1163
|
-
* @param transactional 已有的事务实例
|
|
1164
|
-
*/
|
|
1165
|
-
removeTransactional(transactional: Transactional): void;
|
|
1166
|
-
|
|
1167
|
-
removeTransactional(options: string | Transactional) {
|
|
1168
|
-
let transactional: Transactional;
|
|
1169
|
-
if (typeof options === 'string') {
|
|
1170
|
-
transactional = this.transactional;
|
|
1171
|
-
if (!transactional) {
|
|
1172
|
-
throw new Error(`找不到事务 ${ options}`);
|
|
1173
|
-
}
|
|
1174
|
-
} else {
|
|
1175
|
-
transactional = options;
|
|
1176
|
-
}
|
|
1177
|
-
return transactional.delete();
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
__removeTransactional(transactional: Transactional) {
|
|
1181
|
-
const {parentKey} = transactional;
|
|
1182
|
-
const params: Params = {
|
|
1183
|
-
parentNode: this,
|
|
1184
|
-
parentKey,
|
|
1185
|
-
index: -1,
|
|
1186
|
-
object: null,
|
|
1187
|
-
oldObject: transactional,
|
|
1188
|
-
};
|
|
1189
|
-
if (parentKey) {
|
|
1190
|
-
params.parentKey = parentKey;
|
|
1191
|
-
// @ts-ignore
|
|
1192
|
-
const t = this.__v_raw || this;
|
|
1193
|
-
// @ts-ignore
|
|
1194
|
-
const n = transactional.__v_raw || transactional;
|
|
1195
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
1196
|
-
// @ts-ignore
|
|
1197
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1198
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
1199
|
-
params.index = index;
|
|
1200
|
-
} else {
|
|
1201
|
-
const q = (t as any)[parentKey];
|
|
1202
|
-
if ((q.__v_raw || q) === n) {
|
|
1203
|
-
params.index = 0;
|
|
1204
|
-
(this as any)[parentKey] = undefined;
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
return params;
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
1110
|
/**
|
|
1212
1111
|
* 删除类型参数
|
|
1213
1112
|
* @param name 类型参数名称
|
|
@@ -1225,7 +1124,7 @@ export class Logic extends BaseNode {
|
|
|
1225
1124
|
if (typeof options === 'string') {
|
|
1226
1125
|
typeParam = (this.typeParams as TypeParam[]).find((item) => item.name === options);
|
|
1227
1126
|
if (!typeParam) {
|
|
1228
|
-
throw new Error(
|
|
1127
|
+
throw new Error('找不到类型参数 ' + options);
|
|
1229
1128
|
}
|
|
1230
1129
|
} else {
|
|
1231
1130
|
typeParam = options;
|
|
@@ -1233,37 +1132,6 @@ export class Logic extends BaseNode {
|
|
|
1233
1132
|
return typeParam.delete();
|
|
1234
1133
|
}
|
|
1235
1134
|
|
|
1236
|
-
__removeTypeParam(typeParam: TypeParam) {
|
|
1237
|
-
const {parentKey} = typeParam;
|
|
1238
|
-
const params: Params = {
|
|
1239
|
-
parentNode: this,
|
|
1240
|
-
parentKey,
|
|
1241
|
-
index: -1,
|
|
1242
|
-
object: null,
|
|
1243
|
-
oldObject: typeParam,
|
|
1244
|
-
};
|
|
1245
|
-
if (parentKey) {
|
|
1246
|
-
params.parentKey = parentKey;
|
|
1247
|
-
// @ts-ignore
|
|
1248
|
-
const t = this.__v_raw || this;
|
|
1249
|
-
// @ts-ignore
|
|
1250
|
-
const n = typeParam.__v_raw || typeParam;
|
|
1251
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
1252
|
-
// @ts-ignore
|
|
1253
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1254
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
1255
|
-
params.index = index;
|
|
1256
|
-
} else {
|
|
1257
|
-
const q = (t as any)[parentKey];
|
|
1258
|
-
if ((q.__v_raw || q) === n) {
|
|
1259
|
-
params.index = 0;
|
|
1260
|
-
(this as any)[parentKey] = undefined;
|
|
1261
|
-
}
|
|
1262
|
-
}
|
|
1263
|
-
}
|
|
1264
|
-
return params;
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
1135
|
/**
|
|
1268
1136
|
* 删除输入参数
|
|
1269
1137
|
* @param name 输入参数名称
|
|
@@ -1281,7 +1149,7 @@ export class Logic extends BaseNode {
|
|
|
1281
1149
|
if (typeof options === 'string') {
|
|
1282
1150
|
param = (this.params as Param[]).find((item) => item.name === options);
|
|
1283
1151
|
if (!param) {
|
|
1284
|
-
throw new Error(
|
|
1152
|
+
throw new Error('找不到输入参数 ' + options);
|
|
1285
1153
|
}
|
|
1286
1154
|
} else {
|
|
1287
1155
|
param = options;
|
|
@@ -1289,37 +1157,6 @@ export class Logic extends BaseNode {
|
|
|
1289
1157
|
return param.delete();
|
|
1290
1158
|
}
|
|
1291
1159
|
|
|
1292
|
-
__removeParam(param: Param) {
|
|
1293
|
-
const {parentKey} = param;
|
|
1294
|
-
const params: Params = {
|
|
1295
|
-
parentNode: this,
|
|
1296
|
-
parentKey,
|
|
1297
|
-
index: -1,
|
|
1298
|
-
object: null,
|
|
1299
|
-
oldObject: param,
|
|
1300
|
-
};
|
|
1301
|
-
if (parentKey) {
|
|
1302
|
-
params.parentKey = parentKey;
|
|
1303
|
-
// @ts-ignore
|
|
1304
|
-
const t = this.__v_raw || this;
|
|
1305
|
-
// @ts-ignore
|
|
1306
|
-
const n = param.__v_raw || param;
|
|
1307
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
1308
|
-
// @ts-ignore
|
|
1309
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1310
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
1311
|
-
params.index = index;
|
|
1312
|
-
} else {
|
|
1313
|
-
const q = (t as any)[parentKey];
|
|
1314
|
-
if ((q.__v_raw || q) === n) {
|
|
1315
|
-
params.index = 0;
|
|
1316
|
-
(this as any)[parentKey] = undefined;
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
return params;
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
1160
|
/**
|
|
1324
1161
|
* 删除输出参数
|
|
1325
1162
|
* @param name 输出参数名称
|
|
@@ -1337,7 +1174,7 @@ export class Logic extends BaseNode {
|
|
|
1337
1174
|
if (typeof options === 'string') {
|
|
1338
1175
|
ret = (this.returns as Return[]).find((item) => item.name === options);
|
|
1339
1176
|
if (!ret) {
|
|
1340
|
-
throw new Error(
|
|
1177
|
+
throw new Error('找不到输出参数 ' + options);
|
|
1341
1178
|
}
|
|
1342
1179
|
} else {
|
|
1343
1180
|
ret = options;
|
|
@@ -1345,37 +1182,6 @@ export class Logic extends BaseNode {
|
|
|
1345
1182
|
return ret.delete();
|
|
1346
1183
|
}
|
|
1347
1184
|
|
|
1348
|
-
__removeReturn(ret: Return) {
|
|
1349
|
-
const {parentKey} = ret;
|
|
1350
|
-
const params: Params = {
|
|
1351
|
-
parentNode: this,
|
|
1352
|
-
parentKey,
|
|
1353
|
-
index: -1,
|
|
1354
|
-
object: null,
|
|
1355
|
-
oldObject: ret,
|
|
1356
|
-
};
|
|
1357
|
-
if (parentKey) {
|
|
1358
|
-
params.parentKey = parentKey;
|
|
1359
|
-
// @ts-ignore
|
|
1360
|
-
const t = this.__v_raw || this;
|
|
1361
|
-
// @ts-ignore
|
|
1362
|
-
const n = ret.__v_raw || ret;
|
|
1363
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
1364
|
-
// @ts-ignore
|
|
1365
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1366
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
1367
|
-
params.index = index;
|
|
1368
|
-
} else {
|
|
1369
|
-
const q = (t as any)[parentKey];
|
|
1370
|
-
if ((q.__v_raw || q) === n) {
|
|
1371
|
-
params.index = 0;
|
|
1372
|
-
(this as any)[parentKey] = undefined;
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
return params;
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
1185
|
/**
|
|
1380
1186
|
* 删除变量
|
|
1381
1187
|
* @param name 变量名称
|
|
@@ -1393,7 +1199,7 @@ export class Logic extends BaseNode {
|
|
|
1393
1199
|
if (typeof options === 'string') {
|
|
1394
1200
|
variable = (this.variables as Variable[]).find((item) => item.name === options);
|
|
1395
1201
|
if (!variable) {
|
|
1396
|
-
throw new Error(
|
|
1202
|
+
throw new Error('找不到变量 ' + options);
|
|
1397
1203
|
}
|
|
1398
1204
|
} else {
|
|
1399
1205
|
variable = options;
|
|
@@ -1401,37 +1207,6 @@ export class Logic extends BaseNode {
|
|
|
1401
1207
|
return variable.delete();
|
|
1402
1208
|
}
|
|
1403
1209
|
|
|
1404
|
-
__removeVariable(variable: Variable) {
|
|
1405
|
-
const {parentKey} = variable;
|
|
1406
|
-
const params: Params = {
|
|
1407
|
-
parentNode: this,
|
|
1408
|
-
parentKey,
|
|
1409
|
-
index: -1,
|
|
1410
|
-
object: null,
|
|
1411
|
-
oldObject: variable,
|
|
1412
|
-
};
|
|
1413
|
-
if (parentKey) {
|
|
1414
|
-
params.parentKey = parentKey;
|
|
1415
|
-
// @ts-ignore
|
|
1416
|
-
const t = this.__v_raw || this;
|
|
1417
|
-
// @ts-ignore
|
|
1418
|
-
const n = variable.__v_raw || variable;
|
|
1419
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
1420
|
-
// @ts-ignore
|
|
1421
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1422
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
1423
|
-
params.index = index;
|
|
1424
|
-
} else {
|
|
1425
|
-
const q = (t as any)[parentKey];
|
|
1426
|
-
if ((q.__v_raw || q) === n) {
|
|
1427
|
-
params.index = 0;
|
|
1428
|
-
(this as any)[parentKey] = undefined;
|
|
1429
|
-
}
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
return params;
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
1210
|
/**
|
|
1436
1211
|
* 删除逻辑项
|
|
1437
1212
|
* @param logicItem 已有的逻辑项实例
|
|
@@ -1439,7 +1214,7 @@ export class Logic extends BaseNode {
|
|
|
1439
1214
|
removeItemInBody(logicItem: LogicItem): void;
|
|
1440
1215
|
|
|
1441
1216
|
removeItemInBody(options: LogicItem) {
|
|
1442
|
-
|
|
1217
|
+
let logicItem: LogicItem = options;
|
|
1443
1218
|
return logicItem.delete();
|
|
1444
1219
|
}
|
|
1445
1220
|
|
|
@@ -1450,45 +1225,51 @@ export class Logic extends BaseNode {
|
|
|
1450
1225
|
removeItemInPlayground(logicItem: LogicItem): void;
|
|
1451
1226
|
|
|
1452
1227
|
removeItemInPlayground(options: LogicItem) {
|
|
1453
|
-
|
|
1228
|
+
let logicItem: LogicItem = options;
|
|
1454
1229
|
return logicItem.delete();
|
|
1455
1230
|
}
|
|
1456
1231
|
|
|
1457
|
-
__removeLogicItem(logicItem: LogicItem) {
|
|
1458
|
-
const {parentKey} = logicItem;
|
|
1459
|
-
const params: Params = {
|
|
1460
|
-
parentNode: this,
|
|
1461
|
-
parentKey,
|
|
1462
|
-
index: -1,
|
|
1463
|
-
object: null,
|
|
1464
|
-
oldObject: logicItem,
|
|
1465
|
-
};
|
|
1466
|
-
if (parentKey) {
|
|
1467
|
-
params.parentKey = parentKey;
|
|
1468
|
-
// @ts-ignore
|
|
1469
|
-
const t = this.__v_raw || this;
|
|
1470
|
-
// @ts-ignore
|
|
1471
|
-
const n = logicItem.__v_raw || logicItem;
|
|
1472
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
1473
|
-
// @ts-ignore
|
|
1474
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1475
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
1476
|
-
params.index = index;
|
|
1477
|
-
} else {
|
|
1478
|
-
const q = (t as any)[parentKey];
|
|
1479
|
-
if ((q.__v_raw || q) === n) {
|
|
1480
|
-
params.index = 0;
|
|
1481
|
-
(this as any)[parentKey] = undefined;
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
return params;
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
1232
|
//================================================================================
|
|
1489
1233
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1490
1234
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
1491
1235
|
//================================================================================
|
|
1236
|
+
/**
|
|
1237
|
+
* 祖先 Module
|
|
1238
|
+
*/
|
|
1239
|
+
get module() {
|
|
1240
|
+
return this.getAncestor('Module') as Module;
|
|
1241
|
+
}
|
|
1242
|
+
/**
|
|
1243
|
+
* 祖先 Connector
|
|
1244
|
+
*/
|
|
1245
|
+
get connector() {
|
|
1246
|
+
return this.getAncestor('Connector') as Connector;
|
|
1247
|
+
}
|
|
1248
|
+
/**
|
|
1249
|
+
* 祖先 View
|
|
1250
|
+
*/
|
|
1251
|
+
get view() {
|
|
1252
|
+
return this.getAncestor('View') as View;
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
* 祖先 Frontend
|
|
1256
|
+
*/
|
|
1257
|
+
get frontend() {
|
|
1258
|
+
return this.getAncestor('Frontend') as Frontend;
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* 祖先 ProcessElement
|
|
1262
|
+
*/
|
|
1263
|
+
get processElement() {
|
|
1264
|
+
return this.getAncestor('ProcessElement') as ProcessElement;
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
* 祖先 Process
|
|
1268
|
+
*/
|
|
1269
|
+
get process() {
|
|
1270
|
+
return this.getAncestor('Process') as Process;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1492
1273
|
// 用于calllogic树中定位是那个logic,回显
|
|
1493
1274
|
get calleewholeKey() {
|
|
1494
1275
|
return `${this.getNamespace()}.${this.name}`;
|
|
@@ -1656,105 +1437,100 @@ export class Logic extends BaseNode {
|
|
|
1656
1437
|
};
|
|
1657
1438
|
}
|
|
1658
1439
|
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
1440
|
toMockService() {
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1441
|
+
// 本此考虑将return 的类型 生成到 returnType: {} 字段
|
|
1442
|
+
// 在运行时根据类型直接生成mock数据
|
|
1443
|
+
const mockService: any = this.toService();
|
|
1444
|
+
mockService.returns = this.returns?.map((re) => {
|
|
1667
1445
|
// if(!re?.typeAnnotation){debugger}
|
|
1668
|
-
let tA = re?.typeAnnotation
|
|
1446
|
+
let tA = re?.typeAnnotation || re?.__TypeAnnotation;
|
|
1669
1447
|
return {
|
|
1670
|
-
typeAnnotation
|
|
1671
|
-
}
|
|
1672
|
-
})
|
|
1673
|
-
return mockService
|
|
1448
|
+
typeAnnotation: tA?.toJS(),
|
|
1449
|
+
};
|
|
1450
|
+
});
|
|
1451
|
+
return mockService;
|
|
1674
1452
|
}
|
|
1675
1453
|
|
|
1676
|
-
|
|
1677
1454
|
toService() {
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
}
|
|
1697
|
-
path = `/api/${entityPath}`;
|
|
1698
|
-
switch (this.name) {
|
|
1699
|
-
case 'get':
|
|
1700
|
-
method = 'GET';
|
|
1701
|
-
path = `/api/${entityPath}`;
|
|
1702
|
-
break;
|
|
1703
|
-
case 'create':
|
|
1704
|
-
method = 'POST';
|
|
1705
|
-
break;
|
|
1706
|
-
case 'update':
|
|
1707
|
-
method = 'PUT';
|
|
1708
|
-
break;
|
|
1709
|
-
case 'delete':
|
|
1710
|
-
method = 'DELETE';
|
|
1711
|
-
path = `/api/${entityPath}`;
|
|
1712
|
-
break;
|
|
1713
|
-
case 'createOrUpdate':
|
|
1714
|
-
method = 'POST';
|
|
1715
|
-
path = `/api/${entityPath}/createOrUpdate`;
|
|
1716
|
-
break;
|
|
1717
|
-
case 'updateBy':
|
|
1718
|
-
method = 'PUT';
|
|
1719
|
-
path = `/api/${entityPath}/by`;
|
|
1720
|
-
break;
|
|
1721
|
-
case 'deleteBy':
|
|
1722
|
-
method = 'DELETE';
|
|
1723
|
-
path = `/api/${entityPath}/by`;
|
|
1724
|
-
break;
|
|
1725
|
-
case 'batchCreate':
|
|
1726
|
-
method = 'POST';
|
|
1727
|
-
path = `/api/${entityPath}/batch`;
|
|
1728
|
-
break;
|
|
1729
|
-
case 'batchUpdate':
|
|
1730
|
-
method = 'PUT';
|
|
1731
|
-
path = `/api/${entityPath}/batch`;
|
|
1732
|
-
break;
|
|
1733
|
-
case 'batchDelete':
|
|
1734
|
-
method = 'DELETE';
|
|
1735
|
-
path = `/api/${entityPath}/batch`;
|
|
1736
|
-
break;
|
|
1737
|
-
case 'import':
|
|
1738
|
-
method = 'POST';
|
|
1739
|
-
path = `/api/${entityPath}/import`;
|
|
1740
|
-
break;
|
|
1741
|
-
default:
|
|
1742
|
-
break;
|
|
1743
|
-
}
|
|
1455
|
+
const { parentNode } = this;
|
|
1456
|
+
const { concept, name: entityName } = parentNode || {};
|
|
1457
|
+
const logicName = this.name;
|
|
1458
|
+
let serviceType = 'micro';
|
|
1459
|
+
let method = 'POST';
|
|
1460
|
+
let path = `/api/lcplogics/${logicName}`;
|
|
1461
|
+
if (concept === 'Module') {
|
|
1462
|
+
path = `/api/${entityName.replace('-', '_')}/${logicName}`;
|
|
1463
|
+
} else if (concept === 'Namespace') {
|
|
1464
|
+
serviceType = 'entity';
|
|
1465
|
+
let entityPath = entityName.replace(/[A-Z]/g, (char, index) => {
|
|
1466
|
+
const lowerChar = char.toLowerCase();
|
|
1467
|
+
return index === 0 ? lowerChar : `-${lowerChar}`;
|
|
1468
|
+
});
|
|
1469
|
+
const dataSource = parentNode.getAncestor('DataSource');
|
|
1470
|
+
// 默认数据源不动,其他数据源需要拼接数据源信息
|
|
1471
|
+
if (dataSource && dataSource.name !== 'defaultDS') {
|
|
1472
|
+
entityPath = `${dataSource.name}/${entityPath}`;
|
|
1744
1473
|
}
|
|
1474
|
+
path = `/api/${entityPath}`;
|
|
1475
|
+
switch (this.name) {
|
|
1476
|
+
case 'get':
|
|
1477
|
+
method = 'GET';
|
|
1478
|
+
path = `/api/${entityPath}`;
|
|
1479
|
+
break;
|
|
1480
|
+
case 'create':
|
|
1481
|
+
method = 'POST';
|
|
1482
|
+
break;
|
|
1483
|
+
case 'update':
|
|
1484
|
+
method = 'PUT';
|
|
1485
|
+
break;
|
|
1486
|
+
case 'delete':
|
|
1487
|
+
method = 'DELETE';
|
|
1488
|
+
path = `/api/${entityPath}`;
|
|
1489
|
+
break;
|
|
1490
|
+
case 'createOrUpdate':
|
|
1491
|
+
method = 'POST';
|
|
1492
|
+
path = `/api/${entityPath}/createOrUpdate`;
|
|
1493
|
+
break;
|
|
1494
|
+
case 'updateBy':
|
|
1495
|
+
method = 'PUT';
|
|
1496
|
+
path = `/api/${entityPath}/by`;
|
|
1497
|
+
break;
|
|
1498
|
+
case 'deleteBy':
|
|
1499
|
+
method = 'DELETE';
|
|
1500
|
+
path = `/api/${entityPath}/by`;
|
|
1501
|
+
break;
|
|
1502
|
+
case 'batchCreate':
|
|
1503
|
+
method = 'POST';
|
|
1504
|
+
path = `/api/${entityPath}/batch`;
|
|
1505
|
+
break;
|
|
1506
|
+
case 'batchUpdate':
|
|
1507
|
+
method = 'PUT';
|
|
1508
|
+
path = `/api/${entityPath}/batch`;
|
|
1509
|
+
break;
|
|
1510
|
+
case 'batchDelete':
|
|
1511
|
+
method = 'DELETE';
|
|
1512
|
+
path = `/api/${entityPath}/batch`;
|
|
1513
|
+
break;
|
|
1514
|
+
case 'import':
|
|
1515
|
+
method = 'POST';
|
|
1516
|
+
path = `/api/${entityPath}/import`;
|
|
1517
|
+
break;
|
|
1518
|
+
default:
|
|
1519
|
+
break;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1745
1522
|
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1523
|
+
return {
|
|
1524
|
+
config: {
|
|
1525
|
+
serviceType,
|
|
1526
|
+
},
|
|
1527
|
+
url: {
|
|
1528
|
+
method,
|
|
1529
|
+
path,
|
|
1530
|
+
},
|
|
1531
|
+
};
|
|
1755
1532
|
}
|
|
1756
1533
|
|
|
1757
|
-
|
|
1758
1534
|
@withSourceMapGenerator
|
|
1759
1535
|
*toEmbeddedTSInProcess(
|
|
1760
1536
|
state = createCompilerState(),
|
|
@@ -1815,9 +1591,9 @@ export class Logic extends BaseNode {
|
|
|
1815
1591
|
return code;
|
|
1816
1592
|
}
|
|
1817
1593
|
|
|
1818
|
-
toEmbeddedTSNoExport(state?: TranslatorState):
|
|
1594
|
+
toEmbeddedTSNoExport(state?: TranslatorState): string {
|
|
1595
|
+
return runSync(this.toEmbeddedTS(state, 'noExport'));
|
|
1819
1596
|
}
|
|
1820
|
-
|
|
1821
1597
|
get tsName() {
|
|
1822
1598
|
// 来自集成中心,且是连接内部的逻辑,则认为是编辑态的,需要加上后缀
|
|
1823
1599
|
if (this.connector && this.integration) {
|
|
@@ -1865,28 +1641,42 @@ export class Logic extends BaseNode {
|
|
|
1865
1641
|
code += '()';
|
|
1866
1642
|
}
|
|
1867
1643
|
// 需要类型推导的局部变量/返回值需要调整申明顺序
|
|
1868
|
-
const advanceMap: Map<Return | Variable, Assignment | BatchAssignment> = new Map();
|
|
1644
|
+
const advanceMap: Map<Return | Variable, Assignment | BatchAssignment | CallFunction> = new Map();
|
|
1869
1645
|
// const needGetSourceMapOqlList: Promise<any>[] = [];
|
|
1870
1646
|
yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
|
|
1871
|
-
if (el && (
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1647
|
+
if (el && (
|
|
1648
|
+
// 批量赋值
|
|
1649
|
+
asserts.isBatchAssignment(el)
|
|
1650
|
+
// 赋值
|
|
1651
|
+
|| (asserts.isAssignment(el) && el.left?.name)
|
|
1652
|
+
// 内置函数对集合类型的推导
|
|
1653
|
+
|| (
|
|
1654
|
+
asserts.isCallFunction(el) && el.derivablecollection?.name
|
|
1655
|
+
)
|
|
1656
|
+
)) {
|
|
1657
|
+
if (asserts.isAssignment(el) || asserts.isCallFunction(el)) {
|
|
1658
|
+
let expression: LogicItem;
|
|
1659
|
+
if (asserts.isAssignment(el)) {
|
|
1660
|
+
// 需要被推导的赋值左侧
|
|
1661
|
+
expression = el.left;
|
|
1662
|
+
} else if (asserts.isCallFunction(el)) {
|
|
1663
|
+
// 需要被推导的集合
|
|
1664
|
+
expression = el.derivablecollection;
|
|
1665
|
+
}
|
|
1666
|
+
// 宽泛意义上的变量(变量+出参)
|
|
1667
|
+
const advanceVar = [...(self.variables || []), ...(self.returns || [])].find((variable) => {
|
|
1668
|
+
return !variable.typeAnnotation && expression?.name === variable.name;
|
|
1669
|
+
});
|
|
1876
1670
|
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1877
1671
|
advanceMap.set(advanceVar, el);
|
|
1878
1672
|
}
|
|
1879
|
-
const advanceRn = self.returns?.find((ret) => !ret.typeAnnotation && el.left?.name === ret.name);
|
|
1880
|
-
if (advanceRn && !advanceMap.get(advanceRn)) {
|
|
1881
|
-
advanceMap.set(advanceRn, el);
|
|
1882
|
-
}
|
|
1883
1673
|
} else if (asserts.isBatchAssignment(el)) {
|
|
1884
1674
|
yield* wrapForEach(el.assignmentLines, function* warpForEachGenerator({ leftIndex }) {
|
|
1885
1675
|
const leftCode =
|
|
1886
1676
|
leftIndex.length === 1
|
|
1887
1677
|
? yield* el.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1888
1678
|
: yield* el.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
1889
|
-
|
|
1679
|
+
returnOrigin('');
|
|
1890
1680
|
const advanceVar = self.variables?.find(
|
|
1891
1681
|
(variable) => !variable.typeAnnotation && leftCode === variable.name,
|
|
1892
1682
|
);
|
|
@@ -1908,10 +1698,6 @@ export class Logic extends BaseNode {
|
|
|
1908
1698
|
returnOrigin('');
|
|
1909
1699
|
}
|
|
1910
1700
|
code += '{\n';
|
|
1911
|
-
if (self.exportInterface) {
|
|
1912
|
-
code += indent((state?.tabSize || 0) + 1);
|
|
1913
|
-
code += `let exportInterface = app.interfaces.${self.exportInterface.name};\n`
|
|
1914
|
-
}
|
|
1915
1701
|
// 用于虚拟节点的查找引用
|
|
1916
1702
|
if (Array.isArray(self.virtualParams)) {
|
|
1917
1703
|
for (const param of self.virtualParams) {
|
|
@@ -1953,6 +1739,26 @@ export class Logic extends BaseNode {
|
|
|
1953
1739
|
return;
|
|
1954
1740
|
}
|
|
1955
1741
|
code += `${indent((state?.tabSize || 0) + 1)}// @ts-ignore\n`;
|
|
1742
|
+
if (asserts.isCallFunction(assignment)) {
|
|
1743
|
+
yield* wrapForEach([
|
|
1744
|
+
{
|
|
1745
|
+
key: 'key',
|
|
1746
|
+
node: assignment.keyOfCollection
|
|
1747
|
+
},
|
|
1748
|
+
{
|
|
1749
|
+
key: 'item',
|
|
1750
|
+
node: assignment.itemOfCollection
|
|
1751
|
+
}
|
|
1752
|
+
], function* warpForEachGenerator({ key, node: itemNode }) {
|
|
1753
|
+
if (itemNode) {
|
|
1754
|
+
code += `const __${key}_${node?.name} = `;
|
|
1755
|
+
const itemCode = yield* itemNode?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
1756
|
+
returnOrigin('');
|
|
1757
|
+
code += yield* self.getRightCode(itemCode, assignment, itemNode);
|
|
1758
|
+
code += ';\n';
|
|
1759
|
+
}
|
|
1760
|
+
});
|
|
1761
|
+
}
|
|
1956
1762
|
code += `${indent((state?.tabSize || 0) + 1)}let `;
|
|
1957
1763
|
code += yield* node.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1958
1764
|
if (asserts.isBatchAssignment(assignment)) {
|
|
@@ -1961,7 +1767,7 @@ export class Logic extends BaseNode {
|
|
|
1961
1767
|
leftIndex.length === 1
|
|
1962
1768
|
? yield* assignment.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1963
1769
|
: yield* assignment.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
1964
|
-
|
|
1770
|
+
returnOrigin('');
|
|
1965
1771
|
if (leftCode === node.name) {
|
|
1966
1772
|
const rightNode: any =
|
|
1967
1773
|
rightIndex.length === 1
|
|
@@ -1989,28 +1795,37 @@ export class Logic extends BaseNode {
|
|
|
1989
1795
|
}
|
|
1990
1796
|
});
|
|
1991
1797
|
} else if (
|
|
1992
|
-
['NewList', 'NewMap'].includes(assignment.right?.concept) &&
|
|
1993
|
-
!(assignment.right as any)?.typeAnnotation
|
|
1798
|
+
['NewList', 'NewMap'].includes((assignment as Assignment).right?.concept) &&
|
|
1799
|
+
!((assignment as Assignment).right as any)?.typeAnnotation
|
|
1994
1800
|
) {
|
|
1995
|
-
const rightNode: any = assignment.right;
|
|
1801
|
+
const rightNode: any = (assignment as Assignment).right;
|
|
1996
1802
|
code += ' = ';
|
|
1997
1803
|
code += yield* rightNode.getInitCode(shiftState(state, code, { inline: true }));
|
|
1998
1804
|
} else if (
|
|
1999
|
-
assignment.right?.concept === 'NewComposite' &&
|
|
2000
|
-
(assignment.right as any)?.typeAnnotation?.typeKind === 'anonymousStructure'
|
|
1805
|
+
(assignment as Assignment).right?.concept === 'NewComposite' &&
|
|
1806
|
+
((assignment as Assignment).right as any)?.typeAnnotation?.typeKind === 'anonymousStructure'
|
|
2001
1807
|
) {
|
|
2002
|
-
const rightNode: any = assignment.right;
|
|
1808
|
+
const rightNode: any = (assignment as Assignment).right;
|
|
2003
1809
|
code += ' = ';
|
|
2004
1810
|
code += yield* rightNode.getInitCode(shiftState(state, code, { inline: true }));
|
|
2005
1811
|
} else if (
|
|
2006
|
-
assignment.right?.concept === 'NewComposite' &&
|
|
2007
|
-
(assignment.right as any)?.typeAnnotation?.typeKind === 'generic'
|
|
1812
|
+
(assignment as Assignment).right?.concept === 'NewComposite' &&
|
|
1813
|
+
((assignment as Assignment).right as any)?.typeAnnotation?.typeKind === 'generic'
|
|
2008
1814
|
) {
|
|
2009
|
-
const rightNode: any = assignment.right;
|
|
1815
|
+
const rightNode: any = (assignment as Assignment).right;
|
|
2010
1816
|
code += ' = ';
|
|
2011
1817
|
code += yield* rightNode.getNewCompositeCode(shiftState(state, code, { inline: true }));
|
|
1818
|
+
} else if (asserts.isCallFunction((assignment as CallFunction))) {
|
|
1819
|
+
const nodeName = node?.name;
|
|
1820
|
+
const keyNode = (assignment as CallFunction).keyOfCollection;
|
|
1821
|
+
const itemNode = (assignment as CallFunction).itemOfCollection;
|
|
1822
|
+
if ((assignment as CallFunction).isDerivableMap && keyNode && itemNode) {
|
|
1823
|
+
code += `: nasl.collection.Map<typeof __key_${nodeName}, typeof __item_${nodeName}>`;
|
|
1824
|
+
} else if ((assignment as CallFunction).isDerivableList && itemNode) {
|
|
1825
|
+
code += `: nasl.collection.List<typeof __item_${nodeName}>;`;
|
|
1826
|
+
}
|
|
2012
1827
|
} else {
|
|
2013
|
-
const rightNode: any = assignment.right;
|
|
1828
|
+
const rightNode: any = (assignment as Assignment).right;
|
|
2014
1829
|
// 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
|
|
2015
1830
|
if (rightNode?.typeAnnotation && !(asserts.isCallQueryComponent(rightNode) && !rightNode.isAutoInfer())) {
|
|
2016
1831
|
code += ': ';
|
|
@@ -2113,6 +1928,8 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2113
1928
|
logicName = `viewLogic_${name}`;
|
|
2114
1929
|
} else if (parentNode?.concept === 'BindEvent') {
|
|
2115
1930
|
logicName = `on_${parentNode?.parentNode?.name}_${name}`;
|
|
1931
|
+
} else if (this?.concept === 'BusinessLogic') {
|
|
1932
|
+
logicName = `businessLogic_${name}`;
|
|
2116
1933
|
} else {
|
|
2117
1934
|
logicName = this.name;
|
|
2118
1935
|
}
|
|
@@ -2210,9 +2027,15 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2210
2027
|
return code;
|
|
2211
2028
|
}
|
|
2212
2029
|
|
|
2213
|
-
*getRightCode(code: string, assignment: Assignment | BatchAssignment, rightNode: any) {
|
|
2030
|
+
*getRightCode(code: string, assignment: Assignment | BatchAssignment | CallFunction, rightNode: any) {
|
|
2214
2031
|
code = code.replaceAll('\n', ' ');
|
|
2215
|
-
|
|
2032
|
+
// 赋值语句的右侧或者集合内置函数的参数
|
|
2033
|
+
if (
|
|
2034
|
+
(asserts.isAssignment(assignment) && !assignment.right)
|
|
2035
|
+
|| (asserts.isCallFunction(assignment) && ((assignment.isDerivableList && !assignment.itemOfCollection) || (assignment.isDerivableMap && !(assignment.keyOfCollection && assignment.itemOfCollection))))
|
|
2036
|
+
) {
|
|
2037
|
+
return code;
|
|
2038
|
+
}
|
|
2216
2039
|
|
|
2217
2040
|
// 调用接口,参数替换成 null
|
|
2218
2041
|
if (asserts.isCallInterface(rightNode)) {
|
|
@@ -2234,6 +2057,12 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2234
2057
|
if (forEachStatement) {
|
|
2235
2058
|
code = yield* this.handleForEachCode(code, forEachStatement);
|
|
2236
2059
|
}
|
|
2060
|
+
// 可迭代的集合
|
|
2061
|
+
const callFunction = assignment.getAncestor('CallFunction') as CallFunction;
|
|
2062
|
+
if (callFunction && callFunction.isLoopCollection) {
|
|
2063
|
+
const anonymousFunction = assignment.getAncestor('AnonymousFunction') as AnonymousFunction;
|
|
2064
|
+
code = yield* this.handleCollectionCode(code, anonymousFunction, callFunction);
|
|
2065
|
+
}
|
|
2237
2066
|
// Match 需要针对分支缩小类型范围
|
|
2238
2067
|
const matchCase = assignment.getAncestor('MatchCase') as MatchCase;
|
|
2239
2068
|
if (matchCase) {
|
|
@@ -2282,6 +2111,31 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2282
2111
|
return code;
|
|
2283
2112
|
}
|
|
2284
2113
|
|
|
2114
|
+
*handleCollectionCode(code: string, anonymousFunction: AnonymousFunction, callFunction: CallFunction): Generator<any, string, any> {
|
|
2115
|
+
const { collection } = callFunction;
|
|
2116
|
+
const self = this;
|
|
2117
|
+
yield* wrapForEach(anonymousFunction.params, function* warpForEachGenerator(param, index) {
|
|
2118
|
+
if (code.includes(param?.name)) {
|
|
2119
|
+
const collectionTSCode = collection ? yield* collection.toEmbeddedTS() : '__IDENTIFIER__';
|
|
2120
|
+
code = self.handleReplaceCode(
|
|
2121
|
+
code,
|
|
2122
|
+
param.name,
|
|
2123
|
+
collectionTSCode === '__IDENTIFIER__' ? collectionTSCode : callFunction.isLoopMap && index === 0 ? `${collectionTSCode}.__getKey(0)` : `${collectionTSCode}.__get(0)`,
|
|
2124
|
+
);
|
|
2125
|
+
}
|
|
2126
|
+
});
|
|
2127
|
+
const parentForEachStatement = callFunction.getAncestor('ForEachStatement') as ForEachStatement;
|
|
2128
|
+
if (parentForEachStatement) {
|
|
2129
|
+
code = yield* this.handleForEachCode(code, parentForEachStatement);
|
|
2130
|
+
}
|
|
2131
|
+
const parentCallFunction = callFunction.getAncestor('CallFunction') as CallFunction;
|
|
2132
|
+
if (parentCallFunction?.isLoopCollection) {
|
|
2133
|
+
const parentAnonymousFunction = callFunction.getAncestor('AnonymousFunction') as AnonymousFunction;
|
|
2134
|
+
code = yield* this.handleCollectionCode(code, parentAnonymousFunction, parentCallFunction);
|
|
2135
|
+
}
|
|
2136
|
+
return code;
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2285
2139
|
*handleMatchCaseCode(code: string, matchCase: MatchCase): Generator<any, string, any> {
|
|
2286
2140
|
const match = matchCase.getAncestor('Match') as Match;
|
|
2287
2141
|
const expressionTsCode = yield* match.expression.toEmbeddedTS();
|
|
@@ -2407,9 +2261,8 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2407
2261
|
if (asserts.isFrontendLibrary(this.parentNode)) {
|
|
2408
2262
|
_path += `/frontends/${this.parentNode.type}`;
|
|
2409
2263
|
} else if (this.parentNode.concept === 'BindEvent' && this.getAncestor('Frontend')) {
|
|
2410
|
-
_path += `/frontendTypes/${this.getAncestor('FrontendType')?.name}/frontends/${
|
|
2411
|
-
|
|
2412
|
-
}/bindEvents/${name}.ts`;
|
|
2264
|
+
_path += `/frontendTypes/${this.getAncestor('FrontendType')?.name}/frontends/${this.getAncestor('Frontend')?.name
|
|
2265
|
+
}/bindEvents/${name}.ts`;
|
|
2413
2266
|
}
|
|
2414
2267
|
return `/embedded/${this.getAncestor('App')?.name}${_path}/logics/${name}.ts`;
|
|
2415
2268
|
}
|