@lcap/nasl 3.4.0-beta.8 → 3.4.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/.nyc_output/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +1 -0
  2. package/.nyc_output/processinfo/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +1 -0
  3. package/.nyc_output/processinfo/index.json +1 -0
  4. package/coverage/base.css +224 -0
  5. package/coverage/block-navigation.js +87 -0
  6. package/coverage/favicon.png +0 -0
  7. package/coverage/index.html +461 -0
  8. package/coverage/prettify.css +1 -0
  9. package/coverage/prettify.js +2 -0
  10. package/coverage/sort-arrow-sprite.png +0 -0
  11. package/coverage/sorter.js +196 -0
  12. package/coverage/src/automate/engine/index.html +116 -0
  13. package/coverage/src/automate/engine/utils.js.html +1414 -0
  14. package/coverage/src/bak/index.html +116 -0
  15. package/coverage/src/bak/translator.js.html +622 -0
  16. package/coverage/src/breakpoint/generator/AfterStartNode.ts.html +175 -0
  17. package/coverage/src/breakpoint/generator/BeforeEndNode.ts.html +169 -0
  18. package/coverage/src/breakpoint/generator/BreakpointNode.ts.html +1246 -0
  19. package/coverage/src/breakpoint/generator/CallbackNode.ts.html +145 -0
  20. package/coverage/src/breakpoint/generator/index.html +176 -0
  21. package/coverage/src/breakpoint/generator/index.ts.html +508 -0
  22. package/coverage/src/breakpoint/index.html +116 -0
  23. package/coverage/src/breakpoint/index.ts.html +94 -0
  24. package/coverage/src/breakpoint/shared/constants.ts.html +436 -0
  25. package/coverage/src/breakpoint/shared/index.html +176 -0
  26. package/coverage/src/breakpoint/shared/index.ts.html +94 -0
  27. package/coverage/src/breakpoint/shared/operations.ts.html +160 -0
  28. package/coverage/src/breakpoint/shared/socket.ts.html +1297 -0
  29. package/coverage/src/breakpoint/shared/utils.ts.html +1087 -0
  30. package/coverage/src/breakpoint/store/core.ts.html +1600 -0
  31. package/coverage/src/breakpoint/store/dock.ts.html +733 -0
  32. package/coverage/src/breakpoint/store/index.html +146 -0
  33. package/coverage/src/breakpoint/store/index.ts.html +91 -0
  34. package/coverage/src/common/BaseNode.ts.html +3874 -0
  35. package/coverage/src/common/Command.ts.html +310 -0
  36. package/coverage/src/common/EventEmitter.ts.html +370 -0
  37. package/coverage/src/common/Messager.ts.html +820 -0
  38. package/coverage/src/common/asyncFuncMap.ts.html +127 -0
  39. package/coverage/src/common/index.html +191 -0
  40. package/coverage/src/common/index.ts.html +94 -0
  41. package/coverage/src/concepts/Abort__.ts.html +328 -0
  42. package/coverage/src/concepts/Anchor__.ts.html +646 -0
  43. package/coverage/src/concepts/AnonymousFunction__.ts.html +2029 -0
  44. package/coverage/src/concepts/App__.ts.html +13252 -0
  45. package/coverage/src/concepts/Argument__.ts.html +964 -0
  46. package/coverage/src/concepts/Assignee__.ts.html +2236 -0
  47. package/coverage/src/concepts/AssignmentLine__.ts.html +409 -0
  48. package/coverage/src/concepts/Assignment__.ts.html +1123 -0
  49. package/coverage/src/concepts/Attribute__.ts.html +733 -0
  50. package/coverage/src/concepts/AuthInterface__.ts.html +367 -0
  51. package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +1984 -0
  52. package/coverage/src/concepts/AuthLogic__.ts.html +781 -0
  53. package/coverage/src/concepts/BackendVariable__.ts.html +1483 -0
  54. package/coverage/src/concepts/Backend__.ts.html +1165 -0
  55. package/coverage/src/concepts/BatchAssignment__.ts.html +3301 -0
  56. package/coverage/src/concepts/BinaryExpression__.ts.html +1441 -0
  57. package/coverage/src/concepts/BindAttribute__.ts.html +3835 -0
  58. package/coverage/src/concepts/BindDirective__.ts.html +1921 -0
  59. package/coverage/src/concepts/BindEvent__.ts.html +3406 -0
  60. package/coverage/src/concepts/BindStyle__.ts.html +1612 -0
  61. package/coverage/src/concepts/BooleanLiteral__.ts.html +418 -0
  62. package/coverage/src/concepts/CallAuthInterface__.ts.html +1615 -0
  63. package/coverage/src/concepts/CallConnector__.ts.html +922 -0
  64. package/coverage/src/concepts/CallFunction__.ts.html +2122 -0
  65. package/coverage/src/concepts/CallInterface__.ts.html +2719 -0
  66. package/coverage/src/concepts/CallLogic__.ts.html +4807 -0
  67. package/coverage/src/concepts/CallQueryComponent__.ts.html +5308 -0
  68. package/coverage/src/concepts/Comment__.ts.html +394 -0
  69. package/coverage/src/concepts/CompletionProperty__.ts.html +925 -0
  70. package/coverage/src/concepts/ConfigGroup__.ts.html +1105 -0
  71. package/coverage/src/concepts/ConfigPropertyValue__.ts.html +424 -0
  72. package/coverage/src/concepts/ConfigProperty__.ts.html +1348 -0
  73. package/coverage/src/concepts/Configuration__.ts.html +1027 -0
  74. package/coverage/src/concepts/Connection__.ts.html +1360 -0
  75. package/coverage/src/concepts/ConnectorTrigger__.ts.html +595 -0
  76. package/coverage/src/concepts/Connector__.ts.html +4255 -0
  77. package/coverage/src/concepts/Constant__.ts.html +913 -0
  78. package/coverage/src/concepts/DataSource__.ts.html +1771 -0
  79. package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +331 -0
  80. package/coverage/src/concepts/Destination__.ts.html +2731 -0
  81. package/coverage/src/concepts/End__.ts.html +433 -0
  82. package/coverage/src/concepts/EntityIndex__.ts.html +787 -0
  83. package/coverage/src/concepts/EntityProperty__.ts.html +2668 -0
  84. package/coverage/src/concepts/Entity__.ts.html +2950 -0
  85. package/coverage/src/concepts/EnumItem__.ts.html +550 -0
  86. package/coverage/src/concepts/Enum__.ts.html +1231 -0
  87. package/coverage/src/concepts/Event__.ts.html +1084 -0
  88. package/coverage/src/concepts/ExternalDestination__.ts.html +1033 -0
  89. package/coverage/src/concepts/ForEachStatement__.ts.html +1957 -0
  90. package/coverage/src/concepts/FrontendLibrary__.ts.html +1711 -0
  91. package/coverage/src/concepts/FrontendVariable__.ts.html +292 -0
  92. package/coverage/src/concepts/Frontend__.ts.html +3961 -0
  93. package/coverage/src/concepts/Function__.ts.html +3598 -0
  94. package/coverage/src/concepts/Identifier__.ts.html +1057 -0
  95. package/coverage/src/concepts/IfStatement__.ts.html +1594 -0
  96. package/coverage/src/concepts/Integration__.ts.html +1228 -0
  97. package/coverage/src/concepts/InterfaceParam__.ts.html +1087 -0
  98. package/coverage/src/concepts/Interface__.ts.html +3394 -0
  99. package/coverage/src/concepts/JSBlock__.ts.html +421 -0
  100. package/coverage/src/concepts/JavaLogic__.ts.html +460 -0
  101. package/coverage/src/concepts/LogicItem__.ts.html +1171 -0
  102. package/coverage/src/concepts/Logic__.ts.html +7408 -0
  103. package/coverage/src/concepts/MatchCase__.ts.html +2929 -0
  104. package/coverage/src/concepts/Match__.ts.html +2455 -0
  105. package/coverage/src/concepts/MemberExpression__.ts.html +1726 -0
  106. package/coverage/src/concepts/MicroApp__.ts.html +436 -0
  107. package/coverage/src/concepts/Module__.ts.html +9220 -0
  108. package/coverage/src/concepts/MsgTriggerEvent__.ts.html +1045 -0
  109. package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +1018 -0
  110. package/coverage/src/concepts/Namespace__.ts.html +7942 -0
  111. package/coverage/src/concepts/NewComposite__.ts.html +4729 -0
  112. package/coverage/src/concepts/NewList__.ts.html +1618 -0
  113. package/coverage/src/concepts/NewMap__.ts.html +2326 -0
  114. package/coverage/src/concepts/New__.ts.html +289 -0
  115. package/coverage/src/concepts/NullLiteral__.ts.html +349 -0
  116. package/coverage/src/concepts/NumericLiteral__.ts.html +676 -0
  117. package/coverage/src/concepts/OqlQueryComponent__.ts.html +1141 -0
  118. package/coverage/src/concepts/OverriddenLogic__.ts.html +6817 -0
  119. package/coverage/src/concepts/Param__.ts.html +1726 -0
  120. package/coverage/src/concepts/Point__.ts.html +331 -0
  121. package/coverage/src/concepts/ProcessComponent__.ts.html +1666 -0
  122. package/coverage/src/concepts/ProcessElement__.ts.html +5884 -0
  123. package/coverage/src/concepts/ProcessOutcome__.ts.html +352 -0
  124. package/coverage/src/concepts/ProcessOutcomes__.ts.html +343 -0
  125. package/coverage/src/concepts/Process__.ts.html +4768 -0
  126. package/coverage/src/concepts/QueryAggregateExpression__.ts.html +568 -0
  127. package/coverage/src/concepts/QueryFieldExpression__.ts.html +583 -0
  128. package/coverage/src/concepts/QueryFromExpression__.ts.html +910 -0
  129. package/coverage/src/concepts/QueryGroupByExpression__.ts.html +559 -0
  130. package/coverage/src/concepts/QueryJoinExpression__.ts.html +1567 -0
  131. package/coverage/src/concepts/QueryLimitExpression__.ts.html +637 -0
  132. package/coverage/src/concepts/QueryOrderByExpression__.ts.html +679 -0
  133. package/coverage/src/concepts/QuerySelectExpression__.ts.html +1714 -0
  134. package/coverage/src/concepts/Rect__.ts.html +373 -0
  135. package/coverage/src/concepts/Return__.ts.html +1312 -0
  136. package/coverage/src/concepts/Role__.ts.html +601 -0
  137. package/coverage/src/concepts/SelectMembers__.ts.html +1246 -0
  138. package/coverage/src/concepts/Slot__.ts.html +628 -0
  139. package/coverage/src/concepts/SqlQueryComponent__.ts.html +982 -0
  140. package/coverage/src/concepts/Start__.ts.html +304 -0
  141. package/coverage/src/concepts/StringInterpolation__.ts.html +1129 -0
  142. package/coverage/src/concepts/StringLiteral__.ts.html +505 -0
  143. package/coverage/src/concepts/StructureProperty__.ts.html +1132 -0
  144. package/coverage/src/concepts/Structure__.ts.html +2092 -0
  145. package/coverage/src/concepts/SwitchCase__.ts.html +1174 -0
  146. package/coverage/src/concepts/SwitchStatement__.ts.html +877 -0
  147. package/coverage/src/concepts/Theme__.ts.html +358 -0
  148. package/coverage/src/concepts/Transactional__.ts.html +628 -0
  149. package/coverage/src/concepts/TriggerEvent__.ts.html +1012 -0
  150. package/coverage/src/concepts/TriggerLauncher__.ts.html +775 -0
  151. package/coverage/src/concepts/TypeAnnotation__.ts.html +3718 -0
  152. package/coverage/src/concepts/TypeParam__.ts.html +319 -0
  153. package/coverage/src/concepts/UnaryExpression__.ts.html +697 -0
  154. package/coverage/src/concepts/Unparsed__.ts.html +394 -0
  155. package/coverage/src/concepts/UseComponent__.ts.html +331 -0
  156. package/coverage/src/concepts/ValidationRule__.ts.html +1840 -0
  157. package/coverage/src/concepts/Variable__.ts.html +1489 -0
  158. package/coverage/src/concepts/ViewBlock__.ts.html +352 -0
  159. package/coverage/src/concepts/ViewComponent__.ts.html +4180 -0
  160. package/coverage/src/concepts/ViewElement__.ts.html +8803 -0
  161. package/coverage/src/concepts/View__.ts.html +8620 -0
  162. package/coverage/src/concepts/WhileStatement__.ts.html +1063 -0
  163. package/coverage/src/concepts/basics/stdlib/index.html +356 -0
  164. package/coverage/src/concepts/basics/stdlib/index.ts.html +208 -0
  165. package/coverage/src/concepts/basics/stdlib/nasl.auth.ts.html +565 -0
  166. package/coverage/src/concepts/basics/stdlib/nasl.browser.ts.html +517 -0
  167. package/coverage/src/concepts/basics/stdlib/nasl.collection.ts.html +226 -0
  168. package/coverage/src/concepts/basics/stdlib/nasl.configuration.ts.html +172 -0
  169. package/coverage/src/concepts/basics/stdlib/nasl.core.ts.html +214 -0
  170. package/coverage/src/concepts/basics/stdlib/nasl.event.ts.html +145 -0
  171. package/coverage/src/concepts/basics/stdlib/nasl.http.ts.html +589 -0
  172. package/coverage/src/concepts/basics/stdlib/nasl.interface.ts.html +214 -0
  173. package/coverage/src/concepts/basics/stdlib/nasl.io.ts.html +229 -0
  174. package/coverage/src/concepts/basics/stdlib/nasl.logging.ts.html +268 -0
  175. package/coverage/src/concepts/basics/stdlib/nasl.process.ts.html +1999 -0
  176. package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +3259 -0
  177. package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +6844 -0
  178. package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +1768 -0
  179. package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +163 -0
  180. package/coverage/src/concepts/basics/stdlib/timeZone.ts.html +664 -0
  181. package/coverage/src/concepts/basics/types/coreTypeList.ts.html +121 -0
  182. package/coverage/src/concepts/basics/types/index.html +131 -0
  183. package/coverage/src/concepts/basics/types/index.ts.html +160 -0
  184. package/coverage/src/concepts/index.html +1961 -0
  185. package/coverage/src/concepts/index.ts.html +103 -0
  186. package/coverage/src/concepts/index__.ts.html +451 -0
  187. package/coverage/src/config.ts.html +325 -0
  188. package/coverage/src/decorators/index.html +131 -0
  189. package/coverage/src/decorators/index.ts.html +574 -0
  190. package/coverage/src/decorators/promise.ts.html +169 -0
  191. package/coverage/src/eventBus.ts.html +100 -0
  192. package/coverage/src/generator/compileComponent.ts.html +142 -0
  193. package/coverage/src/generator/genBundleFiles.ts.html +1828 -0
  194. package/coverage/src/generator/genHash.ts.html +124 -0
  195. package/coverage/src/generator/genMetaData.ts.html +1042 -0
  196. package/coverage/src/generator/genReleaseBody.ts.html +1282 -0
  197. package/coverage/src/generator/icestark.ts.html +220 -0
  198. package/coverage/src/generator/index.html +266 -0
  199. package/coverage/src/generator/index.ts.html +106 -0
  200. package/coverage/src/generator/microApp.ts.html +172 -0
  201. package/coverage/src/generator/permission.ts.html +1036 -0
  202. package/coverage/src/generator/qiankun.ts.html +232 -0
  203. package/coverage/src/generator/styleReplacer.ts.html +199 -0
  204. package/coverage/src/index.html +146 -0
  205. package/coverage/src/index.ts.html +121 -0
  206. package/coverage/src/manager/diagnostic.ts.html +442 -0
  207. package/coverage/src/manager/index.html +131 -0
  208. package/coverage/src/manager/stepRecorder.ts.html +457 -0
  209. package/coverage/src/natural/genNaturalTS.ts.html +355 -0
  210. package/coverage/src/natural/index.html +161 -0
  211. package/coverage/src/natural/index.ts.html +91 -0
  212. package/coverage/src/natural/naslStdlibMap.ts.html +157 -0
  213. package/coverage/src/natural/transformTSCode.ts.html +2647 -0
  214. package/coverage/src/sentry/index.html +116 -0
  215. package/coverage/src/sentry/index.ts.html +676 -0
  216. package/coverage/src/server/createUiTs.ts.html +910 -0
  217. package/coverage/src/server/entity2LogicNamespace.ts.html +1294 -0
  218. package/coverage/src/server/event.js.html +526 -0
  219. package/coverage/src/server/extendBaseNode.ts.html +1762 -0
  220. package/coverage/src/server/formatTsUtils.ts.html +2689 -0
  221. package/coverage/src/server/getConnector.ts.html +316 -0
  222. package/coverage/src/server/getExtensionModules.ts.html +178 -0
  223. package/coverage/src/server/getFunctions.ts.html +133 -0
  224. package/coverage/src/server/getInterfaces.ts.html +229 -0
  225. package/coverage/src/server/getLogging.ts.html +100 -0
  226. package/coverage/src/server/getLogics.ts.html +1363 -0
  227. package/coverage/src/server/getMemberIdentifier.ts.html +1561 -0
  228. package/coverage/src/server/getProcessComponents.ts.html +112 -0
  229. package/coverage/src/server/getProcesses.ts.html +2023 -0
  230. package/coverage/src/server/getValidates.ts.html +115 -0
  231. package/coverage/src/server/index.html +401 -0
  232. package/coverage/src/server/index.ts.html +229 -0
  233. package/coverage/src/server/naslServer.ts.html +14401 -0
  234. package/coverage/src/server/naslStdlibMap.ts.html +241 -0
  235. package/coverage/src/server/process2LogicNamespace.ts.html +454 -0
  236. package/coverage/src/server/translator.ts.html +2566 -0
  237. package/coverage/src/service/creator/add.configs.js.html +379 -0
  238. package/coverage/src/service/creator/errHandles.js.html +322 -0
  239. package/coverage/src/service/creator/index.html +146 -0
  240. package/coverage/src/service/creator/index.js.html +352 -0
  241. package/coverage/src/service/datasource/api.js.html +118 -0
  242. package/coverage/src/service/datasource/index.html +131 -0
  243. package/coverage/src/service/datasource/index.js.html +103 -0
  244. package/coverage/src/service/logic/api.js.html +109 -0
  245. package/coverage/src/service/logic/index.html +131 -0
  246. package/coverage/src/service/logic/index.js.html +103 -0
  247. package/coverage/src/service/storage/api.js.html +202 -0
  248. package/coverage/src/service/storage/index.html +206 -0
  249. package/coverage/src/service/storage/index.ts.html +103 -0
  250. package/coverage/src/service/storage/init.ts.html +2761 -0
  251. package/coverage/src/service/storage/jsoner.ts.html +502 -0
  252. package/coverage/src/service/storage/map.ts.html +256 -0
  253. package/coverage/src/service/storage/service.ts.html +331 -0
  254. package/coverage/src/service/storage/storagePoint.ts.html +304 -0
  255. package/coverage/src/templator/genCallComponentLogic.ts.html +163 -0
  256. package/coverage/src/templator/genCreateBlock.ts.html +1093 -0
  257. package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +1609 -0
  258. package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +2254 -0
  259. package/coverage/src/templator/genEditTableBlock.ts.html +955 -0
  260. package/coverage/src/templator/genEnumSelectBlock.ts.html +178 -0
  261. package/coverage/src/templator/genGetBlock.ts.html +451 -0
  262. package/coverage/src/templator/genGridViewBlock.ts.html +1114 -0
  263. package/coverage/src/templator/genListViewBlock.ts.html +475 -0
  264. package/coverage/src/templator/genQueryComponent.ts.html +1207 -0
  265. package/coverage/src/templator/genSelectBlock.ts.html +1243 -0
  266. package/coverage/src/templator/genTableBlock.ts.html +910 -0
  267. package/coverage/src/templator/genUpdateBlock.ts.html +1192 -0
  268. package/coverage/src/templator/index.html +326 -0
  269. package/coverage/src/templator/index.ts.html +154 -0
  270. package/coverage/src/templator/utils.ts.html +1861 -0
  271. package/coverage/src/translator/constant.ts.html +106 -0
  272. package/coverage/src/translator/index.html +146 -0
  273. package/coverage/src/translator/index.ts.html +94 -0
  274. package/coverage/src/translator/utils.ts.html +436 -0
  275. package/coverage/src/utils/cookie.ts.html +265 -0
  276. package/coverage/src/utils/env.ts.html +91 -0
  277. package/coverage/src/utils/index.html +236 -0
  278. package/coverage/src/utils/index.ts.html +655 -0
  279. package/coverage/src/utils/logger.ts.html +145 -0
  280. package/coverage/src/utils/sortTsString.ts.html +187 -0
  281. package/coverage/src/utils/string.ts.html +400 -0
  282. package/coverage/src/utils/time-slicing.ts.html +418 -0
  283. package/coverage/src/utils/traverse.ts.html +568 -0
  284. package/coverage/src/utils/window.ts.html +112 -0
  285. package/out/automate/engine/utils.d.ts +1 -1
  286. package/out/automate/engine/utils.js +1 -5
  287. package/out/automate/engine/utils.js.map +1 -1
  288. package/out/common/BaseNode.d.ts +2 -0
  289. package/out/common/BaseNode.js +24 -1
  290. package/out/common/BaseNode.js.map +1 -1
  291. package/out/concepts/BackendVariable__.js +10 -2
  292. package/out/concepts/BackendVariable__.js.map +1 -1
  293. package/out/concepts/BinaryExpression__.d.ts +2 -0
  294. package/out/concepts/BinaryExpression__.js +4 -0
  295. package/out/concepts/BinaryExpression__.js.map +1 -1
  296. package/out/concepts/BindAttribute__.js +3 -0
  297. package/out/concepts/BindAttribute__.js.map +1 -1
  298. package/out/concepts/CallFunction__.d.ts +2 -0
  299. package/out/concepts/CallFunction__.js +14 -2
  300. package/out/concepts/CallFunction__.js.map +1 -1
  301. package/out/concepts/CallInterface__.d.ts +2 -0
  302. package/out/concepts/CallInterface__.js +5 -1
  303. package/out/concepts/CallInterface__.js.map +1 -1
  304. package/out/concepts/CallLogic__.d.ts +3 -2
  305. package/out/concepts/CallLogic__.js +33 -48
  306. package/out/concepts/CallLogic__.js.map +1 -1
  307. package/out/concepts/Destination__.d.ts +1 -1
  308. package/out/concepts/Destination__.js +2 -2
  309. package/out/concepts/Destination__.js.map +1 -1
  310. package/out/concepts/Logic__.js +21 -5
  311. package/out/concepts/Logic__.js.map +1 -1
  312. package/out/concepts/MemberExpression__.d.ts +1 -1
  313. package/out/concepts/MemberExpression__.js +3 -3
  314. package/out/concepts/MemberExpression__.js.map +1 -1
  315. package/out/concepts/NewComposite__.d.ts +2 -0
  316. package/out/concepts/NewComposite__.js +4 -0
  317. package/out/concepts/NewComposite__.js.map +1 -1
  318. package/out/concepts/NewList__.d.ts +2 -0
  319. package/out/concepts/NewList__.js +4 -0
  320. package/out/concepts/NewList__.js.map +1 -1
  321. package/out/concepts/NewMap__.d.ts +2 -0
  322. package/out/concepts/NewMap__.js +4 -0
  323. package/out/concepts/NewMap__.js.map +1 -1
  324. package/out/concepts/Param__.js +11 -3
  325. package/out/concepts/Param__.js.map +1 -1
  326. package/out/concepts/ProcessElement__.js +9 -1
  327. package/out/concepts/ProcessElement__.js.map +1 -1
  328. package/out/concepts/Return__.js +10 -2
  329. package/out/concepts/Return__.js.map +1 -1
  330. package/out/concepts/Variable__.js +10 -2
  331. package/out/concepts/Variable__.js.map +1 -1
  332. package/out/concepts/ViewElement__.d.ts +1 -0
  333. package/out/concepts/ViewElement__.js +8 -1
  334. package/out/concepts/ViewElement__.js.map +1 -1
  335. package/out/concepts/View__.js +1 -1
  336. package/out/concepts/View__.js.map +1 -1
  337. package/out/concepts/utils/quick-info.d.ts +13 -0
  338. package/out/concepts/utils/quick-info.js +51 -0
  339. package/out/concepts/utils/quick-info.js.map +1 -0
  340. package/out/generator/genBundleFiles.d.ts +1 -0
  341. package/out/generator/genBundleFiles.js +4 -1
  342. package/out/generator/genBundleFiles.js.map +1 -1
  343. package/out/server/getProcesses.js +3 -3
  344. package/out/server/getProcesses.js.map +1 -1
  345. package/out/server/naslServer.js +11 -50
  346. package/out/server/naslServer.js.map +1 -1
  347. package/out/translator/utils.d.ts +2 -2
  348. package/out/utils/i18nInfo.js +7 -2
  349. package/out/utils/i18nInfo.js.map +1 -1
  350. package/package.json +1 -1
  351. package/src/automate/engine/utils.js +1 -5
  352. package/src/common/BaseNode.ts +23 -2
  353. package/src/concepts/BackendVariable__.ts +10 -2
  354. package/src/concepts/BinaryExpression__.ts +5 -1
  355. package/src/concepts/BindAttribute__.ts +2 -0
  356. package/src/concepts/CallFunction__.ts +15 -2
  357. package/src/concepts/CallInterface__.ts +6 -1
  358. package/src/concepts/CallLogic__.ts +36 -52
  359. package/src/concepts/Destination__.ts +2 -2
  360. package/src/concepts/Logic__.ts +35 -22
  361. package/src/concepts/MemberExpression__.ts +3 -3
  362. package/src/concepts/NewComposite__.ts +5 -5
  363. package/src/concepts/NewList__.ts +6 -2
  364. package/src/concepts/NewMap__.ts +6 -3
  365. package/src/concepts/Param__.ts +11 -3
  366. package/src/concepts/ProcessElement__.ts +8 -1
  367. package/src/concepts/Return__.ts +10 -2
  368. package/src/concepts/Variable__.ts +10 -2
  369. package/src/concepts/ViewElement__.ts +11 -2
  370. package/src/concepts/View__.ts +1 -1
  371. package/src/concepts/utils/quick-info.ts +64 -0
  372. package/src/generator/genBundleFiles.ts +8 -3
  373. package/src/server/getProcesses.ts +3 -3
  374. package/src/server/naslServer.ts +10 -47
  375. package/src/translator/utils.ts +2 -2
  376. package/src/utils/i18nInfo.ts +7 -2
  377. package/test/concepts/binary-expression/__snapshots__/getQuickInfoOffset.spec.ts.snap +25 -0
  378. package/test/concepts/binary-expression/getQuickInfoOffset.spec.ts +19 -0
  379. package/test/concepts/call-function/__snapshots__/getQuickInfoOffset.spec.ts.snap +41 -0
  380. package/test/concepts/call-function/getQuickInfoOffset.spec.ts +19 -0
  381. package/test/concepts/call-interface/__snapshots__/getQuickInfoOffset.spec.ts.snap +86 -0
  382. package/test/concepts/call-interface/__snapshots__/toEmbeddedTS.spec.ts.snap +3 -3
  383. package/test/concepts/call-interface/getQuickInfoOffset.spec.ts +19 -0
  384. package/test/concepts/call-logic/getQuickInfoOffset.spec.ts +2 -7
  385. package/test/concepts/new-composite/__snapshots__/getQuickInfoOffset.spec.ts.snap +104 -0
  386. package/test/concepts/new-composite/__snapshots__/toEmbeddedTS.spec.ts.snap +97 -0
  387. package/test/concepts/new-composite/__snapshots__/toJS.spec.ts.snap +43 -0
  388. package/test/concepts/new-composite/constant.ts +5 -0
  389. package/test/concepts/new-composite/fixtures/nested-transform.json +241 -0
  390. package/test/concepts/new-composite/fixtures/nested.json +146 -0
  391. package/test/concepts/new-composite/fixtures/normal.json +63 -0
  392. package/test/concepts/new-composite/getQuickInfoOffset.spec.ts +19 -0
  393. package/test/concepts/new-composite/toEmbeddedTS.spec.ts +15 -0
  394. package/test/concepts/new-composite/toJS.spec.ts +14 -0
  395. package/test/concepts/new-list/__snapshots__/getQuickInfoOffset.spec.ts.snap +165 -0
  396. package/test/concepts/new-list/__snapshots__/toEmbeddedTS.spec.ts.snap +207 -0
  397. package/test/concepts/new-list/__snapshots__/toJS.spec.ts.snap +63 -0
  398. package/test/concepts/new-list/constant.ts +5 -0
  399. package/test/concepts/new-list/fixtures/nested-map.json +117 -0
  400. package/test/concepts/new-list/fixtures/nested-tranform.json +140 -0
  401. package/test/concepts/new-list/fixtures/nested.json +107 -0
  402. package/test/concepts/new-list/fixtures/normal.json +95 -0
  403. package/test/concepts/new-list/getQuickInfoOffset.spec.ts +19 -0
  404. package/test/concepts/new-list/toEmbeddedTS.spec.ts +15 -0
  405. package/test/concepts/new-list/toJS.spec.ts +14 -0
  406. package/test/concepts/new-map/__snapshots__/getQuickInfoOffset.spec.ts.snap +115 -0
  407. package/test/concepts/new-map/__snapshots__/toEmbeddedTS.spec.ts.snap +192 -0
  408. package/test/concepts/new-map/__snapshots__/toJS.spec.ts.snap +54 -0
  409. package/test/concepts/new-map/constant.ts +5 -0
  410. package/test/concepts/new-map/fixtures/nested-transform.json +169 -0
  411. package/test/concepts/new-map/fixtures/nested.json +141 -0
  412. package/test/concepts/new-map/fixtures/normal.json +101 -0
  413. package/test/concepts/new-map/getQuickInfoOffset.spec.ts +19 -0
  414. package/test/concepts/new-map/toEmbeddedTS.spec.ts +15 -0
  415. package/test/concepts/new-map/toJS.spec.ts +14 -0
  416. package/test/concepts/utils.ts +17 -0
