@lcap/nasl 2.22.0-beta.0 → 2.22.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.
Files changed (276) hide show
  1. package/out/automate/engine/operators.d.ts +9 -0
  2. package/out/automate/engine/viewCache.d.ts +1 -0
  3. package/out/automate/template/myProcess.d.ts +1 -0
  4. package/out/common/BaseNode.d.ts +1 -0
  5. package/out/common/BaseNode.js +7 -1
  6. package/out/common/BaseNode.js.map +1 -1
  7. package/out/common/Command.d.ts +1 -1
  8. package/out/common/EventEmitter.d.ts +1 -1
  9. package/out/concepts/Abort__.js.map +1 -1
  10. package/out/concepts/Anchor__.js.map +1 -1
  11. package/out/concepts/AnonymousFunction__.js.map +1 -1
  12. package/out/concepts/App__.d.ts +22 -0
  13. package/out/concepts/App__.js +78 -12
  14. package/out/concepts/App__.js.map +1 -1
  15. package/out/concepts/Argument__.js.map +1 -1
  16. package/out/concepts/Assignee__.js.map +1 -1
  17. package/out/concepts/AssignmentLine__.js.map +1 -1
  18. package/out/concepts/Assignment__.js.map +1 -1
  19. package/out/concepts/Attribute__.js.map +1 -1
  20. package/out/concepts/BatchAssignment__.js.map +1 -1
  21. package/out/concepts/BinaryExpression__.js.map +1 -1
  22. package/out/concepts/BindAttribute__.js.map +1 -1
  23. package/out/concepts/BindDirective__.js.map +1 -1
  24. package/out/concepts/BindEvent__.js.map +1 -1
  25. package/out/concepts/BindStyle__.js.map +1 -1
  26. package/out/concepts/BooleanLiteral__.js.map +1 -1
  27. package/out/concepts/CallFunction__.js.map +1 -1
  28. package/out/concepts/CallInterface__.js +9 -1
  29. package/out/concepts/CallInterface__.js.map +1 -1
  30. package/out/concepts/CallLogic__.js +2 -1
  31. package/out/concepts/CallLogic__.js.map +1 -1
  32. package/out/concepts/CallQueryComponent__.d.ts +2 -0
  33. package/out/concepts/CallQueryComponent__.js +76 -24
  34. package/out/concepts/CallQueryComponent__.js.map +1 -1
  35. package/out/concepts/Comment__.js.map +1 -1
  36. package/out/concepts/CompletionProperty__.js.map +1 -1
  37. package/out/concepts/ConfigGroup__.js.map +1 -1
  38. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  39. package/out/concepts/ConfigProperty__.d.ts +4 -0
  40. package/out/concepts/ConfigProperty__.js +18 -1
  41. package/out/concepts/ConfigProperty__.js.map +1 -1
  42. package/out/concepts/Configuration__.js.map +1 -1
  43. package/out/concepts/Constant__.js.map +1 -1
  44. package/out/concepts/DataElement__.js.map +1 -1
  45. package/out/concepts/DataSource__.js.map +1 -1
  46. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
  47. package/out/concepts/Destination__.js +2 -2
  48. package/out/concepts/Destination__.js.map +1 -1
  49. package/out/concepts/End__.js.map +1 -1
  50. package/out/concepts/EntityIndex__.d.ts +1 -1
  51. package/out/concepts/EntityIndex__.js.map +1 -1
  52. package/out/concepts/EntityProperty__.d.ts +7 -2
  53. package/out/concepts/EntityProperty__.js +100 -1
  54. package/out/concepts/EntityProperty__.js.map +1 -1
  55. package/out/concepts/Entity__.d.ts +2 -1
  56. package/out/concepts/Entity__.js +30 -1
  57. package/out/concepts/Entity__.js.map +1 -1
  58. package/out/concepts/EnumItem__.js.map +1 -1
  59. package/out/concepts/Enum__.js.map +1 -1
  60. package/out/concepts/Event__.js.map +1 -1
  61. package/out/concepts/ExternalDestination__.js.map +1 -1
  62. package/out/concepts/ForEachStatement__.js.map +1 -1
  63. package/out/concepts/FrontendLibrary__.js.map +1 -1
  64. package/out/concepts/Frontend__.js.map +1 -1
  65. package/out/concepts/Function__.js.map +1 -1
  66. package/out/concepts/Identifier__.js +7 -0
  67. package/out/concepts/Identifier__.js.map +1 -1
  68. package/out/concepts/IfStatement__.js +2 -2
  69. package/out/concepts/IfStatement__.js.map +1 -1
  70. package/out/concepts/Integration__.d.ts +53 -0
  71. package/out/concepts/Integration__.js +143 -0
  72. package/out/concepts/Integration__.js.map +1 -0
  73. package/out/concepts/InterfaceParam__.js.map +1 -1
  74. package/out/concepts/Interface__.js.map +1 -1
  75. package/out/concepts/JSBlock__.js.map +1 -1
  76. package/out/concepts/JavaLogic__.d.ts +42 -0
  77. package/out/concepts/JavaLogic__.js +122 -0
  78. package/out/concepts/JavaLogic__.js.map +1 -0
  79. package/out/concepts/LogicItem__.d.ts +1 -1
  80. package/out/concepts/LogicItem__.js.map +1 -1
  81. package/out/concepts/Logic__.js +12 -7
  82. package/out/concepts/Logic__.js.map +1 -1
  83. package/out/concepts/MatchCase__.js.map +1 -1
  84. package/out/concepts/Match__.js +11 -6
  85. package/out/concepts/Match__.js.map +1 -1
  86. package/out/concepts/MemberExpression__.js +1 -1
  87. package/out/concepts/MemberExpression__.js.map +1 -1
  88. package/out/concepts/MicroApp__.d.ts +51 -0
  89. package/out/concepts/MicroApp__.js +113 -0
  90. package/out/concepts/MicroApp__.js.map +1 -0
  91. package/out/concepts/Module__.d.ts +20 -9
  92. package/out/concepts/Module__.js +72 -14
  93. package/out/concepts/Module__.js.map +1 -1
  94. package/out/concepts/Namespace__.js.map +1 -1
  95. package/out/concepts/NewComposite__.d.ts +1 -1
  96. package/out/concepts/NewComposite__.js +25 -11
  97. package/out/concepts/NewComposite__.js.map +1 -1
  98. package/out/concepts/NewList__.js.map +1 -1
  99. package/out/concepts/NewMap__.js.map +1 -1
  100. package/out/concepts/New__.js.map +1 -1
  101. package/out/concepts/NullLiteral__.js.map +1 -1
  102. package/out/concepts/NumericLiteral__.js.map +1 -1
  103. package/out/concepts/OqlQueryComponent__.js +1 -1
  104. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  105. package/out/concepts/Param__.d.ts +1 -0
  106. package/out/concepts/Param__.js +5 -0
  107. package/out/concepts/Param__.js.map +1 -1
  108. package/out/concepts/Point__.js.map +1 -1
  109. package/out/concepts/ProcessComponent__.js.map +1 -1
  110. package/out/concepts/ProcessElement__.js.map +1 -1
  111. package/out/concepts/ProcessOutcome__.js.map +1 -1
  112. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  113. package/out/concepts/Process__.js.map +1 -1
  114. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  115. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  116. package/out/concepts/QueryFromExpression__.js.map +1 -1
  117. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  118. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  119. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  120. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  121. package/out/concepts/QuerySelectExpression__.d.ts +104 -16
  122. package/out/concepts/QuerySelectExpression__.js +99 -9
  123. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  124. package/out/concepts/Rect__.js.map +1 -1
  125. package/out/concepts/Return__.js.map +1 -1
  126. package/out/concepts/Role__.js.map +1 -1
  127. package/out/concepts/SelectMembers__.js.map +1 -1
  128. package/out/concepts/Slot__.js.map +1 -1
  129. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  130. package/out/concepts/Start__.js.map +1 -1
  131. package/out/concepts/StringInterpolation__.js.map +1 -1
  132. package/out/concepts/StringLiteral__.js.map +1 -1
  133. package/out/concepts/StructureProperty__.js.map +1 -1
  134. package/out/concepts/Structure__.js.map +1 -1
  135. package/out/concepts/SwitchCase__.js +2 -2
  136. package/out/concepts/SwitchCase__.js.map +1 -1
  137. package/out/concepts/SwitchStatement__.js.map +1 -1
  138. package/out/concepts/Theme__.js.map +1 -1
  139. package/out/concepts/Transactional__.js.map +1 -1
  140. package/out/concepts/TypeAnnotation__.js +8 -3
  141. package/out/concepts/TypeAnnotation__.js.map +1 -1
  142. package/out/concepts/TypeParam__.js.map +1 -1
  143. package/out/concepts/UnaryExpression__.js.map +1 -1
  144. package/out/concepts/Unparsed__.js.map +1 -1
  145. package/out/concepts/UseComponent__.js.map +1 -1
  146. package/out/concepts/ValidationRule__.js.map +1 -1
  147. package/out/concepts/Variable__.js.map +1 -1
  148. package/out/concepts/ViewBlock__.js.map +1 -1
  149. package/out/concepts/ViewComponent__.js.map +1 -1
  150. package/out/concepts/ViewElement__.js +26 -6
  151. package/out/concepts/ViewElement__.js.map +1 -1
  152. package/out/concepts/View__.d.ts +1 -1
  153. package/out/concepts/View__.js +3 -1
  154. package/out/concepts/View__.js.map +1 -1
  155. package/out/concepts/WhileStatement__.js.map +1 -1
  156. package/out/concepts/basics/stdlib/nasl.ui.js +15 -0
  157. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  158. package/out/concepts/basics/stdlib/nasl.util.js +94 -0
  159. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  160. package/out/concepts/index__.d.ts +3 -0
  161. package/out/concepts/index__.js +3 -0
  162. package/out/concepts/index__.js.map +1 -1
  163. package/out/config.d.ts +1 -1
  164. package/out/decorators/index.d.ts +2 -2
  165. package/out/generator/genBundleFiles.js +20 -3
  166. package/out/generator/genBundleFiles.js.map +1 -1
  167. package/out/generator/genReleaseBody.js +2 -2
  168. package/out/generator/genReleaseBody.js.map +1 -1
  169. package/out/generator/icestark.d.ts +2 -0
  170. package/out/generator/icestark.js +48 -0
  171. package/out/generator/icestark.js.map +1 -0
  172. package/out/generator/microApp.d.ts +2 -0
  173. package/out/generator/microApp.js +35 -0
  174. package/out/generator/microApp.js.map +1 -0
  175. package/out/generator/permission.d.ts +1 -1
  176. package/out/generator/permission.js +0 -13
  177. package/out/generator/permission.js.map +1 -1
  178. package/out/generator/qiankun.d.ts +2 -0
  179. package/out/generator/qiankun.js +52 -0
  180. package/out/generator/qiankun.js.map +1 -0
  181. package/out/index.d.ts +1 -0
  182. package/out/index.js +1 -0
  183. package/out/index.js.map +1 -1
  184. package/out/manager/stepRecorder.d.ts +20 -0
  185. package/out/manager/stepRecorder.js +110 -0
  186. package/out/manager/stepRecorder.js.map +1 -0
  187. package/out/sentry/index.d.ts +5 -4
  188. package/out/sentry/index.js +9 -2
  189. package/out/sentry/index.js.map +1 -1
  190. package/out/server/formatTsUtils.d.ts +1 -1
  191. package/out/server/formatTsUtils.js +40 -14
  192. package/out/server/formatTsUtils.js.map +1 -1
  193. package/out/server/getLogics.js +38 -6
  194. package/out/server/getLogics.js.map +1 -1
  195. package/out/server/getMemberIdentifier.js +5 -4
  196. package/out/server/getMemberIdentifier.js.map +1 -1
  197. package/out/server/getProcesses.d.ts +3 -3
  198. package/out/server/getScope.d.ts +1 -1
  199. package/out/server/naslServer.d.ts +7 -3
  200. package/out/server/naslServer.js +270 -102
  201. package/out/server/naslServer.js.map +1 -1
  202. package/out/server/translator.js +25 -7
  203. package/out/server/translator.js.map +1 -1
  204. package/out/service/storage/init.d.ts +3 -3
  205. package/out/service/storage/init.js +6 -0
  206. package/out/service/storage/init.js.map +1 -1
  207. package/out/templator/genCreateBlock.js +6 -1
  208. package/out/templator/genCreateBlock.js.map +1 -1
  209. package/out/templator/genQueryComponent.js +20 -6
  210. package/out/templator/genQueryComponent.js.map +1 -1
  211. package/out/templator/genUpdateBlock.js +7 -1
  212. package/out/templator/genUpdateBlock.js.map +1 -1
  213. package/out/templator/utils.d.ts +16 -0
  214. package/out/templator/utils.js +2 -0
  215. package/out/templator/utils.js.map +1 -1
  216. package/out/translator/index.d.ts +1 -1
  217. package/out/translator/lsp.d.ts +3 -3
  218. package/out/utils/index.d.ts +4 -4
  219. package/package.json +1 -1
  220. package/sandbox/stdlib/nasl.ui.ts +16 -11
  221. package/sandbox/stdlib/nasl.util.ts +4 -0
  222. package/sandbox/stdlib/nasl.validation.ts +2 -2
  223. package/src/automate/upgrader/2.17.js +1 -1
  224. package/src/common/BaseNode.ts +10 -2
  225. package/src/concepts/App__.ts +90 -46
  226. package/src/concepts/CallInterface__.ts +9 -1
  227. package/src/concepts/CallLogic__.ts +2 -1
  228. package/src/concepts/CallQueryComponent__.ts +73 -82
  229. package/src/concepts/ConfigProperty__.ts +18 -1
  230. package/src/concepts/Destination__.ts +2 -20
  231. package/src/concepts/EntityProperty__.ts +102 -8
  232. package/src/concepts/Entity__.ts +31 -8
  233. package/src/concepts/Identifier__.ts +9 -2
  234. package/src/concepts/IfStatement__.ts +2 -2
  235. package/src/concepts/Integration__.ts +162 -0
  236. package/src/concepts/JavaLogic__.ts +129 -0
  237. package/src/concepts/LogicItem__.ts +1 -1
  238. package/src/concepts/Logic__.ts +12 -45
  239. package/src/concepts/Match__.ts +10 -5
  240. package/src/concepts/MemberExpression__.ts +1 -1
  241. package/src/concepts/MicroApp__.ts +118 -0
  242. package/src/concepts/Module__.ts +106 -79
  243. package/src/concepts/NewComposite__.ts +23 -11
  244. package/src/concepts/OqlQueryComponent__.ts +1 -1
  245. package/src/concepts/Param__.ts +3 -0
  246. package/src/concepts/QueryFieldExpression__.ts +0 -7
  247. package/src/concepts/QuerySelectExpression__.ts +206 -30
  248. package/src/concepts/SwitchCase__.ts +2 -2
  249. package/src/concepts/TypeAnnotation__.ts +8 -42
  250. package/src/concepts/ViewElement__.ts +24 -6
  251. package/src/concepts/View__.ts +3 -24
  252. package/src/concepts/basics/stdlib/nasl.ui.ts +15 -0
  253. package/src/concepts/basics/stdlib/nasl.util.ts +94 -0
  254. package/src/concepts/index__.ts +3 -0
  255. package/src/generator/genBundleFiles.ts +22 -4
  256. package/src/generator/genReleaseBody.ts +2 -2
  257. package/src/generator/icestark.ts +45 -0
  258. package/src/generator/microApp.ts +32 -0
  259. package/src/generator/permission.ts +1 -15
  260. package/src/generator/qiankun.ts +49 -0
  261. package/src/index.ts +1 -0
  262. package/src/manager/stepRecorder.ts +112 -0
  263. package/src/sentry/index.ts +8 -2
  264. package/src/server/formatTsUtils.ts +42 -14
  265. package/src/server/getLogics.ts +41 -6
  266. package/src/server/getMemberIdentifier.ts +5 -4
  267. package/src/server/naslServer.ts +270 -101
  268. package/src/server/translator.ts +25 -7
  269. package/src/service/storage/init.ts +7 -0
  270. package/src/templator/genCreateBlock.ts +6 -1
  271. package/src/templator/genQueryComponent.ts +22 -8
  272. package/src/templator/genUpdateBlock.ts +7 -1
  273. package/src/templator/utils.ts +2 -0
  274. package/ts-worker/src/index.js +1 -4
  275. package/src/manager/history.ts +0 -0
  276. package/src/manager/problem.ts +0 -0
