@lcap/nasl 2.22.0-beta.0 → 2.22.0-beta.2

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 +271 -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 +68 -68
  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 +44 -16
  265. package/src/server/getLogics.ts +41 -6
  266. package/src/server/getMemberIdentifier.ts +5 -4
  267. package/src/server/naslServer.ts +271 -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
@@ -103,8 +103,6 @@ export class CallQueryComponent extends LogicItem {
103
103
  @property()
104
104
  ideVersion: string = undefined;
105
105
 
106
-
107
-
108
106
  /**
109
107
  * @param source 需要合并的部分参数
110
108
  */
@@ -121,7 +119,6 @@ export class CallQueryComponent extends LogicItem {
121
119
  return super.from(source, parentNode, parentKey) as CallQueryComponent;
122
120
  }
123
121
 
124
-
125
122
  /**
126
123
  * 设置select
127
124
  */
@@ -221,10 +218,6 @@ export class CallQueryComponent extends LogicItem {
221
218
  });
222
219
  }
223
220
 
224
-
225
-
226
-
227
-
228
221
  /**
229
222
  * 插入逻辑项
230
223
  * @internal
@@ -257,8 +250,6 @@ export class CallQueryComponent extends LogicItem {
257
250
  return logicItem;
258
251
  }
259
252
 
260
-
261
-
262
253
  /**
263
254
  * 插入逻辑项
264
255
  * @param logicItemOptions 逻辑项参数
@@ -281,8 +272,6 @@ export class CallQueryComponent extends LogicItem {
281
272
  return node;
282
273
  }
283
274
 
284
-
285
-
286
275
  /**
287
276
  * 添加逻辑项
288
277
  * @internal
@@ -302,8 +291,6 @@ export class CallQueryComponent extends LogicItem {
302
291
  return this._insertItemInWherePlaygroundAt(options as any, index);
303
292
  }
304
293
 
305
-
306
-
307
294
  /**
308
295
  * 添加逻辑项
309
296
  * @param logicItemOptions 逻辑项参数
@@ -327,8 +314,6 @@ export class CallQueryComponent extends LogicItem {
327
314
  return node;
328
315
  }
329
316
 
330
-
331
-
332
317
  /**
333
318
  * 插入查询分组
334
319
  * @internal
@@ -361,8 +346,6 @@ export class CallQueryComponent extends LogicItem {
361
346
  return queryGroupByExpression;
362
347
  }
363
348
 
364
-
365
-
366
349
  /**
367
350
  * 插入查询分组
368
351
  * @param queryGroupByExpressionOptions 查询分组参数
@@ -385,8 +368,6 @@ export class CallQueryComponent extends LogicItem {
385
368
  return node;
386
369
  }
387
370
 
388
-
389
-
390
371
  /**
391
372
  * 添加查询分组
392
373
  * @internal
@@ -406,8 +387,6 @@ export class CallQueryComponent extends LogicItem {
406
387
  return this._insertQueryGroupByExpressionInGroupByAt(options as any, index);
407
388
  }
408
389
 
409
-
410
-
411
390
  /**
412
391
  * 添加查询分组
413
392
  * @param queryGroupByExpressionOptions 查询分组参数
@@ -431,8 +410,6 @@ export class CallQueryComponent extends LogicItem {
431
410
  return node;
432
411
  }
433
412
 
434
-
435
-
436
413
  /**
437
414
  * 插入逻辑项
438
415
  * @internal
@@ -465,8 +442,6 @@ export class CallQueryComponent extends LogicItem {
465
442
  return logicItem;
466
443
  }
467
444
 
468
-
469
-
470
445
  /**
471
446
  * 插入逻辑项
472
447
  * @param logicItemOptions 逻辑项参数
@@ -489,8 +464,6 @@ export class CallQueryComponent extends LogicItem {
489
464
  return node;
490
465
  }
491
466
 
492
-
493
-
494
467
  /**
495
468
  * 添加逻辑项
496
469
  * @internal
@@ -510,8 +483,6 @@ export class CallQueryComponent extends LogicItem {
510
483
  return this._insertItemInHavingPlaygroundAt(options as any, index);
511
484
  }
512
485
 
513
-
514
-
515
486
  /**
516
487
  * 添加逻辑项
517
488
  * @param logicItemOptions 逻辑项参数
@@ -535,8 +506,6 @@ export class CallQueryComponent extends LogicItem {
535
506
  return node;
536
507
  }
537
508
 
538
-
539
-
540
509
  /**
541
510
  * 插入查询排序子句
542
511
  * @internal
@@ -569,8 +538,6 @@ export class CallQueryComponent extends LogicItem {
569
538
  return queryOrderByExpression;
570
539
  }
571
540
 
572
-
573
-
574
541
  /**
575
542
  * 插入查询排序子句
576
543
  * @param queryOrderByExpressionOptions 查询排序子句参数
@@ -593,8 +560,6 @@ export class CallQueryComponent extends LogicItem {
593
560
  return node;
594
561
  }
595
562
 
596
-
597
-
598
563
  /**
599
564
  * 添加查询排序子句
600
565
  * @internal
@@ -614,8 +579,6 @@ export class CallQueryComponent extends LogicItem {
614
579
  return this._insertQueryOrderByExpressionInOrderByAt(options as any, index);
615
580
  }
616
581
 
617
-
618
-
619
582
  /**
620
583
  * 添加查询排序子句
621
584
  * @param queryOrderByExpressionOptions 查询排序子句参数
@@ -639,9 +602,6 @@ export class CallQueryComponent extends LogicItem {
639
602
  return node;
640
603
  }
641
604
 
642
-
643
-
644
-
645
605
  /**
646
606
  * 删除类型标注
647
607
  * @param name 类型标注名称
@@ -690,8 +650,6 @@ export class CallQueryComponent extends LogicItem {
690
650
  return params;
691
651
  }
692
652
 
693
-
694
-
695
653
  /**
696
654
  * 删除查询选择子句
697
655
  * @param name 查询选择子句名称
@@ -717,8 +675,6 @@ export class CallQueryComponent extends LogicItem {
717
675
  return select.delete();
718
676
  }
719
677
 
720
-
721
-
722
678
  /**
723
679
  * 删除查询 From 子句
724
680
  * @param name 查询 From 子句名称
@@ -744,8 +700,6 @@ export class CallQueryComponent extends LogicItem {
744
700
  return from.delete();
745
701
  }
746
702
 
747
-
748
-
749
703
  /**
750
704
  * 删除逻辑项
751
705
  * @param name 逻辑项名称
@@ -771,8 +725,6 @@ export class CallQueryComponent extends LogicItem {
771
725
  return where.delete();
772
726
  }
773
727
 
774
-
775
-
776
728
  /**
777
729
  * 删除逻辑项
778
730
  * @param logicItem 已有的逻辑项实例
@@ -780,12 +732,10 @@ export class CallQueryComponent extends LogicItem {
780
732
  removeItemInWherePlayground(logicItem: LogicItem): void;
781
733
 
782
734
  removeItemInWherePlayground(options: LogicItem) {
783
- let logicItem: LogicItem = options;
735
+ const logicItem: LogicItem = options;
784
736
  return logicItem.delete();
785
737
  }
786
738
 
787
-
788
-
789
739
  /**
790
740
  * 删除查询分组
791
741
  * @param queryGroupByExpression 已有的查询分组实例
@@ -793,12 +743,10 @@ export class CallQueryComponent extends LogicItem {
793
743
  removeQueryGroupByExpressionInGroupBy(queryGroupByExpression: QueryGroupByExpression): void;
794
744
 
795
745
  removeQueryGroupByExpressionInGroupBy(options: QueryGroupByExpression) {
796
- let queryGroupByExpression: QueryGroupByExpression = options;
746
+ const queryGroupByExpression: QueryGroupByExpression = options;
797
747
  return queryGroupByExpression.delete();
798
748
  }
799
749
 
800
-
801
-
802
750
  /**
803
751
  * 删除逻辑项
804
752
  * @param name 逻辑项名称
@@ -824,8 +772,6 @@ export class CallQueryComponent extends LogicItem {
824
772
  return having.delete();
825
773
  }
826
774
 
827
-
828
-
829
775
  /**
830
776
  * 删除逻辑项
831
777
  * @param logicItem 已有的逻辑项实例
@@ -833,12 +779,10 @@ export class CallQueryComponent extends LogicItem {
833
779
  removeItemInHavingPlayground(logicItem: LogicItem): void;
834
780
 
835
781
  removeItemInHavingPlayground(options: LogicItem) {
836
- let logicItem: LogicItem = options;
782
+ const logicItem: LogicItem = options;
837
783
  return logicItem.delete();
838
784
  }
839
785
 
840
-
841
-
842
786
  /**
843
787
  * 删除查询排序子句
844
788
  * @param queryOrderByExpression 已有的查询排序子句实例
@@ -846,12 +790,10 @@ export class CallQueryComponent extends LogicItem {
846
790
  removeQueryOrderByExpressionInOrderBy(queryOrderByExpression: QueryOrderByExpression): void;
847
791
 
848
792
  removeQueryOrderByExpressionInOrderBy(options: QueryOrderByExpression) {
849
- let queryOrderByExpression: QueryOrderByExpression = options;
793
+ const queryOrderByExpression: QueryOrderByExpression = options;
850
794
  return queryOrderByExpression.delete();
851
795
  }
852
796
 
853
-
854
-
855
797
  /**
856
798
  * 删除查询分页子句
857
799
  * @param name 查询分页子句名称
@@ -984,8 +926,14 @@ export class CallQueryComponent extends LogicItem {
984
926
  // })`;
985
927
  }
986
928
 
929
+ // 2.11版本,自动推断返回类型
987
930
  isAutoInfer() {
988
- return this.ideVersion === '2.11';
931
+ return this.ideVersion === '2.11' || this.ideVersion === '2.22';
932
+ }
933
+ // 2.22版本,实体支持列筛选 2.11版本不支持列筛选,需要运维select.selectElements
934
+ get entityPropertySelectable() {
935
+ return false; // 回滚功能
936
+ // return this.ideVersion === '2.22';
989
937
  }
990
938
 
991
939
  @withSourceMap()
@@ -1020,7 +968,7 @@ export class CallQueryComponent extends LogicItem {
1020
968
  });
1021
969
  }
1022
970
  // 聚合属性别名
1023
- this.select.selectElements.forEach((item, index, array) => {
971
+ this.select.selectAggregateElements.forEach((item, index, array) => {
1024
972
  code += indent((state?.tabSize || 0) + 1);
1025
973
  const { asName, aggregateName, aggregateParam } = item;
1026
974
  if (asName)
@@ -1048,11 +996,19 @@ export class CallQueryComponent extends LogicItem {
1048
996
  multipleErrorType: '__WHERE_MULTIPLE_CONDITION__',
1049
997
  });
1050
998
 
1051
- // 聚合属性
1052
- code = this.toEmbeddedTSOfSubPart('SELECT', this.select.selectElements, {
1053
- code,
1054
- state,
1055
- });
999
+ if (this.select.selectAggregateElements.length) {
1000
+ // 聚合属性
1001
+ code = this.toEmbeddedTSOfSubPart('SELECT', this.select.selectAggregateElements, {
1002
+ code,
1003
+ state,
1004
+ });
1005
+ } else {
1006
+ // select实体字段
1007
+ code = this.toEmbeddedTSOfSubPart('SELECT', this.select.selectFieldElements.filter((node) => !node.isDotStar), {
1008
+ code,
1009
+ state,
1010
+ });
1011
+ }
1056
1012
 
1057
1013
  // 分组属性(Group by)
1058
1014
  code = this.toEmbeddedTSOfSubPart('GROUP_BY', this.groupBy, {
@@ -1088,6 +1044,7 @@ export class CallQueryComponent extends LogicItem {
1088
1044
  && this.parentNode.concept !== 'Assignment'
1089
1045
  && this.parentNode.concept !== 'ForEachStatement'
1090
1046
  && this.parentNode.concept !== 'SelectMembers'
1047
+ && this.parentNode.concept !== 'UnaryExpression'
1091
1048
  && this.parentNode.concept !== 'BinaryExpression'
1092
1049
  && this.parentNode.concept !== 'StringInterpolation'
1093
1050
  && this.parentNode.concept !== 'MemberExpression'
@@ -1104,15 +1061,37 @@ export class CallQueryComponent extends LogicItem {
1104
1061
 
1105
1062
  const entityName = node.entityName;
1106
1063
  const entityNamespace = node.entityNamespace;
1107
- properties.push(StructureProperty.from({
1108
- name: utils.firstLowerCase(entityName),
1109
- typeAnnotation: TypeAnnotation.from({
1110
- concept: 'TypeAnnotation',
1111
- typeKind: 'reference',
1112
- typeName: entityName,
1113
- typeNamespace: entityNamespace,
1114
- }),
1115
- }));
1064
+ // 生成整个实体类型 { entity1: Entity1 } 在2.11属于默认情况;在2.22勾选实体节点(isDotStar=true)时
1065
+ if (!this.entityPropertySelectable || this.select.selectFieldElements.some((item) => item.entityAsName === entityName && item.isDotStar)) {
1066
+ properties.push(StructureProperty.from({
1067
+ name: utils.firstLowerCase(entityName),
1068
+ typeAnnotation: TypeAnnotation.from({
1069
+ concept: 'TypeAnnotation',
1070
+ typeKind: 'reference',
1071
+ typeName: entityName,
1072
+ typeNamespace: entityNamespace,
1073
+ }),
1074
+ }));
1075
+ } else if (this.select.selectFieldElements.some((item) => item.entityAsName === entityName && item.propertyName)) {
1076
+ // 2.22 选择字段时,生成选择字段的匿名数据结构 { entity1: { prop1, prop2 } }
1077
+ const entity: Entity = this.app.findNodeByCompleteName(entityNamespace + '.' + entityName);
1078
+ properties.push(StructureProperty.from({
1079
+ name: utils.firstLowerCase(entityName),
1080
+ typeAnnotation: TypeAnnotation.from({
1081
+ concept: 'TypeAnnotation',
1082
+ typeKind: 'anonymousStructure',
1083
+ properties: this.select.selectFieldElements
1084
+ .filter((sel) => sel.entityAsName === entityName && sel.propertyName)
1085
+ .map((item) => {
1086
+ const property = entity.properties.find((prop) => prop.name === item.propertyName);
1087
+ return property && StructureProperty.from({
1088
+ name: item.propertyName,
1089
+ typeAnnotation: TypeAnnotation.from(property.typeAnnotation),
1090
+ });
1091
+ }).filter(Boolean),
1092
+ }),
1093
+ }));
1094
+ } else { /* 实体或属性都不选择时,不生成数据结构 */ }
1116
1095
 
