@lcap/nasl 3.3.0-alpha.1 → 3.3.0-alpha.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 (380) hide show
  1. package/out/automate/upgrader/2.20.js.map +1 -1
  2. package/out/bak/translator.js +52 -1
  3. package/out/bak/translator.js.map +1 -1
  4. package/out/breakpoint/shared/utils.js +0 -2
  5. package/out/breakpoint/shared/utils.js.map +1 -1
  6. package/out/common/Command.d.ts +1 -0
  7. package/out/common/Command.js +9 -1
  8. package/out/common/Command.js.map +1 -1
  9. package/out/concepts/Abort__.js +2 -1
  10. package/out/concepts/Abort__.js.map +1 -1
  11. package/out/concepts/Anchor__.js +1 -1
  12. package/out/concepts/Anchor__.js.map +1 -1
  13. package/out/concepts/AnonymousFunction__.js +2 -2
  14. package/out/concepts/AnonymousFunction__.js.map +1 -1
  15. package/out/concepts/Argument__.js +1 -1
  16. package/out/concepts/Argument__.js.map +1 -1
  17. package/out/concepts/Assignee__.js.map +1 -1
  18. package/out/concepts/AssignmentLine__.js +1 -1
  19. package/out/concepts/AssignmentLine__.js.map +1 -1
  20. package/out/concepts/Assignment__.js +2 -2
  21. package/out/concepts/Assignment__.js.map +1 -1
  22. package/out/concepts/BackendVariable__.js +1 -1
  23. package/out/concepts/BackendVariable__.js.map +1 -1
  24. package/out/concepts/Backend__.js +1 -1
  25. package/out/concepts/Backend__.js.map +1 -1
  26. package/out/concepts/BatchAssignment__.js +2 -2
  27. package/out/concepts/BatchAssignment__.js.map +1 -1
  28. package/out/concepts/BinaryExpression__.js +2 -2
  29. package/out/concepts/BinaryExpression__.js.map +1 -1
  30. package/out/concepts/BindAttribute__.d.ts +2 -0
  31. package/out/concepts/BindAttribute__.js +79 -4
  32. package/out/concepts/BindAttribute__.js.map +1 -1
  33. package/out/concepts/BindDirective__.js +1 -1
  34. package/out/concepts/BindDirective__.js.map +1 -1
  35. package/out/concepts/BindEvent__.d.ts +2 -1
  36. package/out/concepts/BindEvent__.js +44 -37
  37. package/out/concepts/BindEvent__.js.map +1 -1
  38. package/out/concepts/BindStyle__.js +1 -1
  39. package/out/concepts/BindStyle__.js.map +1 -1
  40. package/out/concepts/BooleanLiteral__.js +1 -1
  41. package/out/concepts/BooleanLiteral__.js.map +1 -1
  42. package/out/concepts/CallAuthInterface__.js +1 -1
  43. package/out/concepts/CallAuthInterface__.js.map +1 -1
  44. package/out/concepts/CallConnector__.js +1 -1
  45. package/out/concepts/CallConnector__.js.map +1 -1
  46. package/out/concepts/CallFunction__.js +2 -2
  47. package/out/concepts/CallFunction__.js.map +1 -1
  48. package/out/concepts/CallInterface__.js +2 -2
  49. package/out/concepts/CallInterface__.js.map +1 -1
  50. package/out/concepts/CallLogic__.js +69 -12
  51. package/out/concepts/CallLogic__.js.map +1 -1
  52. package/out/concepts/CallQueryComponent__.d.ts +1 -1
  53. package/out/concepts/CallQueryComponent__.js +1 -1
  54. package/out/concepts/CallQueryComponent__.js.map +1 -1
  55. package/out/concepts/Comment__.js +1 -1
  56. package/out/concepts/Comment__.js.map +1 -1
  57. package/out/concepts/ConfigProperty__.js +1 -1
  58. package/out/concepts/ConfigProperty__.js.map +1 -1
  59. package/out/concepts/Connection__.js +9 -10
  60. package/out/concepts/Connection__.js.map +1 -1
  61. package/out/concepts/Constant__.js +1 -1
  62. package/out/concepts/Constant__.js.map +1 -1
  63. package/out/concepts/DataSource__.js +1 -1
  64. package/out/concepts/DataSource__.js.map +1 -1
  65. package/out/concepts/Destination__.js +2 -2
  66. package/out/concepts/Destination__.js.map +1 -1
  67. package/out/concepts/End__.js +1 -1
  68. package/out/concepts/End__.js.map +1 -1
  69. package/out/concepts/EntityIndex__.js +1 -1
  70. package/out/concepts/EntityIndex__.js.map +1 -1
  71. package/out/concepts/EntityProperty__.js +2 -2
  72. package/out/concepts/EntityProperty__.js.map +1 -1
  73. package/out/concepts/Entity__.js +2 -2
  74. package/out/concepts/Entity__.js.map +1 -1
  75. package/out/concepts/EnumItem__.js +2 -2
  76. package/out/concepts/EnumItem__.js.map +1 -1
  77. package/out/concepts/Enum__.js +2 -2
  78. package/out/concepts/Enum__.js.map +1 -1
  79. package/out/concepts/ForEachStatement__.js +27 -37
  80. package/out/concepts/ForEachStatement__.js.map +1 -1
  81. package/out/concepts/Frontend__.js +1 -1
  82. package/out/concepts/Frontend__.js.map +1 -1
  83. package/out/concepts/Function__.js +2 -2
  84. package/out/concepts/Function__.js.map +1 -1
  85. package/out/concepts/Identifier__.js +1 -1
  86. package/out/concepts/Identifier__.js.map +1 -1
  87. package/out/concepts/IfStatement__.js +2 -2
  88. package/out/concepts/IfStatement__.js.map +1 -1
  89. package/out/concepts/Interface__.js +1 -1
  90. package/out/concepts/Interface__.js.map +1 -1
  91. package/out/concepts/JSBlock__.js +1 -1
  92. package/out/concepts/JSBlock__.js.map +1 -1
  93. package/out/concepts/JavaLogic__.js +1 -1
  94. package/out/concepts/JavaLogic__.js.map +1 -1
  95. package/out/concepts/LogicItem__.js +3 -2
  96. package/out/concepts/LogicItem__.js.map +1 -1
  97. package/out/concepts/Logic__.js +2 -1
  98. package/out/concepts/Logic__.js.map +1 -1
  99. package/out/concepts/MatchCase__.js +1 -1
  100. package/out/concepts/MatchCase__.js.map +1 -1
  101. package/out/concepts/Match__.js +2 -2
  102. package/out/concepts/Match__.js.map +1 -1
  103. package/out/concepts/MemberExpression__.d.ts +1 -0
  104. package/out/concepts/MemberExpression__.js +117 -2
  105. package/out/concepts/MemberExpression__.js.map +1 -1
  106. package/out/concepts/Module__.d.ts +1 -1
  107. package/out/concepts/Module__.js +34 -35
  108. package/out/concepts/Module__.js.map +1 -1
  109. package/out/concepts/NewComposite__.js +2 -2
  110. package/out/concepts/NewComposite__.js.map +1 -1
  111. package/out/concepts/NewList__.js +2 -2
  112. package/out/concepts/NewList__.js.map +1 -1
  113. package/out/concepts/NewMap__.js +2 -2
  114. package/out/concepts/NewMap__.js.map +1 -1
  115. package/out/concepts/New__.js +1 -1
  116. package/out/concepts/New__.js.map +1 -1
  117. package/out/concepts/NullLiteral__.js +1 -1
  118. package/out/concepts/NullLiteral__.js.map +1 -1
  119. package/out/concepts/NumericLiteral__.js +1 -1
  120. package/out/concepts/NumericLiteral__.js.map +1 -1
  121. package/out/concepts/OqlQueryComponent__.js +2 -2
  122. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  123. package/out/concepts/Param__.js +1 -1
  124. package/out/concepts/Param__.js.map +1 -1
  125. package/out/concepts/ProcessElement__.js +1 -1
  126. package/out/concepts/ProcessElement__.js.map +1 -1
  127. package/out/concepts/ProcessOutcome__.js +1 -1
  128. package/out/concepts/ProcessOutcome__.js.map +1 -1
  129. package/out/concepts/ProcessOutcomes__.js +1 -1
  130. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  131. package/out/concepts/Process__.js +1 -1
  132. package/out/concepts/Process__.js.map +1 -1
  133. package/out/concepts/QueryAggregateExpression__.js +1 -1
  134. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  135. package/out/concepts/QueryFieldExpression__.js +1 -1
  136. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  137. package/out/concepts/QueryFromExpression__.js +1 -1
  138. package/out/concepts/QueryFromExpression__.js.map +1 -1
  139. package/out/concepts/QueryJoinExpression__.js +1 -1
  140. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  141. package/out/concepts/QueryLimitExpression__.js +1 -1
  142. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  143. package/out/concepts/QueryOrderByExpression__.js +1 -1
  144. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  145. package/out/concepts/Return__.js +2 -2
  146. package/out/concepts/Return__.js.map +1 -1
  147. package/out/concepts/Role__.js +1 -1
  148. package/out/concepts/Role__.js.map +1 -1
  149. package/out/concepts/SelectMembers__.js +1 -1
  150. package/out/concepts/SelectMembers__.js.map +1 -1
  151. package/out/concepts/SqlQueryComponent__.js +2 -2
  152. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  153. package/out/concepts/Start__.js +1 -1
  154. package/out/concepts/Start__.js.map +1 -1
  155. package/out/concepts/StringInterpolation__.js +2 -2
  156. package/out/concepts/StringInterpolation__.js.map +1 -1
  157. package/out/concepts/StringLiteral__.js +1 -1
  158. package/out/concepts/StringLiteral__.js.map +1 -1
  159. package/out/concepts/StructureProperty__.js +2 -2
  160. package/out/concepts/StructureProperty__.js.map +1 -1
  161. package/out/concepts/Structure__.js +2 -2
  162. package/out/concepts/Structure__.js.map +1 -1
  163. package/out/concepts/SwitchCase__.js +1 -1
  164. package/out/concepts/SwitchCase__.js.map +1 -1
  165. package/out/concepts/SwitchStatement__.js +2 -2
  166. package/out/concepts/SwitchStatement__.js.map +1 -1
  167. package/out/concepts/TriggerLauncher__.js +1 -1
  168. package/out/concepts/TriggerLauncher__.js.map +1 -1
  169. package/out/concepts/TypeAnnotation__.d.ts +4 -3
  170. package/out/concepts/TypeAnnotation__.js +116 -75
  171. package/out/concepts/TypeAnnotation__.js.map +1 -1
  172. package/out/concepts/TypeParam__.js +1 -1
  173. package/out/concepts/TypeParam__.js.map +1 -1
  174. package/out/concepts/UnaryExpression__.js +2 -2
  175. package/out/concepts/UnaryExpression__.js.map +1 -1
  176. package/out/concepts/ValidationRule__.d.ts +14 -14
  177. package/out/concepts/ValidationRule__.js +28 -24
  178. package/out/concepts/ValidationRule__.js.map +1 -1
  179. package/out/concepts/Variable__.js +2 -2
  180. package/out/concepts/Variable__.js.map +1 -1
  181. package/out/concepts/ViewElement__.d.ts +88 -87
  182. package/out/concepts/ViewElement__.js +268 -204
  183. package/out/concepts/ViewElement__.js.map +1 -1
  184. package/out/concepts/View__.d.ts +6 -0
  185. package/out/concepts/View__.js +254 -11
  186. package/out/concepts/View__.js.map +1 -1
  187. package/out/concepts/WhileStatement__.js +2 -2
  188. package/out/concepts/WhileStatement__.js.map +1 -1
  189. package/out/concepts/basics/stdlib/nasl.browser.js +1 -0
  190. package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -1
  191. package/out/concepts/basics/stdlib/nasl.event.js +2 -0
  192. package/out/concepts/basics/stdlib/nasl.event.js.map +1 -1
  193. package/out/generator/genBundleFiles.js +90 -1
  194. package/out/generator/genBundleFiles.js.map +1 -1
  195. package/out/generator/genReleaseBody.js +1 -1
  196. package/out/generator/genReleaseBody.js.map +1 -1
  197. package/out/generator/permission.js +3 -3
  198. package/out/generator/permission.js.map +1 -1
  199. package/out/index.d.ts +1 -0
  200. package/out/index.js +1 -0
  201. package/out/index.js.map +1 -1
  202. package/out/natural/genNaturalTS.js +7 -3
  203. package/out/natural/genNaturalTS.js.map +1 -1
  204. package/out/natural/knowledgeMap.js +12 -12
  205. package/out/natural/knowledgeMap.js.map +1 -1
  206. package/out/natural/transformTSCode.d.ts +1 -1
  207. package/out/natural/transformTSCode.js +115 -141
  208. package/out/natural/transformTSCode.js.map +1 -1
  209. package/out/server/extendBaseNode.js +69 -44
  210. package/out/server/extendBaseNode.js.map +1 -1
  211. package/out/server/formatTsUtils.js +72 -63
  212. package/out/server/formatTsUtils.js.map +1 -1
  213. package/out/server/getLogics.js +20 -23
  214. package/out/server/getLogics.js.map +1 -1
  215. package/out/server/getMemberIdentifier.d.ts +1 -0
  216. package/out/server/getMemberIdentifier.js +149 -1
  217. package/out/server/getMemberIdentifier.js.map +1 -1
  218. package/out/server/naslServer.d.ts +3 -3
  219. package/out/server/naslServer.js +182 -132
  220. package/out/server/naslServer.js.map +1 -1
  221. package/out/server/translator.js +43 -33
  222. package/out/server/translator.js.map +1 -1
  223. package/out/service/defaultErrorMessage.json +6 -6
  224. package/out/service/storage/init.js +16 -0
  225. package/out/service/storage/init.js.map +1 -1
  226. package/out/templator/genCreateBlock.js +5 -3
  227. package/out/templator/genCreateBlock.js.map +1 -1
  228. package/out/templator/genCurdEditMultipleKeyBlock.js +12 -8
  229. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  230. package/out/templator/genCurdMultipleKeyBlock.js +8 -7
  231. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  232. package/out/templator/genEditTableBlock.d.ts +1 -1
  233. package/out/templator/genEditTableBlock.js +12 -6
  234. package/out/templator/genEditTableBlock.js.map +1 -1
  235. package/out/templator/genEnumSelectBlock.js +2 -2
  236. package/out/templator/genEnumSelectBlock.js.map +1 -1
  237. package/out/templator/genGetBlock.js +1 -1
  238. package/out/templator/genGetBlock.js.map +1 -1
  239. package/out/templator/genGridViewBlock.d.ts +2 -2
  240. package/out/templator/genGridViewBlock.js +20 -7
  241. package/out/templator/genGridViewBlock.js.map +1 -1
  242. package/out/templator/genListViewBlock.d.ts +2 -2
  243. package/out/templator/genListViewBlock.js +13 -5
  244. package/out/templator/genListViewBlock.js.map +1 -1
  245. package/out/templator/genSelectBlock.d.ts +2 -2
  246. package/out/templator/genSelectBlock.js +8 -6
  247. package/out/templator/genSelectBlock.js.map +1 -1
  248. package/out/templator/genTableBlock.d.ts +1 -1
  249. package/out/templator/genTableBlock.js +10 -5
  250. package/out/templator/genTableBlock.js.map +1 -1
  251. package/out/templator/genUpdateBlock.js +5 -3
  252. package/out/templator/genUpdateBlock.js.map +1 -1
  253. package/package.json +3 -1
  254. package/sandbox/stdlib/nasl.auth.ts +40 -44
  255. package/sandbox/stdlib/nasl.core.ts +8 -1
  256. package/sandbox/stdlib/nasl.http.ts +22 -22
  257. package/sandbox-natural/stdlib/nasl.util.ts +74 -15
  258. package/src/automate/upgrader/2.20.js +17 -13
  259. package/src/bak/translator.js +50 -1
  260. package/src/breakpoint/shared/utils.ts +0 -2
  261. package/src/common/Command.ts +8 -0
  262. package/src/concepts/Abort__.ts +2 -2
  263. package/src/concepts/Anchor__.ts +2 -2
  264. package/src/concepts/AnonymousFunction__.ts +3 -3
  265. package/src/concepts/Argument__.ts +2 -2
  266. package/src/concepts/Assignee__.ts +1 -1
  267. package/src/concepts/AssignmentLine__.ts +2 -2
  268. package/src/concepts/Assignment__.ts +3 -3
  269. package/src/concepts/BackendVariable__.ts +2 -2
  270. package/src/concepts/Backend__.ts +1 -1
  271. package/src/concepts/BatchAssignment__.ts +3 -3
  272. package/src/concepts/BinaryExpression__.ts +3 -3
  273. package/src/concepts/BindAttribute__.ts +69 -4
  274. package/src/concepts/BindDirective__.ts +2 -2
  275. package/src/concepts/BindEvent__.ts +44 -64
  276. package/src/concepts/BindStyle__.ts +2 -2
  277. package/src/concepts/BooleanLiteral__.ts +2 -2
  278. package/src/concepts/CallAuthInterface__.ts +2 -2
  279. package/src/concepts/CallConnector__.ts +2 -2
  280. package/src/concepts/CallFunction__.ts +3 -3
  281. package/src/concepts/CallInterface__.ts +3 -3
  282. package/src/concepts/CallLogic__.ts +69 -13
  283. package/src/concepts/CallQueryComponent__.ts +2 -2
  284. package/src/concepts/Comment__.ts +2 -2
  285. package/src/concepts/ConfigProperty__.ts +2 -2
  286. package/src/concepts/Connection__.ts +15 -21
  287. package/src/concepts/Constant__.ts +2 -2
  288. package/src/concepts/DataSource__.ts +1 -1
  289. package/src/concepts/Destination__.ts +3 -3
  290. package/src/concepts/End__.ts +2 -2
  291. package/src/concepts/EntityIndex__.ts +2 -2
  292. package/src/concepts/EntityProperty__.ts +3 -3
  293. package/src/concepts/Entity__.ts +2 -2
  294. package/src/concepts/EnumItem__.ts +3 -3
  295. package/src/concepts/Enum__.ts +2 -2
  296. package/src/concepts/ForEachStatement__.ts +35 -46
  297. package/src/concepts/Frontend__.ts +1 -1
  298. package/src/concepts/Function__.ts +3 -3
  299. package/src/concepts/Identifier__.ts +2 -2
  300. package/src/concepts/IfStatement__.ts +3 -3
  301. package/src/concepts/Interface__.ts +1 -1
  302. package/src/concepts/JSBlock__.ts +2 -2
  303. package/src/concepts/JavaLogic__.ts +2 -2
  304. package/src/concepts/LogicItem__.ts +3 -3
  305. package/src/concepts/Logic__.ts +2 -1
  306. package/src/concepts/MatchCase__.ts +2 -2
  307. package/src/concepts/Match__.ts +3 -3
  308. package/src/concepts/MemberExpression__.ts +112 -4
  309. package/src/concepts/Module__.ts +41 -58
  310. package/src/concepts/NewComposite__.ts +3 -3
  311. package/src/concepts/NewList__.ts +3 -3
  312. package/src/concepts/NewMap__.ts +3 -3
  313. package/src/concepts/New__.ts +2 -2
  314. package/src/concepts/NullLiteral__.ts +2 -2
  315. package/src/concepts/NumericLiteral__.ts +2 -2
  316. package/src/concepts/OqlQueryComponent__.ts +3 -3
  317. package/src/concepts/Param__.ts +2 -2
  318. package/src/concepts/ProcessElement__.ts +2 -2
  319. package/src/concepts/ProcessOutcome__.ts +2 -2
  320. package/src/concepts/ProcessOutcomes__.ts +2 -2
  321. package/src/concepts/Process__.ts +1 -1
  322. package/src/concepts/QueryAggregateExpression__.ts +2 -2
  323. package/src/concepts/QueryFieldExpression__.ts +2 -2
  324. package/src/concepts/QueryFromExpression__.ts +2 -2
  325. package/src/concepts/QueryJoinExpression__.ts +2 -2
  326. package/src/concepts/QueryLimitExpression__.ts +2 -2
  327. package/src/concepts/QueryOrderByExpression__.ts +2 -2
  328. package/src/concepts/Return__.ts +3 -3
  329. package/src/concepts/Role__.ts +1 -1
  330. package/src/concepts/SelectMembers__.ts +2 -2
  331. package/src/concepts/SqlQueryComponent__.ts +3 -3
  332. package/src/concepts/Start__.ts +2 -2
  333. package/src/concepts/StringInterpolation__.ts +3 -3
  334. package/src/concepts/StringLiteral__.ts +2 -2
  335. package/src/concepts/StructureProperty__.ts +3 -3
  336. package/src/concepts/Structure__.ts +2 -2
  337. package/src/concepts/SwitchCase__.ts +2 -2
  338. package/src/concepts/SwitchStatement__.ts +3 -3
  339. package/src/concepts/TriggerLauncher__.ts +1 -1
  340. package/src/concepts/TypeAnnotation__.ts +145 -125
  341. package/src/concepts/TypeParam__.ts +2 -2
  342. package/src/concepts/UnaryExpression__.ts +3 -3
  343. package/src/concepts/ValidationRule__.ts +554 -524
  344. package/src/concepts/Variable__.ts +3 -3
  345. package/src/concepts/ViewElement__.ts +2445 -2498
  346. package/src/concepts/View__.ts +258 -10
  347. package/src/concepts/WhileStatement__.ts +3 -3
  348. package/src/concepts/basics/stdlib/nasl.browser.ts +1 -0
  349. package/src/concepts/basics/stdlib/nasl.event.ts +2 -0
  350. package/src/generator/genBundleFiles.ts +91 -1
  351. package/src/generator/genReleaseBody.ts +1 -1
  352. package/src/generator/permission.ts +3 -3
  353. package/src/index.ts +1 -0
  354. package/src/natural/genNaturalTS.ts +8 -4
  355. package/src/natural/knowledgeMap.ts +12 -12
  356. package/src/natural/transformTSCode.ts +139 -151
  357. package/src/server/extendBaseNode.ts +71 -45
  358. package/src/server/formatTsUtils.ts +64 -64
  359. package/src/server/getLogics.ts +23 -30
  360. package/src/server/getMemberIdentifier.ts +143 -0
  361. package/src/server/naslServer.ts +174 -148
  362. package/src/server/translator.ts +40 -39
  363. package/src/service/defaultErrorMessage.json +6 -6
  364. package/src/service/storage/init.ts +17 -0
  365. package/src/templator/genCreateBlock.ts +5 -3
  366. package/src/templator/genCurdEditMultipleKeyBlock.ts +12 -8
  367. package/src/templator/genCurdMultipleKeyBlock.ts +8 -7
  368. package/src/templator/genEditTableBlock.ts +12 -7
  369. package/src/templator/genEnumSelectBlock.ts +2 -2
  370. package/src/templator/genGetBlock.ts +6 -6
  371. package/src/templator/genGridViewBlock.ts +22 -9
  372. package/src/templator/genListViewBlock.ts +14 -5
  373. package/src/templator/genSelectBlock.ts +8 -6
  374. package/src/templator/genTableBlock.ts +10 -9
  375. package/src/templator/genUpdateBlock.ts +5 -3
  376. package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +11 -0
  377. package/test/concepts/validation-rule/__snapshots__/toJS.spec.ts.snap +10 -0
  378. package/test/concepts/validation-rule/fixtures/argument-without-keyword.json +34 -0
  379. package/test/concepts/validation-rule/fixtures/empty-rule.json +9 -0
  380. package/test/concepts/validation-rule/validation-rule.spec.ts +15 -0
