@lcap/nasl 1.0.1 → 2.12.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/automate/engine/index.d.ts +1 -0
- package/out/automate/engine/index.js +34 -12
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/operators.d.ts +10 -2
- package/out/automate/engine/operators.js +105 -7
- package/out/automate/engine/operators.js.map +1 -1
- package/out/automate/engine/uniqueName.d.ts +8 -2
- package/out/automate/engine/uniqueName.js +72 -4
- package/out/automate/engine/uniqueName.js.map +1 -1
- package/out/automate/engine/utils.d.ts +1 -0
- package/out/automate/engine/utils.js +108 -67
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/template/process.d.ts +9 -0
- package/out/automate/template/process.js +10976 -0
- package/out/automate/template/process.js.map +1 -0
- package/out/bak/translator.js +1 -0
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.d.ts +6 -1
- package/out/common/BaseNode.js +37 -6
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +52 -49
- package/out/concepts/App__.js +89 -53
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +11 -0
- package/out/concepts/Assignee__.js +34 -0
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +2 -2
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +10 -3
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +15 -6
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +4 -0
- package/out/concepts/BooleanLiteral__.js +11 -0
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js +9 -4
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallLogic__.js +48 -30
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +34 -4
- package/out/concepts/CallQueryComponent__.js +340 -95
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +1 -0
- package/out/concepts/ConfigGroup__.js +7 -0
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +1 -0
- package/out/concepts/ConfigProperty__.js +3 -0
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +1 -0
- package/out/concepts/Configuration__.js +3 -0
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js +6 -6
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +143 -0
- package/out/concepts/DataSource__.js +318 -0
- package/out/concepts/DataSource__.js.map +1 -0
- package/out/concepts/Destination__.js +22 -8
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +2 -2
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +5 -0
- package/out/concepts/EntityIndex__.js +10 -2
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +9 -0
- package/out/concepts/EntityProperty__.js +22 -7
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +6 -0
- package/out/concepts/Entity__.js +27 -11
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +1 -0
- package/out/concepts/Enum__.js +14 -4
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +2 -2
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.d.ts +18 -0
- package/out/concepts/Function__.js +96 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +5 -14
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +8 -8
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +9 -4
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +19 -12
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +3 -5
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/Logic__.js +44 -44
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Module__.d.ts +116 -194
- package/out/concepts/Module__.js +31 -114
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +0 -86
- package/out/concepts/Namespace__.js +1 -108
- package/out/concepts/Namespace__.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/ProcessElement__.js +38 -12
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Process__.d.ts +1 -1
- package/out/concepts/Process__.js +17 -10
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +1 -0
- package/out/concepts/QueryFieldExpression__.js +11 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +4 -0
- package/out/concepts/QueryFromExpression__.js +13 -2
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +3 -0
- package/out/concepts/QueryGroupByExpression__.js +20 -0
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +4 -0
- package/out/concepts/QueryJoinExpression__.js +14 -3
- package/out/concepts/QueryJoinExpression__.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 +10 -3
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +14 -0
- package/out/concepts/SqlQueryComponent__.js +48 -5
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -1
- package/out/concepts/StringLiteral__.js +2 -9
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +11 -10
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +19 -12
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +1 -1
- package/out/concepts/SwitchCase__.js +23 -25
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +1 -6
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +8 -0
- package/out/concepts/TypeAnnotation__.js +53 -3
- package/out/concepts/TypeAnnotation__.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/ViewElement__.js +25 -20
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -3
- package/out/concepts/View__.js +42 -36
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +4 -4
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +20 -0
- package/out/concepts/basics/stdlib/nasl.auth.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.process.d.ts +4 -0
- package/out/concepts/basics/stdlib/nasl.process.js +410 -0
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +1 -11
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +270 -8
- 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 +2 -0
- package/out/concepts/basics/types/index.js +6 -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 -7
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +3 -1
- package/out/generator/genBundleFiles.js +23 -5
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +1 -0
- package/out/generator/genMetaData.js +20 -12
- package/out/generator/genMetaData.js.map +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.js +2 -1
- package/out/index.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/{test/integration/connect-file copy.d.ts → server/extendBaseNode.d.ts} +0 -0
- package/out/server/extendBaseNode.js +323 -0
- package/out/server/extendBaseNode.js.map +1 -0
- package/out/server/getLogics.js +49 -2
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +52 -2
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +8 -2
- package/out/server/getProcesses.js +228 -20
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/getScope.d.ts +1 -0
- package/out/server/getScope.js +4 -0
- 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 +8 -5
- package/out/server/naslServer.js +314 -383
- 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 +40 -2
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -0
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -0
- package/out/service/storage/init.js +113 -94
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +34 -24
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +28 -18
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +45 -29
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +15 -13
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genEnumSelectBlock.js +1 -1
- package/out/templator/genEnumSelectBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +29 -24
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +7 -5
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +31 -29
- 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 +31 -21
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +35 -25
- 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 +5 -0
- package/out/utils/index.js +50 -1
- package/out/utils/index.js.map +1 -1
- package/package.json +1 -2
- package/src/automate/engine/index.js +33 -8
- package/src/automate/engine/operators.js +114 -17
- package/src/automate/engine/uniqueName.js +77 -9
- package/src/automate/engine/utils.js +110 -69
- package/src/automate/template/process.js +10999 -0
- package/src/bak/translator.js +1 -0
- package/src/common/BaseNode.ts +35 -7
- package/src/concepts/App__.ts +132 -131
- package/src/concepts/Assignee__.ts +30 -0
- package/src/concepts/BindAttribute__.ts +2 -2
- package/src/concepts/BindDirective__.ts +9 -7
- package/src/concepts/BindEvent__.ts +14 -6
- package/src/concepts/BooleanLiteral__.ts +12 -0
- package/src/concepts/CallFunction__.ts +7 -4
- package/src/concepts/CallLogic__.ts +47 -32
- package/src/concepts/CallQueryComponent__.ts +352 -101
- package/src/concepts/Comment__.ts +1 -1
- package/src/concepts/ConfigGroup__.ts +3 -1
- package/src/concepts/ConfigProperty__.ts +4 -0
- package/src/concepts/Configuration__.ts +3 -0
- package/src/concepts/Constant__.ts +6 -6
- package/src/concepts/DataSource__.ts +391 -0
- package/src/concepts/Destination__.ts +22 -8
- package/src/concepts/End__.ts +2 -2
- package/src/concepts/EntityIndex__.ts +11 -2
- package/src/concepts/EntityProperty__.ts +23 -7
- package/src/concepts/Entity__.ts +38 -14
- package/src/concepts/Enum__.ts +15 -4
- package/src/concepts/ForEachStatement__.ts +2 -2
- package/src/concepts/Function__.ts +95 -1
- package/src/concepts/Identifier__.ts +5 -14
- package/src/concepts/IfStatement__.ts +9 -9
- package/src/concepts/InterfaceParam__.ts +9 -4
- package/src/concepts/Interface__.ts +20 -12
- package/src/concepts/JSBlock__.ts +3 -12
- package/src/concepts/Logic__.ts +45 -79
- package/src/concepts/Module__.ts +141 -342
- package/src/concepts/Namespace__.ts +1 -204
- package/src/concepts/Param__.ts +17 -9
- package/src/concepts/ProcessElement__.ts +42 -15
- package/src/concepts/Process__.ts +18 -12
- package/src/concepts/QueryAggregateExpression__.ts +1 -1
- package/src/concepts/QueryFieldExpression__.ts +13 -1
- package/src/concepts/QueryFromExpression__.ts +13 -2
- package/src/concepts/QueryGroupByExpression__.ts +23 -0
- package/src/concepts/QueryJoinExpression__.ts +14 -3
- package/src/concepts/Return__.ts +16 -11
- package/src/concepts/Role__.ts +10 -4
- package/src/concepts/SqlQueryComponent__.ts +47 -11
- package/src/concepts/StringLiteral__.ts +2 -9
- package/src/concepts/StructureProperty__.ts +11 -14
- package/src/concepts/Structure__.ts +19 -11
- package/src/concepts/SwitchCase__.ts +23 -27
- package/src/concepts/SwitchStatement__.ts +1 -5
- package/src/concepts/TypeAnnotation__.ts +52 -3
- package/src/concepts/Variable__.ts +16 -11
- package/src/concepts/ViewElement__.ts +26 -39
- package/src/concepts/View__.ts +45 -38
- package/src/concepts/WhileStatement__.ts +4 -4
- package/src/concepts/basics/stdlib/nasl.auth.ts +20 -0
- 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.process.ts +406 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +1 -11
- package/src/concepts/basics/stdlib/nasl.util.ts +271 -8
- package/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts +1 -1
- package/src/concepts/basics/types/index.ts +2 -0
- package/src/concepts/index__.ts +1 -0
- package/src/enums/KEYWORDS.ts +0 -7
- package/src/generator/genBundleFiles.ts +28 -7
- package/src/generator/genMetaData.ts +22 -13
- package/src/index.ts +1 -1
- 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 +51 -5
- package/src/server/getMemberIdentifier.ts +53 -2
- package/src/server/getProcesses.ts +238 -21
- package/src/server/getScope.ts +5 -0
- package/src/server/index.ts +1 -0
- package/src/server/naslServer.ts +322 -380
- package/src/server/process2LogicNamespace.ts +29 -19
- package/src/server/translator.ts +42 -2
- package/src/service/creator/errHandles.js +6 -0
- package/src/service/storage/init.ts +115 -97
- package/src/templator/genCreateBlock.ts +35 -26
- package/src/templator/genCurdEditMultipleKeyBlock.ts +29 -21
- package/src/templator/genCurdMultipleKeyBlock.ts +46 -31
- package/src/templator/genEditTableBlock.ts +17 -14
- package/src/templator/genEnumSelectBlock.ts +1 -1
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genGridViewBlock.ts +30 -25
- package/src/templator/genListViewBlock.ts +10 -7
- package/src/templator/genQueryComponent.ts +34 -30
- package/src/templator/genSelectBlock.ts +14 -23
- package/src/templator/genTableBlock.ts +32 -23
- package/src/templator/genUpdateBlock.ts +36 -26
- 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 +51 -0
- 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/out/test/integration/connect-file copy.js +0 -50
- package/out/test/integration/connect-file copy.js.map +0 -1
- package/out/test/integration/node-nasl-server.d.ts +0 -1
- package/out/test/integration/node-nasl-server.js +0 -41
- package/out/test/integration/node-nasl-server.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// BaseNode,
|
|
3
3
|
// Module
|
|
4
4
|
// } from '../../concepts';
|
|
5
|
-
import { BaseNode, uiStructures, collectionStructures } from '../../concepts';
|
|
5
|
+
import { BaseNode, uiStructures, collectionStructures, interfaceStructures, processStructures } from '../../concepts';
|
|
6
6
|
import { getConceptMeta } from '../../decorators/index';
|
|
7
7
|
/*
|
|
8
8
|
根据 namespace 字符串来获取 node
|
|
@@ -72,12 +72,17 @@ export function getNaslNodeByNodeCallee(namespace, typeName) {
|
|
|
72
72
|
return uiStructures.find((item) => item.name === typeName);
|
|
73
73
|
} else if (namespace === 'nasl.collection') {
|
|
74
74
|
return collectionStructures.find((item) => item.name === typeName);
|
|
75
|
+
} else if (namespace === 'nasl.interface') {
|
|
76
|
+
return interfaceStructures.find((item) => item.name === typeName);
|
|
77
|
+
} else if (namespace === 'nasl.process') {
|
|
78
|
+
return processStructures.find((item) => item.name === typeName);
|
|
75
79
|
}
|
|
76
80
|
}
|
|
77
81
|
export const TRACK_TYPE = {
|
|
78
82
|
PLAIN: 'plain',
|
|
79
83
|
PROPERTY: 'property',
|
|
80
84
|
ARRAY: 'array',
|
|
85
|
+
ARRAY_NO_FURTHER: 'array_no_further',
|
|
81
86
|
CALLEE: 'callee',
|
|
82
87
|
CALLEE_TEMPLATE: 'callee_template',
|
|
83
88
|
MODULE: 'module',
|
|
@@ -101,6 +106,7 @@ const BACKTACKING_PROPERTY = {
|
|
|
101
106
|
ENTITY_NAMESPACE: 'entityName',
|
|
102
107
|
RELATION_NAMESPACE: 'relationEntity',
|
|
103
108
|
};
|
|
109
|
+
const BACKTRACKING_MODULE_COMPONENT = 'tag'
|
|
104
110
|
function getRelatedProperyName(nspropertyname) {
|
|
105
111
|
switch (nspropertyname) {
|
|
106
112
|
case BACKTACKING_PROPERTY_NS.TYPE_NAMESPACE:
|
|
@@ -115,6 +121,10 @@ function getRelatedProperyName(nspropertyname) {
|
|
|
115
121
|
return '';
|
|
116
122
|
}
|
|
117
123
|
|
|
124
|
+
const TRACKING_ONLY_ONE_LAYER = [
|
|
125
|
+
'DataSource'
|
|
126
|
+
]
|
|
127
|
+
|
|
118
128
|
const BACKTRACKING_IGNORE_NAMESPACE = [
|
|
119
129
|
'nasl.core',
|
|
120
130
|
'',
|
|
@@ -151,7 +161,6 @@ const ROLE_PROPERTY = 'bindRoles';
|
|
|
151
161
|
|
|
152
162
|
export function tracking(node, startNode, callback) {
|
|
153
163
|
const { propertyMap } = getConceptMeta(node.concept);
|
|
154
|
-
// console.log(propertyMap)
|
|
155
164
|
for (const p of propertyMap) {
|
|
156
165
|
// console.log(p)
|
|
157
166
|
const [propertyName, _data] = p;
|
|
@@ -163,13 +172,20 @@ export function tracking(node, startNode, callback) {
|
|
|
163
172
|
}
|
|
164
173
|
continue;
|
|
165
174
|
}
|
|
175
|
+
const isOnlyOneLayerTracking = TRACKING_ONLY_ONE_LAYER.includes(node.concept);
|
|
166
176
|
const property = node[propertyName];
|
|
167
177
|
if (Array.isArray(property)) {
|
|
168
178
|
if (property.length > 0) {
|
|
169
179
|
if (property[0] instanceof BaseNode) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
180
|
+
if (!isOnlyOneLayerTracking) {
|
|
181
|
+
property.forEach((p) => {
|
|
182
|
+
callback(TRACK_TYPE.ARRAY, propertyName, p);
|
|
183
|
+
});
|
|
184
|
+
} else {
|
|
185
|
+
property.forEach((p) => {
|
|
186
|
+
callback(TRACK_TYPE.ARRAY_NO_FURTHER, propertyName, p);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
173
189
|
} else {
|
|
174
190
|
if (ROLE_PROPERTY === propertyName) {
|
|
175
191
|
const rootNode = node.rootNode;
|
|
@@ -205,7 +221,7 @@ export function tracking(node, startNode, callback) {
|
|
|
205
221
|
|
|
206
222
|
const rootNode = node.rootNode;
|
|
207
223
|
const ns = node[propertyName];
|
|
208
|
-
if (!ns) {
|
|
224
|
+
if (!ns || !node[relatedPropertyName]) {
|
|
209
225
|
callback(TRACK_TYPE.PLAIN, propertyName, property);
|
|
210
226
|
callback(TRACK_TYPE.PLAIN, relatedPropertyName, node[relatedPropertyName]);
|
|
211
227
|
break;
|
|
@@ -215,71 +231,84 @@ export function tracking(node, startNode, callback) {
|
|
|
215
231
|
callback(TRACK_TYPE.PLAIN, propertyName, property);
|
|
216
232
|
callback(TRACK_TYPE.PLAIN, relatedPropertyName, node[relatedPropertyName]);
|
|
217
233
|
} else {
|
|
218
|
-
const r1 = /app\.(?:entities|processes)\.([^.]+)\.logics/.exec(ns);
|
|
219
|
-
const r2 = /app\.processes\.([^.]+)\.elements\.([^.]+)\.logics/.exec(ns);
|
|
220
234
|
const calleeN = node[relatedPropertyName];
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
|
|
236
|
+
const r1 = /app\.processes\.([^.]+)\.logics/.exec(ns);
|
|
237
|
+
const r2 = /app\.processes\.([^.]+)\.elements\.([^.]+)\.logics/.exec(ns);
|
|
238
|
+
if(r1 || r2) {
|
|
239
|
+
// Process 处理
|
|
240
|
+
if (r2) {
|
|
241
|
+
const nodeName = r2[1];
|
|
242
|
+
const subNodename = r2[2];
|
|
243
|
+
if (subNodename) {
|
|
244
|
+
// 目前只有 userTask
|
|
245
|
+
const process = rootNode.processes.find((p) => p.name === nodeName);
|
|
246
|
+
if (process) {
|
|
247
|
+
const usertask = process.elements.find((e) => e.name === subNodename);
|
|
248
|
+
if (usertask) {
|
|
249
|
+
callback(TRACK_TYPE.CALLEE_TEMPLATE, propertyName, node[propertyName], {
|
|
250
|
+
rootNode: process,
|
|
251
|
+
metaNodes: [process, usertask],
|
|
252
|
+
nstemplate: `function(meta, meta2){ return "app.processes" + meta.name + ".elements." + meta2.name + ".logics"; }`,
|
|
253
|
+
nametemplate: `function(meta, meta2){ return "complete"; }`,
|
|
254
|
+
relatedPropertyName,
|
|
255
|
+
AppPropertyName: 'processes',
|
|
256
|
+
});
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
238
259
|
}
|
|
239
260
|
}
|
|
261
|
+
} else if (r1){
|
|
262
|
+
const nodeName = r1[1];
|
|
263
|
+
const process = rootNode.processes.find((p) => p.name === nodeName);
|
|
264
|
+
if (/launch/.test(calleeN) && process) {
|
|
265
|
+
// const prefix = /(launch|complete).+/.exec(calleeN)[1];
|
|
266
|
+
callback(TRACK_TYPE.CALLEE_TEMPLATE, propertyName, node[propertyName], {
|
|
267
|
+
rootNode: process,
|
|
268
|
+
metaNodes: [process],
|
|
269
|
+
nstemplate: `function(meta){ return "app.processes" + meta.name + ".logics"; }`,
|
|
270
|
+
nametemplate: `function(){ return "${calleeN}"; }`,
|
|
271
|
+
relatedPropertyName,
|
|
272
|
+
AppPropertyName: 'processes',
|
|
273
|
+
});
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
240
276
|
}
|
|
241
|
-
}
|
|
242
|
-
const nodeName = r1[1];
|
|
243
|
-
const process = rootNode.processes.find((p) => p.name === nodeName);
|
|
244
|
-
if (/launch/.test(calleeN) && process) {
|
|
245
|
-
// const prefix = /(launch|complete).+/.exec(calleeN)[1];
|
|
246
|
-
callback(TRACK_TYPE.CALLEE_TEMPLATE, propertyName, node[propertyName], {
|
|
247
|
-
rootNode: process,
|
|
248
|
-
metaNodes: [process],
|
|
249
|
-
nstemplate: `function(meta){ return "app.processes" + meta.name + ".logics"; }`,
|
|
250
|
-
nametemplate: `function(){ return "${calleeN}"; }`,
|
|
251
|
-
relatedPropertyName,
|
|
252
|
-
AppPropertyName: 'processes',
|
|
253
|
-
});
|
|
254
|
-
break;
|
|
255
|
-
}
|
|
277
|
+
}
|
|
256
278
|
|
|
257
|
-
|
|
258
|
-
|
|
279
|
+
const r3 = /app\.dataSources\.([^.]+)\.entities\.([^.]+)\.logics/.exec(ns);
|
|
280
|
+
if(r3) {
|
|
281
|
+
const datasourceName = r3[1];
|
|
282
|
+
const entityName = r3[2];
|
|
283
|
+
|
|
284
|
+
if (/get|create|update|delete|batchCreate|batchUpdate|batchDelete|import/.test(calleeN)) {
|
|
259
285
|
// const prefix = /(get|create|update|delete|batchCreate|batchUpdate|batchDelete|import)/.exec(calleeN)[1];
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
if (calleeNode) {
|
|
274
|
-
backtracking({
|
|
275
|
-
node,
|
|
276
|
-
startNode,
|
|
277
|
-
calleeNode,
|
|
278
|
-
propertyName,
|
|
279
|
-
relatedPropertyName,
|
|
280
|
-
}, callback);
|
|
286
|
+
const datasource = rootNode.dataSources.find(d => d.name === datasourceName);
|
|
287
|
+
if (datasource) {
|
|
288
|
+
const entity = datasource.entities.find((e) => e.name === entityName);
|
|
289
|
+
callback(TRACK_TYPE.CALLEE_TEMPLATE, propertyName, node[propertyName], {
|
|
290
|
+
rootNode: datasource,
|
|
291
|
+
metaNodes: [datasource, entity],
|
|
292
|
+
nstemplate: `function(meta, meta2){ return "app.dataSources." + meta.name + ".entities." + meta2.name + ".logics"; }`,
|
|
293
|
+
nametemplate: `function(){ return "${calleeN}"; }`,
|
|
294
|
+
relatedPropertyName,
|
|
295
|
+
AppPropertyName: 'dataSources',
|
|
296
|
+
});
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
281
299
|
}
|
|
282
300
|
}
|
|
301
|
+
const nsPath = `${ns}.${calleeN}`;
|
|
302
|
+
const calleeNode = getNodeByNodeCallee(rootNode, nsPath);
|
|
303
|
+
if (calleeNode) {
|
|
304
|
+
backtracking({
|
|
305
|
+
node,
|
|
306
|
+
startNode,
|
|
307
|
+
calleeNode,
|
|
308
|
+
propertyName,
|
|
309
|
+
relatedPropertyName,
|
|
310
|
+
}, callback);
|
|
311
|
+
}
|
|
283
312
|
}
|
|
284
313
|
break;
|
|
285
314
|
|
|
@@ -293,10 +322,11 @@ export function tracking(node, startNode, callback) {
|
|
|
293
322
|
callback(TRACK_TYPE.PROPERTY_TEMPLATE, propertyName, property, {
|
|
294
323
|
getRelatedVar: () => {
|
|
295
324
|
const queryCom = node.getAncestor('CallQueryComponent');
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
325
|
+
const entityNamespace = queryCom?.from?.entityNamespace;
|
|
326
|
+
if (queryCom && entityNamespace && property) {
|
|
327
|
+
const rootNode = queryCom.rootNode;
|
|
328
|
+
const entity = getNodeByNodeCallee(rootNode, `${entityNamespace}.${property}`);
|
|
329
|
+
return entity;
|
|
300
330
|
}
|
|
301
331
|
return null;
|
|
302
332
|
},
|
|
@@ -304,7 +334,18 @@ export function tracking(node, startNode, callback) {
|
|
|
304
334
|
});
|
|
305
335
|
|
|
306
336
|
break;
|
|
307
|
-
|
|
337
|
+
case BACKTRACKING_MODULE_COMPONENT:
|
|
338
|
+
// 条件 break 一定要放到最后
|
|
339
|
+
if(node.concept === 'ViewElement'){
|
|
340
|
+
const componentDependencies = node.app.componentDependencies;
|
|
341
|
+
const tag = node[propertyName];
|
|
342
|
+
const dep = componentDependencies.find(c => c.name === tag);
|
|
343
|
+
if(dep) {
|
|
344
|
+
callback(TRACK_TYPE.PLAIN, propertyName, tag);
|
|
345
|
+
callback(TRACK_TYPE.MODULE, undefined, dep);
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
308
349
|
default:
|
|
309
350
|
if (property !== undefined) {
|
|
310
351
|
if (objectRef && property !== null) {
|
|
@@ -347,7 +388,7 @@ export function backtracking({ node, startNode, calleeNode, propertyName, relate
|
|
|
347
388
|
while (t) {
|
|
348
389
|
const pnode = t.parentNode;
|
|
349
390
|
if (pnode === approot) {
|
|
350
|
-
AppPropertyName = getAppPropertyName(
|
|
391
|
+
AppPropertyName = getAppPropertyName(t);
|
|
351
392
|
}
|
|
352
393
|
if (pnode !== approot && pnode !== startNode) {
|
|
353
394
|
t = pnode;
|