@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
|
@@ -3,8 +3,8 @@ import { genLaunchProcess, genUserTaskLogic } from './getProcesses';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 给调用逻辑用
|
|
6
|
-
* @param process
|
|
7
|
-
* @returns
|
|
6
|
+
* @param process
|
|
7
|
+
* @returns
|
|
8
8
|
*/
|
|
9
9
|
export function process2LogicNamespace(process: Process) {
|
|
10
10
|
const children: Array<Namespace> = [];
|
|
@@ -18,13 +18,13 @@ export function process2LogicNamespace(process: Process) {
|
|
|
18
18
|
});
|
|
19
19
|
// 与process 中 toEmbededTS 所设置的 namespace 相关
|
|
20
20
|
const path = `app.processes.${process.name}.elements.${e.name}.logics`;
|
|
21
|
-
l.getNamespace = function() {
|
|
21
|
+
l.getNamespace = function () {
|
|
22
22
|
return path;
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
const api = `/api/${process.name}/${e.name}/${l.name}`;
|
|
25
|
-
l.getPath = function() {
|
|
25
|
+
l.getPath = function () {
|
|
26
26
|
return api;
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
28
|
children.push(ns);
|
|
29
29
|
ns.path = `app.processes.${process.name}.elements.${e.name}`;
|
|
30
30
|
ns.expanded = true;
|
|
@@ -38,12 +38,12 @@ export function process2LogicNamespace(process: Process) {
|
|
|
38
38
|
});
|
|
39
39
|
ns.path = `app.processes.${process.name}.logics`;
|
|
40
40
|
const api = `/api/${process.name}/${launchLogic.name}`;
|
|
41
|
-
launchLogic.getNamespace = function() {
|
|
41
|
+
launchLogic.getNamespace = function () {
|
|
42
42
|
return ns.path;
|
|
43
|
-
}
|
|
44
|
-
launchLogic.getPath = function() {
|
|
43
|
+
};
|
|
44
|
+
launchLogic.getPath = function () {
|
|
45
45
|
return api;
|
|
46
|
-
}
|
|
46
|
+
};
|
|
47
47
|
return ns;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -61,8 +61,8 @@ interface processTreeFragment {
|
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* 给侧边栏树形用
|
|
64
|
-
* @param process
|
|
65
|
-
* @returns
|
|
64
|
+
* @param process
|
|
65
|
+
* @returns
|
|
66
66
|
*/
|
|
67
67
|
export function processToTreeFragment(process: Process) {
|
|
68
68
|
const fragment: processTreeFragment = {
|
|
@@ -71,28 +71,38 @@ export function processToTreeFragment(process: Process) {
|
|
|
71
71
|
id: process.id,
|
|
72
72
|
logics: [],
|
|
73
73
|
elements: [],
|
|
74
|
-
}
|
|
74
|
+
};
|
|
75
75
|
process.elements.forEach((e) => {
|
|
76
76
|
if (e.type === 'UserTask') {
|
|
77
77
|
const l = genUserTaskLogic(e);
|
|
78
|
-
l.parentKey = 'readonly'
|
|
79
|
-
l.params.forEach(p => {
|
|
78
|
+
l.parentKey = 'readonly';
|
|
79
|
+
l.params.forEach((p) => {
|
|
80
80
|
p.readonly = true;
|
|
81
|
-
})
|
|
81
|
+
});
|
|
82
82
|
l.parentNode = process;
|
|
83
|
+
// 与process 中 toEmbededTS 所设置的 namespace 相关
|
|
84
|
+
const path = `app.processes.${process.name}.elements.${e.name}.logics`;
|
|
85
|
+
l.getNamespace = function () {
|
|
86
|
+
return path;
|
|
87
|
+
};
|
|
83
88
|
fragment.elements.push({
|
|
84
89
|
level: 'processTreeElementFragment',
|
|
85
90
|
id: e.id,
|
|
86
91
|
name: e.name,
|
|
87
92
|
logics: [l],
|
|
88
|
-
})
|
|
93
|
+
});
|
|
89
94
|
}
|
|
90
95
|
});
|
|
91
96
|
|
|
92
97
|
const launchLogic = genLaunchProcess(process);
|
|
93
98
|
launchLogic.parentNode = process;
|
|
94
|
-
|
|
99
|
+
|
|
100
|
+
const path = `app.processes.${process.name}.logics`;
|
|
101
|
+
launchLogic.getNamespace = function () {
|
|
102
|
+
return path;
|
|
103
|
+
};
|
|
104
|
+
|
|
95
105
|
fragment.logics.push(launchLogic);
|
|
96
|
-
launchLogic.parentKey = 'readonly'
|
|
106
|
+
launchLogic.parentKey = 'readonly';
|
|
97
107
|
return fragment;
|
|
98
108
|
}
|
package/src/server/translator.ts
CHANGED
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
ForEachStatement,
|
|
42
42
|
CallFunction,
|
|
43
43
|
ProcessOutcome,
|
|
44
|
+
Function,
|
|
44
45
|
} from '../concepts';
|
|
45
46
|
import { SourceMapItem } from '../translator';
|
|
46
47
|
import { Diagnostic } from '../manager/diagnostic';
|
|
@@ -226,6 +227,10 @@ const TS_RULES: Array<{
|
|
|
226
227
|
re: /No value exists in scope for the shorthand property '__(?:IDENTIFIER|LEFT|RIGHT)__'. Either declare one or provide an initializer./,
|
|
227
228
|
result: '用户任务未关联页面',
|
|
228
229
|
},
|
|
230
|
+
{
|
|
231
|
+
re: /No value exists in scope for the shorthand property '__(?:outOfProcess)__'. Either declare one or provide an initializer./,
|
|
232
|
+
result: '节点未关联到流程图',
|
|
233
|
+
},
|
|
229
234
|
{
|
|
230
235
|
re: /'(.+?)' is declared but its value is never read/,
|
|
231
236
|
result: "已添加'$1',但从来没有使用过。",
|
|
@@ -355,6 +360,8 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
|
|
|
355
360
|
return null;
|
|
356
361
|
} else if (text.startsWith(`Namespace 'nasl.ui' has no exported member `)) {
|
|
357
362
|
return null;
|
|
363
|
+
} else if (text.startsWith(`Function expression, which lacks return-type annotation, implicitly has an 'any[]' return type.`)) {
|
|
364
|
+
return null;
|
|
358
365
|
}
|
|
359
366
|
}
|
|
360
367
|
// 处理bindevent参数没传递的报错
|
|
@@ -363,6 +370,37 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
|
|
|
363
370
|
if (node instanceof BindEvent) {
|
|
364
371
|
return null;
|
|
365
372
|
}
|
|
373
|
+
|
|
374
|
+
if (node instanceof ProcessElement && (node.type === 'UserTask' || node.type === 'AutoTask' || node.type === 'StartNoneEvent')) {
|
|
375
|
+
const reg = /Expected (.+?) arguments, but got (.+?)./.exec(text);
|
|
376
|
+
let u = '用户任务';
|
|
377
|
+
if(node.type === 'AutoTask') {
|
|
378
|
+
u = '自动任务';
|
|
379
|
+
}
|
|
380
|
+
if(reg[2] === '0') {
|
|
381
|
+
tsErrorDetail.message = `${u}出口顺序流个数不能是0`;
|
|
382
|
+
} else {
|
|
383
|
+
tsErrorDetail.message = `${u}出口顺序流个数不能大于1`;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if(node.type === 'StartNoneEvent') {
|
|
387
|
+
tsErrorDetail.message = `开始节点只能有一个出口顺序流`;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (node instanceof ProcessElement && (node.type === 'ExclusiveGateway' || node.type === 'ParallelGateway')) {
|
|
392
|
+
const reg = /Expected (.+?) arguments, but got (.+?)./.exec(text);
|
|
393
|
+
let u = '排他网关';
|
|
394
|
+
if(node.type === 'ParallelGateway') {
|
|
395
|
+
u = '并行网关';
|
|
396
|
+
}
|
|
397
|
+
if(reg[2] === '0') {
|
|
398
|
+
tsErrorDetail.message = `${u}出口顺序流和入口顺序流个数不能等于0`;
|
|
399
|
+
} else {
|
|
400
|
+
tsErrorDetail.message = `${u}出口顺序流和入口顺序流个数同时等于1,该${u}没有意义`;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
}
|
|
366
404
|
}
|
|
367
405
|
|
|
368
406
|
// 因为缺少参数时候有可能有特殊情况,因为原本少的多了就会找到 callLogic上,
|
|
@@ -401,7 +439,9 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
|
|
|
401
439
|
// 变量type的报错放到内部
|
|
402
440
|
node = node.parentNode;
|
|
403
441
|
let str = tsErrorDetail.message;
|
|
404
|
-
|
|
442
|
+
if (node) {
|
|
443
|
+
str = (node as any).constructor.nodeTitle + ':' + str;
|
|
444
|
+
}
|
|
405
445
|
tsErrorDetail.message = str;
|
|
406
446
|
}
|
|
407
447
|
}
|
|
@@ -425,7 +465,7 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
|
|
|
425
465
|
tsErrorDetail.message = '调用函数:参数不能为空!';
|
|
426
466
|
} else if ((node instanceof Argument && node.parentNode instanceof CallLogic) || node instanceof CallLogic) {
|
|
427
467
|
tsErrorDetail.message = '调用逻辑:参数不能为空!';
|
|
428
|
-
} else if (node instanceof ProcessOutcome) {
|
|
468
|
+
} else if (node instanceof ProcessOutcome || node instanceof Function) {
|
|
429
469
|
tsErrorDetail.message = (node as any).constructor.nodeTitle + ':不能为空!';
|
|
430
470
|
} else if (node instanceof Argument || node instanceof TypeAnnotation) {
|
|
431
471
|
let str = tsErrorDetail.message;
|
|
@@ -26,6 +26,12 @@ export default {
|
|
|
26
26
|
if (config.noErrorTip)
|
|
27
27
|
return;
|
|
28
28
|
|
|
29
|
+
// 检测到当前应用拉取操作已被强制结束
|
|
30
|
+
if(err.code === 401650) {
|
|
31
|
+
eventBus.emit('forceCancelPull');
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
if (versionStatus[err.code])
|
|
30
36
|
eventBus.emit('updateVersionStatus', {
|
|
31
37
|
status: versionStatus[err.code],
|
|
@@ -26,10 +26,10 @@ function getLogic(key: string, app: any, diffLogicList: string[]) {
|
|
|
26
26
|
const _path = _pathArr[3];
|
|
27
27
|
const _list = app.dependencies;
|
|
28
28
|
const _module = _list.find((it: Module) => {
|
|
29
|
-
const name = it.name.
|
|
29
|
+
const name = it.name.replaceAll('-', '_');
|
|
30
30
|
return name === _name;
|
|
31
31
|
});
|
|
32
|
-
const logic = _module
|
|
32
|
+
const logic = _module?.logics?.find((item: Logic) => item.name === _path);
|
|
33
33
|
if (logic && logic.body && logic.body.length > 2) {
|
|
34
34
|
logic.body.map((item: any) => getStatement(item, app, diffLogicList));
|
|
35
35
|
}
|
|
@@ -50,7 +50,7 @@ function getStatement(state: any, app: any, diffLogicList: string[]) {
|
|
|
50
50
|
logicItems = [...state.body, state.each, state.start, state.end];
|
|
51
51
|
break;
|
|
52
52
|
case 'SwitchStatement':
|
|
53
|
-
logicItems = state.cases.map(getStatement);
|
|
53
|
+
logicItems = state.cases.map(getStatement).flat(1);
|
|
54
54
|
break;
|
|
55
55
|
case 'SwitchCase':
|
|
56
56
|
logicItems = [state.test, ...state.consequent];
|
|
@@ -83,7 +83,7 @@ async function doAction(app: any, actionItem: any) {
|
|
|
83
83
|
}
|
|
84
84
|
view?.children?.forEach((item) => loopEle(item, checkAuth));
|
|
85
85
|
if (view instanceof ViewElement) {
|
|
86
|
-
if (view.tag === 'u-uploader') {
|
|
86
|
+
if (view.tag === 'u-uploader' || view.tag === 'van-uploader') {
|
|
87
87
|
const bute = view?.bindAttrs.find((item) => item.name === 'url');
|
|
88
88
|
if (checkAuth) {
|
|
89
89
|
if (bute?.value.endsWith('/import') && !view.view.parentAuth) {
|
|
@@ -97,104 +97,110 @@ async function doAction(app: any, actionItem: any) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
const itemloop = (_i: LogicItem, app: any, diffArr: string[]) => {
|
|
112
|
-
const _l = getStatement(_i, app, diffArr);
|
|
113
|
-
if (_l.length) {
|
|
114
|
-
_l.map((_ii: LogicItem) => itemloop(_ii, app, diffArr));
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
if (emitTarget.concept === 'Logic') {
|
|
118
|
-
const diffArr: string[] = [];
|
|
119
|
-
if (emitTarget.body.length > 2) {
|
|
120
|
-
emitTarget.body.forEach((it: LogicItem) => {
|
|
121
|
-
itemloop(it, app, diffArr);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
const result = diffArr.filter((item) => item.startsWith('app') || item.startsWith('extensions'));
|
|
125
|
-
if (result.length) {
|
|
100
|
+
try {
|
|
101
|
+
if (Array.isArray(list)) {
|
|
102
|
+
list.forEach((event) => {
|
|
103
|
+
const emitTarget = event?.originEvent?.target;
|
|
104
|
+
const _path: string = event.originEvent.path;
|
|
105
|
+
const _root = _path.split('.')?.[1] || '';
|
|
106
|
+
if (
|
|
107
|
+
['dataSources', 'processes', 'logics', 'enums', 'structures', 'interfaces', 'interfaceDependencies', 'componentDependencies', 'configuration', 'dependencies'].some((item) =>
|
|
108
|
+
_root.startsWith(item))
|
|
109
|
+
) {
|
|
126
110
|
hasBackEnd = true;
|
|
127
111
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (isDelete || isUpdateAuth) {
|
|
136
|
-
const app = emitTarget.app;
|
|
112
|
+
const itemloop = (_i: LogicItem, app: any, diffArr: string[]) => {
|
|
113
|
+
const _l = getStatement(_i, app, diffArr);
|
|
114
|
+
if (_l.length) {
|
|
115
|
+
_l.map((_ii: LogicItem) => itemloop(_ii, app, diffArr));
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
if (emitTarget.concept === 'Logic') {
|
|
137
119
|
const diffArr: string[] = [];
|
|
138
|
-
emitTarget.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
});
|
|
120
|
+
if (emitTarget.body.length > 2) {
|
|
121
|
+
emitTarget.body.forEach((it: LogicItem) => {
|
|
122
|
+
itemloop(it, app, diffArr);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
145
125
|
const result = diffArr.filter((item) => item.startsWith('app') || item.startsWith('extensions'));
|
|
146
126
|
if (result.length) {
|
|
147
127
|
hasBackEnd = true;
|
|
148
128
|
}
|
|
149
|
-
emitTarget.children.forEach((item: View | ViewElement) => loopEle(item, isDelete));
|
|
150
|
-
emitTarget.elements.forEach((item: View | ViewElement) => loopEle(item, isDelete));
|
|
151
129
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (emitTarget.concept === 'ViewElement') {
|
|
155
|
-
loopEle(emitTarget, true);
|
|
156
|
-
}
|
|
157
|
-
if (emitTarget.concept === 'BindAttribute' && emitTarget.name === 'url' && emitTarget.value.endsWith('/import')) {
|
|
158
|
-
if (!emitTarget.view.parentAuth) {
|
|
159
|
-
hasBackEnd = true;
|
|
130
|
+
if (emitTarget.view) {
|
|
131
|
+
hasFrontEnd = true;
|
|
160
132
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (action === 'update') {
|
|
174
|
-
actionList.push({
|
|
175
|
-
action,
|
|
176
|
-
path,
|
|
177
|
-
node: objItem[0],
|
|
133
|
+
if (emitTarget.concept === 'View') {
|
|
134
|
+
const isDelete = event?.originEvent?.action === 'delete';
|
|
135
|
+
const isUpdateAuth = event?.originEvent?.action === 'update' && event?.originEvent?.object && 'auth' in event?.originEvent?.object;
|
|
136
|
+
if (isDelete || isUpdateAuth) {
|
|
137
|
+
const app = emitTarget.app;
|
|
138
|
+
const diffArr: string[] = [];
|
|
139
|
+
emitTarget.logics.forEach((logic: Logic) => {
|
|
140
|
+
if (logic.body.length > 2) {
|
|
141
|
+
logic.body.forEach((it: LogicItem) => {
|
|
142
|
+
itemloop(it, app, diffArr);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
178
145
|
});
|
|
179
|
-
|
|
180
|
-
|
|
146
|
+
const result = diffArr.filter((item) => item.startsWith('app') || item.startsWith('extensions'));
|
|
147
|
+
if (result.length) {
|
|
148
|
+
hasBackEnd = true;
|
|
149
|
+
}
|
|
150
|
+
emitTarget.children.forEach((item: View | ViewElement) => loopEle(item, isDelete));
|
|
151
|
+
emitTarget.elements.forEach((item: View | ViewElement) => loopEle(item, isDelete));
|
|
152
|
+
}
|
|
153
|
+
hasFrontEnd = true;
|
|
154
|
+
}
|
|
155
|
+
if (emitTarget.concept === 'ViewElement') {
|
|
156
|
+
loopEle(emitTarget, true);
|
|
157
|
+
}
|
|
158
|
+
if (emitTarget.concept === 'BindAttribute' && emitTarget.name === 'url' && emitTarget.value.endsWith('/import')) {
|
|
159
|
+
if (!emitTarget.view.parentAuth) {
|
|
160
|
+
hasBackEnd = true;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (emitTarget.concept === 'CallLogic') {
|
|
164
|
+
const arrlist: string[] = [];
|
|
165
|
+
getLogic(emitTarget.calleeKey, emitTarget.app, arrlist);
|
|
166
|
+
const result = arrlist.filter((item) => item.startsWith('app') || item.startsWith('extensions'));
|
|
167
|
+
// console.log(result, 'CallLogic');
|
|
168
|
+
if (result.length) {
|
|
169
|
+
hasBackEnd = true;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
event.eventList.forEach(({ action, path, object: objItem }: { action: string; path: string; object: any }) => {
|
|
173
|
+
if (Array.isArray(objItem)) {
|
|
174
|
+
if (action === 'update') {
|
|
181
175
|
actionList.push({
|
|
182
176
|
action,
|
|
183
177
|
path,
|
|
184
|
-
node:
|
|
178
|
+
node: objItem[0],
|
|
179
|
+
});
|
|
180
|
+
} else {
|
|
181
|
+
objItem.forEach((item, index) => {
|
|
182
|
+
actionList.push({
|
|
183
|
+
action,
|
|
184
|
+
path,
|
|
185
|
+
node: item,
|
|
186
|
+
});
|
|
185
187
|
});
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
actionList.push({
|
|
191
|
+
action,
|
|
192
|
+
path,
|
|
193
|
+
object: objItem,
|
|
186
194
|
});
|
|
187
195
|
}
|
|
188
|
-
}
|
|
189
|
-
actionList.push({
|
|
190
|
-
action,
|
|
191
|
-
path,
|
|
192
|
-
object: objItem,
|
|
193
|
-
});
|
|
194
|
-
}
|
|
196
|
+
});
|
|
195
197
|
});
|
|
196
|
-
}
|
|
198
|
+
}
|
|
199
|
+
} catch (error) {
|
|
200
|
+
console.log(error);
|
|
201
|
+
app.emit('refresh');
|
|
197
202
|
}
|
|
203
|
+
|
|
198
204
|
let ChangedNASLType = '';
|
|
199
205
|
if (hasFrontEnd && hasBackEnd) {
|
|
200
206
|
ChangedNASLType = 'both';
|
|
@@ -213,11 +219,15 @@ async function doAction(app: any, actionItem: any) {
|
|
|
213
219
|
ChangedNASLType,
|
|
214
220
|
'request-appBaseVersion': (window as any).appData?.baseVersion || '',
|
|
215
221
|
'request-versionChangedTime': (window as any).appData?.versionChangedTime || '',
|
|
222
|
+
operateArea: (window as any).appData?.branchStatus === 'merging' ? 'merge_conflict' : '',
|
|
216
223
|
},
|
|
217
224
|
});
|
|
218
225
|
} catch (error) {
|
|
219
226
|
err = error;
|
|
220
|
-
|
|
227
|
+
|
|
228
|
+
// 401650, 检测到当前应用拉取操作已被强制结束, 用户确认后再刷新
|
|
229
|
+
if (error?.code !== 401650)
|
|
230
|
+
app.emit('refresh');
|
|
221
231
|
}
|
|
222
232
|
} else if (config.storage.protocol === 'mock') {
|
|
223
233
|
// Do nothing
|
|
@@ -250,7 +260,7 @@ async function doAction(app: any, actionItem: any) {
|
|
|
250
260
|
}
|
|
251
261
|
}
|
|
252
262
|
|
|
253
|
-
function handleApp(app: any) {
|
|
263
|
+
export function handleApp(app: any) {
|
|
254
264
|
app._isCollectingCount = 0;
|
|
255
265
|
app._collectingList = [];
|
|
256
266
|
app._historyList = [];
|
|
@@ -273,7 +283,10 @@ function handleApp(app: any) {
|
|
|
273
283
|
if (app._timer) {
|
|
274
284
|
clearTimeout(app._timer);
|
|
275
285
|
}
|
|
276
|
-
if (!
|
|
286
|
+
if (!app._noTimer) {
|
|
287
|
+
app._noTimer = event.noTimer;
|
|
288
|
+
}
|
|
289
|
+
if (!app._noTimer) {
|
|
277
290
|
app._timer = setTimeout(() => {
|
|
278
291
|
console.error('收集超时,请及时排查原因');
|
|
279
292
|
app.emit('refresh');
|
|
@@ -295,20 +308,24 @@ function handleApp(app: any) {
|
|
|
295
308
|
if (app._timer) {
|
|
296
309
|
clearTimeout(app._timer);
|
|
297
310
|
}
|
|
298
|
-
|
|
311
|
+
// 结束收集时,立即将全局收集变量状态重置,防止下次收集数据混乱
|
|
312
|
+
const collectingList = app._collectingList;
|
|
313
|
+
const actionMsg = app._actionMsg;
|
|
314
|
+
const action = app._action;
|
|
315
|
+
app._collectingList = [];
|
|
316
|
+
app._actionMsg = '';
|
|
317
|
+
app._action = '';
|
|
318
|
+
app._noTimer = undefined;
|
|
319
|
+
if (Array.isArray(collectingList) && collectingList.length) {
|
|
299
320
|
embeddedTSEmitter.emit('change', {
|
|
300
|
-
value:
|
|
321
|
+
value: collectingList,
|
|
301
322
|
});
|
|
302
323
|
await doAction(app, {
|
|
303
|
-
list:
|
|
304
|
-
actionMsg
|
|
305
|
-
action
|
|
324
|
+
list: collectingList,
|
|
325
|
+
actionMsg,
|
|
326
|
+
action,
|
|
306
327
|
});
|
|
307
328
|
}
|
|
308
|
-
|
|
309
|
-
app._collectingList = [];
|
|
310
|
-
app._actionMsg = '';
|
|
311
|
-
app._action = '';
|
|
312
329
|
} else if (app._isCollectingCount < 0) {
|
|
313
330
|
app._isCollectingCount = 0;
|
|
314
331
|
throw Error('关闭收集有问题,请排查');
|
|
@@ -372,6 +389,7 @@ export async function loadApp(appId?: string) {
|
|
|
372
389
|
appId,
|
|
373
390
|
'request-appBaseVersion': (window as any).appData?.baseVersion || '',
|
|
374
391
|
'request-versionChangedTime': (window as any).appData?.versionChangedTime || '',
|
|
392
|
+
operateArea: (window as any).appData?.branchStatus === 'merging' ? 'merge_conflict' : '',
|
|
375
393
|
},
|
|
376
394
|
});
|
|
377
395
|
// const data = res?.data?.result;
|
|
@@ -385,7 +403,7 @@ export async function loadApp(appId?: string) {
|
|
|
385
403
|
scope: 'pc',
|
|
386
404
|
envs: 'dev,online',
|
|
387
405
|
hasAuth: true,
|
|
388
|
-
|
|
406
|
+
dataSources: [],
|
|
389
407
|
structures: [],
|
|
390
408
|
enums: [],
|
|
391
409
|
logics: [],
|