@@ -1,6 +1,6 @@
1
1
  import type { Position, Range, TranslatorState } from './types';
2
- import TypeAnnotation from '../concepts/TypeAnnotation__';
3
- import App from '../concepts/App__';
2
+ import type TypeAnnotation from '../concepts/TypeAnnotation__';
3
+ import type App from '../concepts/App__';
4
4
  export declare function lsp2tspNumber(num: number): number;
5
5
  export declare const indent: (tabSize: number) => string;
6
6
  /**
@@ -4,14 +4,19 @@ exports.languageList = void 0;
4
4
  exports.languageList = [
5
5
  {
6
6
  id: 'en-US',
7
- name: 'English (United States)',
8
- title: '英语(美国)',
7
+ name: 'English',
8
+ title: '英语',
9
9
  },
10
10
  {
11
11
  id: 'fr-FR',
12
12
  name: 'Français',
13
13
  title: '法语',
14
14
  },
15
+ {
16
+ id: 'ko-KR',
17
+ name: '한국어',
18
+ title: '韩语',
19
+ },
15
20
  {
16
21
  id: 'zh-CN',
17
22
  name: '中文 (简体)',
@@ -1 +1 @@
1
- {"version":3,"file":"i18nInfo.js","sourceRoot":"","sources":["../../src/utils/i18nInfo.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,yBAAyB;QAC/B,KAAK,EAAE,QAAQ;KAChB;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,IAAI;KACZ;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,QAAQ;KAChB;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,QAAQ;KAChB;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,IAAI;KACZ;CACF,CAAC"}
1
+ {"version":3,"file":"i18nInfo.js","sourceRoot":"","sources":["../../src/utils/i18nInfo.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,IAAI;KACZ;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,IAAI;KACZ;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,IAAI;KACZ;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,QAAQ;KAChB;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,QAAQ;KAChB;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,IAAI;KACZ;CACF,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lcap/nasl",
3
3
  "description": "NetEase Application Specific Language",
4
- "version": "3.4.0-beta.8",
4
+ "version": "3.4.1-beta.1",
5
5
  "author": "Forrest <rainforest92@126.com>",
6
6
  "scripts": {
7
7
  "clear": "rimraf ./out",
@@ -1,8 +1,4 @@
1
- // import {
2
- // BaseNode,
3
- // Module
4
- // } from '../../concepts';
5
- import { BaseNode, uiStructures, collectionStructures, interfaceStructures, processStructures, getStdlibNamespace, coreStructures, httpStructures } from '../../concepts';
1
+ import { BaseNode, uiStructures, collectionStructures, interfaceStructures, processStructures, getStdlibNamespace, coreStructures, authStructures, httpStructures } from '../../concepts';
6
2
  import { getConceptMeta } from '../../decorators/index';
7
3
  /*
8
4
  根据 namespace 字符串来获取 node
@@ -1085,7 +1085,27 @@ export class BaseNode extends EventEmitter {
1085
1085
  });
1086
1086
  return JSON.parse(JSON.stringify(temp));
1087
1087
  }
1088
-
1088
+ // 给国际化展示用
1089
+ getNodeChinesePath(useIndex: boolean | string[] | NodePathOption) {
1090
+ let node: BaseNode = this;
1091
+ const pathArr: string[] = [];
1092
+ while (node && node.concept) {
1093
+ let pathText = '';
1094
+ const { parentNode } = node;
1095
+ if (parentNode) {
1096
+ const { name, title, label } = parentNode as any;
1097
+ pathText = `${(parentNode.constructor as any)?.nodeTitle || ''}${name || ''}`;
1098
+ if (title && label) {
1099
+ pathText += `(${title} | ${label})`;
1100
+ } else if (title || label) {
1101
+ pathText += `(${title || label})`;
1102
+ }
1103
+ pathArr.unshift(pathText);
1104
+ }
1105
+ node = parentNode;
1106
+ }
1107
+ return pathArr.join('/');
1108
+ }
1089
1109
  /**
1090
1110
  * 查找引用
1091
1111
  */
