@lcap/nasl 1.0.2 → 2.12.0

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.
Files changed (299) hide show
  1. package/out/automate/engine/index.d.ts +1 -0
  2. package/out/automate/engine/index.js +34 -12
  3. package/out/automate/engine/index.js.map +1 -1
  4. package/out/automate/engine/operators.d.ts +10 -2
  5. package/out/automate/engine/operators.js +105 -7
  6. package/out/automate/engine/operators.js.map +1 -1
  7. package/out/automate/engine/uniqueName.d.ts +8 -2
  8. package/out/automate/engine/uniqueName.js +72 -4
  9. package/out/automate/engine/uniqueName.js.map +1 -1
  10. package/out/automate/engine/utils.d.ts +1 -0
  11. package/out/automate/engine/utils.js +92 -67
  12. package/out/automate/engine/utils.js.map +1 -1
  13. package/out/automate/template/process.d.ts +9 -0
  14. package/out/automate/template/process.js +10976 -0
  15. package/out/automate/template/process.js.map +1 -0
  16. package/out/bak/translator.js +1 -0
  17. package/out/bak/translator.js.map +1 -1
  18. package/out/common/BaseNode.d.ts +5 -0
  19. package/out/common/BaseNode.js +24 -3
  20. package/out/common/BaseNode.js.map +1 -1
  21. package/out/concepts/App__.d.ts +51 -49
  22. package/out/concepts/App__.js +86 -53
  23. package/out/concepts/App__.js.map +1 -1
  24. package/out/concepts/BindAttribute__.js +2 -2
  25. package/out/concepts/BindAttribute__.js.map +1 -1
  26. package/out/concepts/BindDirective__.js +10 -3
  27. package/out/concepts/BindDirective__.js.map +1 -1
  28. package/out/concepts/BindEvent__.js +15 -6
  29. package/out/concepts/BindEvent__.js.map +1 -1
  30. package/out/concepts/BooleanLiteral__.d.ts +4 -0
  31. package/out/concepts/BooleanLiteral__.js +11 -0
  32. package/out/concepts/BooleanLiteral__.js.map +1 -1
  33. package/out/concepts/CallFunction__.js +8 -2
  34. package/out/concepts/CallFunction__.js.map +1 -1
  35. package/out/concepts/CallLogic__.js +48 -30
  36. package/out/concepts/CallLogic__.js.map +1 -1
  37. package/out/concepts/CallQueryComponent__.d.ts +8 -7
  38. package/out/concepts/CallQueryComponent__.js +86 -76
  39. package/out/concepts/CallQueryComponent__.js.map +1 -1
  40. package/out/concepts/Comment__.js +1 -1
  41. package/out/concepts/Comment__.js.map +1 -1
  42. package/out/concepts/ConfigGroup__.d.ts +1 -0
  43. package/out/concepts/ConfigGroup__.js +7 -0
  44. package/out/concepts/ConfigGroup__.js.map +1 -1
  45. package/out/concepts/ConfigProperty__.d.ts +1 -0
  46. package/out/concepts/ConfigProperty__.js +3 -0
  47. package/out/concepts/ConfigProperty__.js.map +1 -1
  48. package/out/concepts/Configuration__.d.ts +1 -0
  49. package/out/concepts/Configuration__.js +3 -0
  50. package/out/concepts/Configuration__.js.map +1 -1
  51. package/out/concepts/DataSource__.d.ts +143 -0
  52. package/out/concepts/DataSource__.js +318 -0
  53. package/out/concepts/DataSource__.js.map +1 -0
  54. package/out/concepts/Destination__.js +8 -8
  55. package/out/concepts/Destination__.js.map +1 -1
  56. package/out/concepts/End__.js +2 -2
  57. package/out/concepts/End__.js.map +1 -1
  58. package/out/concepts/EntityIndex__.d.ts +5 -0
  59. package/out/concepts/EntityIndex__.js +6 -0
  60. package/out/concepts/EntityIndex__.js.map +1 -1
  61. package/out/concepts/EntityProperty__.d.ts +9 -0
  62. package/out/concepts/EntityProperty__.js +19 -2
  63. package/out/concepts/EntityProperty__.js.map +1 -1
  64. package/out/concepts/Entity__.d.ts +5 -0
  65. package/out/concepts/Entity__.js +20 -10
  66. package/out/concepts/Entity__.js.map +1 -1
  67. package/out/concepts/Enum__.js +12 -6
  68. package/out/concepts/Enum__.js.map +1 -1
  69. package/out/concepts/ForEachStatement__.js +2 -2
  70. package/out/concepts/ForEachStatement__.js.map +1 -1
  71. package/out/concepts/Function__.d.ts +18 -0
  72. package/out/concepts/Function__.js +96 -1
  73. package/out/concepts/Function__.js.map +1 -1
  74. package/out/concepts/Identifier__.js +6 -15
  75. package/out/concepts/Identifier__.js.map +1 -1
  76. package/out/concepts/IfStatement__.js +8 -8
  77. package/out/concepts/IfStatement__.js.map +1 -1
  78. package/out/concepts/Interface__.js +19 -12
  79. package/out/concepts/Interface__.js.map +1 -1
  80. package/out/concepts/JSBlock__.js +3 -5
  81. package/out/concepts/JSBlock__.js.map +1 -1
  82. package/out/concepts/Logic__.js +44 -44
  83. package/out/concepts/Logic__.js.map +1 -1
  84. package/out/concepts/Module__.d.ts +116 -194
  85. package/out/concepts/Module__.js +31 -114
  86. package/out/concepts/Module__.js.map +1 -1
  87. package/out/concepts/Namespace__.d.ts +0 -86
  88. package/out/concepts/Namespace__.js +1 -108
  89. package/out/concepts/Namespace__.js.map +1 -1
  90. package/out/concepts/Param__.d.ts +2 -1
  91. package/out/concepts/Param__.js +1 -1
  92. package/out/concepts/Param__.js.map +1 -1
  93. package/out/concepts/ProcessElement__.js +30 -10
  94. package/out/concepts/ProcessElement__.js.map +1 -1
  95. package/out/concepts/Process__.d.ts +1 -1
  96. package/out/concepts/Process__.js +17 -10
  97. package/out/concepts/Process__.js.map +1 -1
  98. package/out/concepts/QueryFieldExpression__.js +8 -1
  99. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  100. package/out/concepts/QueryFromExpression__.d.ts +4 -0
  101. package/out/concepts/QueryFromExpression__.js +13 -2
  102. package/out/concepts/QueryFromExpression__.js.map +1 -1
  103. package/out/concepts/QueryJoinExpression__.d.ts +4 -0
  104. package/out/concepts/QueryJoinExpression__.js +14 -3
  105. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  106. package/out/concepts/Return__.js +1 -1
  107. package/out/concepts/Return__.js.map +1 -1
  108. package/out/concepts/Role__.js +10 -3
  109. package/out/concepts/Role__.js.map +1 -1
  110. package/out/concepts/SqlQueryComponent__.d.ts +14 -0
  111. package/out/concepts/SqlQueryComponent__.js +48 -5
  112. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  113. package/out/concepts/StringLiteral__.d.ts +1 -1
  114. package/out/concepts/StringLiteral__.js +1 -1
  115. package/out/concepts/StructureProperty__.js +6 -5
  116. package/out/concepts/StructureProperty__.js.map +1 -1
  117. package/out/concepts/Structure__.js +19 -12
  118. package/out/concepts/Structure__.js.map +1 -1
  119. package/out/concepts/SwitchCase__.d.ts +1 -1
  120. package/out/concepts/SwitchCase__.js +23 -25
  121. package/out/concepts/SwitchCase__.js.map +1 -1
  122. package/out/concepts/SwitchStatement__.js +1 -6
  123. package/out/concepts/SwitchStatement__.js.map +1 -1
  124. package/out/concepts/TypeAnnotation__.d.ts +8 -0
  125. package/out/concepts/TypeAnnotation__.js +44 -2
  126. package/out/concepts/TypeAnnotation__.js.map +1 -1
  127. package/out/concepts/Variable__.js +1 -1
  128. package/out/concepts/Variable__.js.map +1 -1
  129. package/out/concepts/ViewElement__.js +25 -20
  130. package/out/concepts/ViewElement__.js.map +1 -1
  131. package/out/concepts/View__.d.ts +0 -2
  132. package/out/concepts/View__.js +27 -32
  133. package/out/concepts/View__.js.map +1 -1
  134. package/out/concepts/WhileStatement__.js +4 -4
  135. package/out/concepts/WhileStatement__.js.map +1 -1
  136. package/out/concepts/basics/stdlib/nasl.auth.js +20 -0
  137. package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
  138. package/out/concepts/basics/stdlib/nasl.process.d.ts +4 -0
  139. package/out/concepts/basics/stdlib/nasl.process.js +410 -0
  140. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
  141. package/out/concepts/basics/stdlib/nasl.ui.js +1 -11
  142. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  143. package/out/concepts/basics/stdlib/nasl.util.js +280 -2
  144. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  145. package/out/concepts/basics/types/index.d.ts +1 -0
  146. package/out/concepts/basics/types/index.js +4 -1
  147. package/out/concepts/basics/types/index.js.map +1 -1
  148. package/out/concepts/index__.d.ts +1 -0
  149. package/out/concepts/index__.js +1 -0
  150. package/out/concepts/index__.js.map +1 -1
  151. package/out/generator/genBundleFiles.d.ts +3 -1
  152. package/out/generator/genBundleFiles.js +23 -5
  153. package/out/generator/genBundleFiles.js.map +1 -1
  154. package/out/generator/genMetaData.d.ts +1 -0
  155. package/out/generator/genMetaData.js +20 -12
  156. package/out/generator/genMetaData.js.map +1 -1
  157. package/out/index.d.ts +1 -1
  158. package/out/index.js +2 -1
  159. package/out/index.js.map +1 -1
  160. package/out/server/createUiTs.js +1 -0
  161. package/out/server/createUiTs.js.map +1 -1
  162. package/out/server/getLogics.js +27 -1
  163. package/out/server/getLogics.js.map +1 -1
  164. package/out/server/getMemberIdentifier.js +5 -0
  165. package/out/server/getMemberIdentifier.js.map +1 -1
  166. package/out/server/getProcesses.d.ts +4 -0
  167. package/out/server/getProcesses.js +69 -1
  168. package/out/server/getProcesses.js.map +1 -1
  169. package/out/server/naslServer.d.ts +1 -0
  170. package/out/server/naslServer.js +223 -26
  171. package/out/server/naslServer.js.map +1 -1
  172. package/out/server/process2LogicNamespace.js +10 -1
  173. package/out/server/process2LogicNamespace.js.map +1 -1
  174. package/out/server/translator.js +37 -1
  175. package/out/server/translator.js.map +1 -1
  176. package/out/service/creator/errHandles.js +5 -0
  177. package/out/service/creator/errHandles.js.map +1 -1
  178. package/out/service/storage/init.d.ts +1 -0
  179. package/out/service/storage/init.js +95 -84
  180. package/out/service/storage/init.js.map +1 -1
  181. package/out/templator/genCreateBlock.js +34 -24
  182. package/out/templator/genCreateBlock.js.map +1 -1
  183. package/out/templator/genCurdEditMultipleKeyBlock.js +28 -18
  184. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  185. package/out/templator/genCurdMultipleKeyBlock.js +45 -29
  186. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  187. package/out/templator/genEditTableBlock.js +15 -13
  188. package/out/templator/genEditTableBlock.js.map +1 -1
  189. package/out/templator/genEnumSelectBlock.js +1 -1
  190. package/out/templator/genEnumSelectBlock.js.map +1 -1
  191. package/out/templator/genGridViewBlock.js +29 -24
  192. package/out/templator/genGridViewBlock.js.map +1 -1
  193. package/out/templator/genListViewBlock.js +7 -5
  194. package/out/templator/genListViewBlock.js.map +1 -1
  195. package/out/templator/genQueryComponent.js +25 -26
  196. package/out/templator/genQueryComponent.js.map +1 -1
  197. package/out/templator/genSelectBlock.js +8 -7
  198. package/out/templator/genSelectBlock.js.map +1 -1
  199. package/out/templator/genTableBlock.js +31 -21
  200. package/out/templator/genTableBlock.js.map +1 -1
  201. package/out/templator/genUpdateBlock.js +34 -24
  202. package/out/templator/genUpdateBlock.js.map +1 -1
  203. package/out/templator/utils.d.ts +2 -2
  204. package/out/templator/utils.js.map +1 -1
  205. package/out/test/integration/connect-file.js +6 -6
  206. package/out/test/integration/connect-file.js.map +1 -1
  207. package/out/translator/index.js +1 -1
  208. package/out/translator/index.js.map +1 -1
  209. package/out/utils/index.d.ts +5 -0
  210. package/out/utils/index.js +50 -1
  211. package/out/utils/index.js.map +1 -1
  212. package/package.json +1 -1
  213. package/src/automate/engine/index.js +33 -8
  214. package/src/automate/engine/operators.js +114 -17
  215. package/src/automate/engine/uniqueName.js +77 -9
  216. package/src/automate/engine/utils.js +95 -68
  217. package/src/automate/template/process.js +10999 -0
  218. package/src/bak/translator.js +1 -0
  219. package/src/common/BaseNode.ts +21 -4
  220. package/src/concepts/App__.ts +128 -94
  221. package/src/concepts/BindAttribute__.ts +2 -2
  222. package/src/concepts/BindDirective__.ts +9 -7
  223. package/src/concepts/BindEvent__.ts +14 -6
  224. package/src/concepts/BooleanLiteral__.ts +12 -0
  225. package/src/concepts/CallFunction__.ts +6 -2
  226. package/src/concepts/CallLogic__.ts +47 -32
  227. package/src/concepts/CallQueryComponent__.ts +92 -81
  228. package/src/concepts/Comment__.ts +1 -1
  229. package/src/concepts/ConfigGroup__.ts +3 -1
  230. package/src/concepts/ConfigProperty__.ts +4 -0
  231. package/src/concepts/Configuration__.ts +3 -0
  232. package/src/concepts/DataSource__.ts +391 -0
  233. package/src/concepts/Destination__.ts +24 -8
  234. package/src/concepts/End__.ts +2 -2
  235. package/src/concepts/EntityIndex__.ts +7 -0
  236. package/src/concepts/EntityProperty__.ts +20 -2
  237. package/src/concepts/Entity__.ts +23 -11
  238. package/src/concepts/Enum__.ts +25 -6
  239. package/src/concepts/ForEachStatement__.ts +2 -2
  240. package/src/concepts/Function__.ts +95 -1
  241. package/src/concepts/Identifier__.ts +15 -15
  242. package/src/concepts/IfStatement__.ts +9 -9
  243. package/src/concepts/Interface__.ts +20 -12
  244. package/src/concepts/JSBlock__.ts +3 -12
  245. package/src/concepts/Logic__.ts +45 -79
  246. package/src/concepts/Module__.ts +141 -342
  247. package/src/concepts/Namespace__.ts +1 -204
  248. package/src/concepts/Param__.ts +3 -2
  249. package/src/concepts/ProcessElement__.ts +33 -12
  250. package/src/concepts/Process__.ts +18 -12
  251. package/src/concepts/QueryFieldExpression__.ts +9 -1
  252. package/src/concepts/QueryFromExpression__.ts +13 -2
  253. package/src/concepts/QueryJoinExpression__.ts +14 -3
  254. package/src/concepts/Return__.ts +1 -1
  255. package/src/concepts/Role__.ts +10 -4
  256. package/src/concepts/SqlQueryComponent__.ts +47 -11
  257. package/src/concepts/StringLiteral__.ts +1 -1
  258. package/src/concepts/StructureProperty__.ts +6 -9
  259. package/src/concepts/Structure__.ts +19 -11
  260. package/src/concepts/SwitchCase__.ts +23 -27
  261. package/src/concepts/SwitchStatement__.ts +1 -5
  262. package/src/concepts/TypeAnnotation__.ts +43 -2
  263. package/src/concepts/Variable__.ts +1 -1
  264. package/src/concepts/ViewElement__.ts +26 -39
  265. package/src/concepts/View__.ts +29 -34
  266. package/src/concepts/WhileStatement__.ts +4 -4
  267. package/src/concepts/basics/stdlib/nasl.auth.ts +20 -0
  268. package/src/concepts/basics/stdlib/nasl.process.ts +406 -0
  269. package/src/concepts/basics/stdlib/nasl.ui.ts +1 -11
  270. package/src/concepts/basics/stdlib/nasl.util.ts +281 -2
  271. package/src/concepts/basics/types/index.ts +1 -0
  272. package/src/concepts/index__.ts +1 -0
  273. package/src/generator/genBundleFiles.ts +28 -7
  274. package/src/generator/genMetaData.ts +22 -13
  275. package/src/index.ts +1 -1
  276. package/src/server/createUiTs.ts +1 -0
  277. package/src/server/getLogics.ts +29 -4
  278. package/src/server/getMemberIdentifier.ts +4 -0
  279. package/src/server/getProcesses.ts +68 -0
  280. package/src/server/naslServer.ts +227 -30
  281. package/src/server/process2LogicNamespace.ts +29 -19
  282. package/src/server/translator.ts +39 -1
  283. package/src/service/creator/errHandles.js +6 -0
  284. package/src/service/storage/init.ts +97 -86
  285. package/src/templator/genCreateBlock.ts +35 -26
  286. package/src/templator/genCurdEditMultipleKeyBlock.ts +29 -21
  287. package/src/templator/genCurdMultipleKeyBlock.ts +46 -31
  288. package/src/templator/genEditTableBlock.ts +17 -14
  289. package/src/templator/genEnumSelectBlock.ts +1 -1
  290. package/src/templator/genGridViewBlock.ts +30 -25
  291. package/src/templator/genListViewBlock.ts +10 -7
  292. package/src/templator/genQueryComponent.ts +28 -27
  293. package/src/templator/genSelectBlock.ts +9 -8
  294. package/src/templator/genTableBlock.ts +32 -23
  295. package/src/templator/genUpdateBlock.ts +35 -25
  296. package/src/templator/utils.ts +2 -2
  297. package/src/test/integration/connect-file.ts +6 -6
  298. package/src/translator/index.ts +1 -1
  299. package/src/utils/index.ts +51 -0
