@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
@@ -249,7 +249,7 @@ export class Logic extends BaseNode {
249
249
  });
250
250
  }
251
251
 
252
- getTypeParamExistingNames(excludedList: Array<TypeParam> = []) {
252
+ getTypeParamExistingNames(excludedList: Array<TypeParam> = []) {
253
253
  const excludedSet = new Set(excludedList);
254
254
  return ((this.typeParams as TypeParam[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
255
255
  }
@@ -390,7 +390,6 @@ export class Logic extends BaseNode {
390
390
  return node;
391
391
  }
392
392
 
393
-
394
393
  getParamUniqueName(name = 'param1') {
395
394
  return utils.unique(name, this.getVarExistingNames(), undefined, false);
396
395
  }
@@ -528,7 +527,6 @@ export class Logic extends BaseNode {
528
527
  return node;
529
528
  }
530
529
 
531
-
532
530
  getReturnUniqueName(name = 'result') {
533
531
  return utils.unique(name, this.getVarExistingNames(), undefined, false);
534
532
  }
@@ -666,7 +664,6 @@ export class Logic extends BaseNode {
666
664
  return node;
667
665
  }
668
666
 
669
-
670
667
  getVariableUniqueName(name = 'variable1') {
671
668
  return utils.unique(name, this.getVarExistingNames(), undefined, false);
672
669
  }
@@ -804,11 +801,6 @@ export class Logic extends BaseNode {
804
801
  return node;
805
802
  }
806
803
 
807
-
808
-
809
-
810
-
811
-
812
804
  /**
813
805
  * 插入逻辑项
814
806
  * @internal
@@ -841,8 +833,6 @@ export class Logic extends BaseNode {
841
833
  return logicItem;
842
834
  }
843
835
 
844
-
845
-
846
836
  /**
847
837
  * 插入逻辑项
848
838
  * @param logicItemOptions 逻辑项参数
@@ -865,8 +855,6 @@ export class Logic extends BaseNode {
865
855
  return node;
866
856
  }
867
857
 
868
-
869
-
870
858
  /**
871
859
  * 添加逻辑项
872
860
  * @internal
@@ -886,8 +874,6 @@ export class Logic extends BaseNode {
886
874
  return this._insertItemInBodyAt(options as any, index);
887
875
  }
888
876
 
889
-
890
-
891
877
  /**
892
878
  * 添加逻辑项
893
879
  * @param logicItemOptions 逻辑项参数
@@ -911,8 +897,6 @@ export class Logic extends BaseNode {
911
897
  return node;
912
898
  }
913
899
 
914
-
915
-
916
900
  /**
917
901
  * 插入逻辑项
918
902
  * @internal
@@ -945,8 +929,6 @@ export class Logic extends BaseNode {
945
929
  return logicItem;
946
930
  }
947
931
 
948
-
949
-
950
932
  /**
951
933
  * 插入逻辑项
952
934
  * @param logicItemOptions 逻辑项参数
@@ -969,8 +951,6 @@ export class Logic extends BaseNode {
969
951
  return node;
970
952
  }
971
953
 
972
-
973
-
974
954
  /**
975
955
  * 添加逻辑项
976
956
  * @internal
@@ -990,8 +970,6 @@ export class Logic extends BaseNode {
990
970
  return this._insertItemInPlaygroundAt(options as any, index);
991
971
  }
992
972
 
993
-
994
-
995
973
  /**
996
974
  * 添加逻辑项
997
975
  * @param logicItemOptions 逻辑项参数
@@ -1015,9 +993,6 @@ export class Logic extends BaseNode {
1015
993
  return node;
1016
994
  }
1017
995
 
1018
-
1019
-
1020
-
1021
996
  /**
1022
997
  * 删除事务
1023
998
  * @param name 事务名称
@@ -1066,8 +1041,6 @@ export class Logic extends BaseNode {
1066
1041
  return params;
1067
1042
  }
1068
1043
 
1069
-
1070
-
1071
1044
  /**
1072
1045
  * 删除类型参数
1073
1046
  * @param name 类型参数名称
@@ -1116,8 +1089,6 @@ export class Logic extends BaseNode {
1116
1089
  return params;
1117
1090
  }
1118
1091
 
1119
-
1120
-
1121
1092
  /**
1122
1093
  * 删除输入参数
1123
1094
  * @param name 输入参数名称
@@ -1166,8 +1137,6 @@ export class Logic extends BaseNode {
1166
1137
  return params;
1167
1138
  }
1168
1139
 
1169
-
1170
-
1171
1140
  /**
1172
1141
  * 删除输出参数
1173
1142
  * @param name 输出参数名称
@@ -1216,8 +1185,6 @@ export class Logic extends BaseNode {
1216
1185
  return params;
1217
1186
  }
1218
1187
 
1219
-
1220
-
1221
1188
  /**
1222
1189
  * 删除变量
1223
1190
  * @param name 变量名称
@@ -1266,8 +1233,6 @@ export class Logic extends BaseNode {
1266
1233
  return params;
1267
1234
  }
1268
1235
 
1269
-
1270
-
1271
1236
  /**
1272
1237
  * 删除逻辑项
1273
1238
  * @param logicItem 已有的逻辑项实例
@@ -1275,12 +1240,10 @@ export class Logic extends BaseNode {
1275
1240
  removeItemInBody(logicItem: LogicItem): void;
1276
1241
 
1277
1242
  removeItemInBody(options: LogicItem) {
1278
- let logicItem: LogicItem = options;
1243
+ const logicItem: LogicItem = options;
1279
1244
  return logicItem.delete();
1280
1245
  }
1281
1246
 
1282
-
1283
-
1284
1247
  /**
1285
1248
  * 删除逻辑项
1286
1249
  * @param logicItem 已有的逻辑项实例
@@ -1288,7 +1251,7 @@ export class Logic extends BaseNode {
1288
1251
  removeItemInPlayground(logicItem: LogicItem): void;
1289
1252
 
1290
1253
  removeItemInPlayground(options: LogicItem) {
1291
- let logicItem: LogicItem = options;
1254
+ const logicItem: LogicItem = options;
1292
1255
  return logicItem.delete();
1293
1256
  }
1294
1257
 
@@ -1477,7 +1440,7 @@ export class Logic extends BaseNode {
1477
1440
  const logicName = this.name;
1478
1441
  let serviceType = 'micro';
1479
1442
  let method = 'POST';
1480
- let path = `/api/${logicName}`;
1443
+ let path = `/api/lcplogics/${logicName}`;
1481
1444
  if (concept === 'Module') {
1482
1445
  path = `/api/${entityName.replace('-', '_')}/${logicName}`;
1483
1446
  } else if (concept === 'Namespace') {
@@ -1740,7 +1703,7 @@ export class Logic extends BaseNode {
1740
1703
  if (leftCode === node.name) {
1741
1704
  const rightNode: any = rightIndex.length === 1 ? assignment.rights[rightIndex[0]]?.expression : assignment.rights[rightIndex[0]]?.members[rightIndex[1]];
1742
1705
  // 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
1743
- if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && rightNode.ideVersion !== '2.11')) {
1706
+ if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && !rightNode.isAutoInfer())) {
1744
1707
  code += ': ';
1745
1708
  code += rightNode.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true })) || 'null';
1746
1709
  } else {
@@ -1761,7 +1724,7 @@ export class Logic extends BaseNode {
1761
1724
  } else {
1762
1725
  const rightNode: any = assignment.right;
1763
1726
  // 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
1764
- if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && rightNode.ideVersion !== '2.11')) {
1727
+ if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && !rightNode.isAutoInfer())) {
1765
1728
  code += ': ';
1766
1729
  code += rightNode.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true })) || 'null';
1767
1730
  } else {
@@ -1783,8 +1746,12 @@ export class Logic extends BaseNode {
1783
1746
  } else {
1784
1747
  // 如果长度小于2 并且不是虚拟节点就 加 报错,
1785
1748
  if (this.body.length <= 2 && !(this.parentNode instanceof Namespace)) {
1786
- code += indent((state?.tabSize || 0) + 1);
1787
- code += 'const __LogicEmpty: any = null;';
1749
+ if (this.body.length && this.body[0].concept === 'JavaLogic') {
1750
+ code += '';
1751
+ } else {
1752
+ code += indent((state?.tabSize || 0) + 1);
1753
+ code += 'const __LogicEmpty: any = null;';
1754
+ }
1788
1755
  }
1789
1756
  this.body.forEach((item) => {
1790
1757
  code += item.toEmbeddedTS && item.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
@@ -615,17 +615,21 @@ export class Match extends LogicItem {
615
615
  let code = '';
616
616
  // 祖先逻辑
617
617
  const ancestorLogic = this.getAncestor('Logic');
618
- if (ancestorLogic) {
619
- code += 'await (async () => {\n';
620
- } else {
621
- code += '(() => {\n';
618
+ if (this.isExpression || !ancestorLogic) {
619
+ if (ancestorLogic) {
620
+ code += 'await (async () => {\n';
621
+ } else {
622
+ code += '(() => {\n';
623
+ }
622
624
  }
623
625
  if (this.expression && Array.isArray(this.cases)) {
624
626
  this.cases.forEach((item, index) => {
625
627
  code += item?.toJS?.(this.expression, index, this.cases.length);
626
628
  });
627
629
  }
628
- code += '})()';
630
+ if (this.isExpression || !ancestorLogic) {
631
+ code += '})()';
632
+ }
629
633
  return code;
630
634
  }
631
635
 
@@ -674,6 +678,7 @@ export class Match extends LogicItem {
674
678
  && this.parentNode.concept !== 'Assignment'
675
679
  && this.parentNode.concept !== 'ForEachStatement'
676
680
  && this.parentNode.concept !== 'SelectMembers'
681
+ && this.parentNode.concept !== 'UnaryExpression'
677
682
  && this.parentNode.concept !== 'BinaryExpression'
678
683
  && this.parentNode.concept !== 'StringInterpolation'
679
684
  && this.parentNode.concept !== 'MemberExpression'
@@ -348,7 +348,7 @@ export class MemberExpression extends LogicItem {
348
348
  }
349
349
  firstMemberExpressionNode() {
350
350
  let tempNode: any = this;
351
- while (tempNode.parentNode.concept === 'MemberExpression') {
351
+ while (tempNode.parentNode?.concept === 'MemberExpression') {
352
352
  tempNode = tempNode.parentNode;
353
353
  }
354
354
  return tempNode;
@@ -0,0 +1,118 @@
1
+ //================================================================================
2
+ // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
3
+ // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
4
+ //================================================================================
5
+ import { EventPayload, Params } from '../common/EventEmitter';
6
+ import { concept, excludedInJSON, property } from '../decorators';
7
+
8
+ import * as utils from '../utils';
9
+ import { v4 as uuidv4 } from 'uuid';
10
+ import BaseNode from '../common/BaseNode';
11
+ import classMap from '../common/classMap';
12
+
13
+
14
+ /**
15
+ * 微应用
16
+ */
17
+ @concept('微应用')
18
+ export class MicroApp extends BaseNode {
19
+ /**
20
+ * 产品概念
21
+ */
22
+ @property()
23
+ concept: 'MicroApp' = 'MicroApp';
24
+
25
+ /**
26
+ * 微前端框架
27
+ */
28
+ @property()
29
+ framework: 'qiankun' | 'icestark' = undefined;
30
+
31
+ /**
32
+ * 微应用名称
33
+ */
34
+ @property()
35
+ name: string = undefined;
36
+
37
+ /**
38
+ * 页面路径前缀
39
+ */
40
+ @property()
41
+ routePrefix: string = undefined;
42
+
43
+ /**
44
+ * 接口和静态资源前缀
45
+ */
46
+ @property()
47
+ proxyPrefix: string = undefined;
48
+
49
+ /**
50
+ * 登录页面地址
51
+ */
52
+ @property()
53
+ loginUrl: string = undefined;
54
+
55
+ /**
56
+ * 无权限页面地址
57
+ */
58
+ @property()
59
+ noAuthUrl: string = undefined;
60
+
61
+ /**
62
+ * 404页面地址
63
+ */
64
+ @property()
65
+ notFoundUrl: string = undefined;
66
+
67
+
68
+
69
+ /**
70
+ * @param source 需要合并的部分参数
71
+ */
72
+ constructor(source?: Partial<MicroApp>) {
73
+ source = Object.assign({}, MicroApp.getDefaultOptions(), source);
74
+ super(source);
75
+ super.subConstructor(source);
76
+ }
77
+ getClassName() {
78
+ return 'MicroApp';
79
+ }
80
+
81
+ static from(source: any, parentNode?: any, parentKey?: string): MicroApp {
82
+ return super.from(source, parentNode, parentKey) as MicroApp;
83
+ }
84
+
85
+ /**
86
+ * 从父级删除该节点
87
+ * @internal
88
+ */
89
+ _delete() {
90
+ let params: Params = null;
91
+ if (this.parentNode) {
92
+ params = (this.parentNode as any)?.__removeMicroApp?.(this);
93
+ }
94
+ return params;
95
+ }
96
+
97
+
98
+
99
+
100
+
101
+
102
+ //================================================================================
103
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
104
+ // 自动生成的代码已结束。下面可以手动编写。
105
+ //================================================================================
106
+
107
+ //================================================================================
108
+ // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
109
+ // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
110
+ //================================================================================
111
+ }
112
+
113
+ classMap.MicroApp = MicroApp;
114
+ export default MicroApp;
115
+ //================================================================================
116
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
117
+ // 自动生成的代码已结束。下面可以手动编写。
118
+ //================================================================================