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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (460) hide show
  1. package/out/automate/engine/index.d.ts +2 -2
  2. package/out/automate/engine/index.js +7 -6
  3. package/out/automate/engine/index.js.map +1 -1
  4. package/out/automate/engine/operators.d.ts +2 -2
  5. package/out/automate/engine/operators.js +5 -14
  6. package/out/automate/engine/operators.js.map +1 -1
  7. package/out/automate/engine/uniqueName.d.ts +2 -2
  8. package/out/automate/engine/uniqueName.js +5 -5
  9. package/out/automate/engine/uniqueName.js.map +1 -1
  10. package/out/automate/engine/utils.js +1 -4
  11. package/out/automate/engine/utils.js.map +1 -1
  12. package/out/automate/template/myProcess.d.ts +1 -1
  13. package/out/automate/template/myProcess.js +9023 -9023
  14. package/out/automate/template/myProcess.js.map +1 -1
  15. package/out/bak/translator.js +24 -16
  16. package/out/bak/translator.js.map +1 -1
  17. package/out/common/BaseNode.d.ts +0 -12
  18. package/out/common/BaseNode.js +13 -84
  19. package/out/common/BaseNode.js.map +1 -1
  20. package/out/common/EventEmitter.d.ts +0 -1
  21. package/out/common/EventEmitter.js +0 -3
  22. package/out/common/EventEmitter.js.map +1 -1
  23. package/out/common/Messager.js +0 -1
  24. package/out/common/Messager.js.map +1 -1
  25. package/out/concepts/Anchor__.d.ts +0 -1
  26. package/out/concepts/Anchor__.js +0 -3
  27. package/out/concepts/Anchor__.js.map +1 -1
  28. package/out/concepts/AnonymousFunction__.d.ts +0 -1
  29. package/out/concepts/AnonymousFunction__.js +0 -3
  30. package/out/concepts/AnonymousFunction__.js.map +1 -1
  31. package/out/concepts/App__.d.ts +256 -99
  32. package/out/concepts/App__.js +405 -232
  33. package/out/concepts/App__.js.map +1 -1
  34. package/out/concepts/Argument__.d.ts +0 -1
  35. package/out/concepts/Argument__.js +0 -3
  36. package/out/concepts/Argument__.js.map +1 -1
  37. package/out/concepts/Assignee__.d.ts +0 -1
  38. package/out/concepts/Assignee__.js +0 -3
  39. package/out/concepts/Assignee__.js.map +1 -1
  40. package/out/concepts/AssignmentLine__.d.ts +0 -1
  41. package/out/concepts/AssignmentLine__.js +0 -3
  42. package/out/concepts/AssignmentLine__.js.map +1 -1
  43. package/out/concepts/Assignment__.d.ts +0 -1
  44. package/out/concepts/Assignment__.js +0 -3
  45. package/out/concepts/Assignment__.js.map +1 -1
  46. package/out/concepts/Attribute__.d.ts +14 -10
  47. package/out/concepts/Attribute__.js +39 -15
  48. package/out/concepts/Attribute__.js.map +1 -1
  49. package/out/concepts/BatchAssignment__.d.ts +0 -1
  50. package/out/concepts/BatchAssignment__.js +0 -3
  51. package/out/concepts/BatchAssignment__.js.map +1 -1
  52. package/out/concepts/BinaryExpression__.d.ts +0 -1
  53. package/out/concepts/BinaryExpression__.js +0 -3
  54. package/out/concepts/BinaryExpression__.js.map +1 -1
  55. package/out/concepts/BindAttribute__.d.ts +0 -13
  56. package/out/concepts/BindAttribute__.js +38 -296
  57. package/out/concepts/BindAttribute__.js.map +1 -1
  58. package/out/concepts/BindDirective__.d.ts +0 -13
  59. package/out/concepts/BindDirective__.js +15 -223
  60. package/out/concepts/BindDirective__.js.map +1 -1
  61. package/out/concepts/BindEvent__.d.ts +0 -6
  62. package/out/concepts/BindEvent__.js +22 -30
  63. package/out/concepts/BindEvent__.js.map +1 -1
  64. package/out/concepts/BindStyle__.d.ts +0 -13
  65. package/out/concepts/BindStyle__.js +1 -200
  66. package/out/concepts/BindStyle__.js.map +1 -1
  67. package/out/concepts/BooleanLiteral__.d.ts +0 -1
  68. package/out/concepts/BooleanLiteral__.js +0 -3
  69. package/out/concepts/BooleanLiteral__.js.map +1 -1
  70. package/out/concepts/CallFunction__.d.ts +0 -1
  71. package/out/concepts/CallFunction__.js +23 -10
  72. package/out/concepts/CallFunction__.js.map +1 -1
  73. package/out/concepts/CallInterface__.d.ts +0 -2
  74. package/out/concepts/CallInterface__.js +4 -50
  75. package/out/concepts/CallInterface__.js.map +1 -1
  76. package/out/concepts/CallLogic__.d.ts +0 -12
  77. package/out/concepts/CallLogic__.js +70 -136
  78. package/out/concepts/CallLogic__.js.map +1 -1
  79. package/out/concepts/CallQueryComponent__.d.ts +0 -3
  80. package/out/concepts/CallQueryComponent__.js +38 -109
  81. package/out/concepts/CallQueryComponent__.js.map +1 -1
  82. package/out/concepts/Comment__.d.ts +0 -1
  83. package/out/concepts/Comment__.js +0 -3
  84. package/out/concepts/Comment__.js.map +1 -1
  85. package/out/concepts/CompletionProperty__.d.ts +0 -2
  86. package/out/concepts/CompletionProperty__.js +0 -4
  87. package/out/concepts/CompletionProperty__.js.map +1 -1
  88. package/out/concepts/ConfigGroup__.d.ts +0 -2
  89. package/out/concepts/ConfigGroup__.js +0 -16
  90. package/out/concepts/ConfigGroup__.js.map +1 -1
  91. package/out/concepts/ConfigPropertyValue__.d.ts +0 -1
  92. package/out/concepts/ConfigPropertyValue__.js +0 -3
  93. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  94. package/out/concepts/ConfigProperty__.d.ts +0 -24
  95. package/out/concepts/ConfigProperty__.js +0 -83
  96. package/out/concepts/ConfigProperty__.js.map +1 -1
  97. package/out/concepts/Configuration__.d.ts +0 -2
  98. package/out/concepts/Configuration__.js +0 -16
  99. package/out/concepts/Configuration__.js.map +1 -1
  100. package/out/concepts/Constant__.d.ts +0 -6
  101. package/out/concepts/Constant__.js +0 -9
  102. package/out/concepts/Constant__.js.map +1 -1
  103. package/out/concepts/DataElement__.d.ts +0 -1
  104. package/out/concepts/DataElement__.js +0 -3
  105. package/out/concepts/DataElement__.js.map +1 -1
  106. package/out/concepts/DataSource__.d.ts +0 -3
  107. package/out/concepts/DataSource__.js +5 -20
  108. package/out/concepts/DataSource__.js.map +1 -1
  109. package/out/concepts/Destination__.d.ts +0 -3
  110. package/out/concepts/Destination__.js +16 -98
  111. package/out/concepts/Destination__.js.map +1 -1
  112. package/out/concepts/End__.d.ts +0 -1
  113. package/out/concepts/End__.js +1 -4
  114. package/out/concepts/End__.js.map +1 -1
  115. package/out/concepts/EntityIndex__.d.ts +0 -1
  116. package/out/concepts/EntityIndex__.js +0 -3
  117. package/out/concepts/EntityIndex__.js.map +1 -1
  118. package/out/concepts/EntityProperty__.d.ts +5 -34
  119. package/out/concepts/EntityProperty__.js +56 -197
  120. package/out/concepts/EntityProperty__.js.map +1 -1
  121. package/out/concepts/Entity__.d.ts +1 -3
  122. package/out/concepts/Entity__.js +1 -33
  123. package/out/concepts/Entity__.js.map +1 -1
  124. package/out/concepts/EnumItem__.d.ts +0 -1
  125. package/out/concepts/EnumItem__.js +0 -3
  126. package/out/concepts/EnumItem__.js.map +1 -1
  127. package/out/concepts/Enum__.d.ts +0 -1
  128. package/out/concepts/Enum__.js +0 -3
  129. package/out/concepts/Enum__.js.map +1 -1
  130. package/out/concepts/Event__.d.ts +0 -1
  131. package/out/concepts/Event__.js +0 -3
  132. package/out/concepts/Event__.js.map +1 -1
  133. package/out/concepts/ExternalDestination__.d.ts +0 -2
  134. package/out/concepts/ExternalDestination__.js +4 -25
  135. package/out/concepts/ExternalDestination__.js.map +1 -1
  136. package/out/concepts/ForEachStatement__.d.ts +0 -1
  137. package/out/concepts/ForEachStatement__.js +0 -3
  138. package/out/concepts/ForEachStatement__.js.map +1 -1
  139. package/out/concepts/Function__.d.ts +0 -1
  140. package/out/concepts/Function__.js +0 -3
  141. package/out/concepts/Function__.js.map +1 -1
  142. package/out/concepts/Identifier__.d.ts +0 -1
  143. package/out/concepts/Identifier__.js +5 -26
  144. package/out/concepts/Identifier__.js.map +1 -1
  145. package/out/concepts/IfStatement__.d.ts +0 -1
  146. package/out/concepts/IfStatement__.js +2 -5
  147. package/out/concepts/IfStatement__.js.map +1 -1
  148. package/out/concepts/InterfaceParam__.d.ts +3 -1
  149. package/out/concepts/InterfaceParam__.js +56 -3
  150. package/out/concepts/InterfaceParam__.js.map +1 -1
  151. package/out/concepts/Interface__.d.ts +0 -14
  152. package/out/concepts/Interface__.js +0 -87
  153. package/out/concepts/Interface__.js.map +1 -1
  154. package/out/concepts/JSBlock__.d.ts +0 -1
  155. package/out/concepts/JSBlock__.js +1 -8
  156. package/out/concepts/JSBlock__.js.map +1 -1
  157. package/out/concepts/LogicItem__.d.ts +1 -7
  158. package/out/concepts/LogicItem__.js +0 -11
  159. package/out/concepts/LogicItem__.js.map +1 -1
  160. package/out/concepts/Logic__.d.ts +0 -7
  161. package/out/concepts/Logic__.js +19 -73
  162. package/out/concepts/Logic__.js.map +1 -1
  163. package/out/concepts/MatchCase__.d.ts +0 -1
  164. package/out/concepts/MatchCase__.js +1 -4
  165. package/out/concepts/MatchCase__.js.map +1 -1
  166. package/out/concepts/Match__.d.ts +3 -6
  167. package/out/concepts/Match__.js +20 -116
  168. package/out/concepts/Match__.js.map +1 -1
  169. package/out/concepts/MemberExpression__.d.ts +0 -1
  170. package/out/concepts/MemberExpression__.js +2 -14
  171. package/out/concepts/MemberExpression__.js.map +1 -1
  172. package/out/concepts/Module__.d.ts +56 -96
  173. package/out/concepts/Module__.js +58 -169
  174. package/out/concepts/Module__.js.map +1 -1
  175. package/out/concepts/Namespace__.d.ts +0 -1
  176. package/out/concepts/Namespace__.js +0 -3
  177. package/out/concepts/Namespace__.js.map +1 -1
  178. package/out/concepts/NewComposite__.d.ts +4 -4
  179. package/out/concepts/NewComposite__.js +112 -129
  180. package/out/concepts/NewComposite__.js.map +1 -1
  181. package/out/concepts/NewList__.d.ts +0 -1
  182. package/out/concepts/NewList__.js +24 -33
  183. package/out/concepts/NewList__.js.map +1 -1
  184. package/out/concepts/NewMap__.d.ts +0 -1
  185. package/out/concepts/NewMap__.js +23 -36
  186. package/out/concepts/NewMap__.js.map +1 -1
  187. package/out/concepts/New__.d.ts +0 -1
  188. package/out/concepts/New__.js +0 -3
  189. package/out/concepts/New__.js.map +1 -1
  190. package/out/concepts/NullLiteral__.d.ts +0 -1
  191. package/out/concepts/NullLiteral__.js +0 -3
  192. package/out/concepts/NullLiteral__.js.map +1 -1
  193. package/out/concepts/NumericLiteral__.d.ts +0 -1
  194. package/out/concepts/NumericLiteral__.js +9 -6
  195. package/out/concepts/NumericLiteral__.js.map +1 -1
  196. package/out/concepts/OqlQueryComponent__.d.ts +1 -1
  197. package/out/concepts/OqlQueryComponent__.js +60 -43
  198. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  199. package/out/concepts/Param__.d.ts +3 -7
  200. package/out/concepts/Param__.js +60 -17
  201. package/out/concepts/Param__.js.map +1 -1
  202. package/out/concepts/Point__.d.ts +0 -1
  203. package/out/concepts/Point__.js +0 -3
  204. package/out/concepts/Point__.js.map +1 -1
  205. package/out/concepts/ProcessComponent__.d.ts +0 -1
  206. package/out/concepts/ProcessComponent__.js +0 -3
  207. package/out/concepts/ProcessComponent__.js.map +1 -1
  208. package/out/concepts/ProcessElement__.d.ts +0 -1
  209. package/out/concepts/ProcessElement__.js +4 -16
  210. package/out/concepts/ProcessElement__.js.map +1 -1
  211. package/out/concepts/ProcessOutcome__.d.ts +0 -1
  212. package/out/concepts/ProcessOutcome__.js +0 -3
  213. package/out/concepts/ProcessOutcome__.js.map +1 -1
  214. package/out/concepts/ProcessOutcomes__.d.ts +0 -1
  215. package/out/concepts/ProcessOutcomes__.js +0 -3
  216. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  217. package/out/concepts/Process__.d.ts +20 -5
  218. package/out/concepts/Process__.js +7 -4
  219. package/out/concepts/Process__.js.map +1 -1
  220. package/out/concepts/QueryAggregateExpression__.d.ts +0 -1
  221. package/out/concepts/QueryAggregateExpression__.js +0 -3
  222. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  223. package/out/concepts/QueryFieldExpression__.d.ts +0 -1
  224. package/out/concepts/QueryFieldExpression__.js +1 -7
  225. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  226. package/out/concepts/QueryFromExpression__.d.ts +0 -1
  227. package/out/concepts/QueryFromExpression__.js +0 -3
  228. package/out/concepts/QueryFromExpression__.js.map +1 -1
  229. package/out/concepts/QueryGroupByExpression__.d.ts +0 -1
  230. package/out/concepts/QueryGroupByExpression__.js +0 -3
  231. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  232. package/out/concepts/QueryJoinExpression__.d.ts +0 -1
  233. package/out/concepts/QueryJoinExpression__.js +0 -3
  234. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  235. package/out/concepts/QueryLimitExpression__.d.ts +0 -1
  236. package/out/concepts/QueryLimitExpression__.js +0 -3
  237. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  238. package/out/concepts/QueryOrderByExpression__.d.ts +0 -1
  239. package/out/concepts/QueryOrderByExpression__.js +0 -3
  240. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  241. package/out/concepts/QuerySelectExpression__.d.ts +16 -105
  242. package/out/concepts/QuerySelectExpression__.js +9 -102
  243. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  244. package/out/concepts/Rect__.d.ts +0 -1
  245. package/out/concepts/Rect__.js +0 -3
  246. package/out/concepts/Rect__.js.map +1 -1
  247. package/out/concepts/Return__.d.ts +3 -6
  248. package/out/concepts/Return__.js +59 -13
  249. package/out/concepts/Return__.js.map +1 -1
  250. package/out/concepts/Role__.d.ts +0 -1
  251. package/out/concepts/Role__.js +0 -3
  252. package/out/concepts/Role__.js.map +1 -1
  253. package/out/concepts/SelectMembers__.d.ts +0 -1
  254. package/out/concepts/SelectMembers__.js +0 -3
  255. package/out/concepts/SelectMembers__.js.map +1 -1
  256. package/out/concepts/Slot__.d.ts +0 -17
  257. package/out/concepts/Slot__.js +0 -46
  258. package/out/concepts/Slot__.js.map +1 -1
  259. package/out/concepts/SqlQueryComponent__.d.ts +1 -1
  260. package/out/concepts/SqlQueryComponent__.js +46 -3
  261. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  262. package/out/concepts/Start__.d.ts +0 -1
  263. package/out/concepts/Start__.js +0 -3
  264. package/out/concepts/Start__.js.map +1 -1
  265. package/out/concepts/StringInterpolation__.d.ts +0 -1
  266. package/out/concepts/StringInterpolation__.js +1 -4
  267. package/out/concepts/StringInterpolation__.js.map +1 -1
  268. package/out/concepts/StringLiteral__.d.ts +0 -1
  269. package/out/concepts/StringLiteral__.js +6 -9
  270. package/out/concepts/StringLiteral__.js.map +1 -1
  271. package/out/concepts/StructureProperty__.d.ts +3 -9
  272. package/out/concepts/StructureProperty__.js +57 -21
  273. package/out/concepts/StructureProperty__.js.map +1 -1
  274. package/out/concepts/Structure__.d.ts +0 -1
  275. package/out/concepts/Structure__.js +0 -3
  276. package/out/concepts/Structure__.js.map +1 -1
  277. package/out/concepts/SwitchCase__.d.ts +0 -1
  278. package/out/concepts/SwitchCase__.js +2 -5
  279. package/out/concepts/SwitchCase__.js.map +1 -1
  280. package/out/concepts/SwitchStatement__.d.ts +0 -1
  281. package/out/concepts/SwitchStatement__.js +0 -3
  282. package/out/concepts/SwitchStatement__.js.map +1 -1
  283. package/out/concepts/Theme__.d.ts +0 -1
  284. package/out/concepts/Theme__.js +0 -3
  285. package/out/concepts/Theme__.js.map +1 -1
  286. package/out/concepts/Transactional__.d.ts +0 -6
  287. package/out/concepts/Transactional__.js +0 -9
  288. package/out/concepts/Transactional__.js.map +1 -1
  289. package/out/concepts/TypeAnnotation__.d.ts +3 -9
  290. package/out/concepts/TypeAnnotation__.js +13 -99
  291. package/out/concepts/TypeAnnotation__.js.map +1 -1
  292. package/out/concepts/TypeParam__.d.ts +0 -1
  293. package/out/concepts/TypeParam__.js +0 -3
  294. package/out/concepts/TypeParam__.js.map +1 -1
  295. package/out/concepts/UnaryExpression__.d.ts +0 -1
  296. package/out/concepts/UnaryExpression__.js +0 -3
  297. package/out/concepts/UnaryExpression__.js.map +1 -1
  298. package/out/concepts/Unparsed__.d.ts +0 -1
  299. package/out/concepts/Unparsed__.js +0 -3
  300. package/out/concepts/Unparsed__.js.map +1 -1
  301. package/out/concepts/UseComponent__.d.ts +0 -1
  302. package/out/concepts/UseComponent__.js +0 -3
  303. package/out/concepts/UseComponent__.js.map +1 -1
  304. package/out/concepts/ValidationRule__.d.ts +0 -2
  305. package/out/concepts/ValidationRule__.js +0 -56
  306. package/out/concepts/ValidationRule__.js.map +1 -1
  307. package/out/concepts/Variable__.d.ts +3 -6
  308. package/out/concepts/Variable__.js +60 -14
  309. package/out/concepts/Variable__.js.map +1 -1
  310. package/out/concepts/ViewComponent__.d.ts +0 -93
  311. package/out/concepts/ViewComponent__.js +0 -114
  312. package/out/concepts/ViewComponent__.js.map +1 -1
  313. package/out/concepts/ViewElement__.d.ts +0 -8
  314. package/out/concepts/ViewElement__.js +9 -65
  315. package/out/concepts/ViewElement__.js.map +1 -1
  316. package/out/concepts/View__.d.ts +3 -9
  317. package/out/concepts/View__.js +16 -63
  318. package/out/concepts/View__.js.map +1 -1
  319. package/out/concepts/WhileStatement__.d.ts +0 -1
  320. package/out/concepts/WhileStatement__.js +0 -3
  321. package/out/concepts/WhileStatement__.js.map +1 -1
  322. package/out/concepts/basics/stdlib/nasl.collection.js +2 -7
  323. package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -1
  324. package/out/concepts/basics/stdlib/nasl.configuration.js +0 -3
  325. package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
  326. package/out/concepts/basics/stdlib/nasl.core.d.ts +0 -2
  327. package/out/concepts/basics/stdlib/nasl.core.js +0 -34
  328. package/out/concepts/basics/stdlib/nasl.core.js.map +1 -1
  329. package/out/concepts/basics/stdlib/nasl.interface.js +1 -1
  330. package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
  331. package/out/concepts/basics/stdlib/nasl.process.js +6 -6
  332. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
  333. package/out/concepts/basics/stdlib/nasl.ui.js +43 -71
  334. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  335. package/out/concepts/basics/stdlib/nasl.util.js +19 -142
  336. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  337. package/out/concepts/basics/stdlib/nasl.validation.js +13 -13
  338. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
  339. package/out/concepts/basics/types/coreTypeList.js +5 -1
  340. package/out/concepts/basics/types/coreTypeList.js.map +1 -1
  341. package/out/concepts/basics/types/index.d.ts +0 -1
  342. package/out/concepts/basics/types/index.js +1 -3
  343. package/out/concepts/basics/types/index.js.map +1 -1
  344. package/out/concepts/index__.d.ts +0 -8
  345. package/out/concepts/index__.js +0 -8
  346. package/out/concepts/index__.js.map +1 -1
  347. package/out/decorators/index.js +3 -3
  348. package/out/decorators/index.js.map +1 -1
  349. package/out/enums/KEYWORDS.d.ts +0 -1
  350. package/out/enums/KEYWORDS.js +1 -16
  351. package/out/enums/KEYWORDS.js.map +1 -1
  352. package/out/generator/genBundleFiles.d.ts +3 -6
  353. package/out/generator/genBundleFiles.js +51 -60
  354. package/out/generator/genBundleFiles.js.map +1 -1
  355. package/out/generator/genMetaData.d.ts +2 -2
  356. package/out/generator/genMetaData.js +3 -3
  357. package/out/generator/genMetaData.js.map +1 -1
  358. package/out/generator/genReleaseBody.d.ts +4 -19
  359. package/out/generator/genReleaseBody.js +54 -144
  360. package/out/generator/genReleaseBody.js.map +1 -1
  361. package/out/generator/permission.d.ts +0 -1
  362. package/out/generator/permission.js +29 -24
  363. package/out/generator/permission.js.map +1 -1
  364. package/out/index.d.ts +1 -2
  365. package/out/index.js +1 -4
  366. package/out/index.js.map +1 -1
  367. package/out/server/entity2LogicNamespace.js +1 -3
  368. package/out/server/entity2LogicNamespace.js.map +1 -1
  369. package/out/server/extendBaseNode.js +1 -108
  370. package/out/server/extendBaseNode.js.map +1 -1
  371. package/out/server/formatTsUtils.d.ts +1 -2
  372. package/out/server/formatTsUtils.js +9 -152
  373. package/out/server/formatTsUtils.js.map +1 -1
  374. package/out/server/getLogics.d.ts +2 -2
  375. package/out/server/getLogics.js +17 -63
  376. package/out/server/getLogics.js.map +1 -1
  377. package/out/server/getMemberIdentifier.d.ts +0 -1
  378. package/out/server/getMemberIdentifier.js +6 -34
  379. package/out/server/getMemberIdentifier.js.map +1 -1
  380. package/out/server/index.js +0 -1
  381. package/out/server/index.js.map +1 -1
  382. package/out/server/naslServer.d.ts +4 -16
  383. package/out/server/naslServer.js +176 -1056
  384. package/out/server/naslServer.js.map +1 -1
  385. package/out/server/translator.js +30 -73
  386. package/out/server/translator.js.map +1 -1
  387. package/out/service/storage/api.d.ts +0 -9
  388. package/out/service/storage/api.js +0 -7
  389. package/out/service/storage/api.js.map +1 -1
  390. package/out/service/storage/init.d.ts +0 -3
  391. package/out/service/storage/init.js +10 -90
  392. package/out/service/storage/init.js.map +1 -1
  393. package/out/service/storage/service.d.ts +0 -3
  394. package/out/service/storage/service.js +1 -6
  395. package/out/service/storage/service.js.map +1 -1
  396. package/out/templator/genCallComponentLogic.d.ts +1 -1
  397. package/out/templator/genCallComponentLogic.js.map +1 -1
  398. package/out/templator/genCreateBlock.js +4 -7
  399. package/out/templator/genCreateBlock.js.map +1 -1
  400. package/out/templator/genCurdEditMultipleKeyBlock.d.ts +1 -7
  401. package/out/templator/genCurdEditMultipleKeyBlock.js +8 -122
  402. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  403. package/out/templator/genCurdMultipleKeyBlock.js +8 -6
  404. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  405. package/out/templator/genEditTableBlock.js +20 -48
  406. package/out/templator/genEditTableBlock.js.map +1 -1
  407. package/out/templator/genGridViewBlock.js +2 -2
  408. package/out/templator/genGridViewBlock.js.map +1 -1
  409. package/out/templator/genListViewBlock.js +1 -1
  410. package/out/templator/genListViewBlock.js.map +1 -1
  411. package/out/templator/genQueryComponent.js +9 -23
  412. package/out/templator/genQueryComponent.js.map +1 -1
  413. package/out/templator/genSelectBlock.d.ts +1 -12
  414. package/out/templator/genSelectBlock.js +2 -273
  415. package/out/templator/genSelectBlock.js.map +1 -1
  416. package/out/templator/genTableBlock.js +4 -4
  417. package/out/templator/genTableBlock.js.map +1 -1
  418. package/out/templator/genUpdateBlock.js +4 -9
  419. package/out/templator/genUpdateBlock.js.map +1 -1
  420. package/out/templator/utils.d.ts +33 -19
  421. package/out/templator/utils.js +8 -11
  422. package/out/templator/utils.js.map +1 -1
  423. package/out/translator/index.js +1 -4
  424. package/out/translator/index.js.map +1 -1
  425. package/out/utils/traverse.js +2 -8
  426. package/out/utils/traverse.js.map +1 -1
  427. package/package.json +1 -1
  428. package/sandbox/stdlib/nasl.oql.ts +16 -4
  429. package/src/common/BaseNode.ts +3 -1
  430. package/src/concepts/App__.ts +41 -1
  431. package/src/concepts/BatchAssignment__.ts +2 -2
  432. package/src/concepts/CallFunction__.ts +34 -20
  433. package/src/concepts/CallInterface__.ts +19 -1
  434. package/src/concepts/CallLogic__.ts +8 -3
  435. package/src/concepts/EnumItem__.ts +6 -6
  436. package/src/concepts/Enum__.ts +22 -19
  437. package/src/concepts/ForEachStatement__.ts +1 -1
  438. package/src/concepts/Logic__.ts +13 -10
  439. package/src/concepts/NewComposite__.ts +9 -7
  440. package/src/concepts/NewList__.ts +16 -0
  441. package/src/concepts/NewMap__.ts +17 -0
  442. package/src/concepts/StringInterpolation__.ts +6 -4
  443. package/src/concepts/TypeAnnotation__.ts +41 -3
  444. package/src/concepts/View__.ts +3 -2
  445. package/src/generator/genReleaseBody.ts +3 -1
  446. package/src/server/extendBaseNode.ts +4 -1
  447. package/src/server/formatTsUtils.ts +11 -8
  448. package/src/server/naslServer.ts +112 -2
  449. package/src/server/translator.ts +6 -6
  450. package/src/service/creator/add.configs.js +3 -0
  451. package/src/service/creator/errHandles.js +6 -0
  452. package/src/service/creator/index.js +3 -0
  453. package/src/service/storage/api.js +12 -0
  454. package/src/service/storage/init.ts +207 -29
  455. package/src/service/storage/service.ts +29 -1
  456. package/src/templator/genGetBlock.ts +1 -1
  457. package/src/templator/genListViewBlock.ts +6 -0
  458. package/ts-worker/lib/tsserver.js +6 -1
  459. package/ts-worker/package.json +1 -0
  460. package/ts-worker/webpack.config.js +11 -2
