@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
@@ -342,12 +342,20 @@ export class Variable extends BaseNode {
342
342
  toJS(state?: TranslatorState): string {
343
343
  const context = this.view ? 'this' : 'Vue.prototype';
344
344
  const typeAnnotation = this.typeAnnotation || this.__TypeAnnotation;
345
+ let { sortedTypeKey, typeKind, typeName, typeNamespace } = typeAnnotation || {};
346
+ if (typeNamespace?.endsWith('.metadataTypes')) {
347
+ const referenceNode = this.app.findNodeByCompleteName(typeNamespace + '.' + typeName) || {};
348
+ const typeAn = referenceNode.typeAnnotation || {};
349
+ sortedTypeKey = `${typeAn.typeNamespace}.${typeAn.typeName}`;
350
+ typeKind = typeAn.typeKind;
351
+ typeName = typeAn.typeName;
352
+ }
345
353
  const needGenInitFromSchema =
346
354
  typeAnnotation &&
347
- (!['primitive', 'union'].includes(typeAnnotation.typeKind) || typeAnnotation.typeName === 'DateTime');
355
+ (!['primitive', 'union'].includes(typeKind) || typeName === 'DateTime');
348
356
  let code = `${this.name} = `;
349
357
  if (needGenInitFromSchema) {
350
- code += `${context}.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}',`;
358
+ code += `${context}.$genInitFromSchema('${sortedTypeKey}',`;
351
359
  }
352
360
 
353
361
  if (this.defaultValue?.expression) {
@@ -1718,7 +1718,7 @@ export class ViewElement extends BaseNode {
1718
1718
  }>`;
1719
1719
  } else {
1720
1720
  let targetNode: any = _this;
1721
- while (!targetNode.__tsVariableDataSourceTypeName && asserts.isViewElement(targetNode?.parentNode)) {
1721
+ while ((!targetNode.__tsVariableDataSourceTypeName || targetNode.__tsVariableDataSourceTypeName === 'any') && asserts.isViewElement(targetNode?.parentNode)) {
1722
1722
  targetNode = targetNode.parentNode;
1723
1723
  }
1724
1724
  genericity += `<${(targetNode as any).__tsVariableDataSourceTypeName ?? 'any'}>`;
@@ -2861,7 +2861,16 @@ export class ViewElement extends BaseNode {
2861
2861
  { node: this },
2862
2862
  );
2863
2863
  }
2864
-
2864
+ // 查找element下有没有某个类型的元素,有就返回
2865
+ findElementItem(conceptName: string): ViewElement {
2866
+ return utils.traverse(
2867
+ (current) => {
2868
+ if (current.node.concept === conceptName) return current.node;
2869
+ },
2870
+ { node: this },
2871
+ { mode: 'anyObject', excludedKeySet: this.JSON_EXCLUDED_KEYS }
2872
+ );
2873
+ }
2865
2874
  @excludedInJSON()
2866
2875
  computedStyle: object = {};
2867
2876
  getCurrentName() {
@@ -1867,7 +1867,7 @@ export class View extends BaseNode {
1867
1867
  logics: [newLogic],
1868
1868
  },
1869
1869
  this,
1870
- 'events',
1870
+ 'bindEvents',
1871
1871
  );
1872
1872
  this.addBindEvent(event);
1873
1873
  } else {
@@ -0,0 +1,64 @@
1
+ import { Range } from '../../translator';
2
+
3
+ export { Range } from '../../translator';
4
+
5
+ /** 获取当前代码 */
6
+ export type GetCode = () => string;
7
+
8
+ export interface QuickInfoData {
9
+ /** 行 */
10
+ line: number;
11
+ /** 列 */
12
+ offset: number;
13
+ }
14
+
15
+ export type GetQuickInfoOffset = (range: Range, getCode: GetCode) => QuickInfoData;
16
+
17
+ export function getCallExpressionQuickInfo(range: Range, getCode: GetCode) {
18
+ const code = getCode();
19
+ const data: QuickInfoData = {
20
+ line: range.start.line + 1,
21
+ offset: range.start.character + 1,
22
+ };
23
+
24
+ // 如果没有括号 ,括号就在外面,就 -1
25
+ // 有括号就找到括号的位置 然后 -1
26
+ let indexOf = 0;
27
+ if (!code.includes('(')) {
28
+ indexOf = -1;
29
+ }
30
+ // 如果有泛型先往前找一找
31
+ else {
32
+ if (code.includes('<')) {
33
+ indexOf = Math.min(code.indexOf('<'), code.indexOf('('));
34
+ } else {
35
+ indexOf = code.indexOf('(');
36
+ }
37
+ const subStr = code.substring(0, indexOf);
38
+ const codeArr = subStr?.split('.');
39
+ const lastLen = codeArr?.[codeArr.length - 1]?.length;
40
+ indexOf = subStr.length - lastLen;
41
+ }
42
+ data.offset += indexOf;
43
+ return data;
44
+ }
45
+
46
+ export function getNewCompositeQuickInfo(concept: 'NewComposite' | 'NewList' | 'NewMap', range: Range, getCode: GetCode): QuickInfoData {
47
+ const type = {
48
+ 'NewComposite': '__newComposite',
49
+ 'NewList': '__newList',
50
+ 'NewMap': '__newMap',
51
+ }[concept];
52
+ const code = getCode();
53
+ const data: QuickInfoData = {
54
+ line: range.end.line,
55
+ offset: range.end.character,
56
+ };
57
+
58
+ const indexOf = code.lastIndexOf(`return ${type}`);
59
+ let newCode = code.substring(0, indexOf);
60
+ newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
61
+ data.offset = newCode.length + 'return '.length;
62
+
63
+ return data;
64
+ }
@@ -32,6 +32,7 @@ interface Config {
32
32
  tenantType: any;
33
33
  tenantLevel: any;
34
34
  appid: string;
35
+ isExport?:string;
35
36
  devDnsAddr: string;
36
37
  miniEnable: boolean;
37
38
  }
@@ -44,7 +45,7 @@ function stringifyMetaData(obj: any) {
44
45
  // 处理数组类型
45
46
  const elements: string[] = obj.map(element => stringifyMetaData(element));
46
47
  return `[${elements.join(',')}]`;
47
- }
48
+ }
48
49
  let newObj = obj;
49
50
  const properties: string[] = [];
50
51
  if (obj instanceof FrontendVariable) {
@@ -64,7 +65,7 @@ function stringifyMetaData(obj: any) {
64
65
  return `{
65
66
  ${properties.join(',')}
66
67
  }`;
67
- }
68
+ }
68
69
  return JSON5.stringify(obj);
69
70
  }
70
71
 
@@ -596,7 +597,11 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
596
597
  `;
597
598
  content += str;
598
599
  }
599
- const baseUrl = `${config.USER_STATIC_URL}/${config.tenant}/${app.id}/${config.env}`;
600
+ let baseUrl = `${config.USER_STATIC_URL}/${config.tenant}/${app.id}/${config.env}`;
601
+
602
+ if((config.isExport)as any){
603
+ baseUrl = '';
604
+ }
600
605
  let bundleMinPath = `${baseUrl}/bundle.${genHash(content)}.min.js`;
601
606
  if (frontend.basePath) {
602
607
  bundleMinPath = `${baseUrl}${frontend.basePath}/bundle.${genHash(content)}.min.js`;
@@ -267,7 +267,7 @@ export function syncMemberExpression(elem: ProcessElement | Process, callback: (
267
267
  }
268
268
  });
269
269
  }
270
- if (el.type === 'ExclusiveGateway' || el.type === 'AutoTask') {
270
+ if (['ExclusiveGateway', 'AutoTask', 'InclusiveGateway'].includes(el.type)) {
271
271
  travelDown(el.logic, (node) => {
272
272
  if (node instanceof MemberExpression) {
273
273
  callback(node);
@@ -435,7 +435,7 @@ export function getProcessVariableSuggestions(node: LogicItem, abandonConstant:
435
435
  ],
436
436
  });
437
437
  processVariables.icon = 'Process';
438
- if (processElem.type === 'ExclusiveGateway') {
438
+ if (['ExclusiveGateway', 'InclusiveGateway'].includes(processElem.type)) {
439
439
  const scopeVariable = new CompletionProperty({
440
440
  name: processElem.name,
441
441
  value: processElem.name,
@@ -589,7 +589,7 @@ export function getProcessVariableSuggestionsAll(node: ProcessElement, exitConst
589
589
  });
590
590
  processVariables.expanded = true;
591
591
  processVariables.icon = 'Process';
592
- if (processElem.type === 'ExclusiveGateway') {
592
+ if (['ExclusiveGateway', 'AutoTask', 'InclusiveGateway'].includes(processElem.type)) {
593
593
  const scopeVariable = new CompletionProperty({
594
594
  name: processElem.name,
595
595
  value: processElem.name,
@@ -108,6 +108,7 @@ import { EventEmitter } from '../common/EventEmitter';
108
108
  import { traverse, FileNode } from '../utils';
109
109
  import { withQueueExecute } from '../decorators';
110
110
  import { getNodeByNodeCallee } from '../automate/engine/utils';
111
+ import { isConnection, isConnector } from '../concepts/utils/asserts';
111
112
 
112
113
  const EmbeddedTSFileLineMap: { [name: string]: number } = {
113
114
  Entity: 3,
@@ -3121,6 +3122,9 @@ class NaslServer {
3121
3122
  );
3122
3123
  const results = await Promise.all(promises);
3123
3124
  results.forEach((constRefs) => {
3125
+ if(constRefs.symbolDisplayString.includes('(parameter)')) {
3126
+ return;
3127
+ }
3124
3128
  refsList = [...refsList, ...constRefs.refs];
3125
3129
  });
3126
3130
  }
@@ -4090,7 +4094,7 @@ class NaslServer {
4090
4094
 
4091
4095
  // 位置计算偏移
4092
4096
  if ('getQuickInfoOffset' in node) {
4093
- Object.assign(fileDetail, (node as any).getQuickInfoOffset(fileDetail, getCode(item)));
4097
+ Object.assign(fileDetail, (node as any).getQuickInfoOffset(item, () => getCode(item)));
4094
4098
  }
4095
4099
 
4096
4100
  yield;
@@ -4098,30 +4102,6 @@ class NaslServer {
4098
4102
  // 位置计算偏移2
4099
4103
  // TODO: 之后考虑把这些偏移量计算全都挪到节点内部去
4100
4104
  if (
4101
- node.concept === 'BinaryExpression' ||
4102
- node.concept === 'CallFunction' ||
4103
- node.concept === 'CallInterface'
4104
- ) {
4105
- const code = getCode(item);
4106
- // 如果没有括号 ,括号就在外面,就 -1
4107
- // 有括号就找到括号的位置 然后 -1
4108
- let indexOf = 0;
4109
- if (!code.includes('(')) {
4110
- indexOf = -1;
4111
- } else {
4112
- // 如果有泛型先往前找一找
4113
- if (code.includes('<')) {
4114
- indexOf = Math.min(code.indexOf('<'), code.indexOf('('));
4115
- } else {
4116
- indexOf = code.indexOf('(');
4117
- }
4118
- const subStr = code.substring(0, indexOf);
4119
- const codeArr = subStr?.split('.');
4120
- const lastLen = codeArr?.[codeArr.length - 1]?.length;
4121
- indexOf = subStr.length - lastLen;
4122
- }
4123
- fileDetail.offset += indexOf;
4124
- } else if (
4125
4105
  node.concept === 'MemberExpression' ||
4126
4106
  node.concept === 'Identifier' ||
4127
4107
  node.concept === 'QueryFieldExpression' ||
@@ -4147,26 +4127,6 @@ class NaslServer {
4147
4127
  let newCode = code.substring(0, indexOf);
4148
4128
  newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
4149
4129
  fileDetail.offset = newCode.length + 'return '.length;
4150
- } else if (['NewComposite', 'NewList', 'NewMap'].includes(node.concept)) {
4151
- let type;
4152
- switch (node.concept) {
4153
- case 'NewComposite':
4154
- type = '__newComposite';
4155
- break;
4156
- case 'NewList':
4157
- type = '__newList';
4158
- break;
4159
- case 'NewMap':
4160
- type = '__newMap';
4161
- break;
4162
- default:
4163
- }
4164
- const code = getCode(item);
4165
- fileDetail.line = item.end.line;
4166
- const indexOf = code.indexOf(`return ${type}`);
4167
- let newCode = code.substring(0, indexOf);
4168
- newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
4169
- fileDetail.offset = newCode.length + 'return '.length;
4170
4130
  } else if (['OqlQueryComponent'].includes(node.concept)) {
4171
4131
  fileDetail.offset += 10;
4172
4132
  }
@@ -4416,14 +4376,14 @@ class NaslServer {
4416
4376
  }
4417
4377
  }
4418
4378
  // 特殊处理param有类型错误的
4419
- if (node instanceof Param && value) {
4379
+ if (value && (node instanceof Param)) {
4420
4380
  // index在nasl foreach上有脏数据
4421
4381
  if (node.parentKey === 'index' && node.parentNode instanceof ForEachStatement) {
4422
4382
  const jsonNode = jsoner.queryNodeByPath(json, node.getNodePath(false));
4423
4383
  jsonNode.typeAnnotation = (value as TypeAnnotation).toJSON();
4424
4384
  }
4425
4385
  }
4426
- if (node instanceof NewComposite && (node.typeAnnotation?.typeKind === 'anonymousStructure' || node.typeAnnotation?.typeKind === 'generic')) {
4386
+ if (value && (node instanceof NewComposite) && (node.typeAnnotation?.typeKind === 'anonymousStructure' || node.typeAnnotation?.typeKind === 'generic')) {
4427
4387
  const jsonNode = jsoner.queryNodeByPath(json, node.getNodePath(false));
4428
4388
  jsonNode.typeAnnotation = (value as TypeAnnotation).toJSON();
4429
4389
  }
@@ -4977,6 +4937,9 @@ class NaslServer {
4977
4937
  */
4978
4938
  static getPropertyNames(fileNode: Connection|Connector) {
4979
4939
  const names: string[] = [];
4940
+ if (!isConnection(fileNode) && !isConnector(fileNode)) {
4941
+ return names;
4942
+ }
4980
4943
  // TODO 如果不存在对应的 Connector 时,应该提示错误
4981
4944
  if (fileNode) {
4982
4945
  fileNode.properties.forEach((property) => {
@@ -1,7 +1,7 @@
1
1
  import type { SourceMapItem, Position, Range, TranslatorMethod, TranslatorState } from './types';
2
2
  import type { BaseNode } from '../concepts';
3
- import TypeAnnotation from '../concepts/TypeAnnotation__';
4
- import App from '../concepts/App__';
3
+ import type TypeAnnotation from '../concepts/TypeAnnotation__';
4
+ import type App from '../concepts/App__';
5
5
 
6
6
  export function lsp2tspNumber(num: number) {
7
7
  return num + 1;
@@ -1,14 +1,19 @@
1
1
  export const languageList = [
2
2
  {
3
3
  id: 'en-US',
4
- name: 'English (United States)',
5
- title: '英语(美国)',
4
+ name: 'English',
5
+ title: '英语',
6
6
  },
7
7
  {
8
8
  id: 'fr-FR',
9
9
  name: 'Français',
10
10
  title: '法语',
11
11
  },
12
+ {
13
+ id: 'ko-KR',
14
+ name: '한국어',
15
+ title: '韩语',
16
+ },
12
17
  {
13
18
  id: 'zh-CN',
14
19
  name: '中文 (简体)',
@@ -0,0 +1,25 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`binary-expression:getQuickInfoOffset constant-nested 1`] = `
4
+ Object {
5
+ "code": "nasl.core.and(nasl.core.isEqual(new nasl.core.String('StringLiteral').length,new nasl.core.Long(3)),new nasl.core.Boolean(false))",
6
+ "line": 1,
7
+ "offset": 11,
8
+ }
9
+ `;
10
+
11
+ exports[`binary-expression:getQuickInfoOffset constant-simple 1`] = `
12
+ Object {
13
+ "code": "nasl.core.and(new nasl.core.Boolean(true),new nasl.core.Boolean(false))",
14
+ "line": 1,
15
+ "offset": 11,
16
+ }
17
+ `;
18
+
19
+ exports[`binary-expression:getQuickInfoOffset variable-nested 1`] = `
20
+ Object {
21
+ "code": "nasl.core.or(nasl.core.isEqual(param1.length,new nasl.core.Long(3)),nasl.core.isNotEqual(param3.updatedBy.length,new nasl.core.Long(0)))",
22
+ "line": 1,
23
+ "offset": 11,
24
+ }
25
+ `;
@@ -0,0 +1,19 @@
1
+ import { expect } from 'chai';
2
+ import type { BinaryExpression } from '../../../src';
3
+ import { runGeneratorSync as runSync } from '../../../src/utils';
4
+ import { getNodeByData, readFixture, getCodeRange } from '../utils';
5
+ import { ConceptName, cases } from './constant';
6
+
7
+ describe(`${ConceptName}:getQuickInfoOffset`, () => {
8
+ cases.forEach((name) => {
9
+ it(name, () => {
10
+ const data = readFixture(ConceptName, name);
11
+ const node = getNodeByData<BinaryExpression>(data);
12
+ const tsCode = runSync(node.toEmbeddedTS());
13
+ expect({
14
+ code: tsCode,
15
+ ...node.getQuickInfoOffset(getCodeRange(tsCode), () => tsCode),
16
+ }).toMatchSnapshot();
17
+ });
18
+ });
19
+ });
@@ -0,0 +1,41 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`call-function:getQuickInfoOffset from-string 1`] = `
4
+ Object {
5
+ "code": "nasl.util.FromString(str)<nasl.core.Boolean>()",
6
+ "line": 1,
7
+ "offset": 11,
8
+ }
9
+ `;
10
+
11
+ exports[`call-function:getQuickInfoOffset to-string-global-tz 1`] = `
12
+ Object {
13
+ "code": "nasl.util.ToString(dt, new nasl.core.String('StringLiteral'))",
14
+ "line": 1,
15
+ "offset": 11,
16
+ }
17
+ `;
18
+
19
+ exports[`call-function:getQuickInfoOffset to-string-no-tz 1`] = `
20
+ Object {
21
+ "code": "nasl.util.ToString(str)",
22
+ "line": 1,
23
+ "offset": 11,
24
+ }
25
+ `;
26
+
27
+ exports[`call-function:getQuickInfoOffset to-string-user-tz 1`] = `
28
+ Object {
29
+ "code": "nasl.util.ToString(dt, new nasl.core.String('StringLiteral'))",
30
+ "line": 1,
31
+ "offset": 11,
32
+ }
33
+ `;
34
+
35
+ exports[`call-function:getQuickInfoOffset to-string-utc-tz 1`] = `
36
+ Object {
37
+ "code": "nasl.util.ToString(dt, new nasl.core.String('StringLiteral'))",
38
+ "line": 1,
39
+ "offset": 11,
40
+ }
41
+ `;
@@ -0,0 +1,19 @@
1
+ import { expect } from 'chai';
2
+ import type { CallFunction } from '../../../src';
3
+ import { runGeneratorSync as runSync } from '../../../src/utils';
4
+ import { getNodeByData, readFixture, getCodeRange } from '../utils';
5
+ import { ConceptName, cases } from './constant';
6
+
7
+ describe(`${ConceptName}:getQuickInfoOffset`, () => {
8
+ cases.forEach((name) => {
9
+ it(name, () => {
10
+ const data = readFixture(ConceptName, name);
11
+ const node = getNodeByData<CallFunction>(data);
12
+ const tsCode = runSync(node.toEmbeddedTS());
13
+ expect({
14
+ code: tsCode,
15
+ ...node.getQuickInfoOffset(getCodeRange(tsCode), () => tsCode),
16
+ }).toMatchSnapshot();
17
+ });
18
+ });
19
+ });
@@ -0,0 +1,86 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`call-interface:getQuickInfoOffset only-interface 1`] = `
4
+ Object {
5
+ "code": "apis.a123456.interfaces.only_interface();
6
+ ",
7
+ "line": 1,
8
+ "offset": 25,
9
+ }
10
+ `;
11
+
12
+ exports[`call-interface:getQuickInfoOffset with-body-complex-argument 1`] = `
13
+ Object {
14
+ "code": "apis.a123456.interfaces.with_body({param1:new nasl.core.String('StringLiteral'), param2:new nasl.core.Long(123), Body:(() => {
15
+ new nasl.core.Long(1);
16
+ new nasl.core.String('StringLiteral');
17
+ new nasl.core.String('StringLiteral');
18
+ function __newComposite() {
19
+ let __obj = nasl.util.New<apis.a123456.structures.With_bodyBody>();
20
+ const { id, value, property1 } = __obj;
21
+ __obj.id = new nasl.core.Long(1);
22
+ __obj.value = new nasl.core.String('StringLiteral');
23
+ __obj.property1 = new nasl.core.String('StringLiteral');
24
+ return __obj;
25
+ };
26
+ return __newComposite();
27
+ })()});
28
+ ",
29
+ "line": 1,
30
+ "offset": 25,
31
+ }
32
+ `;
33
+
34
+ exports[`call-interface:getQuickInfoOffset with-body-no-argument 1`] = `
35
+ Object {
36
+ "code": "apis.a123456.interfaces.with_body({param1:undefined});
37
+ ",
38
+ "line": 1,
39
+ "offset": 25,
40
+ }
41
+ `;
42
+
43
+ exports[`call-interface:getQuickInfoOffset with-body-simple-argument 1`] = `
44
+ Object {
45
+ "code": "apis.a123456.interfaces.with_body({param1:new nasl.core.String('StringLiteral'), param2:new nasl.core.String('StringLiteral')});
46
+ ",
47
+ "line": 1,
48
+ "offset": 25,
49
+ }
50
+ `;
51
+
52
+ exports[`call-interface:getQuickInfoOffset with-headers 1`] = `
53
+ Object {
54
+ "code": "apis.a123456.interfaces.with_headers({param1:new nasl.core.String('StringLiteral')});
55
+ ",
56
+ "line": 1,
57
+ "offset": 25,
58
+ }
59
+ `;
60
+
61
+ exports[`call-interface:getQuickInfoOffset with-headers-no-argument 1`] = `
62
+ Object {
63
+ "code": "apis.a123456.interfaces.with_headers({param1:__IDENTIFIER__, param2:undefined});
64
+ ",
65
+ "line": 1,
66
+ "offset": 25,
67
+ }
68
+ `;
69
+
70
+ exports[`call-interface:getQuickInfoOffset with-query 1`] = `
71
+ Object {
72
+ "code": "apis.a123456.interfaces.with_query({param1:new nasl.core.String('StringLiteral')});
73
+ ",
74
+ "line": 1,
75
+ "offset": 25,
76
+ }
77
+ `;
78
+
79
+ exports[`call-interface:getQuickInfoOffset with-query-no-argument 1`] = `
80
+ Object {
81
+ "code": "apis.a123456.interfaces.with_query({param1:__IDENTIFIER__, param2:undefined});
82
+ ",
83
+ "line": 1,
84
+ "offset": 25,
85
+ }
86
+ `;
@@ -28,7 +28,7 @@ exports[`call-interface:toEmbeddedTS with-body-complex-argument 1`] = `
28
28
  `;
29
29
 
30
30
  exports[`call-interface:toEmbeddedTS with-body-no-argument 1`] = `
31
- "apis.a123456.interfaces.with_body({ param1: __IDENTIFIER__ });
31
+ "apis.a123456.interfaces.with_body({ param1: undefined });
32
32
  "
33
33
  `;
34
34
 
@@ -50,7 +50,7 @@ exports[`call-interface:toEmbeddedTS with-headers 1`] = `
50
50
  exports[`call-interface:toEmbeddedTS with-headers-no-argument 1`] = `
51
51
  "apis.a123456.interfaces.with_headers({
52
52
  param1: __IDENTIFIER__,
53
- param2: __IDENTIFIER__,
53
+ param2: undefined,
54
54
  });
55
55
  "
56
56
  `;
@@ -65,7 +65,7 @@ exports[`call-interface:toEmbeddedTS with-query 1`] = `
65
65
  exports[`call-interface:toEmbeddedTS with-query-no-argument 1`] = `
66
66
  "apis.a123456.interfaces.with_query({
67
67
  param1: __IDENTIFIER__,
68
- param2: __IDENTIFIER__,
68
+ param2: undefined,
69
69
  });
70
70
  "
71
71
  `;
@@ -0,0 +1,19 @@
1
+ import { expect } from 'chai';
2
+ import type { CallInterface } from '../../../src';
3
+ import { runGeneratorSync as runSync } from '../../../src/utils';
4
+ import { getNodeByData, readFixture, getCodeRange } from '../utils';
5
+ import { ConceptName, cases } from './constant';
6
+
7
+ describe(`${ConceptName}:getQuickInfoOffset`, () => {
8
+ cases.forEach((name) => {
9
+ it(name, () => {
10
+ const data = readFixture(ConceptName, name);
11
+ const node = getNodeByData<CallInterface>(data);
12
+ const tsCode = runSync(node.toEmbeddedTS());
13
+ expect({
14
+ code: tsCode,
15
+ ...node.getQuickInfoOffset(getCodeRange(tsCode), () => tsCode),
16
+ }).toMatchSnapshot();
17
+ });
18
+ });
19
+ });
@@ -1,15 +1,10 @@
1
1
  import { expect } from 'chai';
2
2
  import type { CallLogic } from '../../../src';
3
3
  import { runGeneratorSync as runSync } from '../../../src/utils';
4
- import { getNodeByData, readFixture } from '../utils';
4
+ import { getNodeByData, readFixture, getCodeRange } from '../utils';
5
5
  import { ConceptName, cases } from './constant';
6
6
 
7
7
  describe(`${ConceptName}:getQuickInfoOffset`, () => {
8
- const fakeInputOffset = {
9
- line: 1,
10
- offset: 1,
11
- };
12
-
13
8
  cases.forEach((name) => {
14
9
  it(name, () => {
15
10
  const data = readFixture(ConceptName, name);
@@ -17,7 +12,7 @@ describe(`${ConceptName}:getQuickInfoOffset`, () => {
17
12
  const tsCode = runSync(node.toEmbeddedTS());
18
13
  expect({
19
14
  code: tsCode,
20
- ...node.getQuickInfoOffset(fakeInputOffset, tsCode),
15
+ ...node.getQuickInfoOffset(getCodeRange(tsCode), () => tsCode),
21
16
  }).toMatchSnapshot();
22
17
  });
23
18
  });