@lcap/nasl 1.0.0-alpha.2 → 1.0.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 (391) hide show
  1. package/README.md +3 -3
  2. package/docs/assets/search.js +1 -1
  3. package/docs/classes/Entity.html +2832 -204
  4. package/docs/classes/View.html +4567 -365
  5. package/out/common/BaseNode.js +23 -16
  6. package/out/common/BaseNode.js.map +1 -1
  7. package/out/concepts/App__.d.ts +22 -0
  8. package/out/concepts/App__.js +77 -15
  9. package/out/concepts/App__.js.map +1 -1
  10. package/out/concepts/Argument__.d.ts +2 -1
  11. package/out/concepts/Argument__.js +2 -2
  12. package/out/concepts/Argument__.js.map +1 -1
  13. package/out/concepts/Assignment__.d.ts +2 -1
  14. package/out/concepts/Assignment__.js +3 -8
  15. package/out/concepts/Assignment__.js.map +1 -1
  16. package/out/concepts/Attribute__.js.map +1 -1
  17. package/out/concepts/BinaryExpression__.d.ts +2 -1
  18. package/out/concepts/BinaryExpression__.js +5 -5
  19. package/out/concepts/BinaryExpression__.js.map +1 -1
  20. package/out/concepts/BindAttribute__.d.ts +2 -1
  21. package/out/concepts/BindAttribute__.js +9 -4
  22. package/out/concepts/BindAttribute__.js.map +1 -1
  23. package/out/concepts/BindDirective__.d.ts +2 -1
  24. package/out/concepts/BindDirective__.js +2 -2
  25. package/out/concepts/BindDirective__.js.map +1 -1
  26. package/out/concepts/BindEvent__.d.ts +2 -1
  27. package/out/concepts/BindEvent__.js +4 -3
  28. package/out/concepts/BindEvent__.js.map +1 -1
  29. package/out/concepts/BooleanLiteral__.d.ts +2 -1
  30. package/out/concepts/BooleanLiteral__.js +1 -1
  31. package/out/concepts/BooleanLiteral__.js.map +1 -1
  32. package/out/concepts/CallFunction__.d.ts +57 -1
  33. package/out/concepts/CallFunction__.js +119 -11
  34. package/out/concepts/CallFunction__.js.map +1 -1
  35. package/out/concepts/CallInterface__.d.ts +2 -1
  36. package/out/concepts/CallInterface__.js +2 -2
  37. package/out/concepts/CallInterface__.js.map +1 -1
  38. package/out/concepts/CallLogic__.d.ts +57 -1
  39. package/out/concepts/CallLogic__.js +117 -10
  40. package/out/concepts/CallLogic__.js.map +1 -1
  41. package/out/concepts/CallQueryComponent__.js +1 -1
  42. package/out/concepts/CallQueryComponent__.js.map +1 -1
  43. package/out/concepts/Comment__.js.map +1 -1
  44. package/out/concepts/CompletionProperty__.js.map +1 -1
  45. package/out/concepts/ConfigGroup__.d.ts +120 -0
  46. package/out/concepts/ConfigGroup__.js +214 -0
  47. package/out/concepts/ConfigGroup__.js.map +1 -0
  48. package/out/concepts/ConfigPropertyValue__.d.ts +43 -0
  49. package/out/concepts/ConfigPropertyValue__.js +103 -0
  50. package/out/concepts/ConfigPropertyValue__.js.map +1 -0
  51. package/out/concepts/ConfigProperty__.d.ts +128 -0
  52. package/out/concepts/ConfigProperty__.js +236 -0
  53. package/out/concepts/ConfigProperty__.js.map +1 -0
  54. package/out/concepts/Configuration__.d.ts +120 -0
  55. package/out/concepts/Configuration__.js +210 -0
  56. package/out/concepts/Configuration__.js.map +1 -0
  57. package/out/concepts/Constant__.d.ts +2 -1
  58. package/out/concepts/Constant__.js +1 -1
  59. package/out/concepts/Constant__.js.map +1 -1
  60. package/out/concepts/DataElement__.js.map +1 -1
  61. package/out/concepts/Destination__.d.ts +2 -1
  62. package/out/concepts/Destination__.js +4 -3
  63. package/out/concepts/Destination__.js.map +1 -1
  64. package/out/concepts/End__.js.map +1 -1
  65. package/out/concepts/EntityIndex__.d.ts +8 -0
  66. package/out/concepts/EntityIndex__.js +18 -0
  67. package/out/concepts/EntityIndex__.js.map +1 -1
  68. package/out/concepts/EntityProperty__.d.ts +5 -5
  69. package/out/concepts/EntityProperty__.js +10 -9
  70. package/out/concepts/EntityProperty__.js.map +1 -1
  71. package/out/concepts/Entity__.d.ts +30 -26
  72. package/out/concepts/Entity__.js +44 -36
  73. package/out/concepts/Entity__.js.map +1 -1
  74. package/out/concepts/EnumItem__.js.map +1 -1
  75. package/out/concepts/Enum__.d.ts +8 -8
  76. package/out/concepts/Enum__.js +10 -4
  77. package/out/concepts/Enum__.js.map +1 -1
  78. package/out/concepts/Event__.js +1 -1
  79. package/out/concepts/Event__.js.map +1 -1
  80. package/out/concepts/ForEachStatement__.d.ts +35 -33
  81. package/out/concepts/ForEachStatement__.js +103 -36
  82. package/out/concepts/ForEachStatement__.js.map +1 -1
  83. package/out/concepts/Function__.js +1 -1
  84. package/out/concepts/Function__.js.map +1 -1
  85. package/out/concepts/Identifier__.d.ts +2 -1
  86. package/out/concepts/Identifier__.js +15 -1
  87. package/out/concepts/Identifier__.js.map +1 -1
  88. package/out/concepts/IfStatement__.js.map +1 -1
  89. package/out/concepts/InterfaceParam__.js +1 -1
  90. package/out/concepts/InterfaceParam__.js.map +1 -1
  91. package/out/concepts/Interface__.d.ts +5 -1
  92. package/out/concepts/Interface__.js +19 -5
  93. package/out/concepts/Interface__.js.map +1 -1
  94. package/out/concepts/JSBlock__.js.map +1 -1
  95. package/out/concepts/LogicItem__.d.ts +2 -1
  96. package/out/concepts/LogicItem__.js +2 -2
  97. package/out/concepts/LogicItem__.js.map +1 -1
  98. package/out/concepts/Logic__.js +9 -7
  99. package/out/concepts/Logic__.js.map +1 -1
  100. package/out/concepts/MemberExpression__.d.ts +2 -5
  101. package/out/concepts/MemberExpression__.js +12 -18
  102. package/out/concepts/MemberExpression__.js.map +1 -1
  103. package/out/concepts/Module__.d.ts +121 -126
  104. package/out/concepts/Module__.js +10 -17
  105. package/out/concepts/Module__.js.map +1 -1
  106. package/out/concepts/Namespace__.js +12 -12
  107. package/out/concepts/Namespace__.js.map +1 -1
  108. package/out/concepts/NullLiteral__.d.ts +2 -1
  109. package/out/concepts/NullLiteral__.js +1 -1
  110. package/out/concepts/NullLiteral__.js.map +1 -1
  111. package/out/concepts/NumericLiteral__.d.ts +2 -1
  112. package/out/concepts/NumericLiteral__.js +1 -1
  113. package/out/concepts/NumericLiteral__.js.map +1 -1
  114. package/out/concepts/Param__.d.ts +1 -1
  115. package/out/concepts/Param__.js +2 -2
  116. package/out/concepts/Param__.js.map +1 -1
  117. package/out/concepts/Point__.js.map +1 -1
  118. package/out/concepts/ProcessComponent__.js +2 -2
  119. package/out/concepts/ProcessComponent__.js.map +1 -1
  120. package/out/concepts/ProcessElement__.d.ts +82 -81
  121. package/out/concepts/ProcessElement__.js +19 -6
  122. package/out/concepts/ProcessElement__.js.map +1 -1
  123. package/out/concepts/ProcessOutcome__.js.map +1 -1
  124. package/out/concepts/Process__.d.ts +1 -0
  125. package/out/concepts/Process__.js +10 -4
  126. package/out/concepts/Process__.js.map +1 -1
  127. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  128. package/out/concepts/QueryFieldExpression__.js +1 -1
  129. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  130. package/out/concepts/QueryFromExpression__.js.map +1 -1
  131. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  132. package/out/concepts/QueryJoinExpression__.js +1 -1
  133. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  134. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  135. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  136. package/out/concepts/QuerySelectExpression__.js +1 -1
  137. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  138. package/out/concepts/Rect__.js.map +1 -1
  139. package/out/concepts/Return__.d.ts +1 -1
  140. package/out/concepts/Return__.js +2 -2
  141. package/out/concepts/Return__.js.map +1 -1
  142. package/out/concepts/Role__.d.ts +5 -0
  143. package/out/concepts/Role__.js +19 -2
  144. package/out/concepts/Role__.js.map +1 -1
  145. package/out/concepts/Slot__.js.map +1 -1
  146. package/out/concepts/SqlQueryComponent__.d.ts +2 -0
  147. package/out/concepts/SqlQueryComponent__.js +16 -0
  148. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  149. package/out/concepts/Start__.js.map +1 -1
  150. package/out/concepts/StringLiteral__.d.ts +2 -1
  151. package/out/concepts/StringLiteral__.js +1 -1
  152. package/out/concepts/StringLiteral__.js.map +1 -1
  153. package/out/concepts/StructureProperty__.d.ts +1 -1
  154. package/out/concepts/StructureProperty__.js +1 -1
  155. package/out/concepts/StructureProperty__.js.map +1 -1
  156. package/out/concepts/Structure__.d.ts +1 -1
  157. package/out/concepts/Structure__.js +4 -4
  158. package/out/concepts/Structure__.js.map +1 -1
  159. package/out/concepts/SwitchCase__.js.map +1 -1
  160. package/out/concepts/SwitchStatement__.js.map +1 -1
  161. package/out/concepts/Theme__.js.map +1 -1
  162. package/out/concepts/Transactional__.js.map +1 -1
  163. package/out/concepts/TypeAnnotation__.js +3 -0
  164. package/out/concepts/TypeAnnotation__.js.map +1 -1
  165. package/out/concepts/TypeParam__.js.map +1 -1
  166. package/out/concepts/UnaryExpression__.d.ts +2 -1
  167. package/out/concepts/UnaryExpression__.js +3 -3
  168. package/out/concepts/UnaryExpression__.js.map +1 -1
  169. package/out/concepts/Unparsed__.d.ts +2 -1
  170. package/out/concepts/Unparsed__.js +1 -1
  171. package/out/concepts/Unparsed__.js.map +1 -1
  172. package/out/concepts/UseComponent__.js.map +1 -1
  173. package/out/concepts/ValidationRule__.d.ts +2 -1
  174. package/out/concepts/ValidationRule__.js +2 -2
  175. package/out/concepts/ValidationRule__.js.map +1 -1
  176. package/out/concepts/Variable__.d.ts +6 -5
  177. package/out/concepts/Variable__.js +3 -3
  178. package/out/concepts/Variable__.js.map +1 -1
  179. package/out/concepts/ViewComponent__.js +5 -5
  180. package/out/concepts/ViewComponent__.js.map +1 -1
  181. package/out/concepts/ViewElement__.d.ts +5 -4
  182. package/out/concepts/ViewElement__.js +109 -65
  183. package/out/concepts/ViewElement__.js.map +1 -1
  184. package/out/concepts/View__.d.ts +97 -90
  185. package/out/concepts/View__.js +153 -118
  186. package/out/concepts/View__.js.map +1 -1
  187. package/out/concepts/WhileStatement__.js.map +1 -1
  188. package/out/concepts/basics/stdlib/index.js +2 -2
  189. package/out/concepts/basics/stdlib/index.js.map +1 -1
  190. package/out/concepts/basics/stdlib/nasl.ui.js +3 -137
  191. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  192. package/out/concepts/basics/stdlib/nasl.util.js +21 -5
  193. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  194. package/out/concepts/basics/stdlib/nasl.validation.d.ts +3 -0
  195. package/out/concepts/basics/stdlib/nasl.validation.js +527 -0
  196. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -0
  197. package/out/concepts/index__.d.ts +4 -0
  198. package/out/concepts/index__.js +4 -0
  199. package/out/concepts/index__.js.map +1 -1
  200. package/out/data/Module.d.ts +34 -0
  201. package/out/data/Module.js +53 -0
  202. package/out/data/Module.js.map +1 -0
  203. package/out/generator/compileComponent.d.ts +1 -1
  204. package/out/generator/genBundleFiles.d.ts +0 -1
  205. package/out/generator/genBundleFiles.js +1 -1
  206. package/out/generator/genBundleFiles.js.map +1 -1
  207. package/out/generator/genMetaData.d.ts +35 -0
  208. package/out/generator/genMetaData.js +78 -0
  209. package/out/generator/genMetaData.js.map +1 -0
  210. package/out/generator/index.d.ts +1 -0
  211. package/out/generator/index.js +1 -0
  212. package/out/generator/index.js.map +1 -1
  213. package/out/index.d.ts +2 -2
  214. package/out/index.js +3 -1
  215. package/out/index.js.map +1 -1
  216. package/out/server/createUiTs.d.ts +7 -0
  217. package/out/server/createUiTs.js +157 -0
  218. package/out/server/createUiTs.js.map +1 -0
  219. package/out/server/entity2LogicNamespace.d.ts +9 -1
  220. package/out/server/entity2LogicNamespace.js +11 -1
  221. package/out/server/entity2LogicNamespace.js.map +1 -1
  222. package/out/server/getExtensionModules.d.ts +3 -0
  223. package/out/server/getExtensionModules.js +18 -0
  224. package/out/server/getExtensionModules.js.map +1 -0
  225. package/out/server/getLogics.js +18 -15
  226. package/out/server/getLogics.js.map +1 -1
  227. package/out/server/getMemberIdentifier.d.ts +3 -2
  228. package/out/server/getMemberIdentifier.js +47 -15
  229. package/out/server/getMemberIdentifier.js.map +1 -1
  230. package/out/server/getProcesses.d.ts +4 -1
  231. package/out/server/getProcesses.js +16 -7
  232. package/out/server/getProcesses.js.map +1 -1
  233. package/out/server/getValidates.js +1 -1
  234. package/out/server/getValidates.js.map +1 -1
  235. package/out/server/index.js +1 -0
  236. package/out/server/index.js.map +1 -1
  237. package/out/server/naslServer.d.ts +23 -5
  238. package/out/server/naslServer.js +199 -25
  239. package/out/server/naslServer.js.map +1 -1
  240. package/out/server/process2LogicNamespace.d.ts +15 -1
  241. package/out/server/process2LogicNamespace.js +30 -3
  242. package/out/server/process2LogicNamespace.js.map +1 -1
  243. package/out/server/translator.js +28 -0
  244. package/out/server/translator.js.map +1 -1
  245. package/out/service/storage/init.d.ts +5 -0
  246. package/out/service/storage/init.js +60 -52
  247. package/out/service/storage/init.js.map +1 -1
  248. package/out/templator/genCallComponentLogic.js +2 -2
  249. package/out/templator/genCallComponentLogic.js.map +1 -1
  250. package/out/templator/genCreateBlock.js +6 -8
  251. package/out/templator/genCreateBlock.js.map +1 -1
  252. package/out/templator/genCurdEditMultipleKeyBlock.js +3 -3
  253. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  254. package/out/templator/genCurdMultipleKeyBlock.js +4 -4
  255. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  256. package/out/templator/genEditTableBlock.js +3 -3
  257. package/out/templator/genEditTableBlock.js.map +1 -1
  258. package/out/templator/genGetBlock.js +1 -1
  259. package/out/templator/genGetBlock.js.map +1 -1
  260. package/out/templator/genListViewBlock.js +2 -2
  261. package/out/templator/genListViewBlock.js.map +1 -1
  262. package/out/templator/genSelectBlock.js +1 -1
  263. package/out/templator/genSelectBlock.js.map +1 -1
  264. package/out/templator/genUpdateBlock.js +8 -12
  265. package/out/templator/genUpdateBlock.js.map +1 -1
  266. package/out/templator/utils.d.ts +20 -20
  267. package/out/templator/utils.js +22 -22
  268. package/out/templator/utils.js.map +1 -1
  269. package/package.json +2 -1
  270. package/src/automate/engine/index.js +37 -3
  271. package/src/automate/engine/utils.js +68 -64
  272. package/src/common/BaseNode.ts +24 -17
  273. package/src/concepts/App__.ts +93 -17
  274. package/src/concepts/Argument__.ts +4 -2
  275. package/src/concepts/Assignment__.ts +5 -7
  276. package/src/concepts/Attribute__.ts +1 -0
  277. package/src/concepts/BinaryExpression__.ts +7 -5
  278. package/src/concepts/BindAttribute__.ts +9 -4
  279. package/src/concepts/BindDirective__.ts +4 -2
  280. package/src/concepts/BindEvent__.ts +6 -4
  281. package/src/concepts/BooleanLiteral__.ts +3 -1
  282. package/src/concepts/CallFunction__.ts +195 -11
  283. package/src/concepts/CallInterface__.ts +4 -2
  284. package/src/concepts/CallLogic__.ts +211 -12
  285. package/src/concepts/CallQueryComponent__.ts +2 -1
  286. package/src/concepts/Comment__.ts +1 -0
  287. package/src/concepts/CompletionProperty__.ts +1 -0
  288. package/src/concepts/ConfigGroup__.ts +290 -0
  289. package/src/concepts/ConfigPropertyValue__.ts +112 -0
  290. package/src/concepts/ConfigProperty__.ts +306 -0
  291. package/src/concepts/Configuration__.ts +286 -0
  292. package/src/concepts/Constant__.ts +3 -1
  293. package/src/concepts/DataElement__.ts +1 -0
  294. package/src/concepts/Destination__.ts +7 -5
  295. package/src/concepts/End__.ts +1 -0
  296. package/src/concepts/EntityIndex__.ts +19 -0
  297. package/src/concepts/EntityProperty__.ts +9 -8
  298. package/src/concepts/Entity__.ts +66 -59
  299. package/src/concepts/EnumItem__.ts +1 -0
  300. package/src/concepts/Enum__.ts +32 -12
  301. package/src/concepts/Event__.ts +2 -1
  302. package/src/concepts/ForEachStatement__.ts +115 -69
  303. package/src/concepts/Function__.ts +2 -1
  304. package/src/concepts/Identifier__.ts +18 -1
  305. package/src/concepts/IfStatement__.ts +1 -0
  306. package/src/concepts/InterfaceParam__.ts +2 -1
  307. package/src/concepts/Interface__.ts +21 -5
  308. package/src/concepts/JSBlock__.ts +1 -0
  309. package/src/concepts/LogicItem__.ts +9 -40
  310. package/src/concepts/Logic__.ts +48 -9
  311. package/src/concepts/MemberExpression__.ts +14 -17
  312. package/src/concepts/Module__.ts +158 -139
  313. package/src/concepts/Namespace__.ts +13 -12
  314. package/src/concepts/NullLiteral__.ts +3 -1
  315. package/src/concepts/NumericLiteral__.ts +3 -1
  316. package/src/concepts/Param__.ts +3 -2
  317. package/src/concepts/Point__.ts +1 -0
  318. package/src/concepts/ProcessComponent__.ts +3 -2
  319. package/src/concepts/ProcessElement__.ts +102 -107
  320. package/src/concepts/ProcessOutcome__.ts +1 -0
  321. package/src/concepts/Process__.ts +12 -4
  322. package/src/concepts/QueryAggregateExpression__.ts +1 -0
  323. package/src/concepts/QueryFieldExpression__.ts +2 -1
  324. package/src/concepts/QueryFromExpression__.ts +1 -0
  325. package/src/concepts/QueryGroupByExpression__.ts +1 -0
  326. package/src/concepts/QueryJoinExpression__.ts +2 -1
  327. package/src/concepts/QueryLimitExpression__.ts +1 -0
  328. package/src/concepts/QueryOrderByExpression__.ts +1 -0
  329. package/src/concepts/QuerySelectExpression__.ts +2 -1
  330. package/src/concepts/Rect__.ts +1 -0
  331. package/src/concepts/Return__.ts +3 -2
  332. package/src/concepts/Role__.ts +19 -2
  333. package/src/concepts/Slot__.ts +1 -0
  334. package/src/concepts/SqlQueryComponent__.ts +11 -1
  335. package/src/concepts/Start__.ts +1 -0
  336. package/src/concepts/StringLiteral__.ts +3 -1
  337. package/src/concepts/StructureProperty__.ts +2 -1
  338. package/src/concepts/Structure__.ts +5 -4
  339. package/src/concepts/SwitchCase__.ts +1 -0
  340. package/src/concepts/SwitchStatement__.ts +1 -0
  341. package/src/concepts/Theme__.ts +1 -0
  342. package/src/concepts/Transactional__.ts +1 -0
  343. package/src/concepts/TypeAnnotation__.ts +4 -0
  344. package/src/concepts/TypeParam__.ts +1 -0
  345. package/src/concepts/UnaryExpression__.ts +6 -3
  346. package/src/concepts/Unparsed__.ts +3 -1
  347. package/src/concepts/UseComponent__.ts +1 -0
  348. package/src/concepts/ValidationRule__.ts +5 -2
  349. package/src/concepts/Variable__.ts +12 -6
  350. package/src/concepts/ViewComponent__.ts +6 -5
  351. package/src/concepts/ViewElement__.ts +109 -80
  352. package/src/concepts/View__.ts +245 -206
  353. package/src/concepts/WhileStatement__.ts +1 -0
  354. package/src/concepts/basics/stdlib/index.ts +2 -2
  355. package/src/concepts/basics/stdlib/nasl.ui.ts +3 -137
  356. package/src/concepts/basics/stdlib/nasl.util.ts +21 -5
  357. package/src/concepts/basics/stdlib/{nasl.validate.ts → nasl.validation.ts} +28 -28
  358. package/src/concepts/index__.ts +4 -0
  359. package/src/generator/compileComponent.ts +1 -1
  360. package/src/generator/genBundleFiles.ts +1 -2
  361. package/src/generator/genMetaData.ts +111 -0
  362. package/src/generator/index.ts +1 -0
  363. package/src/index.ts +2 -2
  364. package/src/server/createUiTs.ts +153 -0
  365. package/src/server/entity2LogicNamespace.ts +17 -1
  366. package/src/server/getExtensionModules.ts +13 -0
  367. package/src/server/getLogics.ts +19 -18
  368. package/src/server/getMemberIdentifier.ts +60 -19
  369. package/src/server/getProcesses.ts +15 -8
  370. package/src/server/getValidates.ts +1 -1
  371. package/src/server/index.ts +2 -1
  372. package/src/server/naslServer.ts +204 -24
  373. package/src/server/process2LogicNamespace.ts +44 -3
  374. package/src/server/translator.ts +121 -97
  375. package/src/service/config/api.js +32 -0
  376. package/src/service/config/index.js +6 -0
  377. package/src/service/creator/index.js +2 -2
  378. package/src/service/logic/checktypeSocket.js +49 -0
  379. package/src/service/modules/api.js +20 -0
  380. package/src/service/modules/index.js +6 -0
  381. package/src/service/storage/init.ts +62 -54
  382. package/src/templator/genCallComponentLogic.ts +2 -2
  383. package/src/templator/genCreateBlock.ts +19 -25
  384. package/src/templator/genCurdEditMultipleKeyBlock.ts +3 -3
  385. package/src/templator/genCurdMultipleKeyBlock.ts +4 -4
  386. package/src/templator/genEditTableBlock.ts +3 -3
  387. package/src/templator/genGetBlock.ts +1 -1
  388. package/src/templator/genListViewBlock.ts +2 -2
  389. package/src/templator/genSelectBlock.ts +1 -1
  390. package/src/templator/genUpdateBlock.ts +19 -25
  391. package/src/templator/utils.ts +25 -153