@@ -728,7 +728,7 @@ export class CallLogic extends LogicItem {
728
728
  return `${name}: {
729
729
  concept: 'Function',
730
730
  name: 'filter',
731
- returnExpression: this.$resolveRequestData(${argsStr}, event, current)
731
+ returnExpression: this.$resolveRequestData(${argsStr}, __eventArg, __currentArg)
732
732
  }`;
733
733
  } else {
734
734
  return `${name}: ${arg.expression.toJS(shiftState(state, code))}`;
@@ -747,7 +747,7 @@ export class CallLogic extends LogicItem {
747
747
  code += `{
748
748
  concept: 'Function',
749
749
  name: 'filter',
750
- returnExpression: this.$resolveRequestData(${argsStr}, event, current)
750
+ returnExpression: this.$resolveRequestData(${argsStr}, __eventArg, __currentArg)
751
751
  }`;
752
752
  code += `,\n`;
753
753
  logicArgs = [];
@@ -881,7 +881,12 @@ export class CallLogic extends LogicItem {
881
881
  };
882
882
  }
883
883
 
884
- const left = handleMember(root.left);
884
+ let left;
885
+ if (root.concept === 'UnaryExpression') {
886
+ left = handleMember(root.argument);
887
+ } else {
888
+ left = handleMember(root.left);
889
+ }
885
890
  const right = handleMember(root.right);
886
891
  return {
887
892
  concept: root.concept,
@@ -15,9 +15,9 @@ import Module from './Module__';
15
15
  import App from './App__';
16
16
 
17
17
  /**
18
- * 枚举项
18
+ * 枚举值
19
19
  */
20
- @concept('枚举项')
20
+ @concept('枚举值')
21
21
  export class EnumItem extends BaseNode {
22
22
  /**
23
23
  * 产品概念
@@ -26,13 +26,13 @@ export class EnumItem extends BaseNode {
26
26
  concept: 'EnumItem' = 'EnumItem';
27
27
 
28
28
  /**
29
- * 枚举项的值
29
+ * 枚举值的值
30
30
  */
31
31
  @property()
32
32
  value: string = undefined;
33
33
 
34
34
  /**
35
- * 枚举项标题
35
+ * 枚举值标题
36
36
  */
37
37
  @property()
38
38
  label: string = undefined;
@@ -81,7 +81,7 @@ export class EnumItem extends BaseNode {
81
81
  return params;
82
82
  }
83
83
  /**
84
- * 设置枚举项的值
84
+ * 设置枚举值的值
85
85
  */
86
86
  setValue(value: string) {
87
87
  const object = {
@@ -93,7 +93,7 @@ export class EnumItem extends BaseNode {
93
93
  }
94
94
 
95
95
  /**
96
- * 设置枚举项标题
96
+ * 设置枚举值标题
97
97
  */
98
98
  setLabel(label: string) {
99
99
  const object = {
@@ -46,7 +46,7 @@ export class Enum extends BaseNode {
46
46
  description: string = undefined;
47
47
 
48
48
  /**
49
- * 枚举项列表
49
+ * 枚举值列表
50
50
  */
51
51
  @property('EnumItem')
52
52
  enumItems: Array<EnumItem> = [];
@@ -130,16 +130,16 @@ export class Enum extends BaseNode {
130
130
 
131
131
 
132
132
  /**
133
- * 插入枚举项
133
+ * 插入枚举值
134
134
  * @internal
135
- * @param enumItemOptions 枚举项参数
135
+ * @param enumItemOptions 枚举值参数
136
136
  */
137
137
  _insertEnumItemAt(enumItemOptions: Partial<EnumItem>, index: number): EnumItem;
138
138
 
139
139
  /**
140
- * 插入枚举项
140
+ * 插入枚举值
141
141
  * @internal
142
- * @param enumItem 已有的枚举项实例
142
+ * @param enumItem 已有的枚举值实例
143
143
  */
144
144
  _insertEnumItemAt(enumItem: EnumItem, index: number): EnumItem;
145
145
 
@@ -164,14 +164,14 @@ export class Enum extends BaseNode {
164
164
 
165
165
 
166
166
  /**
167
- * 插入枚举项
168
- * @param enumItemOptions 枚举项参数
167
+ * 插入枚举值
168
+ * @param enumItemOptions 枚举值参数
169
169
  */
170
170
  insertEnumItemAt(enumItemOptions: Partial<EnumItem>, index: number): EnumItem;
171
171
 
172
172
  /**
173
- * 插入枚举项
174
- * @param enumItem 已有的枚举项实例
173
+ * 插入枚举值
174
+ * @param enumItem 已有的枚举值实例
175
175
  */
176
176
  insertEnumItemAt(enumItem: EnumItem, index: number): EnumItem;
177
177
 
@@ -188,16 +188,16 @@ export class Enum extends BaseNode {
188
188
 
189
189
 
190
190
  /**
191
- * 添加枚举项
191
+ * 添加枚举值
192
192
  * @internal
193
- * @param enumItemOptions 枚举项参数
193
+ * @param enumItemOptions 枚举值参数
194
194
  */
195
195
  _addEnumItem(enumItemOptions: Partial<EnumItem>): EnumItem;
196
196
 
197
197
  /**
198
- * 添加枚举项
198
+ * 添加枚举值
199
199
  * @internal
200
- * @param enumItem 已有的枚举项实例
200
+ * @param enumItem 已有的枚举值实例
201
201
  */
202
202
  _addEnumItem(enumItem: EnumItem): EnumItem;
203
203
 
@@ -209,14 +209,14 @@ export class Enum extends BaseNode {
209
209
 
210
210
 
211
211
  /**
212
- * 添加枚举项
213
- * @param enumItemOptions 枚举项参数
212
+ * 添加枚举值
213
+ * @param enumItemOptions 枚举值参数
214
214
  */
215
215
  addEnumItem(enumItemOptions: Partial<EnumItem>): EnumItem;
216
216
 
217
217
  /**
218
- * 添加枚举项
219
- * @param enumItem 已有的枚举项实例
218
+ * 添加枚举值
219
+ * @param enumItem 已有的枚举值实例
220
220
  */
221
221
  addEnumItem(enumItem: EnumItem): EnumItem;
222
222
 
@@ -235,8 +235,8 @@ export class Enum extends BaseNode {
235
235
 
236
236
 
237
237
  /**
238
- * 删除枚举项
239
- * @param enumItem 已有的枚举项实例
238
+ * 删除枚举值
239
+ * @param enumItem 已有的枚举值实例
240
240
  */
241
241
  removeEnumItem(enumItem: EnumItem): void;
242
242
 
@@ -290,6 +290,9 @@ export class Enum extends BaseNode {
290
290
  const excludedSet = new Set(excludedList);
291
291
  return (this.enumItems || []).filter((item) => !excludedSet.has(item)).map((item) => item.value);
292
292
  }
293
+ getEnumItemUniqueName(name = 'VALUE1') {
294
+ return utils.unique(name, this.getEnumItemExistingNames(), undefined, false);
295
+ }
293
296
 
294
297
  @withSourceMap()
295
298
  toEmbeddedTS(state?: TranslatorState): string {
@@ -531,7 +531,7 @@ export class ForEachStatement extends LogicItem {
531
531
  code += this.each ? this.each.toEmbeddedTS(shiftState(state, code, {
532
532
  tabSize: 0,
533
533
  })) : '__IDENTIFIER__';
534
- if (['NewList', 'NewMap'].includes(this.each.concept))
534
+ if (['NewList', 'NewMap'].includes(this.each?.concept))
535
535
  code += '\n';
536
536
  code += '.__slice(';
537
537
  code += this.start ? this.start.toEmbeddedTS(shiftState(state, code)) : '__IDENTIFIER__';
@@ -796,7 +796,7 @@ export class Logic extends BaseNode {
796
796
 
797
797
 
798
798
 
799
-
799
+
800
800
 
801
801
  /**
802
802
  * 插入逻辑项
@@ -830,7 +830,7 @@ export class Logic extends BaseNode {
830
830
  return logicItem;
831
831
  }
832
832
 
833
-
833
+
834
834
 
835
835
  /**
836
836
  * 插入逻辑项
@@ -854,7 +854,7 @@ export class Logic extends BaseNode {
854
854
  return node;
855
855
  }
856
856
 
857
-
857
+
858
858
 
859
859
  /**
860
860
  * 添加逻辑项
@@ -875,7 +875,7 @@ export class Logic extends BaseNode {
875
875
  return this._insertItemInBodyAt(options as any, index);
876
876
  }
877
877
 
878
-
878
+
879
879
 
880
880
  /**
881
881
  * 添加逻辑项
@@ -900,7 +900,7 @@ export class Logic extends BaseNode {
900
900
  return node;
901
901
  }
902
902
 
903
-
903
+
904
904
 
905
905
  /**
906
906
  * 插入逻辑项
@@ -934,7 +934,7 @@ export class Logic extends BaseNode {
934
934
  return logicItem;
935
935
  }
936
936
 
937
-
937
+
938
938
 
939
939
  /**
940
940
  * 插入逻辑项
@@ -958,7 +958,7 @@ export class Logic extends BaseNode {
958
958
  return node;
959
959
  }
960
960
 
961
-
961
+
962
962
 
963
963
  /**
964
964
  * 添加逻辑项
@@ -979,7 +979,7 @@ export class Logic extends BaseNode {
979
979
  return this._insertItemInPlaygroundAt(options as any, index);
980
980
  }
981
981
 
982
-
982
+
983
983
 
984
984
  /**
985
985
  * 添加逻辑项
@@ -1005,7 +1005,7 @@ export class Logic extends BaseNode {
1005
1005
  }
1006
1006
 
1007
1007
 
1008
-
1008
+
1009
1009
 
1010
1010
  /**
1011
1011
  * 删除事务
@@ -1268,7 +1268,7 @@ export class Logic extends BaseNode {
1268
1268
  return logicItem.delete();
1269
1269
  }
1270
1270
 
1271
-
1271
+
1272
1272
 
1273
1273
  /**
1274
1274
  * 删除逻辑项
@@ -1390,6 +1390,8 @@ export class Logic extends BaseNode {
1390
1390
  }
1391
1391
 
1392
1392
  toJSContent(code: string, state?: TranslatorState): string {
1393
+ // 兼容前端事件逻辑参数中的 current event,deleteBy updateBy 需要对 current、event 进行预处理
1394
+ code += `var __currentArg;var __eventArg;try {__currentArg = current;__eventArg = event;} catch(e) {}`;
1393
1395
  // params
1394
1396
  if (Array.isArray(this.params)) {
1395
1397
  this.params.forEach((param) => {
@@ -1778,6 +1780,7 @@ export class Logic extends BaseNode {
1778
1780
  }
1779
1781
 
1780
1782
  getRightCode(code: string, assignment: Assignment | BatchAssignment, rightNode: any): string {
1783
+ code = code.replaceAll('\n', ' ');
1781
1784
  if (assignment instanceof Assignment && !assignment.right)
1782
1785
  return code;
1783
1786
 
@@ -1014,7 +1014,7 @@ export class NewComposite extends LogicItem {
1014
1014
  this.app.emit('collect:start', {
1015
1015
  actionMsg: '匿名数据结构删除右侧变量',
1016
1016
  });
1017
- if (this.typeAnnotation.typeKind === 'anonymousStructure') {
1017
+ if (this.typeAnnotation?.typeKind === 'anonymousStructure') {
1018
1018
  oldLines.forEach(({ leftIndex }) => {
1019
1019
  const leftItem = this.typeAnnotation.properties[leftIndex[1]];
1020
1020
  leftItem.update({
@@ -1042,7 +1042,7 @@ export class NewComposite extends LogicItem {
1042
1042
  let oldLines: AssignmentLine[] = this.assignmentLines.filter(({ rightIndex }) => rightIndex[0] === splitIndex);
1043
1043
  // 右侧变量改变后,修改连线
1044
1044
  members.forEach((item, index) => {
1045
- if (keepMembers.has(item.completeName)) {
1045
+ if (keepMembers?.has(item.completeName)) {
1046
1046
  const lines = this.findlines(item, selectMember);
1047
1047
  lines.forEach((line) => {
1048
1048
  const newLine = Object.assign({}, line, { rightIndex: [line.rightIndex[0], index] });
@@ -1217,8 +1217,7 @@ export class NewComposite extends LogicItem {
1217
1217
  });
1218
1218
  // 方便ts报错检查
1219
1219
  code += 'function __newComposite() {\n';
1220
- code += `let __obj = nasl.util.New<${this.typeAnnotation.sortedTypeKey}>();`;
1221
- code += '\n';
1220
+ code += `let __obj = nasl.util.New<${this.typeAnnotation.sortedTypeKey}>();\n`;
1222
1221
  // 是否是左边的顶层连线
1223
1222
  const leftTopIndex = this.assignmentLines.findIndex(({ leftIndex }) => leftIndex[1] === undefined);
1224
1223
  if (leftTopIndex !== -1) {
@@ -1228,10 +1227,13 @@ export class NewComposite extends LogicItem {
1228
1227
  code += '\n';
1229
1228
  } else {
1230
1229
  // 左侧properties的identifier的类型标注
1231
- this.properties.forEach((item) => {
1232
- code += `const `;
1233
- code += `${item.toEmbeddedTS(shiftState(state, code, { inline: true }))} = __obj.${item.name};\n`;
1230
+ code += 'const { ';
1231
+ this.properties.forEach((item, index) => {
1232
+ code += item.toEmbeddedTS(shiftState(state, code, { inline: true }));
1233
+ if (index < this.properties.length - 1)
1234
+ code += ', ';
1234
1235
  });
1236
+ code += ' } = __obj;\n';
1235
1237
  this.assignmentLines.forEach(({ leftIndex, rightIndex }) => {
1236
1238
  const leftSecondIndex = leftIndex[1];
1237
1239
  const [rightFirst, rightSecond] = [rightIndex[0], rightIndex[1]];
@@ -326,6 +326,22 @@ export class NewList extends LogicItem {
326
326
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
327
327
  // 自动生成的代码已结束。下面可以手动编写。
328
328
  //================================================================================
329
+ toBrief(): string {
330
+ let code = '';
331
+ code += '[ ';
332
+ this.items.forEach((value, index) => {
333
+ if (index >= 10)
334
+ return;
335
+ if (index)
336
+ code += ',';
337
+ code += value.toBrief();
338
+ });
339
+ if (this.items.length > 10)
340
+ code += ', ...';
341
+ code += ' ]';
342
+ return code;
343
+ }
344
+
329
345
  toUI(state?: TranslatorState): string {
330
346
  let code = '';
331
347
  code += '[';
@@ -530,6 +530,23 @@ export class NewMap extends LogicItem {
530
530
  })
531
531
  }
532
532
 
533
+ toBrief(): string {
534
+ let code = '';
535
+ code += '[<br />';
536
+ this.keys.forEach((key, index) => {
537
+ if (index >= 10)
538
+ return;
539
+ const value = this.values[index];
540
+ code += '&nbsp;&nbsp;&nbsp;&nbsp;';
541
+ code += `${key ? key.toBrief() : 'null'} -> ${value ? value.toBrief() : 'null'}`;
542
+ code += '<br />';
543
+ });
544
+ if (this.keys.length > 10)
545
+ code += '&nbsp;&nbsp;&nbsp;&nbsp...<br />';
546
+ code += ']';
547
+ return code;
548
+ }
549
+
533
550
  toJS(state?: TranslatorState): string {
534
551
  let code = '';
535
552
  code += 'await (async () => {\n';
@@ -30,7 +30,7 @@ export class StringInterpolation extends LogicItem {
30
30
  @property('LogicItem')
31
31
  expressions: Array<LogicItem> = [];
32
32
 
33
-
33
+
34
34
 
35
35
  /**
36
36
  * @param source 需要合并的部分参数
@@ -45,7 +45,7 @@ export class StringInterpolation extends LogicItem {
45
45
  return super.from(source, parentNode, parentKey) as StringInterpolation;
46
46
  }
47
47
 
48
-
48
+
49
49
  /**
50
50
  * 设置插值表达式
51
51
  */
@@ -58,7 +58,7 @@ export class StringInterpolation extends LogicItem {
58
58
  });
59
59
  }
60
60
 
61
- getItemExistingNames(excludedList: Array<LogicItem> = []) {
61
+ getItemExistingNames(excludedList: Array<LogicItem> = []) {
62
62
  const excludedSet = new Set(excludedList);
63
63
  return ((this.expressions as LogicItem[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
64
64
  }
@@ -200,7 +200,7 @@ export class StringInterpolation extends LogicItem {
200
200
  }
201
201
 
202
202
 
203
-
203
+
204
204
 
205
205
  /**
206
206
  * 删除逻辑项
@@ -279,6 +279,8 @@ export class StringInterpolation extends LogicItem {
279
279
  }
280
280
 
281
281
  toJS(): string {
282
+ if (!this.expressions.length)
283
+ return `''`;
282
284
  return this.expressions.map((exp: any) => {
283
285
  const expTypeAnnotation = exp.typeAnnotation || exp.__TypeAnnotation;
284
286
  return `this.$utils['ToString'](${exp.toJS()}, '${expTypeAnnotation?.sortedTypeKey}')`;
@@ -121,6 +121,8 @@ export class TypeAnnotation extends BaseNode {
121
121
  @property()
122
122
  ruleMap: Object = undefined;
123
123
 
124
+
125
+
124
126
  /**
125
127
  * @param source 需要合并的部分参数
126
128
  */
@@ -157,6 +159,10 @@ export class TypeAnnotation extends BaseNode {
157
159
  });
158
160
  }
159
161
 
162
+
163
+
164
+
165
+
160
166
  /**
161
167
  * 插入类型标注
162
168
  * @internal
@@ -189,6 +195,8 @@ export class TypeAnnotation extends BaseNode {
189
195
  return typeAnnotation;
190
196
  }
191
197
 
198
+
199
+
192
200
  /**
193
201
  * 插入类型标注
194
202
  * @param typeAnnotationOptions 类型标注参数
@@ -211,6 +219,8 @@ export class TypeAnnotation extends BaseNode {
211
219
  return node;
212
220
  }
213
221
 
222
+
223
+
214
224
  /**
215
225
  * 添加类型标注
216
226
  * @internal
@@ -230,6 +240,8 @@ export class TypeAnnotation extends BaseNode {
230
240
  return this._insertTypeAnnotationInTypeArgumentsAt(options as any, index);
231
241
  }
232
242
 
243
+
244
+
233
245
  /**
234
246
  * 添加类型标注
235
247
  * @param typeAnnotationOptions 类型标注参数
@@ -253,6 +265,8 @@ export class TypeAnnotation extends BaseNode {
253
265
  return node;
254
266
  }
255
267
 
268
+
269
+
256
270
  /**
257
271
  * 插入类型标注
258
272
  * @internal
@@ -285,6 +299,8 @@ export class TypeAnnotation extends BaseNode {
285
299
  return typeAnnotation;
286
300
  }
287
301
 
302
+
303
+
288
304
  /**
289
305
  * 插入类型标注
290
306
  * @param typeAnnotationOptions 类型标注参数
@@ -307,6 +323,8 @@ export class TypeAnnotation extends BaseNode {
307
323
  return node;
308
324
  }
309
325
 
326
+
327
+
310
328
  /**
311
329
  * 添加类型标注
312
330
  * @internal
@@ -326,6 +344,8 @@ export class TypeAnnotation extends BaseNode {
326
344
  return this._insertTypeAnnotationInReturnTypeAt(options as any, index);
327
345
  }
328
346
 
347
+
348
+
329
349
  /**
330
350
  * 添加类型标注
331
351
  * @param typeAnnotationOptions 类型标注参数
@@ -349,6 +369,11 @@ export class TypeAnnotation extends BaseNode {
349
369
  return node;
350
370
  }
351
371
 
372
+
373
+
374
+
375
+
376
+
352
377
  /**
353
378
  * 插入数据结构属性
354
379
  * @internal
@@ -381,6 +406,8 @@ export class TypeAnnotation extends BaseNode {
381
406
  return structureProperty;
382
407
  }
383
408
 
409
+
410
+
384
411
  /**
385
412
  * 插入数据结构属性
386
413
  * @param structurePropertyOptions 数据结构属性参数
@@ -403,6 +430,8 @@ export class TypeAnnotation extends BaseNode {
403
430
  return node;
404
431
  }
405
432
 
433
+
434
+
406
435
  /**
407
436
  * 添加数据结构属性
408
437
  * @internal
@@ -422,6 +451,8 @@ export class TypeAnnotation extends BaseNode {
422
451
  return this._insertStructurePropertyAt(options as any, index);
423
452
  }
424
453
 
454
+
455
+
425
456
  /**
426
457
  * 添加数据结构属性
427
458
  * @param structurePropertyOptions 数据结构属性参数
@@ -445,6 +476,9 @@ export class TypeAnnotation extends BaseNode {
445
476
  return node;
446
477
  }
447
478
 
479
+
480
+
481
+
448
482
  /**
449
483
  * 删除类型标注
450
484
  * @param typeAnnotation 已有的类型标注实例
@@ -452,10 +486,12 @@ export class TypeAnnotation extends BaseNode {
452
486
  removeTypeAnnotationInTypeArguments(typeAnnotation: TypeAnnotation): void;
453
487
 
454
488
  removeTypeAnnotationInTypeArguments(options: TypeAnnotation) {
455
- const typeAnnotation: TypeAnnotation = options;
489
+ let typeAnnotation: TypeAnnotation = options;
456
490
  return typeAnnotation.delete();
457
491
  }
458
492
 
493
+
494
+
459
495
  /**
460
496
  * 删除类型标注
461
497
  * @param typeAnnotation 已有的类型标注实例
@@ -463,7 +499,7 @@ export class TypeAnnotation extends BaseNode {
463
499
  removeTypeAnnotationInReturnType(typeAnnotation: TypeAnnotation): void;
464
500
 
465
501
  removeTypeAnnotationInReturnType(options: TypeAnnotation) {
466
- const typeAnnotation: TypeAnnotation = options;
502
+ let typeAnnotation: TypeAnnotation = options;
467
503
  return typeAnnotation.delete();
468
504
  }
469
505
 
@@ -490,6 +526,8 @@ export class TypeAnnotation extends BaseNode {
490
526
  return params;
491
527
  }
492
528
 
529
+
530
+
493
531
  /**
494
532
  * 删除数据结构属性
495
533
  * @param structureProperty 已有的数据结构属性实例
@@ -497,7 +535,7 @@ export class TypeAnnotation extends BaseNode {
497
535
  removeStructureProperty(structureProperty: StructureProperty): void;
498
536
 
499
537
  removeStructureProperty(options: StructureProperty) {
500
- const structureProperty: StructureProperty = options;
538
+ let structureProperty: StructureProperty = options;
501
539
  return structureProperty.delete();
502
540
  }
503
541
 
@@ -259,7 +259,7 @@ export class View extends BaseNode {
259
259
  });
260
260
  }
261
261
 
262
-
262
+
263
263
 
264
264
  /**
265
265
  * 插入页面元素
@@ -1095,7 +1095,7 @@ export class View extends BaseNode {
1095
1095
  }
1096
1096
 
1097
1097
 
1098
-
1098
+
1099
1099
 
1100
1100
  /**
1101
1101
  * 删除页面元素
@@ -2101,6 +2101,7 @@ export class View extends BaseNode {
2101
2101
  }
2102
2102
 
2103
2103
  getRightCode(code: string, assignment: Assignment | BatchAssignment, rightNode: any): string {
2104
+ code = code.replaceAll('\n', ' ');
2104
2105
  const logic = assignment.logic;
2105
2106
  const logicRtn = logic?.returns[0];
2106
2107
  // 调用接口,参数替换成 null
@@ -1,4 +1,4 @@
1
- import { App, Assignment, BatchAssignment, CallFunction, CallInterface, CallLogic, ForEachStatement, IfStatement, Logic, LogicItem, Match, MatchCase, MemberExpression, Role, SwitchCase, SwitchStatement, View, ViewElement, WhileStatement, StringInterpolation } from '../concepts';
1
+ import { App, Assignment, BatchAssignment, CallFunction, CallInterface, CallLogic, ForEachStatement, IfStatement, Logic, LogicItem, Match, MatchCase, MemberExpression, Role, SwitchCase, SwitchStatement, View, ViewElement, WhileStatement, StringInterpolation, ExternalDestination } from '../concepts';
2
2
  import { genBundleFiles } from './genBundleFiles';
3
3
  import { genPermissionData } from './permission';
4
4
 
@@ -265,6 +265,8 @@ function getAuthApiPathList(app: App) {
265
265
  logicItems = [state.object, state.property];
266
266
  } else if (state instanceof StringInterpolation) {
267
267
  logicItems = [...state.expressions];
268
+ } else if (state instanceof ExternalDestination) {
269
+ logicItems = [state.anchor, state.link];
268
270
  }
269
271
 
270
272
  return logicItems.filter((item) => !!item);
@@ -87,7 +87,10 @@ BaseNode.prototype.changeName = async function changeName(newValue: string, upda
87
87
  */
88
88
  const res = naslServer._renamePrepare(this, refsList, newValue);
89
89
  if (res.length <= 1) {
90
- (this as SetNameNode).setName(newValue);
90
+ if (this.concept === 'enumItem') {
91
+ (this as any).setValue(newValue);
92
+ } else
93
+ (this as SetNameNode).setName(newValue);
91
94
  } else {
92
95
  const callback = (value: boolean) => {
93
96
  if (value) {
@@ -45,16 +45,19 @@ export function type2TypeAnnotation(oldType: Array<any> | {}): TypeAnnotation {
45
45
  let typeAnnotation: TypeAnnotation;
46
46
  try {
47
47
  const { typeName, typeNamespace, typeArguments, typeKind, properties } = type as any;
48
- if (typeKind === 'anonymousStructure' && Array.isArray(properties) && properties.length) {
48
+ if (typeKind === 'anonymousStructure') {
49
49
  // 自定义类型
50
50
  const newProperties: StructureProperty[] = [];
51
- properties.forEach((item) => {
52
- if (!item?.name?.startsWith('__')) {
53
- const itemType = type2TypeAnnotation(item.typeInfo);
54
- const structureProperty = StructureProperty.from({ name: item.name, typeAnnotation: itemType }, typeAnnotation, 'properties');
55
- newProperties.push(structureProperty);
56
- }
57
- });
51
+ if (Array.isArray(properties) && properties.length) {
52
+ properties.forEach((item) => {
53
+ if (!item?.name?.startsWith('__')) {
54
+ // 如果没有获取到类型,就默认塞一个string
55
+ const itemType = type2TypeAnnotation(item.typeInfo) || TypeAnnotation.createPrimitive('String');
56
+ const structureProperty = StructureProperty.from({ name: item.name, typeAnnotation: itemType }, typeAnnotation, 'properties');
57
+ newProperties.push(structureProperty);
58
+ }
59
+ });
60
+ }
58
61
  typeAnnotation = TypeAnnotation.createTypeAnonymousStructure(newProperties);
59
62
  } else if (!typeName || typeName === 'Promise' || typeName === 'nasl' || typeName === '___IDENTIFIER__') {
60
63
  return null;