@lcap/nasl 2.21.0-beta.2 → 2.21.0-beta.3

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 (188) hide show
  1. package/out/automate/engine/operators.d.ts +2 -2
  2. package/out/automate/engine/operators.js +14 -5
  3. package/out/automate/engine/operators.js.map +1 -1
  4. package/out/common/BaseNode.d.ts +6 -0
  5. package/out/common/BaseNode.js +45 -8
  6. package/out/common/BaseNode.js.map +1 -1
  7. package/out/concepts/Abort__.d.ts +1 -1
  8. package/out/concepts/Abort__.js +3 -3
  9. package/out/concepts/Abort__.js.map +1 -1
  10. package/out/concepts/App__.d.ts +0 -2
  11. package/out/concepts/App__.js +0 -42
  12. package/out/concepts/App__.js.map +1 -1
  13. package/out/concepts/BindAttribute__.js +18 -0
  14. package/out/concepts/BindAttribute__.js.map +1 -1
  15. package/out/concepts/BindEvent__.js +21 -22
  16. package/out/concepts/BindEvent__.js.map +1 -1
  17. package/out/concepts/CallFunction__.js.map +1 -1
  18. package/out/concepts/CallQueryComponent__.js +16 -16
  19. package/out/concepts/CallQueryComponent__.js.map +1 -1
  20. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  21. package/out/concepts/DataSource__.d.ts +0 -1
  22. package/out/concepts/DataSource__.js +0 -3
  23. package/out/concepts/DataSource__.js.map +1 -1
  24. package/out/concepts/EntityProperty__.d.ts +0 -23
  25. package/out/concepts/EntityProperty__.js +0 -121
  26. package/out/concepts/EntityProperty__.js.map +1 -1
  27. package/out/concepts/InterfaceParam__.d.ts +0 -3
  28. package/out/concepts/InterfaceParam__.js +0 -64
  29. package/out/concepts/InterfaceParam__.js.map +1 -1
  30. package/out/concepts/Interface__.d.ts +0 -3
  31. package/out/concepts/Interface__.js +4 -8
  32. package/out/concepts/Interface__.js.map +1 -1
  33. package/out/concepts/Logic__.d.ts +1 -1
  34. package/out/concepts/Logic__.js +22 -42
  35. package/out/concepts/Logic__.js.map +1 -1
  36. package/out/concepts/MatchCase__.js +1 -1
  37. package/out/concepts/MatchCase__.js.map +1 -1
  38. package/out/concepts/MemberExpression__.js +1 -1
  39. package/out/concepts/MemberExpression__.js.map +1 -1
  40. package/out/concepts/Module__.d.ts +0 -12
  41. package/out/concepts/Module__.js +0 -7
  42. package/out/concepts/Module__.js.map +1 -1
  43. package/out/concepts/NewMap__.js +5 -1
  44. package/out/concepts/NewMap__.js.map +1 -1
  45. package/out/concepts/NumericLiteral__.js +9 -3
  46. package/out/concepts/NumericLiteral__.js.map +1 -1
  47. package/out/concepts/OqlQueryComponent__.d.ts +0 -1
  48. package/out/concepts/OqlQueryComponent__.js +0 -46
  49. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  50. package/out/concepts/Param__.d.ts +0 -3
  51. package/out/concepts/Param__.js +1 -67
  52. package/out/concepts/Param__.js.map +1 -1
  53. package/out/concepts/Rect__.js.map +1 -1
  54. package/out/concepts/Return__.d.ts +0 -3
  55. package/out/concepts/Return__.js +1 -67
  56. package/out/concepts/Return__.js.map +1 -1
  57. package/out/concepts/SqlQueryComponent__.d.ts +0 -1
  58. package/out/concepts/SqlQueryComponent__.js +0 -46
  59. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  60. package/out/concepts/StructureProperty__.d.ts +0 -3
  61. package/out/concepts/StructureProperty__.js +0 -65
  62. package/out/concepts/StructureProperty__.js.map +1 -1
  63. package/out/concepts/TypeAnnotation__.d.ts +1 -3
  64. package/out/concepts/TypeAnnotation__.js +12 -31
  65. package/out/concepts/TypeAnnotation__.js.map +1 -1
  66. package/out/concepts/Variable__.d.ts +0 -3
  67. package/out/concepts/Variable__.js +1 -67
  68. package/out/concepts/Variable__.js.map +1 -1
  69. package/out/concepts/ViewComponent__.d.ts +7 -0
  70. package/out/concepts/ViewComponent__.js +7 -0
  71. package/out/concepts/ViewComponent__.js.map +1 -1
  72. package/out/concepts/ViewElement__.js +1 -1
  73. package/out/concepts/ViewElement__.js.map +1 -1
  74. package/out/concepts/basics/stdlib/nasl.collection.js +2 -2
  75. package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -1
  76. package/out/concepts/basics/stdlib/nasl.core.js +3 -3
  77. package/out/concepts/basics/stdlib/nasl.core.js.map +1 -1
  78. package/out/concepts/basics/stdlib/nasl.interface.js +1 -1
  79. package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
  80. package/out/concepts/basics/stdlib/nasl.process.js +6 -6
  81. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
  82. package/out/concepts/basics/stdlib/nasl.ui.js +43 -43
  83. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  84. package/out/concepts/basics/stdlib/nasl.util.js +19 -46
  85. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  86. package/out/concepts/basics/stdlib/nasl.validation.js +13 -13
  87. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
  88. package/out/concepts/basics/types/coreTypeList.js +5 -1
  89. package/out/concepts/basics/types/coreTypeList.js.map +1 -1
  90. package/out/concepts/index__.d.ts +0 -1
  91. package/out/concepts/index__.js +0 -1
  92. package/out/concepts/index__.js.map +1 -1
  93. package/out/generator/genReleaseBody.js +0 -3
  94. package/out/generator/genReleaseBody.js.map +1 -1
  95. package/out/sentry/index.d.ts +28 -0
  96. package/out/sentry/index.js +104 -0
  97. package/out/sentry/index.js.map +1 -0
  98. package/out/server/entity2LogicNamespace.js +1 -1
  99. package/out/server/entity2LogicNamespace.js.map +1 -1
  100. package/out/server/extendBaseNode.js +65 -0
  101. package/out/server/extendBaseNode.js.map +1 -1
  102. package/out/server/formatTsUtils.js +5 -5
  103. package/out/server/formatTsUtils.js.map +1 -1
  104. package/out/server/getLogics.js +9 -7
  105. package/out/server/getLogics.js.map +1 -1
  106. package/out/server/naslServer.d.ts +2 -2
  107. package/out/server/naslServer.js +120 -51
  108. package/out/server/naslServer.js.map +1 -1
  109. package/out/server/translator.js +3 -2
  110. package/out/server/translator.js.map +1 -1
  111. package/out/service/creator/errHandles.js +5 -0
  112. package/out/service/creator/errHandles.js.map +1 -1
  113. package/out/service/storage/init.js +6 -8
  114. package/out/service/storage/init.js.map +1 -1
  115. package/out/templator/genQueryComponent.js +2 -2
  116. package/out/templator/genQueryComponent.js.map +1 -1
  117. package/out/templator/genSelectBlock.js +9 -1
  118. package/out/templator/genSelectBlock.js.map +1 -1
  119. package/out/templator/utils.d.ts +32 -0
  120. package/out/templator/utils.js +7 -7
  121. package/out/templator/utils.js.map +1 -1
  122. package/package.json +2 -2
  123. package/sandbox/stdlib/nasl.auth.ts +3 -1
  124. package/sandbox/stdlib/nasl.browser.ts +1 -1
  125. package/sandbox/stdlib/nasl.collection.ts +9 -9
  126. package/sandbox/stdlib/nasl.core.ts +100 -38
  127. package/sandbox/stdlib/nasl.interface.ts +1 -1
  128. package/sandbox/stdlib/nasl.langUtil.ts +4 -4
  129. package/sandbox/stdlib/nasl.oql.ts +156 -156
  130. package/sandbox/stdlib/nasl.process.ts +6 -6
  131. package/sandbox/stdlib/nasl.ui.ts +42 -42
  132. package/sandbox/stdlib/nasl.util.ts +45 -44
  133. package/sandbox/stdlib/nasl.validation.ts +8 -8
  134. package/src/automate/engine/operators.js +13 -5
  135. package/src/automate/upgrader/2.20.js +1 -0
  136. package/src/common/BaseNode.ts +32 -1
  137. package/src/concepts/Abort__.ts +4 -3
  138. package/src/concepts/App__.ts +2 -38
  139. package/src/concepts/BindAttribute__.ts +17 -1
  140. package/src/concepts/BindEvent__.ts +21 -21
  141. package/src/concepts/CallFunction__.ts +0 -1
  142. package/src/concepts/CallQueryComponent__.ts +16 -74
  143. package/src/concepts/ConfigPropertyValue__.ts +0 -4
  144. package/src/concepts/DataSource__.ts +0 -4
  145. package/src/concepts/EntityProperty__.ts +0 -129
  146. package/src/concepts/InterfaceParam__.ts +0 -55
  147. package/src/concepts/Interface__.ts +4 -4
  148. package/src/concepts/Logic__.ts +31 -47
  149. package/src/concepts/MatchCase__.ts +1 -1
  150. package/src/concepts/MemberExpression__.ts +1 -1
  151. package/src/concepts/Module__.ts +0 -6
  152. package/src/concepts/NewMap__.ts +5 -1
  153. package/src/concepts/NumericLiteral__.ts +9 -4
  154. package/src/concepts/OqlQueryComponent__.ts +0 -40
  155. package/src/concepts/Param__.ts +3 -59
  156. package/src/concepts/Rect__.ts +0 -8
  157. package/src/concepts/Return__.ts +1 -58
  158. package/src/concepts/SqlQueryComponent__.ts +0 -40
  159. package/src/concepts/StructureProperty__.ts +0 -57
  160. package/src/concepts/TypeAnnotation__.ts +12 -72
  161. package/src/concepts/Variable__.ts +1 -58
  162. package/src/concepts/ViewComponent__.ts +6 -0
  163. package/src/concepts/ViewElement__.ts +7 -7
  164. package/src/concepts/basics/stdlib/nasl.collection.ts +2 -2
  165. package/src/concepts/basics/stdlib/nasl.core.ts +3 -3
  166. package/src/concepts/basics/stdlib/nasl.interface.ts +1 -1
  167. package/src/concepts/basics/stdlib/nasl.process.ts +6 -6
  168. package/src/concepts/basics/stdlib/nasl.ui.ts +43 -43
  169. package/src/concepts/basics/stdlib/nasl.util.ts +19 -46
  170. package/src/concepts/basics/stdlib/nasl.validation.ts +13 -13
  171. package/src/concepts/basics/types/coreTypeList.ts +5 -1
  172. package/src/concepts/index__.ts +0 -1
  173. package/src/generator/genReleaseBody.ts +0 -2
  174. package/src/sentry/index.ts +134 -0
  175. package/src/server/entity2LogicNamespace.ts +1 -1
  176. package/src/server/extendBaseNode.ts +61 -1
  177. package/src/server/formatTsUtils.ts +5 -5
  178. package/src/server/getLogics.ts +8 -7
  179. package/src/server/naslServer.ts +120 -53
  180. package/src/server/translator.ts +3 -2
  181. package/src/service/creator/errHandles.js +6 -0
  182. package/src/service/storage/init.ts +6 -8
  183. package/src/templator/genQueryComponent.ts +5 -5
  184. package/src/templator/genSelectBlock.ts +9 -1
  185. package/src/templator/utils.ts +7 -7
  186. package/ts-worker/lib/Messager.js +0 -3
  187. package/ts-worker/src/index.js +0 -1
  188. package/src/concepts/DatabaseTypeAnnotation__.ts +0 -88
