@lcap/nasl 2.22.2-beta.3 → 2.22.2-beta.4

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 (669) hide show
  1. package/out/automate/engine/index.d.ts +4 -0
  2. package/out/automate/engine/index.js +443 -0
  3. package/out/automate/engine/index.js.map +1 -0
  4. package/out/automate/engine/operators.d.ts +24 -0
  5. package/out/automate/engine/operators.js +252 -0
  6. package/out/automate/engine/operators.js.map +1 -0
  7. package/out/automate/engine/uniqueName.d.ts +12 -0
  8. package/out/automate/engine/uniqueName.js +112 -0
  9. package/out/automate/engine/uniqueName.js.map +1 -0
  10. package/out/automate/engine/utils.d.ts +25 -0
  11. package/out/automate/engine/utils.js +428 -0
  12. package/out/automate/engine/utils.js.map +1 -0
  13. package/out/automate/engine/viewCache.d.ts +19 -0
  14. package/out/automate/engine/viewCache.js +45 -0
  15. package/out/automate/engine/viewCache.js.map +1 -0
  16. package/out/automate/template/myProcess.d.ts +10 -0
  17. package/out/automate/template/myProcess.js +11498 -0
  18. package/out/automate/template/myProcess.js.map +1 -0
  19. package/out/bak/translator.d.ts +1 -0
  20. package/out/bak/translator.js +130 -0
  21. package/out/bak/translator.js.map +1 -0
  22. package/out/common/BaseNode.d.ts +306 -0
  23. package/out/common/BaseNode.js +1222 -0
  24. package/out/common/BaseNode.js.map +1 -0
  25. package/out/common/Command.d.ts +20 -0
  26. package/out/common/Command.js +66 -0
  27. package/out/common/Command.js.map +1 -0
  28. package/out/common/ComponentAPI.d.ts +110 -0
  29. package/out/common/ComponentAPI.js +3 -0
  30. package/out/common/ComponentAPI.js.map +1 -0
  31. package/out/common/EventEmitter.d.ts +59 -0
  32. package/out/common/EventEmitter.js +69 -0
  33. package/out/common/EventEmitter.js.map +1 -0
  34. package/out/common/Messager.d.ts +91 -0
  35. package/out/common/Messager.js +208 -0
  36. package/out/common/Messager.js.map +1 -0
  37. package/out/common/index.d.ts +3 -0
  38. package/out/common/index.js +20 -0
  39. package/out/common/index.js.map +1 -0
  40. package/out/concepts/Abort__.d.ts +26 -0
  41. package/out/concepts/Abort__.js +79 -0
  42. package/out/concepts/Abort__.js.map +1 -0
  43. package/out/concepts/Anchor__.d.ts +45 -0
  44. package/out/concepts/Anchor__.js +182 -0
  45. package/out/concepts/Anchor__.js.map +1 -0
  46. package/out/concepts/AnonymousFunction__.d.ts +173 -0
  47. package/out/concepts/AnonymousFunction__.js +484 -0
  48. package/out/concepts/AnonymousFunction__.js.map +1 -0
  49. package/out/concepts/App__.d.ts +1166 -0
  50. package/out/concepts/App__.js +1885 -0
  51. package/out/concepts/App__.js.map +1 -0
  52. package/out/concepts/Argument__.d.ts +66 -0
  53. package/out/concepts/Argument__.js +267 -0
  54. package/out/concepts/Argument__.js.map +1 -0
  55. package/out/concepts/Assignee__.d.ts +289 -0
  56. package/out/concepts/Assignee__.js +426 -0
  57. package/out/concepts/Assignee__.js.map +1 -0
  58. package/out/concepts/AssignmentLine__.d.ts +42 -0
  59. package/out/concepts/AssignmentLine__.js +111 -0
  60. package/out/concepts/AssignmentLine__.js.map +1 -0
  61. package/out/concepts/Assignment__.d.ts +74 -0
  62. package/out/concepts/Assignment__.js +287 -0
  63. package/out/concepts/Assignment__.js.map +1 -0
  64. package/out/concepts/Attribute__.d.ts +98 -0
  65. package/out/concepts/Attribute__.js +206 -0
  66. package/out/concepts/Attribute__.js.map +1 -0
  67. package/out/concepts/BatchAssignment__.d.ts +252 -0
  68. package/out/concepts/BatchAssignment__.js +806 -0
  69. package/out/concepts/BatchAssignment__.js.map +1 -0
  70. package/out/concepts/BinaryExpression__.d.ts +71 -0
  71. package/out/concepts/BinaryExpression__.js +347 -0
  72. package/out/concepts/BinaryExpression__.js.map +1 -0
  73. package/out/concepts/BindAttribute__.d.ts +319 -0
  74. package/out/concepts/BindAttribute__.js +896 -0
  75. package/out/concepts/BindAttribute__.js.map +1 -0
  76. package/out/concepts/BindDirective__.d.ts +162 -0
  77. package/out/concepts/BindDirective__.js +538 -0
  78. package/out/concepts/BindDirective__.js.map +1 -0
  79. package/out/concepts/BindEvent__.d.ts +240 -0
  80. package/out/concepts/BindEvent__.js +764 -0
  81. package/out/concepts/BindEvent__.js.map +1 -0
  82. package/out/concepts/BindStyle__.d.ts +140 -0
  83. package/out/concepts/BindStyle__.js +433 -0
  84. package/out/concepts/BindStyle__.js.map +1 -0
  85. package/out/concepts/BooleanLiteral__.d.ts +35 -0
  86. package/out/concepts/BooleanLiteral__.js +100 -0
  87. package/out/concepts/BooleanLiteral__.js.map +1 -0
  88. package/out/concepts/CallFunction__.d.ts +159 -0
  89. package/out/concepts/CallFunction__.js +503 -0
  90. package/out/concepts/CallFunction__.js.map +1 -0
  91. package/out/concepts/CallInterface__.d.ts +116 -0
  92. package/out/concepts/CallInterface__.js +570 -0
  93. package/out/concepts/CallInterface__.js.map +1 -0
  94. package/out/concepts/CallLogic__.d.ts +187 -0
  95. package/out/concepts/CallLogic__.js +1007 -0
  96. package/out/concepts/CallLogic__.js.map +1 -0
  97. package/out/concepts/CallQueryComponent__.d.ts +433 -0
  98. package/out/concepts/CallQueryComponent__.js +1267 -0
  99. package/out/concepts/CallQueryComponent__.js.map +1 -0
  100. package/out/concepts/Comment__.d.ts +32 -0
  101. package/out/concepts/Comment__.js +96 -0
  102. package/out/concepts/Comment__.js.map +1 -0
  103. package/out/concepts/CompletionProperty__.d.ts +105 -0
  104. package/out/concepts/CompletionProperty__.js +262 -0
  105. package/out/concepts/CompletionProperty__.js.map +1 -0
  106. package/out/concepts/ConfigGroup__.d.ts +124 -0
  107. package/out/concepts/ConfigGroup__.js +237 -0
  108. package/out/concepts/ConfigGroup__.js.map +1 -0
  109. package/out/concepts/ConfigPropertyValue__.d.ts +45 -0
  110. package/out/concepts/ConfigPropertyValue__.js +107 -0
  111. package/out/concepts/ConfigPropertyValue__.js.map +1 -0
  112. package/out/concepts/ConfigProperty__.d.ts +154 -0
  113. package/out/concepts/ConfigProperty__.js +324 -0
  114. package/out/concepts/ConfigProperty__.js.map +1 -0
  115. package/out/concepts/Configuration__.d.ts +124 -0
  116. package/out/concepts/Configuration__.js +228 -0
  117. package/out/concepts/Configuration__.js.map +1 -0
  118. package/out/concepts/Constant__.d.ts +106 -0
  119. package/out/concepts/Constant__.js +249 -0
  120. package/out/concepts/Constant__.js.map +1 -0
  121. package/out/concepts/DataElement__.d.ts +47 -0
  122. package/out/concepts/DataElement__.js +119 -0
  123. package/out/concepts/DataElement__.js.map +1 -0
  124. package/out/concepts/DataSource__.d.ts +165 -0
  125. package/out/concepts/DataSource__.js +442 -0
  126. package/out/concepts/DataSource__.js.map +1 -0
  127. package/out/concepts/DatabaseTypeAnnotation__.d.ts +32 -0
  128. package/out/concepts/DatabaseTypeAnnotation__.js +79 -0
  129. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -0
  130. package/out/concepts/Destination__.d.ts +157 -0
  131. package/out/concepts/Destination__.js +740 -0
  132. package/out/concepts/Destination__.js.map +1 -0
  133. package/out/concepts/End__.d.ts +25 -0
  134. package/out/concepts/End__.js +86 -0
  135. package/out/concepts/End__.js.map +1 -0
  136. package/out/concepts/EntityIndex__.d.ts +96 -0
  137. package/out/concepts/EntityIndex__.js +221 -0
  138. package/out/concepts/EntityIndex__.js.map +1 -0
  139. package/out/concepts/EntityProperty__.d.ts +274 -0
  140. package/out/concepts/EntityProperty__.js +824 -0
  141. package/out/concepts/EntityProperty__.js.map +1 -0
  142. package/out/concepts/Entity__.d.ts +339 -0
  143. package/out/concepts/Entity__.js +711 -0
  144. package/out/concepts/Entity__.js.map +1 -0
  145. package/out/concepts/EnumItem__.d.ts +64 -0
  146. package/out/concepts/EnumItem__.js +146 -0
  147. package/out/concepts/EnumItem__.js.map +1 -0
  148. package/out/concepts/Enum__.d.ts +138 -0
  149. package/out/concepts/Enum__.js +322 -0
  150. package/out/concepts/Enum__.js.map +1 -0
  151. package/out/concepts/Event__.d.ts +144 -0
  152. package/out/concepts/Event__.js +249 -0
  153. package/out/concepts/Event__.js.map +1 -0
  154. package/out/concepts/ExternalDestination__.d.ts +76 -0
  155. package/out/concepts/ExternalDestination__.js +286 -0
  156. package/out/concepts/ExternalDestination__.js.map +1 -0
  157. package/out/concepts/ForEachStatement__.d.ts +189 -0
  158. package/out/concepts/ForEachStatement__.js +446 -0
  159. package/out/concepts/ForEachStatement__.js.map +1 -0
  160. package/out/concepts/FrontendLibrary__.d.ts +214 -0
  161. package/out/concepts/FrontendLibrary__.js +353 -0
  162. package/out/concepts/FrontendLibrary__.js.map +1 -0
  163. package/out/concepts/Frontend__.d.ts +374 -0
  164. package/out/concepts/Frontend__.js +690 -0
  165. package/out/concepts/Frontend__.js.map +1 -0
  166. package/out/concepts/Function__.d.ts +417 -0
  167. package/out/concepts/Function__.js +717 -0
  168. package/out/concepts/Function__.js.map +1 -0
  169. package/out/concepts/Identifier__.d.ts +52 -0
  170. package/out/concepts/Identifier__.js +296 -0
  171. package/out/concepts/Identifier__.js.map +1 -0
  172. package/out/concepts/IfStatement__.d.ts +158 -0
  173. package/out/concepts/IfStatement__.js +305 -0
  174. package/out/concepts/IfStatement__.js.map +1 -0
  175. package/out/concepts/Integration__.d.ts +54 -0
  176. package/out/concepts/Integration__.js +143 -0
  177. package/out/concepts/Integration__.js.map +1 -0
  178. package/out/concepts/InterfaceParam__.d.ts +111 -0
  179. package/out/concepts/InterfaceParam__.js +266 -0
  180. package/out/concepts/InterfaceParam__.js.map +1 -0
  181. package/out/concepts/Interface__.d.ts +284 -0
  182. package/out/concepts/Interface__.js +749 -0
  183. package/out/concepts/Interface__.js.map +1 -0
  184. package/out/concepts/JSBlock__.d.ts +34 -0
  185. package/out/concepts/JSBlock__.js +106 -0
  186. package/out/concepts/JSBlock__.js.map +1 -0
  187. package/out/concepts/JavaLogic__.d.ts +43 -0
  188. package/out/concepts/JavaLogic__.js +124 -0
  189. package/out/concepts/JavaLogic__.js.map +1 -0
  190. package/out/concepts/LogicItem__.d.ts +126 -0
  191. package/out/concepts/LogicItem__.js +253 -0
  192. package/out/concepts/LogicItem__.js.map +1 -0
  193. package/out/concepts/Logic__.d.ts +633 -0
  194. package/out/concepts/Logic__.js +1568 -0
  195. package/out/concepts/Logic__.js.map +1 -0
  196. package/out/concepts/MatchCase__.d.ts +258 -0
  197. package/out/concepts/MatchCase__.js +591 -0
  198. package/out/concepts/MatchCase__.js.map +1 -0
  199. package/out/concepts/Match__.d.ts +124 -0
  200. package/out/concepts/Match__.js +628 -0
  201. package/out/concepts/Match__.js.map +1 -0
  202. package/out/concepts/MemberExpression__.d.ts +73 -0
  203. package/out/concepts/MemberExpression__.js +319 -0
  204. package/out/concepts/MemberExpression__.js.map +1 -0
  205. package/out/concepts/MetadataType__.d.ts +245 -0
  206. package/out/concepts/MetadataType__.js +473 -0
  207. package/out/concepts/MetadataType__.js.map +1 -0
  208. package/out/concepts/MicroApp__.d.ts +52 -0
  209. package/out/concepts/MicroApp__.js +119 -0
  210. package/out/concepts/MicroApp__.js.map +1 -0
  211. package/out/concepts/Module__.d.ts +978 -0
  212. package/out/concepts/Module__.js +1386 -0
  213. package/out/concepts/Module__.js.map +1 -0
  214. package/out/concepts/Namespace__.d.ts +1069 -0
  215. package/out/concepts/Namespace__.js +1380 -0
  216. package/out/concepts/Namespace__.js.map +1 -0
  217. package/out/concepts/NewComposite__.d.ts +346 -0
  218. package/out/concepts/NewComposite__.js +1086 -0
  219. package/out/concepts/NewComposite__.js.map +1 -0
  220. package/out/concepts/NewList__.d.ts +133 -0
  221. package/out/concepts/NewList__.js +385 -0
  222. package/out/concepts/NewList__.js.map +1 -0
  223. package/out/concepts/NewMap__.d.ts +224 -0
  224. package/out/concepts/NewMap__.js +530 -0
  225. package/out/concepts/NewMap__.js.map +1 -0
  226. package/out/concepts/New__.d.ts +21 -0
  227. package/out/concepts/New__.js +68 -0
  228. package/out/concepts/New__.js.map +1 -0
  229. package/out/concepts/NullLiteral__.d.ts +27 -0
  230. package/out/concepts/NullLiteral__.js +81 -0
  231. package/out/concepts/NullLiteral__.js.map +1 -0
  232. package/out/concepts/NumericLiteral__.d.ts +56 -0
  233. package/out/concepts/NumericLiteral__.js +174 -0
  234. package/out/concepts/NumericLiteral__.js.map +1 -0
  235. package/out/concepts/OqlQueryComponent__.d.ts +73 -0
  236. package/out/concepts/OqlQueryComponent__.js +327 -0
  237. package/out/concepts/OqlQueryComponent__.js.map +1 -0
  238. package/out/concepts/Param__.d.ts +161 -0
  239. package/out/concepts/Param__.js +431 -0
  240. package/out/concepts/Param__.js.map +1 -0
  241. package/out/concepts/Point__.d.ts +32 -0
  242. package/out/concepts/Point__.js +79 -0
  243. package/out/concepts/Point__.js.map +1 -0
  244. package/out/concepts/ProcessComponent__.d.ts +220 -0
  245. package/out/concepts/ProcessComponent__.js +339 -0
  246. package/out/concepts/ProcessComponent__.js.map +1 -0
  247. package/out/concepts/ProcessElement__.d.ts +647 -0
  248. package/out/concepts/ProcessElement__.js +1220 -0
  249. package/out/concepts/ProcessElement__.js.map +1 -0
  250. package/out/concepts/ProcessOutcome__.d.ts +32 -0
  251. package/out/concepts/ProcessOutcome__.js +90 -0
  252. package/out/concepts/ProcessOutcome__.js.map +1 -0
  253. package/out/concepts/ProcessOutcomes__.d.ts +32 -0
  254. package/out/concepts/ProcessOutcomes__.js +89 -0
  255. package/out/concepts/ProcessOutcomes__.js.map +1 -0
  256. package/out/concepts/Process__.d.ts +614 -0
  257. package/out/concepts/Process__.js +1031 -0
  258. package/out/concepts/Process__.js.map +1 -0
  259. package/out/concepts/QueryAggregateExpression__.d.ts +52 -0
  260. package/out/concepts/QueryAggregateExpression__.js +149 -0
  261. package/out/concepts/QueryAggregateExpression__.js.map +1 -0
  262. package/out/concepts/QueryFieldExpression__.d.ts +54 -0
  263. package/out/concepts/QueryFieldExpression__.js +160 -0
  264. package/out/concepts/QueryFieldExpression__.js.map +1 -0
  265. package/out/concepts/QueryFromExpression__.d.ts +97 -0
  266. package/out/concepts/QueryFromExpression__.js +197 -0
  267. package/out/concepts/QueryFromExpression__.js.map +1 -0
  268. package/out/concepts/QueryGroupByExpression__.d.ts +47 -0
  269. package/out/concepts/QueryGroupByExpression__.js +142 -0
  270. package/out/concepts/QueryGroupByExpression__.js.map +1 -0
  271. package/out/concepts/QueryJoinExpression__.d.ts +184 -0
  272. package/out/concepts/QueryJoinExpression__.js +318 -0
  273. package/out/concepts/QueryJoinExpression__.js.map +1 -0
  274. package/out/concepts/QueryLimitExpression__.d.ts +58 -0
  275. package/out/concepts/QueryLimitExpression__.js +160 -0
  276. package/out/concepts/QueryLimitExpression__.js.map +1 -0
  277. package/out/concepts/QueryOrderByExpression__.d.ts +69 -0
  278. package/out/concepts/QueryOrderByExpression__.js +173 -0
  279. package/out/concepts/QueryOrderByExpression__.js.map +1 -0
  280. package/out/concepts/QuerySelectExpression__.d.ts +204 -0
  281. package/out/concepts/QuerySelectExpression__.js +295 -0
  282. package/out/concepts/QuerySelectExpression__.js.map +1 -0
  283. package/out/concepts/Rect__.d.ts +40 -0
  284. package/out/concepts/Rect__.js +95 -0
  285. package/out/concepts/Rect__.js.map +1 -0
  286. package/out/concepts/Return__.d.ts +129 -0
  287. package/out/concepts/Return__.js +345 -0
  288. package/out/concepts/Return__.js.map +1 -0
  289. package/out/concepts/Role__.d.ts +63 -0
  290. package/out/concepts/Role__.js +170 -0
  291. package/out/concepts/Role__.js.map +1 -0
  292. package/out/concepts/SelectMembers__.d.ts +143 -0
  293. package/out/concepts/SelectMembers__.js +293 -0
  294. package/out/concepts/SelectMembers__.js.map +1 -0
  295. package/out/concepts/Slot__.d.ts +75 -0
  296. package/out/concepts/Slot__.js +165 -0
  297. package/out/concepts/Slot__.js.map +1 -0
  298. package/out/concepts/SqlQueryComponent__.d.ts +71 -0
  299. package/out/concepts/SqlQueryComponent__.js +271 -0
  300. package/out/concepts/SqlQueryComponent__.js.map +1 -0
  301. package/out/concepts/Start__.d.ts +25 -0
  302. package/out/concepts/Start__.js +73 -0
  303. package/out/concepts/Start__.js.map +1 -0
  304. package/out/concepts/StringInterpolation__.d.ts +117 -0
  305. package/out/concepts/StringInterpolation__.js +252 -0
  306. package/out/concepts/StringInterpolation__.js.map +1 -0
  307. package/out/concepts/StringLiteral__.d.ts +38 -0
  308. package/out/concepts/StringLiteral__.js +134 -0
  309. package/out/concepts/StringLiteral__.js.map +1 -0
  310. package/out/concepts/StructureProperty__.d.ts +131 -0
  311. package/out/concepts/StructureProperty__.js +303 -0
  312. package/out/concepts/StructureProperty__.js.map +1 -0
  313. package/out/concepts/Structure__.d.ts +252 -0
  314. package/out/concepts/Structure__.js +447 -0
  315. package/out/concepts/Structure__.js.map +1 -0
  316. package/out/concepts/SwitchCase__.d.ts +94 -0
  317. package/out/concepts/SwitchCase__.js +232 -0
  318. package/out/concepts/SwitchCase__.js.map +1 -0
  319. package/out/concepts/SwitchStatement__.d.ts +84 -0
  320. package/out/concepts/SwitchStatement__.js +177 -0
  321. package/out/concepts/SwitchStatement__.js.map +1 -0
  322. package/out/concepts/Theme__.d.ts +38 -0
  323. package/out/concepts/Theme__.js +88 -0
  324. package/out/concepts/Theme__.js.map +1 -0
  325. package/out/concepts/Transactional__.d.ts +83 -0
  326. package/out/concepts/Transactional__.js +162 -0
  327. package/out/concepts/Transactional__.js.map +1 -0
  328. package/out/concepts/TypeAnnotation__.d.ts +290 -0
  329. package/out/concepts/TypeAnnotation__.js +885 -0
  330. package/out/concepts/TypeAnnotation__.js.map +1 -0
  331. package/out/concepts/TypeParam__.d.ts +25 -0
  332. package/out/concepts/TypeParam__.js +73 -0
  333. package/out/concepts/TypeParam__.js.map +1 -0
  334. package/out/concepts/UnaryExpression__.d.ts +49 -0
  335. package/out/concepts/UnaryExpression__.js +176 -0
  336. package/out/concepts/UnaryExpression__.js.map +1 -0
  337. package/out/concepts/Unparsed__.d.ts +32 -0
  338. package/out/concepts/Unparsed__.js +94 -0
  339. package/out/concepts/Unparsed__.js.map +1 -0
  340. package/out/concepts/UseComponent__.d.ts +32 -0
  341. package/out/concepts/UseComponent__.js +79 -0
  342. package/out/concepts/UseComponent__.js.map +1 -0
  343. package/out/concepts/ValidationRule__.d.ts +142 -0
  344. package/out/concepts/ValidationRule__.js +473 -0
  345. package/out/concepts/ValidationRule__.js.map +1 -0
  346. package/out/concepts/Variable__.d.ts +139 -0
  347. package/out/concepts/Variable__.js +386 -0
  348. package/out/concepts/Variable__.js.map +1 -0
  349. package/out/concepts/ViewBlock__.d.ts +36 -0
  350. package/out/concepts/ViewBlock__.js +87 -0
  351. package/out/concepts/ViewBlock__.js.map +1 -0
  352. package/out/concepts/ViewComponent__.d.ts +566 -0
  353. package/out/concepts/ViewComponent__.js +762 -0
  354. package/out/concepts/ViewComponent__.js.map +1 -0
  355. package/out/concepts/ViewElement__.d.ts +597 -0
  356. package/out/concepts/ViewElement__.js +1777 -0
  357. package/out/concepts/ViewElement__.js.map +1 -0
  358. package/out/concepts/View__.d.ts +714 -0
  359. package/out/concepts/View__.js +1733 -0
  360. package/out/concepts/View__.js.map +1 -0
  361. package/out/concepts/WhileStatement__.d.ts +97 -0
  362. package/out/concepts/WhileStatement__.js +211 -0
  363. package/out/concepts/WhileStatement__.js.map +1 -0
  364. package/out/concepts/basics/stdlib/index.d.ts +4 -0
  365. package/out/concepts/basics/stdlib/index.js +29 -0
  366. package/out/concepts/basics/stdlib/index.js.map +1 -0
  367. package/out/concepts/basics/stdlib/nasl.auth.d.ts +7 -0
  368. package/out/concepts/basics/stdlib/nasl.auth.js +140 -0
  369. package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -0
  370. package/out/concepts/basics/stdlib/nasl.browser.d.ts +3 -0
  371. package/out/concepts/basics/stdlib/nasl.browser.js +133 -0
  372. package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -0
  373. package/out/concepts/basics/stdlib/nasl.collection.d.ts +7 -0
  374. package/out/concepts/basics/stdlib/nasl.collection.js +52 -0
  375. package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -0
  376. package/out/concepts/basics/stdlib/nasl.configuration.d.ts +3 -0
  377. package/out/concepts/basics/stdlib/nasl.configuration.js +33 -0
  378. package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -0
  379. package/out/concepts/basics/stdlib/nasl.core.d.ts +5 -0
  380. package/out/concepts/basics/stdlib/nasl.core.js +49 -0
  381. package/out/concepts/basics/stdlib/nasl.core.js.map +1 -0
  382. package/out/concepts/basics/stdlib/nasl.event.d.ts +3 -0
  383. package/out/concepts/basics/stdlib/nasl.event.js +25 -0
  384. package/out/concepts/basics/stdlib/nasl.event.js.map +1 -0
  385. package/out/concepts/basics/stdlib/nasl.interface.d.ts +7 -0
  386. package/out/concepts/basics/stdlib/nasl.interface.js +43 -0
  387. package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -0
  388. package/out/concepts/basics/stdlib/nasl.io.d.ts +3 -0
  389. package/out/concepts/basics/stdlib/nasl.io.js +52 -0
  390. package/out/concepts/basics/stdlib/nasl.io.js.map +1 -0
  391. package/out/concepts/basics/stdlib/nasl.logging.d.ts +3 -0
  392. package/out/concepts/basics/stdlib/nasl.logging.js +56 -0
  393. package/out/concepts/basics/stdlib/nasl.logging.js.map +1 -0
  394. package/out/concepts/basics/stdlib/nasl.process.d.ts +7 -0
  395. package/out/concepts/basics/stdlib/nasl.process.js +638 -0
  396. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -0
  397. package/out/concepts/basics/stdlib/nasl.ui.d.ts +7 -0
  398. package/out/concepts/basics/stdlib/nasl.ui.js +1043 -0
  399. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -0
  400. package/out/concepts/basics/stdlib/nasl.util.d.ts +3 -0
  401. package/out/concepts/basics/stdlib/nasl.util.js +1798 -0
  402. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -0
  403. package/out/concepts/basics/stdlib/nasl.validation.d.ts +3 -0
  404. package/out/concepts/basics/stdlib/nasl.validation.js +565 -0
  405. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -0
  406. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts +5 -0
  407. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +26 -0
  408. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -0
  409. package/out/concepts/basics/types/coreTypeList.d.ts +2 -0
  410. package/out/concepts/basics/types/coreTypeList.js +15 -0
  411. package/out/concepts/basics/types/coreTypeList.js.map +1 -0
  412. package/out/concepts/basics/types/index.d.ts +15 -0
  413. package/out/concepts/basics/types/index.js +32 -0
  414. package/out/concepts/basics/types/index.js.map +1 -0
  415. package/out/concepts/index.d.ts +5 -0
  416. package/out/concepts/index.js +24 -0
  417. package/out/concepts/index.js.map +1 -0
  418. package/out/concepts/index__.d.ts +108 -0
  419. package/out/concepts/index__.js +125 -0
  420. package/out/concepts/index__.js.map +1 -0
  421. package/out/config.d.ts +44 -0
  422. package/out/config.js +73 -0
  423. package/out/config.js.map +1 -0
  424. package/out/decorators/index.d.ts +56 -0
  425. package/out/decorators/index.js +159 -0
  426. package/out/decorators/index.js.map +1 -0
  427. package/out/enums/KEYWORDS.d.ts +6 -0
  428. package/out/enums/KEYWORDS.js +1243 -0
  429. package/out/enums/KEYWORDS.js.map +1 -0
  430. package/out/enums/LEVEL_NAME_MAP.d.ts +26 -0
  431. package/out/enums/LEVEL_NAME_MAP.js +30 -0
  432. package/out/enums/LEVEL_NAME_MAP.js.map +1 -0
  433. package/out/eventBus.d.ts +3 -0
  434. package/out/eventBus.js +7 -0
  435. package/out/eventBus.js.map +1 -0
  436. package/out/generator/compileComponent.d.ts +11 -0
  437. package/out/generator/compileComponent.js +12 -0
  438. package/out/generator/compileComponent.js.map +1 -0
  439. package/out/generator/genBundleFiles.d.ts +33 -0
  440. package/out/generator/genBundleFiles.js +501 -0
  441. package/out/generator/genBundleFiles.js.map +1 -0
  442. package/out/generator/genHash.d.ts +7 -0
  443. package/out/generator/genHash.js +39 -0
  444. package/out/generator/genHash.js.map +1 -0
  445. package/out/generator/genMetaData.d.ts +28 -0
  446. package/out/generator/genMetaData.js +288 -0
  447. package/out/generator/genMetaData.js.map +1 -0
  448. package/out/generator/genReleaseBody.d.ts +60 -0
  449. package/out/generator/genReleaseBody.js +493 -0
  450. package/out/generator/genReleaseBody.js.map +1 -0
  451. package/out/generator/icestark.d.ts +2 -0
  452. package/out/generator/icestark.js +48 -0
  453. package/out/generator/icestark.js.map +1 -0
  454. package/out/generator/index.d.ts +7 -0
  455. package/out/generator/index.js +24 -0
  456. package/out/generator/index.js.map +1 -0
  457. package/out/generator/microApp.d.ts +2 -0
  458. package/out/generator/microApp.js +35 -0
  459. package/out/generator/microApp.js.map +1 -0
  460. package/out/generator/permission.d.ts +10 -0
  461. package/out/generator/permission.js +269 -0
  462. package/out/generator/permission.js.map +1 -0
  463. package/out/generator/qiankun.d.ts +2 -0
  464. package/out/generator/qiankun.js +52 -0
  465. package/out/generator/qiankun.js.map +1 -0
  466. package/out/generator/styleReplacer.d.ts +3 -0
  467. package/out/generator/styleReplacer.js +71 -0
  468. package/out/generator/styleReplacer.js.map +1 -0
  469. package/out/index.d.ts +13 -0
  470. package/out/index.js +64 -0
  471. package/out/index.js.map +1 -0
  472. package/out/manager/diagnostic.d.ts +35 -0
  473. package/out/manager/diagnostic.js +63 -0
  474. package/out/manager/diagnostic.js.map +1 -0
  475. package/out/manager/stepRecorder.d.ts +20 -0
  476. package/out/manager/stepRecorder.js +110 -0
  477. package/out/manager/stepRecorder.js.map +1 -0
  478. package/out/sentry/index.d.ts +29 -0
  479. package/out/sentry/index.js +111 -0
  480. package/out/sentry/index.js.map +1 -0
  481. package/out/server/createUiTs.d.ts +16 -0
  482. package/out/server/createUiTs.js +248 -0
  483. package/out/server/createUiTs.js.map +1 -0
  484. package/out/server/entity2LogicNamespace.d.ts +10 -0
  485. package/out/server/entity2LogicNamespace.js +380 -0
  486. package/out/server/entity2LogicNamespace.js.map +1 -0
  487. package/out/server/event.d.ts +30 -0
  488. package/out/server/event.js +151 -0
  489. package/out/server/event.js.map +1 -0
  490. package/out/server/extendBaseNode.d.ts +1 -0
  491. package/out/server/extendBaseNode.js +475 -0
  492. package/out/server/extendBaseNode.js.map +1 -0
  493. package/out/server/formatTsUtils.d.ts +36 -0
  494. package/out/server/formatTsUtils.js +788 -0
  495. package/out/server/formatTsUtils.js.map +1 -0
  496. package/out/server/getExtensionModules.d.ts +3 -0
  497. package/out/server/getExtensionModules.js +20 -0
  498. package/out/server/getExtensionModules.js.map +1 -0
  499. package/out/server/getFunctions.d.ts +3 -0
  500. package/out/server/getFunctions.js +20 -0
  501. package/out/server/getFunctions.js.map +1 -0
  502. package/out/server/getInterfaces.d.ts +2 -0
  503. package/out/server/getInterfaces.js +48 -0
  504. package/out/server/getInterfaces.js.map +1 -0
  505. package/out/server/getLogging.d.ts +1 -0
  506. package/out/server/getLogging.js +9 -0
  507. package/out/server/getLogging.js.map +1 -0
  508. package/out/server/getLogics.d.ts +4 -0
  509. package/out/server/getLogics.js +352 -0
  510. package/out/server/getLogics.js.map +1 -0
  511. package/out/server/getMemberIdentifier.d.ts +15 -0
  512. package/out/server/getMemberIdentifier.js +290 -0
  513. package/out/server/getMemberIdentifier.js.map +1 -0
  514. package/out/server/getProcessComponents.d.ts +2 -0
  515. package/out/server/getProcessComponents.js +13 -0
  516. package/out/server/getProcessComponents.js.map +1 -0
  517. package/out/server/getProcesses.d.ts +33 -0
  518. package/out/server/getProcesses.js +599 -0
  519. package/out/server/getProcesses.js.map +1 -0
  520. package/out/server/getScope.d.ts +13 -0
  521. package/out/server/getScope.js +61 -0
  522. package/out/server/getScope.js.map +1 -0
  523. package/out/server/getValidates.d.ts +3 -0
  524. package/out/server/getValidates.js +14 -0
  525. package/out/server/getValidates.js.map +1 -0
  526. package/out/server/index.d.ts +5 -0
  527. package/out/server/index.js +38 -0
  528. package/out/server/index.js.map +1 -0
  529. package/out/server/naslServer.d.ts +363 -0
  530. package/out/server/naslServer.js +4382 -0
  531. package/out/server/naslServer.js.map +1 -0
  532. package/out/server/naslStdlibMap.d.ts +2 -0
  533. package/out/server/naslStdlibMap.js +50 -0
  534. package/out/server/naslStdlibMap.js.map +1 -0
  535. package/out/server/process2LogicNamespace.d.ts +26 -0
  536. package/out/server/process2LogicNamespace.js +109 -0
  537. package/out/server/process2LogicNamespace.js.map +1 -0
  538. package/out/server/translator.d.ts +26 -0
  539. package/out/server/translator.js +787 -0
  540. package/out/server/translator.js.map +1 -0
  541. package/out/service/creator/add.configs.d.ts +1 -0
  542. package/out/service/creator/add.configs.js +74 -0
  543. package/out/service/creator/add.configs.js.map +1 -0
  544. package/out/service/creator/errHandles.d.ts +18 -0
  545. package/out/service/creator/errHandles.js +75 -0
  546. package/out/service/creator/errHandles.js.map +1 -0
  547. package/out/service/creator/index.d.ts +1 -0
  548. package/out/service/creator/index.js +74 -0
  549. package/out/service/creator/index.js.map +1 -0
  550. package/out/service/datasource/api.d.ts +12 -0
  551. package/out/service/datasource/api.js +14 -0
  552. package/out/service/datasource/api.js.map +1 -0
  553. package/out/service/datasource/index.d.ts +2 -0
  554. package/out/service/datasource/index.js +10 -0
  555. package/out/service/datasource/index.js.map +1 -0
  556. package/out/service/defaultErrorMessage.json +98 -0
  557. package/out/service/logic/api.d.ts +9 -0
  558. package/out/service/logic/api.js +11 -0
  559. package/out/service/logic/api.js.map +1 -0
  560. package/out/service/logic/index.d.ts +2 -0
  561. package/out/service/logic/index.js +10 -0
  562. package/out/service/logic/index.js.map +1 -0
  563. package/out/service/storage/api.d.ts +45 -0
  564. package/out/service/storage/api.js +36 -0
  565. package/out/service/storage/api.js.map +1 -0
  566. package/out/service/storage/index.d.ts +2 -0
  567. package/out/service/storage/index.js +10 -0
  568. package/out/service/storage/index.js.map +1 -0
  569. package/out/service/storage/init.d.ts +65 -0
  570. package/out/service/storage/init.js +797 -0
  571. package/out/service/storage/init.js.map +1 -0
  572. package/out/service/storage/jsoner.d.ts +36 -0
  573. package/out/service/storage/jsoner.js +131 -0
  574. package/out/service/storage/jsoner.js.map +1 -0
  575. package/out/service/storage/map.d.ts +4 -0
  576. package/out/service/storage/map.js +54 -0
  577. package/out/service/storage/map.js.map +1 -0
  578. package/out/service/storage/service.d.ts +22 -0
  579. package/out/service/storage/service.js +70 -0
  580. package/out/service/storage/service.js.map +1 -0
  581. package/out/service/storage/storagePoint.d.ts +17 -0
  582. package/out/service/storage/storagePoint.js +76 -0
  583. package/out/service/storage/storagePoint.js.map +1 -0
  584. package/out/templator/genCallComponentLogic.d.ts +17 -0
  585. package/out/templator/genCallComponentLogic.js +30 -0
  586. package/out/templator/genCallComponentLogic.js.map +1 -0
  587. package/out/templator/genCreateBlock.d.ts +10 -0
  588. package/out/templator/genCreateBlock.js +338 -0
  589. package/out/templator/genCreateBlock.js.map +1 -0
  590. package/out/templator/genCurdEditMultipleKeyBlock.d.ts +8 -0
  591. package/out/templator/genCurdEditMultipleKeyBlock.js +516 -0
  592. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -0
  593. package/out/templator/genCurdMultipleKeyBlock.d.ts +34 -0
  594. package/out/templator/genCurdMultipleKeyBlock.js +709 -0
  595. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -0
  596. package/out/templator/genEditTableBlock.d.ts +51 -0
  597. package/out/templator/genEditTableBlock.js +299 -0
  598. package/out/templator/genEditTableBlock.js.map +1 -0
  599. package/out/templator/genEnumSelectBlock.d.ts +10 -0
  600. package/out/templator/genEnumSelectBlock.js +26 -0
  601. package/out/templator/genEnumSelectBlock.js.map +1 -0
  602. package/out/templator/genGetBlock.d.ts +6 -0
  603. package/out/templator/genGetBlock.js +138 -0
  604. package/out/templator/genGetBlock.js.map +1 -0
  605. package/out/templator/genGridViewBlock.d.ts +55 -0
  606. package/out/templator/genGridViewBlock.js +350 -0
  607. package/out/templator/genGridViewBlock.js.map +1 -0
  608. package/out/templator/genListViewBlock.d.ts +19 -0
  609. package/out/templator/genListViewBlock.js +143 -0
  610. package/out/templator/genListViewBlock.js.map +1 -0
  611. package/out/templator/genQueryComponent.d.ts +34 -0
  612. package/out/templator/genQueryComponent.js +342 -0
  613. package/out/templator/genQueryComponent.js.map +1 -0
  614. package/out/templator/genSelectBlock.d.ts +45 -0
  615. package/out/templator/genSelectBlock.js +406 -0
  616. package/out/templator/genSelectBlock.js.map +1 -0
  617. package/out/templator/genTableBlock.d.ts +53 -0
  618. package/out/templator/genTableBlock.js +280 -0
  619. package/out/templator/genTableBlock.js.map +1 -0
  620. package/out/templator/genUpdateBlock.d.ts +6 -0
  621. package/out/templator/genUpdateBlock.js +380 -0
  622. package/out/templator/genUpdateBlock.js.map +1 -0
  623. package/out/templator/index.d.ts +18 -0
  624. package/out/templator/index.js +34 -0
  625. package/out/templator/index.js.map +1 -0
  626. package/out/templator/utils.d.ts +676 -0
  627. package/out/templator/utils.js +469 -0
  628. package/out/templator/utils.js.map +1 -0
  629. package/out/translator/constant.d.ts +6 -0
  630. package/out/translator/constant.js +10 -0
  631. package/out/translator/constant.js.map +1 -0
  632. package/out/translator/index.d.ts +3 -0
  633. package/out/translator/index.js +20 -0
  634. package/out/translator/index.js.map +1 -0
  635. package/out/translator/types.d.ts +32 -0
  636. package/out/translator/types.js +3 -0
  637. package/out/translator/types.js.map +1 -0
  638. package/out/translator/utils.d.ts +25 -0
  639. package/out/translator/utils.js +120 -0
  640. package/out/translator/utils.js.map +1 -0
  641. package/out/utils/index.d.ts +42 -0
  642. package/out/utils/index.js +213 -0
  643. package/out/utils/index.js.map +1 -0
  644. package/out/utils/logger.d.ts +7 -0
  645. package/out/utils/logger.js +23 -0
  646. package/out/utils/logger.js.map +1 -0
  647. package/out/utils/sortTsString.d.ts +1 -0
  648. package/out/utils/sortTsString.js +36 -0
  649. package/out/utils/sortTsString.js.map +1 -0
  650. package/out/utils/string.d.ts +51 -0
  651. package/out/utils/string.js +110 -0
  652. package/out/utils/string.js.map +1 -0
  653. package/out/utils/time.d.ts +1 -0
  654. package/out/utils/time.js +6 -0
  655. package/out/utils/time.js.map +1 -0
  656. package/out/utils/traverse.d.ts +36 -0
  657. package/out/utils/traverse.js +145 -0
  658. package/out/utils/traverse.js.map +1 -0
  659. package/out/utils/types.d.ts +1 -0
  660. package/out/utils/types.js +3 -0
  661. package/out/utils/types.js.map +1 -0
  662. package/out/utils/window.d.ts +7 -0
  663. package/out/utils/window.js +14 -0
  664. package/out/utils/window.js.map +1 -0
  665. package/package.json +1 -1
  666. package/src/concepts/BindEvent__.ts +5 -6
  667. package/src/concepts/Module__.ts +2 -2
  668. package/src/concepts/View__.ts +2 -2
  669. package/src/server/naslServer.ts +4 -4