@@ -1,5 +1,5 @@
1
1
  import { v4 as uuidv4 } from 'uuid';
2
- import { TranslatorState } from '../translator';
2
+ import { TranslatorState, createCompilerState } from '../translator';
3
3
  import { ElementToVueOptions } from './ViewElement__';
4
4
  import CallQueryComponent from './CallQueryComponent__';
5
5
  import CallInterface from './CallInterface__';
@@ -330,7 +330,7 @@ export class LogicItem extends BaseNode {
330
330
  * @param state 编译状态
331
331
  * @returns 生成的代码
332
332
  */
333
- toEmbeddedTS(state?: TranslatorState): string {
333
+ toEmbeddedTS(state = createCompilerState()): string {
334
334
  return this.toJS(state);
335
335
  }
336
336
 
@@ -339,7 +339,7 @@ export class LogicItem extends BaseNode {
339
339
  * @param state 编译状态
340
340
  * @returns 生成的代码
341
341
  */
342
- toNaturalTS(state?: TranslatorState): string {
342
+ toNaturalTS(state = createCompilerState()): string {
343
343
  return this.toEmbeddedTS(state);
344
344
  }
345
345
 
@@ -1884,7 +1884,7 @@ export class Logic extends BaseNode {
1884
1884
  }
1885
1885
 
1886
1886
  @withSourceMap()
1887
- toNaturalTS(state?: TranslatorState, prefix?: string, logicName?: string): string {
1887
+ toNaturalTS(state = createCompilerState(), prefix?: string, logicName?: string): string {
1888
1888
  if (!logicName) {
1889
1889
  if (this.parentNode instanceof BindEvent && this.parentNode.parentNode instanceof View) {
1890
1890
  logicName = `on_view_${this.name}`;
@@ -2259,6 +2259,7 @@ export class Logic extends BaseNode {
2259
2259
  delete() {
2260
2260
  let actionMsg = '删除逻辑项';
2261
2261
  if (this.name) actionMsg += `“${this.name}”`;
2262
+ this.app?.emit('logicDeleted', { actionMsg: this.nodePath})
2262
2263
  this.app?.emit('collect:start', {
2263
2264
  actionMsg,
2264
2265
  });
@@ -1,6 +1,6 @@
1
1
  // @ts-nocheck
2
2
  import { v4 as uuidv4 } from 'uuid';
3
- import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
3
+ import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
4
4
  import Match from './Match__';
5
5
  import MemberExpression from './MemberExpression__';
6
6
  import BooleanLiteral from './BooleanLiteral__';
@@ -842,7 +842,7 @@ export class MatchCase extends LogicItem {
842
842
 
843
843
 
844
844
  @withSourceMap()
845
- toNaturalTS(state?: TranslatorState, index?: number, parentCode?: string): string {
845
+ toNaturalTS(state = createCompilerState(), index?: number, parentCode?: string): string {
846
846
  let code = '\n';
847
847
 
848
848
  const parentNode = (this.parentNode as Match);
@@ -1,5 +1,5 @@
1
1
  import { v4 as uuidv4 } from 'uuid';
2
- import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
2
+ import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
3
3
  import TypeAnnotation, { isUnion } from './TypeAnnotation__';
4
4
  import BooleanLiteral from './BooleanLiteral__';
5
5
  import MemberExpression from './MemberExpression__';
@@ -675,7 +675,7 @@ export class Match extends LogicItem {
675
675
  }
676
676
 
677
677
  @withSourceMap()
678
- toEmbeddedTS(state?: TranslatorState): string {
678
+ toEmbeddedTS(state = createCompilerState()): string {
679
679
  let code = '';
680
680
 
681
681
  if (this.parentNode.concept === 'Logic') {
@@ -733,7 +733,7 @@ export class Match extends LogicItem {
733
733
  }
734
734
 
735
735
  @withSourceMap()
736
- toNaturalTS(state?: TranslatorState): string {
736
+ toNaturalTS(state = createCompilerState()): string {
737
737
  let code = '';
738
738
 
739
739
  if (this.parentNode?.concept === 'Logic') {
@@ -1,9 +1,9 @@
1
1
  import { v4 as uuidv4 } from 'uuid';
2
- import { TranslatorState, shiftState, withSourceMap } from '../translator';
2
+ import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
3
3
  import { Enum, TypeAnnotation } from '..';
4
4
  import { ElementToVueOptions } from './ViewElement__';
5
5
  import Identifier from './Identifier__';
6
- import BindAttribute from './BindAttribute__';
6
+ import BindAttribute, { attrConvertCamelCase } from './BindAttribute__';
7
7
  import Assignment from './Assignment__';
8
8
  import BatchAssignment from './BatchAssignment__';
9
9
 
@@ -21,6 +21,12 @@ import LogicItem from './LogicItem__';
21
21
 
22
22
  const Identifier_RE = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
23
23
 
24
+ const atrrParamsMap:Record<string, string> = {
25
+ page: 'pageNumber',
26
+ size: 'pageSize',
27
+ sort: 'sorting.field',
28
+ order: 'sorting.order'
29
+ };
24
30
  /**
25
31
  * 成员表达式
26
32
  */
@@ -135,6 +141,7 @@ export class MemberExpression extends LogicItem {
135
141
  return params;
136
142
  }
137
143
 
144
+
138
145
  //= ===============================================================================
139
146
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
140
147
  // 自动生成的代码已结束。下面可以手动编写。
@@ -150,6 +157,25 @@ export class MemberExpression extends LogicItem {
150
157
  if (this.object?.__TypeAnnotation?.sortedTypeKey?.startsWith('nasl.collection.Map') && this.property?.name === 'length') {
151
158
  return `Object.keys(${this.object?.toJS()}).length`;
152
159
  }
160
+ if (this.object instanceof Identifier && this.object?.namespace?.startsWith('elements.') && this.object?.namespace?.endsWith('.property')) {
161
+ let elementName = ''
162
+ if (this.object.namespace.startsWith('elements.$ce')) {
163
+ elementName = this.getAncestor('ViewElement')?.name
164
+ } else {
165
+ elementName = this.object.name
166
+ }
167
+ let propertyName = ''
168
+ let subProperty = ''
169
+ if (this.property instanceof Identifier) {
170
+ const namespace = this.property.namespace
171
+ const namespaceList = namespace.includes('.') ? namespace.split('.') : [namespace]
172
+ propertyName = namespaceList[0]
173
+ subProperty = namespaceList?.[1] ? `['${namespaceList?.[1]}']` : ''
174
+ }
175
+ return `this['__${elementName}_${propertyName}']${subProperty}`
176
+ } else if (this.object instanceof MemberExpression && this.object?.object?.name === 'elements' && this.object?.property?.name === '$ce') {
177
+ return this.transfromAtrrLogic();
178
+ }
153
179
  const object = String(this.object?.toVue(options)); // undefined 也让正常展示
154
180
  const property = String(this.property?.toVue(options));
155
181
 
@@ -170,6 +196,19 @@ export class MemberExpression extends LogicItem {
170
196
  }
171
197
  const object: string = this.object?.toUI();
172
198
  const property = this.property?.toUI();
199
+ const paramsMap:Record<string, string> = {
200
+ 'pageNumber': 'page',
201
+ 'pageSize': 'size',
202
+ 'sorting.field': 'sort',
203
+ 'sorting.order': 'order'
204
+ };
205
+ if (paramsMap[this.property.name]) {
206
+ this.property.name = paramsMap[this.property.name]
207
+ }
208
+ if (this.object instanceof Identifier && property === '$ce' && object === 'elements') return
209
+ if (this.object instanceof MemberExpression && this.object?.object?.name === 'elements' && this.object?.property?.name === '$ce') {
210
+ return Identifier_RE.test(property) ? `当前组件.${property}` : `当前组件['${property}']`;
211
+ }
173
212
 
174
213
  return Identifier_RE.test(property) ? `${object}.${property}` : `${object}['${property}']`;
175
214
  }
@@ -182,6 +221,25 @@ export class MemberExpression extends LogicItem {
182
221
  if (this.object?.__TypeAnnotation?.sortedTypeKey?.startsWith('nasl.collection.Map') && this.property?.name === 'length') {
183
222
  return `Object.keys(${this.object?.toJS()}).length`;
184
223
  }
224
+ if (this.object instanceof Identifier && this.property instanceof Identifier && this.object?.namespace?.startsWith('elements.') && this.object?.namespace?.endsWith('.property')) {
225
+ let elementName = ''
226
+ if (this.object.namespace.startsWith('elements.$ce')) {
227
+ elementName = this.getAncestor('ViewElement')?.name
228
+ } else {
229
+ elementName = this.object.name
230
+ }
231
+ let propertyName = ''
232
+ let subProperty = ''
233
+ if (this.property instanceof Identifier) {
234
+ const namespace = this.property.namespace
235
+ const namespaceList = namespace.includes('.') ? namespace.split('.') : [namespace]
236
+ propertyName = namespaceList[0]
237
+ subProperty = namespaceList?.[1] ? `['${namespaceList?.[1]}']` : ''
238
+ }
239
+ return `this['__${elementName}_${propertyName}']${subProperty}`
240
+ } else if (this.object instanceof MemberExpression && this.object?.object?.name === 'elements' && this.object?.property?.name === '$ce') {
241
+ return this.transfromAtrrLogic();
242
+ }
185
243
  const object: string = this.object?.toJS();
186
244
  const property = this.property?.toJS();
187
245
  // 在赋值语句的左侧,不能有 &&
@@ -281,6 +339,19 @@ export class MemberExpression extends LogicItem {
281
339
 
282
340
  return value;
283
341
  }
342
+ transfromAtrrLogic() {
343
+ let elementName = this.getAncestor('ViewElement')?.name
344
+ let propertyName = ''
345
+ let subProperty = ''
346
+ let name = this.property.name
347
+ if (atrrParamsMap[this.property.name]) {
348
+ name = atrrParamsMap[this.property.name]
349
+ }
350
+ const namesList = name.includes('.') ? name.split('.') : [name]
351
+ propertyName = namesList[0]
352
+ subProperty = namesList?.[1] ? `['${namesList?.[1]}']` : ''
353
+ return `this['__${elementName}_${propertyName}']${subProperty}`
354
+ }
284
355
 
285
356
  get completeName() {
286
357
  const object: string = this.object?.completeName;
@@ -324,7 +395,7 @@ export class MemberExpression extends LogicItem {
324
395
  * @returns
325
396
  */
326
397
  @withSourceMap()
327
- toEmbeddedTS(state?: TranslatorState): string {
398
+ toEmbeddedTS(state = createCompilerState()): string {
328
399
  let code = '';
329
400
  const leftCode = this.object ? `${this.object.toEmbeddedTS(shiftState(state, code, { inline: true }))}.` : '';
330
401
  code += this.object ? `${this.object.toEmbeddedTS(shiftState(state, code, { inline: true }))}.` : '';
@@ -337,11 +408,48 @@ export class MemberExpression extends LogicItem {
337
408
  const newCode = `${code.substring(0, lastIndex)}['${code.substring(lastIndex + 1, code.length)}']`;
338
409
  code = newCode;
339
410
  }
411
+ if (this.object instanceof Identifier && this.object?.namespace?.startsWith('elements.') && this.object?.namespace?.endsWith('.property')) {
412
+ let newCode = ''
413
+ if (this.object?.namespace?.startsWith('elements.$ce')) {
414
+ const elementName = this.getAncestor('ViewElement')?.name
415
+ newCode += `__elements_completionProperty.${elementName}`
416
+ if (this.property instanceof Identifier) {
417
+ const namespace = this.property.namespace
418
+ const namespaceList = namespace.includes('.') ? namespace.split('.') : [namespace]
419
+ namespaceList.forEach((item) => {
420
+ newCode += `.${attrConvertCamelCase(item)}`
421
+ })
422
+ }
423
+ } else {
424
+ newCode += `__elements.${this.object?.name}`
425
+ if (this.property instanceof Identifier) {
426
+ const namespace = this.property.namespace
427
+ const namespaceList = namespace.includes('.') ? namespace.split('.') : [namespace]
428
+ namespaceList.forEach((item) => {
429
+ newCode += `['${item}']`
430
+ })
431
+ }
432
+ }
433
+ return newCode
434
+ }
435
+ if (this.object instanceof MemberExpression && this.object?.object?.name === 'elements' && this.object?.property?.name === '$ce') {
436
+ let newCode = ''
437
+ const elementName = this.getAncestor('ViewElement')?.name
438
+ newCode += `__elements_completionProperty['${elementName}']`
439
+ if (atrrParamsMap[this.property.name]) {
440
+ const name = atrrParamsMap[this.property.name]
441
+ const nameList = name.includes('.') ? name.split('.') : [name]
442
+ nameList.forEach((item) => {
443
+ newCode += `.${attrConvertCamelCase(item)}`
444
+ })
445
+ }
446
+ return newCode
447
+ }
340
448
  return code;
341
449
  }
342
450
 
343
451
  @withSourceMap()
344
- toNaturalTS(state?: TranslatorState): string {
452
+ toNaturalTS(state = createCompilerState()): string {
345
453
  let code = '';
346
454
  const leftCode = this.object ? `${this.object.toNaturalTS(shiftState(state, code, { inline: true }))}.` : '';
347
455
  code += this.object ? `${this.object.toNaturalTS(shiftState(state, code, { inline: true }))}.` : '';
@@ -1,13 +1,20 @@
1
- import { v4 as uuidv4 } from 'uuid';
1
+ type PropertyType = 'structures' | 'enums' | 'entities' | 'interfaces' | 'processes' | 'views';
2
+ const moduleNameSpace = {
3
+ dependencies: 'extensions',
4
+ interfaceDependencies: 'apis',
5
+ componentDependencies: 'components',
6
+ };
7
+ type ModuleKeyType = 'dependencies' | 'interfaceDependencies' | 'componentDependencies';
2
8
  import ConfigProperty from './ConfigProperty__';
3
- //= ===============================================================================
9
+ //================================================================================
4
10
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
5
11
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
6
- //= ===============================================================================
12
+ //================================================================================
7
13
  import { EventPayload, Params } from '../common/EventEmitter';
8
14
  import { concept, excludedInJSON, property } from '../decorators';
9
15
 
10
16
  import * as utils from '../utils';
17
+ import { v4 as uuidv4 } from 'uuid';
11
18
  import BaseNode from '../common/BaseNode';
12
19
  import classMap from '../common/classMap';
13
20
  import DataSource from './DataSource__';
@@ -24,14 +31,6 @@ import TriggerLauncher from './TriggerLauncher__';
24
31
  import Connection from './Connection__';
25
32
  import App from './App__';
26
33
 
27
- type PropertyType = 'structures' | 'enums' | 'entities' | 'interfaces' | 'processes' | 'views';
28
- const moduleNameSpace = {
29
- dependencies: 'extensions',
30
- interfaceDependencies: 'apis',
31
- componentDependencies: 'components',
32
- };
33
- type ModuleKeyType = 'dependencies' | 'interfaceDependencies' | 'componentDependencies';
34
-
35
34
  /**
36
35
  * 模块
37
36
  */
@@ -177,12 +176,10 @@ export class Module extends BaseNode {
177
176
  * @param source 需要合并的部分参数
178
177
  */
179
178
  constructor(source?: Partial<Module>) {
180
- // @ts-ignore
181
- source = { ...Module.getDefaultOptions(), ...source };
179
+ source = Object.assign({}, Module.getDefaultOptions(), source);
182
180
  super(source);
183
181
  super.subConstructor(source);
184
182
  }
185
-
186
183
  getClassName() {
187
184
  return 'Module';
188
185
  }
@@ -207,7 +204,6 @@ export class Module extends BaseNode {
207
204
  const excludedSet = new Set(excludedList);
208
205
  return ((this.dataSources as DataSource[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
209
206
  }
210
-
211
207
  getDataSourceUniqueName(name = 'dataSource1') {
212
208
  return utils.unique(name, this.getDataSourceExistingNames(), undefined, false);
213
209
  }
@@ -361,7 +357,6 @@ export class Module extends BaseNode {
361
357
  const excludedSet = new Set(excludedList);
362
358
  return ((this.structures as Structure[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
363
359
  }
364
-
365
360
  getStructureUniqueName(name = 'Structure1') {
366
361
  return utils.unique(name, this.getStructureExistingNames(), undefined, false);
367
362
  }
@@ -515,7 +510,6 @@ export class Module extends BaseNode {
515
510
  const excludedSet = new Set(excludedList);
516
511
  return ((this.enums as Enum[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
517
512
  }
518
-
519
513
  getEnumUniqueName(name = 'Enum1') {
520
514
  return utils.unique(name, this.getEnumExistingNames(), undefined, false);
521
515
  }
@@ -669,7 +663,6 @@ export class Module extends BaseNode {
669
663
  const excludedSet = new Set(excludedList);
670
664
  return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
671
665
  }
672
-
673
666
  getLogicUniqueName(name = 'logic1') {
674
667
  return utils.unique(name, this.getLogicExistingNames(), undefined, false);
675
668
  }
@@ -823,7 +816,6 @@ export class Module extends BaseNode {
823
816
  const excludedSet = new Set(excludedList);
824
817
  return ((this.interfaces as Interface[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
825
818
  }
826
-
827
819
  getInterfaceUniqueName(name = 'Interface1') {
828
820
  return utils.unique(name, this.getInterfaceExistingNames(), undefined, false);
829
821
  }
@@ -977,7 +969,6 @@ export class Module extends BaseNode {
977
969
  const excludedSet = new Set(excludedList);
978
970
  return ((this.views as View[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
979
971
  }
980
-
981
972
  getViewUniqueName(name = 'view1') {
982
973
  return utils.unique(name, this.getViewExistingNames(), undefined, false);
983
974
  }
@@ -1131,7 +1122,6 @@ export class Module extends BaseNode {
1131
1122
  const excludedSet = new Set(excludedList);
1132
1123
  return ((this.frontendVariables as Variable[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1133
1124
  }
1134
-
1135
1125
  getVariableUniqueName(name = 'variable1') {
1136
1126
  return utils.unique(name, this.getVarExistingNames(), undefined, true);
1137
1127
  }
@@ -1285,7 +1275,6 @@ export class Module extends BaseNode {
1285
1275
  const excludedSet = new Set(excludedList);
1286
1276
  return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1287
1277
  }
1288
-
1289
1278
  getProcessUniqueName(name = 'Process1') {
1290
1279
  return utils.unique(name, this.getProcessExistingNames(), undefined, false);
1291
1280
  }
@@ -1439,7 +1428,6 @@ export class Module extends BaseNode {
1439
1428
  const excludedSet = new Set(excludedList);
1440
1429
  return ((this.frontends as FrontendLibrary[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1441
1430
  }
1442
-
1443
1431
  getFrontendLibraryUniqueName(name = 'frontendLibrary1') {
1444
1432
  return utils.unique(name, this.getFrontendLibraryExistingNames(), undefined, false);
1445
1433
  }
@@ -1593,7 +1581,6 @@ export class Module extends BaseNode {
1593
1581
  const excludedSet = new Set(excludedList);
1594
1582
  return ((this.triggerLaunchers as TriggerLauncher[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1595
1583
  }
1596
-
1597
1584
  getTriggerLauncherUniqueName(name = 'triggerLauncher1') {
1598
1585
  return utils.unique(name, this.getTriggerLauncherExistingNames(), undefined, false);
1599
1586
  }
@@ -1747,7 +1734,6 @@ export class Module extends BaseNode {
1747
1734
  const excludedSet = new Set(excludedList);
1748
1735
  return ((this.connections as Connection[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1749
1736
  }
1750
-
1751
1737
  getConnectionUniqueName(name = 'connection1') {
1752
1738
  return utils.unique(name, this.getConnectionExistingNames(), undefined, false);
1753
1739
  }
@@ -1914,7 +1900,7 @@ export class Module extends BaseNode {
1914
1900
  if (typeof options === 'string') {
1915
1901
  dataSource = (this.dataSources as DataSource[]).find((item) => item.name === options);
1916
1902
  if (!dataSource) {
1917
- throw new Error(`找不到数据源 ${options}`);
1903
+ throw new Error('找不到数据源 ' + options);
1918
1904
  }
1919
1905
  } else {
1920
1906
  dataSource = options;
@@ -1923,7 +1909,7 @@ export class Module extends BaseNode {
1923
1909
  }
1924
1910
 
1925
1911
  __removeDataSource(dataSource: DataSource) {
1926
- const { parentKey } = dataSource;
1912
+ const parentKey = dataSource.parentKey;
1927
1913
  const params: Params = {
1928
1914
  parentNode: this,
1929
1915
  parentKey,
@@ -1962,7 +1948,7 @@ export class Module extends BaseNode {
1962
1948
  if (typeof options === 'string') {
1963
1949
  structure = (this.structures as Structure[]).find((item) => item.name === options);
1964
1950
  if (!structure) {
1965
- throw new Error(`找不到数据结构 ${options}`);
1951
+ throw new Error('找不到数据结构 ' + options);
1966
1952
  }
1967
1953
  } else {
1968
1954
  structure = options;
@@ -1971,7 +1957,7 @@ export class Module extends BaseNode {
1971
1957
  }
1972
1958
 
1973
1959
  __removeStructure(structure: Structure) {
1974
- const { parentKey } = structure;
1960
+ const parentKey = structure.parentKey;
1975
1961
  const params: Params = {
1976
1962
  parentNode: this,
1977
1963
  parentKey,
@@ -2010,7 +1996,7 @@ export class Module extends BaseNode {
2010
1996
  if (typeof options === 'string') {
2011
1997
  enumeration = (this.enums as Enum[]).find((item) => item.name === options);
2012
1998
  if (!enumeration) {
2013
- throw new Error(`找不到枚举 ${options}`);
1999
+ throw new Error('找不到枚举 ' + options);
2014
2000
  }
2015
2001
  } else {
2016
2002
  enumeration = options;
@@ -2019,7 +2005,7 @@ export class Module extends BaseNode {
2019
2005
  }
2020
2006
 
2021
2007
  __removeEnum(enumeration: Enum) {
2022
- const { parentKey } = enumeration;
2008
+ const parentKey = enumeration.parentKey;
2023
2009
  const params: Params = {
2024
2010
  parentNode: this,
2025
2011
  parentKey,
@@ -2058,7 +2044,7 @@ export class Module extends BaseNode {
2058
2044
  if (typeof options === 'string') {
2059
2045
  logic = (this.logics as Logic[]).find((item) => item.name === options);
2060
2046
  if (!logic) {
2061
- throw new Error(`找不到逻辑 ${options}`);
2047
+ throw new Error('找不到逻辑 ' + options);
2062
2048
  }
2063
2049
  } else {
2064
2050
  logic = options;
@@ -2067,7 +2053,7 @@ export class Module extends BaseNode {
2067
2053
  }
2068
2054
 
2069
2055
  __removeLogic(logic: Logic) {
2070
- const { parentKey } = logic;
2056
+ const parentKey = logic.parentKey;
2071
2057
  const params: Params = {
2072
2058
  parentNode: this,
2073
2059
  parentKey,
@@ -2106,7 +2092,7 @@ export class Module extends BaseNode {
2106
2092
  if (typeof options === 'string') {
2107
2093
  itface = (this.interfaces as Interface[]).find((item) => item.name === options);
2108
2094
  if (!itface) {
2109
- throw new Error(`找不到接口 ${options}`);
2095
+ throw new Error('找不到接口 ' + options);
2110
2096
  }
2111
2097
  } else {
2112
2098
  itface = options;
@@ -2115,7 +2101,7 @@ export class Module extends BaseNode {
2115
2101
  }
2116
2102
 
2117
2103
  __removeInterface(itface: Interface) {
2118
- const { parentKey } = itface;
2104
+ const parentKey = itface.parentKey;
2119
2105
  const params: Params = {
2120
2106
  parentNode: this,
2121
2107
  parentKey,
@@ -2154,7 +2140,7 @@ export class Module extends BaseNode {
2154
2140
  if (typeof options === 'string') {
2155
2141
  view = (this.views as View[]).find((item) => item.name === options);
2156
2142
  if (!view) {
2157
- throw new Error(`找不到页面 ${options}`);
2143
+ throw new Error('找不到页面 ' + options);
2158
2144
  }
2159
2145
  } else {
2160
2146
  view = options;
@@ -2163,7 +2149,7 @@ export class Module extends BaseNode {
2163
2149
  }
2164
2150
 
2165
2151
  __removeView(view: View) {
2166
- const { parentKey } = view;
2152
+ const parentKey = view.parentKey;
2167
2153
  const params: Params = {
2168
2154
  parentNode: this,
2169
2155
  parentKey,
@@ -2202,7 +2188,7 @@ export class Module extends BaseNode {
2202
2188
  if (typeof options === 'string') {
2203
2189
  variable = (this.frontendVariables as Variable[]).find((item) => item.name === options);
2204
2190
  if (!variable) {
2205
- throw new Error(`找不到变量 ${options}`);
2191
+ throw new Error('找不到变量 ' + options);
2206
2192
  }
2207
2193
  } else {
2208
2194
  variable = options;
@@ -2211,7 +2197,7 @@ export class Module extends BaseNode {
2211
2197
  }
2212
2198
 
2213
2199
  __removeVariable(variable: Variable) {
2214
- const { parentKey } = variable;
2200
+ const parentKey = variable.parentKey;
2215
2201
  const params: Params = {
2216
2202
  parentNode: this,
2217
2203
  parentKey,
@@ -2250,7 +2236,7 @@ export class Module extends BaseNode {
2250
2236
  if (typeof options === 'string') {
2251
2237
  process = (this.processes as Process[]).find((item) => item.name === options);
2252
2238
  if (!process) {
2253
- throw new Error(`找不到流程 ${options}`);
2239
+ throw new Error('找不到流程 ' + options);
2254
2240
  }
2255
2241
  } else {
2256
2242
  process = options;
@@ -2259,7 +2245,7 @@ export class Module extends BaseNode {
2259
2245
  }
2260
2246
 
2261
2247
  __removeProcess(process: Process) {
2262
- const { parentKey } = process;
2248
+ const parentKey = process.parentKey;
2263
2249
  const params: Params = {
2264
2250
  parentNode: this,
2265
2251
  parentKey,
@@ -2298,7 +2284,7 @@ export class Module extends BaseNode {
2298
2284
  if (typeof options === 'string') {
2299
2285
  frontendLibrary = (this.frontends as FrontendLibrary[]).find((item) => item.name === options);
2300
2286
  if (!frontendLibrary) {
2301
- throw new Error(`找不到端包 ${options}`);
2287
+ throw new Error('找不到端包 ' + options);
2302
2288
  }
2303
2289
  } else {
2304
2290
  frontendLibrary = options;
@@ -2307,7 +2293,7 @@ export class Module extends BaseNode {
2307
2293
  }
2308
2294
 
2309
2295
  __removeFrontendLibrary(frontendLibrary: FrontendLibrary) {
2310
- const { parentKey } = frontendLibrary;
2296
+ const parentKey = frontendLibrary.parentKey;
2311
2297
  const params: Params = {
2312
2298
  parentNode: this,
2313
2299
  parentKey,
@@ -2346,7 +2332,7 @@ export class Module extends BaseNode {
2346
2332
  if (typeof options === 'string') {
2347
2333
  configuration = this.configuration;
2348
2334
  if (!configuration) {
2349
- throw new Error(`找不到配置管理 ${options}`);
2335
+ throw new Error('找不到配置管理 ' + options);
2350
2336
  }
2351
2337
  } else {
2352
2338
  configuration = options;
@@ -2355,7 +2341,7 @@ export class Module extends BaseNode {
2355
2341
  }
2356
2342
 
2357
2343
  __removeConfiguration(configuration: Configuration) {
2358
- const { parentKey } = configuration;
2344
+ const parentKey = configuration.parentKey;
2359
2345
  const params: Params = {
2360
2346
  parentNode: this,
2361
2347
  parentKey,
@@ -2394,7 +2380,7 @@ export class Module extends BaseNode {
2394
2380
  if (typeof options === 'string') {
2395
2381
  triggerLauncher = (this.triggerLaunchers as TriggerLauncher[]).find((item) => item.name === options);
2396
2382
  if (!triggerLauncher) {
2397
- throw new Error(`找不到触发器启动器 ${options}`);
2383
+ throw new Error('找不到触发器启动器 ' + options);
2398
2384
  }
2399
2385
  } else {
2400
2386
  triggerLauncher = options;
@@ -2403,7 +2389,7 @@ export class Module extends BaseNode {
2403
2389
  }
2404
2390
 
2405
2391
  __removeTriggerLauncher(triggerLauncher: TriggerLauncher) {
2406
- const { parentKey } = triggerLauncher;
2392
+ const parentKey = triggerLauncher.parentKey;
2407
2393
  const params: Params = {
2408
2394
  parentNode: this,
2409
2395
  parentKey,
@@ -2442,7 +2428,7 @@ export class Module extends BaseNode {
2442
2428
  if (typeof options === 'string') {
2443
2429
  connection = (this.connections as Connection[]).find((item) => item.name === options);
2444
2430
  if (!connection) {
2445
- throw new Error(`找不到连接 ${options}`);
2431
+ throw new Error('找不到连接 ' + options);
2446
2432
  }
2447
2433
  } else {
2448
2434
  connection = options;
@@ -2451,7 +2437,7 @@ export class Module extends BaseNode {
2451
2437
  }
2452
2438
 
2453
2439
  __removeConnection(connection: Connection) {
2454
- const { parentKey } = connection;
2440
+ const parentKey = connection.parentKey;
2455
2441
  const params: Params = {
2456
2442
  parentNode: this,
2457
2443
  parentKey,
@@ -2473,10 +2459,10 @@ export class Module extends BaseNode {
2473
2459
  return params;
2474
2460
  }
2475
2461
 
2476
- //= ===============================================================================
2462
+ //================================================================================
2477
2463
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
2478
2464
  // 自动生成的代码已结束。下面可以手动编写。
2479
- //= ===============================================================================
2465
+ //================================================================================
2480
2466
  /**
2481
2467
  * 用于区分存量应用新导入模块,存量应用替换数据结构使用
2482
2468
  */
@@ -2503,7 +2489,6 @@ export class Module extends BaseNode {
2503
2489
  ...object,
2504
2490
  });
2505
2491
  }
2506
-
2507
2492
  /**
2508
2493
  * 生成宿主语言的文件路径
2509
2494
  * @param name 一般不用传,用于 rename
@@ -2511,7 +2496,6 @@ export class Module extends BaseNode {
2511
2496
  getEmbeddedFilePath(name = this.name) {
2512
2497
  return `/embedded/${this.app.name}/${this.parentKey}/${this.name}`;
2513
2498
  }
2514
-
2515
2499
  /**
2516
2500
  * 获取命名空间和
2517
2501
  * 暂时不考虑 Module 嵌套的情况
@@ -2530,7 +2514,6 @@ export class Module extends BaseNode {
2530
2514
  }
2531
2515
  return `${moduleNameSpace[this.parentKey as ModuleKeyType]}`;
2532
2516
  }
2533
-
2534
2517
  getTsNamespaceAndName() {
2535
2518
  if (this.type === 'connector') {
2536
2519
  return 'connector';
@@ -2612,15 +2595,15 @@ export class Module extends BaseNode {
2612
2595
  }
2613
2596
  }
2614
2597
 
2615
- //= ===============================================================================
2598
+ //================================================================================
2616
2599
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
2617
2600
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
2618
- //= ===============================================================================
2601
+ //================================================================================
2619
2602
  }
2620
2603
 
2621
2604
  classMap.Module = Module;
2622
2605
  export default Module;
2623
- //= ===============================================================================
2606
+ //================================================================================
2624
2607
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
2625
2608
  // 自动生成的代码已结束。下面可以手动编写。
2626
- //= ===============================================================================
2609
+ //================================================================================