@lcap/nasl 2.18.0-beta.7 → 2.20.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 (336) hide show
  1. package/out/automate/engine/index.js +3 -3
  2. package/out/automate/engine/index.js.map +1 -1
  3. package/out/bak/translator.js +85 -37
  4. package/out/bak/translator.js.map +1 -1
  5. package/out/common/BaseNode.d.ts +6 -10
  6. package/out/common/BaseNode.js +7 -53
  7. package/out/common/BaseNode.js.map +1 -1
  8. package/out/concepts/AnonymousFunction__.js.map +1 -1
  9. package/out/concepts/App__.d.ts +0 -10
  10. package/out/concepts/App__.js +0 -74
  11. package/out/concepts/App__.js.map +1 -1
  12. package/out/concepts/Assignee__.js.map +1 -1
  13. package/out/concepts/AssignmentLine__.d.ts +5 -5
  14. package/out/concepts/AssignmentLine__.js +6 -6
  15. package/out/concepts/AssignmentLine__.js.map +1 -1
  16. package/out/concepts/Assignment__.js +2 -1
  17. package/out/concepts/Assignment__.js.map +1 -1
  18. package/out/concepts/BatchAssignment__.d.ts +60 -60
  19. package/out/concepts/BatchAssignment__.js +41 -68
  20. package/out/concepts/BatchAssignment__.js.map +1 -1
  21. package/out/concepts/BindAttribute__.d.ts +0 -19
  22. package/out/concepts/BindAttribute__.js +2 -39
  23. package/out/concepts/BindAttribute__.js.map +1 -1
  24. package/out/concepts/BindEvent__.js.map +1 -1
  25. package/out/concepts/BindStyle__.d.ts +2 -2
  26. package/out/concepts/BindStyle__.js +3 -3
  27. package/out/concepts/BindStyle__.js.map +1 -1
  28. package/out/concepts/BooleanLiteral__.js +8 -0
  29. package/out/concepts/BooleanLiteral__.js.map +1 -1
  30. package/out/concepts/CallFunction__.js +25 -58
  31. package/out/concepts/CallFunction__.js.map +1 -1
  32. package/out/concepts/CallInterface__.d.ts +0 -7
  33. package/out/concepts/CallInterface__.js +7 -53
  34. package/out/concepts/CallInterface__.js.map +1 -1
  35. package/out/concepts/CallLogic__.d.ts +1 -2
  36. package/out/concepts/CallLogic__.js +25 -89
  37. package/out/concepts/CallLogic__.js.map +1 -1
  38. package/out/concepts/CallQueryComponent__.js +1 -13
  39. package/out/concepts/CallQueryComponent__.js.map +1 -1
  40. package/out/concepts/CompletionProperty__.js +0 -3
  41. package/out/concepts/CompletionProperty__.js.map +1 -1
  42. package/out/concepts/ConfigGroup__.js.map +1 -1
  43. package/out/concepts/ConfigProperty__.js.map +1 -1
  44. package/out/concepts/Configuration__.js.map +1 -1
  45. package/out/concepts/DataSource__.d.ts +0 -6
  46. package/out/concepts/DataSource__.js +0 -41
  47. package/out/concepts/DataSource__.js.map +1 -1
  48. package/out/concepts/Destination__.d.ts +2 -11
  49. package/out/concepts/Destination__.js +48 -148
  50. package/out/concepts/Destination__.js.map +1 -1
  51. package/out/concepts/EntityProperty__.d.ts +8 -21
  52. package/out/concepts/EntityProperty__.js +23 -109
  53. package/out/concepts/EntityProperty__.js.map +1 -1
  54. package/out/concepts/Entity__.d.ts +0 -32
  55. package/out/concepts/Entity__.js +2 -117
  56. package/out/concepts/Entity__.js.map +1 -1
  57. package/out/concepts/Enum__.js +4 -0
  58. package/out/concepts/Enum__.js.map +1 -1
  59. package/out/concepts/Event__.js.map +1 -1
  60. package/out/concepts/ForEachStatement__.d.ts +4 -0
  61. package/out/concepts/ForEachStatement__.js +8 -4
  62. package/out/concepts/ForEachStatement__.js.map +1 -1
  63. package/out/concepts/Function__.js.map +1 -1
  64. package/out/concepts/Identifier__.js +4 -16
  65. package/out/concepts/Identifier__.js.map +1 -1
  66. package/out/concepts/IfStatement__.d.ts +0 -8
  67. package/out/concepts/IfStatement__.js +0 -22
  68. package/out/concepts/IfStatement__.js.map +1 -1
  69. package/out/concepts/InterfaceParam__.js.map +1 -1
  70. package/out/concepts/Interface__.js.map +1 -1
  71. package/out/concepts/LogicItem__.d.ts +1 -1
  72. package/out/concepts/LogicItem__.js.map +1 -1
  73. package/out/concepts/Logic__.d.ts +1 -6
  74. package/out/concepts/Logic__.js +50 -150
  75. package/out/concepts/Logic__.js.map +1 -1
  76. package/out/concepts/MatchCase__.d.ts +1 -1
  77. package/out/concepts/MatchCase__.js +8 -15
  78. package/out/concepts/MatchCase__.js.map +1 -1
  79. package/out/concepts/Match__.d.ts +19 -21
  80. package/out/concepts/Match__.js +25 -112
  81. package/out/concepts/Match__.js.map +1 -1
  82. package/out/concepts/MemberExpression__.d.ts +1 -4
  83. package/out/concepts/MemberExpression__.js +15 -30
  84. package/out/concepts/MemberExpression__.js.map +1 -1
  85. package/out/concepts/Module__.js.map +1 -1
  86. package/out/concepts/Namespace__.js.map +1 -1
  87. package/out/concepts/NumericLiteral__.js +1 -1
  88. package/out/concepts/NumericLiteral__.js.map +1 -1
  89. package/out/concepts/OqlQueryComponent__.d.ts +3 -7
  90. package/out/concepts/OqlQueryComponent__.js +95 -56
  91. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  92. package/out/concepts/Param__.d.ts +1 -1
  93. package/out/concepts/Param__.js +4 -40
  94. package/out/concepts/Param__.js.map +1 -1
  95. package/out/concepts/ProcessComponent__.js.map +1 -1
  96. package/out/concepts/ProcessElement__.js.map +1 -1
  97. package/out/concepts/Process__.js.map +1 -1
  98. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  99. package/out/concepts/QueryOrderByExpression__.d.ts +3 -3
  100. package/out/concepts/QueryOrderByExpression__.js +3 -3
  101. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  102. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  103. package/out/concepts/Return__.js +2 -38
  104. package/out/concepts/Return__.js.map +1 -1
  105. package/out/concepts/SelectMembers__.d.ts +1 -1
  106. package/out/concepts/SelectMembers__.js +2 -2
  107. package/out/concepts/SelectMembers__.js.map +1 -1
  108. package/out/concepts/SqlQueryComponent__.d.ts +4 -2
  109. package/out/concepts/SqlQueryComponent__.js +88 -9
  110. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  111. package/out/concepts/StringLiteral__.js +7 -0
  112. package/out/concepts/StringLiteral__.js.map +1 -1
  113. package/out/concepts/StructureProperty__.js.map +1 -1
  114. package/out/concepts/Structure__.js.map +1 -1
  115. package/out/concepts/TypeAnnotation__.d.ts +0 -1
  116. package/out/concepts/TypeAnnotation__.js +12 -25
  117. package/out/concepts/TypeAnnotation__.js.map +1 -1
  118. package/out/concepts/TypeParam__.d.ts +0 -1
  119. package/out/concepts/TypeParam__.js +0 -2
  120. package/out/concepts/TypeParam__.js.map +1 -1
  121. package/out/concepts/UnaryExpression__.js +9 -6
  122. package/out/concepts/UnaryExpression__.js.map +1 -1
  123. package/out/concepts/ValidationRule__.js +23 -88
  124. package/out/concepts/ValidationRule__.js.map +1 -1
  125. package/out/concepts/Variable__.js +2 -38
  126. package/out/concepts/Variable__.js.map +1 -1
  127. package/out/concepts/ViewComponent__.js.map +1 -1
  128. package/out/concepts/ViewElement__.d.ts +29 -30
  129. package/out/concepts/ViewElement__.js +52 -118
  130. package/out/concepts/ViewElement__.js.map +1 -1
  131. package/out/concepts/View__.d.ts +3 -4
  132. package/out/concepts/View__.js +83 -97
  133. package/out/concepts/View__.js.map +1 -1
  134. package/out/concepts/WhileStatement__.js +1 -1
  135. package/out/concepts/WhileStatement__.js.map +1 -1
  136. package/out/concepts/basics/stdlib/nasl.browser.js +0 -50
  137. package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -1
  138. package/out/concepts/basics/stdlib/nasl.ui.js +4 -36
  139. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  140. package/out/concepts/basics/stdlib/nasl.util.js +43 -63
  141. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  142. package/out/concepts/index__.d.ts +0 -2
  143. package/out/concepts/index__.js +0 -2
  144. package/out/concepts/index__.js.map +1 -1
  145. package/out/generator/genBundleFiles.d.ts +2 -5
  146. package/out/generator/genBundleFiles.js +155 -108
  147. package/out/generator/genBundleFiles.js.map +1 -1
  148. package/out/generator/genMetaData.d.ts +10 -1
  149. package/out/generator/genMetaData.js +50 -189
  150. package/out/generator/genMetaData.js.map +1 -1
  151. package/out/generator/index.d.ts +0 -1
  152. package/out/generator/index.js +0 -1
  153. package/out/generator/index.js.map +1 -1
  154. package/out/index.d.ts +2 -3
  155. package/out/index.js +1 -5
  156. package/out/index.js.map +1 -1
  157. package/out/server/entity2LogicNamespace.js +11 -11
  158. package/out/server/entity2LogicNamespace.js.map +1 -1
  159. package/out/server/extendBaseNode.js +18 -4
  160. package/out/server/extendBaseNode.js.map +1 -1
  161. package/out/server/formatTsUtils.d.ts +2 -1
  162. package/out/server/formatTsUtils.js +64 -40
  163. package/out/server/formatTsUtils.js.map +1 -1
  164. package/out/server/getLogics.js +6 -13
  165. package/out/server/getLogics.js.map +1 -1
  166. package/out/server/getMemberIdentifier.js +7 -7
  167. package/out/server/getMemberIdentifier.js.map +1 -1
  168. package/out/server/getProcesses.d.ts +1 -1
  169. package/out/server/getProcesses.js +1 -1
  170. package/out/server/getProcesses.js.map +1 -1
  171. package/out/server/index.d.ts +1 -0
  172. package/out/server/index.js +27 -2
  173. package/out/server/index.js.map +1 -1
  174. package/out/server/naslServer.d.ts +7 -47
  175. package/out/server/naslServer.js +399 -604
  176. package/out/server/naslServer.js.map +1 -1
  177. package/out/server/naslStdlibMap.js +28 -30
  178. package/out/server/naslStdlibMap.js.map +1 -1
  179. package/out/server/translator.js +11 -59
  180. package/out/server/translator.js.map +1 -1
  181. package/out/service/storage/init.js +3 -33
  182. package/out/service/storage/init.js.map +1 -1
  183. package/out/templator/genCreateBlock.js +4 -6
  184. package/out/templator/genCreateBlock.js.map +1 -1
  185. package/out/templator/genCurdEditMultipleKeyBlock.js +4 -7
  186. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  187. package/out/templator/genCurdMultipleKeyBlock.js +5 -7
  188. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  189. package/out/templator/genEnumSelectBlock.js +2 -5
  190. package/out/templator/genEnumSelectBlock.js.map +1 -1
  191. package/out/templator/genGridViewBlock.js +2 -2
  192. package/out/templator/genGridViewBlock.js.map +1 -1
  193. package/out/templator/genListViewBlock.js +2 -2
  194. package/out/templator/genListViewBlock.js.map +1 -1
  195. package/out/templator/genQueryComponent.d.ts +2 -2
  196. package/out/templator/genQueryComponent.js +1 -4
  197. package/out/templator/genQueryComponent.js.map +1 -1
  198. package/out/templator/genTableBlock.js +2 -2
  199. package/out/templator/genTableBlock.js.map +1 -1
  200. package/out/templator/genUpdateBlock.js +3 -4
  201. package/out/templator/genUpdateBlock.js.map +1 -1
  202. package/out/templator/utils.js +1 -1
  203. package/out/templator/utils.js.map +1 -1
  204. package/out/test/integration/node-nasl-server.js +38 -10
  205. package/out/test/integration/node-nasl-server.js.map +1 -1
  206. package/out/translator/index.d.ts +0 -1
  207. package/out/translator/index.js +1 -1
  208. package/out/translator/index.js.map +1 -1
  209. package/out/utils/index.d.ts +0 -1
  210. package/out/utils/index.js +1 -38
  211. package/out/utils/index.js.map +1 -1
  212. package/out/utils/string.d.ts +2 -15
  213. package/out/utils/string.js +3 -18
  214. package/out/utils/string.js.map +1 -1
  215. package/package.json +2 -2
  216. package/sandbox/stdlib/nasl.auth.ts +1 -1
  217. package/sandbox/stdlib/nasl.core.ts +1 -0
  218. package/sandbox/stdlib/nasl.logging.ts +4 -4
  219. package/sandbox/stdlib/nasl.util.ts +8 -4
  220. package/src/automate/engine/index.js +4 -4
  221. package/src/automate/engine/uniqueName.js +3 -3
  222. package/src/automate/template/myProcess.js +1 -1
  223. package/src/automate/upgrader/2.20.js +41 -0
  224. package/src/bak/translator.js +4 -1
  225. package/src/concepts/AnonymousFunction__.ts +48 -2
  226. package/src/concepts/App__.ts +288 -615
  227. package/src/concepts/BatchAssignment__.ts +45 -1
  228. package/src/concepts/BindAttribute__.ts +18 -25
  229. package/src/concepts/BindDirective__.ts +7 -0
  230. package/src/concepts/BindEvent__.ts +7 -0
  231. package/src/concepts/BindStyle__.ts +7 -0
  232. package/src/concepts/CallFunction__.ts +34 -45
  233. package/src/concepts/CallInterface__.ts +2 -1
  234. package/src/concepts/CallLogic__.ts +61 -44
  235. package/src/concepts/CallQueryComponent__.ts +4 -1
  236. package/src/concepts/Constant__.ts +7 -0
  237. package/src/concepts/DataSource__.ts +57 -5
  238. package/src/concepts/Destination__.ts +8 -21
  239. package/src/concepts/Frontend__.ts +937 -0
  240. package/src/concepts/Identifier__.ts +18 -16
  241. package/src/concepts/LogicItem__.ts +8 -1
  242. package/src/concepts/Logic__.ts +128 -142
  243. package/src/concepts/Match__.ts +13 -29
  244. package/src/concepts/NewComposite__.ts +1357 -0
  245. package/src/concepts/NewList__.ts +440 -0
  246. package/src/concepts/NewMap__.ts +666 -0
  247. package/src/concepts/New__.ts +73 -0
  248. package/src/concepts/Param__.ts +245 -199
  249. package/src/concepts/ProcessElement__.ts +43 -36
  250. package/src/concepts/ProcessOutcomes__.ts +90 -0
  251. package/src/concepts/Process__.ts +1 -23
  252. package/src/concepts/Return__.ts +11 -1
  253. package/src/concepts/SelectMembers__.ts +3 -3
  254. package/src/concepts/Transactional__.ts +7 -0
  255. package/src/concepts/TypeAnnotation__.ts +54 -49
  256. package/src/concepts/ValidationRule__.ts +19 -1
  257. package/src/concepts/Variable__.ts +12 -6
  258. package/src/concepts/ViewElement__.ts +51 -7
  259. package/src/concepts/View__.ts +21 -25
  260. package/src/concepts/basics/stdlib/nasl.auth.ts +1 -1
  261. package/src/concepts/basics/stdlib/nasl.logging.ts +5 -0
  262. package/src/concepts/basics/stdlib/nasl.ui.ts +2 -0
  263. package/src/concepts/basics/stdlib/nasl.util.ts +153 -19
  264. package/src/concepts/index__.ts +7 -0
  265. package/src/enums/KEYWORDS.ts +9 -0
  266. package/src/generator/genBundleFiles.ts +43 -29
  267. package/src/generator/genMetaData.ts +5 -10
  268. package/src/generator/genReleaseBody.ts +77 -41
  269. package/src/generator/index.ts +1 -0
  270. package/src/generator/permission.ts +261 -0
  271. package/src/index.ts +1 -1
  272. package/src/server/entity2LogicNamespace.ts +90 -10
  273. package/src/server/extendBaseNode.ts +29 -3
  274. package/src/server/formatTsUtils.ts +6 -0
  275. package/src/server/getLogics.ts +13 -1
  276. package/src/server/getMemberIdentifier.ts +5 -5
  277. package/src/server/naslServer.ts +235 -58
  278. package/src/server/process2LogicNamespace.ts +8 -0
  279. package/src/server/translator.ts +33 -1
  280. package/src/service/creator/add.configs.js +4 -0
  281. package/src/service/datasource/api.js +11 -0
  282. package/src/service/datasource/index.js +6 -0
  283. package/src/service/storage/init.ts +12 -0
  284. package/src/service/video/VideoTranscribe.js +1 -0
  285. package/src/templator/genEditTableBlock.ts +8 -16
  286. package/src/templator/genGetBlock.ts +18 -19
  287. package/src/templator/genGridViewBlock.ts +18 -18
  288. package/src/templator/genListViewBlock.ts +8 -11
  289. package/src/templator/genTableBlock.ts +6 -10
  290. package/ts-worker/lib/tsserver.js +8 -1
  291. package/out/automate/engine/2.14-components.d.ts +0 -1115
  292. package/out/automate/engine/2.14-components.js +0 -1087
  293. package/out/automate/engine/2.14-components.js.map +0 -1
  294. package/out/concepts/ExternalDestination__.d.ts +0 -73
  295. package/out/concepts/ExternalDestination__.js +0 -264
  296. package/out/concepts/ExternalDestination__.js.map +0 -1
  297. package/out/concepts/MatchExpression__.d.ts +0 -97
  298. package/out/concepts/MatchExpression__.js +0 -281
  299. package/out/concepts/MatchExpression__.js.map +0 -1
  300. package/out/concepts/StringInterpolation__.d.ts +0 -113
  301. package/out/concepts/StringInterpolation__.js +0 -227
  302. package/out/concepts/StringInterpolation__.js.map +0 -1
  303. package/out/generator/genReleaseBody.d.ts +0 -41
  304. package/out/generator/genReleaseBody.js +0 -349
  305. package/out/generator/genReleaseBody.js.map +0 -1
  306. package/out/service/defaultErrorMessage.json +0 -97
  307. package/out/service/logic/api.d.ts +0 -9
  308. package/out/service/logic/api.js +0 -11
  309. package/out/service/logic/api.js.map +0 -1
  310. package/out/service/logic/index.d.ts +0 -2
  311. package/out/service/logic/index.js +0 -10
  312. package/out/service/logic/index.js.map +0 -1
  313. package/sandbox/stdlib/dist/nasl.logging.js +0 -0
  314. package/src/automate/engine/dist/index.dev.js +0 -517
  315. package/src/common/dist/BaseNode.js +0 -1101
  316. package/src/concepts/basics/stdlib/dist/nasl.util.js +0 -1503
  317. package/src/concepts/basics/stdlib/dist/reference2TypeAnnotationList.js +0 -24
  318. package/src/concepts/dist/Anchor__.js +0 -179
  319. package/src/concepts/dist/Assignment__.js +0 -301
  320. package/src/concepts/dist/CallFunction__.js +0 -513
  321. package/src/concepts/dist/CallInterface__.js +0 -533
  322. package/src/concepts/dist/CallLogic__.js +0 -892
  323. package/src/concepts/dist/ForEachStatement__.js +0 -426
  324. package/src/concepts/dist/MatchCase__.js +0 -587
  325. package/src/concepts/dist/Match__.js +0 -631
  326. package/src/concepts/dist/MemberExpression__.js +0 -348
  327. package/src/concepts/dist/Param__.js +0 -538
  328. package/src/concepts/dist/Return__.js +0 -494
  329. package/src/concepts/dist/Variable__.js +0 -537
  330. package/src/concepts/dist/ViewElement__.js +0 -1680
  331. package/src/generator/dist/genBundleFiles.js +0 -261
  332. package/src/generator/dist/genMetaData.js +0 -249
  333. package/src/server/dist/formatTsUtils.js +0 -683
  334. package/src/server/dist/naslServer.js +0 -3474
  335. package/src/service/storage/dist/init.js +0 -572
  336. package/ts-worker/dist/webpack.config.dev.js +0 -108
