@lcap/nasl 1.0.0-alpha.13 → 1.0.0-alpha.16
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 -1
- package/out/automate/engine/index.js +73 -25
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/utils.js +7 -6
- package/out/automate/engine/utils.js.map +1 -1
- package/out/common/BaseNode.d.ts +5 -4
- package/out/common/BaseNode.js +48 -41
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +18 -1
- package/out/concepts/App__.js +64 -24
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +2 -2
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +190 -0
- package/out/concepts/Assignee__.js +264 -0
- package/out/concepts/Assignee__.js.map +1 -0
- package/out/concepts/BinaryExpression__.js +6 -6
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +19 -0
- package/out/concepts/BindAttribute__.js +36 -2
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +21 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +1 -0
- package/out/concepts/BindEvent__.js +38 -14
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.js +20 -7
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +11 -8
- package/out/concepts/CallInterface__.js +160 -23
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +1 -0
- package/out/concepts/CallLogic__.js +17 -7
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +5 -1
- package/out/concepts/CallQueryComponent__.js +15 -11
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +6 -2
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +1 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +1 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +11 -0
- package/out/concepts/Destination__.js +59 -19
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +10 -2
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +7 -0
- package/out/concepts/EntityProperty__.js +60 -3
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +4 -1
- package/out/concepts/Entity__.js +29 -12
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +4 -0
- package/out/concepts/Enum__.js +9 -6
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +8 -12
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.js +5 -5
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +26 -24
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +2 -0
- package/out/concepts/InterfaceParam__.js +41 -21
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +3 -0
- package/out/concepts/Interface__.js +105 -9
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +2 -1
- package/out/concepts/LogicItem__.js +14 -0
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +3 -0
- package/out/concepts/Logic__.js +57 -16
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +13 -6
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +6 -0
- package/out/concepts/Module__.js +18 -8
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +4 -0
- package/out/concepts/Namespace__.js +23 -12
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/Param__.d.ts +2 -1
- package/out/concepts/Param__.js +35 -22
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +2 -2
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +20 -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__.d.ts +6 -1
- package/out/concepts/Process__.js +18 -14
- 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/QueryFromExpression__.js +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +2 -2
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -0
- package/out/concepts/Return__.js +38 -25
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js +1 -1
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -1
- package/out/concepts/StringLiteral__.js +2 -2
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +5 -4
- package/out/concepts/StructureProperty__.js +54 -31
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +1 -0
- package/out/concepts/Structure__.js +18 -5
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +3 -3
- 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/TypeAnnotation__.d.ts +3 -5
- package/out/concepts/TypeAnnotation__.js +36 -14
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +4 -2
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +1 -0
- package/out/concepts/ValidationRule__.js +27 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +1 -0
- package/out/concepts/Variable__.js +38 -25
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +5 -5
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +7 -1
- package/out/concepts/ViewElement__.js +154 -117
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +4 -0
- package/out/concepts/View__.js +38 -25
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/index.js +3 -1
- package/out/concepts/basics/stdlib/index.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.auth.js +30 -0
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.browser copy.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.browser copy.js +70 -0
- package/out/concepts/basics/stdlib/nasl.browser copy.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.browser.js +6 -35
- package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.configuration.js +25 -0
- package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.util.js +49 -41
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.js +26 -20
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
- package/out/concepts/basics/types/coreTypeList.js +11 -11
- package/out/concepts/basics/types/coreTypeList.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 +1 -1
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +1 -0
- package/out/generator/genBundleFiles.js +122 -93
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/manager/diagnostic.d.ts +1 -1
- package/out/server/createUiTs.d.ts +1 -0
- package/out/server/createUiTs.js +19 -2
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/entity2LogicNamespace.js +24 -9
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/getExtensionModules.js +2 -0
- package/out/server/getExtensionModules.js.map +1 -1
- package/out/server/getLogics.js +40 -56
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +4 -0
- package/out/server/getMemberIdentifier.js +90 -48
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +2 -2
- package/out/server/getProcesses.js +34 -11
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/index.js +4 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +11 -30
- package/out/server/naslServer.js +410 -199
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.d.ts +10 -0
- package/out/server/process2LogicNamespace.js +16 -0
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.d.ts +22 -3
- package/out/server/translator.js +336 -130
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.js +29 -15
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +5 -5
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +9 -13
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +7 -7
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +2 -2
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +4 -2
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.d.ts +1 -1
- package/out/templator/genGridViewBlock.js +3 -3
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.d.ts +2 -0
- package/out/templator/genQueryComponent.js +1 -0
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genTableBlock.d.ts +1 -1
- package/out/templator/genTableBlock.js +3 -3
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +7 -7
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +3 -1
- package/out/templator/utils.js +2 -1
- package/out/templator/utils.js.map +1 -1
- package/out/utils/index.d.ts +6 -0
- package/out/utils/index.js +20 -1
- package/out/utils/index.js.map +1 -1
- package/package.json +2 -1
- package/src/automate/engine/index.js +73 -25
- package/src/automate/engine/utils.js +7 -6
- package/src/common/BaseNode.ts +51 -42
- package/src/concepts/App__.ts +104 -26
- package/src/concepts/Argument__.ts +3 -2
- package/src/concepts/Assignee__.ts +437 -0
- package/src/concepts/BinaryExpression__.ts +7 -6
- package/src/concepts/BindAttribute__.ts +51 -2
- package/src/concepts/BindDirective__.ts +20 -1
- package/src/concepts/BindEvent__.ts +39 -16
- package/src/concepts/CallFunction__.ts +21 -8
- package/src/concepts/CallInterface__.ts +161 -42
- package/src/concepts/CallLogic__.ts +21 -9
- package/src/concepts/CallQueryComponent__.ts +15 -13
- package/src/concepts/Comment__.ts +6 -2
- package/src/concepts/ConfigGroup__.ts +1 -1
- package/src/concepts/ConfigProperty__.ts +1 -1
- package/src/concepts/Configuration__.ts +1 -1
- package/src/concepts/Destination__.ts +57 -19
- package/src/concepts/End__.ts +9 -11
- package/src/concepts/EntityProperty__.ts +56 -3
- package/src/concepts/Entity__.ts +33 -20
- package/src/concepts/Enum__.ts +8 -7
- package/src/concepts/Event__.ts +1 -1
- package/src/concepts/ForEachStatement__.ts +8 -13
- package/src/concepts/Function__.ts +5 -5
- package/src/concepts/Identifier__.ts +31 -26
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/InterfaceParam__.ts +39 -20
- package/src/concepts/Interface__.ts +103 -9
- package/src/concepts/LogicItem__.ts +16 -1
- package/src/concepts/Logic__.ts +60 -18
- package/src/concepts/MemberExpression__.ts +18 -6
- package/src/concepts/Module__.ts +19 -8
- package/src/concepts/Namespace__.ts +24 -12
- package/src/concepts/Param__.ts +34 -23
- package/src/concepts/ProcessComponent__.ts +2 -2
- package/src/concepts/ProcessElement__.ts +51 -50
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/Process__.ts +32 -28
- package/src/concepts/QueryAggregateExpression__.ts +1 -1
- package/src/concepts/QueryFromExpression__.ts +1 -1
- package/src/concepts/QueryJoinExpression__.ts +2 -2
- package/src/concepts/QuerySelectExpression__.ts +1 -1
- package/src/concepts/Return__.ts +35 -25
- package/src/concepts/SqlQueryComponent__.ts +1 -1
- package/src/concepts/StringLiteral__.ts +2 -2
- package/src/concepts/StructureProperty__.ts +49 -29
- package/src/concepts/Structure__.ts +17 -5
- package/src/concepts/SwitchCase__.ts +3 -3
- package/src/concepts/SwitchStatement__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +34 -12
- package/src/concepts/UnaryExpression__.ts +4 -2
- package/src/concepts/ValidationRule__.ts +24 -1
- package/src/concepts/Variable__.ts +35 -24
- package/src/concepts/ViewComponent__.ts +5 -5
- package/src/concepts/ViewElement__.ts +168 -113
- package/src/concepts/View__.ts +44 -25
- package/src/concepts/WhileStatement__.ts +1 -1
- package/src/concepts/basics/stdlib/index.ts +3 -1
- package/src/concepts/basics/stdlib/nasl.auth.ts +26 -0
- package/src/concepts/basics/stdlib/nasl.browser.ts +7 -41
- package/src/concepts/basics/stdlib/nasl.configuration.ts +21 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +49 -41
- package/src/concepts/basics/stdlib/nasl.validation.ts +17 -11
- package/src/concepts/basics/types/coreTypeList.ts +11 -11
- package/src/concepts/index__.ts +1 -0
- package/src/enums/KEYWORDS.ts +1 -1
- package/src/generator/genBundleFiles.ts +131 -112
- package/src/manager/diagnostic.ts +1 -1
- package/src/server/createUiTs.ts +22 -4
- package/src/server/entity2LogicNamespace.ts +25 -9
- package/src/server/getExtensionModules.ts +2 -0
- package/src/server/getLogics.ts +42 -58
- package/src/server/getMemberIdentifier.ts +88 -46
- package/src/server/getProcesses.ts +32 -9
- package/src/server/index.ts +12 -1
- package/src/server/naslServer.ts +422 -215
- package/src/server/process2LogicNamespace.ts +17 -1
- package/src/server/translator.ts +392 -134
- package/src/service/storage/init.ts +27 -16
- package/src/templator/genCreateBlock.ts +5 -5
- package/src/templator/genCurdEditMultipleKeyBlock.ts +25 -26
- package/src/templator/genCurdMultipleKeyBlock.ts +7 -7
- package/src/templator/genEditTableBlock.ts +2 -2
- package/src/templator/genGetBlock.ts +5 -7
- package/src/templator/genGridViewBlock.ts +4 -7
- package/src/templator/genQueryComponent.ts +1 -0
- package/src/templator/genTableBlock.ts +4 -7
- package/src/templator/genUpdateBlock.ts +7 -8
- package/src/templator/utils.ts +2 -1
- package/src/utils/index.ts +19 -0
package/out/server/translator.js
CHANGED
|
@@ -3,8 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.naslNodeTranslateMessage = exports.translateDiagnosticMessage = exports.outOriginalvalue = void 0;
|
|
7
7
|
const naslServer_1 = __importDefault(require("./naslServer"));
|
|
8
|
+
const concepts_1 = require("../concepts");
|
|
8
9
|
function transformType(tsType) {
|
|
9
10
|
if (tsType === 'string' || tsType === 'String')
|
|
10
11
|
return '字符串';
|
|
@@ -30,8 +31,12 @@ function transformType(tsType) {
|
|
|
30
31
|
return '枚举';
|
|
31
32
|
else if (tsType === 'views')
|
|
32
33
|
return '页面';
|
|
34
|
+
else if (tsType === 'void')
|
|
35
|
+
return '无返回值';
|
|
33
36
|
else if (tsType === '__elements')
|
|
34
37
|
return '页面元素';
|
|
38
|
+
else if (tsType === 'extensions')
|
|
39
|
+
return '拓展模块';
|
|
35
40
|
else if (tsType === 'Promise<void>')
|
|
36
41
|
return '未知类型';
|
|
37
42
|
else if (tsType.startsWith('{') && tsType.endsWith('}'))
|
|
@@ -47,150 +52,226 @@ function transformType(tsType) {
|
|
|
47
52
|
});
|
|
48
53
|
return tsStr;
|
|
49
54
|
}
|
|
55
|
+
else if (tsType.includes(' & ')) {
|
|
56
|
+
const types = tsType.split(' & ');
|
|
57
|
+
let tsStr = '';
|
|
58
|
+
types.forEach((item, index) => {
|
|
59
|
+
tsStr += index === 0 ? transformType(item) : ' | ' + transformType(item);
|
|
60
|
+
});
|
|
61
|
+
return tsStr;
|
|
62
|
+
}
|
|
63
|
+
else if (tsType.includes(' | ')) {
|
|
64
|
+
const types = tsType.split(' | ');
|
|
65
|
+
let tsStr = '';
|
|
66
|
+
types.forEach((item, index) => {
|
|
67
|
+
tsStr += index === 0 ? transformType(item) : ' | ' + transformType(item);
|
|
68
|
+
});
|
|
69
|
+
return tsStr;
|
|
70
|
+
}
|
|
50
71
|
else {
|
|
51
72
|
return tsType;
|
|
52
73
|
}
|
|
53
74
|
}
|
|
54
|
-
|
|
75
|
+
const NAMESPACE_CONCEPT_MAP = {
|
|
76
|
+
entities: '实体',
|
|
77
|
+
structures: '数据结构',
|
|
78
|
+
enums: '枚举',
|
|
79
|
+
logics: '逻辑',
|
|
80
|
+
interfaces: '接口',
|
|
81
|
+
views: '页面',
|
|
82
|
+
elements: '元素',
|
|
83
|
+
processes: '流程',
|
|
84
|
+
roles: '角色',
|
|
85
|
+
extensions: '扩展模块',
|
|
86
|
+
apis: '接口应用',
|
|
87
|
+
components: '扩展组件',
|
|
88
|
+
};
|
|
55
89
|
function transformNamespace(tsNamespace) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
90
|
+
for (const key in NAMESPACE_CONCEPT_MAP) {
|
|
91
|
+
const value = NAMESPACE_CONCEPT_MAP[key];
|
|
92
|
+
if (tsNamespace.endsWith(key))
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
95
|
+
return tsNamespace;
|
|
62
96
|
}
|
|
63
|
-
exports.transformNamespace = transformNamespace;
|
|
64
97
|
function transformMethod(tsMethod) {
|
|
65
98
|
if (tsMethod === 'forEach')
|
|
66
99
|
return 'ForEach';
|
|
67
|
-
|
|
100
|
+
else
|
|
101
|
+
return tsMethod;
|
|
102
|
+
}
|
|
103
|
+
function transformIdentifier(identifier) {
|
|
104
|
+
if (NAMESPACE_CONCEPT_MAP[identifier])
|
|
105
|
+
return NAMESPACE_CONCEPT_MAP[identifier];
|
|
106
|
+
else
|
|
107
|
+
return ` ${transformType(identifier)} 上的`;
|
|
68
108
|
}
|
|
69
|
-
exports.transformMethod = transformMethod;
|
|
70
109
|
function outOriginalvalue(value) {
|
|
71
110
|
return value;
|
|
72
111
|
}
|
|
73
112
|
exports.outOriginalvalue = outOriginalvalue;
|
|
113
|
+
const TS_RULES = [
|
|
114
|
+
{
|
|
115
|
+
re: /Type '(.+?)' is not assignable to type '(.+?)'/,
|
|
116
|
+
result: '左右参数类型不一致!左边类型:$2,右边类型:$1。',
|
|
117
|
+
transforms: [transformType, transformType],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
re: /Argument of type '(.+?)' is not assignable to parameter of type '(.+?)'/,
|
|
121
|
+
result: '参数类型不一致!传入类型:$1,接收类型:$2。',
|
|
122
|
+
transforms: [transformType, transformType],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
re: /Type '(.+?)' does not satisfy the constraint '(.+?)'/,
|
|
126
|
+
result: '参数类型不一致!传入类型:$1,接收类型:$2。',
|
|
127
|
+
transforms: [transformType, transformType],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
re: /This condition will always return '(.+?)' since the types '(.+?)' and '(.+?)' have no overlap/,
|
|
131
|
+
result: '左右参数类型不一致!左边类型:$2,右边类型:$3。',
|
|
132
|
+
transforms: [transformType, transformType, transformType],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
re: /Type '(.+?)' is missing the following properties from type '(.+?)'/,
|
|
136
|
+
result: '类型不一致!左边类型:$2,右边类型:$1。',
|
|
137
|
+
transforms: [transformType, transformType],
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
re: /Property '(.+?)' is missing in type '(.+?)' but required in type '(.+?)'/,
|
|
141
|
+
result: '类型不一致!左边类型:$3,右边类型:$2。',
|
|
142
|
+
transforms: [outOriginalvalue, transformType, transformType],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
re: /Expression expected/,
|
|
146
|
+
result: '表达式不能为空。',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
re: /Cannot find name '__(?:IDENTIFIER|LEFT|RIGHT)__'/,
|
|
150
|
+
result: '表达式不能为空。',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
re: /Cannot find name '__(?:QueryFieldExpression)__'/,
|
|
154
|
+
result: '数据查询:实体字段不能为空。',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
re: /Cannot find name '__(?:WHERE_MULTIPLE_CONDITION)__'/,
|
|
158
|
+
result: '数据查询:筛选条件不能有多个表达式。',
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
re: /Cannot find name '__(?:HAVING_MULTIPLE_CONDITION)__'/,
|
|
162
|
+
result: '数据查询:聚合属性过滤不能有多个表达式。',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
re: /Cannot find name '__(?:EMPTY_AGGREGATE_NAME)__'/,
|
|
166
|
+
result: '数据查询:聚合函数名称不能为空。',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
re: /Cannot find name '__(?:EMPTY_AGGREGATE_ALIAS)__'/,
|
|
170
|
+
result: '数据查询:聚合函数别名不能为空。',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
re: /No value exists in scope for the shorthand property '__(?:IDENTIFIER|LEFT|RIGHT)__'. Either declare one or provide an initializer./,
|
|
174
|
+
result: '用户任务未关联页面',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
re: /'(.+?)' is declared but its value is never read/,
|
|
178
|
+
result: "已添加'$1',但从来没有使用过。",
|
|
179
|
+
transforms: [transformType, transformType],
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
re: /'(.+?)' has no exported member(?: named)? '(.+?)'/,
|
|
183
|
+
result: '找不到$1 $2。',
|
|
184
|
+
transforms: [transformNamespace, transformType],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
re: /Unreachable code detected\./,
|
|
188
|
+
result: '逻辑中有未使用的。',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
re: /Property '__slice' does not exist on type '(.+?)'/,
|
|
192
|
+
result: 'For Each:循环列表:参数类型不匹配!所需类型:数组、集合等,提供类型:$1',
|
|
193
|
+
transforms: [transformType],
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
re: /Property '(.+?)' does not exist on type 'typeof (.+?)'/,
|
|
197
|
+
result: '找不到$2 $1。',
|
|
198
|
+
transforms: [transformMethod, transformIdentifier],
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
re: /Property '(.+?)' does not exist on type '(.+?)'/,
|
|
202
|
+
result: '找不到$2 $1。',
|
|
203
|
+
transforms: [transformMethod, transformIdentifier],
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
re: /Cannot find name '(.+?)'. Did you mean '(.+?)'\?/,
|
|
207
|
+
result: '找不到 $1。',
|
|
208
|
+
transforms: [outOriginalvalue, outOriginalvalue],
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
re: /Expected (.+?) type arguments, but got (.+?)/,
|
|
212
|
+
result: '预期 $1 个类型参数,但传入了 $2 个。',
|
|
213
|
+
transforms: [outOriginalvalue, outOriginalvalue],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
re: /Expected (.+?) arguments, but got (.+?)./,
|
|
217
|
+
result: '预期 $1 个参数,但传入了 $2 个。',
|
|
218
|
+
transforms: [outOriginalvalue, outOriginalvalue],
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
re: /The (.+?)-hand side of an arithmetic operation must be of type (.+?). type./,
|
|
222
|
+
result: '表达式错误!',
|
|
223
|
+
transforms: [outOriginalvalue, outOriginalvalue],
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
re: /Operator '(.+?)' cannot be applied to types '(.+?)' and '(.+?)'./,
|
|
227
|
+
result: '符号:$1 参数类型不匹配!所需类型:基础类型>$2,提供类型:$3。',
|
|
228
|
+
transforms: [outOriginalvalue, transformType, transformType],
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
re: /Object is possibly 'undefined'./,
|
|
232
|
+
result: '所选择的内容未定义。',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
re: /Cannot find name '(.+?)'./,
|
|
236
|
+
result: '所选择的内容 $1 未定义。',
|
|
237
|
+
transforms: [outOriginalvalue],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
re: /Duplicate identifier '(.+?)'./,
|
|
241
|
+
result: '当前内容中有重复的 $1,可能会影响使用。',
|
|
242
|
+
transforms: [outOriginalvalue],
|
|
243
|
+
},
|
|
244
|
+
];
|
|
245
|
+
const POST_RULES = [
|
|
246
|
+
{
|
|
247
|
+
re: /__IDENTIFIER__/g,
|
|
248
|
+
result: 'undefined',
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
re: /Integer|"Integer"/g,
|
|
252
|
+
result: '整数',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
re: /Long|"Long"/g,
|
|
256
|
+
result: '长整数',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
re: /Double|"Double"/g,
|
|
260
|
+
result: '小数',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
re: /never/g,
|
|
264
|
+
result: '不接受任何类型',
|
|
265
|
+
},
|
|
266
|
+
];
|
|
267
|
+
Object.keys(NAMESPACE_CONCEPT_MAP).forEach((key) => {
|
|
268
|
+
POST_RULES.push({
|
|
269
|
+
re: new RegExp(key, 'g'),
|
|
270
|
+
result: NAMESPACE_CONCEPT_MAP[key],
|
|
271
|
+
});
|
|
272
|
+
});
|
|
74
273
|
function translateDiagnosticMessage(message) {
|
|
75
|
-
const
|
|
76
|
-
{
|
|
77
|
-
re: /^Type '(.+?)' is not assignable to type '(.+?)'\./,
|
|
78
|
-
result: '左右参数类型不一致!左边类型:$2,右边类型:$1。',
|
|
79
|
-
transforms: [transformType, transformType],
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
re: /^Argument of type '(.+?)' is not assignable to parameter of type '(.+?)'\./,
|
|
83
|
-
result: '参数类型不一致!传入类型:$1,接收类型:$2。',
|
|
84
|
-
transforms: [transformType, transformType],
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
re: /^This condition will always return 'false' since the types '(.+?)' and '(.+?)' have no overlap\.$/,
|
|
88
|
-
result: '类型不一致!左边类型:$1,右边类型:$2。',
|
|
89
|
-
transforms: [transformType, transformType],
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
re: /^Type '(.+?)' is missing the following properties from type '(.+?)'/,
|
|
93
|
-
result: '类型不一致!左边类型:$2,右边类型:$1。',
|
|
94
|
-
transforms: [transformType, transformType],
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
re: /^Property '(.+?)' is missing in type '(.+?)' but required in type '(.+?)'./,
|
|
98
|
-
result: '类型不一致!左边类型:$3,右边类型:$2。',
|
|
99
|
-
transforms: [outOriginalvalue, transformType, transformType],
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
re: /^Expression expected\.$/,
|
|
103
|
-
result: '表达式不能为空。',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
re: /^Cannot find name '__(?:IDENTIFIER|LEFT|RIGHT)__'\.$/,
|
|
107
|
-
result: '表达式不能为空。',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
re: /^Cannot find name '__(?:QueryFieldExpression)__'\.$/,
|
|
111
|
-
result: '实体字段不能为空。',
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
re: /^Cannot find name '__(?:WHERE_MULTIPLE_CONDITION)__'\.$/,
|
|
115
|
-
result: '筛选条件不能有多个表达式。',
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
re: /^Cannot find name '__(?:HAVING_MULTIPLE_CONDITION)__'\.$/,
|
|
119
|
-
result: '聚合属性过滤不能有多个表达式。',
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
re: /^Cannot find name '__(?:EMPTY_AGGREGATE_NAME)__'\.$/,
|
|
123
|
-
result: '聚合函数名称不能为空。',
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
re: /^Cannot find name '__(?:EMPTY_AGGREGATE_ALIAS)__'\.$/,
|
|
127
|
-
result: '聚合函数别名不能为空。',
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
re: /^'(.+?)' is declared but its value is never read\.$/,
|
|
131
|
-
result: "已添加'$1',但从来没有使用过。",
|
|
132
|
-
transforms: [transformType, transformType],
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
re: /'(.+?)' has no exported member(?: named)? '(.+?)'/,
|
|
136
|
-
result: "找不到数据结构 '$2'。",
|
|
137
|
-
transforms: [transformType, transformNamespace],
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
re: /^Unreachable code detected\.$/,
|
|
141
|
-
result: '逻辑中有未使用的。',
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
re: /Property '__slice' does not exist on type '(.+?)'./,
|
|
145
|
-
result: 'For Each:循环列表:参数类型不匹配!所需类型:基础类型>字符串、数组、集合等,提供类型:$1',
|
|
146
|
-
transforms: [transformType],
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
re: /Property '(.+?)' does not exist on type 'typeof logics'./,
|
|
150
|
-
result: '逻辑上找不到 $1 未找到。',
|
|
151
|
-
transforms: [outOriginalvalue],
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
re: /Property '(.+?)' does not exist on type 'typeof (.+?)'./,
|
|
155
|
-
result: '$2 上找不到 $1。',
|
|
156
|
-
transforms: [transformMethod, transformType],
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
re: /Property '(.+?)' does not exist on type '(.+?)'./,
|
|
160
|
-
result: '$2 上找不到 $1。',
|
|
161
|
-
transforms: [transformMethod, transformType],
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
re: /Cannot find name '(.+?)'. Did you mean '(.+?)'\?/,
|
|
165
|
-
result: '找不到 $1,您是想要 $2 吗?',
|
|
166
|
-
transforms: [outOriginalvalue, outOriginalvalue],
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
re: /Expected (.+?) arguments, but got (.+?)./,
|
|
170
|
-
result: '预期 $1 个参数,但传入了 $2 个。',
|
|
171
|
-
transforms: [outOriginalvalue, outOriginalvalue],
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
re: /The (.+?)-hand side of an arithmetic operation must be of type (.+?). type./,
|
|
175
|
-
result: '表达式错误!',
|
|
176
|
-
transforms: [outOriginalvalue, outOriginalvalue],
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
re: /Operator '(.+?)' cannot be applied to types '(.+?)' and '(.+?)'./,
|
|
180
|
-
result: '符号 $1 左右类型不匹配!左侧 $2,右侧 $3。',
|
|
181
|
-
transforms: [outOriginalvalue, transformType, transformType],
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
re: /Object is possibly 'undefined'./,
|
|
185
|
-
result: '所选择的内容未定义。',
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
re: /Cannot find name '(.+?)'./,
|
|
189
|
-
result: '所选择的内容 $1 未定义。',
|
|
190
|
-
transforms: [outOriginalvalue],
|
|
191
|
-
},
|
|
192
|
-
];
|
|
193
|
-
for (const rule of translateRules) {
|
|
274
|
+
for (const rule of TS_RULES) {
|
|
194
275
|
const cap = rule.re.exec(message);
|
|
195
276
|
if (cap) {
|
|
196
277
|
return rule.result.replace(/\$(\d+)/g, (m, index) => rule.transforms[index - 1](cap[index]));
|
|
@@ -199,4 +280,129 @@ function translateDiagnosticMessage(message) {
|
|
|
199
280
|
return message;
|
|
200
281
|
}
|
|
201
282
|
exports.translateDiagnosticMessage = translateDiagnosticMessage;
|
|
283
|
+
/**
|
|
284
|
+
* 节点和ts 报错结合,转成更精准的ts报错
|
|
285
|
+
* @param minRange
|
|
286
|
+
* @param tsErrorDetail 报错具体信息
|
|
287
|
+
* @returns
|
|
288
|
+
*/
|
|
289
|
+
function naslNodeTranslateMessage(minRange, tsErrorDetail) {
|
|
290
|
+
const text = tsErrorDetail.originalDiagnostic.text;
|
|
291
|
+
let node = minRange.node;
|
|
292
|
+
// 有一些节点报错信息不向外暴露,缺失一些原生标签等等的展示
|
|
293
|
+
if (node instanceof concepts_1.View || node instanceof concepts_1.ViewElement) {
|
|
294
|
+
if (text.startsWith(`'nasl.ui' has no exported member named `)) {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
else if (text.startsWith(`Property '`) && text.includes(`does not exist on type 'typeof ui'.`)) {
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
else if (text.startsWith(`Namespace 'nasl.ui' has no exported member `)) {
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
// 处理bindevent参数没传递的报错
|
|
305
|
+
if (/Expected (.+?) arguments, but got (.+?)./.exec(text)) {
|
|
306
|
+
// bindevent本身现在就不传参数
|
|
307
|
+
if (node instanceof concepts_1.BindEvent) {
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
// 因为缺少参数时候有可能有特殊情况,因为原本少的多了就会找到 callLogic上,
|
|
312
|
+
// 但是只少一个的时候就会找到准确的Argument上 需要特殊处理, ui层就可以统一处理
|
|
313
|
+
if (/Expected (.+?) arguments, but got (.+?)./.exec(text) && node.getAncestor('CallLogic')) {
|
|
314
|
+
node = node.getAncestor('CallLogic');
|
|
315
|
+
}
|
|
316
|
+
if (node instanceof concepts_1.Argument) {
|
|
317
|
+
// if (/Type '(.+?)' is not assignable to type '(.+?)'./.exec(text)) {
|
|
318
|
+
// }
|
|
319
|
+
// Argument在callInterface上的报错放到内部
|
|
320
|
+
if (node.expression) {
|
|
321
|
+
node = node.expression;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
// 处理一些复制过来的内容 Identifier或者MemberExpression内容缺失,错误要像上冒
|
|
325
|
+
if (node instanceof concepts_1.Identifier || node instanceof concepts_1.MemberExpression) {
|
|
326
|
+
if (node.parentNode instanceof concepts_1.MemberExpression) {
|
|
327
|
+
let parentNode = node;
|
|
328
|
+
while (parentNode && parentNode.parentNode instanceof concepts_1.MemberExpression) {
|
|
329
|
+
parentNode = parentNode.parentNode;
|
|
330
|
+
}
|
|
331
|
+
node = parentNode || node;
|
|
332
|
+
let str = tsErrorDetail.message;
|
|
333
|
+
str = node.constructor.nodeTitle + ':' + str;
|
|
334
|
+
tsErrorDetail.message = str;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
// 类型报错的,需要放到上一级
|
|
338
|
+
if (/'(.+?)' has no exported member(?: named)? '(.+?)'/.exec(text) || /Property '(.+?)' does not exist on type '(.+?)'./.exec(text)) {
|
|
339
|
+
if (node instanceof concepts_1.TypeAnnotation) {
|
|
340
|
+
// 变量type的报错放到内部
|
|
341
|
+
node = node.parentNode;
|
|
342
|
+
let str = tsErrorDetail.message;
|
|
343
|
+
str = node.constructor.nodeTitle + ':' + str;
|
|
344
|
+
tsErrorDetail.message = str;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* 所有问题的报错处理具体信息
|
|
349
|
+
*/
|
|
350
|
+
if (/^Cannot find name '__(?:IDENTIFIER|LEFT|RIGHT)__'\.$/.exec(text)) {
|
|
351
|
+
if (node instanceof concepts_1.IfStatement || node instanceof concepts_1.SwitchCase || node instanceof concepts_1.WhileStatement) {
|
|
352
|
+
tsErrorDetail.message = node.constructor.nodeTitle + ':参数不能为空!所需类型:基础类型>布尔值';
|
|
353
|
+
}
|
|
354
|
+
else if (node instanceof concepts_1.ForEachStatement) {
|
|
355
|
+
tsErrorDetail.message = 'For Each:结束值:不能为空!所需类型:基础类型>整数';
|
|
356
|
+
}
|
|
357
|
+
else if (node instanceof concepts_1.UnaryExpression) {
|
|
358
|
+
tsErrorDetail.message = '!:参数不能为空!';
|
|
359
|
+
}
|
|
360
|
+
else if (node instanceof concepts_1.Assignment) {
|
|
361
|
+
tsErrorDetail.message = '赋值:参数不能为空!';
|
|
362
|
+
}
|
|
363
|
+
else if ((node instanceof concepts_1.Argument && node.parentNode instanceof concepts_1.CallInterface) || node instanceof concepts_1.CallInterface) {
|
|
364
|
+
tsErrorDetail.message = '调用接口:逻辑不能为空!';
|
|
365
|
+
}
|
|
366
|
+
else if ((node instanceof concepts_1.Argument && node.parentNode instanceof concepts_1.CallFunction) || node instanceof concepts_1.CallFunction) {
|
|
367
|
+
tsErrorDetail.message = '调用函数:逻辑不能为空!';
|
|
368
|
+
}
|
|
369
|
+
else if ((node instanceof concepts_1.Argument && node.parentNode instanceof concepts_1.CallLogic) || node instanceof concepts_1.CallLogic) {
|
|
370
|
+
tsErrorDetail.message = '调用逻辑:逻辑不能为空!';
|
|
371
|
+
}
|
|
372
|
+
else if (node instanceof concepts_1.Identifier) {
|
|
373
|
+
// 根据父级内容推断当前缺少啥
|
|
374
|
+
const identifierToString = (node) => {
|
|
375
|
+
let str = tsErrorDetail.message;
|
|
376
|
+
if (node.parentNode instanceof concepts_1.Assignment) {
|
|
377
|
+
str = '赋值:参数不能为空!';
|
|
378
|
+
}
|
|
379
|
+
else if (node.parentNode instanceof concepts_1.Argument && node.parentNode.parentNode instanceof concepts_1.CallLogic) {
|
|
380
|
+
str = '调用逻辑:逻辑不能为空!';
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
str = node.parentNode.constructor.nodeTitle + ':' + str;
|
|
384
|
+
tsErrorDetail.message = str;
|
|
385
|
+
}
|
|
386
|
+
return str;
|
|
387
|
+
};
|
|
388
|
+
tsErrorDetail.message = identifierToString(node);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
// 左右类型不一致的,把上级信息带上
|
|
392
|
+
if (/^Type '(.+?)' is not assignable to type '(.+?)'\./.exec(text) || /^This condition will always return '(.+?)' since the types '(.+?)' and '(.+?)' have no overlap./.exec(text)) {
|
|
393
|
+
let str = tsErrorDetail.message;
|
|
394
|
+
str = node.parentNode.constructor.nodeTitle + ':' + str;
|
|
395
|
+
tsErrorDetail.message = str;
|
|
396
|
+
}
|
|
397
|
+
for (const rule of POST_RULES) {
|
|
398
|
+
if (rule.re.test(tsErrorDetail.message))
|
|
399
|
+
tsErrorDetail.message = tsErrorDetail.message.replace(rule.re, rule.result);
|
|
400
|
+
}
|
|
401
|
+
node.tsErrorDetail = tsErrorDetail;
|
|
402
|
+
return {
|
|
403
|
+
node,
|
|
404
|
+
...tsErrorDetail,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
exports.naslNodeTranslateMessage = naslNodeTranslateMessage;
|
|
202
408
|
//# sourceMappingURL=translator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translator.js","sourceRoot":"","sources":["../../src/server/translator.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"translator.js","sourceRoot":"","sources":["../../src/server/translator.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAsC;AACtC,0CAyCqB;AAQrB,SAAS,aAAa,CAAC,MAAc;IACjC,IAAI,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,QAAQ;QAC1C,OAAO,KAAK,CAAC;SACZ,IAAI,MAAM,KAAK,QAAQ;QACxB,OAAO,IAAI,CAAC;SACX,IAAI,MAAM,KAAK,SAAS;QACzB,OAAO,IAAI,CAAC;SACX,IAAI,MAAM,KAAK,QAAQ;QACxB,OAAO,IAAI,CAAC;SACX,IAAI,MAAM,KAAK,MAAM;QACtB,OAAO,KAAK,CAAC;SACZ,IAAI,MAAM,KAAK,UAAU;QAC1B,OAAO,MAAM,CAAC;SACb,IAAI,MAAM,KAAK,MAAM;QACtB,OAAO,IAAI,CAAC;SACX,IAAI,MAAM,KAAK,MAAM;QACtB,OAAO,IAAI,CAAC;SACX,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS;QACjD,OAAO,KAAK,CAAC;SACZ,IAAI,MAAM,KAAK,SAAS;QACzB,OAAO,MAAM,CAAC;SACb,IAAI,MAAM,KAAK,OAAO;QACvB,OAAO,IAAI,CAAC;SACX,IAAI,MAAM,KAAK,OAAO;QACvB,OAAO,IAAI,CAAC;SACX,IAAI,MAAM,KAAK,MAAM;QACtB,OAAO,MAAM,CAAC;SACb,IAAI,MAAM,KAAK,YAAY;QAC5B,OAAO,MAAM,CAAC;SACb,IAAI,MAAM,KAAK,YAAY;QAC5B,OAAO,MAAM,CAAC;SACb,IAAI,MAAM,KAAK,eAA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G,CAAC;YACf,CAAC,CAAC;YACF,aAAa,CAAC,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;SACpD;KACJ;IACD,mBAAmB;IACnB,IAAI,mDAAmD,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,iGAAiG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAChL,IAAI,GAAG,GAAG,aAAa,CAAC,OAAO,CAAC;QAChC,GAAG,GAAI,IAAI,CAAC,UAAkB,CAAC,WAAW,CAAC,SAAS,GAAG,GAAG,GAAG,GAAG,CAAC;QACjE,aAAa,CAAC,OAAO,GAAG,GAAG,CAAC;KAC/B;IAED,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE;QAC3B,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;YACnC,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;KACnF;IACD,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACnC,OAAO;QACH,IAAI;QACJ,GAAG,aAAa;KACnB,CAAC;AACN,CAAC;AAjHD,4DAiHC"}
|
|
@@ -93,12 +93,13 @@ function getStatement(state, app, diffLogicList) {
|
|
|
93
93
|
default:
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
|
-
return logicItems;
|
|
96
|
+
return logicItems.filter((item) => !!item);
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
99
|
* 执行更新
|
|
100
100
|
*/
|
|
101
101
|
async function doAction(app, actionItem) {
|
|
102
|
+
app.emit('saving');
|
|
102
103
|
let hasFrontEnd = false;
|
|
103
104
|
let hasBackEnd = false;
|
|
104
105
|
const actionList = [];
|
|
@@ -107,11 +108,10 @@ async function doAction(app, actionItem) {
|
|
|
107
108
|
list.forEach((event) => {
|
|
108
109
|
const emitTarget = event?.originEvent?.target;
|
|
109
110
|
const _path = event.originEvent.path;
|
|
110
|
-
const _root = _path.split('.')[1];
|
|
111
|
-
if (['entities', 'processes', 'logics'].some((item) => _root.startsWith(item))) {
|
|
111
|
+
const _root = _path.split('.')?.[1] || '';
|
|
112
|
+
if (['entities', 'processes', 'logics', 'enums', 'structures', 'interfaces'].some((item) => _root.startsWith(item))) {
|
|
112
113
|
hasBackEnd = true;
|
|
113
114
|
}
|
|
114
|
-
// console.log(emitTarget, action, actionItem);
|
|
115
115
|
const itemloop = (_i, app, diffArr) => {
|
|
116
116
|
const _l = getStatement(_i, app, diffArr);
|
|
117
117
|
if (_l.length) {
|
|
@@ -203,16 +203,23 @@ async function doAction(app, actionItem) {
|
|
|
203
203
|
else if (hasBackEnd) {
|
|
204
204
|
ChangedNASLType = 'backend';
|
|
205
205
|
}
|
|
206
|
+
let err;
|
|
206
207
|
if (config_1.config.storage.protocol === 'http') {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
208
|
+
try {
|
|
209
|
+
await service_1.default.batchAction({
|
|
210
|
+
body: actionList,
|
|
211
|
+
headers: {
|
|
212
|
+
appId: app.id,
|
|
213
|
+
ChangedNASLType,
|
|
214
|
+
'request-appBaseVersion': window.appData?.baseVersion || '',
|
|
215
|
+
'request-versionChangedTime': window.appData?.versionChangedTime || '',
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
err = error;
|
|
221
|
+
app.emit('refresh');
|
|
222
|
+
}
|
|
216
223
|
}
|
|
217
224
|
else if (config_1.config.storage.protocol === 'mock') {
|
|
218
225
|
// Do nothing
|
|
@@ -224,6 +231,7 @@ async function doAction(app, actionItem) {
|
|
|
224
231
|
spaces: 4,
|
|
225
232
|
});
|
|
226
233
|
}
|
|
234
|
+
app.emit('saved', err);
|
|
227
235
|
if (!app._historying) {
|
|
228
236
|
if (app._historyIndex !== app._historyList.length) {
|
|
229
237
|
app._historyList = app._historyList.splice(0, app._historyIndex);
|
|
@@ -261,9 +269,11 @@ function handleApp(app) {
|
|
|
261
269
|
* 开启收集
|
|
262
270
|
*/
|
|
263
271
|
app.on('collect:start', (event) => {
|
|
272
|
+
if (!app._isCollectingCount) {
|
|
273
|
+
app._actionMsg = event?.actionMsg;
|
|
274
|
+
app._action = event?.action;
|
|
275
|
+
}
|
|
264
276
|
app._isCollectingCount++;
|
|
265
|
-
app._actionMsg = event?.actionMsg;
|
|
266
|
-
app._action = event?.action;
|
|
267
277
|
});
|
|
268
278
|
/**
|
|
269
279
|
* 结束收集
|
|
@@ -285,6 +295,10 @@ function handleApp(app) {
|
|
|
285
295
|
app._actionMsg = '';
|
|
286
296
|
app._action = '';
|
|
287
297
|
}
|
|
298
|
+
else if (app._isCollectingCount < 0) {
|
|
299
|
+
app._isCollectingCount = 0;
|
|
300
|
+
throw Error('关闭收集有问题,请排查');
|
|
301
|
+
}
|
|
288
302
|
});
|
|
289
303
|
/**
|
|
290
304
|
* 有变更
|