@@ -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 查询分页子句名称
@@ -999,7 +941,7 @@ export class CallQueryComponent extends LogicItem {
999
941
  code += `${this.typeAnnotation.toEmbeddedTS(shiftState(state, code))} {\n`;
1000
942
  } else {
1001
943
  code += `{ list: nasl.collection.List<`;
1002
- code += `${this.typeAnnotation.toEmbeddedTS(shiftState(state, code))}>, total: nasl.core.Long } {\n`;
944
+ code += `${this.typeAnnotation.toEmbeddedTS(shiftState(state, code))}>, total: nasl.core.Integer } {\n`;
1003
945
  }
1004
946
  // 2.11版本后 分组使用别名
1005
947
  if (this.isAutoInfer()) {
@@ -1151,7 +1093,7 @@ export class CallQueryComponent extends LogicItem {
1151
1093
  .map((item) => {
1152
1094
  let typeName;
1153
1095
  if (['COUNT', 'COUNTD'].includes(item.aggregateName)) {
1154
- typeName = 'Long';
1096
+ typeName = 'Integer';
1155
1097
  } else if (['AVG'].includes(item.aggregateName)) {
1156
1098
  const { entityAsName, propertyName } = item.aggregateParam;
1157
1099
  const entity = entities.find((item: Entity) => item.name === entityAsName);
@@ -1160,7 +1102,7 @@ export class CallQueryComponent extends LogicItem {
1160
1102
  if (propertyTypeName === 'Decimal') {
1161
1103
  typeName = 'Decimal';
1162
1104
  } else {
1163
- typeName = 'Decimal';
1105
+ typeName = 'Double';
1164
1106
  }
1165
1107
  } else {
1166
1108
  const { entityAsName, propertyName } = item.aggregateParam;
@@ -1251,7 +1193,7 @@ export class CallQueryComponent extends LogicItem {
1251
1193
  // 1. 有分组
1252
1194
  if (groupByLength) {
1253
1195
  if (!aggregateLength && groupByLength === 1) {
1254
- // 1.1 单分组无聚合:`{ list: List<列的类型>, total: Long }`
1196
+ // 1.1 单分组无聚合:`{ list: List<列的类型>, total: Integer }`
1255
1197
  const { entityAsName, propertyName } = groupBy[0].groupElement as QueryFieldExpression;
1256
1198
  const entity = entities.find((item: Entity) => item.name === entityAsName);
1257
1199
  const property = entity?.properties.find((item: any) => item.name === propertyName);
@@ -1282,13 +1224,13 @@ export class CallQueryComponent extends LogicItem {
1282
1224
  concept: 'TypeAnnotation',
1283
1225
  typeKind: 'primitive',
1284
1226
  typeNamespace: 'nasl.core',
1285
- typeName: 'Long',
1227
+ typeName: 'Integer',
1286
1228
  }, this.typeAnnotation, 'typeAnnotation'),
1287
1229
  }),
1288
1230
  ],
1289
1231
  }, this, 'typeAnnotation');
1290
1232
  } else {
1291
- // 1.2 多分组:`{ list: List<anonymousStructure>, total: Long }`
1233
+ // 1.2 多分组:`{ list: List<anonymousStructure>, total: Integer }`
1292
1234
  typeAnnotation = TypeAnnotation.from({
1293
1235
  concept: 'TypeAnnotation',
1294
1236
  typeKind: 'anonymousStructure',
@@ -1318,7 +1260,7 @@ export class CallQueryComponent extends LogicItem {
1318
1260
  concept: 'TypeAnnotation',
1319
1261
  typeKind: 'primitive',
1320
1262
  typeNamespace: 'nasl.core',
1321
- typeName: 'Long',
1263
+ typeName: 'Integer',
1322
1264
  }, this.typeAnnotation, 'typeAnnotation'),
1323
1265
  }),
1324
1266
  ],
@@ -1330,8 +1272,8 @@ export class CallQueryComponent extends LogicItem {
1330
1272
  // 2.1 单聚合:`基本类型`
1331
1273
  let typeName;
1332
1274
  if (['COUNT', 'COUNTD'].includes(selectElements[0].aggregateName)) {
1333
- // 2.1.1. `COUNT`、`COUNTD` 返回 `Long`
1334
- typeName = 'Long';
1275
+ // 2.1.1. `COUNT`、`COUNTD` 返回 `Integer`
1276
+ typeName = 'Integer';
1335
1277
  } else if (['AVG'].includes(selectElements[0].aggregateName)) {
1336
1278
  const { entityAsName, propertyName } = selectElements[0].aggregateParam;
1337
1279
  const entity = entities.find((item: Entity) => item.name === entityAsName);
@@ -1343,7 +1285,7 @@ export class CallQueryComponent extends LogicItem {
1343
1285
  typeName = 'Double';
1344
1286
  }
1345
1287
  } else {
1346
- // 2.1.3. 其他返回列类型,包含:`Long`、`Long`、`Double`
1288
+ // 2.1.3. 其他返回列类型,包含:`Integer`、`Long`、`Double`
1347
1289
  const { entityAsName, propertyName } = selectElements[0].aggregateParam;
1348
1290
  const entity = entities.find((item: Entity) => item.name === entityAsName);
1349
1291
  const property = entity?.properties.find((item: any) => item.name === propertyName);
@@ -1364,7 +1306,7 @@ export class CallQueryComponent extends LogicItem {
1364
1306
  }, this, 'typeAnnotation');
1365
1307
  }
1366
1308
  } else {
1367
- // 2.3. 无聚合(默认情况):`{ list: List<Structure>, total: Long }`
1309
+ // 2.3. 无聚合(默认情况):`{ list: List<Structure>, total: Integer }`
1368
1310
  typeAnnotation = TypeAnnotation.from({
1369
1311
  concept: 'TypeAnnotation',
1370
1312
  typeKind: 'anonymousStructure',
@@ -1391,7 +1333,7 @@ export class CallQueryComponent extends LogicItem {
1391
1333
  concept: 'TypeAnnotation',
1392
1334
  typeKind: 'primitive',
1393
1335
  typeNamespace: 'nasl.core',
1394
- typeName: 'Long',
1336
+ typeName: 'Integer',
1395
1337
  }, this.typeAnnotation, 'typeAnnotation'),
1396
1338
  }),
