@lcap/nasl 3.3.3-beta.2 → 3.3.3-beta.3
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/template/myProcess.d.ts +1 -1
- package/out/automate/template/myProcess.js +3 -2
- package/out/automate/template/myProcess.js.map +1 -1
- package/out/common/BaseNode.d.ts +4 -5
- package/out/common/BaseNode.js +15 -11
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/Anchor__.js +2 -1
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js +6 -3
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/Argument__.js +4 -3
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignment__.js +3 -2
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +2 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +3 -2
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +4 -3
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +7 -5
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +7 -7
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +9 -14
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +2 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +5 -3
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js +2 -1
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.js +5 -2
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallFunction__.js +6 -2
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +2 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +10 -5
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +4 -2
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +2 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +3 -2
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +3 -2
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +3 -2
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.js +3 -2
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/Connector__.js +15 -10
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.js +2 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.js +3 -2
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/Destination__.js +2 -1
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +6 -3
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js +6 -4
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.js +2 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +3 -2
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js +2 -1
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +4 -2
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Frontend__.js +14 -9
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js +11 -6
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +3 -0
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -1
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +2 -1
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +6 -3
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +5 -5
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/Logic__.js +25 -19
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js +6 -4
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +2 -1
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +2 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MetadataType__.d.ts +1 -1
- package/out/concepts/MetadataType__.js +8 -6
- package/out/concepts/MetadataType__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.js +3 -2
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.js +3 -2
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/Namespace__.js +33 -22
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.js +24 -13
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js +5 -3
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js +5 -3
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +2 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +4 -3
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +13 -7
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.js +4 -3
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +6 -4
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +22 -14
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.d.ts +1 -2
- package/out/concepts/ProcessOutcome__.js +16 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +1 -2
- package/out/concepts/ProcessOutcomes__.js +16 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js +15 -10
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +2 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +2 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js +2 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +3 -2
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js +2 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +2 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +3 -2
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Return__.js +4 -3
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/SelectMembers__.js +3 -2
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js +2 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js +2 -1
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js +5 -2
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +2 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +6 -4
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +2 -1
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +2 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/TriggerEvent__.js +3 -2
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +9 -4
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +2 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +2 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +4 -3
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.js +26 -5
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +2 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/generator/genBundleFiles.js +4 -4
- package/out/generator/icestark.d.ts +1 -1
- package/out/generator/icestark.js +4 -2
- package/out/generator/icestark.js.map +1 -1
- package/out/generator/qiankun.d.ts +1 -1
- package/out/generator/qiankun.js +3 -1
- package/out/generator/qiankun.js.map +1 -1
- package/out/server/translator.js +11 -0
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/jsoner.js +20 -1
- package/out/service/storage/jsoner.js.map +1 -1
- package/out/translator/utils.d.ts +1 -0
- package/out/translator/utils.js +16 -2
- package/out/translator/utils.js.map +1 -1
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.oql.ts +6 -1
- package/src/automate/template/myProcess.js +3 -2
- package/src/common/BaseNode.ts +19 -10
- package/src/concepts/Anchor__.ts +2 -1
- package/src/concepts/AnonymousFunction__.ts +6 -3
- package/src/concepts/Argument__.ts +7 -6
- package/src/concepts/Assignment__.ts +17 -17
- package/src/concepts/Attribute__.ts +2 -1
- package/src/concepts/AuthLogicForCallInterface__.ts +3 -2
- package/src/concepts/BackendVariable__.ts +7 -6
- package/src/concepts/BatchAssignment__.ts +7 -5
- package/src/concepts/BinaryExpression__.ts +10 -12
- package/src/concepts/BindAttribute__.ts +18 -15
- package/src/concepts/BindDirective__.ts +15 -14
- package/src/concepts/BindEvent__.ts +5 -3
- package/src/concepts/BindStyle__.ts +2 -1
- package/src/concepts/CallAuthInterface__.ts +5 -2
- package/src/concepts/CallFunction__.ts +17 -5
- package/src/concepts/CallInterface__.ts +2 -1
- package/src/concepts/CallLogic__.ts +22 -9
- package/src/concepts/CallQueryComponent__.ts +4 -2
- package/src/concepts/CompletionProperty__.ts +2 -1
- package/src/concepts/ConfigGroup__.ts +3 -2
- package/src/concepts/ConfigProperty__.ts +3 -2
- package/src/concepts/Configuration__.ts +3 -2
- package/src/concepts/Connection__.ts +3 -2
- package/src/concepts/Connector__.ts +15 -10
- package/src/concepts/Constant__.ts +2 -1
- package/src/concepts/DataSource__.ts +3 -2
- package/src/concepts/Destination__.ts +2 -1
- package/src/concepts/EntityProperty__.ts +7 -3
- package/src/concepts/Entity__.ts +6 -4
- package/src/concepts/Enum__.ts +2 -1
- package/src/concepts/Event__.ts +3 -2
- package/src/concepts/ExternalDestination__.ts +2 -1
- package/src/concepts/ForEachStatement__.ts +4 -2
- package/src/concepts/Frontend__.ts +14 -9
- package/src/concepts/Function__.ts +11 -6
- package/src/concepts/Identifier__.ts +7 -4
- package/src/concepts/IfStatement__.ts +2 -1
- package/src/concepts/InterfaceParam__.ts +2 -1
- package/src/concepts/Interface__.ts +6 -3
- package/src/concepts/JSBlock__.ts +24 -25
- package/src/concepts/Logic__.ts +26 -20
- package/src/concepts/MatchCase__.ts +6 -4
- package/src/concepts/Match__.ts +2 -1
- package/src/concepts/MemberExpression__.ts +2 -1
- package/src/concepts/MetadataType__.ts +18 -17
- package/src/concepts/MsgTriggerEvent__.ts +3 -2
- package/src/concepts/MsgTriggerLauncher__.ts +3 -2
- package/src/concepts/Namespace__.ts +33 -22
- package/src/concepts/NewComposite__.ts +23 -13
- package/src/concepts/NewList__.ts +13 -11
- package/src/concepts/NewMap__.ts +11 -9
- package/src/concepts/NumericLiteral__.ts +2 -1
- package/src/concepts/OqlQueryComponent__.ts +9 -8
- package/src/concepts/OverriddenLogic__.ts +13 -7
- package/src/concepts/Param__.ts +15 -14
- package/src/concepts/ProcessComponent__.ts +6 -4
- package/src/concepts/ProcessElement__.ts +22 -14
- package/src/concepts/ProcessOutcome__.ts +17 -2
- package/src/concepts/ProcessOutcomes__.ts +17 -2
- package/src/concepts/Process__.ts +15 -10
- package/src/concepts/QueryAggregateExpression__.ts +2 -1
- package/src/concepts/QueryFromExpression__.ts +2 -1
- package/src/concepts/QueryGroupByExpression__.ts +2 -1
- package/src/concepts/QueryJoinExpression__.ts +3 -2
- package/src/concepts/QueryLimitExpression__.ts +2 -1
- package/src/concepts/QueryOrderByExpression__.ts +2 -1
- package/src/concepts/QuerySelectExpression__.ts +3 -2
- package/src/concepts/Return__.ts +7 -6
- package/src/concepts/SelectMembers__.ts +3 -2
- package/src/concepts/Slot__.ts +2 -1
- package/src/concepts/SqlQueryComponent__.ts +2 -1
- package/src/concepts/StringInterpolation__.ts +13 -3
- package/src/concepts/StructureProperty__.ts +2 -1
- package/src/concepts/Structure__.ts +6 -4
- package/src/concepts/SwitchCase__.ts +2 -1
- package/src/concepts/SwitchStatement__.ts +2 -1
- package/src/concepts/TriggerEvent__.ts +3 -2
- package/src/concepts/TypeAnnotation__.ts +35 -28
- package/src/concepts/UnaryExpression__.ts +2 -1
- package/src/concepts/ValidationRule__.ts +2 -1
- package/src/concepts/Variable__.ts +7 -6
- package/src/concepts/ViewElement__.ts +27 -8
- package/src/concepts/WhileStatement__.ts +2 -1
- package/src/generator/genBundleFiles.ts +4 -4
- package/src/generator/icestark.ts +4 -2
- package/src/generator/qiankun.ts +3 -1
- package/src/server/translator.ts +10 -1
- package/src/service/storage/jsoner.ts +24 -3
- package/src/translator/utils.ts +15 -1
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -461
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/coverage/src/automate/engine/index.html +0 -116
- package/coverage/src/automate/engine/utils.js.html +0 -1414
- package/coverage/src/bak/index.html +0 -116
- package/coverage/src/bak/translator.js.html +0 -745
- package/coverage/src/breakpoint/generator/AfterStartNode.ts.html +0 -175
- package/coverage/src/breakpoint/generator/BeforeEndNode.ts.html +0 -169
- package/coverage/src/breakpoint/generator/BreakpointNode.ts.html +0 -1246
- package/coverage/src/breakpoint/generator/CallbackNode.ts.html +0 -145
- package/coverage/src/breakpoint/generator/index.html +0 -176
- package/coverage/src/breakpoint/generator/index.ts.html +0 -508
- package/coverage/src/breakpoint/index.html +0 -116
- package/coverage/src/breakpoint/index.ts.html +0 -94
- package/coverage/src/breakpoint/shared/constants.ts.html +0 -436
- package/coverage/src/breakpoint/shared/index.html +0 -176
- package/coverage/src/breakpoint/shared/index.ts.html +0 -94
- package/coverage/src/breakpoint/shared/operations.ts.html +0 -160
- package/coverage/src/breakpoint/shared/socket.ts.html +0 -1297
- package/coverage/src/breakpoint/shared/utils.ts.html +0 -1087
- package/coverage/src/breakpoint/store/core.ts.html +0 -1600
- package/coverage/src/breakpoint/store/dock.ts.html +0 -733
- package/coverage/src/breakpoint/store/index.html +0 -146
- package/coverage/src/breakpoint/store/index.ts.html +0 -91
- package/coverage/src/common/BaseNode.ts.html +0 -3904
- package/coverage/src/common/Command.ts.html +0 -310
- package/coverage/src/common/EventEmitter.ts.html +0 -370
- package/coverage/src/common/Messager.ts.html +0 -820
- package/coverage/src/common/asyncFuncMap.ts.html +0 -127
- package/coverage/src/common/index.html +0 -191
- package/coverage/src/common/index.ts.html +0 -94
- package/coverage/src/concepts/Abort__.ts.html +0 -331
- package/coverage/src/concepts/Anchor__.ts.html +0 -661
- package/coverage/src/concepts/AnonymousFunction__.ts.html +0 -2071
- package/coverage/src/concepts/App__.ts.html +0 -14095
- package/coverage/src/concepts/Argument__.ts.html +0 -979
- package/coverage/src/concepts/Assignee__.ts.html +0 -2263
- package/coverage/src/concepts/AssignmentLine__.ts.html +0 -412
- package/coverage/src/concepts/Assignment__.ts.html +0 -1162
- package/coverage/src/concepts/Attribute__.ts.html +0 -748
- package/coverage/src/concepts/AuthInterface__.ts.html +0 -370
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +0 -1999
- package/coverage/src/concepts/AuthLogic__.ts.html +0 -793
- package/coverage/src/concepts/BackendVariable__.ts.html +0 -1498
- package/coverage/src/concepts/Backend__.ts.html +0 -1180
- package/coverage/src/concepts/BatchAssignment__.ts.html +0 -3346
- package/coverage/src/concepts/BinaryExpression__.ts.html +0 -1543
- package/coverage/src/concepts/BindAttribute__.ts.html +0 -3928
- package/coverage/src/concepts/BindDirective__.ts.html +0 -1984
- package/coverage/src/concepts/BindEvent__.ts.html +0 -3463
- package/coverage/src/concepts/BindStyle__.ts.html +0 -1627
- package/coverage/src/concepts/BooleanLiteral__.ts.html +0 -421
- package/coverage/src/concepts/CallAuthInterface__.ts.html +0 -1630
- package/coverage/src/concepts/CallConnector__.ts.html +0 -925
- package/coverage/src/concepts/CallFunction__.ts.html +0 -2140
- package/coverage/src/concepts/CallInterface__.ts.html +0 -2764
- package/coverage/src/concepts/CallLogic__.ts.html +0 -4738
- package/coverage/src/concepts/CallQueryComponent__.ts.html +0 -5335
- package/coverage/src/concepts/Comment__.ts.html +0 -397
- package/coverage/src/concepts/CompletionProperty__.ts.html +0 -940
- package/coverage/src/concepts/ConfigGroup__.ts.html +0 -1120
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +0 -427
- package/coverage/src/concepts/ConfigProperty__.ts.html +0 -1363
- package/coverage/src/concepts/Configuration__.ts.html +0 -1042
- package/coverage/src/concepts/Connection__.ts.html +0 -1375
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +0 -598
- package/coverage/src/concepts/Connector__.ts.html +0 -4318
- package/coverage/src/concepts/Constant__.ts.html +0 -928
- package/coverage/src/concepts/DataSource__.ts.html +0 -1786
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +0 -334
- package/coverage/src/concepts/Destination__.ts.html +0 -2743
- package/coverage/src/concepts/End__.ts.html +0 -436
- package/coverage/src/concepts/EntityIndex__.ts.html +0 -790
- package/coverage/src/concepts/EntityProperty__.ts.html +0 -2716
- package/coverage/src/concepts/Entity__.ts.html +0 -2977
- package/coverage/src/concepts/EnumItem__.ts.html +0 -553
- package/coverage/src/concepts/Enum__.ts.html +0 -1246
- package/coverage/src/concepts/Event__.ts.html +0 -1099
- package/coverage/src/concepts/ExternalDestination__.ts.html +0 -1048
- package/coverage/src/concepts/ForEachStatement__.ts.html +0 -1978
- package/coverage/src/concepts/FrontendLibrary__.ts.html +0 -1738
- package/coverage/src/concepts/FrontendVariable__.ts.html +0 -292
- package/coverage/src/concepts/Frontend__.ts.html +0 -4024
- package/coverage/src/concepts/Function__.ts.html +0 -3664
- package/coverage/src/concepts/Identifier__.ts.html +0 -1060
- package/coverage/src/concepts/IfStatement__.ts.html +0 -1621
- package/coverage/src/concepts/Integration__.ts.html +0 -1255
- package/coverage/src/concepts/InterfaceParam__.ts.html +0 -1102
- package/coverage/src/concepts/Interface__.ts.html +0 -3433
- package/coverage/src/concepts/JSBlock__.ts.html +0 -601
- package/coverage/src/concepts/JavaLogic__.ts.html +0 -463
- package/coverage/src/concepts/LogicItem__.ts.html +0 -1174
- package/coverage/src/concepts/Logic__.ts.html +0 -7444
- package/coverage/src/concepts/MatchCase__.ts.html +0 -2968
- package/coverage/src/concepts/Match__.ts.html +0 -2476
- package/coverage/src/concepts/MemberExpression__.ts.html +0 -1732
- package/coverage/src/concepts/MetadataType__.ts.html +0 -1996
- package/coverage/src/concepts/MicroApp__.ts.html +0 -439
- package/coverage/src/concepts/Module__.ts.html +0 -9874
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +0 -1060
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +0 -1033
- package/coverage/src/concepts/Namespace__.ts.html +0 -8077
- package/coverage/src/concepts/NewComposite__.ts.html +0 -4795
- package/coverage/src/concepts/NewList__.ts.html +0 -1648
- package/coverage/src/concepts/NewMap__.ts.html +0 -2356
- package/coverage/src/concepts/New__.ts.html +0 -289
- package/coverage/src/concepts/NullLiteral__.ts.html +0 -352
- package/coverage/src/concepts/NumericLiteral__.ts.html +0 -691
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +0 -1231
- package/coverage/src/concepts/OverriddenLogic__.ts.html +0 -6892
- package/coverage/src/concepts/Param__.ts.html +0 -1735
- package/coverage/src/concepts/Point__.ts.html +0 -334
- package/coverage/src/concepts/ProcessComponent__.ts.html +0 -1693
- package/coverage/src/concepts/ProcessElement__.ts.html +0 -5983
- package/coverage/src/concepts/ProcessOutcome__.ts.html +0 -355
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +0 -346
- package/coverage/src/concepts/Process__.ts.html +0 -4831
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +0 -583
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +0 -586
- package/coverage/src/concepts/QueryFromExpression__.ts.html +0 -925
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +0 -574
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +0 -1582
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +0 -652
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +0 -694
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +0 -1729
- package/coverage/src/concepts/Rect__.ts.html +0 -376
- package/coverage/src/concepts/Return__.ts.html +0 -1327
- package/coverage/src/concepts/Role__.ts.html +0 -604
- package/coverage/src/concepts/SelectMembers__.ts.html +0 -1261
- package/coverage/src/concepts/Slot__.ts.html +0 -643
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +0 -997
- package/coverage/src/concepts/Start__.ts.html +0 -307
- package/coverage/src/concepts/StringInterpolation__.ts.html +0 -1150
- package/coverage/src/concepts/StringLiteral__.ts.html +0 -508
- package/coverage/src/concepts/StructureProperty__.ts.html +0 -1147
- package/coverage/src/concepts/Structure__.ts.html +0 -2119
- package/coverage/src/concepts/SwitchCase__.ts.html +0 -1189
- package/coverage/src/concepts/SwitchStatement__.ts.html +0 -892
- package/coverage/src/concepts/Theme__.ts.html +0 -361
- package/coverage/src/concepts/Transactional__.ts.html +0 -631
- package/coverage/src/concepts/TriggerEvent__.ts.html +0 -1027
- package/coverage/src/concepts/TriggerLauncher__.ts.html +0 -778
- package/coverage/src/concepts/TypeAnnotation__.ts.html +0 -3880
- package/coverage/src/concepts/TypeParam__.ts.html +0 -322
- package/coverage/src/concepts/UnaryExpression__.ts.html +0 -724
- package/coverage/src/concepts/Unparsed__.ts.html +0 -397
- package/coverage/src/concepts/UseComponent__.ts.html +0 -334
- package/coverage/src/concepts/ValidationRule__.ts.html +0 -1855
- package/coverage/src/concepts/Variable__.ts.html +0 -1534
- package/coverage/src/concepts/ViewBlock__.ts.html +0 -355
- package/coverage/src/concepts/ViewComponent__.ts.html +0 -4255
- package/coverage/src/concepts/ViewElement__.ts.html +0 -8956
- package/coverage/src/concepts/View__.ts.html +0 -8875
- package/coverage/src/concepts/WhileStatement__.ts.html +0 -1096
- package/coverage/src/concepts/basics/stdlib/index.html +0 -356
- package/coverage/src/concepts/basics/stdlib/index.ts.html +0 -208
- package/coverage/src/concepts/basics/stdlib/nasl.auth.ts.html +0 -565
- package/coverage/src/concepts/basics/stdlib/nasl.browser.ts.html +0 -517
- package/coverage/src/concepts/basics/stdlib/nasl.collection.ts.html +0 -226
- package/coverage/src/concepts/basics/stdlib/nasl.configuration.ts.html +0 -172
- package/coverage/src/concepts/basics/stdlib/nasl.core.ts.html +0 -214
- package/coverage/src/concepts/basics/stdlib/nasl.event.ts.html +0 -145
- package/coverage/src/concepts/basics/stdlib/nasl.http.ts.html +0 -589
- package/coverage/src/concepts/basics/stdlib/nasl.interface.ts.html +0 -214
- package/coverage/src/concepts/basics/stdlib/nasl.io.ts.html +0 -229
- package/coverage/src/concepts/basics/stdlib/nasl.logging.ts.html +0 -268
- package/coverage/src/concepts/basics/stdlib/nasl.process.ts.html +0 -1999
- package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +0 -3259
- package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +0 -6844
- package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +0 -1768
- package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +0 -163
- package/coverage/src/concepts/basics/stdlib/timeZone.ts.html +0 -664
- package/coverage/src/concepts/basics/types/coreTypeList.ts.html +0 -121
- package/coverage/src/concepts/basics/types/index.html +0 -131
- package/coverage/src/concepts/basics/types/index.ts.html +0 -160
- package/coverage/src/concepts/index.html +0 -1976
- package/coverage/src/concepts/index.ts.html +0 -103
- package/coverage/src/concepts/index__.ts.html +0 -454
- package/coverage/src/config.ts.html +0 -325
- package/coverage/src/decorators/index.html +0 -131
- package/coverage/src/decorators/index.ts.html +0 -574
- package/coverage/src/decorators/promise.ts.html +0 -169
- package/coverage/src/eventBus.ts.html +0 -100
- package/coverage/src/generator/compileComponent.ts.html +0 -142
- package/coverage/src/generator/genBundleFiles.ts.html +0 -1822
- package/coverage/src/generator/genHash.ts.html +0 -124
- package/coverage/src/generator/genMetaData.ts.html +0 -1129
- package/coverage/src/generator/genReleaseBody.ts.html +0 -1282
- package/coverage/src/generator/icestark.ts.html +0 -220
- package/coverage/src/generator/index.html +0 -266
- package/coverage/src/generator/index.ts.html +0 -106
- package/coverage/src/generator/microApp.ts.html +0 -172
- package/coverage/src/generator/permission.ts.html +0 -1036
- package/coverage/src/generator/qiankun.ts.html +0 -232
- package/coverage/src/generator/styleReplacer.ts.html +0 -199
- package/coverage/src/index.html +0 -146
- package/coverage/src/index.ts.html +0 -121
- package/coverage/src/manager/diagnostic.ts.html +0 -442
- package/coverage/src/manager/index.html +0 -131
- package/coverage/src/manager/stepRecorder.ts.html +0 -457
- package/coverage/src/natural/genNaturalTS.ts.html +0 -355
- package/coverage/src/natural/index.html +0 -161
- package/coverage/src/natural/index.ts.html +0 -91
- package/coverage/src/natural/naslStdlibMap.ts.html +0 -157
- package/coverage/src/natural/transformTSCode.ts.html +0 -2707
- package/coverage/src/sentry/index.html +0 -116
- package/coverage/src/sentry/index.ts.html +0 -676
- package/coverage/src/server/createUiTs.ts.html +0 -919
- package/coverage/src/server/entity2LogicNamespace.ts.html +0 -1294
- package/coverage/src/server/event.js.html +0 -526
- package/coverage/src/server/extendBaseNode.ts.html +0 -1765
- package/coverage/src/server/formatTsUtils.ts.html +0 -2689
- package/coverage/src/server/getConnector.ts.html +0 -316
- package/coverage/src/server/getExtensionModules.ts.html +0 -178
- package/coverage/src/server/getFunctions.ts.html +0 -133
- package/coverage/src/server/getInterfaces.ts.html +0 -229
- package/coverage/src/server/getLogging.ts.html +0 -100
- package/coverage/src/server/getLogics.ts.html +0 -1363
- package/coverage/src/server/getMemberIdentifier.ts.html +0 -1609
- package/coverage/src/server/getProcessComponents.ts.html +0 -112
- package/coverage/src/server/getProcesses.ts.html +0 -2023
- package/coverage/src/server/getValidates.ts.html +0 -115
- package/coverage/src/server/index.html +0 -401
- package/coverage/src/server/index.ts.html +0 -229
- package/coverage/src/server/naslServer.ts.html +0 -14812
- package/coverage/src/server/naslStdlibMap.ts.html +0 -241
- package/coverage/src/server/process2LogicNamespace.ts.html +0 -454
- package/coverage/src/server/translator.ts.html +0 -2566
- package/coverage/src/service/creator/add.configs.js.html +0 -397
- package/coverage/src/service/creator/errHandles.js.html +0 -304
- package/coverage/src/service/creator/index.html +0 -146
- package/coverage/src/service/creator/index.js.html +0 -352
- package/coverage/src/service/datasource/api.js.html +0 -118
- package/coverage/src/service/datasource/index.html +0 -131
- package/coverage/src/service/datasource/index.js.html +0 -103
- package/coverage/src/service/logic/api.js.html +0 -109
- package/coverage/src/service/logic/index.html +0 -131
- package/coverage/src/service/logic/index.js.html +0 -103
- package/coverage/src/service/storage/api.js.html +0 -202
- package/coverage/src/service/storage/index.html +0 -206
- package/coverage/src/service/storage/index.ts.html +0 -103
- package/coverage/src/service/storage/init.ts.html +0 -3661
- package/coverage/src/service/storage/jsoner.ts.html +0 -502
- package/coverage/src/service/storage/map.ts.html +0 -256
- package/coverage/src/service/storage/service.ts.html +0 -331
- package/coverage/src/service/storage/storagePoint.ts.html +0 -304
- package/coverage/src/templator/genCallComponentLogic.ts.html +0 -163
- package/coverage/src/templator/genCreateBlock.ts.html +0 -1084
- package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +0 -1627
- package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +0 -2242
- package/coverage/src/templator/genEditTableBlock.ts.html +0 -1024
- package/coverage/src/templator/genEnumSelectBlock.ts.html +0 -178
- package/coverage/src/templator/genGetBlock.ts.html +0 -451
- package/coverage/src/templator/genGridViewBlock.ts.html +0 -1114
- package/coverage/src/templator/genListViewBlock.ts.html +0 -475
- package/coverage/src/templator/genQueryComponent.ts.html +0 -1207
- package/coverage/src/templator/genSelectBlock.ts.html +0 -1243
- package/coverage/src/templator/genTableBlock.ts.html +0 -973
- package/coverage/src/templator/genUpdateBlock.ts.html +0 -1204
- package/coverage/src/templator/index.html +0 -326
- package/coverage/src/templator/index.ts.html +0 -154
- package/coverage/src/templator/utils.ts.html +0 -1927
- package/coverage/src/translator/constant.ts.html +0 -106
- package/coverage/src/translator/index.html +0 -146
- package/coverage/src/translator/index.ts.html +0 -94
- package/coverage/src/translator/utils.ts.html +0 -493
- package/coverage/src/utils/cookie.ts.html +0 -265
- package/coverage/src/utils/env.ts.html +0 -91
- package/coverage/src/utils/index.html +0 -236
- package/coverage/src/utils/index.ts.html +0 -748
- package/coverage/src/utils/logger.ts.html +0 -145
- package/coverage/src/utils/sortTsString.ts.html +0 -187
- package/coverage/src/utils/string.ts.html +0 -502
- package/coverage/src/utils/time-slicing.ts.html +0 -418
- package/coverage/src/utils/traverse.ts.html +0 -568
- package/coverage/src/utils/window.ts.html +0 -112
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { indent, withSourceMap, createCompilerState } from '../translator';
|
|
2
|
+
import { getFlowAfterElements } from '../server/getProcesses';
|
|
2
3
|
//================================================================================
|
|
3
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
4
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -71,7 +72,21 @@ export class ProcessOutcomes extends LogicItem {
|
|
|
71
72
|
//================================================================================
|
|
72
73
|
@withSourceMap()
|
|
73
74
|
toEmbeddedTS(state = createCompilerState()): string {
|
|
74
|
-
const
|
|
75
|
+
const tab0 = indent(state?.tabSize || 0);
|
|
76
|
+
const tab1 = indent((state?.tabSize || 0) + 1);
|
|
77
|
+
let code = ''
|
|
78
|
+
|
|
79
|
+
const afterLinkValues = getFlowAfterElements(this.processElement).map((l) => l.flowValue);
|
|
80
|
+
code += `return () => `
|
|
81
|
+
if (this.flowRefs.length > 0) {
|
|
82
|
+
code += `{\n`;
|
|
83
|
+
code += `${tab1}let afterLinks: ${afterLinkValues.map((item) => `'${item}'`).join(' | ')};\n`;
|
|
84
|
+
code += `${tab1}let outComes: ${this.flowRefs.map((item) => `'${item}'`).join(' | ')};\n`;
|
|
85
|
+
code += `${tab1}nasl.core.assign(afterLinks, outComes);\n`;
|
|
86
|
+
code += `${tab0}};\n`;
|
|
87
|
+
} else {
|
|
88
|
+
code += `__IDENTIFIER__`;
|
|
89
|
+
}
|
|
75
90
|
return code;
|
|
76
91
|
}
|
|
77
92
|
//================================================================================
|
|
@@ -167,7 +167,7 @@ export class Process extends BaseNode {
|
|
|
167
167
|
|
|
168
168
|
getBindEventExistingNames(excludedList: Array<BindEvent> = []) {
|
|
169
169
|
const excludedSet = new Set(excludedList);
|
|
170
|
-
return ((this.bindEvents as BindEvent[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
170
|
+
return ((this.bindEvents as BindEvent[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
171
171
|
}
|
|
172
172
|
getBindEventUniqueName(name = 'bindEvent1') {
|
|
173
173
|
return utils.unique(name, this.getBindEventExistingNames(), undefined, false);
|
|
@@ -320,7 +320,7 @@ export class Process extends BaseNode {
|
|
|
320
320
|
|
|
321
321
|
getParamExistingNames(excludedList: Array<Param> = []) {
|
|
322
322
|
const excludedSet = new Set(excludedList);
|
|
323
|
-
return ((this.params as Param[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
323
|
+
return ((this.params as Param[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
324
324
|
}
|
|
325
325
|
getParamUniqueName(name = 'param1') {
|
|
326
326
|
return utils.unique(name, this.getParamExistingNames(), undefined, false);
|
|
@@ -473,7 +473,7 @@ export class Process extends BaseNode {
|
|
|
473
473
|
|
|
474
474
|
getReturnExistingNames(excludedList: Array<Return> = []) {
|
|
475
475
|
const excludedSet = new Set(excludedList);
|
|
476
|
-
return ((this.returns as Return[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
476
|
+
return ((this.returns as Return[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
477
477
|
}
|
|
478
478
|
getReturnUniqueName(name = 'ret1') {
|
|
479
479
|
return utils.unique(name, this.getReturnExistingNames(), undefined, false);
|
|
@@ -626,7 +626,7 @@ export class Process extends BaseNode {
|
|
|
626
626
|
|
|
627
627
|
getConstantExistingNames(excludedList: Array<Constant> = []) {
|
|
628
628
|
const excludedSet = new Set(excludedList);
|
|
629
|
-
return ((this.constants as Constant[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
629
|
+
return ((this.constants as Constant[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
630
630
|
}
|
|
631
631
|
getConstantUniqueName(name = 'constant1') {
|
|
632
632
|
return utils.unique(name, this.getConstantExistingNames(), undefined, false);
|
|
@@ -781,7 +781,7 @@ export class Process extends BaseNode {
|
|
|
781
781
|
const excludedSet = new Set(excludedList);
|
|
782
782
|
return ((this.elements as ProcessElement[]) || [])
|
|
783
783
|
.filter((item) => !excludedSet.has(item))
|
|
784
|
-
.map((item) => item
|
|
784
|
+
.map((item) => item?.name);
|
|
785
785
|
}
|
|
786
786
|
getElementUniqueName(name = 'element1') {
|
|
787
787
|
return utils.unique(name, this.getElementExistingNames(), undefined, false);
|
|
@@ -973,7 +973,8 @@ export class Process extends BaseNode {
|
|
|
973
973
|
// @ts-ignore
|
|
974
974
|
const n = bindEvent.__v_raw || bindEvent;
|
|
975
975
|
if (Array.isArray((t as any)[parentKey])) {
|
|
976
|
-
|
|
976
|
+
// @ts-ignore
|
|
977
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
977
978
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
978
979
|
params.index = index;
|
|
979
980
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -1025,7 +1026,8 @@ export class Process extends BaseNode {
|
|
|
1025
1026
|
// @ts-ignore
|
|
1026
1027
|
const n = param.__v_raw || param;
|
|
1027
1028
|
if (Array.isArray((t as any)[parentKey])) {
|
|
1028
|
-
|
|
1029
|
+
// @ts-ignore
|
|
1030
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1029
1031
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1030
1032
|
params.index = index;
|
|
1031
1033
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -1077,7 +1079,8 @@ export class Process extends BaseNode {
|
|
|
1077
1079
|
// @ts-ignore
|
|
1078
1080
|
const n = ret.__v_raw || ret;
|
|
1079
1081
|
if (Array.isArray((t as any)[parentKey])) {
|
|
1080
|
-
|
|
1082
|
+
// @ts-ignore
|
|
1083
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1081
1084
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1082
1085
|
params.index = index;
|
|
1083
1086
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -1129,7 +1132,8 @@ export class Process extends BaseNode {
|
|
|
1129
1132
|
// @ts-ignore
|
|
1130
1133
|
const n = constant.__v_raw || constant;
|
|
1131
1134
|
if (Array.isArray((t as any)[parentKey])) {
|
|
1132
|
-
|
|
1135
|
+
// @ts-ignore
|
|
1136
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1133
1137
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1134
1138
|
params.index = index;
|
|
1135
1139
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -1181,7 +1185,8 @@ export class Process extends BaseNode {
|
|
|
1181
1185
|
// @ts-ignore
|
|
1182
1186
|
const n = element.__v_raw || element;
|
|
1183
1187
|
if (Array.isArray((t as any)[parentKey])) {
|
|
1184
|
-
|
|
1188
|
+
// @ts-ignore
|
|
1189
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1185
1190
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1186
1191
|
params.index = index;
|
|
1187
1192
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -104,7 +104,8 @@ export class QueryAggregateExpression extends LogicItem {
|
|
|
104
104
|
// @ts-ignore
|
|
105
105
|
const n = logicItem.__v_raw || logicItem;
|
|
106
106
|
if (Array.isArray((t as any)[parentKey])) {
|
|
107
|
-
|
|
107
|
+
// @ts-ignore
|
|
108
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
108
109
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
109
110
|
params.index = index;
|
|
110
111
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -209,7 +209,8 @@ export class QueryFromExpression extends LogicItem {
|
|
|
209
209
|
// @ts-ignore
|
|
210
210
|
const n = logicItem.__v_raw || logicItem;
|
|
211
211
|
if (Array.isArray((t as any)[parentKey])) {
|
|
212
|
-
|
|
212
|
+
// @ts-ignore
|
|
213
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
213
214
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
214
215
|
params.index = index;
|
|
215
216
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -107,7 +107,8 @@ export class QueryGroupByExpression extends LogicItem {
|
|
|
107
107
|
// @ts-ignore
|
|
108
108
|
const n = logicItem.__v_raw || logicItem;
|
|
109
109
|
if (Array.isArray((t as any)[parentKey])) {
|
|
110
|
-
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
111
112
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
112
113
|
params.index = index;
|
|
113
114
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -99,7 +99,7 @@ export class QueryJoinExpression extends LogicItem {
|
|
|
99
99
|
const excludedSet = new Set(excludedList);
|
|
100
100
|
return ((this.onExpressions as BinaryExpression[]) || [])
|
|
101
101
|
.filter((item) => !excludedSet.has(item))
|
|
102
|
-
.map((item) => item
|
|
102
|
+
.map((item) => item?.name);
|
|
103
103
|
}
|
|
104
104
|
getBinaryExpressionUniqueName(name = 'binaryExpression1') {
|
|
105
105
|
return utils.unique(name, this.getBinaryExpressionExistingNames(), undefined, false);
|
|
@@ -420,7 +420,8 @@ export class QueryJoinExpression extends LogicItem {
|
|
|
420
420
|
// @ts-ignore
|
|
421
421
|
const n = logicItem.__v_raw || logicItem;
|
|
422
422
|
if (Array.isArray((t as any)[parentKey])) {
|
|
423
|
-
|
|
423
|
+
// @ts-ignore
|
|
424
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
424
425
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
425
426
|
params.index = index;
|
|
426
427
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -151,7 +151,8 @@ export class QueryLimitExpression extends LogicItem {
|
|
|
151
151
|
// @ts-ignore
|
|
152
152
|
const n = logicItem.__v_raw || logicItem;
|
|
153
153
|
if (Array.isArray((t as any)[parentKey])) {
|
|
154
|
-
|
|
154
|
+
// @ts-ignore
|
|
155
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
155
156
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
156
157
|
params.index = index;
|
|
157
158
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -151,7 +151,8 @@ export class QueryOrderByExpression extends LogicItem {
|
|
|
151
151
|
// @ts-ignore
|
|
152
152
|
const n = logicItem.__v_raw || logicItem;
|
|
153
153
|
if (Array.isArray((t as any)[parentKey])) {
|
|
154
|
-
|
|
154
|
+
// @ts-ignore
|
|
155
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
155
156
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
156
157
|
params.index = index;
|
|
157
158
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -76,7 +76,7 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
76
76
|
const excludedSet = new Set(excludedList);
|
|
77
77
|
return ((this.selectElements as QueryAggregateExpression[]) || [])
|
|
78
78
|
.filter((item) => !excludedSet.has(item))
|
|
79
|
-
.map((item) => item
|
|
79
|
+
.map((item) => item?.name);
|
|
80
80
|
}
|
|
81
81
|
getQueryAggregateExpressionUniqueName(name = 'queryAggregateExpression1') {
|
|
82
82
|
return utils.unique(name, this.getQueryAggregateExpressionExistingNames(), undefined, false);
|
|
@@ -492,7 +492,8 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
492
492
|
// @ts-ignore
|
|
493
493
|
const n = logicItem.__v_raw || logicItem;
|
|
494
494
|
if (Array.isArray((t as any)[parentKey])) {
|
|
495
|
-
|
|
495
|
+
// @ts-ignore
|
|
496
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
496
497
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
497
498
|
params.index = index;
|
|
498
499
|
} else if ((t as any)[parentKey] === n) {
|
package/src/concepts/Return__.ts
CHANGED
|
@@ -8,7 +8,7 @@ function tryJSONParse(str: string) {
|
|
|
8
8
|
|
|
9
9
|
try {
|
|
10
10
|
result = JSON.parse(str);
|
|
11
|
-
} catch (e) {
|
|
11
|
+
} catch (e) {}
|
|
12
12
|
|
|
13
13
|
return result;
|
|
14
14
|
}
|
|
@@ -229,7 +229,8 @@ export class Return extends BaseNode {
|
|
|
229
229
|
// @ts-ignore
|
|
230
230
|
const n = typeAnnotation.__v_raw || typeAnnotation;
|
|
231
231
|
if (Array.isArray((t as any)[parentKey])) {
|
|
232
|
-
|
|
232
|
+
// @ts-ignore
|
|
233
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
233
234
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
234
235
|
params.index = index;
|
|
235
236
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -269,8 +270,8 @@ export class Return extends BaseNode {
|
|
|
269
270
|
const { defaultValue } = this;
|
|
270
271
|
const defaultValueType = Object.prototype.toString.call(defaultValue);
|
|
271
272
|
const { typeKind, typeNamespace, typeName } = typeAnnotation || {};
|
|
272
|
-
const isDecimal = typeKind === 'primitive' && ['Decimal',
|
|
273
|
-
const isInteger = typeKind === 'primitive' && ['Long',
|
|
273
|
+
const isDecimal = typeKind === 'primitive' && ['Decimal', 'Double'].includes(typeName);
|
|
274
|
+
const isInteger = typeKind === 'primitive' && ['Long', 'Integer'].includes(typeName);
|
|
274
275
|
|
|
275
276
|
// 设置成null,才能同步给后端清除该值,但是null对checkbox组件是一种特殊状态
|
|
276
277
|
let parsedValue = defaultValue ?? undefined;
|
|
@@ -298,10 +299,10 @@ export class Return extends BaseNode {
|
|
|
298
299
|
}
|
|
299
300
|
}
|
|
300
301
|
if (isDecimal) {
|
|
301
|
-
parsedValue = `new NaslDecimal('${defaultValue}')
|
|
302
|
+
parsedValue = `new NaslDecimal('${defaultValue}')`;
|
|
302
303
|
code += `${parsedValue}`;
|
|
303
304
|
} else if (isInteger) {
|
|
304
|
-
parsedValue = `new NaslLong('${defaultValue}')
|
|
305
|
+
parsedValue = `new NaslLong('${defaultValue}')`;
|
|
305
306
|
code += `${parsedValue}`;
|
|
306
307
|
} else {
|
|
307
308
|
code += `${JSON.stringify(parsedValue)}`;
|
|
@@ -114,7 +114,7 @@ export class SelectMembers extends BaseNode {
|
|
|
114
114
|
|
|
115
115
|
getLogicItemExistingNames(excludedList: Array<LogicItem> = []) {
|
|
116
116
|
const excludedSet = new Set(excludedList);
|
|
117
|
-
return ((this.members as LogicItem[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
117
|
+
return ((this.members as LogicItem[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
118
118
|
}
|
|
119
119
|
getLogicItemUniqueName(name = 'logicItem1') {
|
|
120
120
|
return utils.unique(name, this.getLogicItemExistingNames(), undefined, false);
|
|
@@ -331,7 +331,8 @@ export class SelectMembers extends BaseNode {
|
|
|
331
331
|
// @ts-ignore
|
|
332
332
|
const n = logicItem.__v_raw || logicItem;
|
|
333
333
|
if (Array.isArray((t as any)[parentKey])) {
|
|
334
|
-
|
|
334
|
+
// @ts-ignore
|
|
335
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
335
336
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
336
337
|
params.index = index;
|
|
337
338
|
} else if ((t as any)[parentKey] === n) {
|
package/src/concepts/Slot__.ts
CHANGED
|
@@ -157,7 +157,8 @@ export class Slot extends BaseNode {
|
|
|
157
157
|
// @ts-ignore
|
|
158
158
|
const n = param.__v_raw || param;
|
|
159
159
|
if (Array.isArray((t as any)[parentKey])) {
|
|
160
|
-
|
|
160
|
+
// @ts-ignore
|
|
161
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
161
162
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
162
163
|
params.index = index;
|
|
163
164
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -135,7 +135,8 @@ export class SqlQueryComponent extends LogicItem {
|
|
|
135
135
|
// @ts-ignore
|
|
136
136
|
const n = typeAnnotation.__v_raw || typeAnnotation;
|
|
137
137
|
if (Array.isArray((t as any)[parentKey])) {
|
|
138
|
-
|
|
138
|
+
// @ts-ignore
|
|
139
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
139
140
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
140
141
|
params.index = index;
|
|
141
142
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
TranslatorState,
|
|
3
|
+
shiftState,
|
|
4
|
+
withSourceMap,
|
|
5
|
+
createCompilerState,
|
|
6
|
+
transfromMetadataType,
|
|
7
|
+
transfromUnionTypeAnnotation,
|
|
8
|
+
} from '../translator';
|
|
2
9
|
import { ElementToVueOptions } from './ViewElement__';
|
|
3
10
|
import { StringLiteral } from './StringLiteral__';
|
|
4
11
|
//================================================================================
|
|
@@ -63,7 +70,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
63
70
|
|
|
64
71
|
getItemExistingNames(excludedList: Array<LogicItem> = []) {
|
|
65
72
|
const excludedSet = new Set(excludedList);
|
|
66
|
-
return ((this.expressions as LogicItem[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
73
|
+
return ((this.expressions as LogicItem[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
67
74
|
}
|
|
68
75
|
getItemUniqueName(name = 'logicItem1') {
|
|
69
76
|
return utils.unique(name, this.getItemExistingNames(), undefined, false);
|
|
@@ -255,7 +262,8 @@ export class StringInterpolation extends LogicItem {
|
|
|
255
262
|
// @ts-ignore
|
|
256
263
|
const n = logicItem.__v_raw || logicItem;
|
|
257
264
|
if (Array.isArray((t as any)[parentKey])) {
|
|
258
|
-
|
|
265
|
+
// @ts-ignore
|
|
266
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
259
267
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
260
268
|
params.index = index;
|
|
261
269
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -286,6 +294,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
286
294
|
let expCode = exp.toVue();
|
|
287
295
|
if (options?.finalCode !== false) {
|
|
288
296
|
const expTypeAnnotation = exp.typeAnnotation || exp.__TypeAnnotation;
|
|
297
|
+
transfromUnionTypeAnnotation(expTypeAnnotation, this.app);
|
|
289
298
|
const { sortedTypeKey } = transfromMetadataType(expTypeAnnotation, this.app);
|
|
290
299
|
expCode = `$utils['ToString']('${sortedTypeKey}', ${expCode})`;
|
|
291
300
|
}
|
|
@@ -303,6 +312,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
303
312
|
return this.expressions
|
|
304
313
|
.map((exp: any) => {
|
|
305
314
|
const expTypeAnnotation = exp.typeAnnotation || exp.__TypeAnnotation;
|
|
315
|
+
transfromUnionTypeAnnotation(expTypeAnnotation, this.app);
|
|
306
316
|
const { sortedTypeKey } = transfromMetadataType(expTypeAnnotation, this.app);
|
|
307
317
|
return `this.$utils['ToString']('${sortedTypeKey}', ${exp.toJS()})`;
|
|
308
318
|
})
|
|
@@ -239,7 +239,8 @@ export class StructureProperty extends BaseNode {
|
|
|
239
239
|
// @ts-ignore
|
|
240
240
|
const n = typeAnnotation.__v_raw || typeAnnotation;
|
|
241
241
|
if (Array.isArray((t as any)[parentKey])) {
|
|
242
|
-
|
|
242
|
+
// @ts-ignore
|
|
243
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
243
244
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
244
245
|
params.index = index;
|
|
245
246
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -129,7 +129,7 @@ export class Structure extends BaseNode {
|
|
|
129
129
|
|
|
130
130
|
getTypeParamExistingNames(excludedList: Array<TypeParam> = []) {
|
|
131
131
|
const excludedSet = new Set(excludedList);
|
|
132
|
-
return ((this.typeParams as TypeParam[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
132
|
+
return ((this.typeParams as TypeParam[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
133
133
|
}
|
|
134
134
|
getTypeParamUniqueName(name = 'typeParam1') {
|
|
135
135
|
return utils.unique(name, this.getTypeParamExistingNames(), undefined, false);
|
|
@@ -284,7 +284,7 @@ export class Structure extends BaseNode {
|
|
|
284
284
|
const excludedSet = new Set(excludedList);
|
|
285
285
|
return ((this.properties as StructureProperty[]) || [])
|
|
286
286
|
.filter((item) => !excludedSet.has(item))
|
|
287
|
-
.map((item) => item
|
|
287
|
+
.map((item) => item?.name);
|
|
288
288
|
}
|
|
289
289
|
getPropertyUniqueName(name = 'property1') {
|
|
290
290
|
return utils.unique(name, this.getPropertyExistingNames(), undefined, false);
|
|
@@ -476,7 +476,8 @@ export class Structure extends BaseNode {
|
|
|
476
476
|
// @ts-ignore
|
|
477
477
|
const n = typeParam.__v_raw || typeParam;
|
|
478
478
|
if (Array.isArray((t as any)[parentKey])) {
|
|
479
|
-
|
|
479
|
+
// @ts-ignore
|
|
480
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
480
481
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
481
482
|
params.index = index;
|
|
482
483
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -528,7 +529,8 @@ export class Structure extends BaseNode {
|
|
|
528
529
|
// @ts-ignore
|
|
529
530
|
const n = property.__v_raw || property;
|
|
530
531
|
if (Array.isArray((t as any)[parentKey])) {
|
|
531
|
-
|
|
532
|
+
// @ts-ignore
|
|
533
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
532
534
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
533
535
|
params.index = index;
|
|
534
536
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -221,7 +221,8 @@ export class SwitchCase extends LogicItem {
|
|
|
221
221
|
// @ts-ignore
|
|
222
222
|
const n = logicItem.__v_raw || logicItem;
|
|
223
223
|
if (Array.isArray((t as any)[parentKey])) {
|
|
224
|
-
|
|
224
|
+
// @ts-ignore
|
|
225
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
225
226
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
226
227
|
params.index = index;
|
|
227
228
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -176,7 +176,8 @@ export class SwitchStatement extends LogicItem {
|
|
|
176
176
|
// @ts-ignore
|
|
177
177
|
const n = logicItem.__v_raw || logicItem;
|
|
178
178
|
if (Array.isArray((t as any)[parentKey])) {
|
|
179
|
-
|
|
179
|
+
// @ts-ignore
|
|
180
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
180
181
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
181
182
|
params.index = index;
|
|
182
183
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -93,7 +93,7 @@ export class TriggerEvent extends BaseNode {
|
|
|
93
93
|
const excludedSet = new Set(excludedList);
|
|
94
94
|
return ((this.callBackLogic as TypeAnnotation[]) || [])
|
|
95
95
|
.filter((item) => !excludedSet.has(item))
|
|
96
|
-
.map((item) => item
|
|
96
|
+
.map((item) => item?.name);
|
|
97
97
|
}
|
|
98
98
|
getTypeAnnotationUniqueName(name = 'typeAnnotation1') {
|
|
99
99
|
return utils.unique(name, this.getTypeAnnotationExistingNames(), undefined, false);
|
|
@@ -285,7 +285,8 @@ export class TriggerEvent extends BaseNode {
|
|
|
285
285
|
// @ts-ignore
|
|
286
286
|
const n = typeAnnotation.__v_raw || typeAnnotation;
|
|
287
287
|
if (Array.isArray((t as any)[parentKey])) {
|
|
288
|
-
|
|
288
|
+
// @ts-ignore
|
|
289
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
289
290
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
290
291
|
params.index = index;
|
|
291
292
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -543,7 +543,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
543
543
|
// @ts-ignore
|
|
544
544
|
const n = typeAnnotation.__v_raw || typeAnnotation;
|
|
545
545
|
if (Array.isArray((t as any)[parentKey])) {
|
|
546
|
-
|
|
546
|
+
// @ts-ignore
|
|
547
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
547
548
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
548
549
|
params.index = index;
|
|
549
550
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -581,7 +582,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
581
582
|
// @ts-ignore
|
|
582
583
|
const n = structureProperty.__v_raw || structureProperty;
|
|
583
584
|
if (Array.isArray((t as any)[parentKey])) {
|
|
584
|
-
|
|
585
|
+
// @ts-ignore
|
|
586
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
585
587
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
586
588
|
params.index = index;
|
|
587
589
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -1071,30 +1073,33 @@ export class TypeAnnotation extends BaseNode {
|
|
|
1071
1073
|
if (this.typeKind === 'primitive') {
|
|
1072
1074
|
if (this.typeName === 'String') {
|
|
1073
1075
|
code = ` new nasl.core.String("${value}") `;
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1076
|
+
} else if (this.typeNamespace.endsWith('.metadataTypes')) {
|
|
1077
|
+
const app = this.getAncestor('App') as App;
|
|
1078
|
+
let originType = {} as TypeAnnotation;
|
|
1079
|
+
if (this.typeNamespace === 'app.metadataTypes') {
|
|
1080
|
+
originType = app.metadataTypes.find((metadataType) => metadataType.name === this.typeName)?.typeAnnotation;
|
|
1081
|
+
} else if (this.typeNamespace.startsWith('extensions.') && this.typeNamespace.endsWith('.metadataTypes')) {
|
|
1082
|
+
const dependencyName = this.typeNamespace.replace('extensions.', '').replace('.metadataTypes', '');
|
|
1083
|
+
originType =
|
|
1084
|
+
app.dependencies
|
|
1085
|
+
?.find((item) => item.name === dependencyName)
|
|
1086
|
+
?.metadataTypes?.find((ele) => ele.name === this.typeName)?.typeAnnotation ?? ({} as TypeAnnotation);
|
|
1087
|
+
}
|
|
1088
|
+
const coreType = {
|
|
1089
|
+
typeNamespace: 'nasl.core',
|
|
1090
|
+
typeName: originType.typeName,
|
|
1091
|
+
};
|
|
1092
|
+
if (coreType.typeName === 'String') {
|
|
1093
|
+
code = ` new nasl.core.String("${value}") `;
|
|
1094
|
+
} else {
|
|
1095
|
+
if (['Text'].includes(coreType.typeName)) {
|
|
1096
|
+
code = ` new ${coreType.typeNamespace}.${coreType.typeName}("${value}")`;
|
|
1097
|
+
} else if (['Boolean'].includes(coreType.typeName)) {
|
|
1098
|
+
code = value;
|
|
1089
1099
|
} else {
|
|
1090
|
-
|
|
1091
|
-
code = ` new ${coreType.typeNamespace}.${coreType.typeName}("${value}")`;
|
|
1092
|
-
} else if (['Boolean'].includes(coreType.typeName)) {
|
|
1093
|
-
code = value;
|
|
1094
|
-
} else {
|
|
1095
|
-
code = ` new ${coreType.typeNamespace}.${coreType.typeName}(${value})`;
|
|
1096
|
-
}
|
|
1100
|
+
code = ` new ${coreType.typeNamespace}.${coreType.typeName}(${value})`;
|
|
1097
1101
|
}
|
|
1102
|
+
}
|
|
1098
1103
|
} else {
|
|
1099
1104
|
if (['Text'].includes(this.typeName)) {
|
|
1100
1105
|
code = ` new ${this.typeNamespace}.${this.typeName}("${value}")`;
|
|
@@ -1234,14 +1239,16 @@ export class TypeAnnotation extends BaseNode {
|
|
|
1234
1239
|
if (structureCache.has(structure)) {
|
|
1235
1240
|
return true;
|
|
1236
1241
|
}
|
|
1237
|
-
structureCache.add(structure)
|
|
1238
|
-
const res = structure?.properties.some((prop: StructureProperty) =>
|
|
1242
|
+
structureCache.add(structure);
|
|
1243
|
+
const res = structure?.properties.some((prop: StructureProperty) =>
|
|
1244
|
+
prop.typeAnnotation.hasSystemType(app, structureCache),
|
|
1245
|
+
);
|
|
1239
1246
|
// 如果有系统类型,则终止遍历
|
|
1240
1247
|
if (res === true) {
|
|
1241
1248
|
result = true;
|
|
1242
|
-
return false
|
|
1249
|
+
return false;
|
|
1243
1250
|
}
|
|
1244
|
-
return true
|
|
1251
|
+
return true;
|
|
1245
1252
|
}
|
|
1246
1253
|
// 如果是系统类型,则终止遍历
|
|
1247
1254
|
if (node.isSystemType()) {
|
|
@@ -113,7 +113,8 @@ export class UnaryExpression extends LogicItem {
|
|
|
113
113
|
// @ts-ignore
|
|
114
114
|
const n = logicItem.__v_raw || logicItem;
|
|
115
115
|
if (Array.isArray((t as any)[parentKey])) {
|
|
116
|
-
|
|
116
|
+
// @ts-ignore
|
|
117
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
117
118
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
118
119
|
params.index = index;
|
|
119
120
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -313,7 +313,8 @@ export class ValidationRule extends LogicItem {
|
|
|
313
313
|
// @ts-ignore
|
|
314
314
|
const n = logicItem.__v_raw || logicItem;
|
|
315
315
|
if (Array.isArray((t as any)[parentKey])) {
|
|
316
|
-
|
|
316
|
+
// @ts-ignore
|
|
317
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
317
318
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
318
319
|
params.index = index;
|
|
319
320
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -12,7 +12,7 @@ function tryJSONParse(str: string) {
|
|
|
12
12
|
|
|
13
13
|
try {
|
|
14
14
|
result = JSON.parse(str);
|
|
15
|
-
} catch (e) {
|
|
15
|
+
} catch (e) {}
|
|
16
16
|
|
|
17
17
|
return result;
|
|
18
18
|
}
|
|
@@ -247,7 +247,8 @@ export class Variable extends BaseNode {
|
|
|
247
247
|
// @ts-ignore
|
|
248
248
|
const n = typeAnnotation.__v_raw || typeAnnotation;
|
|
249
249
|
if (Array.isArray((t as any)[parentKey])) {
|
|
250
|
-
|
|
250
|
+
// @ts-ignore
|
|
251
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
251
252
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
252
253
|
params.index = index;
|
|
253
254
|
} else if ((t as any)[parentKey] === n) {
|
|
@@ -290,8 +291,8 @@ export class Variable extends BaseNode {
|
|
|
290
291
|
const { typeKind, typeNamespace, typeName } = typeAnnotation || {};
|
|
291
292
|
// 设置成null,才能同步给后端清除该值,但是null对checkbox组件是一种特殊状态
|
|
292
293
|
let parsedValue = defaultValue ?? undefined;
|
|
293
|
-
const isDecimal = typeKind === 'primitive' && ['Decimal',
|
|
294
|
-
const isInteger = typeKind === 'primitive' && ['Long',
|
|
294
|
+
const isDecimal = typeKind === 'primitive' && ['Decimal', 'Double'].includes(typeName);
|
|
295
|
+
const isInteger = typeKind === 'primitive' && ['Long', 'Integer'].includes(typeName);
|
|
295
296
|
if (
|
|
296
297
|
defaultValueType === '[object String]' &&
|
|
297
298
|
!(typeKind === 'primitive' && typeNamespace === 'nasl.core' && ['String', 'Text', 'Email'].includes(typeName)) &&
|
|
@@ -316,10 +317,10 @@ export class Variable extends BaseNode {
|
|
|
316
317
|
}
|
|
317
318
|
}
|
|
318
319
|
if (isDecimal) {
|
|
319
|
-
parsedValue = `new NaslDecimal('${defaultValue}')
|
|
320
|
+
parsedValue = `new NaslDecimal('${defaultValue}')`;
|
|
320
321
|
code += `${parsedValue}`;
|
|
321
322
|
} else if (isInteger) {
|
|
322
|
-
parsedValue = `new NaslLong('${defaultValue}')
|
|
323
|
+
parsedValue = `new NaslLong('${defaultValue}')`;
|
|
323
324
|
code += `${parsedValue}`;
|
|
324
325
|
} else {
|
|
325
326
|
code += `${JSON.stringify(parsedValue)}`;
|