1117
1096
  for (const sub of node.joinParts) {
1118
1097
  this.genPropertiesFrom(sub, properties);
@@ -1146,7 +1125,7 @@ export class CallQueryComponent extends LogicItem {
1146
1125
  }
1147
1126
 
1148
1127
  genPropertyListOfAggregate(node: CallQueryComponent, entities: Entity[]) {
1149
- return node.select.selectElements
1128
+ return node.select.selectAggregateElements
1150
1129
  .filter((item) => item.aggregateName && item.asName)
1151
1130
  .map((item) => {
1152
1131
  let typeName;
@@ -1225,7 +1204,7 @@ export class CallQueryComponent extends LogicItem {
1225
1204
  }
1226
1205
 
1227
1206
  const groupBy = this.groupBy;
1228
- const selectElements = this.select.selectElements;
1207
+ const selectElements = this.select.selectAggregateElements;
1229
1208
  let structureName;
1230
1209
  let typeAnnotation;
1231
1210
 
@@ -1356,7 +1335,7 @@ export class CallQueryComponent extends LogicItem {
1356
1335
  typeNamespace: 'nasl.core',
1357
1336
  }, this, 'typeAnnotation');
1358
1337
  } else {
1359
- // 2.2. 多聚合:`{ Structure }`
1338
+ // 2.2 多聚合:`{ Structure }`
1360
1339
  typeAnnotation = TypeAnnotation.from({
1361
1340
  concept: 'TypeAnnotation',
1362
1341
  typeKind: 'anonymousStructure',
@@ -1364,7 +1343,7 @@ export class CallQueryComponent extends LogicItem {
1364
1343
  }, this, 'typeAnnotation');
1365
1344
  }
1366
1345
  } else {
1367
- // 2.3. 无聚合(默认情况):`{ list: List<Structure>, total: Long }`
1346
+ // 2.3 无分组&&无聚合 (默认情况):`{ list: List<Structure>, total: Long }`
1368
1347
  typeAnnotation = TypeAnnotation.from({
1369
1348
  concept: 'TypeAnnotation',
1370
1349
  typeKind: 'anonymousStructure',
@@ -1587,6 +1566,18 @@ export class CallQueryComponent extends LogicItem {
1587
1566
  });
1588
1567
  return contentVariables;
1589
1568
  }
1569
+ // 临时升级脚本
1570
+ // 将所有from的实体,在selectElements中初始化一个isDotStar=true的QueryFieldExpression
1571
+ initFieldSelectElement(node: CallQueryComponent = this) {
1572
+ const loop = (from: QueryFromExpression | QueryJoinExpression) => {
1573
+ node.select.addQueryFieldExpressionInSelectElements({
1574
+ entityAsName: from.entityName,
1575
+ isDotStar: true,
1576
+ });
1577
+ from.joinParts?.forEach(loop);
1578
+ };
1579
+ loop(node.from);
1580
+ }
1590
1581
  //================================================================================
1591
1582
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
1592
1583
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -1,6 +1,7 @@
1
1
  import { TranslatorState, withSourceMap, createCompilerState, indent } from '../translator';
2
2
  import ConfigGroup from './ConfigGroup__';
3
3
  import Namespace from './Namespace__';
4
+ import View from './View__';
4
5
 
5
6
  //================================================================================
6
7
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
@@ -46,6 +47,12 @@ export class ConfigProperty extends BaseNode {
46
47
  @property('ConfigPropertyValue')
47
48
  values: Array<ConfigPropertyValue> = [];
48
49
 
50
+ /**
51
+ * isPrivate
52
+ */
53
+ @property()
54
+ isPrivate: boolean = undefined;
55
+
49
56
  /**
50
57
  * 祖先 App
51
58
  */
@@ -335,7 +342,17 @@ export class ConfigProperty extends BaseNode {
335
342
 
336
343
  @withSourceMap()
337
344
  toEmbeddedTS(state?: TranslatorState): string {
338
- let code = `let ${this.name}: nasl.core.String; \n`;
345
+ let modifier;
346
+ if (this.isPrivate) {
347
+ modifier = 'private';
348
+ } else {
349
+ modifier = '';
350
+ }
351
+ let code = `class Custom${this.name} {
352
+ ${modifier} static FrontEnd${this.name}: nasl.core.String
353
+ static BackEnd${this.name}: nasl.core.String
354
+ };`;
355
+
339
356
  if (this.parentNode.name === 'custom') {
340
357
  this.values.forEach((value) => {
341
358
  code += indent((state?.tabSize || 0) + 1);
@@ -66,8 +66,6 @@ export class Destination extends LogicItem {
66
66
  @property()
67
67
  target: string = '_self';
68
68
 
69
-
70
-
71
69
  /**
72
70
  * @param source 需要合并的部分参数
73
71
  */
@@ -84,7 +82,6 @@ export class Destination extends LogicItem {
84
82
  return super.from(source, parentNode, parentKey) as Destination;
85
83
  }
86
84
 
87
-
88
85
  /**
89
86
  * 设置viewNamespace
90
87
  */
@@ -136,10 +133,6 @@ export class Destination extends LogicItem {
136
133
  });
137
134
  }
138
135
 
139
-
140
-
141
-
142
-
143
136
  /**
144
137
  * 插入实际参数
145
138
  * @internal
@@ -172,8 +165,6 @@ export class Destination extends LogicItem {
172
165
  return argument;
173
166
  }
174
167
 
175
-
176
-
177
168
  /**
178
169
  * 插入实际参数
179
170
  * @param argumentOptions 实际参数参数
@@ -196,8 +187,6 @@ export class Destination extends LogicItem {
196
187
  return node;
197
188
  }
198
189
 
199
-
200
-
201
190
  /**
202
191
  * 添加实际参数
203
192
  * @internal
@@ -217,8 +206,6 @@ export class Destination extends LogicItem {
217
206
  return this._insertArgumentAt(options as any, index);
218
207
  }
219
208
 
220
-
221
-
222
209
  /**
223
210
  * 添加实际参数
224
211
  * @param argumentOptions 实际参数参数
@@ -242,9 +229,6 @@ export class Destination extends LogicItem {
242
229
  return node;
243
230
  }
244
231
 
245
-
246
-
247
-
248
232
  /**
249
233
  * 删除实际参数
250
234
  * @param argument 已有的实际参数实例
@@ -252,12 +236,10 @@ export class Destination extends LogicItem {
252
236
  removeArgumentInArguments(argument: Argument): void;
253
237
 
254
238
  removeArgumentInArguments(options: Argument) {
255
- let argument: Argument = options;
239
+ const argument: Argument = options;
256
240
  return argument.delete();
257
241
  }
258
242
 
259
-
260
-
261
243
  /**
262
244
  * 删除锚点参数
263
245
  * @param name 锚点参数名称
@@ -636,7 +618,7 @@ export class Destination extends LogicItem {
636
618
  }
637
619
  });
638
620
  }
639
- if (this.viewNode) {
621
+ if (this.viewNode && this.viewNode.frontend) {
640
622
  return `${this.viewNode.frontend.basePath}/${viewNameAttr.join('/')}`;
641
623
  }
642
624
  return `/${viewNameAttr.join('/')}`;