1397
1339
  ],
@@ -92,10 +92,6 @@ export class ConfigPropertyValue extends BaseNode {
92
92
  });
93
93
  }
94
94
 
95
-
96
-
97
-
98
-
99
95
  //================================================================================
100
96
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
101
97
  // 自动生成的代码已结束。下面可以手动编写。
@@ -478,10 +478,6 @@ export class DataSource extends BaseNode {
478
478
  }
479
479
  }
480
480
 
481
- get dataSourceSqlType() {
482
- return JSON.parse(this.dataSourceConfig?.devProperty?.value || '{}')?.type;
483
- }
484
-
485
481
  // 获取datasource对应的数据源配置
486
482
  get dataSourceConfig() {
487
483
  let devProperty = null;
@@ -16,7 +16,6 @@ import { v4 as uuidv4 } from 'uuid';
16
16
  import BaseNode from '../common/BaseNode';
17
17
  import classMap from '../common/classMap';
18
18
  import TypeAnnotation from './TypeAnnotation__';
19
- import DatabaseTypeAnnotation from './DatabaseTypeAnnotation__';
20
19
  import Entity from './Entity__';
21
20
  import Module from './Module__';
22
21
  import App from './App__';
@@ -69,12 +68,6 @@ export class EntityProperty extends BaseNode {
69
68
  @property('TypeAnnotation')
70
69
  typeAnnotation: TypeAnnotation = undefined;
71
70
 
72
- /**
73
- * 数据库存储类型
74
- */
75
- @property('DatabaseTypeAnnotation')
76
- databaseTypeAnnotation: DatabaseTypeAnnotation = undefined;
77
-
78
71
  /**
79
72
  * 是否必填
80
73
  */
@@ -222,21 +215,6 @@ export class EntityProperty extends BaseNode {
222
215
  });
223
216
  }
