@lcap/nasl 2.19.0-beta.2 → 2.19.0-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/engine/index.d.ts +2 -2
- package/out/automate/engine/index.js +7 -6
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/operators.d.ts +2 -2
- package/out/automate/engine/operators.js +5 -14
- package/out/automate/engine/operators.js.map +1 -1
- package/out/automate/engine/uniqueName.d.ts +2 -2
- package/out/automate/engine/uniqueName.js +5 -5
- package/out/automate/engine/uniqueName.js.map +1 -1
- package/out/automate/engine/utils.js +1 -4
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/template/myProcess.d.ts +1 -1
- package/out/automate/template/myProcess.js +9023 -9023
- package/out/automate/template/myProcess.js.map +1 -1
- package/out/bak/translator.js +24 -16
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.d.ts +0 -12
- package/out/common/BaseNode.js +13 -84
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/EventEmitter.d.ts +0 -1
- package/out/common/EventEmitter.js +0 -3
- package/out/common/EventEmitter.js.map +1 -1
- package/out/common/Messager.js +0 -1
- package/out/common/Messager.js.map +1 -1
- package/out/concepts/Anchor__.d.ts +0 -1
- package/out/concepts/Anchor__.js +0 -3
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +0 -1
- package/out/concepts/AnonymousFunction__.js +0 -3
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +256 -99
- package/out/concepts/App__.js +405 -232
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +0 -1
- package/out/concepts/Argument__.js +0 -3
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +0 -1
- package/out/concepts/Assignee__.js +0 -3
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.d.ts +0 -1
- package/out/concepts/AssignmentLine__.js +0 -3
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +0 -1
- package/out/concepts/Assignment__.js +0 -3
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.d.ts +14 -10
- package/out/concepts/Attribute__.js +39 -15
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BatchAssignment__.d.ts +0 -1
- package/out/concepts/BatchAssignment__.js +0 -3
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +0 -1
- package/out/concepts/BinaryExpression__.js +0 -3
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +0 -13
- package/out/concepts/BindAttribute__.js +38 -296
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +0 -13
- package/out/concepts/BindDirective__.js +15 -223
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +0 -6
- package/out/concepts/BindEvent__.js +22 -30
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +0 -13
- package/out/concepts/BindStyle__.js +1 -200
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +0 -1
- package/out/concepts/BooleanLiteral__.js +0 -3
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +0 -1
- package/out/concepts/CallFunction__.js +23 -10
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +0 -2
- package/out/concepts/CallInterface__.js +4 -50
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +0 -12
- package/out/concepts/CallLogic__.js +70 -136
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +0 -3
- package/out/concepts/CallQueryComponent__.js +38 -109
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.d.ts +0 -1
- package/out/concepts/Comment__.js +0 -3
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.d.ts +0 -2
- package/out/concepts/CompletionProperty__.js +0 -4
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +0 -2
- package/out/concepts/ConfigGroup__.js +0 -16
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.d.ts +0 -1
- package/out/concepts/ConfigPropertyValue__.js +0 -3
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +0 -24
- package/out/concepts/ConfigProperty__.js +0 -83
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +0 -2
- package/out/concepts/Configuration__.js +0 -16
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.d.ts +0 -6
- package/out/concepts/Constant__.js +0 -9
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.d.ts +0 -1
- package/out/concepts/DataElement__.js +0 -3
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +0 -3
- package/out/concepts/DataSource__.js +5 -20
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +0 -3
- package/out/concepts/Destination__.js +16 -98
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.d.ts +0 -1
- package/out/concepts/End__.js +1 -4
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +0 -1
- package/out/concepts/EntityIndex__.js +0 -3
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +5 -34
- package/out/concepts/EntityProperty__.js +56 -197
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +1 -3
- package/out/concepts/Entity__.js +1 -33
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +0 -1
- package/out/concepts/EnumItem__.js +0 -3
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +0 -1
- package/out/concepts/Enum__.js +0 -3
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.d.ts +0 -1
- package/out/concepts/Event__.js +0 -3
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +0 -2
- package/out/concepts/ExternalDestination__.js +4 -25
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +0 -1
- package/out/concepts/ForEachStatement__.js +0 -3
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.d.ts +0 -1
- package/out/concepts/Function__.js +0 -3
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +0 -1
- package/out/concepts/Identifier__.js +5 -26
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.d.ts +0 -1
- package/out/concepts/IfStatement__.js +2 -5
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +3 -1
- package/out/concepts/InterfaceParam__.js +56 -3
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +0 -14
- package/out/concepts/Interface__.js +0 -87
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts +0 -1
- package/out/concepts/JSBlock__.js +1 -8
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +1 -7
- package/out/concepts/LogicItem__.js +0 -11
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +0 -7
- package/out/concepts/Logic__.js +19 -73
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +0 -1
- package/out/concepts/MatchCase__.js +1 -4
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.d.ts +3 -6
- package/out/concepts/Match__.js +20 -116
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +0 -1
- package/out/concepts/MemberExpression__.js +2 -14
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +56 -96
- package/out/concepts/Module__.js +58 -169
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +0 -1
- package/out/concepts/Namespace__.js +0 -3
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +4 -4
- package/out/concepts/NewComposite__.js +112 -129
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +0 -1
- package/out/concepts/NewList__.js +24 -33
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +0 -1
- package/out/concepts/NewMap__.js +23 -36
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.d.ts +0 -1
- package/out/concepts/New__.js +0 -3
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +0 -1
- package/out/concepts/NullLiteral__.js +0 -3
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +0 -1
- package/out/concepts/NumericLiteral__.js +9 -6
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +1 -1
- package/out/concepts/OqlQueryComponent__.js +60 -43
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.d.ts +3 -7
- package/out/concepts/Param__.js +60 -17
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.d.ts +0 -1
- package/out/concepts/Point__.js +0 -3
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.d.ts +0 -1
- package/out/concepts/ProcessComponent__.js +0 -3
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +0 -1
- package/out/concepts/ProcessElement__.js +4 -16
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.d.ts +0 -1
- package/out/concepts/ProcessOutcome__.js +0 -3
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +0 -1
- package/out/concepts/ProcessOutcomes__.js +0 -3
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.d.ts +20 -5
- package/out/concepts/Process__.js +7 -4
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.d.ts +0 -1
- package/out/concepts/QueryAggregateExpression__.js +0 -3
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +0 -1
- package/out/concepts/QueryFieldExpression__.js +1 -7
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +0 -1
- package/out/concepts/QueryFromExpression__.js +0 -3
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +0 -1
- package/out/concepts/QueryGroupByExpression__.js +0 -3
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +0 -1
- package/out/concepts/QueryJoinExpression__.js +0 -3
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +0 -1
- package/out/concepts/QueryLimitExpression__.js +0 -3
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +0 -1
- package/out/concepts/QueryOrderByExpression__.js +0 -3
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +16 -105
- package/out/concepts/QuerySelectExpression__.js +9 -102
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.d.ts +0 -1
- package/out/concepts/Rect__.js +0 -3
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +3 -6
- package/out/concepts/Return__.js +59 -13
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +0 -1
- package/out/concepts/Role__.js +0 -3
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +0 -1
- package/out/concepts/SelectMembers__.js +0 -3
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.d.ts +0 -17
- package/out/concepts/Slot__.js +0 -46
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +1 -1
- package/out/concepts/SqlQueryComponent__.js +46 -3
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.d.ts +0 -1
- package/out/concepts/Start__.js +0 -3
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +0 -1
- package/out/concepts/StringInterpolation__.js +1 -4
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +0 -1
- package/out/concepts/StringLiteral__.js +6 -9
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +3 -9
- package/out/concepts/StructureProperty__.js +57 -21
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +0 -1
- package/out/concepts/Structure__.js +0 -3
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +0 -1
- package/out/concepts/SwitchCase__.js +2 -5
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.d.ts +0 -1
- package/out/concepts/SwitchStatement__.js +0 -3
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.d.ts +0 -1
- package/out/concepts/Theme__.js +0 -3
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.d.ts +0 -6
- package/out/concepts/Transactional__.js +0 -9
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +3 -9
- package/out/concepts/TypeAnnotation__.js +13 -99
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +0 -1
- package/out/concepts/TypeParam__.js +0 -3
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +0 -1
- package/out/concepts/UnaryExpression__.js +0 -3
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +0 -1
- package/out/concepts/Unparsed__.js +0 -3
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.d.ts +0 -1
- package/out/concepts/UseComponent__.js +0 -3
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +0 -2
- package/out/concepts/ValidationRule__.js +0 -56
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +3 -6
- package/out/concepts/Variable__.js +60 -14
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.d.ts +0 -93
- package/out/concepts/ViewComponent__.js +0 -114
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +0 -8
- package/out/concepts/ViewElement__.js +9 -65
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +3 -9
- package/out/concepts/View__.js +16 -63
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.d.ts +0 -1
- package/out/concepts/WhileStatement__.js +0 -3
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.collection.js +2 -7
- package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.js +0 -3
- package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.core.d.ts +0 -2
- package/out/concepts/basics/stdlib/nasl.core.js +0 -34
- package/out/concepts/basics/stdlib/nasl.core.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.interface.js +1 -1
- package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.process.js +6 -6
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +43 -71
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +19 -142
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.js +13 -13
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
- package/out/concepts/basics/types/coreTypeList.js +5 -1
- package/out/concepts/basics/types/coreTypeList.js.map +1 -1
- package/out/concepts/basics/types/index.d.ts +0 -1
- package/out/concepts/basics/types/index.js +1 -3
- package/out/concepts/basics/types/index.js.map +1 -1
- package/out/concepts/index__.d.ts +0 -8
- package/out/concepts/index__.js +0 -8
- package/out/concepts/index__.js.map +1 -1
- package/out/decorators/index.js +3 -3
- package/out/decorators/index.js.map +1 -1
- package/out/enums/KEYWORDS.d.ts +0 -1
- package/out/enums/KEYWORDS.js +1 -16
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +3 -6
- package/out/generator/genBundleFiles.js +51 -60
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +2 -2
- package/out/generator/genMetaData.js +3 -3
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/genReleaseBody.d.ts +4 -19
- package/out/generator/genReleaseBody.js +54 -144
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/permission.d.ts +0 -1
- package/out/generator/permission.js +29 -24
- package/out/generator/permission.js.map +1 -1
- package/out/index.d.ts +1 -2
- package/out/index.js +1 -4
- package/out/index.js.map +1 -1
- package/out/server/entity2LogicNamespace.js +1 -3
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/extendBaseNode.js +1 -108
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +1 -2
- package/out/server/formatTsUtils.js +9 -152
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.d.ts +2 -2
- package/out/server/getLogics.js +17 -63
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +0 -1
- package/out/server/getMemberIdentifier.js +6 -34
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/index.js +0 -1
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +4 -16
- package/out/server/naslServer.js +176 -1056
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +30 -73
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/api.d.ts +0 -9
- package/out/service/storage/api.js +0 -7
- package/out/service/storage/api.js.map +1 -1
- package/out/service/storage/init.d.ts +0 -3
- package/out/service/storage/init.js +10 -90
- package/out/service/storage/init.js.map +1 -1
- package/out/service/storage/service.d.ts +0 -3
- package/out/service/storage/service.js +1 -6
- package/out/service/storage/service.js.map +1 -1
- package/out/templator/genCallComponentLogic.d.ts +1 -1
- package/out/templator/genCallComponentLogic.js.map +1 -1
- package/out/templator/genCreateBlock.js +4 -7
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.d.ts +1 -7
- package/out/templator/genCurdEditMultipleKeyBlock.js +8 -122
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +8 -6
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +20 -48
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +2 -2
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +1 -1
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +9 -23
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.d.ts +1 -12
- package/out/templator/genSelectBlock.js +2 -273
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +4 -4
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +4 -9
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +33 -19
- package/out/templator/utils.js +8 -11
- package/out/templator/utils.js.map +1 -1
- package/out/translator/index.js +1 -4
- package/out/translator/index.js.map +1 -1
- package/out/utils/traverse.js +2 -8
- package/out/utils/traverse.js.map +1 -1
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.oql.ts +16 -4
- package/src/common/BaseNode.ts +3 -1
- package/src/concepts/App__.ts +41 -1
- package/src/concepts/BatchAssignment__.ts +2 -2
- package/src/concepts/CallFunction__.ts +34 -20
- package/src/concepts/CallInterface__.ts +19 -1
- package/src/concepts/CallLogic__.ts +8 -3
- package/src/concepts/EnumItem__.ts +6 -6
- package/src/concepts/Enum__.ts +22 -19
- package/src/concepts/ForEachStatement__.ts +1 -1
- package/src/concepts/Logic__.ts +13 -10
- package/src/concepts/NewComposite__.ts +9 -7
- package/src/concepts/NewList__.ts +16 -0
- package/src/concepts/NewMap__.ts +17 -0
- package/src/concepts/StringInterpolation__.ts +6 -4
- package/src/concepts/TypeAnnotation__.ts +41 -3
- package/src/concepts/View__.ts +3 -2
- package/src/generator/genReleaseBody.ts +3 -1
- package/src/server/extendBaseNode.ts +4 -1
- package/src/server/formatTsUtils.ts +11 -8
- package/src/server/naslServer.ts +112 -2
- package/src/server/translator.ts +6 -6
- package/src/service/creator/add.configs.js +3 -0
- package/src/service/creator/errHandles.js +6 -0
- package/src/service/creator/index.js +3 -0
- package/src/service/storage/api.js +12 -0
- package/src/service/storage/init.ts +207 -29
- package/src/service/storage/service.ts +29 -1
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genListViewBlock.ts +6 -0
- package/ts-worker/lib/tsserver.js +6 -1
- package/ts-worker/package.json +1 -0
- package/ts-worker/webpack.config.js +11 -2
|
@@ -728,7 +728,7 @@ export class CallLogic extends LogicItem {
|
|
|
728
728
|
return `${name}: {
|
|
729
729
|
concept: 'Function',
|
|
730
730
|
name: 'filter',
|
|
731
|
-
returnExpression: this.$resolveRequestData(${argsStr},
|
|
731
|
+
returnExpression: this.$resolveRequestData(${argsStr}, __eventArg, __currentArg)
|
|
732
732
|
}`;
|
|
733
733
|
} else {
|
|
734
734
|
return `${name}: ${arg.expression.toJS(shiftState(state, code))}`;
|
|
@@ -747,7 +747,7 @@ export class CallLogic extends LogicItem {
|
|
|
747
747
|
code += `{
|
|
748
748
|
concept: 'Function',
|
|
749
749
|
name: 'filter',
|
|
750
|
-
returnExpression: this.$resolveRequestData(${argsStr},
|
|
750
|
+
returnExpression: this.$resolveRequestData(${argsStr}, __eventArg, __currentArg)
|
|
751
751
|
}`;
|
|
752
752
|
code += `,\n`;
|
|
753
753
|
logicArgs = [];
|
|
@@ -881,7 +881,12 @@ export class CallLogic extends LogicItem {
|
|
|
881
881
|
};
|
|
882
882
|
}
|
|
883
883
|
|
|
884
|
-
|
|
884
|
+
let left;
|
|
885
|
+
if (root.concept === 'UnaryExpression') {
|
|
886
|
+
left = handleMember(root.argument);
|
|
887
|
+
} else {
|
|
888
|
+
left = handleMember(root.left);
|
|
889
|
+
}
|
|
885
890
|
const right = handleMember(root.right);
|
|
886
891
|
return {
|
|
887
892
|
concept: root.concept,
|
|
@@ -15,9 +15,9 @@ import Module from './Module__';
|
|
|
15
15
|
import App from './App__';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* 枚举值
|
|
19
19
|
*/
|
|
20
|
-
@concept('
|
|
20
|
+
@concept('枚举值')
|
|
21
21
|
export class EnumItem extends BaseNode {
|
|
22
22
|
/**
|
|
23
23
|
* 产品概念
|
|
@@ -26,13 +26,13 @@ export class EnumItem extends BaseNode {
|
|
|
26
26
|
concept: 'EnumItem' = 'EnumItem';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* 枚举值的值
|
|
30
30
|
*/
|
|
31
31
|
@property()
|
|
32
32
|
value: string = undefined;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* 枚举值标题
|
|
36
36
|
*/
|
|
37
37
|
@property()
|
|
38
38
|
label: string = undefined;
|
|
@@ -81,7 +81,7 @@ export class EnumItem extends BaseNode {
|
|
|
81
81
|
return params;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* 设置枚举值的值
|
|
85
85
|
*/
|
|
86
86
|
setValue(value: string) {
|
|
87
87
|
const object = {
|
|
@@ -93,7 +93,7 @@ export class EnumItem extends BaseNode {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
96
|
+
* 设置枚举值标题
|
|
97
97
|
*/
|
|
98
98
|
setLabel(label: string) {
|
|
99
99
|
const object = {
|
package/src/concepts/Enum__.ts
CHANGED
|
@@ -46,7 +46,7 @@ export class Enum extends BaseNode {
|
|
|
46
46
|
description: string = undefined;
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* 枚举值列表
|
|
50
50
|
*/
|
|
51
51
|
@property('EnumItem')
|
|
52
52
|
enumItems: Array<EnumItem> = [];
|
|
@@ -130,16 +130,16 @@ export class Enum extends BaseNode {
|
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
|
-
*
|
|
133
|
+
* 插入枚举值
|
|
134
134
|
* @internal
|
|
135
|
-
* @param enumItemOptions
|
|
135
|
+
* @param enumItemOptions 枚举值参数
|
|
136
136
|
*/
|
|
137
137
|
_insertEnumItemAt(enumItemOptions: Partial<EnumItem>, index: number): EnumItem;
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
|
-
*
|
|
140
|
+
* 插入枚举值
|
|
141
141
|
* @internal
|
|
142
|
-
* @param enumItem
|
|
142
|
+
* @param enumItem 已有的枚举值实例
|
|
143
143
|
*/
|
|
144
144
|
_insertEnumItemAt(enumItem: EnumItem, index: number): EnumItem;
|
|
145
145
|
|
|
@@ -164,14 +164,14 @@ export class Enum extends BaseNode {
|
|
|
164
164
|
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
|
-
*
|
|
168
|
-
* @param enumItemOptions
|
|
167
|
+
* 插入枚举值
|
|
168
|
+
* @param enumItemOptions 枚举值参数
|
|
169
169
|
*/
|
|
170
170
|
insertEnumItemAt(enumItemOptions: Partial<EnumItem>, index: number): EnumItem;
|
|
171
171
|
|
|
172
172
|
/**
|
|
173
|
-
*
|
|
174
|
-
* @param enumItem
|
|
173
|
+
* 插入枚举值
|
|
174
|
+
* @param enumItem 已有的枚举值实例
|
|
175
175
|
*/
|
|
176
176
|
insertEnumItemAt(enumItem: EnumItem, index: number): EnumItem;
|
|
177
177
|
|
|
@@ -188,16 +188,16 @@ export class Enum extends BaseNode {
|
|
|
188
188
|
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
|
-
*
|
|
191
|
+
* 添加枚举值
|
|
192
192
|
* @internal
|
|
193
|
-
* @param enumItemOptions
|
|
193
|
+
* @param enumItemOptions 枚举值参数
|
|
194
194
|
*/
|
|
195
195
|
_addEnumItem(enumItemOptions: Partial<EnumItem>): EnumItem;
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
|
-
*
|
|
198
|
+
* 添加枚举值
|
|
199
199
|
* @internal
|
|
200
|
-
* @param enumItem
|
|
200
|
+
* @param enumItem 已有的枚举值实例
|
|
201
201
|
*/
|
|
202
202
|
_addEnumItem(enumItem: EnumItem): EnumItem;
|
|
203
203
|
|
|
@@ -209,14 +209,14 @@ export class Enum extends BaseNode {
|
|
|
209
209
|
|
|
210
210
|
|
|
211
211
|
/**
|
|
212
|
-
*
|
|
213
|
-
* @param enumItemOptions
|
|
212
|
+
* 添加枚举值
|
|
213
|
+
* @param enumItemOptions 枚举值参数
|
|
214
214
|
*/
|
|
215
215
|
addEnumItem(enumItemOptions: Partial<EnumItem>): EnumItem;
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
|
-
*
|
|
219
|
-
* @param enumItem
|
|
218
|
+
* 添加枚举值
|
|
219
|
+
* @param enumItem 已有的枚举值实例
|
|
220
220
|
*/
|
|
221
221
|
addEnumItem(enumItem: EnumItem): EnumItem;
|
|
222
222
|
|
|
@@ -235,8 +235,8 @@ export class Enum extends BaseNode {
|
|
|
235
235
|
|
|
236
236
|
|
|
237
237
|
/**
|
|
238
|
-
*
|
|
239
|
-
* @param enumItem
|
|
238
|
+
* 删除枚举值
|
|
239
|
+
* @param enumItem 已有的枚举值实例
|
|
240
240
|
*/
|
|
241
241
|
removeEnumItem(enumItem: EnumItem): void;
|
|
242
242
|
|
|
@@ -290,6 +290,9 @@ export class Enum extends BaseNode {
|
|
|
290
290
|
const excludedSet = new Set(excludedList);
|
|
291
291
|
return (this.enumItems || []).filter((item) => !excludedSet.has(item)).map((item) => item.value);
|
|
292
292
|
}
|
|
293
|
+
getEnumItemUniqueName(name = 'VALUE1') {
|
|
294
|
+
return utils.unique(name, this.getEnumItemExistingNames(), undefined, false);
|
|
295
|
+
}
|
|
293
296
|
|
|
294
297
|
@withSourceMap()
|
|
295
298
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
@@ -531,7 +531,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
531
531
|
code += this.each ? this.each.toEmbeddedTS(shiftState(state, code, {
|
|
532
532
|
tabSize: 0,
|
|
533
533
|
})) : '__IDENTIFIER__';
|
|
534
|
-
if (['NewList', 'NewMap'].includes(this.each
|
|
534
|
+
if (['NewList', 'NewMap'].includes(this.each?.concept))
|
|
535
535
|
code += '\n';
|
|
536
536
|
code += '.__slice(';
|
|
537
537
|
code += this.start ? this.start.toEmbeddedTS(shiftState(state, code)) : '__IDENTIFIER__';
|
package/src/concepts/Logic__.ts
CHANGED
|
@@ -796,7 +796,7 @@ export class Logic extends BaseNode {
|
|
|
796
796
|
|
|
797
797
|
|
|
798
798
|
|
|
799
|
-
|
|
799
|
+
|
|
800
800
|
|
|
801
801
|
/**
|
|
802
802
|
* 插入逻辑项
|
|
@@ -830,7 +830,7 @@ export class Logic extends BaseNode {
|
|
|
830
830
|
return logicItem;
|
|
831
831
|
}
|
|
832
832
|
|
|
833
|
-
|
|
833
|
+
|
|
834
834
|
|
|
835
835
|
/**
|
|
836
836
|
* 插入逻辑项
|
|
@@ -854,7 +854,7 @@ export class Logic extends BaseNode {
|
|
|
854
854
|
return node;
|
|
855
855
|
}
|
|
856
856
|
|
|
857
|
-
|
|
857
|
+
|
|
858
858
|
|
|
859
859
|
/**
|
|
860
860
|
* 添加逻辑项
|
|
@@ -875,7 +875,7 @@ export class Logic extends BaseNode {
|
|
|
875
875
|
return this._insertItemInBodyAt(options as any, index);
|
|
876
876
|
}
|
|
877
877
|
|
|
878
|
-
|
|
878
|
+
|
|
879
879
|
|
|
880
880
|
/**
|
|
881
881
|
* 添加逻辑项
|
|
@@ -900,7 +900,7 @@ export class Logic extends BaseNode {
|
|
|
900
900
|
return node;
|
|
901
901
|
}
|
|
902
902
|
|
|
903
|
-
|
|
903
|
+
|
|
904
904
|
|
|
905
905
|
/**
|
|
906
906
|
* 插入逻辑项
|
|
@@ -934,7 +934,7 @@ export class Logic extends BaseNode {
|
|
|
934
934
|
return logicItem;
|
|
935
935
|
}
|
|
936
936
|
|
|
937
|
-
|
|
937
|
+
|
|
938
938
|
|
|
939
939
|
/**
|
|
940
940
|
* 插入逻辑项
|
|
@@ -958,7 +958,7 @@ export class Logic extends BaseNode {
|
|
|
958
958
|
return node;
|
|
959
959
|
}
|
|
960
960
|
|
|
961
|
-
|
|
961
|
+
|
|
962
962
|
|
|
963
963
|
/**
|
|
964
964
|
* 添加逻辑项
|
|
@@ -979,7 +979,7 @@ export class Logic extends BaseNode {
|
|
|
979
979
|
return this._insertItemInPlaygroundAt(options as any, index);
|
|
980
980
|
}
|
|
981
981
|
|
|
982
|
-
|
|
982
|
+
|
|
983
983
|
|
|
984
984
|
/**
|
|
985
985
|
* 添加逻辑项
|
|
@@ -1005,7 +1005,7 @@ export class Logic extends BaseNode {
|
|
|
1005
1005
|
}
|
|
1006
1006
|
|
|
1007
1007
|
|
|
1008
|
-
|
|
1008
|
+
|
|
1009
1009
|
|
|
1010
1010
|
/**
|
|
1011
1011
|
* 删除事务
|
|
@@ -1268,7 +1268,7 @@ export class Logic extends BaseNode {
|
|
|
1268
1268
|
return logicItem.delete();
|
|
1269
1269
|
}
|
|
1270
1270
|
|
|
1271
|
-
|
|
1271
|
+
|
|
1272
1272
|
|
|
1273
1273
|
/**
|
|
1274
1274
|
* 删除逻辑项
|
|
@@ -1390,6 +1390,8 @@ export class Logic extends BaseNode {
|
|
|
1390
1390
|
}
|
|
1391
1391
|
|
|
1392
1392
|
toJSContent(code: string, state?: TranslatorState): string {
|
|
1393
|
+
// 兼容前端事件逻辑参数中的 current event,deleteBy updateBy 需要对 current、event 进行预处理
|
|
1394
|
+
code += `var __currentArg;var __eventArg;try {__currentArg = current;__eventArg = event;} catch(e) {}`;
|
|
1393
1395
|
// params
|
|
1394
1396
|
if (Array.isArray(this.params)) {
|
|
1395
1397
|
this.params.forEach((param) => {
|
|
@@ -1778,6 +1780,7 @@ export class Logic extends BaseNode {
|
|
|
1778
1780
|
}
|
|
1779
1781
|
|
|
1780
1782
|
getRightCode(code: string, assignment: Assignment | BatchAssignment, rightNode: any): string {
|
|
1783
|
+
code = code.replaceAll('\n', ' ');
|
|
1781
1784
|
if (assignment instanceof Assignment && !assignment.right)
|
|
1782
1785
|
return code;
|
|
1783
1786
|
|
|
@@ -1014,7 +1014,7 @@ export class NewComposite extends LogicItem {
|
|
|
1014
1014
|
this.app.emit('collect:start', {
|
|
1015
1015
|
actionMsg: '匿名数据结构删除右侧变量',
|
|
1016
1016
|
});
|
|
1017
|
-
if (this.typeAnnotation
|
|
1017
|
+
if (this.typeAnnotation?.typeKind === 'anonymousStructure') {
|
|
1018
1018
|
oldLines.forEach(({ leftIndex }) => {
|
|
1019
1019
|
const leftItem = this.typeAnnotation.properties[leftIndex[1]];
|
|
1020
1020
|
leftItem.update({
|
|
@@ -1042,7 +1042,7 @@ export class NewComposite extends LogicItem {
|
|
|
1042
1042
|
let oldLines: AssignmentLine[] = this.assignmentLines.filter(({ rightIndex }) => rightIndex[0] === splitIndex);
|
|
1043
1043
|
// 右侧变量改变后,修改连线
|
|
1044
1044
|
members.forEach((item, index) => {
|
|
1045
|
-
if (keepMembers
|
|
1045
|
+
if (keepMembers?.has(item.completeName)) {
|
|
1046
1046
|
const lines = this.findlines(item, selectMember);
|
|
1047
1047
|
lines.forEach((line) => {
|
|
1048
1048
|
const newLine = Object.assign({}, line, { rightIndex: [line.rightIndex[0], index] });
|
|
@@ -1217,8 +1217,7 @@ export class NewComposite extends LogicItem {
|
|
|
1217
1217
|
});
|
|
1218
1218
|
// 方便ts报错检查
|
|
1219
1219
|
code += 'function __newComposite() {\n';
|
|
1220
|
-
code += `let __obj = nasl.util.New<${this.typeAnnotation.sortedTypeKey}>()
|
|
1221
|
-
code += '\n';
|
|
1220
|
+
code += `let __obj = nasl.util.New<${this.typeAnnotation.sortedTypeKey}>();\n`;
|
|
1222
1221
|
// 是否是左边的顶层连线
|
|
1223
1222
|
const leftTopIndex = this.assignmentLines.findIndex(({ leftIndex }) => leftIndex[1] === undefined);
|
|
1224
1223
|
if (leftTopIndex !== -1) {
|
|
@@ -1228,10 +1227,13 @@ export class NewComposite extends LogicItem {
|
|
|
1228
1227
|
code += '\n';
|
|
1229
1228
|
} else {
|
|
1230
1229
|
// 左侧properties的identifier的类型标注
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
code +=
|
|
1230
|
+
code += 'const { ';
|
|
1231
|
+
this.properties.forEach((item, index) => {
|
|
1232
|
+
code += item.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1233
|
+
if (index < this.properties.length - 1)
|
|
1234
|
+
code += ', ';
|
|
1234
1235
|
});
|
|
1236
|
+
code += ' } = __obj;\n';
|
|
1235
1237
|
this.assignmentLines.forEach(({ leftIndex, rightIndex }) => {
|
|
1236
1238
|
const leftSecondIndex = leftIndex[1];
|
|
1237
1239
|
const [rightFirst, rightSecond] = [rightIndex[0], rightIndex[1]];
|
|
@@ -326,6 +326,22 @@ export class NewList extends LogicItem {
|
|
|
326
326
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
327
327
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
328
328
|
//================================================================================
|
|
329
|
+
toBrief(): string {
|
|
330
|
+
let code = '';
|
|
331
|
+
code += '[ ';
|
|
332
|
+
this.items.forEach((value, index) => {
|
|
333
|
+
if (index >= 10)
|
|
334
|
+
return;
|
|
335
|
+
if (index)
|
|
336
|
+
code += ',';
|
|
337
|
+
code += value.toBrief();
|
|
338
|
+
});
|
|
339
|
+
if (this.items.length > 10)
|
|
340
|
+
code += ', ...';
|
|
341
|
+
code += ' ]';
|
|
342
|
+
return code;
|
|
343
|
+
}
|
|
344
|
+
|
|
329
345
|
toUI(state?: TranslatorState): string {
|
|
330
346
|
let code = '';
|
|
331
347
|
code += '[';
|
package/src/concepts/NewMap__.ts
CHANGED
|
@@ -530,6 +530,23 @@ export class NewMap extends LogicItem {
|
|
|
530
530
|
})
|
|
531
531
|
}
|
|
532
532
|
|
|
533
|
+
toBrief(): string {
|
|
534
|
+
let code = '';
|
|
535
|
+
code += '[<br />';
|
|
536
|
+
this.keys.forEach((key, index) => {
|
|
537
|
+
if (index >= 10)
|
|
538
|
+
return;
|
|
539
|
+
const value = this.values[index];
|
|
540
|
+
code += ' ';
|
|
541
|
+
code += `${key ? key.toBrief() : 'null'} -> ${value ? value.toBrief() : 'null'}`;
|
|
542
|
+
code += '<br />';
|
|
543
|
+
});
|
|
544
|
+
if (this.keys.length > 10)
|
|
545
|
+
code += '  ...<br />';
|
|
546
|
+
code += ']';
|
|
547
|
+
return code;
|
|
548
|
+
}
|
|
549
|
+
|
|
533
550
|
toJS(state?: TranslatorState): string {
|
|
534
551
|
let code = '';
|
|
535
552
|
code += 'await (async () => {\n';
|
|
@@ -30,7 +30,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
30
30
|
@property('LogicItem')
|
|
31
31
|
expressions: Array<LogicItem> = [];
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* @param source 需要合并的部分参数
|
|
@@ -45,7 +45,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
45
45
|
return super.from(source, parentNode, parentKey) as StringInterpolation;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
|
|
49
49
|
/**
|
|
50
50
|
* 设置插值表达式
|
|
51
51
|
*/
|
|
@@ -58,7 +58,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
getItemExistingNames(excludedList: Array<LogicItem> = []) {
|
|
62
62
|
const excludedSet = new Set(excludedList);
|
|
63
63
|
return ((this.expressions as LogicItem[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
64
64
|
}
|
|
@@ -200,7 +200,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
|
|
204
204
|
|
|
205
205
|
/**
|
|
206
206
|
* 删除逻辑项
|
|
@@ -279,6 +279,8 @@ export class StringInterpolation extends LogicItem {
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
toJS(): string {
|
|
282
|
+
if (!this.expressions.length)
|
|
283
|
+
return `''`;
|
|
282
284
|
return this.expressions.map((exp: any) => {
|
|
283
285
|
const expTypeAnnotation = exp.typeAnnotation || exp.__TypeAnnotation;
|
|
284
286
|
return `this.$utils['ToString'](${exp.toJS()}, '${expTypeAnnotation?.sortedTypeKey}')`;
|
|
@@ -121,6 +121,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
121
121
|
@property()
|
|
122
122
|
ruleMap: Object = undefined;
|
|
123
123
|
|
|
124
|
+
|
|
125
|
+
|
|
124
126
|
/**
|
|
125
127
|
* @param source 需要合并的部分参数
|
|
126
128
|
*/
|
|
@@ -157,6 +159,10 @@ export class TypeAnnotation extends BaseNode {
|
|
|
157
159
|
});
|
|
158
160
|
}
|
|
159
161
|
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
160
166
|
/**
|
|
161
167
|
* 插入类型标注
|
|
162
168
|
* @internal
|
|
@@ -189,6 +195,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
189
195
|
return typeAnnotation;
|
|
190
196
|
}
|
|
191
197
|
|
|
198
|
+
|
|
199
|
+
|
|
192
200
|
/**
|
|
193
201
|
* 插入类型标注
|
|
194
202
|
* @param typeAnnotationOptions 类型标注参数
|
|
@@ -211,6 +219,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
211
219
|
return node;
|
|
212
220
|
}
|
|
213
221
|
|
|
222
|
+
|
|
223
|
+
|
|
214
224
|
/**
|
|
215
225
|
* 添加类型标注
|
|
216
226
|
* @internal
|
|
@@ -230,6 +240,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
230
240
|
return this._insertTypeAnnotationInTypeArgumentsAt(options as any, index);
|
|
231
241
|
}
|
|
232
242
|
|
|
243
|
+
|
|
244
|
+
|
|
233
245
|
/**
|
|
234
246
|
* 添加类型标注
|
|
235
247
|
* @param typeAnnotationOptions 类型标注参数
|
|
@@ -253,6 +265,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
253
265
|
return node;
|
|
254
266
|
}
|
|
255
267
|
|
|
268
|
+
|
|
269
|
+
|
|
256
270
|
/**
|
|
257
271
|
* 插入类型标注
|
|
258
272
|
* @internal
|
|
@@ -285,6 +299,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
285
299
|
return typeAnnotation;
|
|
286
300
|
}
|
|
287
301
|
|
|
302
|
+
|
|
303
|
+
|
|
288
304
|
/**
|
|
289
305
|
* 插入类型标注
|
|
290
306
|
* @param typeAnnotationOptions 类型标注参数
|
|
@@ -307,6 +323,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
307
323
|
return node;
|
|
308
324
|
}
|
|
309
325
|
|
|
326
|
+
|
|
327
|
+
|
|
310
328
|
/**
|
|
311
329
|
* 添加类型标注
|
|
312
330
|
* @internal
|
|
@@ -326,6 +344,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
326
344
|
return this._insertTypeAnnotationInReturnTypeAt(options as any, index);
|
|
327
345
|
}
|
|
328
346
|
|
|
347
|
+
|
|
348
|
+
|
|
329
349
|
/**
|
|
330
350
|
* 添加类型标注
|
|
331
351
|
* @param typeAnnotationOptions 类型标注参数
|
|
@@ -349,6 +369,11 @@ export class TypeAnnotation extends BaseNode {
|
|
|
349
369
|
return node;
|
|
350
370
|
}
|
|
351
371
|
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
352
377
|
/**
|
|
353
378
|
* 插入数据结构属性
|
|
354
379
|
* @internal
|
|
@@ -381,6 +406,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
381
406
|
return structureProperty;
|
|
382
407
|
}
|
|
383
408
|
|
|
409
|
+
|
|
410
|
+
|
|
384
411
|
/**
|
|
385
412
|
* 插入数据结构属性
|
|
386
413
|
* @param structurePropertyOptions 数据结构属性参数
|
|
@@ -403,6 +430,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
403
430
|
return node;
|
|
404
431
|
}
|
|
405
432
|
|
|
433
|
+
|
|
434
|
+
|
|
406
435
|
/**
|
|
407
436
|
* 添加数据结构属性
|
|
408
437
|
* @internal
|
|
@@ -422,6 +451,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
422
451
|
return this._insertStructurePropertyAt(options as any, index);
|
|
423
452
|
}
|
|
424
453
|
|
|
454
|
+
|
|
455
|
+
|
|
425
456
|
/**
|
|
426
457
|
* 添加数据结构属性
|
|
427
458
|
* @param structurePropertyOptions 数据结构属性参数
|
|
@@ -445,6 +476,9 @@ export class TypeAnnotation extends BaseNode {
|
|
|
445
476
|
return node;
|
|
446
477
|
}
|
|
447
478
|
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
448
482
|
/**
|
|
449
483
|
* 删除类型标注
|
|
450
484
|
* @param typeAnnotation 已有的类型标注实例
|
|
@@ -452,10 +486,12 @@ export class TypeAnnotation extends BaseNode {
|
|
|
452
486
|
removeTypeAnnotationInTypeArguments(typeAnnotation: TypeAnnotation): void;
|
|
453
487
|
|
|
454
488
|
removeTypeAnnotationInTypeArguments(options: TypeAnnotation) {
|
|
455
|
-
|
|
489
|
+
let typeAnnotation: TypeAnnotation = options;
|
|
456
490
|
return typeAnnotation.delete();
|
|
457
491
|
}
|
|
458
492
|
|
|
493
|
+
|
|
494
|
+
|
|
459
495
|
/**
|
|
460
496
|
* 删除类型标注
|
|
461
497
|
* @param typeAnnotation 已有的类型标注实例
|
|
@@ -463,7 +499,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
463
499
|
removeTypeAnnotationInReturnType(typeAnnotation: TypeAnnotation): void;
|
|
464
500
|
|
|
465
501
|
removeTypeAnnotationInReturnType(options: TypeAnnotation) {
|
|
466
|
-
|
|
502
|
+
let typeAnnotation: TypeAnnotation = options;
|
|
467
503
|
return typeAnnotation.delete();
|
|
468
504
|
}
|
|
469
505
|
|
|
@@ -490,6 +526,8 @@ export class TypeAnnotation extends BaseNode {
|
|
|
490
526
|
return params;
|
|
491
527
|
}
|
|
492
528
|
|
|
529
|
+
|
|
530
|
+
|
|
493
531
|
/**
|
|
494
532
|
* 删除数据结构属性
|
|
495
533
|
* @param structureProperty 已有的数据结构属性实例
|
|
@@ -497,7 +535,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
497
535
|
removeStructureProperty(structureProperty: StructureProperty): void;
|
|
498
536
|
|
|
499
537
|
removeStructureProperty(options: StructureProperty) {
|
|
500
|
-
|
|
538
|
+
let structureProperty: StructureProperty = options;
|
|
501
539
|
return structureProperty.delete();
|
|
502
540
|
}
|
|
503
541
|
|
package/src/concepts/View__.ts
CHANGED
|
@@ -259,7 +259,7 @@ export class View extends BaseNode {
|
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
|
|
262
|
+
|
|
263
263
|
|
|
264
264
|
/**
|
|
265
265
|
* 插入页面元素
|
|
@@ -1095,7 +1095,7 @@ export class View extends BaseNode {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
|
|
1097
1097
|
|
|
1098
|
-
|
|
1098
|
+
|
|
1099
1099
|
|
|
1100
1100
|
/**
|
|
1101
1101
|
* 删除页面元素
|
|
@@ -2101,6 +2101,7 @@ export class View extends BaseNode {
|
|
|
2101
2101
|
}
|
|
2102
2102
|
|
|
2103
2103
|
getRightCode(code: string, assignment: Assignment | BatchAssignment, rightNode: any): string {
|
|
2104
|
+
code = code.replaceAll('\n', ' ');
|
|
2104
2105
|
const logic = assignment.logic;
|
|
2105
2106
|
const logicRtn = logic?.returns[0];
|
|
2106
2107
|
// 调用接口,参数替换成 null
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { App, Assignment, BatchAssignment, CallFunction, CallInterface, CallLogic, ForEachStatement, IfStatement, Logic, LogicItem, Match, MatchCase, MemberExpression, Role, SwitchCase, SwitchStatement, View, ViewElement, WhileStatement, StringInterpolation } from '../concepts';
|
|
1
|
+
import { App, Assignment, BatchAssignment, CallFunction, CallInterface, CallLogic, ForEachStatement, IfStatement, Logic, LogicItem, Match, MatchCase, MemberExpression, Role, SwitchCase, SwitchStatement, View, ViewElement, WhileStatement, StringInterpolation, ExternalDestination } from '../concepts';
|
|
2
2
|
import { genBundleFiles } from './genBundleFiles';
|
|
3
3
|
import { genPermissionData } from './permission';
|
|
4
4
|
|
|
@@ -265,6 +265,8 @@ function getAuthApiPathList(app: App) {
|
|
|
265
265
|
logicItems = [state.object, state.property];
|
|
266
266
|
} else if (state instanceof StringInterpolation) {
|
|
267
267
|
logicItems = [...state.expressions];
|
|
268
|
+
} else if (state instanceof ExternalDestination) {
|
|
269
|
+
logicItems = [state.anchor, state.link];
|
|
268
270
|
}
|
|
269
271
|
|
|
270
272
|
return logicItems.filter((item) => !!item);
|
|
@@ -87,7 +87,10 @@ BaseNode.prototype.changeName = async function changeName(newValue: string, upda
|
|
|
87
87
|
*/
|
|
88
88
|
const res = naslServer._renamePrepare(this, refsList, newValue);
|
|
89
89
|
if (res.length <= 1) {
|
|
90
|
-
(this
|
|
90
|
+
if (this.concept === 'enumItem') {
|
|
91
|
+
(this as any).setValue(newValue);
|
|
92
|
+
} else
|
|
93
|
+
(this as SetNameNode).setName(newValue);
|
|
91
94
|
} else {
|
|
92
95
|
const callback = (value: boolean) => {
|
|
93
96
|
if (value) {
|
|
@@ -45,16 +45,19 @@ export function type2TypeAnnotation(oldType: Array<any> | {}): TypeAnnotation {
|
|
|
45
45
|
let typeAnnotation: TypeAnnotation;
|
|
46
46
|
try {
|
|
47
47
|
const { typeName, typeNamespace, typeArguments, typeKind, properties } = type as any;
|
|
48
|
-
if (typeKind === 'anonymousStructure'
|
|
48
|
+
if (typeKind === 'anonymousStructure') {
|
|
49
49
|
// 自定义类型
|
|
50
50
|
const newProperties: StructureProperty[] = [];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
if (Array.isArray(properties) && properties.length) {
|
|
52
|
+
properties.forEach((item) => {
|
|
53
|
+
if (!item?.name?.startsWith('__')) {
|
|
54
|
+
// 如果没有获取到类型,就默认塞一个string
|
|
55
|
+
const itemType = type2TypeAnnotation(item.typeInfo) || TypeAnnotation.createPrimitive('String');
|
|
56
|
+
const structureProperty = StructureProperty.from({ name: item.name, typeAnnotation: itemType }, typeAnnotation, 'properties');
|
|
57
|
+
newProperties.push(structureProperty);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
58
61
|
typeAnnotation = TypeAnnotation.createTypeAnonymousStructure(newProperties);
|
|
59
62
|
} else if (!typeName || typeName === 'Promise' || typeName === 'nasl' || typeName === '___IDENTIFIER__') {
|
|
60
63
|
return null;
|