@@ -527,3 +527,71 @@ export function getProcessVariableSuggestionsAll(node: ProcessElement) {
527
527
  }
528
528
  return processVariables;
529
529
  }
530
+
531
+
532
+ export function getFlowAfterElements(el: ProcessElement) {
533
+ const process = el.process;
534
+ const processname = el.name;
535
+ const elems = process.elements;
536
+ const links = elems.filter(e => e.type === 'SequenceFlow' && e.sourceRef === processname);
537
+ return links;
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
+ }
546
+
547
+ export function isFromStartNode(el: ProcessElement) {
548
+ const process = el.process;
549
+ // const processname = el.name;
550
+ const elems = process.elements;
551
+ const set = new WeakSet();
552
+ const stack = [el];
553
+ while(stack.length){
554
+ let t = stack.shift();
555
+ let name = t.name;
556
+ if(t.type === 'StartNoneEvent') {
557
+ return true;
558
+ }
559
+ elems.forEach(e => {
560
+ if(e.type === 'SequenceFlow'
561
+ && e.targetRef === name
562
+ && !set.has(e)) {
563
+ set.add(e);
564
+ const sourcename = e.sourceRef;
565
+ const source = elems.find(e => e.name === sourcename);
566
+ stack.push(source);
567
+ }
568
+ });
569
+ }
570
+ return false;
571
+ }
572
+
573
+ export function findNodeAfterNodeInFlow(el: ProcessElement) {
574
+ const process = el.process;
575
+ const elems = process.elements;
576
+ const set = new WeakSet();
577
+ const nodeSet = new Set();
578
+ const stack = [el];
579
+ while(stack.length){
580
+ let t = stack.shift();
581
+ if(el !== t) {
582
+ nodeSet.add(t);
583
+ }
584
+ const name = t.name;
585
+ elems.forEach(e => {
586
+ if(e.type === 'SequenceFlow'
587
+ && e.sourceRef === name
588
+ && !set.has(e)) {
589
+ set.add(e);
590
+ const targetname = e.targetRef;
591
+ const source = elems.find(e => e.name === targetname);
592
+ stack.push(source);
593
+ }
594
+ });
595
+ }
596
+ return Array.from(nodeSet);
597
+ }
@@ -44,7 +44,9 @@ import {
44
44
  Namespace,
45
45
  Theme,
46
46
  Variable,
47
+ DataSource,
47
48
  Assignee,
49
+ SqlQueryComponent,
48
50
  } from '../concepts';
