@lcap/nasl 2.12.0-beta → 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 +23 -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.js +4 -1
- 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 +5 -0
- package/out/common/BaseNode.js +24 -3
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.js +3 -2
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js +1 -1
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/Assignment__.js +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +1 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +9 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +6 -2
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +4 -0
- package/out/concepts/BooleanLiteral__.js +12 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js +2 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +1 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +27 -11
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +1 -1
- package/out/concepts/CallQueryComponent__.js +3 -3
- 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/CompletionProperty__.js +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +1 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.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/Constant__.js +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.js +2 -0
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/End__.js +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.js +1 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +1 -1
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js +1 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js +1 -1
- 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 +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.js +2 -2
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +3 -2
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +1 -1
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +1 -1
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +2 -2
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +2 -4
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.js +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +7 -6
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +118 -112
- package/out/concepts/Module__.js +25 -7
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js +2 -2
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NullLiteral__.js +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.js +2 -2
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +1 -1
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +7 -2
- 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 +1 -1
- package/out/concepts/Process__.js +2 -2
- 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__.js +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js +2 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +1 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Slot__.js +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +4 -0
- package/out/concepts/SqlQueryComponent__.js +16 -0
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -1
- package/out/concepts/StringLiteral__.js +2 -2
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +5 -4
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +1 -1
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +1 -1
- package/out/concepts/SwitchCase__.js +19 -21
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +2 -7
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +2 -2
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +2 -2
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +1 -1
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +9 -4
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +0 -2
- package/out/concepts/View__.js +4 -11
- 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/nasl.auth.js +20 -0
- package/out/concepts/basics/stdlib/nasl.auth.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 +25 -25
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/types/index.d.ts +1 -0
- package/out/concepts/basics/types/index.js +4 -1
- package/out/concepts/basics/types/index.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +3 -1
- package/out/generator/genBundleFiles.js +16 -3
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +1 -0
- package/out/generator/genMetaData.js +7 -0
- 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/server/getLogics.js +18 -0
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +5 -0
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +1 -0
- package/out/server/getProcesses.js +9 -1
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.d.ts +1 -0
- package/out/server/naslServer.js +98 -23
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +21 -3
- 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 +94 -83
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +20 -14
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +13 -6
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +20 -8
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +3 -1
- 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/genGridViewBlock.js +8 -4
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +1 -2
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +20 -21
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genTableBlock.js +14 -6
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +20 -14
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/utils/index.d.ts +1 -0
- package/out/utils/index.js +19 -1
- package/out/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/automate/engine/index.js +21 -7
- package/src/automate/engine/operators.js +114 -17
- package/src/automate/engine/uniqueName.js +77 -9
- package/src/automate/engine/utils.js +4 -2
- package/src/automate/template/process.js +10999 -0
- package/src/bak/translator.js +1 -0
- package/src/common/BaseNode.ts +21 -4
- package/src/concepts/App__.ts +4 -40
- package/src/concepts/Argument__.ts +1 -1
- package/src/concepts/Assignee__.ts +1 -1
- package/src/concepts/Assignment__.ts +1 -1
- package/src/concepts/Attribute__.ts +1 -1
- package/src/concepts/BinaryExpression__.ts +1 -1
- package/src/concepts/BindAttribute__.ts +1 -1
- package/src/concepts/BindDirective__.ts +8 -6
- package/src/concepts/BindEvent__.ts +6 -2
- package/src/concepts/BooleanLiteral__.ts +13 -1
- package/src/concepts/CallFunction__.ts +15 -14
- package/src/concepts/CallInterface__.ts +1 -1
- package/src/concepts/CallLogic__.ts +26 -11
- package/src/concepts/CallQueryComponent__.ts +32 -4
- package/src/concepts/Comment__.ts +1 -1
- package/src/concepts/CompletionProperty__.ts +1 -1
- package/src/concepts/ConfigGroup__.ts +1 -1
- package/src/concepts/ConfigPropertyValue__.ts +1 -1
- package/src/concepts/ConfigProperty__.ts +1 -1
- package/src/concepts/Configuration__.ts +1 -1
- package/src/concepts/Constant__.ts +1 -1
- package/src/concepts/DataElement__.ts +1 -1
- package/src/concepts/DataSource__.ts +2 -0
- package/src/concepts/End__.ts +1 -1
- package/src/concepts/EntityIndex__.ts +1 -1
- package/src/concepts/EntityProperty__.ts +1 -1
- package/src/concepts/Entity__.ts +1 -1
- package/src/concepts/EnumItem__.ts +1 -1
- package/src/concepts/Enum__.ts +1 -1
- package/src/concepts/Event__.ts +1 -1
- package/src/concepts/ForEachStatement__.ts +1 -1
- package/src/concepts/Function__.ts +5 -5
- package/src/concepts/Identifier__.ts +3 -2
- package/src/concepts/IfStatement__.ts +1 -1
- package/src/concepts/InterfaceParam__.ts +1 -1
- package/src/concepts/Interface__.ts +2 -2
- package/src/concepts/JSBlock__.ts +2 -11
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +8 -44
- package/src/concepts/MemberExpression__.ts +1 -1
- package/src/concepts/Module__.ts +141 -147
- package/src/concepts/Namespace__.ts +2 -2
- package/src/concepts/NullLiteral__.ts +1 -1
- package/src/concepts/NumericLiteral__.ts +1 -1
- package/src/concepts/Param__.ts +2 -2
- package/src/concepts/Point__.ts +1 -1
- package/src/concepts/ProcessComponent__.ts +1 -1
- package/src/concepts/ProcessElement__.ts +8 -3
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/Process__.ts +3 -3
- package/src/concepts/QueryAggregateExpression__.ts +1 -1
- package/src/concepts/QueryFieldExpression__.ts +1 -1
- package/src/concepts/QueryFromExpression__.ts +1 -1
- package/src/concepts/QueryGroupByExpression__.ts +1 -1
- package/src/concepts/QueryJoinExpression__.ts +1 -1
- package/src/concepts/QueryLimitExpression__.ts +1 -1
- package/src/concepts/QueryOrderByExpression__.ts +1 -1
- package/src/concepts/QuerySelectExpression__.ts +1 -1
- package/src/concepts/Rect__.ts +1 -1
- package/src/concepts/Return__.ts +2 -2
- package/src/concepts/Role__.ts +1 -1
- package/src/concepts/Slot__.ts +1 -1
- package/src/concepts/SqlQueryComponent__.ts +17 -0
- package/src/concepts/Start__.ts +1 -1
- package/src/concepts/StringLiteral__.ts +2 -2
- package/src/concepts/StructureProperty__.ts +5 -8
- package/src/concepts/Structure__.ts +1 -1
- package/src/concepts/SwitchCase__.ts +19 -23
- package/src/concepts/SwitchStatement__.ts +2 -6
- package/src/concepts/Theme__.ts +1 -1
- package/src/concepts/Transactional__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +21 -2
- package/src/concepts/TypeParam__.ts +1 -1
- package/src/concepts/UnaryExpression__.ts +1 -1
- package/src/concepts/Unparsed__.ts +1 -1
- package/src/concepts/UseComponent__.ts +1 -1
- package/src/concepts/ValidationRule__.ts +1 -1
- package/src/concepts/Variable__.ts +2 -2
- package/src/concepts/ViewComponent__.ts +1 -1
- package/src/concepts/ViewElement__.ts +10 -23
- package/src/concepts/View__.ts +6 -13
- package/src/concepts/WhileStatement__.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.auth.ts +20 -0
- 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 +25 -25
- package/src/concepts/basics/types/index.ts +1 -0
- package/src/generator/genBundleFiles.ts +21 -5
- package/src/generator/genMetaData.ts +10 -1
- package/src/index.ts +1 -1
- package/src/server/getLogics.ts +18 -1
- package/src/server/getMemberIdentifier.ts +4 -0
- package/src/server/getProcesses.ts +8 -1
- package/src/server/naslServer.ts +107 -28
- package/src/server/translator.ts +20 -3
- package/src/service/creator/errHandles.js +6 -0
- package/src/service/storage/init.ts +96 -85
- package/src/templator/genCreateBlock.ts +20 -14
- package/src/templator/genCurdEditMultipleKeyBlock.ts +13 -8
- package/src/templator/genCurdMultipleKeyBlock.ts +20 -9
- package/src/templator/genEditTableBlock.ts +3 -1
- package/src/templator/genEnumSelectBlock.ts +1 -1
- package/src/templator/genGridViewBlock.ts +8 -4
- package/src/templator/genListViewBlock.ts +1 -2
- package/src/templator/genQueryComponent.ts +22 -21
- package/src/templator/genTableBlock.ts +14 -7
- package/src/templator/genUpdateBlock.ts +20 -14
- package/src/utils/index.ts +19 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { App, Module, View, BaseNode, Entity, Structure, Enum, uiStructures, collectionStructures, Logic, Interface, Process } from '../concepts';
|
|
1
|
+
import { App, Module, View, BaseNode, Entity, Structure, Enum, uiStructures, collectionStructures, processStructures, Logic, Interface, Process } from '../concepts';
|
|
2
2
|
import * as utils from '../utils';
|
|
3
3
|
import { genHash, RawOptions } from '.';
|
|
4
4
|
import { compileComponent } from './compileComponent';
|
|
@@ -20,8 +20,8 @@ export interface PageOptions {
|
|
|
20
20
|
hasUserCenter: boolean;
|
|
21
21
|
hasAuth: boolean;
|
|
22
22
|
domainName: string;
|
|
23
|
-
nuimsDomain: string;
|
|
24
23
|
auth: boolean;
|
|
24
|
+
subPage: object;
|
|
25
25
|
documentTitle?: string;
|
|
26
26
|
router: {
|
|
27
27
|
notFound: string;
|
|
@@ -44,8 +44,12 @@ export async function genBundleFiles(app: App,
|
|
|
44
44
|
USER_STATIC_URL: string;
|
|
45
45
|
extendedConfig: string;
|
|
46
46
|
lowcodeDomain: string;
|
|
47
|
+
envLcpDomain: any,
|
|
48
|
+
envNuimsDomain: any,
|
|
47
49
|
appid: string;
|
|
48
50
|
}) {
|
|
51
|
+
const fnNuimsDomain = config?.envNuimsDomain?.[config?.env] || config?.nuimsDomain;
|
|
52
|
+
const fnLowcodeDomain = config?.envLcpDomain?.[config?.env]?.lcpDomain || config?.lowcodeDomain;
|
|
49
53
|
const modules: Module[] = [];
|
|
50
54
|
const views: View[] = [];
|
|
51
55
|
const entities: Entity[] = [];
|
|
@@ -135,8 +139,8 @@ export async function genBundleFiles(app: App,
|
|
|
135
139
|
hasUserCenter: app.hasUserCenter,
|
|
136
140
|
hasAuth: app.hasAuth,
|
|
137
141
|
domainName: app.name,
|
|
138
|
-
nuimsDomain: config.nuimsDomain,
|
|
139
142
|
auth: view.auth,
|
|
143
|
+
subPage: view.children,
|
|
140
144
|
documentTitle: app.documentTitle,
|
|
141
145
|
router: {
|
|
142
146
|
notFound: '/',
|
|
@@ -217,6 +221,14 @@ export async function genBundleFiles(app: App,
|
|
|
217
221
|
});
|
|
218
222
|
}
|
|
219
223
|
|
|
224
|
+
if (Array.isArray(processStructures)) {
|
|
225
|
+
const namespace = 'nasl.process';
|
|
226
|
+
processStructures.forEach((node) => {
|
|
227
|
+
const id = `${namespace}.${node.name}`;
|
|
228
|
+
dataTypesMap[id] = node;
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
220
232
|
if (Array.isArray(logics)) {
|
|
221
233
|
allLogics.push(...logics);
|
|
222
234
|
}
|
|
@@ -252,9 +264,11 @@ export async function genBundleFiles(app: App,
|
|
|
252
264
|
},
|
|
253
265
|
},
|
|
254
266
|
extendedConfig: config.extendedConfig,
|
|
255
|
-
lowcodeDomain:
|
|
267
|
+
lowcodeDomain: fnLowcodeDomain,
|
|
256
268
|
tenant: config.tenant,
|
|
257
269
|
env: config.env,
|
|
270
|
+
nuimsDomain: fnNuimsDomain,
|
|
271
|
+
envNuimsDomain: config.envNuimsDomain,
|
|
258
272
|
indexName,
|
|
259
273
|
}, null, 4);
|
|
260
274
|
|
|
@@ -341,6 +355,8 @@ export async function genBundleFiles(app: App,
|
|
|
341
355
|
tenant: data.tenant,
|
|
342
356
|
env: data.env,
|
|
343
357
|
extendedConfig: data.extendedConfig,
|
|
358
|
+
nuimsDomain: data.nuimsDomain,
|
|
359
|
+
envNuimsDomain: data.envNuimsDomain,
|
|
344
360
|
envConfig: {
|
|
345
361
|
lowcodeDomain: data.lowcodeDomain,
|
|
346
362
|
},
|
|
@@ -350,7 +366,7 @@ export async function genBundleFiles(app: App,
|
|
|
350
366
|
|
|
351
367
|
if (config.env === 'dev') {
|
|
352
368
|
// 加载资源js
|
|
353
|
-
const domain =
|
|
369
|
+
const domain = fnLowcodeDomain.slice(fnLowcodeDomain.indexOf('.') + 1);
|
|
354
370
|
const targetUrl = `${location.origin}/empty?url=${domain}&appid=${config.appid}`;
|
|
355
371
|
const str = `
|
|
356
372
|
if(!document.querySelector("iframe[name='iframeEmpty']")){
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { App, View, BaseNode, Module, Interface, Entity, Structure, Enum, uiStructures, collectionStructures, Logic, Process, DataSource } from '../concepts';
|
|
1
|
+
import { App, View, BaseNode, Module, Interface, Entity, Structure, Enum, uiStructures, collectionStructures, processStructures, Logic, Process, DataSource } from '../concepts';
|
|
2
2
|
|
|
3
3
|
export function genMetaData(app: App,
|
|
4
4
|
config: {
|
|
5
5
|
tenant: string;
|
|
6
6
|
env: string;
|
|
7
7
|
nuimsDomain: string;
|
|
8
|
+
envNuimsDomain: Object;
|
|
8
9
|
STATIC_URL: string;
|
|
9
10
|
USER_STATIC_URL: string;
|
|
10
11
|
extendedConfig: string;
|
|
@@ -127,6 +128,14 @@ export function genMetaData(app: App,
|
|
|
127
128
|
});
|
|
128
129
|
}
|
|
129
130
|
|
|
131
|
+
if (Array.isArray(processStructures)) {
|
|
132
|
+
const namespace = 'nasl.process';
|
|
133
|
+
processStructures.forEach((node) => {
|
|
134
|
+
const id = `${namespace}.${node.name}`;
|
|
135
|
+
dataTypesMap[id] = node;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
130
139
|
if (Array.isArray(logics)) {
|
|
131
140
|
allLogics.push(...logics);
|
|
132
141
|
}
|
package/src/index.ts
CHANGED
|
@@ -8,5 +8,5 @@ export * as genBlock from './templator';
|
|
|
8
8
|
export * as utils from './utils';
|
|
9
9
|
export * from './config';
|
|
10
10
|
export * from './eventBus';
|
|
11
|
-
export { loadApp, loadAppSync } from './service/storage/init';
|
|
11
|
+
export { loadApp, loadAppSync, handleApp } from './service/storage/init';
|
|
12
12
|
import './automate/engine';
|
package/src/server/getLogics.ts
CHANGED
|
@@ -128,12 +128,18 @@ export async function getLogics(node: CallLogic | BindEvent, needAllLogic: boole
|
|
|
128
128
|
});
|
|
129
129
|
tree.expanded = true;
|
|
130
130
|
result.push(tree);
|
|
131
|
-
|
|
132
131
|
const systemTree = new Namespace({
|
|
133
132
|
name: 'category',
|
|
134
133
|
path: `nasl`,
|
|
135
134
|
title: '系统逻辑',
|
|
136
135
|
children: [
|
|
136
|
+
new Namespace({
|
|
137
|
+
name: 'category',
|
|
138
|
+
path: `process`,
|
|
139
|
+
title: '流程逻辑',
|
|
140
|
+
logics: stdlibNamespace.findChild('process').logics,
|
|
141
|
+
expanded: true,
|
|
142
|
+
}),
|
|
137
143
|
new Namespace({
|
|
138
144
|
name: 'category',
|
|
139
145
|
path: `browser`,
|
|
@@ -158,6 +164,8 @@ export async function getLogics(node: CallLogic | BindEvent, needAllLogic: boole
|
|
|
158
164
|
],
|
|
159
165
|
expanded: true,
|
|
160
166
|
});
|
|
167
|
+
if (!app.processes.length)
|
|
168
|
+
systemTree.children.shift();
|
|
161
169
|
|
|
162
170
|
systemTree.expanded = true;
|
|
163
171
|
systemTree.children.forEach((child) => (child.expanded = true));
|
|
@@ -169,6 +177,13 @@ export async function getLogics(node: CallLogic | BindEvent, needAllLogic: boole
|
|
|
169
177
|
path: `nasl`,
|
|
170
178
|
title: '系统逻辑',
|
|
171
179
|
children: [
|
|
180
|
+
new Namespace({
|
|
181
|
+
name: 'category',
|
|
182
|
+
path: `process`,
|
|
183
|
+
title: '流程逻辑',
|
|
184
|
+
logics: stdlibNamespace.findChild('process').logics,
|
|
185
|
+
expanded: true,
|
|
186
|
+
}),
|
|
172
187
|
new Namespace({
|
|
173
188
|
name: 'category',
|
|
174
189
|
path: `configuration`,
|
|
@@ -179,6 +194,8 @@ export async function getLogics(node: CallLogic | BindEvent, needAllLogic: boole
|
|
|
179
194
|
],
|
|
180
195
|
expanded: true,
|
|
181
196
|
});
|
|
197
|
+
if (!app.processes.length)
|
|
198
|
+
systemTree.children.shift();
|
|
182
199
|
|
|
183
200
|
systemTree.expanded = true;
|
|
184
201
|
systemTree.children.forEach((child) => (child.expanded = true));
|
|
@@ -76,6 +76,10 @@ function createType2Annotation(type: string): TypeAnnotation {
|
|
|
76
76
|
typeAnnotation = TypeAnnotation.createReference(types[types.length - 1], {
|
|
77
77
|
typeNamespace: 'nasl.ui',
|
|
78
78
|
});
|
|
79
|
+
} else if (type.startsWith('nasl.process')) {
|
|
80
|
+
typeAnnotation = TypeAnnotation.createReference(types[types.length - 1], {
|
|
81
|
+
typeNamespace: 'nasl.process',
|
|
82
|
+
});
|
|
79
83
|
} else if (type.startsWith('nasl.collection')) {
|
|
80
84
|
typeAnnotation = TypeAnnotation.createGeneric(types[types.length - 1], {
|
|
81
85
|
typeNamespace: 'nasl.collection',
|
|
@@ -536,6 +536,13 @@ export function getFlowAfterElements(el: ProcessElement) {
|
|
|
536
536
|
const links = elems.filter(e => e.type === 'SequenceFlow' && e.sourceRef === processname);
|
|
537
537
|
return links;
|
|
538
538
|
}
|
|
539
|
+
export function getFlowBeforeElements(el: ProcessElement) {
|
|
540
|
+
const process = el.process;
|
|
541
|
+
const processname = el.name;
|
|
542
|
+
const elems = process.elements;
|
|
543
|
+
const links = elems.filter(e => e.type === 'SequenceFlow' && e.targetRef === processname);
|
|
544
|
+
return links;
|
|
545
|
+
}
|
|
539
546
|
|
|
540
547
|
export function isFromStartNode(el: ProcessElement) {
|
|
541
548
|
const process = el.process;
|
|
@@ -587,4 +594,4 @@ export function findNodeAfterNodeInFlow(el: ProcessElement) {
|
|
|
587
594
|
});
|
|
588
595
|
}
|
|
589
596
|
return Array.from(nodeSet);
|
|
590
|
-
}
|
|
597
|
+
}
|
package/src/server/naslServer.ts
CHANGED
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
Variable,
|
|
47
47
|
DataSource,
|
|
48
48
|
Assignee,
|
|
49
|
+
SqlQueryComponent,
|
|
49
50
|
} from '../concepts';
|
|
50
51
|
import { lsp2tspNumber, SourceMap, SourceMapItem, embeddedTSEmitter } from '../translator';
|
|
51
52
|
import axios from '../service/storage';
|
|
@@ -101,6 +102,10 @@ interface QuoteNode {
|
|
|
101
102
|
expanded: boolean;
|
|
102
103
|
children?: QuoteNode[];
|
|
103
104
|
}
|
|
105
|
+
let isChangeInterface = false; //判断是否导入接口
|
|
106
|
+
type ActionNode = { target: Variable; typeannotation: TypeAnnotation };
|
|
107
|
+
let actionArr: Array<ActionNode> = []; //用于导入接口收集更改的节点
|
|
108
|
+
let timer: number = null; //超时器用于收集导入接口相关
|
|
104
109
|
const naslServer = {
|
|
105
110
|
messager,
|
|
106
111
|
worker,
|
|
@@ -495,8 +500,10 @@ const naslServer = {
|
|
|
495
500
|
oldRecord?.semanticDiagnostics.forEach((item) => {
|
|
496
501
|
item.node ? (item.node.tsErrorDetail = undefined) : '';
|
|
497
502
|
});
|
|
498
|
-
|
|
499
503
|
// 语义诊断
|
|
504
|
+
if (isChangeInterface) {
|
|
505
|
+
this.existStructureFix(record.semanticDiagnostics, node as FileNode, this);
|
|
506
|
+
}
|
|
500
507
|
record.semanticDiagnostics = record.semanticDiagnostics
|
|
501
508
|
.map((diag) => this._resolveDiagnostic(diag as unknown as tsProtocol.DiagnosticWithFileName, node as FileNode))
|
|
502
509
|
.filter((diag) => !!diag);
|
|
@@ -521,6 +528,7 @@ const naslServer = {
|
|
|
521
528
|
record.suggestionDiagnostics = [];
|
|
522
529
|
// 语法诊断暂时不需要
|
|
523
530
|
});
|
|
531
|
+
|
|
524
532
|
return records;
|
|
525
533
|
},
|
|
526
534
|
_attachDiagnostics(fileNode: BaseNode): Diagnostic[] {
|
|
@@ -529,8 +537,7 @@ const naslServer = {
|
|
|
529
537
|
traverse((current) => {
|
|
530
538
|
if (current.node.tag) {
|
|
531
539
|
current.node.bindAttrs.forEach((bindAttr) => {
|
|
532
|
-
if ((bindAttr.model || bindAttr.sync)
|
|
533
|
-
&& bindAttr.expression && bindAttr.expression.concept !== 'Identifier' && bindAttr.expression.concept !== 'MemberExpression') {
|
|
540
|
+
if ((bindAttr.model || bindAttr.sync) && bindAttr.expression && bindAttr.expression.concept !== 'Identifier' && bindAttr.expression.concept !== 'MemberExpression') {
|
|
534
541
|
const diagnostic = {
|
|
535
542
|
node: bindAttr,
|
|
536
543
|
severity: 'error',
|
|
@@ -549,7 +556,7 @@ const naslServer = {
|
|
|
549
556
|
const property = dataSourceGroup.getProperty(fileNode.name);
|
|
550
557
|
if (property && property.values) {
|
|
551
558
|
property.values.forEach((propertyValue) => {
|
|
552
|
-
if (!propertyValue.value) {
|
|
559
|
+
if (!propertyValue.value && fileNode.name !== 'defaultDS') {
|
|
553
560
|
const diagnostic = {
|
|
554
561
|
node: fileNode,
|
|
555
562
|
severity: 'error',
|
|
@@ -572,6 +579,62 @@ const naslServer = {
|
|
|
572
579
|
|
|
573
580
|
return diagnostics;
|
|
574
581
|
},
|
|
582
|
+
/* 接口导入查找 */
|
|
583
|
+
existStructureFix(semanticDiagnostics: Diagnostic[], node: FileNode, that: any) {
|
|
584
|
+
let module: Module;
|
|
585
|
+
semanticDiagnostics.map((diag) => {
|
|
586
|
+
const minRange = this._findMinRange(diag as unknown as tsProtocol.DiagnosticWithFileName, node);
|
|
587
|
+
if (diag.text?.includes('has no exported member named')) {
|
|
588
|
+
if (minRange.node instanceof Logic) {
|
|
589
|
+
return null;
|
|
590
|
+
}
|
|
591
|
+
const typeAnnotation = minRange.node instanceof TypeAnnotation ? (minRange.node.upperNode as Variable).typeAnnotation : (minRange.node as Variable).typeAnnotation;
|
|
592
|
+
const regNamespace = /<(\S*)>/;
|
|
593
|
+
const typeKey = (typeAnnotation.typeKey.match(regNamespace) && typeAnnotation.typeKey.match(regNamespace)[1]) || typeAnnotation.typeKey;
|
|
594
|
+
const typeKeyArr = typeKey.split('.');
|
|
595
|
+
if (typeKeyArr[0] === 'apis') {
|
|
596
|
+
const structureName = typeKeyArr[3];
|
|
597
|
+
const moduleName = typeKeyArr[1];
|
|
598
|
+
const app = (typeAnnotation.upperNode as Variable).app;
|
|
599
|
+
if (!app) {
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
module = app.interfaceDependencies?.find((item) => item.name === moduleName);
|
|
603
|
+
let existStructure = module?.structures?.find((item) => item.name.toUpperCase() === structureName.toUpperCase());
|
|
604
|
+
if (!existStructure) {
|
|
605
|
+
const realName = structureName.replace(/\d*$/, (m) => String(''));
|
|
606
|
+
existStructure = module?.structures?.find((item) => item.name.toUpperCase() === realName.toUpperCase());
|
|
607
|
+
}
|
|
608
|
+
if (existStructure) {
|
|
609
|
+
const editTypeAnnotation = JSON.parse(JSON.stringify(typeAnnotation).replace(new RegExp(structureName, 'g'), existStructure.name));
|
|
610
|
+
actionArr.push({ target: typeAnnotation.parentNode as Variable, typeannotation: editTypeAnnotation });
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return null;
|
|
614
|
+
} else {
|
|
615
|
+
return diag;
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
if (actionArr.length) {
|
|
619
|
+
if (timer)
|
|
620
|
+
return;
|
|
621
|
+
timer = window.setTimeout(() => {
|
|
622
|
+
const app = actionArr[0].target.app;
|
|
623
|
+
app.emit('collect:start', {
|
|
624
|
+
actionMsg: '设置导入接口数据类型错误',
|
|
625
|
+
});
|
|
626
|
+
module.isAdd && module.setIsAdd(false);
|
|
627
|
+
actionArr.forEach((item) => {
|
|
628
|
+
item.target.setDataType(TypeAnnotation.from(item.typeannotation));
|
|
629
|
+
});
|
|
630
|
+
app.emit('collect:end');
|
|
631
|
+
actionArr = [];
|
|
632
|
+
isChangeInterface = false;
|
|
633
|
+
clearTimeout(timer);
|
|
634
|
+
timer = null;
|
|
635
|
+
}, 2000);
|
|
636
|
+
}
|
|
637
|
+
},
|
|
575
638
|
_resolveDiagnostic(diagnostic: tsProtocol.DiagnosticWithFileName, fileNode: FileNode): Diagnostic {
|
|
576
639
|
const minRange = this._findMinRange(diagnostic, fileNode);
|
|
577
640
|
const tsErrorDetail = {
|
|
@@ -684,7 +747,7 @@ const naslServer = {
|
|
|
684
747
|
const entity = this.file2NodeMap.get(item.file);
|
|
685
748
|
const { currentSource } = naslServer.getCurrentSource(entity);
|
|
686
749
|
// 32 8个函数的总行数
|
|
687
|
-
if (item.end.line <
|
|
750
|
+
if (item.end.line < currentSource.range.end.line - 32 && item.start.line > 1) {
|
|
688
751
|
flag = true;
|
|
689
752
|
}
|
|
690
753
|
}
|
|
@@ -976,19 +1039,19 @@ const naslServer = {
|
|
|
976
1039
|
// logic 和 views名称修改 可能会触发bindEvent修改
|
|
977
1040
|
if (minRange.node instanceof BindEvent) {
|
|
978
1041
|
// 页面逻辑直接赋值就可以, 因为是相对路径
|
|
979
|
-
if (
|
|
1042
|
+
if (node instanceof ViewElement) {
|
|
980
1043
|
minRange.setTypeMethods = 'setCalleeNamespace';
|
|
981
1044
|
minRange.newValue = 'elements.' + newValue + '.logics';
|
|
982
1045
|
} else {
|
|
983
1046
|
/**
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1047
|
+
* 如果namespce是 'app.views.Student.views.404.views.505.views.update'
|
|
1048
|
+
* 在ts中会是'app.views.Student.views.$404.views.$505.views.update'
|
|
1049
|
+
* 但是505 要改名为 666 ,要存的是666
|
|
1050
|
+
* 'app.views.Student.views.404.views.666.views.update'
|
|
1051
|
+
* 1.取到转后的
|
|
1052
|
+
* 2.在匹配到的内容中取转后的namespace的位置
|
|
1053
|
+
* 3.然后把namespace中的 $替换成 ''
|
|
1054
|
+
*/
|
|
992
1055
|
const tsCalleeNamespace = minRange.node.tsCalleeNamespace;
|
|
993
1056
|
const oldValue = tsCalleeNamespace;
|
|
994
1057
|
|
|
@@ -1082,6 +1145,8 @@ const naslServer = {
|
|
|
1082
1145
|
minRange.setTypeMethods = 'setRelationNamespace';
|
|
1083
1146
|
const newValue = setTypeNamespace(minRange.node.relationNamespace, record);
|
|
1084
1147
|
minRange.newValue = newValue;
|
|
1148
|
+
} else if (minRange.node instanceof SqlQueryComponent) {
|
|
1149
|
+
minRange.setTypeMethods = 'setDataSource';
|
|
1085
1150
|
}
|
|
1086
1151
|
}
|
|
1087
1152
|
if (minRange.node instanceof QueryGroupByExpression && node instanceof Entity) {
|
|
@@ -1099,7 +1164,10 @@ const naslServer = {
|
|
|
1099
1164
|
}
|
|
1100
1165
|
|
|
1101
1166
|
// 如果跳转链接或者页面变量同一个param和TypeAnnotation 有两个过滤掉一个
|
|
1102
|
-
if (
|
|
1167
|
+
if (
|
|
1168
|
+
(minRange.node instanceof Param || minRange.node instanceof Variable || minRange.node instanceof Return)
|
|
1169
|
+
&& (node instanceof Entity || node instanceof Enum || node instanceof Structure)
|
|
1170
|
+
) {
|
|
1103
1171
|
return null;
|
|
1104
1172
|
}
|
|
1105
1173
|
if (minRange.node instanceof Destination && (node instanceof Process || node instanceof ProcessElement)) {
|
|
@@ -1138,7 +1206,7 @@ const naslServer = {
|
|
|
1138
1206
|
/**
|
|
1139
1207
|
* 这里过滤一下,一些查找引用,重复的内容,直接屏蔽掉,防止操作重复
|
|
1140
1208
|
* 因为在生成的时候 ,可能弄了一些副作用的引用
|
|
1141
|
-
|
|
1209
|
+
*/
|
|
1142
1210
|
// 本来是想在上面过滤一把的先放到这里匹配这两个的时候 就会找到
|
|
1143
1211
|
// refsList = refsList.filter((item) => {
|
|
1144
1212
|
// 屏蔽组件查找查到定义这里,也过滤一下
|
|
@@ -1153,7 +1221,7 @@ const naslServer = {
|
|
|
1153
1221
|
* 流程改名不触发Logic改名
|
|
1154
1222
|
* 如果是修改param查找到logic就不操作
|
|
1155
1223
|
* 除非想在内部修改别的内容所以暂时屏蔽掉
|
|
1156
|
-
|
|
1224
|
+
*/
|
|
1157
1225
|
if (minRange.node instanceof Logic && node !== minRange.node) {
|
|
1158
1226
|
return null;
|
|
1159
1227
|
}
|
|
@@ -1180,11 +1248,11 @@ const naslServer = {
|
|
|
1180
1248
|
if (minRange) {
|
|
1181
1249
|
// 如果找到节点是callLogic就去更新
|
|
1182
1250
|
if (minRange.node instanceof CallLogic && node instanceof Param) {
|
|
1183
|
-
minRange.node.setCalleeArgName(
|
|
1251
|
+
minRange.node.setCalleeArgName(parantNode as Logic);
|
|
1184
1252
|
}
|
|
1185
1253
|
// 如果节点参数增加页面也要更新
|
|
1186
1254
|
if (minRange.node instanceof Destination && node instanceof Param) {
|
|
1187
|
-
minRange.node.setViewArgument(
|
|
1255
|
+
minRange.node.setViewArgument(parantNode as View);
|
|
1188
1256
|
}
|
|
1189
1257
|
}
|
|
1190
1258
|
});
|
|
@@ -1202,12 +1270,12 @@ const naslServer = {
|
|
|
1202
1270
|
parentNode: parantNode,
|
|
1203
1271
|
parentKey: node.parentKey,
|
|
1204
1272
|
});
|
|
1205
|
-
naslServer._addParamsEffect(refsList,
|
|
1273
|
+
naslServer._addParamsEffect(refsList, node as Param);
|
|
1206
1274
|
// 结束修改 ,批量操作
|
|
1207
1275
|
App.emit('collect:end');
|
|
1208
1276
|
return node;
|
|
1209
1277
|
}
|
|
1210
|
-
naslServer._addParamsEffect(refsList,
|
|
1278
|
+
naslServer._addParamsEffect(refsList, node as Param);
|
|
1211
1279
|
return node;
|
|
1212
1280
|
},
|
|
1213
1281
|
// 查找引用
|
|
@@ -1215,10 +1283,10 @@ const naslServer = {
|
|
|
1215
1283
|
let refsList = await naslServer._isHaveRef(node);
|
|
1216
1284
|
// 如果查找引用查到自己里面的引用不展示
|
|
1217
1285
|
refsList = refsList.filter((item) =>
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
!item.isDefinition && !
|
|
1286
|
+
// 自己引用自己的过滤掉
|
|
1287
|
+
// 删除的时候过滤一把组件删除提示
|
|
1288
|
+
// 展示组件自己屏蔽掉
|
|
1289
|
+
!item.isDefinition && !item.lineText.includes(' = new nasl.ui.'));
|
|
1222
1290
|
// 最后返回的结果
|
|
1223
1291
|
let result = new Map();
|
|
1224
1292
|
// 树的构造,key: 一个file的node, 值是 [[logic, params],[logic, returns]]
|
|
@@ -1379,7 +1447,14 @@ const naslServer = {
|
|
|
1379
1447
|
// 如果没有sourceMap,就继续向上找 ,或者到module结束
|
|
1380
1448
|
// 如果 节点找到 app 或者module 停止 或者entity找到DataSource为止
|
|
1381
1449
|
// 如果当前节点是view就不要向上查找了
|
|
1382
|
-
while (
|
|
1450
|
+
while (
|
|
1451
|
+
!sourceMap
|
|
1452
|
+
&& fileNode
|
|
1453
|
+
&& !(fileNode.parentNode instanceof App)
|
|
1454
|
+
&& !(fileNode.parentNode instanceof Module)
|
|
1455
|
+
&& !(fileNode.parentNode instanceof DataSource)
|
|
1456
|
+
&& !(fileNode instanceof View)
|
|
1457
|
+
) {
|
|
1383
1458
|
fileNode = fileNode.parentNode;
|
|
1384
1459
|
sourceMap = fileNode?.sourceMap;
|
|
1385
1460
|
}
|
|
@@ -1584,6 +1659,7 @@ async function incidentalAction(action: string, fileNode: BaseNode, targetNode:
|
|
|
1584
1659
|
for (let i = 0; i < fileNodeChildren.length; i++) {
|
|
1585
1660
|
const fileNodeItem = fileNodeChildren[i];
|
|
1586
1661
|
const result = (fileNodeItem as FileNode).toEmbeddedTSFile();
|
|
1662
|
+
fileNodeItem.sourceMap = result.sourceMap;
|
|
1587
1663
|
if (action === 'create') {
|
|
1588
1664
|
await handleChange(fileNodeItem, fileNodeItem, result, action);
|
|
1589
1665
|
await incidentalAction(action, fileNodeItem, fileNodeItem);
|
|
@@ -1602,7 +1678,10 @@ async function incidentalAction(action: string, fileNode: BaseNode, targetNode:
|
|
|
1602
1678
|
// 删除或新增模块
|
|
1603
1679
|
// 需要把下面的哦内容全部都更新一遍
|
|
1604
1680
|
if (fileNode instanceof Module) {
|
|
1605
|
-
|
|
1681
|
+
if (fileNode.type === 'interface' && fileNode.isAdd && action === 'create') {
|
|
1682
|
+
isChangeInterface = true;
|
|
1683
|
+
}
|
|
1684
|
+
const module: Module = targetNode as Module;
|
|
1606
1685
|
const results: Array<ReturnType<Structure['toEmbeddedTSFile']>> = [];
|
|
1607
1686
|
naslServer.contentToFile(module, results);
|
|
1608
1687
|
for (let i = 0; i < results.length; i++) {
|
|
@@ -1629,7 +1708,7 @@ async function incidentalAction(action: string, fileNode: BaseNode, targetNode:
|
|
|
1629
1708
|
* DataSource只会重命名时候,需要把子集全部重新生成一下
|
|
1630
1709
|
*/
|
|
1631
1710
|
if (fileNode instanceof DataSource) {
|
|
1632
|
-
(fileNode as DataSource).entities.forEach(async(entity) => {
|
|
1711
|
+
(fileNode as DataSource).entities.forEach(async (entity) => {
|
|
1633
1712
|
try {
|
|
1634
1713
|
const result = entity.toEmbeddedTSFile();
|
|
1635
1714
|
const parentPath = oldpath.replace('.ts', '/');
|
package/src/server/translator.ts
CHANGED
|
@@ -360,6 +360,8 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
|
|
|
360
360
|
return null;
|
|
361
361
|
} else if (text.startsWith(`Namespace 'nasl.ui' has no exported member `)) {
|
|
362
362
|
return null;
|
|
363
|
+
} else if (text.startsWith(`Function expression, which lacks return-type annotation, implicitly has an 'any[]' return type.`)) {
|
|
364
|
+
return null;
|
|
363
365
|
}
|
|
364
366
|
}
|
|
365
367
|
// 处理bindevent参数没传递的报错
|
|
@@ -369,20 +371,35 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
|
|
|
369
371
|
return null;
|
|
370
372
|
}
|
|
371
373
|
|
|
372
|
-
if (node instanceof ProcessElement && (node.type === 'UserTask' || node.type === 'AutoTask')) {
|
|
374
|
+
if (node instanceof ProcessElement && (node.type === 'UserTask' || node.type === 'AutoTask' || node.type === 'StartNoneEvent')) {
|
|
375
|
+
const reg = /Expected (.+?) arguments, but got (.+?)./.exec(text);
|
|
373
376
|
let u = '用户任务';
|
|
374
377
|
if(node.type === 'AutoTask') {
|
|
375
378
|
u = '自动任务';
|
|
376
379
|
}
|
|
377
|
-
|
|
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
|
+
}
|
|
378
389
|
}
|
|
379
390
|
|
|
380
391
|
if (node instanceof ProcessElement && (node.type === 'ExclusiveGateway' || node.type === 'ParallelGateway')) {
|
|
392
|
+
const reg = /Expected (.+?) arguments, but got (.+?)./.exec(text);
|
|
381
393
|
let u = '排他网关';
|
|
382
394
|
if(node.type === 'ParallelGateway') {
|
|
383
395
|
u = '并行网关';
|
|
384
396
|
}
|
|
385
|
-
|
|
397
|
+
if(reg[2] === '0') {
|
|
398
|
+
tsErrorDetail.message = `${u}出口顺序流和入口顺序流个数不能等于0`;
|
|
399
|
+
} else {
|
|
400
|
+
tsErrorDetail.message = `${u}出口顺序流和入口顺序流个数同时等于1,该${u}没有意义`;
|
|
401
|
+
}
|
|
402
|
+
|
|
386
403
|
}
|
|
387
404
|
}
|
|
388
405
|
|
|
@@ -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],
|