@lcap/nasl 1.0.0 → 2.12.0-beta
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.js +39 -127
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/operators.d.ts +13 -0
- package/out/automate/engine/operators.js +63 -0
- package/out/automate/engine/operators.js.map +1 -0
- package/out/automate/engine/uniqueName.d.ts +6 -0
- package/out/automate/engine/uniqueName.js +39 -0
- package/out/automate/engine/uniqueName.js.map +1 -0
- package/out/automate/engine/utils.d.ts +1 -0
- package/out/automate/engine/utils.js +105 -67
- package/out/automate/engine/utils.js.map +1 -1
- package/out/common/BaseNode.d.ts +1 -1
- package/out/common/BaseNode.js +13 -3
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +52 -49
- package/out/concepts/App__.js +95 -60
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +11 -0
- package/out/concepts/Assignee__.js +36 -2
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/Assignment__.js +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +1 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +4 -4
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +2 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +11 -6
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js +25 -5
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +1 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +24 -22
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +35 -5
- package/out/concepts/CallQueryComponent__.js +344 -99
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +2 -2
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +1 -0
- package/out/concepts/ConfigGroup__.js +9 -2
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +1 -0
- package/out/concepts/ConfigProperty__.js +5 -2
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +1 -0
- package/out/concepts/Configuration__.js +5 -2
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js +7 -7
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +143 -0
- package/out/concepts/DataSource__.js +316 -0
- package/out/concepts/DataSource__.js.map +1 -0
- package/out/concepts/Destination__.js +26 -9
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +3 -3
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +5 -0
- package/out/concepts/EntityIndex__.js +11 -3
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +9 -0
- package/out/concepts/EntityProperty__.js +23 -8
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +6 -3
- package/out/concepts/Entity__.js +28 -24
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +1 -0
- package/out/concepts/Enum__.js +15 -5
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +2 -2
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +1 -1
- package/out/concepts/ForEachStatement__.js +5 -5
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.d.ts +18 -0
- package/out/concepts/Function__.js +100 -5
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +2 -12
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +9 -9
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +10 -5
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +21 -14
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.js +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +4 -0
- package/out/concepts/Logic__.js +59 -46
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -2
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +1 -85
- package/out/concepts/Module__.js +13 -114
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +0 -86
- package/out/concepts/Namespace__.js +12 -119
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NullLiteral__.js +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.d.ts +3 -2
- package/out/concepts/Param__.js +15 -8
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +3 -3
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +39 -18
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/Process__.js +21 -14
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +2 -2
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +1 -0
- package/out/concepts/QueryFieldExpression__.js +12 -2
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +4 -0
- package/out/concepts/QueryFromExpression__.js +14 -3
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +3 -0
- package/out/concepts/QueryGroupByExpression__.js +21 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +4 -0
- package/out/concepts/QueryJoinExpression__.js +16 -5
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +2 -2
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +16 -11
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +11 -4
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Slot__.js +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +10 -0
- package/out/concepts/SqlQueryComponent__.js +32 -5
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringLiteral__.js +2 -9
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +6 -6
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +22 -15
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +6 -6
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +8 -0
- package/out/concepts/TypeAnnotation__.js +56 -6
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +1 -1
- package/out/concepts/Variable__.js +16 -11
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +6 -6
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +21 -21
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +3 -1
- package/out/concepts/View__.js +53 -32
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +5 -5
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.js +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.interface.d.ts +2 -0
- package/out/concepts/basics/stdlib/nasl.interface.js +4 -4
- package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +268 -6
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +1 -1
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -1
- package/out/concepts/basics/types/index.d.ts +1 -0
- package/out/concepts/basics/types/index.js +3 -1
- package/out/concepts/basics/types/index.js.map +1 -1
- package/out/concepts/index__.d.ts +1 -0
- package/out/concepts/index__.js +1 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/enums/KEYWORDS.js +0 -9
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.js +8 -3
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.js +13 -12
- package/out/generator/genMetaData.js.map +1 -1
- package/out/manager/diagnostic.d.ts +1 -1
- package/out/server/createUiTs.js +1 -0
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/extendBaseNode.d.ts +1 -0
- package/out/server/extendBaseNode.js +323 -0
- package/out/server/extendBaseNode.js.map +1 -0
- package/out/server/getLogics.js +31 -2
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +47 -2
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +7 -2
- package/out/server/getProcesses.js +220 -20
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/getScope.d.ts +3 -1
- package/out/server/getScope.js +30 -14
- package/out/server/getScope.js.map +1 -1
- package/out/server/index.d.ts +1 -0
- package/out/server/index.js +1 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +7 -5
- package/out/server/naslServer.js +249 -372
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.js +10 -1
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.d.ts +1 -1
- package/out/server/translator.js +22 -2
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.js +32 -11
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +15 -11
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +15 -12
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +25 -21
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +12 -12
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +21 -20
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +6 -3
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +11 -8
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.js +13 -22
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +17 -15
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +16 -12
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +5 -3
- package/out/templator/utils.js +2 -1
- package/out/templator/utils.js.map +1 -1
- package/out/test/integration/connect-file.js +6 -6
- package/out/test/integration/connect-file.js.map +1 -1
- package/out/translator/index.js +1 -1
- package/out/translator/index.js.map +1 -1
- package/out/utils/index.d.ts +4 -0
- package/out/utils/index.js +38 -2
- package/out/utils/index.js.map +1 -1
- package/out/utils/string.d.ts +1 -1
- package/out/utils/string.js +38 -9
- package/out/utils/string.js.map +1 -1
- package/package.json +1 -2
- package/src/automate/engine/index.js +38 -128
- package/src/automate/engine/operators.js +63 -0
- package/src/automate/engine/uniqueName.js +36 -0
- package/src/automate/engine/utils.js +108 -69
- package/src/common/BaseNode.ts +14 -3
- package/src/concepts/App__.ts +138 -101
- package/src/concepts/Argument__.ts +1 -1
- package/src/concepts/Assignee__.ts +32 -2
- package/src/concepts/Assignment__.ts +1 -1
- package/src/concepts/Attribute__.ts +1 -1
- package/src/concepts/BinaryExpression__.ts +1 -1
- package/src/concepts/BindAttribute__.ts +4 -4
- package/src/concepts/BindDirective__.ts +2 -2
- package/src/concepts/BindEvent__.ts +10 -6
- package/src/concepts/BooleanLiteral__.ts +1 -1
- package/src/concepts/CallFunction__.ts +36 -18
- package/src/concepts/CallInterface__.ts +1 -1
- package/src/concepts/CallLogic__.ts +55 -24
- package/src/concepts/CallQueryComponent__.ts +357 -134
- package/src/concepts/Comment__.ts +2 -2
- package/src/concepts/CompletionProperty__.ts +1 -1
- package/src/concepts/ConfigGroup__.ts +5 -3
- package/src/concepts/ConfigPropertyValue__.ts +1 -1
- package/src/concepts/ConfigProperty__.ts +6 -2
- package/src/concepts/Configuration__.ts +5 -2
- package/src/concepts/Constant__.ts +7 -7
- package/src/concepts/DataElement__.ts +1 -1
- package/src/concepts/DataSource__.ts +389 -0
- package/src/concepts/Destination__.ts +28 -10
- package/src/concepts/End__.ts +3 -3
- package/src/concepts/EntityIndex__.ts +12 -3
- package/src/concepts/EntityProperty__.ts +24 -8
- package/src/concepts/Entity__.ts +39 -27
- package/src/concepts/EnumItem__.ts +1 -1
- package/src/concepts/Enum__.ts +16 -5
- package/src/concepts/Event__.ts +2 -2
- package/src/concepts/ForEachStatement__.ts +5 -5
- package/src/concepts/Function__.ts +101 -7
- package/src/concepts/Identifier__.ts +2 -12
- package/src/concepts/IfStatement__.ts +10 -10
- package/src/concepts/InterfaceParam__.ts +10 -5
- package/src/concepts/Interface__.ts +22 -14
- package/src/concepts/JSBlock__.ts +1 -1
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +60 -43
- package/src/concepts/MemberExpression__.ts +1 -2
- package/src/concepts/Module__.ts +16 -211
- package/src/concepts/Namespace__.ts +12 -215
- package/src/concepts/NullLiteral__.ts +1 -1
- package/src/concepts/NumericLiteral__.ts +1 -1
- package/src/concepts/Param__.ts +17 -9
- package/src/concepts/Point__.ts +1 -1
- package/src/concepts/ProcessComponent__.ts +3 -3
- package/src/concepts/ProcessElement__.ts +43 -21
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/Process__.ts +21 -15
- package/src/concepts/QueryAggregateExpression__.ts +2 -2
- package/src/concepts/QueryFieldExpression__.ts +14 -2
- package/src/concepts/QueryFromExpression__.ts +14 -3
- package/src/concepts/QueryGroupByExpression__.ts +24 -1
- package/src/concepts/QueryJoinExpression__.ts +16 -5
- package/src/concepts/QueryLimitExpression__.ts +9 -0
- package/src/concepts/QueryOrderByExpression__.ts +1 -1
- package/src/concepts/QuerySelectExpression__.ts +2 -2
- package/src/concepts/Rect__.ts +1 -1
- package/src/concepts/Return__.ts +16 -11
- package/src/concepts/Role__.ts +11 -5
- package/src/concepts/Slot__.ts +1 -1
- package/src/concepts/SqlQueryComponent__.ts +30 -11
- package/src/concepts/Start__.ts +1 -1
- package/src/concepts/StringLiteral__.ts +2 -9
- package/src/concepts/StructureProperty__.ts +6 -6
- package/src/concepts/Structure__.ts +22 -14
- package/src/concepts/SwitchCase__.ts +6 -6
- package/src/concepts/SwitchStatement__.ts +1 -1
- package/src/concepts/Theme__.ts +1 -1
- package/src/concepts/Transactional__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +55 -25
- package/src/concepts/TypeParam__.ts +1 -1
- package/src/concepts/UnaryExpression__.ts +1 -1
- package/src/concepts/Unparsed__.ts +1 -1
- package/src/concepts/UseComponent__.ts +1 -1
- package/src/concepts/ValidationRule__.ts +1 -1
- package/src/concepts/Variable__.ts +16 -11
- package/src/concepts/ViewComponent__.ts +6 -6
- package/src/concepts/ViewElement__.ts +21 -21
- package/src/concepts/View__.ts +54 -32
- package/src/concepts/WhileStatement__.ts +5 -5
- package/src/concepts/basics/stdlib/nasl.configuration.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.interface.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.util.ts +269 -6
- package/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts +1 -1
- package/src/concepts/basics/types/index.ts +1 -0
- package/src/concepts/index__.ts +1 -0
- package/src/enums/KEYWORDS.ts +0 -9
- package/src/generator/genBundleFiles.ts +8 -3
- package/src/generator/genMetaData.ts +13 -13
- package/src/manager/diagnostic.ts +1 -1
- package/src/server/createUiTs.ts +1 -0
- package/src/server/extendBaseNode.ts +318 -0
- package/src/server/getLogics.ts +33 -4
- package/src/server/getMemberIdentifier.ts +49 -2
- package/src/server/getProcesses.ts +231 -21
- package/src/server/getScope.ts +41 -24
- package/src/server/index.ts +1 -0
- package/src/server/naslServer.ts +248 -366
- package/src/server/process2LogicNamespace.ts +29 -19
- package/src/server/translator.ts +25 -2
- package/src/service/storage/init.ts +32 -12
- package/src/templator/genCreateBlock.ts +16 -13
- package/src/templator/genCurdEditMultipleKeyBlock.ts +16 -13
- package/src/templator/genCurdMultipleKeyBlock.ts +26 -22
- package/src/templator/genEditTableBlock.ts +14 -13
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genGridViewBlock.ts +22 -21
- package/src/templator/genListViewBlock.ts +9 -5
- package/src/templator/genQueryComponent.ts +12 -9
- package/src/templator/genSelectBlock.ts +14 -23
- package/src/templator/genTableBlock.ts +18 -16
- package/src/templator/genUpdateBlock.ts +17 -13
- package/src/templator/utils.ts +5 -2
- package/src/test/integration/connect-file.ts +6 -6
- package/src/translator/index.ts +1 -1
- package/src/utils/index.ts +38 -1
- package/src/utils/string.ts +39 -9
- package/out/concepts/basics/stdlib/nasl.browser copy.d.ts +0 -3
- package/out/concepts/basics/stdlib/nasl.browser copy.js +0 -70
- package/out/concepts/basics/stdlib/nasl.browser copy.js.map +0 -1
- package/out/terms/LEVEL_NAME_MAP.d.ts +0 -26
- package/out/terms/LEVEL_NAME_MAP.js +0 -30
- package/out/terms/LEVEL_NAME_MAP.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Constant from '@nasl/concepts/Constant__';
|
|
2
|
-
import { CompletionProperty, Process, ProcessElement, Namespace, Logic, TypeAnnotation, Return, Variable, StructureProperty, Param, Identifier, MemberExpression, LogicItem } from '..';
|
|
2
|
+
import { CompletionProperty, Process, ProcessElement, Namespace, Logic, TypeAnnotation, Return, Variable, StructureProperty, Param, Identifier, MemberExpression, LogicItem, App, BaseNode, Structure, Entity, EntityProperty } from '..';
|
|
3
3
|
import { getNodeByNodeCallee } from '../automate/engine/utils';
|
|
4
4
|
function alphaUpper(name: string) {
|
|
5
5
|
if (!name) {
|
|
@@ -156,16 +156,25 @@ export function syncMemberExpression(elem: ProcessElement | Process, callback: (
|
|
|
156
156
|
attr.destination.arguments.forEach((arg) => {
|
|
157
157
|
travelDown(arg.expression, (node) => {
|
|
158
158
|
if (node instanceof MemberExpression) {
|
|
159
|
-
console.log('UserTask', node.getValue());
|
|
159
|
+
// console.log('UserTask destination', node.getValue());
|
|
160
|
+
callback(node);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
if (attr.name === 'assignee') {
|
|
166
|
+
attr.assignee.dynamicUsers.forEach((dy) => {
|
|
167
|
+
travelDown(dy, (node) => {
|
|
168
|
+
if (node instanceof MemberExpression) {
|
|
169
|
+
// console.log('UserTask assignee', node.getValue());
|
|
160
170
|
callback(node);
|
|
161
|
-
// if(node.property.name === oldName) {}
|
|
162
171
|
}
|
|
163
172
|
});
|
|
164
173
|
});
|
|
165
174
|
}
|
|
166
175
|
});
|
|
167
176
|
}
|
|
168
|
-
if (el.type === 'ExclusiveGateway') {
|
|
177
|
+
if (el.type === 'ExclusiveGateway' || el.type === 'AutoTask') {
|
|
169
178
|
travelDown(el.logic, (node) => {
|
|
170
179
|
if (node instanceof MemberExpression) {
|
|
171
180
|
console.log('ExclusiveGateway', node.getValue());
|
|
@@ -175,8 +184,38 @@ export function syncMemberExpression(elem: ProcessElement | Process, callback: (
|
|
|
175
184
|
}
|
|
176
185
|
});
|
|
177
186
|
}
|
|
187
|
+
// a.b.c => MemberExpression
|
|
188
|
+
export function genMemberExpression(path: string) {
|
|
189
|
+
const arr = path.split('.');
|
|
190
|
+
let m: MemberExpression;
|
|
191
|
+
while(arr.length) {
|
|
192
|
+
const ns = arr.shift();
|
|
193
|
+
const cv = new Identifier({ name: ns });
|
|
194
|
+
if (!m) {
|
|
195
|
+
m = new MemberExpression({
|
|
196
|
+
object: cv,
|
|
197
|
+
});
|
|
198
|
+
cv.parentNode = m;
|
|
199
|
+
} else {
|
|
200
|
+
m.property = cv;
|
|
201
|
+
if(arr.length) {
|
|
202
|
+
const tm = new MemberExpression({
|
|
203
|
+
object: m,
|
|
204
|
+
});
|
|
205
|
+
m.parentKey = 'object';
|
|
206
|
+
m.parentNode = tm;
|
|
207
|
+
cv.parentKey = 'property';
|
|
208
|
+
cv.parentNode = tm;
|
|
209
|
+
m = tm;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return m;
|
|
215
|
+
}
|
|
216
|
+
|
|
178
217
|
// ['a','b','c'] => a.b.c
|
|
179
|
-
export function genCompletionProperty(prefix: string[] = []):(v: Variable | Param | Return | Constant) => CompletionProperty {
|
|
218
|
+
export function genCompletionProperty(prefix: string[] = []):(v: Variable | Param | Return | Constant | EntityProperty| StructureProperty) => CompletionProperty {
|
|
180
219
|
return (v) => {
|
|
181
220
|
let m: MemberExpression;
|
|
182
221
|
const p = new Identifier({ name: v.name });
|
|
@@ -238,7 +277,7 @@ export function getPreviousTask(node: ProcessElement) {
|
|
|
238
277
|
if (visitedMap.has(processElem)) {
|
|
239
278
|
return;
|
|
240
279
|
}
|
|
241
|
-
if (processElem !== node && (processElem.type === 'UserTask')) {
|
|
280
|
+
if (processElem !== node && (processElem.type === 'UserTask' || processElem.type === 'AutoTask')) {
|
|
242
281
|
elements.push(processElem);
|
|
243
282
|
}
|
|
244
283
|
visitedMap.set(processElem, true);
|
|
@@ -316,21 +355,21 @@ export function getProcessVariableSuggestions(node: Logic, abandonConstant: bool
|
|
|
316
355
|
scopeVariable.icon = processElem.type;
|
|
317
356
|
processVariables.children.push(scopeVariable);
|
|
318
357
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
358
|
+
if(processElem.type === 'AutoTask') {
|
|
359
|
+
const scopeVariable = new CompletionProperty({
|
|
360
|
+
name: processElem.name,
|
|
361
|
+
value: processElem.name,
|
|
362
|
+
icon: processElem.type,
|
|
363
|
+
noFurther: true,
|
|
364
|
+
children: [
|
|
365
|
+
...processElem.variables.map(genCompletionProperty([process.name, processElem.name])),
|
|
366
|
+
...processElem.returns.map(genCompletionProperty([process.name, processElem.name])),
|
|
367
|
+
]
|
|
368
|
+
});
|
|
369
|
+
scopeVariable.isProcess = true;
|
|
370
|
+
scopeVariable.icon = processElem.type;
|
|
371
|
+
processVariables.children.push(scopeVariable);
|
|
372
|
+
}
|
|
334
373
|
return processVariables;
|
|
335
374
|
}
|
|
336
375
|
|
|
@@ -378,3 +417,174 @@ export function getProcessVaraibleSelections(node: Logic, list: VariableSuggesti
|
|
|
378
417
|
|
|
379
418
|
list.splice(varidx, 1, data);
|
|
380
419
|
}
|
|
420
|
+
|
|
421
|
+
function deduceTypeAnnotation(
|
|
422
|
+
app: App,
|
|
423
|
+
node: Variable | Param | Return | Constant | EntityProperty| StructureProperty,
|
|
424
|
+
typeA: TypeAnnotation,
|
|
425
|
+
prefix: string[],
|
|
426
|
+
records: BaseNode[],
|
|
427
|
+
) {
|
|
428
|
+
const ns = typeA.typeNamespace;
|
|
429
|
+
const name = typeA.typeName;
|
|
430
|
+
const completion = genCompletionProperty(prefix)(node)
|
|
431
|
+
if(ns.startsWith('nasl')) {
|
|
432
|
+
return completion;
|
|
433
|
+
}
|
|
434
|
+
const nsPath = `${ns}.${name}`;
|
|
435
|
+
|
|
436
|
+
const typeNode = getNodeByNodeCallee(app, nsPath);
|
|
437
|
+
if(records.includes(typeNode)){
|
|
438
|
+
return null;
|
|
439
|
+
}
|
|
440
|
+
if(typeNode) {
|
|
441
|
+
records.push(typeNode)
|
|
442
|
+
const children = typeNode.properties.map((p: EntityProperty| StructureProperty) => {
|
|
443
|
+
return deduceTypeAnnotation(app, p, p.typeAnnotation, prefix.concat([node.name]), records.slice())
|
|
444
|
+
}).filter((q: CompletionProperty | null) => !!q);
|
|
445
|
+
completion.children = children;
|
|
446
|
+
completion.expanded = true;
|
|
447
|
+
return completion;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export function getProcessVariableSuggestionsAll(node: ProcessElement) {
|
|
452
|
+
const processElem = node;
|
|
453
|
+
const process = node.process;
|
|
454
|
+
const app = node.app;
|
|
455
|
+
const elements: ProcessElement[] = getPreviousTask(processElem);
|
|
456
|
+
const prevtasks = elements.map((us) => {
|
|
457
|
+
const cp = new CompletionProperty({
|
|
458
|
+
name: us.name,
|
|
459
|
+
value: us.name,
|
|
460
|
+
noFurther: true,
|
|
461
|
+
children: [
|
|
462
|
+
...us.returns.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, us.name], [])),
|
|
463
|
+
...us.constants.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, us.name], [])),
|
|
464
|
+
],
|
|
465
|
+
});
|
|
466
|
+
cp.expanded = true;
|
|
467
|
+
cp.icon = us.type;
|
|
468
|
+
cp.isProcess = true;
|
|
469
|
+
return cp;
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
const processVariables = new CompletionProperty({
|
|
473
|
+
name: process.name,
|
|
474
|
+
value: process.name,
|
|
475
|
+
noFurther: true,
|
|
476
|
+
children: [
|
|
477
|
+
...process.params.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name], [])),
|
|
478
|
+
...process.returns.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name], [])),
|
|
479
|
+
...process.constants.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name], [])),
|
|
480
|
+
...prevtasks,
|
|
481
|
+
],
|
|
482
|
+
});
|
|
483
|
+
processVariables.expanded = true;
|
|
484
|
+
processVariables.icon = 'Process';
|
|
485
|
+
if (processElem.type === 'ExclusiveGateway') {
|
|
486
|
+
const scopeVariable = new CompletionProperty({
|
|
487
|
+
name: processElem.name,
|
|
488
|
+
value: processElem.name,
|
|
489
|
+
icon: processElem.type,
|
|
490
|
+
noFurther: true,
|
|
491
|
+
children: processElem.variables.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, processElem.name], [])),
|
|
492
|
+
});
|
|
493
|
+
scopeVariable.expanded = true;
|
|
494
|
+
scopeVariable.isProcess = true;
|
|
495
|
+
scopeVariable.icon = processElem.type;
|
|
496
|
+
processVariables.children.push(scopeVariable);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
if (processElem.type === 'UserTask') {
|
|
500
|
+
const scopeVariable = new CompletionProperty({
|
|
501
|
+
name: processElem.name,
|
|
502
|
+
value: processElem.name,
|
|
503
|
+
icon: processElem.type,
|
|
504
|
+
noFurther: true,
|
|
505
|
+
children: processElem.constants.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, processElem.name], [])),
|
|
506
|
+
});
|
|
507
|
+
scopeVariable.expanded = true;
|
|
508
|
+
scopeVariable.isProcess = true;
|
|
509
|
+
scopeVariable.icon = processElem.type;
|
|
510
|
+
processVariables.children.push(scopeVariable);
|
|
511
|
+
}
|
|
512
|
+
if(processElem.type === 'AutoTask') {
|
|
513
|
+
const scopeVariable = new CompletionProperty({
|
|
514
|
+
name: processElem.name,
|
|
515
|
+
value: processElem.name,
|
|
516
|
+
icon: processElem.type,
|
|
517
|
+
noFurther: true,
|
|
518
|
+
children: [
|
|
519
|
+
...processElem.variables.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, processElem.name], [])),
|
|
520
|
+
...processElem.returns.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, processElem.name], [])),
|
|
521
|
+
]
|
|
522
|
+
});
|
|
523
|
+
scopeVariable.expanded = true;
|
|
524
|
+
scopeVariable.isProcess = true;
|
|
525
|
+
scopeVariable.icon = processElem.type;
|
|
526
|
+
processVariables.children.push(scopeVariable);
|
|
527
|
+
}
|
|
528
|
+
return processVariables;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
export function getFlowAfterElements(el: ProcessElement) {
|
|
533
|
+
const process = el.process;
|
|
534
|
+
const processname = el.name;
|
|
535
|
+
const elems = process.elements;
|
|
536
|
+
const links = elems.filter(e => e.type === 'SequenceFlow' && e.sourceRef === processname);
|
|
537
|
+
return links;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export function isFromStartNode(el: ProcessElement) {
|
|
541
|
+
const process = el.process;
|
|
542
|
+
// const processname = el.name;
|
|
543
|
+
const elems = process.elements;
|
|
544
|
+
const set = new WeakSet();
|
|
545
|
+
const stack = [el];
|
|
546
|
+
while(stack.length){
|
|
547
|
+
let t = stack.shift();
|
|
548
|
+
let name = t.name;
|
|
549
|
+
if(t.type === 'StartNoneEvent') {
|
|
550
|
+
return true;
|
|
551
|
+
}
|
|
552
|
+
elems.forEach(e => {
|
|
553
|
+
if(e.type === 'SequenceFlow'
|
|
554
|
+
&& e.targetRef === name
|
|
555
|
+
&& !set.has(e)) {
|
|
556
|
+
set.add(e);
|
|
557
|
+
const sourcename = e.sourceRef;
|
|
558
|
+
const source = elems.find(e => e.name === sourcename);
|
|
559
|
+
stack.push(source);
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
return false;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export function findNodeAfterNodeInFlow(el: ProcessElement) {
|
|
567
|
+
const process = el.process;
|
|
568
|
+
const elems = process.elements;
|
|
569
|
+
const set = new WeakSet();
|
|
570
|
+
const nodeSet = new Set();
|
|
571
|
+
const stack = [el];
|
|
572
|
+
while(stack.length){
|
|
573
|
+
let t = stack.shift();
|
|
574
|
+
if(el !== t) {
|
|
575
|
+
nodeSet.add(t);
|
|
576
|
+
}
|
|
577
|
+
const name = t.name;
|
|
578
|
+
elems.forEach(e => {
|
|
579
|
+
if(e.type === 'SequenceFlow'
|
|
580
|
+
&& e.sourceRef === name
|
|
581
|
+
&& !set.has(e)) {
|
|
582
|
+
set.add(e);
|
|
583
|
+
const targetname = e.targetRef;
|
|
584
|
+
const source = elems.find(e => e.name === targetname);
|
|
585
|
+
stack.push(source);
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
return Array.from(nodeSet);
|
|
590
|
+
}
|
package/src/server/getScope.ts
CHANGED
|
@@ -1,50 +1,67 @@
|
|
|
1
|
-
import { Logic, View, Process } from
|
|
1
|
+
import { Logic, View, Process } from '..';
|
|
2
2
|
|
|
3
3
|
type wordScope = {
|
|
4
4
|
Param?: string[]
|
|
5
5
|
Return?: string[]
|
|
6
6
|
Variable?: string[]
|
|
7
7
|
Constant?: string[]
|
|
8
|
+
Logic?: string[]
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
export function getLogicScopeWords(logic: Logic): wordScope{
|
|
11
|
+
export function getLogicScopeWords(logic: Logic): wordScope {
|
|
11
12
|
const scope: wordScope = {
|
|
12
|
-
Param: logic.params.map(p => p.name),
|
|
13
|
-
Return: logic.returns.map(p => p.name),
|
|
14
|
-
Variable: logic.variables.map(p => p.name),
|
|
15
|
-
|
|
13
|
+
Param: logic.params.map((p) => p.name),
|
|
14
|
+
Return: logic.returns.map((p) => p.name),
|
|
15
|
+
Variable: logic.variables.map((p) => p.name),
|
|
16
|
+
Constant: [],
|
|
17
|
+
Logic: []
|
|
18
|
+
};
|
|
16
19
|
return scope;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
export function getViewScopeWords(view: View): wordScope{
|
|
22
|
+
export function getViewScopeWords(view: View): wordScope {
|
|
20
23
|
const scope: wordScope = {
|
|
21
|
-
Param: view.params.map(p => p.name),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
Param: view.params.map((p) => p.name),
|
|
25
|
+
Variable: view.variables.map((p) => p.name),
|
|
26
|
+
Return: [],
|
|
27
|
+
Constant: [],
|
|
28
|
+
Logic: view.logics.map(l => l.name),
|
|
29
|
+
};
|
|
25
30
|
return scope;
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
export function getProcessScopeWords(process: Process): wordScope{
|
|
33
|
+
export function getProcessScopeWords(process: Process): wordScope {
|
|
29
34
|
const processName = process.name;
|
|
30
35
|
const scope: wordScope = {
|
|
31
|
-
Param: process.params.map(p => `${processName}.${p.name}`),
|
|
32
|
-
Return: process.returns.map(p => `${processName}.${p.name}`),
|
|
33
|
-
Constant: process.constants.map(p => `${processName}.${p.name}`),
|
|
36
|
+
Param: process.params.map((p) => `${processName}.${p.name}`),
|
|
37
|
+
Return: process.returns.map((p) => `${processName}.${p.name}`),
|
|
38
|
+
Constant: process.constants.map((p) => `${processName}.${p.name}`),
|
|
34
39
|
Variable: [],
|
|
35
|
-
|
|
40
|
+
Logic: []
|
|
41
|
+
};
|
|
36
42
|
|
|
37
|
-
process.elements.forEach(el => {
|
|
43
|
+
process.elements.forEach((el) => {
|
|
38
44
|
const elname = el.name;
|
|
39
|
-
el.variables.forEach(v => {
|
|
40
|
-
scope.Variable.push(`${processName}.${elname}.${v.name}`)
|
|
45
|
+
el.variables.forEach((v) => {
|
|
46
|
+
scope.Variable.push(`${processName}.${elname}.${v.name}`);
|
|
41
47
|
});
|
|
42
|
-
el.returns.forEach(v => {
|
|
43
|
-
scope.Return.push(`${processName}.${elname}.${v.name}`)
|
|
48
|
+
el.returns.forEach((v) => {
|
|
49
|
+
scope.Return.push(`${processName}.${elname}.${v.name}`);
|
|
44
50
|
});
|
|
45
|
-
el.constants.forEach(v => {
|
|
46
|
-
scope.Constant.push(`${processName}.${elname}.${v.name}`)
|
|
51
|
+
el.constants.forEach((v) => {
|
|
52
|
+
scope.Constant.push(`${processName}.${elname}.${v.name}`);
|
|
47
53
|
});
|
|
48
|
-
})
|
|
54
|
+
});
|
|
55
|
+
return scope;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function combineScope(a: wordScope, b: wordScope) : wordScope {
|
|
59
|
+
const scope: wordScope = {
|
|
60
|
+
Param: [...a.Param, ...b.Param],
|
|
61
|
+
Return: [...a.Return, ...b.Return],
|
|
62
|
+
Constant: [...a.Constant, ...b.Constant],
|
|
63
|
+
Variable: [...a.Variable, ...b.Variable],
|
|
64
|
+
Logic: [...a.Logic, ...b.Logic],
|
|
65
|
+
};
|
|
49
66
|
return scope;
|
|
50
67
|
}
|