224
217
 
225
- /**
226
- * 设置数据库存储类型
227
- */
228
- setDatabaseTypeAnnotation(databaseTypeAnnotation: DatabaseTypeAnnotation) {
229
- databaseTypeAnnotation._delete();
230
- const relationOptions = { parentNode: this, parentKey: 'databaseTypeAnnotation' };
231
- Object.assign(databaseTypeAnnotation, relationOptions);
232
- const object = {
233
- databaseTypeAnnotation,
234
- };
235
- this.update({
236
- ...object,
237
- });
238
- }
239
-
240
218
  /**
241
219
  * 设置是否必填
242
220
  */
@@ -337,56 +315,6 @@ export class EntityProperty extends BaseNode {
337
315
  return params;
338
316
  }
339
317
 
340
-
341
-
342
- /**
343
- * 删除数据库存储类型
344
- * @param name 数据库存储类型名称
345
- */
346
- removeDatabaseTypeAnnotation(name: string): void;
347
-
348
- /**
349
- * 删除数据库存储类型
350
- * @param databaseTypeAnnotation 已有的数据库存储类型实例
351
- */
352
- removeDatabaseTypeAnnotation(databaseTypeAnnotation: DatabaseTypeAnnotation): void;
353
-
354
- removeDatabaseTypeAnnotation(options: string | DatabaseTypeAnnotation) {
355
- let databaseTypeAnnotation: DatabaseTypeAnnotation;
356
- if (typeof options === 'string') {
357
- databaseTypeAnnotation = this.databaseTypeAnnotation;
358
- if (!databaseTypeAnnotation) {
359
- throw new Error('找不到数据库存储类型 ' + options);
360
- }
361
- } else {
362
- databaseTypeAnnotation = options;
363
- }
364
- return databaseTypeAnnotation.delete();
365
- }
366
-
367
- __removeDatabaseTypeAnnotation(databaseTypeAnnotation: DatabaseTypeAnnotation) {
368
- const parentKey = databaseTypeAnnotation.parentKey;
369
- const params: Params = {
370
- parentNode: this,
371
- parentKey,
372
- index: -1,
373
- object: null,
374
- oldObject: databaseTypeAnnotation,
375
- };
376
- if (parentKey) {
377
- params.parentKey = parentKey;
378
- if (Array.isArray((this as any)[parentKey])) {
379
- const index = (this as any)[parentKey].indexOf(databaseTypeAnnotation);
380
- ~index && (this as any)[parentKey].splice(index, 1);
381
- params.index = index;
382
- } else if ((this as any)[parentKey] === databaseTypeAnnotation) {
383
- params.index = 0;
384
- (this as any)[parentKey] = undefined;
385
- }
386
- }
387
- return params;
388
- }
389
-
390
318
  //================================================================================