@@ -39,8 +39,6 @@ export class Identifier extends LogicItem {
39
39
  @property()
40
40
  name: string = undefined;
41
41
 
42
-
43
-
44
42
  /**
45
43
  * @param source 需要合并的部分参数
46
44
  */
@@ -54,13 +52,6 @@ export class Identifier extends LogicItem {
54
52
  return super.from(source, parentNode, parentKey) as Identifier;
55
53
  }
56
54
 
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
55
  //================================================================================
65
56
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
66
57
  // 自动生成的代码已结束。下面可以手动编写。
@@ -95,6 +86,8 @@ export class Identifier extends LogicItem {
95
86
  enumName = `${this.namespace}.${this.name}`;
96
87
  }
97
88
  name = enumName;
89
+ } else if (this.namespace.endsWith('logics')) {
90
+ name = `'${this.namespace}.${name}'`;
98
91
  }
99
92
  }
100
93
  return name;
@@ -134,6 +127,8 @@ export class Identifier extends LogicItem {
134
127
  enumName = `${this.namespace}.${this.name}`;
135
128
  }
136
129
  name = enumName;
130
+ } else if (this.namespace.endsWith('logics')) {
131
+ name = `'${this.namespace}.${name}'`;
137
132
  }
138
133
  }
139
134
  return name;