49
51
  import { lsp2tspNumber, SourceMap, SourceMapItem, embeddedTSEmitter } from '../translator';
50
52
  import axios from '../service/storage';
@@ -100,6 +102,10 @@ interface QuoteNode {
100
102
  expanded: boolean;
101
103
  children?: QuoteNode[];
102
104
  }
105
+ let isChangeInterface = false; //判断是否导入接口
106
+ type ActionNode = { target: Variable; typeannotation: TypeAnnotation };
107
+ let actionArr: Array<ActionNode> = []; //用于导入接口收集更改的节点
108
+ let timer: number = null; //超时器用于收集导入接口相关
103
109
  const naslServer = {
104
110
  messager,
105
111
  worker,
@@ -142,17 +148,30 @@ const naslServer = {
142
148
  console.log(err);
143
149
  }
144
150
  });
145
- module.entities.forEach((entity) => {
151
+ (module as App).dataSources?.forEach((dataSource) => {
152
+ // 本身dataSource也要生成一个文件用于改名
146
153
  try {
147
- const result = entity.toEmbeddedTSFile();
154
+ const result = dataSource.toEmbeddedTSFile();
148
155
  results.push(result);
149
156
  // sourceMap都存在目录级别内容下,在页面层级下去找
150
- entity.sourceMap = result.sourceMap;
151
- this.file2NodeMap.set(result.filePath, entity);
157
+ dataSource.sourceMap = result.sourceMap;
158
+ this.file2NodeMap.set(result.filePath, dataSource);
152
159
  } catch (err) {
153
160
  console.log(err);
154
161
  }
162
+ dataSource.entities.forEach((entity) => {
163
+ try {
164
+ const result = entity.toEmbeddedTSFile();
165
+ results.push(result);
166
+ // sourceMap都存在目录级别内容下,在页面层级下去找
167
+ entity.sourceMap = result.sourceMap;
168
+ this.file2NodeMap.set(result.filePath, entity);
169
+ } catch (err) {
170
+ console.log(err);
171
+ }
172
+ });
155
173
  });
174
+
156
175
  module.interfaces.forEach((_interface) => {
157
176
  try {
158
177
  const result = _interface.toEmbeddedTSFile();
@@ -481,8 +500,10 @@ const naslServer = {
481
500
  oldRecord?.semanticDiagnostics.forEach((item) => {
482
501
  item.node ? (item.node.tsErrorDetail = undefined) : '';
483
502
  });
484
-
485
503
  // 语义诊断
504
+ if (isChangeInterface) {
505
+ this.existStructureFix(record.semanticDiagnostics, node as FileNode, this);
506
+ }
486
507
  record.semanticDiagnostics = record.semanticDiagnostics
487
508
  .map((diag) => this._resolveDiagnostic(diag as unknown as tsProtocol.DiagnosticWithFileName, node as FileNode))
488
509
  .filter((diag) => !!diag);
@@ -507,6 +528,7 @@ const naslServer = {
507
528
  record.suggestionDiagnostics = [];
508
529
  // 语法诊断暂时不需要
509
530
  });
531
+
510
532
  return records;
511
533
  },
512
534
  _attachDiagnostics(fileNode: BaseNode): Diagnostic[] {
@@ -515,8 +537,7 @@ const naslServer = {
515
537
  traverse((current) => {
516
538
  if (current.node.tag) {
517
539
  current.node.bindAttrs.forEach((bindAttr) => {
518
- if ((bindAttr.model || bindAttr.sync)
519
- && 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') {
520
541
  const diagnostic = {
521
542
  node: bindAttr,
522
543
  severity: 'error',
@@ -529,9 +550,91 @@ const naslServer = {
529
550
  }
530
551
  }, { node: { children: fileNode.elements } as ViewElement });
531
552
  }
553
+ if (fileNode instanceof DataSource) {
554
+ const dataSourceGroup = (fileNode.rootNode as App).configuration?.getGroup('dataSource');
555
+ if (dataSourceGroup) {
556
+ const property = dataSourceGroup.getProperty(fileNode.name);
557
+ if (property && property.values) {
558
+ property.values.forEach((propertyValue) => {
559
+ if (!propertyValue.value && fileNode.name !== 'defaultDS') {
560
+ const diagnostic = {
561
+ node: fileNode,
562
+ severity: 'error',
563
+ message: `数据源配置:数据源${property.name}${propertyValue.env === 'dev' ? '开发环境' : '生产环境'}未配置数据信息`,
564
+ // 保留原来的内容方便查询一些问题
565
+ originalDiagnostic: {
566
+ fileName: '',
567
+ start: <any>null,
568
+ end: <any>null,
569
+ category: 'error',
570
+ text: `Data Source is not config`,
571
+ },
572
+ };
573
+ diagnostics.push(diagnostic);
574
+ }
575
+ });
576
+ }
577
+ }
578
+ }
532
579
 
533
580
  return diagnostics;
534
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
+ },
535
638
  _resolveDiagnostic(diagnostic: tsProtocol.DiagnosticWithFileName, fileNode: FileNode): Diagnostic {
536
639
  const minRange = this._findMinRange(diagnostic, fileNode);
537
640
  const tsErrorDetail = {
@@ -625,6 +728,33 @@ const naslServer = {
625
728
  }
626
729
  }
627
730
 
731
+ // 如果是DataSource就需要在单独,查一边来修改名字
732
+ if (node instanceof DataSource) {
733
+ // 过滤一把不需要改的信息
734
+ refsList = refsList.filter((item) => {
735
+ const dataSourceFile = (fileNode as FileNode).getEmbeddedFilePath();
736
+ const entityFilePrefix = dataSourceFile.replace('.ts', '');
737
+ /**
738
+ * 特殊处理,因为关联属性或者关联实体等等都是在实体里,在实体中因为自己不可以是自己的类型
739
+ * 所以全部过滤掉了,
740
+ * 但是在datasource里面在实体里会有大量的引用,不需要全部修改.只需要处理除了8个函数之外的引用
741
+ * 所以底部内容是8个函数,所以这里就 用entity的行数 减去8个函数的行数,然后其余的在进行处理
742
+ * 进行过滤
743
+ */
744
+ // 不要数据源下面的实体里的引用 ,保留原始的节点内容
745
+ let flag = false;
746
+ if (item.file.includes(entityFilePrefix)) {
747
+ const entity = this.file2NodeMap.get(item.file);
748
+ const { currentSource } = naslServer.getCurrentSource(entity);
749
+ // 32 8个函数的总行数
750
+ if (item.end.line < currentSource.range.end.line - 32 && item.start.line > 1) {
751
+ flag = true;
752
+ }
753
+ }
754
+ // 属于实体而且需要修改和查到 || 不是实体前缀的 || 他本身
755
+ return flag || !item.file.includes(entityFilePrefix) || dataSourceFile === item.file;
756
+ });
757
+ }
628
758
  // 如果是entity就需要在单独,查一边来修改名字
629
759
  if (node instanceof Entity) {
630
760
  // 过滤一把不需要改的信息
@@ -909,19 +1039,19 @@ const naslServer = {
909
1039
  // logic 和 views名称修改 可能会触发bindEvent修改
910
1040
  if (minRange.node instanceof BindEvent) {
911
1041
  // 页面逻辑直接赋值就可以, 因为是相对路径
912
- if ((node instanceof ViewElement)) {
1042
+ if (node instanceof ViewElement) {
913
1043
  minRange.setTypeMethods = 'setCalleeNamespace';
914
1044
  minRange.newValue = 'elements.' + newValue + '.logics';
915
1045
  } else {
916
1046
  /**
917
- * 如果namespce是 'app.views.Student.views.404.views.505.views.update'
918
- * 在ts中会是'app.views.Student.views.$404.views.$505.views.update'
919
- * 但是505 要改名为 666 ,要存的是666
920
- * 'app.views.Student.views.404.views.666.views.update'
921
- * 1.取到转后的
922
- * 2.在匹配到的内容中取转后的namespace的位置
923
- * 3.然后把namespace中的 $替换成 ''
924
- */
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
+ */
925
1055
  const tsCalleeNamespace = minRange.node.tsCalleeNamespace;
926
1056
  const oldValue = tsCalleeNamespace;
927
1057
 
@@ -983,6 +1113,42 @@ const naslServer = {
983
1113
  if (minRange.node instanceof QueryFieldExpression && node instanceof Entity) {
984
1114
  minRange.setTypeMethods = 'setEntityAsName';
985
1115
  }
1116
+ // 如果修改的是dataSource字段
1117
+ if (node instanceof DataSource) {
1118
+ const setTypeNamespace = (typeNamespace: string, record: any) => {
1119
+ // 先看下标位置
1120
+ const lineText = record.lineText;
1121
+ const index = lineText.indexOf(typeNamespace);
1122
+ // 在把开始结束位置的-开始位置,来知道是哪里要替换
1123
+ const start = record.start.offset - index - 1;
1124
+ const end = record.end.offset - index - 1;
1125
+ // 新的完整的value
1126
+ const newTextValue = typeNamespace.substring(0, start) + newValue + typeNamespace.substring(end, typeNamespace.length);
1127
+ minRange.newValue = newTextValue;
1128
+ return newTextValue;
1129
+ };
1130
+ if (minRange.node instanceof TypeAnnotation) {
1131
+ minRange.setTypeMethods = 'setTypeNamespace';
1132
+ const newValue = setTypeNamespace(minRange.node.typeNamespace, record);
1133
+ minRange.newValue = newValue;
1134
+ } else if (minRange.node instanceof QueryFromExpression || minRange.node instanceof QueryJoinExpression) {
1135
+ minRange.setTypeMethods = 'setEntityNamespace';
1136
+ const newValue = setTypeNamespace(minRange.node.entityNamespace, record);
1137
+ minRange.newValue = newValue;
1138
+ } else if (minRange.node instanceof QueryFieldExpression) {
1139
+ return null;
1140
+ } else if (minRange.node instanceof CallLogic) {
1141
+ minRange.setTypeMethods = 'setCalleeNamespace';
1142
+ const newValue = setTypeNamespace(minRange.node.calleeNamespace, record);
1143
+ minRange.newValue = newValue;
1144
+ } else if (minRange.node instanceof EntityProperty) {
1145
+ minRange.setTypeMethods = 'setRelationNamespace';
1146
+ const newValue = setTypeNamespace(minRange.node.relationNamespace, record);
1147
+ minRange.newValue = newValue;
1148
+ } else if (minRange.node instanceof SqlQueryComponent) {
1149
+ minRange.setTypeMethods = 'setDataSource';
1150
+ }
1151
+ }
986
1152
  if (minRange.node instanceof QueryGroupByExpression && node instanceof Entity) {
987
1153
  minRange.setTypeMethods = 'setEntityAsName';
988
1154
  }
@@ -998,7 +1164,10 @@ const naslServer = {
998
1164
  }
999
1165
 
1000
1166
  // 如果跳转链接或者页面变量同一个param和TypeAnnotation 有两个过滤掉一个
1001
- if ((minRange.node instanceof Param || minRange.node instanceof Variable || minRange.node instanceof Return) && (node instanceof Entity || node instanceof Enum || node instanceof Structure)) {
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
+ ) {
1002
1171
  return null;
1003
1172
  }
1004
1173
  if (minRange.node instanceof Destination && (node instanceof Process || node instanceof ProcessElement)) {
@@ -1037,7 +1206,7 @@ const naslServer = {
1037
1206
  /**
1038
1207
  * 这里过滤一下,一些查找引用,重复的内容,直接屏蔽掉,防止操作重复
1039
1208
  * 因为在生成的时候 ,可能弄了一些副作用的引用
1040
- */
1209
+ */
1041
1210
  // 本来是想在上面过滤一把的先放到这里匹配这两个的时候 就会找到
1042
1211
  // refsList = refsList.filter((item) => {
1043
1212
  // 屏蔽组件查找查到定义这里,也过滤一下
@@ -1052,7 +1221,7 @@ const naslServer = {
1052
1221
  * 流程改名不触发Logic改名
1053
1222
  * 如果是修改param查找到logic就不操作
1054
1223
  * 除非想在内部修改别的内容所以暂时屏蔽掉
1055
- */
1224
+ */
1056
1225
  if (minRange.node instanceof Logic && node !== minRange.node) {
1057
1226
  return null;
1058
1227
  }
@@ -1079,11 +1248,11 @@ const naslServer = {
1079
1248
  if (minRange) {
1080
1249
  // 如果找到节点是callLogic就去更新
1081
1250
  if (minRange.node instanceof CallLogic && node instanceof Param) {
1082
- minRange.node.setCalleeArgName((parantNode) as Logic);
1251
+ minRange.node.setCalleeArgName(parantNode as Logic);
1083
1252
  }
1084
1253
  // 如果节点参数增加页面也要更新
1085
1254
  if (minRange.node instanceof Destination && node instanceof Param) {
1086
- minRange.node.setViewArgument((parantNode) as View);
1255
+ minRange.node.setViewArgument(parantNode as View);
1087
1256
  }
1088
1257
  }
1089
1258
  });
@@ -1101,12 +1270,12 @@ const naslServer = {
1101
1270
  parentNode: parantNode,
1102
1271
  parentKey: node.parentKey,
1103
1272
  });
1104
- naslServer._addParamsEffect(refsList, (node) as Param);
1273
+ naslServer._addParamsEffect(refsList, node as Param);
1105
1274
  // 结束修改 ,批量操作
1106
1275
  App.emit('collect:end');
1107
1276
  return node;
1108
1277
  }
1109
- naslServer._addParamsEffect(refsList, (node) as Param);
1278
+ naslServer._addParamsEffect(refsList, node as Param);
1110
1279
  return node;
1111
1280
  },
1112
1281
  // 查找引用
@@ -1114,10 +1283,10 @@ const naslServer = {
1114
1283
  let refsList = await naslServer._isHaveRef(node);
1115
1284
  // 如果查找引用查到自己里面的引用不展示
1116
1285
  refsList = refsList.filter((item) =>
1117
- // 自己引用自己的过滤掉
1118
- // 删除的时候过滤一把组件删除提示
1119
- // 展示组件自己屏蔽掉
1120
- !item.isDefinition && !(item.lineText.includes(' = new nasl.ui.')));
1286
+ // 自己引用自己的过滤掉
1287
+ // 删除的时候过滤一把组件删除提示
1288
+ // 展示组件自己屏蔽掉
1289
+ !item.isDefinition && !item.lineText.includes(' = new nasl.ui.'));
1121
1290
  // 最后返回的结果
1122
1291
  let result = new Map();
1123
1292
  // 树的构造,key: 一个file的node, 值是 [[logic, params],[logic, returns]]
@@ -1276,8 +1445,16 @@ const naslServer = {
1276
1445
  let sourceMap = node.sourceMap;
1277
1446
  let fileNode = node;
1278
1447
  // 如果没有sourceMap,就继续向上找 ,或者到module结束
1279
- // 如果 节点找到 app 或者module 停止
1280
- while (!sourceMap && fileNode && !(fileNode.parentNode instanceof App) && !(fileNode.parentNode instanceof Module) && !(fileNode instanceof View)) {
1448
+ // 如果 节点找到 app 或者module 停止 或者entity找到DataSource为止
1449
+ // 如果当前节点是view就不要向上查找了
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
+ ) {
1281
1458
  fileNode = fileNode.parentNode;
1282
1459
  sourceMap = fileNode?.sourceMap;
1283
1460
  }
@@ -1482,6 +1659,7 @@ async function incidentalAction(action: string, fileNode: BaseNode, targetNode:
1482
1659
  for (let i = 0; i < fileNodeChildren.length; i++) {
1483
1660
  const fileNodeItem = fileNodeChildren[i];
1484
1661
  const result = (fileNodeItem as FileNode).toEmbeddedTSFile();
1662
+ fileNodeItem.sourceMap = result.sourceMap;
1485
1663
  if (action === 'create') {
1486
1664
  await handleChange(fileNodeItem, fileNodeItem, result, action);
1487
1665
  await incidentalAction(action, fileNodeItem, fileNodeItem);
@@ -1500,7 +1678,10 @@ async function incidentalAction(action: string, fileNode: BaseNode, targetNode:
1500
1678
  // 删除或新增模块
1501
1679
  // 需要把下面的哦内容全部都更新一遍
1502
1680
  if (fileNode instanceof Module) {
1503
- const module: Module = (targetNode) as Module;
1681
+ if (fileNode.type === 'interface' && fileNode.isAdd && action === 'create') {
1682
+ isChangeInterface = true;
1683
+ }
1684
+ const module: Module = targetNode as Module;
1504
1685
  const results: Array<ReturnType<Structure['toEmbeddedTSFile']>> = [];
1505
1686
  naslServer.contentToFile(module, results);
1506
1687
  for (let i = 0; i < results.length; i++) {
@@ -1523,6 +1704,22 @@ async function incidentalAction(action: string, fileNode: BaseNode, targetNode:
1523
1704
  }
1524
1705
  }
1525
1706
  }
1707
+ /**
1708
+ * DataSource只会重命名时候,需要把子集全部重新生成一下
1709
+ */
1710
+ if (fileNode instanceof DataSource) {
1711
+ (fileNode as DataSource).entities.forEach(async (entity) => {
1712
+ try {
1713
+ const result = entity.toEmbeddedTSFile();
1714
+ const parentPath = oldpath.replace('.ts', '/');
1715
+ const currentOldPath = parentPath + '/entities/' + entity.name + '.ts';
1716
+ // 因为重命名这里只有当前修改父级的 旧名称, 所以他的子集也要根据旧名称去查依赖 更新内容
1717
+ await handleRename(entity, entity, result, currentOldPath);
1718
+ } catch (err) {
1719
+ console.log(err);
1720
+ }
1721
+ });
1722
+ }
1526
1723
  }
1527
1724
  }
1528
1725
 
@@ -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
  }
@@ -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上,
@@ -427,7 +465,7 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
427
465
  tsErrorDetail.message = '调用函数:参数不能为空!';
428
466
  } else if ((node instanceof Argument && node.parentNode instanceof CallLogic) || node instanceof CallLogic) {
429
467
  tsErrorDetail.message = '调用逻辑:参数不能为空!';
430
- } else if (node instanceof ProcessOutcome) {
468
+ } else if (node instanceof ProcessOutcome || node instanceof Function) {
431
469
  tsErrorDetail.message = (node as any).constructor.nodeTitle + ':不能为空!';
432
470
  } else if (node instanceof Argument || node instanceof TypeAnnotation) {
433
471
  let str = tsErrorDetail.message;