@@ -1311,6 +1331,7 @@ export class BaseNode extends EventEmitter {
1311
1331
  * 迭代所有属性
1312
1332
  *
1313
1333
  * @description 是所有属性!!不是所有子节点!!
1334
+ * @deprecated 请使用`traverseStrictChildren`方法
1314
1335
  */
1315
1336
  traverseChildren(cb: (el: any) => void): void {
1316
1337
  function traverse(node: any) {
@@ -1518,7 +1539,7 @@ export class BaseNode extends EventEmitter {
1518
1539
  nodes.push(self);
1519
1540
  }
1520
1541
 
1521
- this.traverseChildren((current) => {
1542
+ this.traverseStrictChildren((current) => {
1522
1543
  if (pre(current)) {
1523
1544
  nodes.push(current);
1524
1545
  }
@@ -321,12 +321,20 @@ export class BackendVariable extends BaseNode {
321
321
  toJS(state?: TranslatorState): string {
322
322
  const context = this.view ? 'this' : 'Vue.prototype';
323
323
  const typeAnnotation = this.typeAnnotation || this.__TypeAnnotation;
324
+ let { sortedTypeKey, typeKind, typeName, typeNamespace } = typeAnnotation || {};
325
+ if (typeNamespace?.endsWith('.metadataTypes')) {
326
+ const referenceNode = this.app.findNodeByCompleteName(typeNamespace + '.' + typeName) || {};
327
+ const typeAn = referenceNode.typeAnnotation || {};
328
+ sortedTypeKey = `${typeAn.typeNamespace}.${typeAn.typeName}`;
329
+ typeKind = typeAn.typeKind;
330
+ typeName = typeAn.typeName;
331
+ }
324
332
  const needGenInitFromSchema =
325
333
  typeAnnotation &&
326
- (!['primitive', 'union'].includes(typeAnnotation.typeKind) || typeAnnotation.typeName === 'DateTime');
334
+ (!['primitive', 'union'].includes(typeKind) || typeName === 'DateTime');
327
335
  let code = `${this.name} =`;
328
336
  if (needGenInitFromSchema) {
329
- code += `${context}.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}',`;
337
+ code += `${context}.$genInitFromSchema('${sortedTypeKey}',`;
330
338
  }
331
339
 
332
340
  if (this.defaultValue?.expression) {
@@ -1,4 +1,3 @@
1
- import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
2
1
  import {
3
2
  TranslatorState,
4
3
  shiftState,
@@ -9,6 +8,7 @@ import {
9
8
  TranslatorGenerator,
10
9
  } from '../translator';
11
10
  import { ElementToVueOptions } from './ViewElement__';
11
+ import { getCallExpressionQuickInfo, Range, GetCode } from './utils/quick-info';
12
12
 
13
13
  const operatorMap = {
14
14
  '&&': 'and',
@@ -475,6 +475,10 @@ export class BinaryExpression extends LogicItem {
475
475
  return code;
476
476
  }
477
477
 
478
+ getQuickInfoOffset(range: Range, getCode: GetCode) {
479
+ return getCallExpressionQuickInfo(range, getCode);
480
+ }
481
+
478
482
  //================================================================================
479
483
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
480
484
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -1168,6 +1168,8 @@ export class BindAttribute extends BaseNode {
1168
1168
  type = `${self.value}`.includes('.') ? 'nasl.core.Decimal' : 'nasl.core.Long';
1169
1169
  } else if (typeof self.value === 'boolean') {
1170
1170
  type = 'nasl.core.Boolean';
1171
+ } else if (['page-size', 'page-number'].includes(self.name) && self.value === null) {
1172
+ type = 'nasl.core.Long'
1171
1173
  }
1172
1174
  code += `${type}`;
1173
1175
  } else {
@@ -11,6 +11,7 @@ import {
11
11
  withGenerator,
12
12
  TranslatorGenerator,
13
13
  } from '../translator';
14
+ import { getCallExpressionQuickInfo, Range, GetCode } from './utils/quick-info';
14
15
  import type Function from './Function__';
15
16
  import { ElementToVueOptions } from './ViewElement__';
16
17
  import type Identifier from './Identifier__';
@@ -526,10 +527,18 @@ export class CallFunction extends LogicItem {
526
527
 
527
528
  code += ')';
528
529
  const tyAnno = (this as any).typeAnnotation || this.__TypeAnnotation;
530
+ let { sortedTypeKey, typeKind, typeName, typeNamespace } = tyAnno || {};
531
+ if (typeNamespace?.endsWith('.metadataTypes')) {
532
+ const referenceNode = this.app.findNodeByCompleteName(typeNamespace + '.' + typeName) || {};
533
+ const typeAn = referenceNode.typeAnnotation || {};
534
+ sortedTypeKey = `${typeAn.typeNamespace}.${typeAn.typeName}`;
535
+ typeKind = typeAn.typeKind;
536
+ typeName = typeAn.typeName;
537
+ }
529
538
  const needGenInitFromSchema =
530
- tyAnno && (!['primitive', 'union'].includes(tyAnno.typeKind) || tyAnno.typeName === 'DateTime');
539
+ tyAnno && (!['primitive', 'union'].includes(typeKind) || typeName === 'DateTime');
531
540
  if (needGenInitFromSchema) {
532
- code = `this.$genInitFromSchema('${tyAnno?.sortedTypeKey}', ${code})`;
541
+ code = `this.$genInitFromSchema('${sortedTypeKey}', ${code})`;
533
542
  }
534
543
  return code;
535
544
  }
@@ -721,6 +730,10 @@ export class CallFunction extends LogicItem {
721
730
  fn.checkParamName();
722
731
  });
723
732
  }
733
+
734
+ getQuickInfoOffset(range: Range, getCode: GetCode) {
735
+ return getCallExpressionQuickInfo(range, getCode);
736
+ }
724
737
  //================================================================================
725
738
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
726
739
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -19,6 +19,7 @@ import type { MemberExpression } from './MemberExpression__';
19
19
  import type Frontend from './Frontend__';
20
20
  import type Connector from './Connector__';
21
21
  import { CUSTOM_CONNECTOR_EDITABLE_SUFFIX } from './basics/constants';
22
+ import { getCallExpressionQuickInfo, Range, GetCode } from './utils/quick-info';
22
23
 
23
24
  //================================================================================
24
25
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
@@ -722,7 +723,7 @@ export class CallInterface extends LogicItem {
722
723
  const idx = logicParam.findIndex((params) => arg.keyword === params.name);
723
724
  const param = logicParam[idx];
724
725
 
725
- arg.paramRequired = Boolean(!param?.defaultValue?.expression);
726
+ arg.paramRequired = param?.required;
726
727
  arg.paramTypeAnnotation = undefined;
727
728
  arg.paramDefaultValue = undefined;
728
729
  // 取到是不是必填放入参数中
@@ -897,6 +898,10 @@ export class CallInterface extends LogicItem {
897
898
  get integration() {
898
899
  return this.getAncestor('Integration');
899
900
  }
901
+
902
+ getQuickInfoOffset(range: Range, getCode: GetCode) {
903
+ return getCallExpressionQuickInfo(range, getCode);
904
+ }
900
905
  //================================================================================
901
906
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
902
907
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -15,8 +15,7 @@ import type Param from './Param__';
15
15
  import type View from './View__';
16
16
  import { getNodeByNodeCallee, getNaslNodeByNodeCallee } from '../automate/engine/utils';
17
17
  import { findConceptKeyWordIndexFromNamespace } from '../utils';
18
- import { config } from '../config';
19
- import type Identifier from './Identifier__';
18
+ import { getCallExpressionQuickInfo, GetCode, Range } from './utils/quick-info';
20
19
  import type { ViewElement, ElementToVueOptions } from './ViewElement__';
21
20
  import type { MemberExpression } from './MemberExpression__';
22
21
 
@@ -774,23 +773,23 @@ export class CallLogic extends LogicItem {
774
773
  code += calleeName;
775
774
  }
776
775
  return code;
777
- } else if (bindAttr?.name === 'text') {
778
- if (calleeName === 'jsonSerialize') {
779
- if (
780
- this.arguments[0]?.expression?.__TypeAnnotation?.typeName === 'String' &&
781
- this.arguments[0]?.expression?.__TypeAnnotation?.typeNamespace === 'nasl.core'
782
- ) {
783
- code += options?.finalCode === false ? 'JSON 序列化' : 'JSON.stringify';
784
- } else {
785
- code += options?.finalCode === false ? 'JSON 序列化' : `$utils['JsonSerialize']`;
786
- }
787
- setArguments();
788
- return code;
789
- } else if (calleeName === 'jsonDeserialize') {
790
- code += options?.finalCode === false ? 'JSON 反序列化' : 'JSON.parse';
791
- setArguments();
792
- return code;
776
+ }
777
+ if (calleeName === 'jsonSerialize') {
778
+ if (
779
+ this.arguments[0]?.expression?.__TypeAnnotation?.typeName === 'String' &&
780
+ this.arguments[0]?.expression?.__TypeAnnotation?.typeNamespace === 'nasl.core'
781
+ ) {
782
+ code += options?.finalCode === false ? 'JSON 序列化' : 'JSON.stringify';
783
+ } else {
784
+ code += options?.finalCode === false ? 'JSON 序列化' : `$utils['JsonSerialize']`;
793
785
  }
786
+ setArguments();
787
+ return code;
788
+ }
789
+ if (calleeName === 'jsonDeserialize') {
790
+ code += options?.finalCode === false ? 'JSON 反序列化' : 'JSON.parse';
791
+ setArguments();
792
+ return code;
794
793
  }
795
794
  }
796
795
 
@@ -816,12 +815,11 @@ export class CallLogic extends LogicItem {
816
815
 
817
816
  if (bindAttr?.name === 'data-source') {
818
817
  return this.calleeName;
819
- } else if (bindAttr?.name === 'text') {
820
- if (calleeName === 'jsonSerialize') {
821
- return 'JSON 序列化';
822
- } else if (calleeName === 'jsonDeserialize') {
823
- return 'JSON 反序列化';
824
- }
818
+ }
819
+ if (calleeName === 'jsonSerialize') {
820
+ return 'JSON 序列化';
821
+ } if (calleeName === 'jsonDeserialize') {
822
+ return 'JSON 反序列化';
825
823
  }
826
824
  }
827
825
 
@@ -1194,11 +1192,17 @@ export class CallLogic extends LogicItem {
1194
1192
  };
1195
1193
  }
1196
1194
  const typeAnnotation = (this as any).typeAnnotation || this.__TypeAnnotation;
1197
- const needGenInitFromSchema =
1198
- typeAnnotation &&
1199
- (!['primitive', 'union'].includes(typeAnnotation.typeKind) || typeAnnotation.typeName === 'DateTime');
1195
+ let { sortedTypeKey, typeKind, typeName, typeNamespace } = typeAnnotation || {};
1196
+ if (typeNamespace?.endsWith('.metadataTypes')) {
1197
+ const referenceNode = this.app.findNodeByCompleteName(typeNamespace + '.' + typeName) || {};
1198
+ const typeAn = referenceNode.typeAnnotation || {};
1199
+ sortedTypeKey = `${typeAn.typeNamespace}.${typeAn.typeName}`;
1200
+ typeKind = typeAn.typeKind;
1201
+ typeName = typeAn.typeName;
1202
+ }
1203
+ const needGenInitFromSchema = typeAnnotation && (!['primitive', 'union'].includes(typeKind) || typeName === 'DateTime');
1200
1204
  if (needGenInitFromSchema) {
1201
- code = `this.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}', ${code})`;
1205
+ code = `this.$genInitFromSchema('${sortedTypeKey}', ${code})`;
1202
1206
  }
1203
1207
  code += ')';
1204
1208
  return code;
@@ -1515,41 +1519,21 @@ export class CallLogic extends LogicItem {
1515
1519
  }
1516
1520
 
1517
1521
  /** 获取类型标注时的偏移量 */
1518
- getQuickInfoOffset(detail: TSPPosition, code: string): TSPPosition {
1522
+ getQuickInfoOffset(range: Range, getCode: GetCode) {
1519
1523
  if (this.useIife) {
1520
1524
  const characterOffset = 8;
1525
+ const code = getCode();
1521
1526
  const lines = code.split('\n');
1522
1527
  const lineOffset = lines.findIndex((item) => item.startsWith('return wrapper'));
1523
1528
 
1524
1529
  return {
1525
- line: detail.line + lineOffset,
1530
+ line: range.start.line + lineOffset + 1,
1526
1531
  offset: characterOffset,
1527
1532
  };
1528
1533
  }
1529
- let indexOf = 0;
1530
-
1531
- // 没有括号,表示括号在外面
1532
- if (!code.includes('(')) {
1533
- indexOf = -1;
1534
- }
1535
- // 有括号就找到括号的位置
1536
1534
  else {
1537
- // 如果有泛型先往前找一找
1538
- if (code.includes('<')) {
1539
- indexOf = Math.min(code.indexOf('<'), code.indexOf('('));
1540
- } else {
1541
- indexOf = code.indexOf('(');
1542
- }
1543
- const subStr = code.substring(0, indexOf);
1544
- const codeArr = subStr?.split('.');
1545
- const lastLen = codeArr?.[codeArr.length - 1]?.length;
1546
- indexOf = subStr.length - lastLen;
1535
+ return getCallExpressionQuickInfo(range, getCode);
1547
1536
  }
1548
-
1549
- return {
1550
- ...detail,
1551
- offset: detail.offset + indexOf,
1552
- };
1553
1537
  }
1554
1538
 
1555
1539
  /**
@@ -697,13 +697,13 @@ export class Destination extends LogicItem {
697
697
  }
698
698
 
699
699
  @withSourceMapGenerator
700
- *toEmbeddedTSInProcess(state = createCompilerState(), prependCode: string): TranslatorGenerator {
700
+ *toEmbeddedTSInProcess(state = createCompilerState(), prevCode: string): TranslatorGenerator {
701
701
  const self = this;
702
702
  // const tab = indent((state?.tabSize || 0));
703
703
  if (self.tsCalleeNamespace && self.tsName) {
704
704
  const destinationName = self.parentNode.name.replace('-', '_');
705
705
  let code = `${destinationName}: function() {\n`;
706
- code += prependCode;
706
+ code += prevCode;
707
707
  code += '\n';
708
708
  if (self.tsCalleeNamespace && self.viewName) {
709
709
  code += `${self.tsCalleeNamespace}.${self.viewName}.$destination({`;
@@ -1832,15 +1832,16 @@ export class Logic extends BaseNode {
1832
1832
  // 没有参数的
1833
1833
  code += '()';
1834
1834
  }
1835
- // 需要类型推导的局部变量/返回值需要调整申明顺序
1835
+ // 需要类型推导的局部变量/返回值需要进行变量提升,声明在前
1836
1836
  const advanceMap: Map<Return | Variable, Assignment | BatchAssignment> = new Map();
1837
- // const needGetSourceMapOqlList: Promise<any>[] = [];
1838
1837
  yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
1839
- if (el && (asserts.isBatchAssignment(el) || (asserts.isAssignment(el) && el.left?.name))) {
1838
+ if (isInPlayground(el)) {
1839
+ // 若当前节点在草稿中,无须提升并忽略
1840
+ return;
1841
+ }
1842
+ if ((asserts.isBatchAssignment(el) || (asserts.isAssignment(el) && el.left?.name))) {
1840
1843
  if (asserts.isAssignment(el)) {
1841
- const advanceVar = self.variables?.find(
1842
- (variable) => !variable.typeAnnotation && el.left?.name === variable.name,
1843
- );
1844
+ const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && el.left?.name === variable.name);
1844
1845
  if (advanceVar && !advanceMap.get(advanceVar)) {
1845
1846
  advanceMap.set(advanceVar, el);
1846
1847
  }
@@ -1849,23 +1850,35 @@ export class Logic extends BaseNode {
1849
1850
  advanceMap.set(advanceRn, el);
1850
1851
  }
1851
1852
  } else if (asserts.isBatchAssignment(el)) {
1852
- yield* wrapForEach(el.assignmentLines, function* warpForEachGenerator({ leftIndex }) {
1853
- const leftCode =
1854
- leftIndex.length === 1
1855
- ? yield* el.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
1856
- : yield* el.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
1857
- returnOrigin('');
1858
- const advanceVar = self.variables?.find(
1859
- (variable) => !variable.typeAnnotation && leftCode === variable.name,
1860
- );
1861
- if (advanceVar && !advanceMap.get(advanceVar)) {
1862
- advanceMap.set(advanceVar, el);
1863
- }
1864
- const advanceRn = self.returns?.find((ret) => !ret.typeAnnotation && leftCode === ret.name);
1865
- if (advanceRn && !advanceMap.get(advanceRn)) {
1866
- advanceMap.set(advanceRn, el);
1853
+ yield *
1854
+ wrapForEach(el.assignmentLines, function* warpForEachGenerator({ leftIndex }) {
1855
+ const leftCode =
1856
+ leftIndex.length === 1
1857
+ ? yield* el.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
1858
+ : yield* el.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ?? returnOrigin('');
1859
+ const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && leftCode === variable.name);
1860
+ if (advanceVar && !advanceMap.get(advanceVar)) {
1861
+ advanceMap.set(advanceVar, el);
1862
+ }
1863
+ const advanceRn = self.returns?.find((ret) => !ret.typeAnnotation && leftCode === ret.name);
1864
+ if (advanceRn && !advanceMap.get(advanceRn)) {
1865
+ advanceMap.set(advanceRn, el);
1866
+ }
1867
+ });
1868
+ }
1869
+ }
1870
+
1871
+ function isInPlayground(node: types.SyntaxNode) {
1872
+ while (node) {
1873
+ const parent = node.parentNode;
1874
+ if (parent) {
1875
+ if (asserts.isLogic(parent) && node.parentKey === 'playground') {
1876
+ return true;
1867
1877
  }
1868
- });
1878
+ node = node.parentNode;
1879
+ } else {
1880
+ return false;
1881
+ }
1869
1882
  }
1870
1883
  }
1871
1884
  });
@@ -276,7 +276,7 @@ export class MemberExpression extends LogicItem {
276
276
  (this.object as Identifier)?.isEnum() &&
277
277
  this.property?.concept === 'Identifier'
278
278
  ) {
279
- return this.isDefaultValueExpression() ? this.property?.name : `"${this.property?.name}"`;
279
+ return this.isDefaultValueExpression(!!state?.getVuePrototype) ? this.property?.name : `"${this.property?.name}"`;
280
280
  }
281
281
  if (
282
282
  this.object?.__TypeAnnotation?.sortedTypeKey?.startsWith('nasl.collection.Map') &&
@@ -379,8 +379,8 @@ export class MemberExpression extends LogicItem {
379
379
  return (this.object as Identifier)?.isEnum?.();
380
380
  }
381
381
 
382
- isDefaultValueExpression() {
383
- return this.parentNode instanceof DefaultValue;
382
+ isDefaultValueExpression(getVuePrototype: boolean) {
383
+ return this.parentNode instanceof DefaultValue && getVuePrototype;
384
384
  }
385
385
 
386
386
  // 方便快速取值,遍历获取value
@@ -9,13 +9,9 @@ import {
9
9
  withGenerator,
10
10
  TranslatorGenerator,
11
11
  } from '../translator';
12
- import { ElementToVueOptions } from './ViewElement__';
13
12
  import type MemberExpression from './MemberExpression__';
14
- import type StructureProperty from './StructureProperty__';
15
- import type App from './App__';
16
- import { genHash } from '../generator';
17
13
  import type ForEachStatement from './ForEachStatement__';
18
- import type Logic from './Logic__';
14
+ import { getNewCompositeQuickInfo, GetCode, Range } from './utils/quick-info';
19
15
  //================================================================================
20
16
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
21
17
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -1607,6 +1603,10 @@ export class NewComposite extends LogicItem {
1607
1603
  }
1608
1604
  return code;
1609
1605
  }
1606
+
1607
+ getQuickInfoOffset(range: Range, getCode: GetCode) {
1608
+ return getNewCompositeQuickInfo(this.concept, range, getCode);
1609
+ }
1610
1610
  //================================================================================
1611
1611
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
1612
1612
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -1,4 +1,4 @@
1
- import { wrapForEachToGenerator as wrapForEach, runGeneratorSync as runSync } from '../utils/time-slicing';
1
+ import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
2
2
  import {
3
3
  TranslatorState,
4
4
  shiftState,
@@ -10,7 +10,7 @@ import {
10
10
  TranslatorGenerator,
11
11
  } from '../translator';
12
12
  import type ForEachStatement from './ForEachStatement__';
13
- import type Logic from './Logic__';
13
+ import { getNewCompositeQuickInfo, GetCode, Range } from './utils/quick-info';
14
14
  //================================================================================
15
15
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
16
16
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -558,6 +558,10 @@ export class NewList extends LogicItem {
558
558
  }
559
559
  return code;
560
560
  }
561
+
562
+ getQuickInfoOffset(range: Range, getCode: GetCode) {
563
+ return getNewCompositeQuickInfo(this.concept, range, getCode);
564
+ }
561
565
  //================================================================================
562
566
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
563
567
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -1,4 +1,4 @@
1
- import { wrapForEachToGenerator as wrapForEach, runGeneratorSync as runSync } from '../utils/time-slicing';
1
+ import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
2
2
  import {
3
3
  TranslatorState,
4
4
  shiftState,
@@ -9,9 +9,8 @@ import {
9
9
  withGenerator,
10
10
  TranslatorGenerator,
11
11
  } from '../translator';
12
- import { ElementToVueOptions } from './ViewElement__';
13
12
  import type ForEachStatement from './ForEachStatement__';
14
- import type Logic from './Logic__';
13
+ import { getNewCompositeQuickInfo, GetCode, Range } from './utils/quick-info';
15
14
  //================================================================================
16
15
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
17
16
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -802,6 +801,10 @@ export class NewMap extends LogicItem {
802
801
  }
803
802
  return code;
804
803
  }
804
+
805
+ getQuickInfoOffset(range: Range, getCode: GetCode) {
806
+ return getNewCompositeQuickInfo(this.concept, range, getCode);
807
+ }
805
808
  //================================================================================
806
809
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
807
810
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -361,17 +361,25 @@ export class Param extends BaseNode {
361
361
  toJS(state?: TranslatorState): string {
362
362
  if (this.view) {
363
363
  const typeAnnotation = this.typeAnnotation || this.__TypeAnnotation;
364
+ let { sortedTypeKey, typeKind, typeName, typeNamespace } = typeAnnotation || {};
365
+ if (typeNamespace?.endsWith('.metadataTypes')) {
366
+ const referenceNode = this.app.findNodeByCompleteName(typeNamespace + '.' + typeName) || {};
367
+ const typeAn = referenceNode.typeAnnotation || {};
368
+ sortedTypeKey = `${typeAn.typeNamespace}.${typeAn.typeName}`;
369
+ typeKind = typeAn.typeKind;
370
+ typeName = typeAn.typeName;
371
+ }
364
372
  const needGenInitFromSchema =
365
373
  typeAnnotation &&
366
- (!['primitive', 'union'].includes(typeAnnotation.typeKind) || typeAnnotation.typeName === 'DateTime');
374
+ (!['primitive', 'union'].includes(typeKind) || typeName === 'DateTime');
367
375
  let code = `${this.name} = `;
368
376
  if (needGenInitFromSchema) {
369
- code += `this.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}',`;
377
+ code += `this.$genInitFromSchema('${sortedTypeKey}',`;
370
378
  }
371
379
 
372
380
  const expressionJS = this.defaultValue?.toJS?.();
373
381
 
374
- code += `${this.name} || (this.$route.query.hasOwnProperty('${this.name}') ? this.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}', this.$route.query.${this.name}) : ${expressionJS})`;
382
+ code += `${this.name} || (this.$route.query.hasOwnProperty('${this.name}') ? this.$genInitFromSchema('${sortedTypeKey}', this.$route.query.${this.name}) : ${expressionJS})`;
375
383
  if (needGenInitFromSchema) {
376
384
  code += `)`;
377
385
  }
@@ -1915,7 +1915,14 @@ export class ProcessElement extends BaseNode {
1915
1915
  if (Array.isArray(self.bindEvents)) {
1916
1916
  yield* wrapForEach(self.bindEvents, function* warpForEachGenerator(bindEvent) {
1917
1917
  // 任务完成时可以拿到输出参数
1918
- const currentPrevCode = bindEvent.name === 'OnClose' ? prevCodeClose : prevCode;
1918
+ let currentPrevCode: any;
1919
+ if(bindEvent.name !== 'OnClose') {
1920
+ currentPrevCode = prevCode;
1921
+ // 除了任务完成时的逻辑,其他逻辑拿不到自己任务下的输出参数,所以不需要__ProcessIdentification__标注
1922
+ currentPrevCode = currentPrevCode.replace('__ProcessIdentification__', '');
1923
+ } else {
1924
+ currentPrevCode = prevCodeClose;
1925
+ }
1919
1926
  code += `${tab1}${bindEvent.name}: () => [\n`;
1920
1927
  yield* wrapForEach(bindEvent.logics, function* warpForEachGenerator(logic) {
1921
1928
  code += `${yield* logic.toEmbeddedTSInProcess(
@@ -322,12 +322,20 @@ export class Return extends BaseNode {
322
322
  toJS(state?: TranslatorState): string {
323
323
  const context = this.view ? 'this' : 'Vue.prototype';
324
324
  const typeAnnotation = this.typeAnnotation || this.__TypeAnnotation;
325
+ let { sortedTypeKey, typeKind, typeName, typeNamespace } = typeAnnotation || {};
326
+ if (typeNamespace?.endsWith('.metadataTypes')) {
327
+ const referenceNode = this.app.findNodeByCompleteName(typeNamespace + '.' + typeName) || {};
328
+ const typeAn = referenceNode.typeAnnotation || {};
329
+ sortedTypeKey = `${typeAn.typeNamespace}.${typeAn.typeName}`;
330
+ typeKind = typeAn.typeKind;
331
+ typeName = typeAn.typeName;
332
+ }
325
333
  const needGenInitFromSchema =
326
334
  typeAnnotation &&
327
- (!['primitive', 'union'].includes(typeAnnotation.typeKind) || typeAnnotation.typeName === 'DateTime');
335
+ (!['primitive', 'union'].includes(typeKind) || typeName === 'DateTime');
328
336
  let code = `${this.name} = `;
329
337
  if (needGenInitFromSchema) {
330
- code += `${context}.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}',`;
338
+ code += `${context}.$genInitFromSchema('${sortedTypeKey}',`;
331
339
  }
332
340
 
333
341
  if (this.defaultValue?.expression) {