@@ -189,13 +184,10 @@ export class Identifier extends LogicItem {
189
184
  return this.name;
190
185
  }
191
186
  }
192
- // 因为右侧枚举要赋值就赋值toList方法一下
193
- if (this.namespace && this.namespace.endsWith('enums')) {
194
- // 绑定类型
195
- if (this.parentNode instanceof BindAttribute) {
196
- // this.parentNode.name === 'data-source'
197
- return (this.namespace + '.' || '') + this.name + '.toList';
198
- }
187
+
188
+ // 全局变量在不是页面的地方放置,就会报错
189
+ if (this.namespace?.startsWith('app.frontendVariables') && !this.view) {
190
+ return '__FRONTENDVARIABLES__';
199
191
  }
200
192
 
201
193
  // 如果是nasl.util.Enum 的子集里的 Identifier > MemberExpression > Argument > callfunction
@@ -271,6 +263,16 @@ export class Identifier extends LogicItem {
271
263
  });
272
264
  }
273
265
 
266
+ setNameAndNamespace(name: string, namespace: string) {
267
+ const object = {
268
+ name,
269
+ namespace,
270
+ };
271
+ this.update({
272
+ ...object,
273
+ });
274
+ }
275
+
274
276
  //================================================================================
275
277
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
276
278
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -17,6 +17,7 @@ import Logic from './Logic__';
17
17
  import Module from './Module__';