@@ -5,6 +5,7 @@ const moduleNameSpace = {
5
5
  componentDependencies: 'components',
6
6
  };
7
7
  type ModuleKeyType = 'dependencies' | 'interfaceDependencies' | 'componentDependencies';
8
+ import ConfigProperty from './ConfigProperty__';
8
9
  //================================================================================
9
10
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
10
11
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -85,7 +86,7 @@ export class Module extends BaseNode {
85
86
  * 外部语言依赖
86
87
  */
87
88
  @property()
88
- compilerInfoMap: { java?: Array<{ packageName: string,className:string,naslName: string, type: string,javaTypes:any }> } = undefined;
89
+ compilerInfoMap: { java?: Array<{ packageName: string, className:string, naslName: string, type: string, javaTypes:any }> } = undefined;
89
90
 
90
91
  /**
91
92
  * 数据源列表
@@ -181,9 +182,8 @@ export class Module extends BaseNode {
181
182
  }
182
183
  return params;
183
184
  }
184
-
185
185
 
186
- getDataSourceExistingNames(excludedList: Array<DataSource> = []) {
186
+ getDataSourceExistingNames(excludedList: Array<DataSource> = []) {
187
187
  const excludedSet = new Set(excludedList);
188
188
  return ((this.dataSources as DataSource[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
189
189
  }
@@ -324,7 +324,6 @@ export class Module extends BaseNode {
324
324
  return node;
325
325
  }
326
326
 
327
-
328
327
  getStructureExistingNames(excludedList: Array<Structure> = []) {
329
328
  const excludedSet = new Set(excludedList);
330
329
  return ((this.structures as Structure[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -466,7 +465,6 @@ export class Module extends BaseNode {
466
465
  return node;
467
466
  }
468
467
 
469
-
470
468
  getEnumExistingNames(excludedList: Array<Enum> = []) {
471
469
  const excludedSet = new Set(excludedList);
472
470
  return ((this.enums as Enum[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -608,7 +606,6 @@ export class Module extends BaseNode {
608
606
  return node;
609
607
  }
610
608
 
611
-
612
609
  getLogicExistingNames(excludedList: Array<Logic> = []) {
613
610
  const excludedSet = new Set(excludedList);
614
611
  return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -750,7 +747,6 @@ export class Module extends BaseNode {
750
747
  return node;
751
748
  }
752
749
 
753
-
754
750
  getInterfaceExistingNames(excludedList: Array<Interface> = []) {
755
751
  const excludedSet = new Set(excludedList);
756
752
  return ((this.interfaces as Interface[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -892,7 +888,6 @@ export class Module extends BaseNode {
892
888
  return node;
893
889
  }
894
890
 
895
-
896
891
  getViewExistingNames(excludedList: Array<View> = []) {
897
892
  const excludedSet = new Set(excludedList);
898
893
  return ((this.views as View[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -1034,7 +1029,6 @@ export class Module extends BaseNode {
1034
1029
  return node;
1035
1030
  }
1036
1031
 
1037
-
1038
1032
  getVarExistingNames(excludedList: Array<Variable> = []) {
1039
1033
  const excludedSet = new Set(excludedList);
1040
1034
  return ((this.frontendVariables as Variable[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -1176,7 +1170,6 @@ export class Module extends BaseNode {
1176
1170
  return node;
1177
1171
  }
1178
1172
 
1179
-
1180
1173
  getProcessExistingNames(excludedList: Array<Process> = []) {
1181
1174
  const excludedSet = new Set(excludedList);
1182
1175
  return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -1318,7 +1311,6 @@ export class Module extends BaseNode {
1318
1311
  return node;
1319
1312
  }
1320
1313
 
1321
-
1322
1314
  getFrontendLibraryExistingNames(excludedList: Array<FrontendLibrary> = []) {
1323
1315
  const excludedSet = new Set(excludedList);
1324
1316
  return ((this.frontends as FrontendLibrary[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -1460,9 +1452,6 @@ export class Module extends BaseNode {
1460
1452
  return node;
1461
1453
  }
1462
1454
 
1463
-
1464
-
1465
-
1466
1455
  /**
1467
1456
  * 删除数据源
1468
1457
  * @param name 数据源名称
@@ -1511,8 +1500,6 @@ export class Module extends BaseNode {
1511
1500
  return params;
1512
1501
  }
1513
1502
 
1514
-
1515
-
1516
1503
  /**
1517
1504
  * 删除数据结构
1518
1505
  * @param name 数据结构名称
@@ -1561,8 +1548,6 @@ export class Module extends BaseNode {
1561
1548
  return params;
1562
1549
  }
1563
1550
 
1564
-
1565
-
1566
1551
  /**
1567
1552
  * 删除枚举
1568
1553
  * @param name 枚举名称
@@ -1611,8 +1596,6 @@ export class Module extends BaseNode {
1611
1596
  return params;
1612
1597
  }
1613
1598
 
1614
-
1615
-
1616
1599
  /**
1617
1600
  * 删除逻辑
1618
1601
  * @param name 逻辑名称
@@ -1661,8 +1644,6 @@ export class Module extends BaseNode {
1661
1644
  return params;
1662
1645
  }
1663
1646
 
1664
-
1665
-
1666
1647
  /**
1667
1648
  * 删除接口
1668
1649
  * @param name 接口名称
@@ -1711,8 +1692,6 @@ export class Module extends BaseNode {
1711
1692
  return params;
1712
1693
  }
1713
1694
 
1714
-
1715
-
1716
1695
  /**
1717
1696
  * 删除页面
1718
1697
  * @param name 页面名称
@@ -1761,8 +1740,6 @@ export class Module extends BaseNode {
1761
1740
  return params;
1762
1741
  }
1763
1742
 
1764
-
1765
-
1766
1743
  /**
1767
1744
  * 删除变量
1768
1745
  * @param name 变量名称
@@ -1811,8 +1788,6 @@ export class Module extends BaseNode {
1811
1788
  return params;
1812
1789
  }
1813
1790
 
1814
-
1815
-
1816
1791
  /**
1817
1792
  * 删除流程
1818
1793
  * @param name 流程名称
@@ -1861,8 +1836,6 @@ export class Module extends BaseNode {
1861
1836
  return params;
1862
1837
  }
1863
1838
 
1864
-
1865
-
1866
1839
  /**
1867
1840
  * 删除端包
1868
1841
  * @param name 端包名称
@@ -1911,8 +1884,6 @@ export class Module extends BaseNode {
1911
1884
  return params;
1912
1885
  }
1913
1886
 
1914
-
1915
-
1916
1887
  /**
1917
1888
  * 删除配置管理
1918
1889
  * @param name 配置管理名称
@@ -1971,65 +1942,121 @@ export class Module extends BaseNode {
1971
1942
  @property()
1972
1943
  isAdd: boolean;
1973
1944
 
1974
- setIsAdd(isAdd: boolean) {
1975
- const object = {
1976
- isAdd,
1977
- };
1978
- this.update({
1979
- ...object,
1980
- });
1981
- }
1982
- /**
1945
+ /**
1946
+ * 是否启动
1947
+ */
1948
+ @property()
1949
+ enable: boolean;
1950
+
1951
+ /**
1952
+ * 依赖列表
1953
+ */
1954
+ @property()
1955
+ dependencies: Array<string> = [];
1956
+
1957
+ setIsAdd(isAdd: boolean) {
1958
+ const object = {
1959
+ isAdd,
1960
+ };
1961
+ this.update({
1962
+ ...object,
1963
+ });
1964
+ }
1965
+ /**
1983
1966
  * 生成宿主语言的文件路径
1984
1967
  * @param name 一般不用传,用于 rename
1985
1968
  */
1986
- getEmbeddedFilePath(name = this.name) {
1987
- return `/embedded/${this.app.name}/${this.parentKey}/${this.name}`;
1988
- }
1989
- /**
1969
+ getEmbeddedFilePath(name = this.name) {
1970
+ return `/embedded/${this.app.name}/${this.parentKey}/${this.name}`;
1971
+ }
1972
+ /**
1990
1973
  * 获取命名空间和
1991
1974
  * 暂时不考虑 Module 嵌套的情况
1992
1975
  */
1993
- getNamespace() {
1994
- return `${moduleNameSpace[this.parentKey as ModuleKeyType]}`;
1995
- }
1976
+ getNamespace() {
1977
+ return `${moduleNameSpace[this.parentKey as ModuleKeyType]}`;
1978
+ }
1996
1979
 
1997
- getTsNamespace() {
1998
- return `${moduleNameSpace[this.parentKey as ModuleKeyType]}`;
1999
- }
2000
- getTsNamespaceAndName() {
2001
- return `${moduleNameSpace[this.parentKey as ModuleKeyType]}.${this.name}`;
2002
- }
1980
+ getTsNamespace() {
1981
+ return `${moduleNameSpace[this.parentKey as ModuleKeyType]}`;
1982
+ }
1983
+ getTsNamespaceAndName() {
1984
+ return `${moduleNameSpace[this.parentKey as ModuleKeyType]}.${this.name}`;
1985
+ }
2003
1986
 
2004
- findEnumByName(name: string) {
2005
- return this.enums.find((enumItem) => enumItem.name === name);
2006
- }
1987
+ findEnumByName(name: string) {
1988
+ return this.enums.find((enumItem) => enumItem.name === name);
1989
+ }
2007
1990
 
2008
- /**
1991
+ /**
2009
1992
  * 获取属性节点是否存在
2010
1993
  */
2011
1994
 
2012
- findProperty(name: string, propertyType: PropertyType): any {
2013
- return ((this as any)[propertyType] as Array<any>).find((item) => item.name === name);
2014
- }
2015
-
2016
- delete() {
2017
- this.parentNode?.emit('collect:start', {
2018
- actionMsg: '移除依赖库',
2019
- });
2020
- super.delete();
2021
- this._delete();
2022
- const dataSourceGroup = (this.parentNode as any)?.configuration?.getGroup('dataSource');
2023
- if (this.dataSources && dataSourceGroup) {
2024
- this.dataSources.forEach((datasource) => {
2025
- this.parentNode?.emit('clear:datasourceError', datasource as any);
2026
- try {
2027
- dataSourceGroup.removeConfigProperty(datasource.name);
2028
- } catch (e) {}
2029
- });
2030
- }
2031
- this.parentNode?.emit('collect:end');
2032
- }
1995
+ findProperty(name: string, propertyType: PropertyType): any {
1996
+ return ((this as any)[propertyType] as Array<any>).find((item) => item.name === name);
1997
+ }
1998
+
1999
+ delete() {
2000
+ this.parentNode?.emit('collect:start', {
2001
+ actionMsg: '移除依赖库',
2002
+ });
2003
+ super.delete();
2004
+ this._delete();
2005
+ // if (this.dependencies) {
2006
+ // // 删除依赖链中的依赖
2007
+ // this.dependencies.forEach((tag) => {
2008
+ // const [name, version] = tag.split('-');
2009
+ // const existNode = this.app.dependencies.find((m) => m.name === name && m.version === version);
2010
+ // existNode?.delete();
2011
+ // });
2012
+ // }
2013
+ // 处理同名依赖 重新生成文件
2014
+ if (this.enable) {
2015
+ // 删[数据源]
2016
+ const dataSourceGroup = (this.parentNode as any)?.configuration?.getGroup('dataSource');
2017
+ if (this.dataSources && dataSourceGroup) {
2018
+ this.dataSources.forEach((datasource) => {
2019
+ this.parentNode?.emit('clear:datasourceError', datasource as any);
2020
+ try {
2021
+ dataSourceGroup.removeConfigProperty(datasource.name);
2022
+ } catch (e) {}
2023
+ });
2024
+ }
2025
+ // // 已启用的依赖库被删除时,将后续被禁用的同名依赖库 切换为启用
2026
+ // const index = this.app.dependencies.findIndex((m) => m.enable === false && m.name === this.name);
2027
+ // if (index >= 0) {
2028
+ // const nextMainModule = this.app.dependencies[index];
2029
+ // // 更新[禁用的依赖]enable:true
2030
+ // nextMainModule.update({ enable: true });
2031
+ // nextMainModule.softDelete({ index });
2032
+ // }
2033
+ }
2034
+ this.parentNode?.emit('collect:end');
2035
+ }
2036
+
2037
+ // 删除再添加 触发文件生成
2038
+ softDelete(options: { index: number }) {
2039
+ // 删[禁用的依赖]
2040
+ super.delete();
2041
+ // 创建[禁用的依赖]
2042
+ this.app.insertModuleInDependenciesAt(this, options.index);
2043
+ // 创建[禁用的依赖]的数据源
2044
+ const dataSourceGroup = (this.parentNode as any)?.configuration?.getGroup('dataSource');
2045
+ if (this.dataSources && dataSourceGroup) {
2046
+ this.dataSources.forEach((datasource) => {
2047
+ const body: ConfigProperty = ConfigProperty.from({
2048
+ name: datasource.name,
2049
+ description: '',
2050
+ isPrivate: false,
2051
+ values: [
2052
+ { env: 'dev', value: '', concept: 'ConfigPropertyValue' },
2053
+ { env: 'online', value: '', concept: 'ConfigPropertyValue' },
2054
+ ],
2055
+ });
2056
+ dataSourceGroup.addConfigProperty(body);
2057
+ });
2058
+ }
2059
+ }
2033
2060
 
2034
2061
  //================================================================================
2035
2062
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
@@ -1225,19 +1225,26 @@ export class NewComposite extends LogicItem {
1225
1225
  code += `${indent1}function __newComposite() {\n`;
1226
1226
  this.properties.forEach((property, index) => {
1227
1227
  const temp = `temp${index}`;
1228
+ const propertyType = this.typeAnnotation.properties[index]?.typeAnnotation;
1228
1229
  const name = property.name;
1229
1230
  const rightItem = nameMap.get(name);
1230
1231
  const ts = rightMap.get(rightItem);
1231
1232
  if (ts !== undefined) {
1232
1233
  if (['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts)) {
1233
- code += `${indent2}const ${temp}: any = null; `;
1234
+ code += `${indent2}let ${temp}: void = null; `;
1234
1235
  } else {
1235
- code += `${indent2}const ${temp}${ts === 'null' ? ':void' : ''} = ${ts}; `;
1236
+ code += `${indent2}let ${temp}${ts === 'null' ? ':void' : ''} = ${ts}; `;
1236
1237
  }
1237
- code += `${indent2}const `;
1238
- code += property.toEmbeddedTS(shiftState(state, code, { inline: true }));
1239
- code += `: nasl.core.Incompatible<typeof ${temp}, void> = ${temp}`;
1240
- code += ';\n';
1238
+ code += `const `;
1239
+ code += `${property.toEmbeddedTS(shiftState(state, code, { inline: true }))}: `;
1240
+ code += propertyType ? propertyType.toEmbeddedTS(shiftState(state, code, { inline: true })) : `nasl.core.Incompatible<typeof ${temp}, void>`;
1241
+ code += ` = ${temp};\n`;
1242
+ } else if (propertyType) {
1243
+ code += `${indent2}let ${property.name}: `;
1244
+ code += `${propertyType.toEmbeddedTS(shiftState(state, code, { inline: true }))}; `;
1245
+ code += `<`;
1246
+ code += `${property.toEmbeddedTS(shiftState(state, code, { inline: true }))}`;
1247
+ code += `>${property.name};\n`;
1241
1248
  } else {
1242
1249
  code += `${indent2}const `;
1243
1250
  code += property.toEmbeddedTS(shiftState(state, code, { inline: true }));
@@ -1289,11 +1296,14 @@ export class NewComposite extends LogicItem {
1289
1296
  });
1290
1297
  // 方便ts报错检查
1291
1298
  code += 'function __newComposite() { ';
1292
- this.properties.forEach((property) => {
1299
+ this.properties.forEach((property, index) => {
1293
1300
  const name = property.name;
1301
+ const propertyType = this.typeAnnotation.properties[index]?.typeAnnotation;
1294
1302
  const rightItem = nameMap.get(name);
1295
1303
  const ts = rightMap.get(rightItem);
1296
- if (ts !== undefined) {
1304
+ if (propertyType) {
1305
+ code += `const ${name}: ${propertyType.toEmbeddedTS(shiftState(state, code, { inline: true }))}; `;
1306
+ } else if (ts !== undefined) {
1297
1307
  code += `const ${name} = ${['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts) ? null : ts}; `;
1298
1308
  } else {
1299
1309
  code += `const ${name}; `;
@@ -1313,14 +1323,16 @@ export class NewComposite extends LogicItem {
1313
1323
  return code;
1314
1324
  }
1315
1325
 
1316
- __addIdentifier() {
1326
+ __addIdentifier(name: string, typeAnnotation: TypeAnnotation) {
1327
+ const newName = name || 'property1';
1328
+ const newType = typeAnnotation || null;
1317
1329
  this.app.emit('collect:start', {
1318
1330
  actionMsg: '添加匿名数据结构属性',
1319
1331
  });
1320
- const node = this.addIdentifier({ name: this.getIdentifierUniqueName('property1') });
1332
+ const node = this.addIdentifier({ name: this.getIdentifierUniqueName(newName) });
1321
1333
  const struct = StructureProperty.from({
1322
1334
  name: node.name,
1323
- typeAnnotation: null,
1335
+ typeAnnotation: newType,
1324
1336
  });
1325
1337
  this.typeAnnotation.addStructureProperty(struct);
1326
1338
  this.app.emit('collect:end');
@@ -303,7 +303,7 @@ export class OqlQueryComponent extends LogicItem {
303
303
  dataSourceName: this.dataSource,
304
304
  oql: this.code,
305
305
  ideVersion: this.app.ideVersion,
306
- dataSourceNasl: this.app.findNodeByCompleteName(this.dataSource).toJSON(),
306
+ dataSourceNasl: this.app.findNodeByCompleteName(this.dataSource)?.toJSON(),
307
307
  typeScriptStartLine: 1,
308
308
  typeScriptStartLineColumn: 1,
309
309
  },
@@ -266,6 +266,9 @@ export class Param extends BaseNode {
266
266
  type: 's-member-identifier-select' | 's-enum-select' | 's-schema-select' | 's-datatype-select' | 's-config-select' | 's-options-select';
267
267
  attrs?: any;
268
268
  } = undefined;
269
+ @excludedInJSON()
270
+ @property()
271
+ cascader: Boolean = false;
269
272
 
270
273
  /**
271
274
  * 自动补全的属性列表
@@ -48,8 +48,6 @@ export class QueryFieldExpression extends LogicItem {
48
48
  @property()
49
49
  propertyName: string = undefined;
50
50
 
51
-
52
-
53
51
  /**
54
52
  * @param source 需要合并的部分参数
55
53
  */
@@ -66,7 +64,6 @@ export class QueryFieldExpression extends LogicItem {
66
64
  return super.from(source, parentNode, parentKey) as QueryFieldExpression;
67
65
  }
68
66
 
69
-
70
67
  /**
71
68
  * 设置entityAsName
72
69
  */
@@ -91,10 +88,6 @@ export class QueryFieldExpression extends LogicItem {
91
88
  });
92
89
  }
93
90
 
94
-
95
-
96
-
97
-
98
91
  //================================================================================
99
92
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
100
93
  // 自动生成的代码已结束。下面可以手动编写。