391
319
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
392
320
  // 自动生成的代码已结束。下面可以手动编写。
@@ -443,69 +371,12 @@ export class EntityProperty extends BaseNode {
443
371
  ...object,
444
372
  });
445
373
  }
446
-
447
- get hasChildren() {
448
- const { typeKind, typeName, typeNamespace } = this.typeAnnotation;
449
- if (typeKind === 'reference' || typeKind === 'generic') {
450
- if (typeNamespace.endsWith('.enums'))
451
- return null;
452
- return [{}];
453
- } else if (typeNamespace === 'nasl.core' && ['String', 'Text', 'Email'].includes(typeName)) {
454
- return [{}];
455
- }
456
- return null;
457
- }
458
- get isTreeLeaf() {
459
- return !this.hasChildren;
460
- }
461
-
462
374
  /**
463
375
  * 是否展开
464
376
  */
465
377
  @property()
466
378
  isLeaf: boolean = true;
467
379
 
468
- getSelectRef() {
469
- try {
470
- const { typeName, typeKind, typeNamespace } = this.typeAnnotation;
471
- let completionChildren;
472
- if (typeKind === 'reference') {
473
- if (typeNamespace === 'nasl.ui' || typeNamespace === 'nasl.process') {
474
- const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
475
- const properties = (node as Structure)?.properties || [];
476
- completionChildren = properties;
477
- } else if (typeNamespace.endsWith('.enums')) {
478
- completionChildren = [];
479
- } else {
480
- const node = getNodeByNodeCallee(this.app, typeNamespace + '.' + typeName);
481
- const properties = node?.properties || [];
482
- completionChildren = properties;
483
- }
484
- } else if (typeKind === 'generic') {
485
- const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
486
- const properties = ((node as Structure)?.properties && [...(node as Structure)?.properties]) || [];
487
- for (let i = 0; i < properties.length; i++) {
488
- const item = properties[i];
489
- if (item?.typeAnnotation?.typeKind === 'typeParam') {
490
- const newItem = StructureProperty.from(item.toJSON());
491
- newItem.typeAnnotation = this?.typeAnnotation?.typeArguments[0];
492
- newItem.parentNode = this;
493
- properties[i] = newItem;
494
- }
495
- }
496
- completionChildren = properties;
497
- } else if (typeNamespace === 'nasl.core' && ['String', 'Text', 'Email'].includes(typeName)) {
498
- const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
499
- const properties = ((node as Structure)?.properties && [...(node as Structure)?.properties]) || [];
500
- completionChildren = properties;
501
- } else {
502
- completionChildren = [];
503
- }
504
- return completionChildren;
505
- } catch (err) {
506
- console.log(err);
507
- }
508
- }
509
380
  /**
510
381
  * 设置是否必填
511
382
  */