18
18
  import App from './App__';
19
19
  import View from './View__';
20
+ import Frontend from './Frontend__';
20
21
  import ProcessElement from './ProcessElement__';
21
22
  import Process from './Process__';
22
23
 
@@ -29,7 +30,7 @@ export class LogicItem extends BaseNode {
29
30
  * 产品概念
30
31
  */
31
32
  @property()
32
- concept: 'LogicItem' | 'Start' | 'End' | 'IfStatement' | 'SwitchStatement' | 'SwitchCase' | 'ForEachStatement' | 'WhileStatement' | 'Assignment' | 'BatchAssignment' | 'Comment' | 'CallLogic' | 'CallFunction' | 'CallInterface' | 'Destination' | 'ExternalDestination' | 'ValidationRule' | 'Argument' | 'Anchor' | 'JSBlock' | 'Identifier' | 'NullLiteral' | 'BooleanLiteral' | 'StringLiteral' | 'StringInterpolation' | 'NumericLiteral' | 'BinaryExpression' | 'MatchCase' | 'Match' | 'UnaryExpression' | 'MemberExpression' | 'Unparsed' | 'CallQueryComponent' | 'QueryFromExpression' | 'QueryJoinExpression' | 'QueryFieldExpression' | 'QueryAggregateExpression' | 'QueryOrderByExpression' | 'QueryGroupByExpression' | 'QuerySelectExpression' | 'QueryLimitExpression' | 'SqlQueryComponent' | 'OqlQueryComponent' | 'ProcessOutcome' | 'Assignee' = 'LogicItem';
33
+ concept: 'LogicItem' | 'Start' | 'End' | 'IfStatement' | 'SwitchStatement' | 'SwitchCase' | 'ForEachStatement' | 'WhileStatement' | 'Assignment' | 'BatchAssignment' | 'Comment' | 'CallLogic' | 'CallFunction' | 'CallInterface' | 'Destination' | 'ExternalDestination' | 'ValidationRule' | 'Argument' | 'Anchor' | 'JSBlock' | 'Identifier' | 'NullLiteral' | 'BooleanLiteral' | 'StringLiteral' | 'StringInterpolation' | 'NumericLiteral' | 'BinaryExpression' | 'MatchCase' | 'Match' | 'UnaryExpression' | 'MemberExpression' | 'Unparsed' | 'New' | 'NewComposite' | 'NewList' | 'NewMap' | 'CallQueryComponent' | 'QueryFromExpression' | 'QueryJoinExpression' | 'QueryFieldExpression' | 'QueryAggregateExpression' | 'QueryOrderByExpression' | 'QueryGroupByExpression' | 'QuerySelectExpression' | 'QueryLimitExpression' | 'SqlQueryComponent' | 'OqlQueryComponent' | 'ProcessOutcome' | 'Assignee' | 'ProcessOutcomes' = 'LogicItem';
33
34
 
34
35
  /**
35
36
  * 逻辑项标题
@@ -85,6 +86,12 @@ export class LogicItem extends BaseNode {
85
86
  get view() {
86
87
  return this.getAncestor('View') as View;
87
88
  }
89
+ /**
90
+ * 祖先 Frontend
91
+ */
92
+ get frontend() {
93
+ return this.getAncestor('Frontend') as Frontend;
94
+ }
88
95
  /**
89
96
  * 祖先 ProcessElement
90
97
  */
@@ -34,6 +34,7 @@ import Module from './Module__';
34
34
  import View from './View__';
35
35
  import ProcessElement from './ProcessElement__';
36
36
  import App from './App__';
37
+ import Frontend from './Frontend__';
37
38
  import Process from './Process__';
38
39
 
39
40
  /**
@@ -81,7 +82,7 @@ export class Logic extends BaseNode {
81
82
  * 编译器信息
82
83
  */
83
84
  @property()
84
- compilerInfoMap: { java?: { packageName: string, className: string } } = undefined;
85
+ compilerInfoMap: { java?: { packageName: string; className: string } } = undefined;
85
86
 
86
87
  /**
87
88
  * 类型参数列表
@@ -137,6 +138,12 @@ export class Logic extends BaseNode {
137
138
  get view() {
138
139
  return this.getAncestor('View') as View;
139
140
  }
141
+ /**
142
+ * 祖先 Frontend
143
+ */
144
+ get frontend() {
145
+ return this.getAncestor('Frontend') as Frontend;
146
+ }
140
147
  /**
141
148
  * 祖先 ProcessElement
142
149
  */
@@ -238,7 +245,7 @@ export class Logic extends BaseNode {
238
245
  });