@@ -1,4 +1,5 @@
1
1
  import { TranslatorState, shiftState, withSourceMap } from '../translator';
2
+ import { ElementToVueOptions } from './ViewElement__';
2
3
  //================================================================================
3
4
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
4
5
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -7,6 +8,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
7
8
  import { concept, excludedInJSON, property } from '../decorators';
8
9
 
9
10
  import * as utils from '../utils';
11
+ import { v4 as uuidv4 } from 'uuid';
10
12
  import BaseNode from '../common/BaseNode';
11
13
  import classMap from '../common/classMap';
12
14
  import LogicItem from './LogicItem__';
@@ -140,10 +142,10 @@ export class Argument extends LogicItem {
140
142
  });
141
143
  }
142
144
 
143
- toVue(state?: TranslatorState): string {
145
+ toVue(options?: ElementToVueOptions) {
144
146
  let code = this.spread ? '...' : '';
145
147
  if (this.expression) {
146
- code += this.expression.toVue(shiftState(state, code));
148
+ code += this.expression.toVue(options);
147
149
  } else {
148
150
  code += '';
149
151
  }
@@ -1,5 +1,6 @@
1
1
  import { TranslatorState, shiftState, withSourceMap } from '../translator';
2
2
  import Identifier from './Identifier__';
3
+ import { ElementToVueOptions } from './ViewElement__';
3
4
 
4
5
  //================================================================================
5
6
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
@@ -9,6 +10,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
9
10
  import { concept, excludedInJSON, property } from '../decorators';
10
11
 
11
12
  import * as utils from '../utils';
13
+ import { v4 as uuidv4 } from 'uuid';
12
14
  import BaseNode from '../common/BaseNode';
13
15
  import classMap from '../common/classMap';
14
16
  import LogicItem from './LogicItem__';
@@ -181,11 +183,11 @@ export class Assignment extends LogicItem {
181
183
  };
182
184
  }
183
185
 
184
- toVue(state?: TranslatorState): string {
186
+ toVue(options?: ElementToVueOptions) {
185
187
  let code = '';
186
- code += this.left ? this.left.toVue(shiftState(state, code, { inline: true })) : '';
188
+ code += this.left ? this.left.toVue(options) : '';
187
189
  code += ' = ';
188
- code += this.right ? this.right.toVue(shiftState(state, code, { inline: true })) : '';
190
+ code += this.right ? this.right.toVue(options) : '';
189
191
  code += ';';
190
192
  return code;
191
193
  }
@@ -215,10 +217,6 @@ export class Assignment extends LogicItem {
215
217
  code += this.left ? this.left.toEmbeddedTS(shiftState(state, code, { inline: true })) : '__LEFT__';
216
218
  code += ' = ';
217
219
 
218
- // 因为右侧枚举要赋值就得new 一下;
219
- if (this.right && this.right instanceof Identifier && this.right.namespace && this.right.namespace.endsWith('enums')) {
220
- code += 'new ';
221
- }
222
220
  code += this.right ? this.right.toEmbeddedTS(shiftState(state, code, { inline: true })) : '__RIGHT__';
223
221
  code += ';';
224
222
  return code;
@@ -6,6 +6,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
6
6
  import { concept, excludedInJSON, property } from '../decorators';
7
7
 
8
8
  import * as utils from '../utils';
9
+ import { v4 as uuidv4 } from 'uuid';
9
10
  import BaseNode from '../common/BaseNode';
10
11
  import classMap from '../common/classMap';
11
12
  import TypeAnnotation from './TypeAnnotation__';
@@ -1,4 +1,5 @@
1
1
  import { TranslatorState, shiftState, withSourceMap } from '../translator';
2
+ import { ElementToVueOptions } from './ViewElement__';
2
3
 
3
4
  //================================================================================
4
5
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
@@ -8,6 +9,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
8
9
  import { concept, excludedInJSON, property } from '../decorators';
9
10
 
10
11
  import * as utils from '../utils';
12
+ import { v4 as uuidv4 } from 'uuid';
11
13
  import BaseNode from '../common/BaseNode';
12
14
  import classMap from '../common/classMap';
13
15
  import LogicItem from './LogicItem__';
@@ -171,7 +173,7 @@ export class BinaryExpression extends LogicItem {
171
173
  // 自动生成的代码已结束。下面可以手动编写。
172
174
  //================================================================================
173
175
 
174
- toVue(state?: TranslatorState): string {
176
+ toVue(options?: ElementToVueOptions) {
175
177
  if (['startwith', 'endwith'].includes(this.operator)) {
176
178
  const operatorMap = {
177
179
  startwith: 'startsWith',
@@ -179,16 +181,16 @@ export class BinaryExpression extends LogicItem {
179
181
  };
180
182
  const fnName = operatorMap[this.operator as keyof typeof operatorMap];
181
183
  let code = '';
182
- code += this.left?.toVue ? this.left.toVue(shiftState(state, code, { inline: true })) : '';
184
+ code += this.left?.toVue ? this.left.toVue(options) : '';
183
185
  code += '.' + fnName + '(';
184
- code += this.right?.toVue ? this.right.toVue(shiftState(state, code, { inline: true })) : '';
186
+ code += this.right?.toVue ? this.right.toVue(options) : '';
185
187
  code += ')';
186
188
  return code;
187
189
  }
188
190
  let code = '';
189
- code += this.left?.toVue ? this.left.toVue(shiftState(state, code, { inline: true })) : '';
191
+ code += this.left?.toVue ? this.left.toVue() : '';
190
192
  code += ` ${this.operator} `;
191
- code += this.right?.toVue ? this.right.toVue(shiftState(state, code, { inline: true })) : '';
193
+ code += this.right?.toVue ? this.right.toVue() : '';
192
194
  return code;
193
195
  }
194
196
 
@@ -9,6 +9,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
9
9
  import { concept, excludedInJSON, property } from '../decorators';
10
10
 
11
11
  import * as utils from '../utils';
12
+ import { v4 as uuidv4 } from 'uuid';
12
13
  import BaseNode from '../common/BaseNode';
13
14
  import classMap from '../common/classMap';
14
15
  import LogicItem from './LogicItem__';
@@ -197,7 +198,7 @@ export class BindAttribute extends BaseNode {
197
198
 
198
199
  getValidationRuleExistingNames(excludedList: Array<ValidationRule> = []) {
199
200
  const excludedSet = new Set(excludedList);
200
- return this.rules.filter((item) => !excludedSet.has(item)).map((item) => item.name);
201
+ return (this.rules || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
201
202
  }
202
203
  getValidationRuleUniqueName(name = 'validationRule1') {
203
204
  return utils.unique(name, this.getValidationRuleExistingNames());
@@ -462,16 +463,20 @@ export class BindAttribute extends BaseNode {
462
463
  /**
463
464
  * 转换成 Vue 的模板格式
464
465
  */
465
- toVue() {
466
+ toVue(options?: ElementToVueOptions) {
466
467
  let value = this.value;
467
468
  if (this.type === 'dynamic' && this.expression) {
468
- value = this.expression.toVue();
469
+ value = this.expression.toVue(options);
469
470
  }
470
471
  if (value !== undefined && value !== null && typeof value === 'string') {
471
472
  value = value.replace(/"/g, "'");
472
473
  }
473
474
  if (this.name === 'destination' && this.destination) {
474
- return this.destination.toVue();
475
+ return this.destination.toVue(options);
476
+ } else if (this.name === 'rules' && this.rules) {
477
+ const ruleStrs = this.rules.map((rule) => rule.toVue());
478
+ value = ruleStrs.join(' | ');
479
+ return value !== undefined && value !== null ? `${this.name}="${value}"` : '';
475
480
  } else if (this.type === 'string') {
476
481
  return value !== undefined && value !== null ? `${this.name}="${value}"` : '';
477
482
  } else {
@@ -1,3 +1,4 @@
1
+ import { ElementToVueOptions } from './ViewElement__';
1
2
  //================================================================================
2
3
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
3
4
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -6,6 +7,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
6
7
  import { concept, excludedInJSON, property } from '../decorators';
7
8
 
8
9
  import * as utils from '../utils';
10
+ import { v4 as uuidv4 } from 'uuid';
9
11
  import BaseNode from '../common/BaseNode';
10
12
  import classMap from '../common/classMap';
11
13
  import LogicItem from './LogicItem__';
@@ -204,7 +206,7 @@ export class BindDirective extends BaseNode {
204
206
  /**
205
207
  * 转换成 Vue 的模板格式
206
208
  */
207
- toVue() {
209
+ toVue(options?: ElementToVueOptions) {
208
210
  let modifiersString = '';
209
211
  Object.keys(this.modifiers || {}).forEach((key) => {
210
212
  const value = (this.modifiers as any)[key];
@@ -214,7 +216,7 @@ export class BindDirective extends BaseNode {
214
216
  // eslint-disable-next-line no-nested-ternary
215
217
  let value = this.type !== 'string' ? this.value : this.value ? `'${this.value}'` : '';
216
218
  if (this.expression) {
217
- value = this.expression.toVue();
219
+ value = this.expression.toVue(options);
218
220
  if (this.expression.concept === 'StringLiteral') {
219
221
  value = `'${value}'`;
220
222
  }
@@ -3,7 +3,7 @@ import Logic from './Logic__';
3
3
  import LogicItem from './LogicItem__';
4
4
  import Namespace from './Namespace__';
5
5
  import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState, embeddedTSEmitter } from '../translator';
6
-
6
+ import { ElementToVueOptions } from './ViewElement__';
7
7
  //================================================================================
8
8
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
9
9
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -12,6 +12,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
12
12
  import { concept, excludedInJSON, property } from '../decorators';
13
13
 
14
14
  import * as utils from '../utils';
15
+ import { v4 as uuidv4 } from 'uuid';
15
16
  import BaseNode from '../common/BaseNode';
16
17
  import classMap from '../common/classMap';
17
18
  import Argument from './Argument__';
@@ -304,7 +305,8 @@ export class BindEvent extends BaseNode {
304
305
  if (/^\d/.test(tsName)) {
305
306
  tsName = '$' + tsName;
306
307
  }
307
- tsName = tsName.replaceAll('-', '_');
308
+ // 匹配所有特殊字符都转为_
309
+ tsName = tsName.replace(/\W/g, '_');
308
310
  return tsName;
309
311
  }
310
312
  return '';
@@ -376,7 +378,7 @@ export class BindEvent extends BaseNode {
376
378
  /**
377
379
  * 转换成 Vue 的模板格式
378
380
  */
379
- toVue() {
381
+ toVue(options?: ElementToVueOptions) {
380
382
  const calleeName = this.calleeName;
381
383
  let code = '';
382
384
  if (calleeName) {
@@ -390,8 +392,8 @@ export class BindEvent extends BaseNode {
390
392
  });
391
393
  code += ')';
392
394
  }
395
+ code += `"`;
393
396
  }
394
- code += `"`;
395
397
  return code;
396
398
  }
397
399
  //================================================================================
@@ -1,4 +1,5 @@
1
1
  import { TranslatorState, shiftState, withSourceMap } from '../translator';
2
+ import { ElementToVueOptions } from './ViewElement__';
2
3
  //================================================================================
3
4
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
4
5
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -7,6 +8,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
7
8
  import { concept, excludedInJSON, property } from '../decorators';
8
9
 
9
10
  import * as utils from '../utils';
11
+ import { v4 as uuidv4 } from 'uuid';
10
12
  import BaseNode from '../common/BaseNode';
11
13
  import classMap from '../common/classMap';
12
14
  import LogicItem from './LogicItem__';
@@ -54,7 +56,7 @@ export class BooleanLiteral extends LogicItem {
54
56
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
55
57
  // 自动生成的代码已结束。下面可以手动编写。
56
58
  //================================================================================
57
- toVue(): string {
59
+ toVue(options?: ElementToVueOptions): string {
58
60
  return this.value;
59
61
  }
60
62
 
@@ -1,5 +1,6 @@
1
1
  import { TranslatorState, shiftState, withSourceMap } from '../translator';
2
2
  import Function from './Function__';
3
+ import { ElementToVueOptions } from './ViewElement__';
3
4
  //================================================================================
4
5
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
5
6
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -8,8 +9,10 @@ import { EventPayload, Params } from '../common/EventEmitter';
8
9
  import { concept, excludedInJSON, property } from '../decorators';
9
10
 
10
11
  import * as utils from '../utils';
12
+ import { v4 as uuidv4 } from 'uuid';
11
13
  import BaseNode from '../common/BaseNode';
12
14
  import classMap from '../common/classMap';
15
+ import TypeAnnotation from './TypeAnnotation__';
13
16
  import Argument from './Argument__';
14
17
  import LogicItem from './LogicItem__';
15
18
 
@@ -48,6 +51,12 @@ export class CallFunction extends LogicItem {
48
51
  @property()
49
52
  shortcut: boolean = undefined;
50
53
 
54
+ /**
55
+ * 类型参数
56
+ */
57
+ @property('TypeAnnotation')
58
+ typeArguments?: Array<TypeAnnotation> = null;
59
+
51
60
  /**
52
61
  * 实际参数
53
62
  */
@@ -76,6 +85,113 @@ export class CallFunction extends LogicItem {
76
85
 
77
86
 
78
87
 
88
+ /**
89
+ * 插入类型标注
90
+ * @internal
91
+ * @param typeAnnotationOptions 类型标注参数
92
+ */
93
+ _insertTypeAnnotationAt(typeAnnotationOptions: Partial<TypeAnnotation>, index: number): TypeAnnotation;
94
+
95
+ /**
96
+ * 插入类型标注
97
+ * @internal
98
+ * @param typeAnnotation 已有的类型标注实例
99
+ */
100
+ _insertTypeAnnotationAt(typeAnnotation: TypeAnnotation, index: number): TypeAnnotation;
101
+
102
+ _insertTypeAnnotationAt(options: Partial<TypeAnnotation> | TypeAnnotation, index: number) {
103
+ const typeAnnotationOptions: any = {};
104
+ const relationOptions = { parentNode: this, parentKey: 'typeArguments' };
105
+ let typeAnnotation: TypeAnnotation;
106
+ if (options instanceof TypeAnnotation) {
107
+ options.delete(); // 同一实例不支持多处存在
108
+ typeAnnotation = options;
109
+ Object.assign(typeAnnotation, relationOptions);
110
+ } else {
111
+ typeAnnotation = TypeAnnotation.from({
112
+ ...typeAnnotationOptions,
113
+ ...options,
114
+ }, this, 'typeArguments');
115
+ }
116
+ this.typeArguments.splice(index, 0, typeAnnotation);
117
+ return typeAnnotation;
118
+ }
119
+
120
+
121
+
122
+ /**
123
+ * 插入类型标注
124
+ * @param typeAnnotationOptions 类型标注参数
125
+ */
126
+ insertTypeAnnotationAt(typeAnnotationOptions: Partial<TypeAnnotation>, index: number): TypeAnnotation;
127
+
128
+ /**
129
+ * 插入类型标注
130
+ * @param typeAnnotation 已有的类型标注实例
131
+ */
132
+ insertTypeAnnotationAt(typeAnnotation: TypeAnnotation, index: number): TypeAnnotation;
133
+
134
+ insertTypeAnnotationAt(options: Partial<TypeAnnotation> | TypeAnnotation, index: number) {
135
+ const node = this._insertTypeAnnotationAt(options as any, index);
136
+ node.create({
137
+ index,
138
+ parentNode: this,
139
+ parentKey: 'typeArguments',
140
+ });
141
+ return node;
142
+ }
143
+
144
+
145
+
146
+ /**
147
+ * 添加类型标注
148
+ * @internal
149
+ * @param typeAnnotationOptions 类型标注参数
150
+ */
151
+ _addTypeAnnotation(typeAnnotationOptions: Partial<TypeAnnotation>): TypeAnnotation;
152
+
153
+ /**
154
+ * 添加类型标注
155
+ * @internal
156
+ * @param typeAnnotation 已有的类型标注实例
157
+ */
158
+ _addTypeAnnotation(typeAnnotation: TypeAnnotation): TypeAnnotation;
159
+
160
+ _addTypeAnnotation(options?: Partial<TypeAnnotation> | TypeAnnotation) {
161
+ const index = this.typeArguments.length;
162
+ return this._insertTypeAnnotationAt(options as any, index);
163
+ }
164
+
165
+
166
+
167
+ /**
168
+ * 添加类型标注
169
+ * @param typeAnnotationOptions 类型标注参数
170
+ */
171
+ addTypeAnnotation(typeAnnotationOptions: Partial<TypeAnnotation>): TypeAnnotation;
172
+
173
+ /**
174
+ * 添加类型标注
175
+ * @param typeAnnotation 已有的类型标注实例
176
+ */
177
+ addTypeAnnotation(typeAnnotation: TypeAnnotation): TypeAnnotation;
178
+
179
+ addTypeAnnotation(options?: Partial<TypeAnnotation> | TypeAnnotation) {
180
+ const node = this._addTypeAnnotation(options as any);
181
+ const index = this.typeArguments.length;
182
+ node.create({
183
+ index,
184
+ parentNode: this,
185
+ parentKey: 'typeArguments',
186
+ });
187
+ return node;
188
+ }
189
+
190
+
191
+
192
+
193
+
194
+
79
195
  /**
80
196
  * 插入实际参数
81
197
  * @internal
@@ -181,6 +297,42 @@ export class CallFunction extends LogicItem {
181
297
 
182
298
 
183
299
 
300
+ /**
301
+ * 删除类型标注
302
+ * @param typeAnnotation 已有的类型标注实例
303
+ */
304
+ removeTypeAnnotation(typeAnnotation: TypeAnnotation): void;
305
+
306
+ removeTypeAnnotation(options: TypeAnnotation) {
307
+ let typeAnnotation: TypeAnnotation = options;
308
+ return typeAnnotation.delete();
309
+ }
310
+
311
+ __removeTypeAnnotation(typeAnnotation: TypeAnnotation) {
312
+ const parentKey = typeAnnotation.parentKey;
313
+ const params: Params = {
314
+ parentNode: this,
315
+ parentKey,
316
+ index: -1,
317
+ object: null,
318
+ oldObject: typeAnnotation,
319
+ };
320
+ if (parentKey) {
321
+ params.parentKey = parentKey;
322
+ if (Array.isArray((this as any)[parentKey])) {
323
+ const index = (this as any)[parentKey].indexOf(typeAnnotation);
324
+ ~index && (this as any)[parentKey].splice(index, 1);
325
+ params.index = index;
326
+ } else if ((this as any)[parentKey] === typeAnnotation) {
327
+ params.index = 0;
328
+ (this as any)[parentKey] = undefined;
329
+ }
330
+ }
331
+ return params;
332
+ }
333
+
334
+
335
+
184
336
  /**
185
337
  * 删除实际参数
186
338
  * @param argument 已有的实际参数实例
@@ -219,11 +371,11 @@ export class CallFunction extends LogicItem {
219
371
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
220
372
  // 自动生成的代码已结束。下面可以手动编写。
221
373
  //================================================================================
222
- toVue(): string {
374
+ toVue(options?: ElementToVueOptions): string {
223
375
  let code = `$utils['${this.calleeName}']`;
224
376
  code += '(';
225
377
  this.arguments.forEach((arg, index) => {
226
- code += arg.toVue();
378
+ code += arg.toVue(options);
227
379
  if (index !== this.arguments.length - 1)
228
380
  code += ', ';
229
381
  });
@@ -256,7 +408,7 @@ export class CallFunction extends LogicItem {
256
408
  }
257
409
 
258
410
  get calleeKey(): string {
259
- return `${this.calleeNamespace}.${this.calleeName}`;
411
+ return this.calleeName ? `${this.calleeNamespace ? this.calleeNamespace + '.' : ''}${this.calleeName}` : '__IDENTIFIER__';
260
412
  }
261
413
 
262
414
  _setCallee(func: Function) {
@@ -279,23 +431,55 @@ export class CallFunction extends LogicItem {
279
431
  Object.assign(argument, relationOptions);
280
432
  return argument;
281
433
  });
434
+ let typeArguments = null;
435
+ if(func.typeParams) {
436
+ typeArguments = func.typeParams.map(() => {
437
+ const relationOptions = { parentNode: this, parentKey: 'typeArguments' };
438
+ const typeArgu = new TypeAnnotation();
439
+ Object.assign(typeArgu, relationOptions);
440
+ return typeArgu;
441
+ })
442
+ }
282
443
  this.update({
283
444
  calleeNamespace,
284
445
  calleeName,
285
446
  arguments: params,
447
+ typeArguments
286
448
  });
287
449
  }
288
450
 
289
451
  @withSourceMap()
290
452
  toEmbeddedTS(state?: TranslatorState): string {
291
- let code = this.calleeKey;
292
- code += '(';
293
- this.arguments.forEach((arg, index) => {
294
- code += arg.toEmbeddedTS(shiftState(state, code));
295
- if (index !== this.arguments.length - 1)
296
- code += ', ';
297
- });
298
- code += ');\n';
453
+ let code = '';
454
+ const calleeKey = this.calleeKey;
455
+ if (calleeKey === 'nasl.util.Convert') {
456
+ // nasl.util.Convert(variable1)<nasl.core.String>();
457
+ // 单独处理
458
+
459
+ code = calleeKey;
460
+ code += '(';
461
+ this.arguments.forEach((arg, index) => {
462
+ code += arg.toEmbeddedTS(shiftState(state, code));
463
+ if (index !== this.arguments.length - 1)
464
+ code += ', ';
465
+ });
466
+ code += ')';
467
+ // 如果有内容
468
+ const typeAnnotation = this.typeArguments[0];
469
+ if (typeAnnotation.typeNamespace && typeAnnotation.typeName) {
470
+ code += `<${typeAnnotation.typeNamespace}.${typeAnnotation.typeName}>()`;
471
+ }
472
+ code += '\n';
473
+ } else {
474
+ code = this.calleeKey;
475
+ code += '(';
476
+ this.arguments.forEach((arg, index) => {
477
+ code += arg.toEmbeddedTS(shiftState(state, code));
478
+ if (index !== this.arguments.length - 1)
479
+ code += ', ';
480
+ });
481
+ code += ')\n';
482
+ }
299
483
  return code;
300
484
  }
301
485
  //================================================================================
@@ -1,5 +1,6 @@
1
1
  import { TranslatorState, shiftState, withSourceMap } from '../translator';
2
2
  import Interface from './Interface__';
3
+ import { ElementToVueOptions } from './ViewElement__';
3
4
  //================================================================================
4
5
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
5
6
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -8,6 +9,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
8
9
  import { concept, excludedInJSON, property } from '../decorators';
9
10
 
10
11
  import * as utils from '../utils';
12
+ import { v4 as uuidv4 } from 'uuid';
11
13
  import BaseNode from '../common/BaseNode';
12
14
  import classMap from '../common/classMap';
13
15
  import Argument from './Argument__';
@@ -219,11 +221,11 @@ export class CallInterface extends LogicItem {
219
221
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
220
222
  // 自动生成的代码已结束。下面可以手动编写。
221
223
  //================================================================================
222
- toVue(): string {
224
+ toVue(options?: ElementToVueOptions): string {
223
225
  let code = this.calleeName;
224
226
  code += '(';
225
227
  this.arguments.forEach((arg, index) => {
226
- code += arg.toVue();
228
+ code += arg.toVue(options);
227
229
  if (index !== this.arguments.length - 1)
228
230
  code += ', ';
229
231
  });