@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
package/src/concepts/App__.ts
CHANGED
|
@@ -14,7 +14,7 @@ import * as utils from '../utils';
|
|
|
14
14
|
import { v4 as uuidv4 } from 'uuid';
|
|
15
15
|
import BaseNode from '../common/BaseNode';
|
|
16
16
|
import classMap from '../common/classMap';
|
|
17
|
-
import
|
|
17
|
+
import DataSource from './DataSource__';
|
|
18
18
|
import Structure from './Structure__';
|
|
19
19
|
import Enum from './Enum__';
|
|
20
20
|
import Logic from './Logic__';
|
|
@@ -110,10 +110,10 @@ export class App extends BaseNode {
|
|
|
110
110
|
hasAuth: boolean = undefined;
|
|
111
111
|
|
|
112
112
|
/**
|
|
113
|
-
*
|
|
113
|
+
* 数据源列表
|
|
114
114
|
*/
|
|
115
|
-
@property('
|
|
116
|
-
|
|
115
|
+
@property('DataSource')
|
|
116
|
+
dataSources: Array<DataSource> = [];
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* 数据结构列表
|
|
@@ -237,143 +237,143 @@ export class App extends BaseNode {
|
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
|
|
240
|
+
getDataSourceExistingNames(excludedList: Array<DataSource> = []) {
|
|
241
241
|
const excludedSet = new Set(excludedList);
|
|
242
|
-
return (this.
|
|
242
|
+
return (this.dataSources || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
243
243
|
}
|
|
244
|
-
|
|
245
|
-
return utils.unique(name, this.
|
|
244
|
+
getDataSourceUniqueName(name = 'DataSource1') {
|
|
245
|
+
return utils.unique(name, this.getDataSourceExistingNames(), undefined, true);
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
/**
|
|
249
|
-
*
|
|
249
|
+
* 插入数据源
|
|
250
250
|
* @internal
|
|
251
|
-
* @param name
|
|
251
|
+
* @param name 数据源名称,如果不填会自动生成一个唯一名称
|
|
252
252
|
*/
|
|
253
|
-
|
|
253
|
+
_insertDataSourceAt(name: string, index: number): DataSource;
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
|
-
*
|
|
256
|
+
* 插入数据源
|
|
257
257
|
* @internal
|
|
258
|
-
* @param
|
|
258
|
+
* @param dataSourceOptions 数据源参数
|
|
259
259
|
*/
|
|
260
|
-
|
|
260
|
+
_insertDataSourceAt(dataSourceOptions: Partial<DataSource>, index: number): DataSource;
|
|
261
261
|
|
|
262
262
|
/**
|
|
263
|
-
*
|
|
263
|
+
* 插入数据源
|
|
264
264
|
* @internal
|
|
265
|
-
* @param
|
|
265
|
+
* @param dataSource 已有的数据源实例
|
|
266
266
|
*/
|
|
267
|
-
|
|
267
|
+
_insertDataSourceAt(dataSource: DataSource, index: number): DataSource;
|
|
268
268
|
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
const relationOptions = { parentNode: this, parentKey: '
|
|
272
|
-
let
|
|
269
|
+
_insertDataSourceAt(options: string | Partial<DataSource> | DataSource, index: number) {
|
|
270
|
+
const dataSourceOptions: any = {};
|
|
271
|
+
const relationOptions = { parentNode: this, parentKey: 'dataSources' };
|
|
272
|
+
let dataSource: DataSource;
|
|
273
273
|
if (!options) {
|
|
274
|
-
|
|
275
|
-
...
|
|
276
|
-
name: this.
|
|
277
|
-
}, this, '
|
|
274
|
+
dataSource = DataSource.from({
|
|
275
|
+
...dataSourceOptions,
|
|
276
|
+
name: this.getDataSourceUniqueName(),
|
|
277
|
+
}, this, 'dataSources');
|
|
278
278
|
} else if (typeof options === 'string') {
|
|
279
|
-
|
|
280
|
-
...
|
|
279
|
+
dataSource = DataSource.from({
|
|
280
|
+
...dataSourceOptions,
|
|
281
281
|
name: options,
|
|
282
|
-
}, this, '
|
|
283
|
-
} else if (options instanceof
|
|
282
|
+
}, this, 'dataSources');
|
|
283
|
+
} else if (options instanceof DataSource) {
|
|
284
284
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
285
|
-
|
|
286
|
-
Object.assign(
|
|
285
|
+
dataSource = options;
|
|
286
|
+
Object.assign(dataSource, relationOptions);
|
|
287
287
|
} else {
|
|
288
|
-
|
|
289
|
-
...
|
|
288
|
+
dataSource = DataSource.from({
|
|
289
|
+
...dataSourceOptions,
|
|
290
290
|
...options,
|
|
291
|
-
}, this, '
|
|
291
|
+
}, this, 'dataSources');
|
|
292
292
|
}
|
|
293
|
-
this.
|
|
294
|
-
return
|
|
293
|
+
this.dataSources.splice(index, 0, dataSource);
|
|
294
|
+
return dataSource;
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
/**
|
|
298
|
-
*
|
|
299
|
-
* @param name
|
|
298
|
+
* 插入数据源
|
|
299
|
+
* @param name 数据源名称,如果不填会自动生成一个唯一名称
|
|
300
300
|
*/
|
|
301
|
-
|
|
301
|
+
insertDataSourceAt(name: string, index: number): DataSource;
|
|
302
302
|
|
|
303
303
|
/**
|
|
304
|
-
*
|
|
305
|
-
* @param
|
|
304
|
+
* 插入数据源
|
|
305
|
+
* @param dataSourceOptions 数据源参数
|
|
306
306
|
*/
|
|
307
|
-
|
|
307
|
+
insertDataSourceAt(dataSourceOptions: Partial<DataSource>, index: number): DataSource;
|
|
308
308
|
|
|
309
309
|
/**
|
|
310
|
-
*
|
|
311
|
-
* @param
|
|
310
|
+
* 插入数据源
|
|
311
|
+
* @param dataSource 已有的数据源实例
|
|
312
312
|
*/
|
|
313
|
-
|
|
313
|
+
insertDataSourceAt(dataSource: DataSource, index: number): DataSource;
|
|
314
314
|
|
|
315
|
-
|
|
316
|
-
const node = this.
|
|
315
|
+
insertDataSourceAt(options: string | Partial<DataSource> | DataSource, index: number) {
|
|
316
|
+
const node = this._insertDataSourceAt(options as any, index);
|
|
317
317
|
node.create({
|
|
318
318
|
index,
|
|
319
319
|
parentNode: this,
|
|
320
|
-
parentKey: '
|
|
320
|
+
parentKey: 'dataSources',
|
|
321
321
|
});
|
|
322
322
|
return node;
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
/**
|
|
326
|
-
*
|
|
326
|
+
* 添加数据源
|
|
327
327
|
* @internal
|
|
328
|
-
* @param name
|
|
328
|
+
* @param name 数据源名称,如果不填会自动生成一个唯一名称
|
|
329
329
|
*/
|
|
330
|
-
|
|
330
|
+
_addDataSource(name?: string): DataSource;
|
|
331
331
|
|
|
332
332
|
/**
|
|
333
|
-
*
|
|
333
|
+
* 添加数据源
|
|
334
334
|
* @internal
|
|
335
|
-
* @param
|
|
335
|
+
* @param dataSourceOptions 数据源参数
|
|
336
336
|
*/
|
|
337
|
-
|
|
337
|
+
_addDataSource(dataSourceOptions: Partial<DataSource>): DataSource;
|
|
338
338
|
|
|
339
339
|
/**
|
|
340
|
-
*
|
|
340
|
+
* 添加数据源
|
|
341
341
|
* @internal
|
|
342
|
-
* @param
|
|
342
|
+
* @param dataSource 已有的数据源实例
|
|
343
343
|
*/
|
|
344
|
-
|
|
344
|
+
_addDataSource(dataSource: DataSource): DataSource;
|
|
345
345
|
|
|
346
|
-
|
|
347
|
-
const index =
|
|
348
|
-
return this.
|
|
346
|
+
_addDataSource(options?: string | Partial<DataSource> | DataSource) {
|
|
347
|
+
const index = this.dataSources.length;
|
|
348
|
+
return this._insertDataSourceAt(options as any, index);
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
/**
|
|
352
|
-
*
|
|
352
|
+
* 添加数据源
|
|
353
353
|
* @internal
|
|
354
|
-
* @param name
|
|
354
|
+
* @param name 数据源名称,如果不填会自动生成一个唯一名称
|
|
355
355
|
*/
|
|
356
|
-
|
|
356
|
+
addDataSource(name?: string): DataSource;
|
|
357
357
|
|
|
358
358
|
/**
|
|
359
|
-
*
|
|
360
|
-
* @param
|
|
359
|
+
* 添加数据源
|
|
360
|
+
* @param dataSourceOptions 数据源参数
|
|
361
361
|
*/
|
|
362
|
-
|
|
362
|
+
addDataSource(dataSourceOptions: Partial<DataSource>): DataSource;
|
|
363
363
|
|
|
364
364
|
/**
|
|
365
|
-
*
|
|
366
|
-
* @param
|
|
365
|
+
* 添加数据源
|
|
366
|
+
* @param dataSource 已有的数据源实例
|
|
367
367
|
*/
|
|
368
|
-
|
|
368
|
+
addDataSource(dataSource: DataSource): DataSource;
|
|
369
369
|
|
|
370
|
-
|
|
371
|
-
const node = this.
|
|
372
|
-
const index = this.
|
|
370
|
+
addDataSource(options?: string | Partial<DataSource> | DataSource) {
|
|
371
|
+
const node = this._addDataSource(options as any);
|
|
372
|
+
const index = this.dataSources.indexOf(node);
|
|
373
373
|
node.create({
|
|
374
374
|
index,
|
|
375
375
|
parentNode: this,
|
|
376
|
-
parentKey: '
|
|
376
|
+
parentKey: 'dataSources',
|
|
377
377
|
});
|
|
378
378
|
return node;
|
|
379
379
|
}
|
|
@@ -384,7 +384,7 @@ export class App extends BaseNode {
|
|
|
384
384
|
return (this.structures || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
385
385
|
}
|
|
386
386
|
getStructureUniqueName(name = 'Structure1') {
|
|
387
|
-
return utils.unique(name, this.getStructureExistingNames());
|
|
387
|
+
return utils.unique(name, this.getStructureExistingNames(), undefined, true);
|
|
388
388
|
}
|
|
389
389
|
|
|
390
390
|
/**
|
|
@@ -526,7 +526,7 @@ export class App extends BaseNode {
|
|
|
526
526
|
return (this.enums || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
527
527
|
}
|
|
528
528
|
getEnumUniqueName(name = 'Enum1') {
|
|
529
|
-
return utils.unique(name, this.getEnumExistingNames());
|
|
529
|
+
return utils.unique(name, this.getEnumExistingNames(), undefined, true);
|
|
530
530
|
}
|
|
531
531
|
|
|
532
532
|
/**
|
|
@@ -668,7 +668,7 @@ export class App extends BaseNode {
|
|
|
668
668
|
return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
669
669
|
}
|
|
670
670
|
getLogicUniqueName(name = 'logic1') {
|
|
671
|
-
return utils.unique(name, this.getLogicExistingNames());
|
|
671
|
+
return utils.unique(name, this.getLogicExistingNames(), undefined, true);
|
|
672
672
|
}
|
|
673
673
|
|
|
674
674
|
/**
|
|
@@ -810,7 +810,7 @@ export class App extends BaseNode {
|
|
|
810
810
|
return (this.interfaces || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
811
811
|
}
|
|
812
812
|
getInterfaceUniqueName(name = 'Interface1') {
|
|
813
|
-
return utils.unique(name, this.getInterfaceExistingNames());
|
|
813
|
+
return utils.unique(name, this.getInterfaceExistingNames(), undefined, true);
|
|
814
814
|
}
|
|
815
815
|
|
|
816
816
|
/**
|
|
@@ -952,7 +952,7 @@ export class App extends BaseNode {
|
|
|
952
952
|
return (this.views || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
953
953
|
}
|
|
954
954
|
getViewUniqueName(name = 'view1') {
|
|
955
|
-
return utils.unique(name, this.getViewExistingNames());
|
|
955
|
+
return utils.unique(name, this.getViewExistingNames(), undefined, true);
|
|
956
956
|
}
|
|
957
957
|
|
|
958
958
|
/**
|
|
@@ -1094,7 +1094,7 @@ export class App extends BaseNode {
|
|
|
1094
1094
|
return (this.processes || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1095
1095
|
}
|
|
1096
1096
|
getProcessUniqueName(name = 'Process1') {
|
|
1097
|
-
return utils.unique(name, this.getProcessExistingNames());
|
|
1097
|
+
return utils.unique(name, this.getProcessExistingNames(), undefined, true);
|
|
1098
1098
|
}
|
|
1099
1099
|
|
|
1100
1100
|
/**
|
|
@@ -1236,7 +1236,7 @@ export class App extends BaseNode {
|
|
|
1236
1236
|
return (this.roles || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1237
1237
|
}
|
|
1238
1238
|
getRoleUniqueName(name = 'role1') {
|
|
1239
|
-
return utils.unique(name, this.getRoleExistingNames());
|
|
1239
|
+
return utils.unique(name, this.getRoleExistingNames(), undefined, true);
|
|
1240
1240
|
}
|
|
1241
1241
|
|
|
1242
1242
|
/**
|
|
@@ -1378,7 +1378,7 @@ export class App extends BaseNode {
|
|
|
1378
1378
|
return (this.dependencies || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1379
1379
|
}
|
|
1380
1380
|
getModuleUniqueName(name = 'module1') {
|
|
1381
|
-
return utils.unique(name, this.getModuleExistingNames());
|
|
1381
|
+
return utils.unique(name, this.getModuleExistingNames(), undefined, false);
|
|
1382
1382
|
}
|
|
1383
1383
|
|
|
1384
1384
|
/**
|
|
@@ -1784,46 +1784,46 @@ export class App extends BaseNode {
|
|
|
1784
1784
|
|
|
1785
1785
|
|
|
1786
1786
|
/**
|
|
1787
|
-
*
|
|
1788
|
-
* @param name
|
|
1787
|
+
* 删除数据源
|
|
1788
|
+
* @param name 数据源名称
|
|
1789
1789
|
*/
|
|
1790
|
-
|
|
1790
|
+
removeDataSource(name: string): void;
|
|
1791
1791
|
|
|
1792
1792
|
/**
|
|
1793
|
-
*
|
|
1794
|
-
* @param
|
|
1793
|
+
* 删除数据源
|
|
1794
|
+
* @param dataSource 已有的数据源实例
|
|
1795
1795
|
*/
|
|
1796
|
-
|
|
1796
|
+
removeDataSource(dataSource: DataSource): void;
|
|
1797
1797
|
|
|
1798
|
-
|
|
1799
|
-
let
|
|
1798
|
+
removeDataSource(options: string | DataSource) {
|
|
1799
|
+
let dataSource: DataSource;
|
|
1800
1800
|
if (typeof options === 'string') {
|
|
1801
|
-
|
|
1802
|
-
if (!
|
|
1803
|
-
throw new Error('
|
|
1801
|
+
dataSource = this.dataSources.find((item) => item.name === options);
|
|
1802
|
+
if (!dataSource) {
|
|
1803
|
+
throw new Error('找不到数据源 ' + options);
|
|
1804
1804
|
}
|
|
1805
1805
|
} else {
|
|
1806
|
-
|
|
1806
|
+
dataSource = options;
|
|
1807
1807
|
}
|
|
1808
|
-
return
|
|
1808
|
+
return dataSource.delete();
|
|
1809
1809
|
}
|
|
1810
1810
|
|
|
1811
|
-
|
|
1812
|
-
const parentKey =
|
|
1811
|
+
__removeDataSource(dataSource: DataSource) {
|
|
1812
|
+
const parentKey = dataSource.parentKey;
|
|
1813
1813
|
const params: Params = {
|
|
1814
1814
|
parentNode: this,
|
|
1815
1815
|
parentKey,
|
|
1816
1816
|
index: -1,
|
|
1817
1817
|
object: null,
|
|
1818
|
-
oldObject:
|
|
1818
|
+
oldObject: dataSource,
|
|
1819
1819
|
};
|
|
1820
1820
|
if (parentKey) {
|
|
1821
1821
|
params.parentKey = parentKey;
|
|
1822
1822
|
if (Array.isArray((this as any)[parentKey])) {
|
|
1823
|
-
const index = (this as any)[parentKey].indexOf(
|
|
1823
|
+
const index = (this as any)[parentKey].indexOf(dataSource);
|
|
1824
1824
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1825
1825
|
params.index = index;
|
|
1826
|
-
} else if ((this as any)[parentKey] ===
|
|
1826
|
+
} else if ((this as any)[parentKey] === dataSource) {
|
|
1827
1827
|
params.index = 0;
|
|
1828
1828
|
(this as any)[parentKey] = undefined;
|
|
1829
1829
|
}
|
|
@@ -2393,8 +2393,12 @@ export class App extends BaseNode {
|
|
|
2393
2393
|
return this.componentDependencies.find((componentDependency) => componentDependency.name === name);
|
|
2394
2394
|
}
|
|
2395
2395
|
|
|
2396
|
-
|
|
2397
|
-
return this.
|
|
2396
|
+
findDataSourceByName(name: string) {
|
|
2397
|
+
return this.dataSources.find((dataSourceItem) => dataSourceItem.name === name);
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
get defaultDS() {
|
|
2401
|
+
return this.dataSources?.find((dataSource) => dataSource.name === 'defaultDS');
|
|
2398
2402
|
}
|
|
2399
2403
|
|
|
2400
2404
|
findEnumByName(name: string) {
|
|
@@ -2467,6 +2471,10 @@ export class App extends BaseNode {
|
|
|
2467
2471
|
* 获取命名空间
|
|
2468
2472
|
*/
|
|
2469
2473
|
getNamespace() {
|
|
2474
|
+
return 'app';
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
getTsNamespace() {
|
|
2470
2478
|
return `app`;
|
|
2471
2479
|
}
|
|
2472
2480
|
|
|
@@ -2494,6 +2502,35 @@ export class App extends BaseNode {
|
|
|
2494
2502
|
return node;
|
|
2495
2503
|
}
|
|
2496
2504
|
|
|
2505
|
+
findNodeByCompleteName(completeName: string) {
|
|
2506
|
+
const nameArr = completeName?.split('.') || [];
|
|
2507
|
+
const start = nameArr.shift();
|
|
2508
|
+
let node: any = this;
|
|
2509
|
+
const mod = 0;
|
|
2510
|
+
const modulesMap: any = {
|
|
2511
|
+
extensions: node.dependencies,
|
|
2512
|
+
apis: node.interfaceDependencies,
|
|
2513
|
+
};
|
|
2514
|
+
const modules = modulesMap[start];
|
|
2515
|
+
if (Array.isArray(modules)) {
|
|
2516
|
+
const moduleName = nameArr.shift();
|
|
2517
|
+
node = modules.find((moduleItem) => moduleItem.name === moduleName);
|
|
2518
|
+
}
|
|
2519
|
+
for (let index = 0; index < nameArr.length; index++) {
|
|
2520
|
+
if (!node) {
|
|
2521
|
+
return null;
|
|
2522
|
+
}
|
|
2523
|
+
const nameItem = nameArr[index];
|
|
2524
|
+
const isKeyword = index % 2 === mod;
|
|
2525
|
+
if (!isKeyword && Array.isArray(node)) {
|
|
2526
|
+
node = node.find(({ name }) => name === nameItem);
|
|
2527
|
+
} else {
|
|
2528
|
+
node = node[nameItem];
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
return node;
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2497
2534
|
/**
|
|
2498
2535
|
* @param path 路径
|
|
2499
2536
|
* path 为要查找路径:如 /dashboard/student/list、/dashboard/student/list
|
|
@@ -209,7 +209,7 @@ export class Argument extends LogicItem {
|
|
|
209
209
|
//================================================================================
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
classMap
|
|
212
|
+
classMap.Argument = Argument;
|
|
213
213
|
export default Argument;
|
|
214
214
|
//================================================================================
|
|
215
215
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState, embeddedTSEmitter } from '../translator';
|
|
2
|
+
import { ProcessElement, Process, } from '..';
|
|
3
|
+
|
|
1
4
|
//================================================================================
|
|
2
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
3
6
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -71,7 +74,7 @@ export class Assignee extends LogicItem {
|
|
|
71
74
|
return (this.dynamicUsers || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
72
75
|
}
|
|
73
76
|
getLogicItemUniqueName(name = 'logicItem1') {
|
|
74
|
-
return utils.unique(name, this.getLogicItemExistingNames());
|
|
77
|
+
return utils.unique(name, this.getLogicItemExistingNames(), undefined, false);
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
/**
|
|
@@ -422,14 +425,41 @@ export class Assignee extends LogicItem {
|
|
|
422
425
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
423
426
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
424
427
|
//================================================================================
|
|
428
|
+
/**
|
|
429
|
+
* 祖先 ProcessElement
|
|
430
|
+
*/
|
|
431
|
+
get processElement() {
|
|
432
|
+
return this.getAncestor('ProcessElement') as ProcessElement;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* 祖先 Process
|
|
436
|
+
*/
|
|
437
|
+
get process() {
|
|
438
|
+
return this.getAncestor('Process') as Process;
|
|
439
|
+
}
|
|
425
440
|
|
|
441
|
+
@withSourceMap()
|
|
442
|
+
toEmbeddedTSInProcess(state: TranslatorState, prevCode: string): string {
|
|
443
|
+
// const tab = indent(state.tabSize);
|
|
444
|
+
// let code = `const plainuser = [];\n`
|
|
445
|
+
// code += `const dynamicuser = [];\n`
|
|
446
|
+
let code = prevCode;
|
|
447
|
+
code += `return nasl.util.concatString(`;
|
|
448
|
+
this.dynamicUsers.forEach(u => {
|
|
449
|
+
code += u.toEmbeddedTS(shiftState(state, code));
|
|
450
|
+
code += ',\n';
|
|
451
|
+
})
|
|
452
|
+
code += ')\n';
|
|
453
|
+
// code += `${this.dynamicUsers.map(u => u.toEmbeddedTS(shiftState(state, code))).join(',\n')})\n`;
|
|
454
|
+
return code;
|
|
455
|
+
}
|
|
426
456
|
//================================================================================
|
|
427
457
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
428
458
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
429
459
|
//================================================================================
|
|
430
460
|
}
|
|
431
461
|
|
|
432
|
-
classMap
|
|
462
|
+
classMap.Assignee = Assignee;
|
|
433
463
|
export default Assignee;
|
|
434
464
|
//================================================================================
|
|
435
465
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -231,7 +231,7 @@ export class Assignment extends LogicItem {
|
|
|
231
231
|
//================================================================================
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
classMap
|
|
234
|
+
classMap.Assignment = Assignment;
|
|
235
235
|
export default Assignment;
|
|
236
236
|
//================================================================================
|
|
237
237
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -244,7 +244,7 @@ export class Attribute extends BaseNode {
|
|
|
244
244
|
//================================================================================
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
classMap
|
|
247
|
+
classMap.Attribute = Attribute;
|
|
248
248
|
export default Attribute;
|
|
249
249
|
//================================================================================
|
|
250
250
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -281,7 +281,7 @@ export class BinaryExpression extends LogicItem {
|
|
|
281
281
|
//================================================================================
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
classMap
|
|
284
|
+
classMap.BinaryExpression = BinaryExpression;
|
|
285
285
|
export default BinaryExpression;
|
|
286
286
|
//================================================================================
|
|
287
287
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -223,7 +223,7 @@ export class BindAttribute extends BaseNode {
|
|
|
223
223
|
return (this.rules || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
224
224
|
}
|
|
225
225
|
getValidationRuleUniqueName(name = 'validationRule1') {
|
|
226
|
-
return utils.unique(name, this.getValidationRuleExistingNames());
|
|
226
|
+
return utils.unique(name, this.getValidationRuleExistingNames(), undefined, false);
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
/**
|
|
@@ -548,9 +548,9 @@ export class BindAttribute extends BaseNode {
|
|
|
548
548
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
549
549
|
let code = '';
|
|
550
550
|
if (this.name === 'destination') {
|
|
551
|
-
code += this.destination.toEmbeddedTS(shiftState(state, code, { tabSize: state
|
|
551
|
+
code += this.destination.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
552
552
|
} else if (this.expression) {
|
|
553
|
-
code += this.expression.toEmbeddedTS(shiftState(state, code, { tabSize: state
|
|
553
|
+
code += this.expression.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
554
554
|
}
|
|
555
555
|
return code;
|
|
556
556
|
}
|
|
@@ -560,7 +560,7 @@ export class BindAttribute extends BaseNode {
|
|
|
560
560
|
//================================================================================
|
|
561
561
|
}
|
|
562
562
|
|
|
563
|
-
classMap
|
|
563
|
+
classMap.BindAttribute = BindAttribute;
|
|
564
564
|
export default BindAttribute;
|
|
565
565
|
//================================================================================
|
|
566
566
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -218,7 +218,7 @@ export class BindDirective extends BaseNode {
|
|
|
218
218
|
if (this.expression) {
|
|
219
219
|
value = this.expression.toVue(options);
|
|
220
220
|
if (this.expression.concept === 'StringLiteral') {
|
|
221
|
-
value =
|
|
221
|
+
value = `${value}`;
|
|
222
222
|
}
|
|
223
223
|
value = value?.replace(/"/g, "'");
|
|
224
224
|
}
|
|
@@ -253,7 +253,7 @@ export class BindDirective extends BaseNode {
|
|
|
253
253
|
//================================================================================
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
classMap
|
|
256
|
+
classMap.BindDirective = BindDirective;
|
|
257
257
|
export default BindDirective;
|
|
258
258
|
//================================================================================
|
|
259
259
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -339,10 +339,10 @@ export class BindEvent extends BaseNode {
|
|
|
339
339
|
return `${this.calleeKey}();`;
|
|
340
340
|
}
|
|
341
341
|
let code = `${this.toHump(this.name) || '__IDENTIFIER__'}: (event) => [\n`;
|
|
342
|
-
code += indent(state
|
|
342
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
343
343
|
code += `() => {${this.calleeKey}()}`;
|
|
344
344
|
code += '\n';
|
|
345
|
-
code += indent(state
|
|
345
|
+
code += indent((state?.tabSize || 0));
|
|
346
346
|
code += '],\n';
|
|
347
347
|
return code;
|
|
348
348
|
}
|
|
@@ -354,10 +354,10 @@ export class BindEvent extends BaseNode {
|
|
|
354
354
|
// let code = '';
|
|
355
355
|
// if (this.name) {
|
|
356
356
|
// code = `function ${this.name || '__IDENTIFIER__'} () {\n`;
|
|
357
|
-
// code += indent(state
|
|
357
|
+
// code += indent((state?.tabSize || 0) + 1);
|
|
358
358
|
// code += `${this.calleeKey}()`;
|
|
359
359
|
// code += '\n';
|
|
360
|
-
// code += indent(state
|
|
360
|
+
// code += indent((state?.tabSize || 0));
|
|
361
361
|
// code += '};\n';
|
|
362
362
|
// }
|
|
363
363
|
// return code;
|
|
@@ -367,8 +367,12 @@ export class BindEvent extends BaseNode {
|
|
|
367
367
|
* 设置callee
|
|
368
368
|
*/
|
|
369
369
|
setCallee(logic: Logic) {
|
|
370
|
+
let calleeNamespace = logic.getNamespace();
|
|
371
|
+
if (logic.parentNode instanceof View) {
|
|
372
|
+
calleeNamespace = '';
|
|
373
|
+
}
|
|
370
374
|
const object = {
|
|
371
|
-
calleeNamespace
|
|
375
|
+
calleeNamespace,
|
|
372
376
|
calleeName: logic.name,
|
|
373
377
|
};
|
|
374
378
|
this.update({
|
|
@@ -436,7 +440,7 @@ export class BindEvent extends BaseNode {
|
|
|
436
440
|
//================================================================================
|
|
437
441
|
}
|
|
438
442
|
|
|
439
|
-
classMap
|
|
443
|
+
classMap.BindEvent = BindEvent;
|
|
440
444
|
export default BindEvent;
|
|
441
445
|
//================================================================================
|
|
442
446
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -82,7 +82,7 @@ export class BooleanLiteral extends LogicItem {
|
|
|
82
82
|
//================================================================================
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
classMap
|
|
85
|
+
classMap.BooleanLiteral = BooleanLiteral;
|
|
86
86
|
export default BooleanLiteral;
|
|
87
87
|
//================================================================================
|
|
88
88
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|