239
246
  }
240
247
 
241
- getTypeParamExistingNames(excludedList: Array<TypeParam> = []) {
248
+ getTypeParamExistingNames(excludedList: Array<TypeParam> = []) {
242
249
  const excludedSet = new Set(excludedList);
243
250
  return ((this.typeParams as TypeParam[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
244
251
  }
@@ -247,24 +254,24 @@ export class Logic extends BaseNode {
247
254
  }
248
255
 
249
256
  /**
250
- * 插入类型参数
251
- * @internal
252
- * @param name 类型参数名称,如果不填会自动生成一个唯一名称
253
- */
257
+ * 插入类型参数
258
+ * @internal
259
+ * @param name 类型参数名称,如果不填会自动生成一个唯一名称
260
+ */
254
261
  _insertTypeParamAt(name: string, index: number): TypeParam;
255
262
 
256
263
  /**
257
- * 插入类型参数
258
- * @internal
259
- * @param typeParamOptions 类型参数参数
260
- */
264
+ * 插入类型参数
265
+ * @internal
266
+ * @param typeParamOptions 类型参数参数
267
+ */
261
268
  _insertTypeParamAt(typeParamOptions: Partial<TypeParam>, index: number): TypeParam;
262
269
 
263
270
  /**
264
- * 插入类型参数
265
- * @internal
266
- * @param typeParam 已有的类型参数实例
267
- */
271
+ * 插入类型参数
272
+ * @internal
273
+ * @param typeParam 已有的类型参数实例
274
+ */
268
275
  _insertTypeParamAt(typeParam: TypeParam, index: number): TypeParam;
269
276
 
270
277
  _insertTypeParamAt(options: string | Partial<TypeParam> | TypeParam, index: number) {
@@ -379,30 +386,29 @@ export class Logic extends BaseNode {
379
386
  return node;
380
387
  }
381
388
 
382
-
383
389
  getParamUniqueName(name = 'param1') {
384
390
  return utils.unique(name, this.getVarExistingNames(), undefined, false);
385
391
  }
386
392
 
387
393
  /**
388
- * 插入输入参数
389
- * @internal
390
- * @param name 输入参数名称,如果不填会自动生成一个唯一名称
391
- */
394
+ * 插入输入参数
395
+ * @internal
396
+ * @param name 输入参数名称,如果不填会自动生成一个唯一名称
397
+ */
392
398
  _insertParamAt(name: string, index: number): Param;
393
399
 
394
400
  /**
395
- * 插入输入参数
396
- * @internal
397
- * @param paramOptions 输入参数参数
398
- */
401
+ * 插入输入参数
402
+ * @internal
403
+ * @param paramOptions 输入参数参数
404
+ */
399
405
  _insertParamAt(paramOptions: Partial<Param>, index: number): Param;
400
406
 
401
407
  /**
402
- * 插入输入参数
403
- * @internal
404
- * @param param 已有的输入参数实例
405
- */
408
+ * 插入输入参数
409
+ * @internal
410
+ * @param param 已有的输入参数实例
411
+ */
406
412
  _insertParamAt(param: Param, index: number): Param;
407
413
 
408
414
  _insertParamAt(options: string | Partial<Param> | Param, index: number) {
@@ -517,30 +523,29 @@ export class Logic extends BaseNode {
517
523
  return node;
518
524
  }
519
525
 
520
-
521
526
  getReturnUniqueName(name = 'result') {
522
527
  return utils.unique(name, this.getVarExistingNames(), undefined, false);
523
528
  }
524
529
 
525
530
  /**
526
- * 插入输出参数
527
- * @internal
528
- * @param name 输出参数名称,如果不填会自动生成一个唯一名称
529
- */
531
+ * 插入输出参数
532
+ * @internal
533
+ * @param name 输出参数名称,如果不填会自动生成一个唯一名称
534
+ */
530
535
  _insertReturnAt(name: string, index: number): Return;
531
536
 
532
537
  /**
533
- * 插入输出参数
534
- * @internal
535
- * @param retOptions 输出参数参数
536
- */
538
+ * 插入输出参数
539
+ * @internal
540
+ * @param retOptions 输出参数参数
541
+ */
537
542
  _insertReturnAt(retOptions: Partial<Return>, index: number): Return;
538
543
 
539
544
  /**
540
- * 插入输出参数
541
- * @internal
542
- * @param ret 已有的输出参数实例
543
- */
545
+ * 插入输出参数
546
+ * @internal
547
+ * @param ret 已有的输出参数实例
548
+ */
544
549
  _insertReturnAt(ret: Return, index: number): Return;
545
550
 
546
551
  _insertReturnAt(options: string | Partial<Return> | Return, index: number) {
@@ -655,30 +660,29 @@ export class Logic extends BaseNode {
655
660
  return node;
656
661
  }
657
662
 
658
-
659
663
  getVariableUniqueName(name = 'variable1') {
660
664
  return utils.unique(name, this.getVarExistingNames(), undefined, false);
661
665
  }
662
666
 
663
667
  /**
664
- * 插入变量
665
- * @internal
666
- * @param name 变量名称,如果不填会自动生成一个唯一名称
667
- */
668
+ * 插入变量
669
+ * @internal
670
+ * @param name 变量名称,如果不填会自动生成一个唯一名称
671
+ */
668
672
  _insertVariableAt(name: string, index: number): Variable;
669
673
 
670
674
  /**
671
- * 插入变量
672
- * @internal
673
- * @param variableOptions 变量参数
674
- */
675
+ * 插入变量
676
+ * @internal
677
+ * @param variableOptions 变量参数
678
+ */
675
679
  _insertVariableAt(variableOptions: Partial<Variable>, index: number): Variable;
676
680
 
677
681
  /**
678
- * 插入变量
679
- * @internal
680
- * @param variable 已有的变量实例
681
- */
682
+ * 插入变量
683
+ * @internal
684
+ * @param variable 已有的变量实例
685
+ */
682
686
  _insertVariableAt(variable: Variable, index: number): Variable;
683
687
 
684
688
  _insertVariableAt(options: string | Partial<Variable> | Variable, index: number) {
@@ -793,23 +797,18 @@ export class Logic extends BaseNode {
793
797
  return node;
794
798
  }
795
799
 
796
-
797
-
798
-
799
-
800
-
801
800
  /**
802
- * 插入逻辑项
803
- * @internal
804
- * @param logicItemOptions 逻辑项参数
805
- */
801
+ * 插入逻辑项
802
+ * @internal
803
+ * @param logicItemOptions 逻辑项参数
804
+ */
806
805
  _insertItemInBodyAt(logicItemOptions: Partial<LogicItem>, index: number): LogicItem;
807
806
 
808
807
  /**
809
- * 插入逻辑项
810
- * @internal
811
- * @param logicItem 已有的逻辑项实例
812
- */
808
+ * 插入逻辑项
809
+ * @internal
810
+ * @param logicItem 已有的逻辑项实例
811
+ */
813
812
  _insertItemInBodyAt(logicItem: LogicItem, index: number): LogicItem;
814
813
 
815
814
  _insertItemInBodyAt(options: Partial<LogicItem> | LogicItem, index: number) {
@@ -830,8 +829,6 @@ export class Logic extends BaseNode {
830
829
  return logicItem;
831
830
  }
832
831
 
833
-
834
-
835
832
  /**
836
833
  * 插入逻辑项
837
834
  * @param logicItemOptions 逻辑项参数
@@ -854,8 +851,6 @@ export class Logic extends BaseNode {
854
851
  return node;
855
852
  }
856
853
 
857
-
858
-
859
854
  /**
860
855
  * 添加逻辑项
861
856
  * @internal
@@ -875,8 +870,6 @@ export class Logic extends BaseNode {
875
870
  return this._insertItemInBodyAt(options as any, index);
876
871
  }
877
872
 
878
-
879
-
880
873
  /**
881
874
  * 添加逻辑项
882
875
  * @param logicItemOptions 逻辑项参数
@@ -900,20 +893,18 @@ export class Logic extends BaseNode {
900
893
  return node;
901
894
  }
902
895
 
903
-
904
-
905
896
  /**
906
- * 插入逻辑项
907
- * @internal
908
- * @param logicItemOptions 逻辑项参数
909
- */
897
+ * 插入逻辑项
898
+ * @internal
899
+ * @param logicItemOptions 逻辑项参数
900
+ */
910
901
  _insertItemInPlaygroundAt(logicItemOptions: Partial<LogicItem>, index: number): LogicItem;
911
902
 
912
903
  /**
913
- * 插入逻辑项
914
- * @internal
915
- * @param logicItem 已有的逻辑项实例
916
- */
904
+ * 插入逻辑项
905
+ * @internal
906
+ * @param logicItem 已有的逻辑项实例
907
+ */
917
908
  _insertItemInPlaygroundAt(logicItem: LogicItem, index: number): LogicItem;
918
909
 
919
910
  _insertItemInPlaygroundAt(options: Partial<LogicItem> | LogicItem, index: number) {
@@ -934,8 +925,6 @@ export class Logic extends BaseNode {
934
925
  return logicItem;
935
926
  }
936
927
 
937
-
938
-
939
928
  /**
940
929
  * 插入逻辑项
941
930
  * @param logicItemOptions 逻辑项参数
@@ -958,8 +947,6 @@ export class Logic extends BaseNode {
958
947
  return node;
959
948
  }
960
949
 
961
-
962
-
963
950
  /**
964
951
  * 添加逻辑项
965
952
  * @internal
@@ -979,8 +966,6 @@ export class Logic extends BaseNode {
979
966
  return this._insertItemInPlaygroundAt(options as any, index);
980
967
  }
981
968
 
982
-
983
-
984
969
  /**
985
970
  * 添加逻辑项
986
971
  * @param logicItemOptions 逻辑项参数
@@ -1004,13 +989,10 @@ export class Logic extends BaseNode {
1004
989
  return node;
1005
990
  }
1006
991
 
1007
-
1008
-
1009
-
1010
992
  /**
1011
- * 删除事务
1012
- * @param name 事务名称
1013
- */
993
+ * 删除事务
994
+ * @param name 事务名称
995
+ */
1014
996
  removeTransactional(name: string): void;
1015
997
 
1016
998
  /**
@@ -1055,12 +1037,10 @@ export class Logic extends BaseNode {
1055
1037
  return params;
1056
1038
  }
1057
1039
 
1058
-
1059
-
1060
1040
  /**
1061
- * 删除类型参数
1062
- * @param name 类型参数名称
1063
- */
1041
+ * 删除类型参数
1042
+ * @param name 类型参数名称
1043
+ */
1064
1044
  removeTypeParam(name: string): void;
1065
1045
 
1066
1046
  /**
@@ -1105,12 +1085,10 @@ export class Logic extends BaseNode {
1105
1085
  return params;
1106
1086
  }
1107
1087
 
1108
-
1109
-
1110
1088
  /**
1111
- * 删除输入参数
1112
- * @param name 输入参数名称
1113
- */
1089
+ * 删除输入参数
1090
+ * @param name 输入参数名称
1091
+ */
1114
1092
  removeParam(name: string): void;
1115
1093
 
1116
1094
  /**
@@ -1155,12 +1133,10 @@ export class Logic extends BaseNode {
1155
1133
  return params;
1156
1134
  }
1157
1135
 
1158
-
1159
-
1160
1136
  /**
1161
- * 删除输出参数
1162
- * @param name 输出参数名称
1163
- */
1137
+ * 删除输出参数
1138
+ * @param name 输出参数名称
1139
+ */
1164
1140
  removeReturn(name: string): void;
1165
1141
 
1166
1142
  /**
@@ -1205,12 +1181,10 @@ export class Logic extends BaseNode {
1205
1181
  return params;
1206
1182
  }
1207
1183
 
1208
-
1209
-
1210
1184
  /**
1211
- * 删除变量
1212
- * @param name 变量名称
1213
- */
1185
+ * 删除变量
1186
+ * @param name 变量名称
1187
+ */
1214
1188
  removeVariable(name: string): void;
1215
1189
 
1216
1190
  /**
@@ -1255,8 +1229,6 @@ export class Logic extends BaseNode {
1255
1229
  return params;
1256
1230
  }
1257
1231
 
1258
-
1259
-
1260
1232
  /**
1261
1233
  * 删除逻辑项
1262
1234
  * @param logicItem 已有的逻辑项实例
@@ -1264,12 +1236,10 @@ export class Logic extends BaseNode {
1264
1236
  removeItemInBody(logicItem: LogicItem): void;
1265
1237
 
1266
1238
  removeItemInBody(options: LogicItem) {
1267
- let logicItem: LogicItem = options;
1239
+ const logicItem: LogicItem = options;
1268
1240
  return logicItem.delete();
1269
1241
  }
1270
1242
 
1271
-
1272
-
1273
1243
  /**
1274
1244
  * 删除逻辑项
1275
1245
  * @param logicItem 已有的逻辑项实例
@@ -1277,7 +1247,7 @@ export class Logic extends BaseNode {
1277
1247
  removeItemInPlayground(logicItem: LogicItem): void;
1278
1248
 
1279
1249
  removeItemInPlayground(options: LogicItem) {
1280
- let logicItem: LogicItem = options;
1250
+ const logicItem: LogicItem = options;
1281
1251
  return logicItem.delete();
1282
1252
  }
1283
1253
 
@@ -1640,13 +1610,11 @@ export class Logic extends BaseNode {
1640
1610
  this.traverseChildren((el) => {
1641
1611
  if (el && (el instanceof BatchAssignment || (el instanceof Assignment && el.left?.name))) {
1642
1612
  const jsCode = el.toJS();
1643
- const advanceVar = this.variables?.find((variable) =>
1644
- !variable.typeAnnotation && jsCode.includes(`${variable.name} = `));
1613
+ const advanceVar = this.variables?.find((variable) => !variable.typeAnnotation && jsCode.includes(`${variable.name} = `));
1645
1614
  if (advanceVar && !advanceMap.get(advanceVar)) {
1646
1615
  advanceMap.set(advanceVar, el);
1647
1616
  }
1648
- const advanceRn = this.returns?.find((ret) =>
1649
- !ret.typeAnnotation && jsCode.includes(`${ret.name} = `));
1617
+ const advanceRn = this.returns?.find((ret) => !ret.typeAnnotation && jsCode.includes(`${ret.name} = `));
1650
1618
  if (advanceRn && !advanceMap.get(advanceRn)) {
1651
1619
  advanceMap.set(advanceRn, el);
1652
1620
  }
@@ -1663,12 +1631,14 @@ export class Logic extends BaseNode {
1663
1631
  Promise.all(needGetSourceMapOqlList).then(() => {
1664
1632
  // 触发一下更新重新生成代码
1665
1633
  (this.app as any)?.naslServer?.embeddedTSEmitter.emit('change', {
1666
- value: [{
1667
- originEvent: {
1668
- action: 'update',
1669
- target: this,
1634
+ value: [
1635
+ {
1636
+ originEvent: {
1637
+ action: 'update',
1638
+ target: this,
1639
+ },
1670
1640
  },
1671
- }],
1641
+ ],
1672
1642
  });
1673
1643
  });
1674
1644
  }
@@ -1680,11 +1650,13 @@ export class Logic extends BaseNode {
1680
1650
  code += '{\n';
1681
1651
 
1682
1652
  // 用于虚拟节点的查找引用
1683
- this.virtualParams && Array.isArray(this.virtualParams) && this.virtualParams.forEach((param) => {
1684
- code += indent((state?.tabSize || 0) + 1);
1685
- code += param.toEmbeddedNameTS(shiftState(state, code, { inline: true }));
1686
- code += '\n';
1687
- });
1653
+ this.virtualParams
1654
+ && Array.isArray(this.virtualParams)
1655
+ && this.virtualParams.forEach((param) => {
1656
+ code += indent((state?.tabSize || 0) + 1);
1657
+ code += param.toEmbeddedNameTS(shiftState(state, code, { inline: true }));
1658
+ code += '\n';
1659
+ });
1688
1660
 
1689
1661
  this.variables.forEach((variable) => {
1690
1662
  if (!advanceMap.get(variable)) {
@@ -1708,12 +1680,12 @@ export class Logic extends BaseNode {
1708
1680
  code += node.toEmbeddedTS(shiftState(state, code, { inline: true }));
1709
1681
  if (assignment instanceof BatchAssignment) {
1710
1682
  assignment.assignmentLines.forEach(({ leftIndex, rightIndex }) => {
1711
- const leftCode = leftIndex.length === 1 ? assignment.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true })) : assignment.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true }));
1683
+ const leftCode
1684
+ = leftIndex.length === 1 ? assignment.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true })) : assignment.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true }));
1712
1685
  if (leftCode === node.name) {
1713
1686
  const rightNode: any = rightIndex.length === 1 ? assignment.rights[rightIndex[0]]?.expression : assignment.rights[rightIndex[0]]?.members[rightIndex[1]];
1714
1687
  // 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
1715
- if (rightNode?.typeAnnotation
1716
- && !(rightNode instanceof CallQueryComponent && rightNode.ideVersion !== '2.11')) {
1688
+ if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && rightNode.ideVersion !== '2.11')) {
1717
1689
  code += ': ';
1718
1690
  code += rightNode.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true })) || 'null';
1719
1691
  } else {
@@ -1723,11 +1695,14 @@ export class Logic extends BaseNode {
1723
1695
  }
1724
1696
  }
1725
1697
  });
1698
+ } else if (['NewList', 'NewMap'].includes(assignment.right.concept) && !(assignment.right as any).typeAnnotation) {
1699
+ const rightNode: any = assignment.right;
1700
+ code += ' = ';
1701
+ code += rightNode.getInitCode(shiftState(state, code, { inline: true }));
1726
1702
  } else {
1727
1703
  const rightNode: any = assignment.right;
1728
1704
  // 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
1729
- if (rightNode?.typeAnnotation
1730
- && !(rightNode instanceof CallQueryComponent && rightNode.ideVersion !== '2.11')) {
1705
+ if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && rightNode.ideVersion !== '2.11')) {
1731
1706
  code += ': ';
1732
1707
  code += rightNode.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true })) || 'null';
1733
1708
  } else {
@@ -1737,7 +1712,7 @@ export class Logic extends BaseNode {
1737
1712
  if (rightNode && rightNode instanceof Identifier && rightNode.namespace && rightNode.namespace.endsWith('enums')) {
1738
1713
  rightCode += 'new ';
1739
1714
  }
1740
- rightCode += (rightNode && rightNode.toEmbeddedTS) ? rightNode.toEmbeddedTS(shiftState(state, code, { inline: true })) : '__RIGHT__';
1715
+ rightCode += rightNode && rightNode.toEmbeddedTS ? rightNode.toEmbeddedTS(shiftState(state, code, { inline: true })) : '__RIGHT__';
1741
1716
  code += this.getRightCode(rightCode, assignment, rightNode);
1742
1717
  }
1743
1718
  }
@@ -1881,7 +1856,10 @@ export class Logic extends BaseNode {
1881
1856
  arr.push(parentName);
1882
1857
  }
1883
1858
  let namespace = arr.join('.');
1884
- if (!['nasl.ui', 'nasl.utils', 'nasl.util', 'nasl.browser', 'nasl.auth', 'nasl.configuration', 'nasl.process', 'nasl.logging', 'nasl.io'].includes(namespace) && !namespace.includes('.logics')) {
1859
+ if (
1860
+ !['nasl.ui', 'nasl.utils', 'nasl.util', 'nasl.browser', 'nasl.auth', 'nasl.configuration', 'nasl.process', 'nasl.logging', 'nasl.io'].includes(namespace)
1861
+ && !namespace.includes('.logics')
1862
+ ) {
1885
1863
  namespace = `${namespace}.logics`;
1886
1864
  }
1887
1865
  return namespace;
@@ -1898,7 +1876,10 @@ export class Logic extends BaseNode {
1898
1876
  arr.push(parentName);
1899
1877
  }
1900
1878
  let namespace = arr.join('.');
1901
- if (!['nasl.ui', 'nasl.utils', 'nasl.util', 'nasl.browser', 'nasl.auth', 'nasl.configuration', 'nasl.process', 'nasl.logging', 'nasl.io'].includes(namespace) && !namespace.includes('.logics')) {
1879
+ if (
1880
+ !['nasl.ui', 'nasl.utils', 'nasl.util', 'nasl.browser', 'nasl.auth', 'nasl.configuration', 'nasl.process', 'nasl.logging', 'nasl.io'].includes(namespace)
1881
+ && !namespace.includes('.logics')
1882
+ ) {
1902
1883
  namespace = `${namespace}.logics`;
1903
1884
  }
1904
1885
  return namespace;
@@ -2038,6 +2019,11 @@ export class Logic extends BaseNode {
2038
2019
  // 虚拟输入参数列表
2039
2020
  virtualParams: Array<Param> = [];
2040
2021
 
2022
+ get getLogicBelongTo() {
2023
+ const [, belongTo] = this.calleewholeKey.split('.');
2024
+ return belongTo;
2025
+ }
2026
+
2041
2027
  //================================================================================
2042
2028
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
2043
2029
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