@@ -0,0 +1,1267 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || function (mod) {
25
+ if (mod && mod.__esModule) return mod;
26
+ var result = {};
27
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
+ __setModuleDefault(result, mod);
29
+ return result;
30
+ };
31
+ var __importDefault = (this && this.__importDefault) || function (mod) {
32
+ return (mod && mod.__esModule) ? mod : { "default": mod };
33
+ };
34
+ var CallQueryComponent_1;
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.CallQueryComponent = void 0;
37
+ const translator_1 = require("../translator");
38
+ const Structure__1 = __importDefault(require("./Structure__"));
39
+ const StructureProperty__1 = __importDefault(require("./StructureProperty__"));
40
+ const CompletionProperty__1 = __importDefault(require("./CompletionProperty__"));
41
+ const decorators_1 = require("../decorators");
42
+ const utils = __importStar(require("../utils"));
43
+ const TypeAnnotation__1 = __importDefault(require("./TypeAnnotation__"));
44
+ const LogicItem__1 = __importDefault(require("./LogicItem__"));
45
+ const QueryGroupByExpression__1 = __importDefault(require("./QueryGroupByExpression__"));
46
+ const QueryOrderByExpression__1 = __importDefault(require("./QueryOrderByExpression__"));
47
+ /**
48
+ * 数据查询
49
+ */
50
+ let CallQueryComponent = CallQueryComponent_1 =
51
+ // @ts-ignore
52
+ class CallQueryComponent extends LogicItem__1.default {
53
+ /** 类名 */
54
+ static ConceptName = 'CallQueryComponent';
55
+ /**
56
+ * 产品概念
57
+ */
58
+ // @ts-ignore
59
+ concept;
60
+ /**
61
+ * 类型
62
+ */
63
+ // @ts-ignore
64
+ typeAnnotation;
65
+ /**
66
+ * select
67
+ */
68
+ // @ts-ignore
69
+ select;
70
+ /**
71
+ * from
72
+ */
73
+ // @ts-ignore
74
+ from;
75
+ /**
76
+ * where
77
+ */
78
+ // @ts-ignore
79
+ where;
80
+ /**
81
+ * where 草稿态
82
+ */
83
+ wherePlayground = [];
84
+ /**
85
+ * groupBy
86
+ */
87
+ groupBy = [];
88
+ /**
89
+ * having
90
+ */
91
+ // @ts-ignore
92
+ having;
93
+ /**
94
+ * having 草稿态
95
+ */
96
+ havingPlayground = [];
97
+ /**
98
+ * orderBy
99
+ */
100
+ orderBy = [];
101
+ /**
102
+ * limit
103
+ */
104
+ // @ts-ignore
105
+ limit;
106
+ /**
107
+ * 查询组件的局部版本
108
+ */
109
+ // @ts-ignore
110
+ ideVersion;
111
+ /**
112
+ * @param source 需要合并的部分参数
113
+ */
114
+ constructor(source) {
115
+ source = Object.assign({}, CallQueryComponent_1.getDefaultOptions(), source);
116
+ super(source);
117
+ super.subConstructor(source);
118
+ }
119
+ static from(source, parentNode, parentKey) {
120
+ return super.from(source, parentNode, parentKey);
121
+ }
122
+ /**
123
+ * 设置select
124
+ */
125
+ setSelect(select) {
126
+ select._delete();
127
+ const relationOptions = { parentNode: this, parentKey: 'select' };
128
+ Object.assign(select, relationOptions);
129
+ const object = {
130
+ select,
131
+ };
132
+ this.update({
133
+ ...object,
134
+ });
135
+ }
136
+ /**
137
+ * 设置from
138
+ */
139
+ setFrom(from) {
140
+ from._delete();
141
+ const relationOptions = { parentNode: this, parentKey: 'from' };
142
+ Object.assign(from, relationOptions);
143
+ const object = {
144
+ from,
145
+ };
146
+ this.update({
147
+ ...object,
148
+ });
149
+ }
150
+ /**
151
+ * 设置where
152
+ */
153
+ setWhere(where) {
154
+ where._delete();
155
+ const relationOptions = { parentNode: this, parentKey: 'where' };
156
+ Object.assign(where, relationOptions);
157
+ const object = {
158
+ where,
159
+ };
160
+ this.update({
161
+ ...object,
162
+ });
163
+ }
164
+ /**
165
+ * 设置groupBy
166
+ */
167
+ setGroupBy(groupBy) {
168
+ const object = {
169
+ groupBy,
170
+ };
171
+ this.update({
172
+ ...object,
173
+ });
174
+ }
175
+ /**
176
+ * 设置having
177
+ */
178
+ setHaving(having) {
179
+ having._delete();
180
+ const relationOptions = { parentNode: this, parentKey: 'having' };
181
+ Object.assign(having, relationOptions);
182
+ const object = {
183
+ having,
184
+ };
185
+ this.update({
186
+ ...object,
187
+ });
188
+ }
189
+ /**
190
+ * 设置orderBy
191
+ */
192
+ setOrderBy(orderBy) {
193
+ const object = {
194
+ orderBy,
195
+ };
196
+ this.update({
197
+ ...object,
198
+ });
199
+ }
200
+ /**
201
+ * 设置limit
202
+ */
203
+ setLimit(limit) {
204
+ limit._delete();
205
+ const relationOptions = { parentNode: this, parentKey: 'limit' };
206
+ Object.assign(limit, relationOptions);
207
+ const object = {
208
+ limit,
209
+ };
210
+ this.update({
211
+ ...object,
212
+ });
213
+ }
214
+ _insertItemInWherePlaygroundAt(options, index) {
215
+ const logicItemOptions = {};
216
+ const relationOptions = { parentNode: this, parentKey: 'wherePlayground' };
217
+ let logicItem;
218
+ if (options instanceof LogicItem__1.default) {
219
+ options.ensureDelete(); // 同一实例不支持多处存在
220
+ logicItem = options;
221
+ Object.assign(logicItem, relationOptions);
222
+ }
223
+ else {
224
+ logicItem = LogicItem__1.default.from({
225
+ ...logicItemOptions,
226
+ ...options,
227
+ }, this, 'wherePlayground');
228
+ }
229
+ this.wherePlayground.splice(index, 0, logicItem);
230
+ return logicItem;
231
+ }
232
+ insertItemInWherePlaygroundAt(options, index) {
233
+ const node = this._insertItemInWherePlaygroundAt(options, index);
234
+ node.create({
235
+ index,
236
+ parentNode: this,
237
+ parentKey: 'wherePlayground',
238
+ });
239
+ return node;
240
+ }
241
+ _addItemInWherePlayground(options) {
242
+ const index = this.wherePlayground.length;
243
+ return this._insertItemInWherePlaygroundAt(options, index);
244
+ }
245
+ addItemInWherePlayground(options) {
246
+ const node = this._addItemInWherePlayground(options);
247
+ const index = this.wherePlayground.indexOf(node);
248
+ node.create({
249
+ index,
250
+ parentNode: this,
251
+ parentKey: 'wherePlayground',
252
+ });
253
+ return node;
254
+ }
255
+ _insertQueryGroupByExpressionInGroupByAt(options, index) {
256
+ const queryGroupByExpressionOptions = {};
257
+ const relationOptions = { parentNode: this, parentKey: 'groupBy' };
258
+ let queryGroupByExpression;
259
+ if (options instanceof QueryGroupByExpression__1.default) {
260
+ options.ensureDelete(); // 同一实例不支持多处存在
261
+ queryGroupByExpression = options;
262
+ Object.assign(queryGroupByExpression, relationOptions);
263
+ }
264
+ else {
265
+ queryGroupByExpression = QueryGroupByExpression__1.default.from({
266
+ ...queryGroupByExpressionOptions,
267
+ ...options,
268
+ }, this, 'groupBy');
269
+ }
270
+ this.groupBy.splice(index, 0, queryGroupByExpression);
271
+ return queryGroupByExpression;
272
+ }
273
+ insertQueryGroupByExpressionInGroupByAt(options, index) {
274
+ const node = this._insertQueryGroupByExpressionInGroupByAt(options, index);
275
+ node.create({
276
+ index,
277
+ parentNode: this,
278
+ parentKey: 'groupBy',
279
+ });
280
+ return node;
281
+ }
282
+ _addQueryGroupByExpressionInGroupBy(options) {
283
+ const index = this.groupBy.length;
284
+ return this._insertQueryGroupByExpressionInGroupByAt(options, index);
285
+ }
286
+ addQueryGroupByExpressionInGroupBy(options) {
287
+ const node = this._addQueryGroupByExpressionInGroupBy(options);
288
+ const index = this.groupBy.indexOf(node);
289
+ node.create({
290
+ index,
291
+ parentNode: this,
292
+ parentKey: 'groupBy',
293
+ });
294
+ return node;
295
+ }
296
+ _insertItemInHavingPlaygroundAt(options, index) {
297
+ const logicItemOptions = {};
298
+ const relationOptions = { parentNode: this, parentKey: 'havingPlayground' };
299
+ let logicItem;
300
+ if (options instanceof LogicItem__1.default) {
301
+ options.ensureDelete(); // 同一实例不支持多处存在
302
+ logicItem = options;
303
+ Object.assign(logicItem, relationOptions);
304
+ }
305
+ else {
306
+ logicItem = LogicItem__1.default.from({
307
+ ...logicItemOptions,
308
+ ...options,
309
+ }, this, 'havingPlayground');
310
+ }
311
+ this.havingPlayground.splice(index, 0, logicItem);
312
+ return logicItem;
313
+ }
314
+ insertItemInHavingPlaygroundAt(options, index) {
315
+ const node = this._insertItemInHavingPlaygroundAt(options, index);
316
+ node.create({
317
+ index,
318
+ parentNode: this,
319
+ parentKey: 'havingPlayground',
320
+ });
321
+ return node;
322
+ }
323
+ _addItemInHavingPlayground(options) {
324
+ const index = this.havingPlayground.length;
325
+ return this._insertItemInHavingPlaygroundAt(options, index);
326
+ }
327
+ addItemInHavingPlayground(options) {
328
+ const node = this._addItemInHavingPlayground(options);
329
+ const index = this.havingPlayground.indexOf(node);
330
+ node.create({
331
+ index,
332
+ parentNode: this,
333
+ parentKey: 'havingPlayground',
334
+ });
335
+ return node;
336
+ }
337
+ _insertQueryOrderByExpressionInOrderByAt(options, index) {
338
+ const queryOrderByExpressionOptions = {};
339
+ const relationOptions = { parentNode: this, parentKey: 'orderBy' };
340
+ let queryOrderByExpression;
341
+ if (options instanceof QueryOrderByExpression__1.default) {
342
+ options.ensureDelete(); // 同一实例不支持多处存在
343
+ queryOrderByExpression = options;
344
+ Object.assign(queryOrderByExpression, relationOptions);
345
+ }
346
+ else {
347
+ queryOrderByExpression = QueryOrderByExpression__1.default.from({
348
+ ...queryOrderByExpressionOptions,
349
+ ...options,
350
+ }, this, 'orderBy');
351
+ }
352
+ this.orderBy.splice(index, 0, queryOrderByExpression);
353
+ return queryOrderByExpression;
354
+ }
355
+ insertQueryOrderByExpressionInOrderByAt(options, index) {
356
+ const node = this._insertQueryOrderByExpressionInOrderByAt(options, index);
357
+ node.create({
358
+ index,
359
+ parentNode: this,
360
+ parentKey: 'orderBy',
361
+ });
362
+ return node;
363
+ }
364
+ _addQueryOrderByExpressionInOrderBy(options) {
365
+ const index = this.orderBy.length;
366
+ return this._insertQueryOrderByExpressionInOrderByAt(options, index);
367
+ }
368
+ addQueryOrderByExpressionInOrderBy(options) {
369
+ const node = this._addQueryOrderByExpressionInOrderBy(options);
370
+ const index = this.orderBy.indexOf(node);
371
+ node.create({
372
+ index,
373
+ parentNode: this,
374
+ parentKey: 'orderBy',
375
+ });
376
+ return node;
377
+ }
378
+ removeTypeAnnotation(options) {
379
+ let typeAnnotation;
380
+ if (typeof options === 'string') {
381
+ typeAnnotation = this.typeAnnotation;
382
+ if (!typeAnnotation) {
383
+ throw new Error('找不到类型标注 ' + options);
384
+ }
385
+ }
386
+ else {
387
+ typeAnnotation = options;
388
+ }
389
+ return typeAnnotation.delete();
390
+ }
391
+ __removeTypeAnnotation(typeAnnotation) {
392
+ const parentKey = typeAnnotation.parentKey;
393
+ const params = {
394
+ parentNode: this,
395
+ parentKey,
396
+ index: -1,
397
+ object: null,
398
+ oldObject: typeAnnotation,
399
+ };
400
+ if (parentKey) {
401
+ params.parentKey = parentKey;
402
+ if (Array.isArray(this[parentKey])) {
403
+ const index = this[parentKey].indexOf(typeAnnotation);
404
+ ~index && this[parentKey].splice(index, 1);
405
+ params.index = index;
406
+ }
407
+ else if (this[parentKey] === typeAnnotation) {
408
+ params.index = 0;
409
+ this[parentKey] = undefined;
410
+ }
411
+ }
412
+ return params;
413
+ }
414
+ removeSelect(options) {
415
+ let select;
416
+ if (typeof options === 'string') {
417
+ select = this.select;
418
+ if (!select) {
419
+ throw new Error('找不到查询选择子句 ' + options);
420
+ }
421
+ }
422
+ else {
423
+ select = options;
424
+ }
425
+ return select.delete();
426
+ }
427
+ removeFrom(options) {
428
+ let from;
429
+ if (typeof options === 'string') {
430
+ from = this.from;
431
+ if (!from) {
432
+ throw new Error('找不到查询 From 子句 ' + options);
433
+ }
434
+ }
435
+ else {
436
+ from = options;
437
+ }
438
+ return from.delete();
439
+ }
440
+ removeWhere(options) {
441
+ let where;
442
+ if (typeof options === 'string') {
443
+ where = this.where;
444
+ if (!where) {
445
+ throw new Error('找不到逻辑项 ' + options);
446
+ }
447
+ }
448
+ else {
449
+ where = options;
450
+ }
451
+ return where.delete();
452
+ }
453
+ removeItemInWherePlayground(options) {
454
+ let logicItem = options;
455
+ return logicItem.delete();
456
+ }
457
+ removeQueryGroupByExpressionInGroupBy(options) {
458
+ let queryGroupByExpression = options;
459
+ return queryGroupByExpression.delete();
460
+ }
461
+ removeHaving(options) {
462
+ let having;
463
+ if (typeof options === 'string') {
464
+ having = this.having;
465
+ if (!having) {
466
+ throw new Error('找不到逻辑项 ' + options);
467
+ }
468
+ }
469
+ else {
470
+ having = options;
471
+ }
472
+ return having.delete();
473
+ }
474
+ removeItemInHavingPlayground(options) {
475
+ let logicItem = options;
476
+ return logicItem.delete();
477
+ }
478
+ removeQueryOrderByExpressionInOrderBy(options) {
479
+ let queryOrderByExpression = options;
480
+ return queryOrderByExpression.delete();
481
+ }
482
+ removeLimit(options) {
483
+ let limit;
484
+ if (typeof options === 'string') {
485
+ limit = this.limit;
486
+ if (!limit) {
487
+ throw new Error('找不到查询分页子句 ' + options);
488
+ }
489
+ }
490
+ else {
491
+ limit = options;
492
+ }
493
+ return limit.delete();
494
+ }
495
+ __removeLogicItem(logicItem) {
496
+ const parentKey = logicItem.parentKey;
497
+ const params = {
498
+ parentNode: this,
499
+ parentKey,
500
+ index: -1,
501
+ object: null,
502
+ oldObject: logicItem,
503
+ };
504
+ if (parentKey) {
505
+ params.parentKey = parentKey;
506
+ if (Array.isArray(this[parentKey])) {
507
+ const index = this[parentKey].indexOf(logicItem);
508
+ ~index && this[parentKey].splice(index, 1);
509
+ params.index = index;
510
+ }
511
+ else if (this[parentKey] === logicItem) {
512
+ params.index = 0;
513
+ this[parentKey] = undefined;
514
+ }
515
+ }
516
+ return params;
517
+ }
518
+ //================================================================================
519
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
520
+ // 自动生成的代码已结束。下面可以手动编写。
521
+ //================================================================================
522
+ /**
523
+ * 获取添加时的默认选项
524
+ * @returns
525
+ */
526
+ static getDefaultOptions() {
527
+ return {
528
+ kind: 'Statement',
529
+ concept: 'CallQueryComponent',
530
+ label: '数据查询',
531
+ select: {
532
+ concept: 'QuerySelectExpression',
533
+ label: '查询组件Select子句',
534
+ distinct: false,
535
+ star: true,
536
+ selectElements: [],
537
+ },
538
+ from: null,
539
+ where: null,
540
+ groupBy: [],
541
+ having: null,
542
+ orderBy: [],
543
+ limit: {
544
+ concept: 'QueryLimitExpression',
545
+ label: '查询组件Limit子句',
546
+ pageElement: {
547
+ concept: 'NumericLiteral',
548
+ value: 1,
549
+ },
550
+ pageSizeElement: {
551
+ concept: 'NumericLiteral',
552
+ value: 1000,
553
+ },
554
+ },
555
+ };
556
+ }
557
+ toEmbeddedTSOfSubPart(key, list, options) {
558
+ let { code, state, multipleErrorType } = options;
559
+ if (list.length === 0)
560
+ return code;
561
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 1) + `.${key}(() => `;
562
+ list.forEach((item, index) => {
563
+ if (index > 0)
564
+ code += `,\n${(0, translator_1.indent)((state?.tabSize || 0) + 2)}() => `;
565
+ code += item?.toEmbeddedTS?.((0, translator_1.shiftState)(state, code, { tabSize: 0 }));
566
+ });
567
+ if (list.length > 1) {
568
+ if (multipleErrorType)
569
+ code += `,\n${(0, translator_1.indent)((state?.tabSize || 0) + 2)}() => ${multipleErrorType}`;
570
+ code += `\n${(0, translator_1.indent)((state?.tabSize || 0) + 1)}`;
571
+ }
572
+ code += ')\n';
573
+ return code;
574
+ }
575
+ toJS() {
576
+ return '';
577
+ // const { entityName } = this.from;
578
+ // return `await this.$services["_custom"]["load${entityName}"]({
579
+ // config: {
580
+ // download: false,
581
+ // },
582
+ // path: {},
583
+ // query: {},
584
+ // headers: {},
585
+ // body: {
586
+ // },
587
+ // })`;
588
+ }
589
+ // 2.11版本,自动推断返回类型
590
+ isAutoInfer() {
591
+ return this.ideVersion === '2.11' || this.ideVersion === '2.22';
592
+ }
593
+ // 2.22版本,实体支持列筛选 2.11版本不支持列筛选,需要运维select.selectElements
594
+ get entityPropertySelectable() {
595
+ return this.ideVersion === '2.22';
596
+ }
597
+ toEmbeddedTS(state) {
598
+ if (!this.typeAnnotation)
599
+ return `(function () {
600
+ return;
601
+ })()`;
602
+ let code = `(function(): `;
603
+ if (this.isAutoInfer()) {
604
+ code += `${this.typeAnnotation.toEmbeddedTS((0, translator_1.shiftState)(state, code))} {\n`;
605
+ }
606
+ else {
607
+ code += `{ list: nasl.collection.List<`;
608
+ code += `${this.typeAnnotation.toEmbeddedTS((0, translator_1.shiftState)(state, code))}>, total: nasl.core.Long } {\n`;
609
+ }
610
+ // 2.11版本后 分组使用别名
611
+ if (this.isAutoInfer()) {
612
+ // 分组别名(列别名)
613
+ this.groupBy.forEach((item, index, array) => {
614
+ code += (0, translator_1.indent)(state.tabSize + 1);
615
+ const groupElement = item.groupElement;
616
+ if (groupElement.asName)
617
+ code += `const __${groupElement.asName} = `;
618
+ if (groupElement.propertyName) {
619
+ code += groupElement.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: 0 }));
620
+ code += ';\n';
621
+ }
622
+ else
623
+ code += `__EMPTY_GROUP_BY_NAME__;\n`;
624
+ if (index === array.length - 1)
625
+ code += '\n';
626
+ });
627
+ }
628
+ // 聚合属性别名
629
+ this.select.selectAggregateElements.forEach((item, index, array) => {
630
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
631
+ const { asName, aggregateName, aggregateParam } = item;
632
+ if (asName)
633
+ code += `const __${asName} = `;
634
+ if (aggregateName) {
635
+ code += `nasl.langUtil.${aggregateName}(`;
636
+ code += aggregateParam.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: 0 }));
637
+ code += ');\n';
638
+ }
639
+ else
640
+ code += `__EMPTY_AGGREGATE_NAME__;\n`;
641
+ if (index === array.length - 1)
642
+ code += '\n';
643
+ });
644
+ if (this.from)
645
+ code += this.from.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
646
+ else
647
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}nasl.langUtil.FROM()\n`;
648
+ // where 子句
649
+ code = this.toEmbeddedTSOfSubPart('WHERE', this.where ? [this.where] : [], {
650
+ code,
651
+ state,
652
+ multipleErrorType: '__WHERE_MULTIPLE_CONDITION__',
653
+ });
654
+ if (this.select.selectAggregateElements.length) {
655
+ // 聚合属性
656
+ code = this.toEmbeddedTSOfSubPart('SELECT', this.select.selectAggregateElements, {
657
+ code,
658
+ state,
659
+ });
660
+ }
661
+ else {
662
+ // select实体字段
663
+ code = this.toEmbeddedTSOfSubPart('SELECT', this.select.selectFieldElements, {
664
+ code,
665
+ state,
666
+ });
667
+ }
668
+ // 分组属性(Group by)
669
+ code = this.toEmbeddedTSOfSubPart('GROUP_BY', this.groupBy, {
670
+ code,
671
+ state,
672
+ });
673
+ // 聚合属性过滤(Having)
674
+ code = this.toEmbeddedTSOfSubPart('HAVING', this.having ? [this.having] : [], {
675
+ code,
676
+ state,
677
+ multipleErrorType: '__HAVING_MULTIPLE_CONDITION__',
678
+ });
679
+ // 排序规则
680
+ code = this.toEmbeddedTSOfSubPart('ORDER_BY', this.orderBy, {
681
+ code,
682
+ state,
683
+ });
684
+ // 分页参数
685
+ code = this.toEmbeddedTSOfSubPart('LIMIT', this.limit ? [this.limit] : [], {
686
+ code,
687
+ state,
688
+ });
689
+ code += '\n';
690
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 1) + 'return;\n';
691
+ code += (0, translator_1.indent)((state?.tabSize || 0)) + '})()';
692
+ if (this.parentNode.concept !== 'Argument'
693
+ && this.parentKey !== 'test'
694
+ && this.parentKey !== 'patterns'
695
+ && this.parentNode.concept !== 'Assignment'
696
+ && this.parentNode.concept !== 'ForEachStatement'
697
+ && this.parentNode.concept !== 'SelectMembers'
698
+ && this.parentNode.concept !== 'UnaryExpression'
699
+ && this.parentNode.concept !== 'BinaryExpression'
700
+ && this.parentNode.concept !== 'StringInterpolation'
701
+ && this.parentNode.concept !== 'MemberExpression'
702
+ && ['NewMap', 'NewList'].includes(this.parentNode.concept)) {
703
+ code += ';';
704
+ }
705
+ code += '\n';
706
+ return code;
707
+ }
708
+ genPropertiesFrom(node, properties = []) {
709
+ if (!node)
710
+ return [];
711
+ const entityName = node.entityName;
712
+ const entityNamespace = node.entityNamespace;
713
+ // 生成整个实体类型 { entity1: Entity1 } 在2.11属于默认情况;在2.22勾选实体节点(isDotStar=true)时
714
+ if (!this.entityPropertySelectable || this.select.selectFieldElements.some((item) => item.entityAsName === entityName && item.isDotStar)) {
715
+ properties.push(StructureProperty__1.default.from({
716
+ name: utils.firstLowerCase(entityName),
717
+ typeAnnotation: TypeAnnotation__1.default.from({
718
+ concept: 'TypeAnnotation',
719
+ typeKind: 'reference',
720
+ typeName: entityName,
721
+ typeNamespace: entityNamespace,
722
+ }),
723
+ }));
724
+ }
725
+ else if (this.select.selectFieldElements.some((item) => item.entityAsName === entityName && item.propertyName)) {
726
+ // 2.22 选择字段时,生成选择字段的匿名数据结构 { entity1: { prop1, prop2 } }
727
+ const entity = this.app.findNodeByCompleteName(entityNamespace + '.' + entityName);
728
+ entity && properties.push(StructureProperty__1.default.from({
729
+ name: utils.firstLowerCase(entityName),
730
+ typeAnnotation: TypeAnnotation__1.default.from({
731
+ concept: 'TypeAnnotation',
732
+ typeKind: 'anonymousStructure',
733
+ properties: this.select.selectFieldElements
734
+ .filter((sel) => sel.entityAsName === entityName && sel.propertyName)
735
+ .map((item) => {
736
+ const property = entity.properties.find((prop) => prop.name === item.propertyName);
737
+ return property && StructureProperty__1.default.from({
738
+ name: item.propertyName,
739
+ typeAnnotation: TypeAnnotation__1.default.from(property.typeAnnotation),
740
+ });
741
+ }).filter(Boolean),
742
+ }),
743
+ }));
744
+ }
745
+ else { /* 实体或属性都不选择时,不生成数据结构 */ }
746
+ for (const sub of node.joinParts) {
747
+ this.genPropertiesFrom(sub, properties);
748
+ }
749
+ return properties;
750
+ }
751
+ genPropertyListOfFrom(node, entities = []) {
752
+ if (!node)
753
+ return [];
754
+ const entityName = node.entityName;
755
+ const entityNamespace = node.entityNamespace;
756
+ entities.push({
757
+ concept: 'StructureProperty',
758
+ name: utils.firstLowerCase(entityName),
759
+ typeAnnotation: {
760
+ concept: 'TypeAnnotation',
761
+ typeKind: 'reference',
762
+ typeName: entityName,
763
+ typeNamespace: entityNamespace,
764
+ },
765
+ });
766
+ for (const sub of node.joinParts) {
767
+ this.genPropertyListOfFrom(sub, entities);
768
+ }
769
+ return entities;
770
+ }
771
+ genPropertyListOfAggregate(node, entities) {
772
+ return node.select.selectAggregateElements
773
+ .filter((item) => item.aggregateName && item.asName)
774
+ .map((item) => {
775
+ let typeName;
776
+ if (['COUNT', 'COUNTD'].includes(item.aggregateName)) {
777
+ typeName = 'Long';
778
+ }
779
+ else if (['AVG'].includes(item.aggregateName)) {
780
+ const { entityAsName, propertyName } = item.aggregateParam;
781
+ const entity = entities.find((item) => item.name === entityAsName);
782
+ const property = entity?.properties.find((item) => item.name === propertyName);
783
+ const propertyTypeName = property?.typeAnnotation?.typeName;
784
+ if (propertyTypeName === 'Decimal') {
785
+ typeName = 'Decimal';
786
+ }
787
+ else {
788
+ typeName = 'Decimal';
789
+ }
790
+ }
791
+ else {
792
+ const { entityAsName, propertyName } = item.aggregateParam;
793
+ const entity = entities.find((item) => item.name === entityAsName);
794
+ const property = entity?.properties.find((item) => item.name === propertyName);
795
+ typeName = property?.typeAnnotation?.typeName;
796
+ }
797
+ return {
798
+ concept: 'StructureProperty',
799
+ name: item.asName,
800
+ typeAnnotation: {
801
+ concept: 'TypeAnnotation',
802
+ typeKind: 'primitive',
803
+ typeNamespace: 'nasl.core',
804
+ typeName,
805
+ },
806
+ };
807
+ });
808
+ }
809
+ genPropertyListOfGroupBy(node, entities) {
810
+ return node.groupBy
811
+ .filter((item) => item.groupElement && item.groupElement.propertyName && item.groupElement.asName)
812
+ .map((item) => {
813
+ const { entityAsName, propertyName, asName } = item.groupElement;
814
+ const entity = entities.find((item) => item.name === entityAsName);
815
+ const property = entity?.properties.find((item) => item.name === propertyName);
816
+ const propertyTypeAnnotation = property.typeAnnotation;
817
+ return {
818
+ concept: 'StructureProperty',
819
+ name: asName,
820
+ typeAnnotation: {
821
+ concept: propertyTypeAnnotation.concept,
822
+ typeKind: propertyTypeAnnotation.typeKind,
823
+ typeName: propertyTypeAnnotation.typeName,
824
+ typeNamespace: propertyTypeAnnotation.typeNamespace,
825
+ },
826
+ };
827
+ });
828
+ }
829
+ genStructure(structureName, properties = []) {
830
+ return Structure__1.default.from({
831
+ concept: 'Structure',
832
+ name: structureName || this.typeAnnotation?.typeName || `${utils.firstUpperCase(this.logic.name)}Structure`,
833
+ origin: 'CallQueryComponent',
834
+ properties,
835
+ });
836
+ }
837
+ saveStructure() {
838
+ // 没有数据源时不初始化数据结构
839
+ if (!this.entityInfos.length) {
840
+ return;
841
+ }
842
+ const entityNamespace = this.from?.entityNamespace;
843
+ const entities = this.app.findNodeByCompleteName(entityNamespace);
844
+ if (!this.isAutoInfer()) {
845
+ // 存量应用走之前的逻辑
846
+ return this.saveStructureNoInfer(entities);
847
+ }
848
+ const groupBy = this.groupBy;
849
+ const selectElements = this.select.selectAggregateElements;
850
+ let structureName;
851
+ let typeAnnotation;
852
+ // remove structure
853
+ if (this.typeAnnotation) {
854
+ const { typeNamespace, typeName, typeArguments } = this.typeAnnotation;
855
+ if (typeNamespace === 'app.structures') {
856
+ structureName = typeName;
857
+ this.removeStructure(structureName);
858
+ }
859
+ else if (typeNamespace === 'nasl.collection' && typeName === 'PageOf') {
860
+ // PageOf<Structures>
861
+ if (typeArguments[0].typeNamespace === 'app.structures') {
862
+ structureName = typeArguments[0].typeName;
863
+ this.removeStructure(structureName);
864
+ }
865
+ }
866
+ }
867
+ structureName = structureName || utils.unique(`${utils.firstUpperCase(this.logic.name)}Structure`, this.app.getStructureExistingNames());
868
+ const groupByLength = groupBy.filter((item) => item.groupElement?.propertyName && item.groupElement.asName).length;
869
+ const aggregateLength = selectElements.filter((item) => item.aggregateName && item.asName).length;
870
+ // 1. 有分组
871
+ if (groupByLength) {
872
+ if (!aggregateLength && groupByLength === 1) {
873
+ // 1.1 单分组无聚合:`{ list: List<列的类型>, total: Long }`
874
+ const { entityAsName, propertyName } = groupBy[0].groupElement;
875
+ const entity = entities.find((item) => item.name === entityAsName);
876
+ const property = entity?.properties.find((item) => item.name === propertyName);
877
+ const propertyTypeAnnotation = property.typeAnnotation;
878
+ typeAnnotation = TypeAnnotation__1.default.from({
879
+ concept: 'TypeAnnotation',
880
+ typeKind: 'anonymousStructure',
881
+ properties: [
882
+ StructureProperty__1.default.from({
883
+ name: 'list',
884
+ typeAnnotation: TypeAnnotation__1.default.from({
885
+ concept: 'TypeAnnotation',
886
+ typeKind: 'generic',
887
+ typeName: 'List',
888
+ typeNamespace: 'nasl.collection',
889
+ typeArguments: [TypeAnnotation__1.default.from({
890
+ concept: propertyTypeAnnotation.concept,
891
+ typeKind: propertyTypeAnnotation.typeKind,
892
+ typeName: propertyTypeAnnotation.typeName,
893
+ typeNamespace: propertyTypeAnnotation.typeNamespace,
894
+ })],
895
+ }, this.typeAnnotation, 'typeAnnotation'),
896
+ }),
897
+ StructureProperty__1.default.from({
898
+ name: 'total',
899
+ typeAnnotation: TypeAnnotation__1.default.from({
900
+ concept: 'TypeAnnotation',
901
+ typeKind: 'primitive',
902
+ typeNamespace: 'nasl.core',
903
+ typeName: 'Long',
904
+ }, this.typeAnnotation, 'typeAnnotation'),
905
+ }),
906
+ ],
907
+ }, this, 'typeAnnotation');
908
+ }
909
+ else {
910
+ // 1.2 多分组:`{ list: List<anonymousStructure>, total: Long }`
911
+ typeAnnotation = TypeAnnotation__1.default.from({
912
+ concept: 'TypeAnnotation',
913
+ typeKind: 'anonymousStructure',
914
+ properties: [
915
+ StructureProperty__1.default.from({
916
+ name: 'list',
917
+ typeAnnotation: TypeAnnotation__1.default.from({
918
+ concept: 'TypeAnnotation',
919
+ typeKind: 'generic',
920
+ typeName: 'List',
921
+ typeNamespace: 'nasl.collection',
922
+ typeArguments: [
923
+ TypeAnnotation__1.default.from({
924
+ concept: 'TypeAnnotation',
925
+ typeKind: 'anonymousStructure',
926
+ properties: [
927
+ ...this.genPropertyListOfGroupBy(this, entities),
928
+ ...this.genPropertyListOfAggregate(this, entities),
929
+ ],
930
+ }),
931
+ ],
932
+ }, this.typeAnnotation, 'typeAnnotation'),
933
+ }),
934
+ StructureProperty__1.default.from({
935
+ name: 'total',
936
+ typeAnnotation: TypeAnnotation__1.default.from({
937
+ concept: 'TypeAnnotation',
938
+ typeKind: 'primitive',
939
+ typeNamespace: 'nasl.core',
940
+ typeName: 'Long',
941
+ }, this.typeAnnotation, 'typeAnnotation'),
942
+ }),
943
+ ],
944
+ }, this, 'typeAnnotation');
945
+ }
946
+ }
947
+ else { // 2. 无分组
948
+ if (aggregateLength) {
949
+ if (aggregateLength === 1) {
950
+ // 2.1 单聚合:`基本类型`
951
+ let typeName;
952
+ if (['COUNT', 'COUNTD'].includes(selectElements[0].aggregateName)) {
953
+ // 2.1.1. `COUNT`、`COUNTD` 返回 `Long`
954
+ typeName = 'Long';
955
+ }
956
+ else if (['AVG'].includes(selectElements[0].aggregateName)) {
957
+ const { entityAsName, propertyName } = selectElements[0].aggregateParam;
958
+ const entity = entities.find((item) => item.name === entityAsName);
959
+ const property = entity?.properties.find((item) => item.name === propertyName);
960
+ const propertyTypeName = property?.typeAnnotation?.typeName;
961
+ if (propertyTypeName === 'Decimal') {
962
+ typeName = 'Decimal';
963
+ }
964
+ else {
965
+ typeName = 'Double';
966
+ }
967
+ }
968
+ else {
969
+ // 2.1.3. 其他返回列类型,包含:`Long`、`Long`、`Double`
970
+ const { entityAsName, propertyName } = selectElements[0].aggregateParam;
971
+ const entity = entities.find((item) => item.name === entityAsName);
972
+ const property = entity?.properties.find((item) => item.name === propertyName);
973
+ typeName = property?.typeAnnotation?.typeName;
974
+ }
975
+ typeAnnotation = TypeAnnotation__1.default.from({
976
+ concept: 'TypeAnnotation',
977
+ typeKind: 'primitive',
978
+ typeName,
979
+ typeNamespace: 'nasl.core',
980
+ }, this, 'typeAnnotation');
981
+ }
982
+ else {
983
+ // 2.2 多聚合:`{ Structure }`
984
+ typeAnnotation = TypeAnnotation__1.default.from({
985
+ concept: 'TypeAnnotation',
986
+ typeKind: 'anonymousStructure',
987
+ properties: [...this.genPropertyListOfAggregate(this, entities)],
988
+ }, this, 'typeAnnotation');
989
+ }
990
+ }
991
+ else {
992
+ // 2.3 无分组&&无聚合 (默认情况):`{ list: List<Structure>, total: Long }`
993
+ typeAnnotation = TypeAnnotation__1.default.from({
994
+ concept: 'TypeAnnotation',
995
+ typeKind: 'anonymousStructure',
996
+ properties: [
997
+ StructureProperty__1.default.from({
998
+ name: 'list',
999
+ typeAnnotation: TypeAnnotation__1.default.from({
1000
+ concept: 'TypeAnnotation',
1001
+ typeKind: 'generic',
1002
+ typeName: 'List',
1003
+ typeNamespace: 'nasl.collection',
1004
+ typeArguments: [
1005
+ TypeAnnotation__1.default.from({
1006
+ concept: 'TypeAnnotation',
1007
+ typeKind: 'anonymousStructure',
1008
+ properties: this.genPropertiesFrom(this.from),
1009
+ }),
1010
+ ],
1011
+ }, this.typeAnnotation, 'typeAnnotation'),
1012
+ }),
1013
+ StructureProperty__1.default.from({
1014
+ name: 'total',
1015
+ typeAnnotation: TypeAnnotation__1.default.from({
1016
+ concept: 'TypeAnnotation',
1017
+ typeKind: 'primitive',
1018
+ typeNamespace: 'nasl.core',
1019
+ typeName: 'Long',
1020
+ }, this.typeAnnotation, 'typeAnnotation'),
1021
+ }),
1022
+ ],
1023
+ }, this, 'typeAnnotation');
1024
+ }
1025
+ }
1026
+ this.update({ typeAnnotation });
1027
+ }
1028
+ saveStructureNoInfer(entities = []) {
1029
+ const source = this.genStructure(null, [
1030
+ ...this.genPropertyListOfFrom(this.from),
1031
+ ...this.genPropertyListOfAggregate(this, entities),
1032
+ ]);
1033
+ if (this.typeAnnotation) {
1034
+ // 老版本没有 ListTotal 结构,支持匿名数据结构
1035
+ if (this.typeAnnotation.typeKind === 'anonymousStructure') {
1036
+ const typeAnnotation = TypeAnnotation__1.default.from({
1037
+ concept: 'TypeAnnotation',
1038
+ typeKind: 'anonymousStructure',
1039
+ properties: source.properties,
1040
+ }, this, 'typeAnnotation');
1041
+ this.update({ typeAnnotation });
1042
+ }
1043
+ else {
1044
+ const structure = this.app.structures.find((item) => item.name === this.typeAnnotation.typeName);
1045
+ if (structure) {
1046
+ const properties = source.properties.map((property) => StructureProperty__1.default.from(property, structure, 'properties'));
1047
+ structure.update({
1048
+ properties,
1049
+ });
1050
+ }
1051
+ else
1052
+ this.app.addStructure(source);
1053
+ }
1054
+ }
1055
+ else {
1056
+ source.name = utils.unique(source.name, this.app.getStructureExistingNames());
1057
+ this.app.addStructure(source);
1058
+ const typeAnnotation = TypeAnnotation__1.default.from({
1059
+ concept: 'TypeAnnotation',
1060
+ typeKind: 'reference',
1061
+ typeName: source.name,
1062
+ typeNamespace: `app.structures`,
1063
+ }, this, 'typeAnnotation');
1064
+ this.update({
1065
+ typeAnnotation,
1066
+ });
1067
+ }
1068
+ }
1069
+ removeStructure(structureName) {
1070
+ try {
1071
+ if (this.typeAnnotation) {
1072
+ const { typeNamespace, typeName, typeArguments } = this.typeAnnotation;
1073
+ if (typeNamespace === 'app.structures') {
1074
+ // Structures
1075
+ structureName = typeName;
1076
+ this.app.removeStructure(structureName);
1077
+ }
1078
+ else if (typeNamespace === 'nasl.collection' && typeName === 'PageOf') {
1079
+ // PageOf<Structures>
1080
+ if (typeArguments[0].typeNamespace === 'app.structures') {
1081
+ structureName = typeArguments[0].typeName;
1082
+ this.app.removeStructure(structureName);
1083
+ }
1084
+ }
1085
+ }
1086
+ }
1087
+ catch { }
1088
+ }
1089
+ getEntityInfos(node, set = new Set()) {
1090
+ if (node?.entityName)
1091
+ set.add({
1092
+ namespace: node.entityNamespace,
1093
+ name: node.entityName,
1094
+ });
1095
+ node?.joinParts?.forEach((child) => {
1096
+ this.getEntityInfos(child, set);
1097
+ });
1098
+ return Array.from(set);
1099
+ }
1100
+ get entityInfos() {
1101
+ return this.getEntityInfos(this.from);
1102
+ }
1103
+ getCompletionPropertyOfEntities() {
1104
+ const firstEntityInfo = this.entityInfos[0];
1105
+ if (firstEntityInfo) {
1106
+ const namespace = firstEntityInfo.namespace;
1107
+ const entities = this.app.findNodeByCompleteName(namespace);
1108
+ if (Array.isArray(entities)) {
1109
+ const children = this.entityInfos
1110
+ .map(({ name }) => entities.find((item) => item.name === name))
1111
+ .filter((item) => item)
1112
+ .map((entity) => ({
1113
+ concept: 'Entity',
1114
+ name: entity.name,
1115
+ children: entity.properties.map((property) => {
1116
+ const expression = LogicItem__1.default.from({
1117
+ concept: 'QueryFieldExpression',
1118
+ name: property.name,
1119
+ value: `${entity.name}.${property.name}`,
1120
+ entityAsName: entity.name,
1121
+ propertyName: property.name,
1122
+ });
1123
+ expression.parentNode = this;
1124
+ const completionProperty = new CompletionProperty__1.default({
1125
+ concept: 'CompletionProperty',
1126
+ name: property.name,
1127
+ value: `${entity.name}.${property.name}`,
1128
+ expression,
1129
+ });
1130
+ completionProperty.icon = 'property';
1131
+ // 标记实体属性是否是符合类型
1132
+ Object.assign(completionProperty, { isComplexType: property.typeAnnotation.isComplexType() });
1133
+ return completionProperty;
1134
+ }),
1135
+ }));
1136
+ if (children.length) {
1137
+ return {
1138
+ name: '实体',
1139
+ icon: 'category',
1140
+ children,
1141
+ };
1142
+ }
1143
+ }
1144
+ }
1145
+ }
1146
+ getCompletionPropertyOfAggregateAsNames() {
1147
+ const children = this.select?.selectElements
1148
+ ?.filter((item) => item.concept === 'QueryAggregateExpression' && item.asName)
1149
+ .map((item) => new CompletionProperty__1.default({
1150
+ concept: 'CompletionProperty',
1151
+ name: item.asName,
1152
+ value: `inner.${item.asName}`,
1153
+ expression: LogicItem__1.default.from({
1154
+ concept: 'Identifier',
1155
+ name: item.asName,
1156
+ namespace: 'inner',
1157
+ }),
1158
+ }));
1159
+ if (!children || children.length === 0)
1160
+ return;
1161
+ children.forEach((item) => {
1162
+ item.icon = 'variable';
1163
+ });
1164
+ return { name: '聚合属性别名', icon: 'category', children, expanded: true };
1165
+ }
1166
+ getCompletionPropertyOfGroupByAsNames() {
1167
+ const children = this.groupBy
1168
+ ?.filter((item) => item.concept === 'QueryGroupByExpression' && item.groupElement?.asName)
1169
+ .map((item) => new CompletionProperty__1.default({
1170
+ concept: 'CompletionProperty',
1171
+ name: item.groupElement.asName,
1172
+ value: `inner.${item.groupElement.asName}`,
1173
+ expression: LogicItem__1.default.from({
1174
+ concept: 'Identifier',
1175
+ name: item.groupElement.asName,
1176
+ namespace: 'inner',
1177
+ }),
1178
+ }));
1179
+ if (!children || children.length === 0)
1180
+ return;
1181
+ children.forEach((item) => {
1182
+ item.icon = 'variable';
1183
+ });
1184
+ return { name: '分组属性别名', icon: 'category', children, expanded: true };
1185
+ }
1186
+ /**
1187
+ * 获取当前内部使用到的变量
1188
+ */
1189
+ getContentVariable() {
1190
+ const contentVariables = [];
1191
+ utils.traverse(({ node }) => {
1192
+ if (node?.parentNode?.concept !== 'MemberExpression') {
1193
+ if (node?.concept === 'MemberExpression') {
1194
+ contentVariables.push(node);
1195
+ }
1196
+ else if (node?.concept === 'Identifier') {
1197
+ // 因为要是父级是MemberExpression, 就放入了父级,子级就不需要了
1198
+ contentVariables.push(node);
1199
+ }
1200
+ }
1201
+ }, { node: this }, {
1202
+ mode: 'anyObject',
1203
+ excludedKeySet: new Set(['parentNode', '_events', 'globalDataMap', 'havingPlayground', 'wherePlayground']),
1204
+ });
1205
+ return contentVariables;
1206
+ }
1207
+ // 临时升级脚本
1208
+ // 将所有from的实体,在selectElements中初始化一个isDotStar=true的QueryFieldExpression
1209
+ initFieldSelectElement(node = this) {
1210
+ const loop = (from) => {
1211
+ node.select.addQueryFieldExpressionInSelectElements({
1212
+ entityAsName: from.entityName,
1213
+ isDotStar: true,
1214
+ });
1215
+ from.joinParts?.forEach(loop);
1216
+ };
1217
+ loop(node.from);
1218
+ }
1219
+ };
1220
+ __decorate([
1221
+ (0, decorators_1.property)('TypeAnnotation')
1222
+ ], CallQueryComponent.prototype, "typeAnnotation", void 0);
1223
+ __decorate([
1224
+ (0, decorators_1.property)('QuerySelectExpression')
1225
+ ], CallQueryComponent.prototype, "select", void 0);
1226
+ __decorate([
1227
+ (0, decorators_1.property)('QueryFromExpression')
1228
+ ], CallQueryComponent.prototype, "from", void 0);
1229
+ __decorate([
1230
+ (0, decorators_1.property)('LogicItem')
1231
+ ], CallQueryComponent.prototype, "where", void 0);
1232
+ __decorate([
1233
+ (0, decorators_1.property)('LogicItem')
1234
+ ], CallQueryComponent.prototype, "wherePlayground", void 0);
1235
+ __decorate([
1236
+ (0, decorators_1.property)('QueryGroupByExpression')
1237
+ ], CallQueryComponent.prototype, "groupBy", void 0);
1238
+ __decorate([
1239
+ (0, decorators_1.property)('LogicItem')
1240
+ ], CallQueryComponent.prototype, "having", void 0);
1241
+ __decorate([
1242
+ (0, decorators_1.property)('LogicItem')
1243
+ ], CallQueryComponent.prototype, "havingPlayground", void 0);
1244
+ __decorate([
1245
+ (0, decorators_1.property)('QueryOrderByExpression')
1246
+ ], CallQueryComponent.prototype, "orderBy", void 0);
1247
+ __decorate([
1248
+ (0, decorators_1.property)('QueryLimitExpression')
1249
+ ], CallQueryComponent.prototype, "limit", void 0);
1250
+ __decorate([
1251
+ (0, decorators_1.property)()
1252
+ ], CallQueryComponent.prototype, "ideVersion", void 0);
1253
+ __decorate([
1254
+ (0, translator_1.withSourceMap)()
1255
+ ], CallQueryComponent.prototype, "toEmbeddedTS", null);
1256
+ CallQueryComponent = CallQueryComponent_1 = __decorate([
1257
+ decorators_1.className,
1258
+ (0, decorators_1.concept)('数据查询')
1259
+ // @ts-ignore
1260
+ ], CallQueryComponent);
1261
+ exports.CallQueryComponent = CallQueryComponent;
1262
+ exports.default = CallQueryComponent;
1263
+ //================================================================================
1264
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1265
+ // 自动生成的代码已结束。下面可以手动编写。
1266
+ //================================================================================
1267
+ //# sourceMappingURL=CallQueryComponent__.js.map