@@ -283,61 +283,6 @@ export class InterfaceParam extends BaseNode {
283
283
  return code;
284
284
  }
285
285
 
286
- get hasChildren() {
287
- const { typeKind, typeName, typeNamespace } = this.typeAnnotation;
288
- if (typeKind === 'reference' || typeKind === 'generic') {
289
- if (typeNamespace.endsWith('.enums'))
290
- return null;
291
- return [{}];
292
- } else if (typeNamespace === 'nasl.core' && ['String', 'Text', 'Email'].includes(typeName)) {
293
- return [{}];
294
- }
295
- return null;
296
- }
297
- get isTreeLeaf() {
298
- return !this.hasChildren;
299
- }
300
- getSelectRef() {
301
- try {
302
- const { typeName, typeKind, typeNamespace } = this.typeAnnotation;
303
- let completionChildren;
304
- if (typeKind === 'reference') {
305
- if (typeNamespace === 'nasl.ui' || typeNamespace === 'nasl.process') {
306
- const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
307
- const properties = (node as Structure)?.properties || [];
308
- completionChildren = properties;
309
- } else if (typeNamespace.endsWith('.enums')) {
310
- completionChildren = [];
311
- } else {
312
- const node = getNodeByNodeCallee(this.app, typeNamespace + '.' + typeName);
313
- const properties = node?.properties || [];
314
- completionChildren = properties;
315
- }
316
- } else if (typeKind === 'generic') {
317
- const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
318
- const properties = ((node as Structure)?.properties && [...(node as Structure)?.properties]) || [];
319
- for (let i = 0; i < properties.length; i++) {
320
- const item = properties[i];
321
- if (item?.typeAnnotation?.typeKind === 'typeParam') {
322
- const newItem = StructureProperty.from(item.toJSON());
323
- newItem.typeAnnotation = this?.typeAnnotation?.typeArguments[0];
324
- newItem.parentNode = this;
325
- properties[i] = newItem;
326
- }
327
- }
328
- completionChildren = properties;
329
- } else if (typeNamespace === 'nasl.core' && ['String', 'Text', 'Email'].includes(typeName)) {
330
- const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
331
- const properties = ((node as Structure)?.properties && [...(node as Structure)?.properties]) || [];
332
- completionChildren = properties;
333
- } else {
334
- completionChildren = [];
335
- }
336
- return completionChildren;
337
- } catch (err) {
338
- console.log(err);
339
- }
340
- }
341
286
  //================================================================================
342
287
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
343
288
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -521,14 +521,14 @@ export class Interface extends BaseNode {
521
521
  /**
522
522
  * 协议
523
523
  */
524
- @property()
525
- protocol: string = undefined;
524
+ // @property()
525
+ // protocol: string = undefined;
526
526
 
527
527
  /**
528
528
  * 协议参数列表
529
529
  */
530
- @property('Param')
531
- protocolParams: Array<Param> = [];
530
+ // @property('Param')
531
+ // protocolParams: Array<Param> = [];
532
532
 
533
533
  /**
534
534
  * 是否可编辑