@lcap/nasl 2.18.0 → 2.19.0-beta.2

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 (603) hide show
  1. package/out/automate/engine/index.d.ts +2 -2
  2. package/out/automate/engine/index.js +6 -7
  3. package/out/automate/engine/index.js.map +1 -1
  4. package/out/automate/engine/operators.d.ts +2 -2
  5. package/out/automate/engine/operators.js +14 -5
  6. package/out/automate/engine/operators.js.map +1 -1
  7. package/out/automate/engine/uniqueName.d.ts +2 -2
  8. package/out/automate/engine/uniqueName.js +5 -5
  9. package/out/automate/engine/uniqueName.js.map +1 -1
  10. package/out/automate/engine/utils.js +4 -1
  11. package/out/automate/engine/utils.js.map +1 -1
  12. package/out/automate/template/myProcess.d.ts +1 -1
  13. package/out/automate/template/myProcess.js +9023 -9023
  14. package/out/automate/template/myProcess.js.map +1 -1
  15. package/out/bak/translator.js +18 -25
  16. package/out/bak/translator.js.map +1 -1
  17. package/out/common/BaseNode.d.ts +12 -0
  18. package/out/common/BaseNode.js +89 -14
  19. package/out/common/BaseNode.js.map +1 -1
  20. package/out/common/Command.d.ts +1 -0
  21. package/out/common/Command.js +5 -1
  22. package/out/common/Command.js.map +1 -1
  23. package/out/common/EventEmitter.d.ts +1 -0
  24. package/out/common/EventEmitter.js +3 -0
  25. package/out/common/EventEmitter.js.map +1 -1
  26. package/out/common/Messager.js +1 -0
  27. package/out/common/Messager.js.map +1 -1
  28. package/out/concepts/Abort__.d.ts +25 -0
  29. package/out/concepts/Abort__.js +80 -0
  30. package/out/concepts/Abort__.js.map +1 -0
  31. package/out/concepts/Anchor__.d.ts +1 -0
  32. package/out/concepts/Anchor__.js +3 -0
  33. package/out/concepts/Anchor__.js.map +1 -1
  34. package/out/concepts/AnonymousFunction__.d.ts +2 -0
  35. package/out/concepts/AnonymousFunction__.js +43 -2
  36. package/out/concepts/AnonymousFunction__.js.map +1 -1
  37. package/out/concepts/App__.d.ts +109 -256
  38. package/out/concepts/App__.js +351 -392
  39. package/out/concepts/App__.js.map +1 -1
  40. package/out/concepts/Argument__.d.ts +1 -0
  41. package/out/concepts/Argument__.js +3 -0
  42. package/out/concepts/Argument__.js.map +1 -1
  43. package/out/concepts/Assignee__.d.ts +1 -0
  44. package/out/concepts/Assignee__.js +7 -3
  45. package/out/concepts/Assignee__.js.map +1 -1
  46. package/out/concepts/AssignmentLine__.d.ts +1 -0
  47. package/out/concepts/AssignmentLine__.js +3 -0
  48. package/out/concepts/AssignmentLine__.js.map +1 -1
  49. package/out/concepts/Assignment__.d.ts +1 -0
  50. package/out/concepts/Assignment__.js +3 -0
  51. package/out/concepts/Assignment__.js.map +1 -1
  52. package/out/concepts/Attribute__.d.ts +10 -14
  53. package/out/concepts/Attribute__.js +15 -39
  54. package/out/concepts/Attribute__.js.map +1 -1
  55. package/out/concepts/BatchAssignment__.d.ts +3 -0
  56. package/out/concepts/BatchAssignment__.js +111 -47
  57. package/out/concepts/BatchAssignment__.js.map +1 -1
  58. package/out/concepts/BinaryExpression__.d.ts +1 -0
  59. package/out/concepts/BinaryExpression__.js +3 -0
  60. package/out/concepts/BinaryExpression__.js.map +1 -1
  61. package/out/concepts/BindAttribute__.d.ts +13 -0
  62. package/out/concepts/BindAttribute__.js +296 -31
  63. package/out/concepts/BindAttribute__.js.map +1 -1
  64. package/out/concepts/BindDirective__.d.ts +13 -0
  65. package/out/concepts/BindDirective__.js +223 -15
  66. package/out/concepts/BindDirective__.js.map +1 -1
  67. package/out/concepts/BindEvent__.d.ts +6 -0
  68. package/out/concepts/BindEvent__.js +30 -22
  69. package/out/concepts/BindEvent__.js.map +1 -1
  70. package/out/concepts/BindStyle__.d.ts +13 -0
  71. package/out/concepts/BindStyle__.js +200 -1
  72. package/out/concepts/BindStyle__.js.map +1 -1
  73. package/out/concepts/BooleanLiteral__.d.ts +1 -0
  74. package/out/concepts/BooleanLiteral__.js +3 -0
  75. package/out/concepts/BooleanLiteral__.js.map +1 -1
  76. package/out/concepts/CallFunction__.d.ts +1 -0
  77. package/out/concepts/CallFunction__.js +54 -18
  78. package/out/concepts/CallFunction__.js.map +1 -1
  79. package/out/concepts/CallInterface__.d.ts +2 -0
  80. package/out/concepts/CallInterface__.js +55 -7
  81. package/out/concepts/CallInterface__.js.map +1 -1
  82. package/out/concepts/CallLogic__.d.ts +14 -1
  83. package/out/concepts/CallLogic__.js +244 -147
  84. package/out/concepts/CallLogic__.js.map +1 -1
  85. package/out/concepts/CallQueryComponent__.d.ts +3 -0
  86. package/out/concepts/CallQueryComponent__.js +113 -39
  87. package/out/concepts/CallQueryComponent__.js.map +1 -1
  88. package/out/concepts/Comment__.d.ts +1 -0
  89. package/out/concepts/Comment__.js +3 -0
  90. package/out/concepts/Comment__.js.map +1 -1
  91. package/out/concepts/CompletionProperty__.d.ts +2 -0
  92. package/out/concepts/CompletionProperty__.js +4 -0
  93. package/out/concepts/CompletionProperty__.js.map +1 -1
  94. package/out/concepts/ConfigGroup__.d.ts +2 -0
  95. package/out/concepts/ConfigGroup__.js +16 -0
  96. package/out/concepts/ConfigGroup__.js.map +1 -1
  97. package/out/concepts/ConfigPropertyValue__.d.ts +1 -0
  98. package/out/concepts/ConfigPropertyValue__.js +3 -0
  99. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  100. package/out/concepts/ConfigProperty__.d.ts +24 -0
  101. package/out/concepts/ConfigProperty__.js +83 -0
  102. package/out/concepts/ConfigProperty__.js.map +1 -1
  103. package/out/concepts/Configuration__.d.ts +2 -0
  104. package/out/concepts/Configuration__.js +16 -0
  105. package/out/concepts/Configuration__.js.map +1 -1
  106. package/out/concepts/Constant__.d.ts +6 -0
  107. package/out/concepts/Constant__.js +9 -0
  108. package/out/concepts/Constant__.js.map +1 -1
  109. package/out/concepts/DataElement__.d.ts +1 -0
  110. package/out/concepts/DataElement__.js +3 -0
  111. package/out/concepts/DataElement__.js.map +1 -1
  112. package/out/concepts/DataSource__.d.ts +5 -0
  113. package/out/concepts/DataSource__.js +70 -1
  114. package/out/concepts/DataSource__.js.map +1 -1
  115. package/out/concepts/DatabaseTypeAnnotation__.d.ts +31 -0
  116. package/out/concepts/DatabaseTypeAnnotation__.js +78 -0
  117. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -0
  118. package/out/concepts/Destination__.d.ts +5 -1
  119. package/out/concepts/Destination__.js +183 -33
  120. package/out/concepts/Destination__.js.map +1 -1
  121. package/out/concepts/End__.d.ts +1 -0
  122. package/out/concepts/End__.js +4 -1
  123. package/out/concepts/End__.js.map +1 -1
  124. package/out/concepts/EntityIndex__.d.ts +1 -0
  125. package/out/concepts/EntityIndex__.js +3 -0
  126. package/out/concepts/EntityIndex__.js.map +1 -1
  127. package/out/concepts/EntityProperty__.d.ts +34 -5
  128. package/out/concepts/EntityProperty__.js +197 -56
  129. package/out/concepts/EntityProperty__.js.map +1 -1
  130. package/out/concepts/Entity__.d.ts +3 -1
  131. package/out/concepts/Entity__.js +33 -1
  132. package/out/concepts/Entity__.js.map +1 -1
  133. package/out/concepts/EnumItem__.d.ts +6 -5
  134. package/out/concepts/EnumItem__.js +9 -6
  135. package/out/concepts/EnumItem__.js.map +1 -1
  136. package/out/concepts/Enum__.d.ts +21 -19
  137. package/out/concepts/Enum__.js +31 -1
  138. package/out/concepts/Enum__.js.map +1 -1
  139. package/out/concepts/Event__.d.ts +1 -0
  140. package/out/concepts/Event__.js +3 -0
  141. package/out/concepts/Event__.js.map +1 -1
  142. package/out/concepts/ExternalDestination__.d.ts +2 -0
  143. package/out/concepts/ExternalDestination__.js +25 -4
  144. package/out/concepts/ExternalDestination__.js.map +1 -1
  145. package/out/concepts/ForEachStatement__.d.ts +1 -0
  146. package/out/concepts/ForEachStatement__.js +5 -0
  147. package/out/concepts/ForEachStatement__.js.map +1 -1
  148. package/out/concepts/FrontendLibrary__.d.ts +213 -0
  149. package/out/concepts/FrontendLibrary__.js +352 -0
  150. package/out/concepts/FrontendLibrary__.js.map +1 -0
  151. package/out/concepts/Frontend__.d.ts +373 -0
  152. package/out/concepts/Frontend__.js +685 -0
  153. package/out/concepts/Frontend__.js.map +1 -0
  154. package/out/concepts/Function__.d.ts +1 -0
  155. package/out/concepts/Function__.js +3 -0
  156. package/out/concepts/Function__.js.map +1 -1
  157. package/out/concepts/Identifier__.d.ts +2 -0
  158. package/out/concepts/Identifier__.js +43 -11
  159. package/out/concepts/Identifier__.js.map +1 -1
  160. package/out/concepts/IfStatement__.d.ts +1 -0
  161. package/out/concepts/IfStatement__.js +5 -2
  162. package/out/concepts/IfStatement__.js.map +1 -1
  163. package/out/concepts/Integration__.d.ts +53 -0
  164. package/out/concepts/Integration__.js +143 -0
  165. package/out/concepts/Integration__.js.map +1 -0
  166. package/out/concepts/InterfaceParam__.d.ts +1 -3
  167. package/out/concepts/InterfaceParam__.js +3 -56
  168. package/out/concepts/InterfaceParam__.js.map +1 -1
  169. package/out/concepts/Interface__.d.ts +14 -0
  170. package/out/concepts/Interface__.js +87 -0
  171. package/out/concepts/Interface__.js.map +1 -1
  172. package/out/concepts/JSBlock__.d.ts +1 -0
  173. package/out/concepts/JSBlock__.js +8 -1
  174. package/out/concepts/JSBlock__.js.map +1 -1
  175. package/out/concepts/JavaLogic__.d.ts +42 -0
  176. package/out/concepts/JavaLogic__.js +122 -0
  177. package/out/concepts/JavaLogic__.js.map +1 -0
  178. package/out/concepts/LogicItem__.d.ts +7 -1
  179. package/out/concepts/LogicItem__.js +11 -0
  180. package/out/concepts/LogicItem__.js.map +1 -1
  181. package/out/concepts/Logic__.d.ts +8 -0
  182. package/out/concepts/Logic__.js +104 -35
  183. package/out/concepts/Logic__.js.map +1 -1
  184. package/out/concepts/MatchCase__.d.ts +1 -0
  185. package/out/concepts/MatchCase__.js +4 -1
  186. package/out/concepts/MatchCase__.js.map +1 -1
  187. package/out/concepts/Match__.d.ts +6 -3
  188. package/out/concepts/Match__.js +123 -22
  189. package/out/concepts/Match__.js.map +1 -1
  190. package/out/concepts/MemberExpression__.d.ts +1 -0
  191. package/out/concepts/MemberExpression__.js +14 -2
  192. package/out/concepts/MemberExpression__.js.map +1 -1
  193. package/out/concepts/MicroApp__.d.ts +51 -0
  194. package/out/concepts/MicroApp__.js +113 -0
  195. package/out/concepts/MicroApp__.js.map +1 -0
  196. package/out/concepts/Module__.d.ts +96 -56
  197. package/out/concepts/Module__.js +169 -58
  198. package/out/concepts/Module__.js.map +1 -1
  199. package/out/concepts/Namespace__.d.ts +1 -0
  200. package/out/concepts/Namespace__.js +3 -0
  201. package/out/concepts/Namespace__.js.map +1 -1
  202. package/out/concepts/NewComposite__.d.ts +345 -0
  203. package/out/concepts/NewComposite__.js +1084 -0
  204. package/out/concepts/NewComposite__.js.map +1 -0
  205. package/out/concepts/NewList__.d.ts +132 -0
  206. package/out/concepts/NewList__.js +378 -0
  207. package/out/concepts/NewList__.js.map +1 -0
  208. package/out/concepts/NewMap__.d.ts +223 -0
  209. package/out/concepts/NewMap__.js +522 -0
  210. package/out/concepts/NewMap__.js.map +1 -0
  211. package/out/concepts/New__.d.ts +20 -0
  212. package/out/concepts/New__.js +69 -0
  213. package/out/concepts/New__.js.map +1 -0
  214. package/out/concepts/NullLiteral__.d.ts +1 -0
  215. package/out/concepts/NullLiteral__.js +3 -0
  216. package/out/concepts/NullLiteral__.js.map +1 -1
  217. package/out/concepts/NumericLiteral__.d.ts +1 -0
  218. package/out/concepts/NumericLiteral__.js +6 -9
  219. package/out/concepts/NumericLiteral__.js.map +1 -1
  220. package/out/concepts/OqlQueryComponent__.d.ts +1 -1
  221. package/out/concepts/OqlQueryComponent__.js +43 -58
  222. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  223. package/out/concepts/Param__.d.ts +9 -3
  224. package/out/concepts/Param__.js +56 -62
  225. package/out/concepts/Param__.js.map +1 -1
  226. package/out/concepts/Point__.d.ts +1 -0
  227. package/out/concepts/Point__.js +3 -0
  228. package/out/concepts/Point__.js.map +1 -1
  229. package/out/concepts/ProcessComponent__.d.ts +1 -0
  230. package/out/concepts/ProcessComponent__.js +3 -0
  231. package/out/concepts/ProcessComponent__.js.map +1 -1
  232. package/out/concepts/ProcessElement__.d.ts +1 -0
  233. package/out/concepts/ProcessElement__.js +47 -14
  234. package/out/concepts/ProcessElement__.js.map +1 -1
  235. package/out/concepts/ProcessOutcome__.d.ts +1 -0
  236. package/out/concepts/ProcessOutcome__.js +4 -1
  237. package/out/concepts/ProcessOutcome__.js.map +1 -1
  238. package/out/concepts/ProcessOutcomes__.d.ts +31 -0
  239. package/out/concepts/{ConstructArgument__.js → ProcessOutcomes__.js} +30 -48
  240. package/out/concepts/ProcessOutcomes__.js.map +1 -0
  241. package/out/concepts/Process__.d.ts +5 -20
  242. package/out/concepts/Process__.js +4 -7
  243. package/out/concepts/Process__.js.map +1 -1
  244. package/out/concepts/QueryAggregateExpression__.d.ts +1 -0
  245. package/out/concepts/QueryAggregateExpression__.js +3 -0
  246. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  247. package/out/concepts/QueryFieldExpression__.d.ts +1 -0
  248. package/out/concepts/QueryFieldExpression__.js +7 -1
  249. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  250. package/out/concepts/QueryFromExpression__.d.ts +1 -0
  251. package/out/concepts/QueryFromExpression__.js +3 -0
  252. package/out/concepts/QueryFromExpression__.js.map +1 -1
  253. package/out/concepts/QueryGroupByExpression__.d.ts +1 -0
  254. package/out/concepts/QueryGroupByExpression__.js +3 -0
  255. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  256. package/out/concepts/QueryJoinExpression__.d.ts +1 -0
  257. package/out/concepts/QueryJoinExpression__.js +3 -0
  258. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  259. package/out/concepts/QueryLimitExpression__.d.ts +1 -0
  260. package/out/concepts/QueryLimitExpression__.js +3 -0
  261. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  262. package/out/concepts/QueryOrderByExpression__.d.ts +1 -0
  263. package/out/concepts/QueryOrderByExpression__.js +3 -0
  264. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  265. package/out/concepts/QuerySelectExpression__.d.ts +105 -16
  266. package/out/concepts/QuerySelectExpression__.js +102 -9
  267. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  268. package/out/concepts/Rect__.d.ts +1 -0
  269. package/out/concepts/Rect__.js +3 -0
  270. package/out/concepts/Rect__.js.map +1 -1
  271. package/out/concepts/Return__.d.ts +6 -3
  272. package/out/concepts/Return__.js +15 -60
  273. package/out/concepts/Return__.js.map +1 -1
  274. package/out/concepts/Role__.d.ts +1 -0
  275. package/out/concepts/Role__.js +3 -0
  276. package/out/concepts/Role__.js.map +1 -1
  277. package/out/concepts/SelectMembers__.d.ts +1 -0
  278. package/out/concepts/SelectMembers__.js +6 -3
  279. package/out/concepts/SelectMembers__.js.map +1 -1
  280. package/out/concepts/Slot__.d.ts +17 -0
  281. package/out/concepts/Slot__.js +46 -0
  282. package/out/concepts/Slot__.js.map +1 -1
  283. package/out/concepts/SqlQueryComponent__.d.ts +1 -1
  284. package/out/concepts/SqlQueryComponent__.js +3 -46
  285. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  286. package/out/concepts/Start__.d.ts +1 -0
  287. package/out/concepts/Start__.js +3 -0
  288. package/out/concepts/Start__.js.map +1 -1
  289. package/out/concepts/StringInterpolation__.d.ts +1 -0
  290. package/out/concepts/StringInterpolation__.js +17 -2
  291. package/out/concepts/StringInterpolation__.js.map +1 -1
  292. package/out/concepts/StringLiteral__.d.ts +1 -0
  293. package/out/concepts/StringLiteral__.js +9 -6
  294. package/out/concepts/StringLiteral__.js.map +1 -1
  295. package/out/concepts/StructureProperty__.d.ts +9 -3
  296. package/out/concepts/StructureProperty__.js +21 -57
  297. package/out/concepts/StructureProperty__.js.map +1 -1
  298. package/out/concepts/Structure__.d.ts +1 -0
  299. package/out/concepts/Structure__.js +3 -0
  300. package/out/concepts/Structure__.js.map +1 -1
  301. package/out/concepts/SwitchCase__.d.ts +1 -0
  302. package/out/concepts/SwitchCase__.js +5 -2
  303. package/out/concepts/SwitchCase__.js.map +1 -1
  304. package/out/concepts/SwitchStatement__.d.ts +1 -0
  305. package/out/concepts/SwitchStatement__.js +3 -0
  306. package/out/concepts/SwitchStatement__.js.map +1 -1
  307. package/out/concepts/Theme__.d.ts +1 -0
  308. package/out/concepts/Theme__.js +3 -0
  309. package/out/concepts/Theme__.js.map +1 -1
  310. package/out/concepts/Transactional__.d.ts +6 -0
  311. package/out/concepts/Transactional__.js +9 -0
  312. package/out/concepts/Transactional__.js.map +1 -1
  313. package/out/concepts/TypeAnnotation__.d.ts +13 -3
  314. package/out/concepts/TypeAnnotation__.js +160 -20
  315. package/out/concepts/TypeAnnotation__.js.map +1 -1
  316. package/out/concepts/TypeParam__.d.ts +1 -0
  317. package/out/concepts/TypeParam__.js +3 -0
  318. package/out/concepts/TypeParam__.js.map +1 -1
  319. package/out/concepts/UnaryExpression__.d.ts +1 -0
  320. package/out/concepts/UnaryExpression__.js +3 -0
  321. package/out/concepts/UnaryExpression__.js.map +1 -1
  322. package/out/concepts/Unparsed__.d.ts +1 -0
  323. package/out/concepts/Unparsed__.js +3 -0
  324. package/out/concepts/Unparsed__.js.map +1 -1
  325. package/out/concepts/UseComponent__.d.ts +1 -0
  326. package/out/concepts/UseComponent__.js +3 -0
  327. package/out/concepts/UseComponent__.js.map +1 -1
  328. package/out/concepts/ValidationRule__.d.ts +2 -0
  329. package/out/concepts/ValidationRule__.js +57 -1
  330. package/out/concepts/ValidationRule__.js.map +1 -1
  331. package/out/concepts/Variable__.d.ts +6 -3
  332. package/out/concepts/Variable__.js +16 -61
  333. package/out/concepts/Variable__.js.map +1 -1
  334. package/out/concepts/ViewBlock__.d.ts +35 -0
  335. package/out/concepts/ViewBlock__.js +85 -0
  336. package/out/concepts/ViewBlock__.js.map +1 -0
  337. package/out/concepts/ViewComponent__.d.ts +93 -0
  338. package/out/concepts/ViewComponent__.js +114 -0
  339. package/out/concepts/ViewComponent__.js.map +1 -1
  340. package/out/concepts/ViewElement__.d.ts +8 -0
  341. package/out/concepts/ViewElement__.js +79 -11
  342. package/out/concepts/ViewElement__.js.map +1 -1
  343. package/out/concepts/View__.d.ts +10 -3
  344. package/out/concepts/View__.js +77 -16
  345. package/out/concepts/View__.js.map +1 -1
  346. package/out/concepts/WhileStatement__.d.ts +1 -0
  347. package/out/concepts/WhileStatement__.js +3 -0
  348. package/out/concepts/WhileStatement__.js.map +1 -1
  349. package/out/concepts/basics/stdlib/nasl.auth.js +1 -1
  350. package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
  351. package/out/concepts/basics/stdlib/nasl.collection.js +7 -2
  352. package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -1
  353. package/out/concepts/basics/stdlib/nasl.configuration.js +3 -0
  354. package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
  355. package/out/concepts/basics/stdlib/nasl.core.d.ts +2 -0
  356. package/out/concepts/basics/stdlib/nasl.core.js +34 -0
  357. package/out/concepts/basics/stdlib/nasl.core.js.map +1 -1
  358. package/out/concepts/basics/stdlib/nasl.interface.js +1 -1
  359. package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
  360. package/out/concepts/basics/stdlib/nasl.logging.js +5 -0
  361. package/out/concepts/basics/stdlib/nasl.logging.js.map +1 -1
  362. package/out/concepts/basics/stdlib/nasl.process.js +6 -6
  363. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
  364. package/out/concepts/basics/stdlib/nasl.ui.js +73 -43
  365. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  366. package/out/concepts/basics/stdlib/nasl.util.js +293 -36
  367. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  368. package/out/concepts/basics/stdlib/nasl.validation.js +13 -13
  369. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
  370. package/out/concepts/basics/types/coreTypeList.js +1 -5
  371. package/out/concepts/basics/types/coreTypeList.js.map +1 -1
  372. package/out/concepts/basics/types/index.d.ts +1 -0
  373. package/out/concepts/basics/types/index.js +3 -1
  374. package/out/concepts/basics/types/index.js.map +1 -1
  375. package/out/concepts/index__.d.ts +13 -0
  376. package/out/concepts/index__.js +13 -0
  377. package/out/concepts/index__.js.map +1 -1
  378. package/out/decorators/index.js +3 -3
  379. package/out/decorators/index.js.map +1 -1
  380. package/out/enums/KEYWORDS.d.ts +1 -0
  381. package/out/enums/KEYWORDS.js +17 -1
  382. package/out/enums/KEYWORDS.js.map +1 -1
  383. package/out/generator/genBundleFiles.d.ts +6 -3
  384. package/out/generator/genBundleFiles.js +96 -228
  385. package/out/generator/genBundleFiles.js.map +1 -1
  386. package/out/generator/genMetaData.d.ts +2 -11
  387. package/out/generator/genMetaData.js +185 -51
  388. package/out/generator/genMetaData.js.map +1 -1
  389. package/out/generator/genReleaseBody.d.ts +21 -4
  390. package/out/generator/genReleaseBody.js +173 -54
  391. package/out/generator/genReleaseBody.js.map +1 -1
  392. package/out/generator/icestark.d.ts +2 -0
  393. package/out/generator/icestark.js +48 -0
  394. package/out/generator/icestark.js.map +1 -0
  395. package/out/generator/index.d.ts +1 -0
  396. package/out/generator/index.js +1 -0
  397. package/out/generator/index.js.map +1 -1
  398. package/out/generator/microApp.d.ts +2 -0
  399. package/out/generator/microApp.js +35 -0
  400. package/out/generator/microApp.js.map +1 -0
  401. package/out/generator/permission.d.ts +10 -0
  402. package/out/generator/permission.js +230 -0
  403. package/out/generator/permission.js.map +1 -0
  404. package/out/generator/qiankun.d.ts +2 -0
  405. package/out/generator/qiankun.js +52 -0
  406. package/out/generator/qiankun.js.map +1 -0
  407. package/out/index.d.ts +2 -1
  408. package/out/index.js +5 -1
  409. package/out/index.js.map +1 -1
  410. package/out/manager/stepRecorder.d.ts +20 -0
  411. package/out/manager/stepRecorder.js +110 -0
  412. package/out/manager/stepRecorder.js.map +1 -0
  413. package/out/sentry/index.d.ts +29 -0
  414. package/out/sentry/index.js +111 -0
  415. package/out/sentry/index.js.map +1 -0
  416. package/out/server/entity2LogicNamespace.js +72 -10
  417. package/out/server/entity2LogicNamespace.js.map +1 -1
  418. package/out/server/extendBaseNode.js +123 -22
  419. package/out/server/extendBaseNode.js.map +1 -1
  420. package/out/server/formatTsUtils.d.ts +3 -3
  421. package/out/server/formatTsUtils.js +195 -60
  422. package/out/server/formatTsUtils.js.map +1 -1
  423. package/out/server/getLogics.d.ts +3 -2
  424. package/out/server/getLogics.js +74 -17
  425. package/out/server/getLogics.js.map +1 -1
  426. package/out/server/getMemberIdentifier.d.ts +1 -0
  427. package/out/server/getMemberIdentifier.js +35 -7
  428. package/out/server/getMemberIdentifier.js.map +1 -1
  429. package/out/server/getProcesses.js +1 -1
  430. package/out/server/getProcesses.js.map +1 -1
  431. package/out/server/index.js +1 -0
  432. package/out/server/index.js.map +1 -1
  433. package/out/server/naslServer.d.ts +17 -5
  434. package/out/server/naslServer.js +1323 -188
  435. package/out/server/naslServer.js.map +1 -1
  436. package/out/server/process2LogicNamespace.js +8 -0
  437. package/out/server/process2LogicNamespace.js.map +1 -1
  438. package/out/server/translator.js +166 -30
  439. package/out/server/translator.js.map +1 -1
  440. package/out/service/creator/add.configs.js +6 -0
  441. package/out/service/creator/add.configs.js.map +1 -1
  442. package/out/service/creator/errHandles.js +5 -0
  443. package/out/service/creator/errHandles.js.map +1 -1
  444. package/out/service/creator/index.js +2 -0
  445. package/out/service/creator/index.js.map +1 -1
  446. package/out/service/datasource/api.d.ts +12 -0
  447. package/out/service/datasource/api.js +14 -0
  448. package/out/service/datasource/api.js.map +1 -0
  449. package/out/service/datasource/index.d.ts +2 -0
  450. package/out/service/datasource/index.js +10 -0
  451. package/out/service/datasource/index.js.map +1 -0
  452. package/out/service/storage/api.d.ts +27 -0
  453. package/out/service/storage/api.js +19 -0
  454. package/out/service/storage/api.js.map +1 -1
  455. package/out/service/storage/init.d.ts +44 -1
  456. package/out/service/storage/init.js +270 -38
  457. package/out/service/storage/init.js.map +1 -1
  458. package/out/service/storage/service.d.ts +12 -1
  459. package/out/service/storage/service.js +32 -1
  460. package/out/service/storage/service.js.map +1 -1
  461. package/out/templator/genCallComponentLogic.d.ts +1 -1
  462. package/out/templator/genCallComponentLogic.js.map +1 -1
  463. package/out/templator/genCreateBlock.js +7 -4
  464. package/out/templator/genCreateBlock.js.map +1 -1
  465. package/out/templator/genCurdEditMultipleKeyBlock.d.ts +7 -1
  466. package/out/templator/genCurdEditMultipleKeyBlock.js +122 -8
  467. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  468. package/out/templator/genCurdMultipleKeyBlock.js +6 -8
  469. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  470. package/out/templator/genEditTableBlock.js +52 -25
  471. package/out/templator/genEditTableBlock.js.map +1 -1
  472. package/out/templator/genGetBlock.js +4 -3
  473. package/out/templator/genGetBlock.js.map +1 -1
  474. package/out/templator/genGridViewBlock.js +18 -16
  475. package/out/templator/genGridViewBlock.js.map +1 -1
  476. package/out/templator/genListViewBlock.js +12 -6
  477. package/out/templator/genListViewBlock.js.map +1 -1
  478. package/out/templator/genQueryComponent.js +23 -9
  479. package/out/templator/genQueryComponent.js.map +1 -1
  480. package/out/templator/genSelectBlock.d.ts +12 -1
  481. package/out/templator/genSelectBlock.js +273 -2
  482. package/out/templator/genSelectBlock.js.map +1 -1
  483. package/out/templator/genTableBlock.js +10 -14
  484. package/out/templator/genTableBlock.js.map +1 -1
  485. package/out/templator/genUpdateBlock.js +9 -4
  486. package/out/templator/genUpdateBlock.js.map +1 -1
  487. package/out/templator/utils.d.ts +19 -33
  488. package/out/templator/utils.js +11 -8
  489. package/out/templator/utils.js.map +1 -1
  490. package/out/translator/index.js +4 -1
  491. package/out/translator/index.js.map +1 -1
  492. package/out/utils/traverse.js +8 -2
  493. package/out/utils/traverse.js.map +1 -1
  494. package/package.json +2 -2
  495. package/sandbox/stdlib/nasl.auth.ts +1 -1
  496. package/sandbox/stdlib/nasl.core.ts +6 -0
  497. package/sandbox/stdlib/nasl.logging.ts +4 -4
  498. package/sandbox/stdlib/nasl.util.ts +16 -6
  499. package/src/automate/template/myProcess.js +1 -1
  500. package/src/bak/translator.js +4 -1
  501. package/src/common/BaseNode.ts +1 -0
  502. package/src/common/Command.ts +4 -0
  503. package/src/concepts/AnonymousFunction__.ts +48 -2
  504. package/src/concepts/App__.ts +140 -41
  505. package/src/concepts/Assignee__.ts +4 -3
  506. package/src/concepts/BatchAssignment__.ts +111 -51
  507. package/src/concepts/BindAttribute__.ts +9 -2
  508. package/src/concepts/CallFunction__.ts +65 -31
  509. package/src/concepts/CallInterface__.ts +6 -22
  510. package/src/concepts/CallLogic__.ts +90 -88
  511. package/src/concepts/CallQueryComponent__.ts +4 -1
  512. package/src/concepts/DataSource__.ts +56 -1
  513. package/src/concepts/Destination__.ts +92 -22
  514. package/src/concepts/ForEachStatement__.ts +2 -0
  515. package/src/concepts/Identifier__.ts +18 -7
  516. package/src/concepts/LogicItem__.ts +1 -1
  517. package/src/concepts/Logic__.ts +54 -39
  518. package/src/concepts/Match__.ts +12 -8
  519. package/src/concepts/NewComposite__.ts +1354 -0
  520. package/src/concepts/NewList__.ts +445 -0
  521. package/src/concepts/NewMap__.ts +679 -0
  522. package/src/concepts/New__.ts +73 -0
  523. package/src/concepts/OqlQueryComponent__.ts +2 -0
  524. package/src/concepts/Param__.ts +238 -199
  525. package/src/concepts/ProcessElement__.ts +32 -10
  526. package/src/concepts/ProcessOutcome__.ts +1 -1
  527. package/src/concepts/ProcessOutcomes__.ts +90 -0
  528. package/src/concepts/Return__.ts +4 -1
  529. package/src/concepts/SelectMembers__.ts +3 -3
  530. package/src/concepts/StringInterpolation__.ts +21 -11
  531. package/src/concepts/TypeAnnotation__.ts +71 -50
  532. package/src/concepts/ValidationRule__.ts +19 -1
  533. package/src/concepts/Variable__.ts +4 -1
  534. package/src/concepts/ViewElement__.ts +24 -8
  535. package/src/concepts/View__.ts +16 -2
  536. package/src/concepts/basics/stdlib/nasl.auth.ts +1 -1
  537. package/src/concepts/basics/stdlib/nasl.logging.ts +5 -0
  538. package/src/concepts/basics/stdlib/nasl.ui.ts +2 -0
  539. package/src/concepts/basics/stdlib/nasl.util.ts +153 -17
  540. package/src/concepts/index__.ts +5 -0
  541. package/src/enums/KEYWORDS.ts +1 -0
  542. package/src/generator/genBundleFiles.ts +44 -220
  543. package/src/generator/genMetaData.ts +177 -77
  544. package/src/generator/genReleaseBody.ts +30 -5
  545. package/src/generator/index.ts +1 -0
  546. package/src/generator/permission.ts +271 -0
  547. package/src/index.ts +1 -1
  548. package/src/server/entity2LogicNamespace.ts +70 -10
  549. package/src/server/extendBaseNode.ts +10 -21
  550. package/src/server/formatTsUtils.ts +36 -46
  551. package/src/server/getLogics.ts +13 -1
  552. package/src/server/getMemberIdentifier.ts +1 -1
  553. package/src/server/getProcesses.ts +1 -1
  554. package/src/server/naslServer.ts +184 -42
  555. package/src/server/process2LogicNamespace.ts +8 -0
  556. package/src/server/translator.ts +93 -9
  557. package/src/service/creator/add.configs.js +4 -0
  558. package/src/service/datasource/api.js +11 -0
  559. package/src/service/datasource/index.js +6 -0
  560. package/src/service/storage/init.ts +9 -2
  561. package/src/service/video/VideoTranscribe.js +1 -0
  562. package/src/templator/genEditTableBlock.ts +8 -16
  563. package/src/templator/genGetBlock.ts +18 -19
  564. package/src/templator/genGridViewBlock.ts +18 -18
  565. package/src/templator/genListViewBlock.ts +8 -11
  566. package/src/templator/genTableBlock.ts +6 -10
  567. package/ts-worker/lib/tsserver.js +11 -1
  568. package/out/automate/engine/2.14-components.d.ts +0 -1115
  569. package/out/automate/engine/2.14-components.js +0 -1087
  570. package/out/automate/engine/2.14-components.js.map +0 -1
  571. package/out/concepts/ConstructArgument__.d.ts +0 -40
  572. package/out/concepts/ConstructArgument__.js.map +0 -1
  573. package/out/concepts/Construct__.d.ts +0 -189
  574. package/out/concepts/Construct__.js +0 -340
  575. package/out/concepts/Construct__.js.map +0 -1
  576. package/out/concepts/MatchExpression__.d.ts +0 -97
  577. package/out/concepts/MatchExpression__.js +0 -281
  578. package/out/concepts/MatchExpression__.js.map +0 -1
  579. package/out/templator/sql-parser/index.d.ts +0 -1
  580. package/out/templator/sql-parser/index.js +0 -228
  581. package/out/templator/sql-parser/index.js.map +0 -1
  582. package/out/templator/sql-parser/parser.js +0 -26664
  583. package/out/templator/sql-parser/parser.js.map +0 -1
  584. package/src/automate/engine/dist/index.dev.js +0 -517
  585. package/src/common/dist/BaseNode.js +0 -1101
  586. package/src/concepts/basics/stdlib/dist/reference2TypeAnnotationList.js +0 -24
  587. package/src/concepts/dist/Anchor__.js +0 -179
  588. package/src/concepts/dist/Assignment__.js +0 -301
  589. package/src/concepts/dist/CallFunction__.js +0 -473
  590. package/src/concepts/dist/CallInterface__.js +0 -533
  591. package/src/concepts/dist/CallLogic__.js +0 -864
  592. package/src/concepts/dist/ForEachStatement__.js +0 -426
  593. package/src/concepts/dist/MatchCase__.js +0 -587
  594. package/src/concepts/dist/MemberExpression__.js +0 -348
  595. package/src/concepts/dist/Param__.js +0 -537
  596. package/src/concepts/dist/Return__.js +0 -493
  597. package/src/generator/dist/genBundleFiles.js +0 -414
  598. package/src/server/dist/formatTsUtils.js +0 -683
  599. package/src/server/dist/naslServer.js +0 -3396
  600. package/src/service/storage/dist/init.js +0 -541
  601. package/ts-worker/dist/webpack.config.dev.js +0 -104
  602. package/ts-worker/lib/dist/tsserver.dev.js +0 -22953
  603. package/ts-worker/sources/lib/dist/tsserver.dev.js +0 -22912
@@ -247,13 +247,9 @@ function findNode(typeKey: string, node: BaseNode) {
247
247
  * 获取下一级的节点进行递归
248
248
  * @param typeKey 当前节点的类型,主要为了取出内部的 T中的实际类型
249
249
  * @param item 当前节点的内容
250
- * @param parent 父级节点的内容
251
250
  * @param node 获取变量框的位置
252
251
  */
253
- export function nextFindTypeChild(typeKey: string, item: any, parent: any, node: BaseNode) {
254
- // 有一个当前树分支的全部节点的node map,用作防止数据无限递归,只保留3层
255
- const nodeMap = parent ? parent.nodeMap : new Map();
256
- item.nodeMap = nodeMap;
252
+ export function nextFindTypeChild(typeKey: string, item: any, node: BaseNode) {
257
253
  const newType = findNode(typeKey, node);
258
254
  if ((newType as Structure)?.properties && (newType as Structure).properties.length) {
259
255
  // 处理泛型的内容要取到值
@@ -274,16 +270,7 @@ export function nextFindTypeChild(typeKey: string, item: any, parent: any, node:
274
270
  });
275
271
  }
276
272
  });
277
- const index = nodeMap.get(newType) || 0;
278
- if (index) {
279
- nodeMap.set(newType, index + 1);
280
- } else {
281
- nodeMap.set(newType, 1);
282
- }
283
- // 最多保留3层
284
- if (index < 3) {
285
- item.children = formatVariableData(newStructure.properties, node, item);
286
- }
273
+ item.children = formatVariableData(newStructure.properties, node, item);
287
274
  }
288
275
  }
289
276
 
@@ -359,7 +346,7 @@ function getAStructureScopeType(type: string, parent: any, node: BaseNode) {
359
346
  newItem.concept = 'CompletionProperty';
360
347
  // 如果有类型而且类型不是没有子集的类型,就把他当前的类型拿到
361
348
  if (item.typeKey && !isNoChildType(item.typeKey)) {
362
- newItem.children = nextObjectTypeChild(item.typeKey, newItem, parentItem, node);
349
+ newItem.children = nextObjectTypeChild(item.typeKey, newItem, node);
363
350
  }
364
351
  const completionProperty = new CompletionProperty(newItem);
365
352
  completionProperty.icon = 'refProperty';
@@ -395,9 +382,6 @@ function getAStructureScopeType(type: string, parent: any, node: BaseNode) {
395
382
  function getAStructureObjectStringType(type: string, parent: any, node: BaseNode) {
396
383
  let newType = type.replaceAll(' ', '').replaceAll('\n', '').replace(/__name:"AStructure_\w{8}";/g, '');
397
384
  newType = newType.substring(1, newType.length - 1);
398
- if (!parent.keyMap) {
399
- parent.keyMap = new Map();
400
- }
401
385
  if (/\{([^()]+)\}/.exec(newType)) {
402
386
  newType = newType.replace(/\{([^()]+)\}/, '');
403
387
  }
@@ -437,7 +421,7 @@ function getAStructureObjectStringType(type: string, parent: any, node: BaseNode
437
421
  newItem.concept = 'CompletionProperty';
438
422
  // 如果有类型而且类型不是没有子集的类型,就把他当前的类型拿到
439
423
  if (item.typeKey && !isNoChildType(item.typeKey)) {
440
- newItem.children = nextObjectTypeChild(getPlatformType(item.typeKey), newItem, parentItem, node);
424
+ newItem.children = nextObjectTypeChild(getPlatformType(item.typeKey), newItem, node);
441
425
  }
442
426
  const completionProperty = new CompletionProperty(newItem);
443
427
 
@@ -451,13 +435,7 @@ function getAStructureObjectStringType(type: string, parent: any, node: BaseNode
451
435
  completionProperty.icon = getNodeiconFromLogic(completionProperty, node);
452
436
  return completionProperty;
453
437
  }
454
- function nextObjectTypeChild(typeKey: string, item: any, parent: any, node: BaseNode) {
455
- // 有一个当前树分支的全部节点的node map,用作防止数据无限递归,只保留3层
456
- const nodeMap = parent.nodeMap || new Map();
457
- item.nodeMap = nodeMap; // 有一个当前树分支的全部节点的node map,用作防止数据无限递归,只保留3层
458
-
459
- const keyMap = parent.keyMap;
460
- item.keyMap = keyMap;
438
+ function nextObjectTypeChild(typeKey: string, item: any, node: BaseNode) {
461
439
  const newType = findNode(typeKey, node);
462
440
  if ((newType as Structure)?.properties && (newType as Structure).properties.length) {
463
441
  // 处理泛型的内容要取到值
@@ -478,16 +456,7 @@ function nextObjectTypeChild(typeKey: string, item: any, parent: any, node: Base
478
456
  });
479
457
  }
480
458
  });
481
- const index = nodeMap.get(newType) || 0;
482
- if (index) {
483
- nodeMap.set(newType, index + 1);
484
- } else {
485
- nodeMap.set(newType, 1);
486
- }
487
- // 最多保留3层
488
- if (index < 3) {
489
- return formatVariableData(newStructure.properties, node, item);
490
- }
459
+ return formatVariableData(newStructure.properties, node, item);
491
460
  }
492
461
  }
493
462
 
@@ -533,21 +502,42 @@ export function formatVariableData(data: unknown | variableItem[], node: BaseNod
533
502
  item.name = item.text;
534
503
  const identifier = new Identifier({ name: item.name });
535
504
  item.expression = identifier;
505
+ item.typeKey = typeKey;
536
506
  } else {
537
507
  item.value = `${parent.value}.${item.name}`;
508
+ const object: any = BaseNode.from(parent.expression.toJSON());
538
509
  const memberExpression = new MemberExpression({
539
- object: parent.expression,
510
+ object,
540
511
  property: new Identifier({ name: item.name }),
541
512
  });
542
513
  item.expression = memberExpression;
514
+ item.variableParent = parent;
515
+ item.typeKey = typeKey;
516
+ // 标记实体属性是否是符合类型
517
+ item.isComplexType = item.typeAnnotation?.isComplexType();
543
518
  }
544
519
  // 如果有类型而且类型不是没有子集的类型,就把他当前的类型拿到
545
520
  if (typeKey && !isNoChildType(typeKey)) {
546
- nextFindTypeChild(typeKey, item, parent, node);
521
+ let currentParent = item;
522
+ let typeKeyIndex = 0;
523
+ while (currentParent.variableParent) {
524
+ currentParent = currentParent.variableParent;
525
+ if (currentParent.typeKey === typeKey) {
526
+ typeKeyIndex++;
527
+ }
528
+ }
529
+ // 向上找到3次一样的就结束
530
+ if (typeKeyIndex < 3) {
531
+ nextFindTypeChild(typeKey, item, node);
532
+ }
547
533
  }
548
534
  // 如果是从实体或者数据结构取的属性,就需要重置一下类型
549
535
  item.concept = 'CompletionProperty';
550
536
  const completionProperty = new CompletionProperty(item);
537
+ // 标记实体属性是否是符合类型
538
+ if (typeof item.isComplexType === 'boolean') {
539
+ Object.assign(completionProperty, { isComplexType: item.isComplexType });
540
+ }
551
541
  if (!parent) {
552
542
  // 变量 param return 在这里添加图标
553
543
  completionProperty.icon = getNodeiconFromLogic(completionProperty, node);
@@ -633,20 +623,20 @@ function sortFirstVariableData(result: CompletionProperty[], node: BaseNode) {
633
623
  }
634
624
 
635
625
  export function formatFrontEndVariables(frontEndVariables: Array<Variable>) {
636
- const result = frontEndVariables.map((item) => {
637
- const namespace = item.getNamespace();
626
+ const result = frontEndVariables.map((itemNode) => {
627
+ const namespace = itemNode.getNamespace();
638
628
  const newItem: any = {
639
- name: item.name,
640
- value: item.name,
629
+ name: itemNode.name,
630
+ value: itemNode.name,
641
631
  expression: new Identifier({
642
- name: item.name,
632
+ name: itemNode.name,
643
633
  namespace,
644
634
  }),
645
635
  };
646
- const noChildType = isNoChildType(item.typeAnnotation.typeKey);
636
+ const noChildType = isNoChildType(itemNode.typeAnnotation.typeKey);
647
637
 
648
638
  if (!noChildType) {
649
- nextFindTypeChild(item.typeAnnotation.typeKey, newItem, null, item);
639
+ nextFindTypeChild(itemNode.typeAnnotation.typeKey, newItem, itemNode);
650
640
  }
651
641
  const completionProperty = new CompletionProperty(newItem);
652
642
  completionProperty.icon = 'frontendVariable';
@@ -1,3 +1,4 @@
1
+ import { Identifier } from './../concepts/Identifier__';
1
2
  import { CallLogic, BindEvent, App, Namespace, Entity, BaseNode, Logic, Param, TypeAnnotation, Return, Process, ViewElement, stdlibNamespace, EnumItem } from '..';
2
3
  import { process2LogicNamespace } from './process2LogicNamespace';
3
4
  import { moduleToLogicNamesapce } from './getExtensionModules';
@@ -56,7 +57,7 @@ function iterator(tree: FakeNode | FakeProcessNode, searchContent: string, fakeN
56
57
  function toHump(name: string): string {
57
58
  return name.replace(/\-(\w)/g, (all, letter) => letter.toUpperCase());
58
59
  }
59
- export async function getLogics(node: CallLogic | BindEvent, needAllLogic: boolean = true) {
60
+ export async function getLogics(node: CallLogic | BindEvent| Identifier, needAllLogic: boolean = true) {
60
61
  const app = node.rootNode as App;
61
62
  if (node.concept === 'CallLogic' || node.concept === 'BindEvent') {
62
63
  const result = [];
@@ -264,6 +265,17 @@ export async function getLogics(node: CallLogic | BindEvent, needAllLogic: boole
264
265
  result.push(systemTree);
265
266
  }
266
267
  return result;
268
+ } else if (node.concept === 'Identifier') {
269
+ const extensions = app.dependencies.map(moduleToLogicNamesapce).filter((item) => item.logics && item.logics.length);
270
+ const tree = new Namespace({
271
+ name: 'category`',
272
+ path: `${app.getNamespace()}.logics`,
273
+ title: '全局逻辑',
274
+ logics: app.logics,
275
+ children: [...extensions],
276
+ });
277
+
278
+ return [tree];
267
279
  }
268
280
  }
269
281
 
@@ -191,7 +191,7 @@ export async function getMemberIdentifier(node: BaseNode) {
191
191
 
192
192
  // 这个可能需要自己算一下
193
193
  const result = [
194
- { name: '字面量', children: literals, expanded: true, icon: 'category' },
194
+ { name: '常量', children: literals, expanded: true, icon: 'category' },
195
195
  { name: '枚举', children: newEnums, expanded: false, icon: 'category' },
196
196
  { name: '变量', children: completionData, expanded: true, icon: 'category' },
197
197
  { name: '公共变量', children: globalVariable, expanded: false, icon: 'category' },
@@ -283,7 +283,7 @@ export function genCompletionProperty(prefix: string[] = []):(v: Variable | Para
283
283
  };
284
284
 
285
285
  if (!noChildType) {
286
- nextFindTypeChild(v.typeAnnotation.typeKey, item, null, v);
286
+ nextFindTypeChild(v.typeAnnotation.typeKey, item, v);
287
287
  }
288
288
 
289
289
  const cp = new CompletionProperty(item);
@@ -202,7 +202,34 @@ export class NaslServer {
202
202
  // 收集到一个行为集合
203
203
  const eventValue = $event.value;
204
204
  eventValue.forEach(async (item: EventPayload) => {
205
- this.changeStackList.push(item.originEvent);
205
+ /**
206
+ * 多个行为进行合并
207
+ * 合并规则是
208
+ * 1.[a,b,c,c] 在cc的时候,在已有一个c,又来一个c的时候,如果他们不都是file级别的节点
209
+ * 就可以前面的内容去掉,只保留最后一个
210
+ * 2.[a,b,c,b,c] 在bc已存在,又来了bc 这就都要保留,因为可能顺序有相关性,不能去掉
211
+ * 理论上只处理同时几个操作 合并,
212
+ * 3.有field的也直接保留
213
+ */
214
+ try {
215
+ const changeEvent = item.originEvent;
216
+ const changeNode = changeEvent.target;
217
+ const { fileNode } = this.getCurrentSource(changeNode);
218
+ if (changeNode !== fileNode || !changeEvent.field) {
219
+ const findIndex = this.changeStackList.findIndex((changeStackItem: EventPayload) => {
220
+ const target = changeStackItem.target;
221
+ const { fileNode: targetFileNode } = this.getCurrentSource(target);
222
+ return targetFileNode === fileNode;
223
+ });
224
+ if (findIndex === this.changeStackList.length - 1) {
225
+ this.changeStackList.pop();
226
+ }
227
+ }
228
+ this.changeStackList.push(item.originEvent);
229
+ } catch (err) {
230
+ console.log(err);
231
+ this.changeStackList.push(item.originEvent);
232
+ }
206
233
  });
207
234
 
208
235
  // 如果有长度开始执行状态机
@@ -615,7 +642,8 @@ export class NaslServer {
615
642
  return '';
616
643
  }
617
644
  async getDataSchemaStructureOrTypeAnnotation(node: ViewElement) {
618
- if (!(node instanceof ViewElement)) return;
645
+ if (!(node instanceof ViewElement))
646
+ return;
619
647
 
620
648
  const { currentSource, fileNode } = this.getCurrentSource(node);
621
649
  const quickInfo = await this._getTypeQuickinfo({
@@ -626,16 +654,18 @@ export class NaslServer {
626
654
  if (quickInfo.responseRequired) {
627
655
  const displayString = quickInfo?.response?.displayString || '';
628
656
  const flag = displayString.includes('<') && displayString.includes('>');
629
- if(!flag) return;
657
+ if (!flag)
658
+ return;
630
659
 
631
660
  const types = /\<([^()]+)\>/g.exec(displayString);
632
- let typeStr = types && types[1];
661
+ const typeStr = types && types[1];
633
662
  const app = node.app;
634
663
  if (typeStr.includes('__name: "AStructure_')) {
635
664
  const properties: StructureProperty[] = [];
636
665
  typeStr
637
666
  .replace(/([^:\s]+):\s+([^;]+);/g, ($1, name, typeKey) => {
638
- if(name === '__name') return;
667
+ if (name === '__name')
668
+ return;
639
669
 
640
670
  typeKey = `app.${typeKey}`;
641
671
  const keys = typeKey.split('.');
@@ -647,12 +677,12 @@ export class NaslServer {
647
677
  typeKind: 'reference',
648
678
  typeName,
649
679
  typeNamespace,
650
- })
651
- }))
680
+ }),
681
+ }));
652
682
  return '';
653
683
  });
654
684
  return TypeAnnotation.createTypeAnonymousStructure(properties);
655
- } else if(typeStr.startsWith('structures'))
685
+ } else if (typeStr.startsWith('structures'))
656
686
  return app.findNodeByCompleteName(`app.${typeStr}`);
657
687
  }
658
688
  }
@@ -814,7 +844,8 @@ export class NaslServer {
814
844
  // record.suggestionDiagnostics = record.suggestionDiagnostics.filter((item) => !item.text.includes(`implicitly has an 'any' type, but a better type may be inferred from usage.`));
815
845
  // }
816
846
  record.suggestionDiagnostics = record.suggestionDiagnostics
817
- .filter((item) => [`'__LogicEmpty' is declared but its value is never read.`, `'__destinationEmpty__' is declared but its value is never read.`].includes(item.text))
847
+ .filter((item) => [`'__LogicEmpty' is declared but its value is never read.`, `'__destinationEmpty__' is declared but its value is never read.`
848
+ , `'__UpdateNoProperty__' is declared but its value is never read.`].includes(item.text))
818
849
  .map((diag) => this._resolveDiagnostic(diag as unknown as tsProtocol.DiagnosticWithFileName, node as FileNode, record))
819
850
  .filter((diag) => !!diag);
820
851
 
@@ -847,7 +878,7 @@ export class NaslServer {
847
878
  }
848
879
  if (removed)
849
880
  return diagnostics;
850
- fileNode?.sourceMap.forEach(async (value, node) => {
881
+ fileNode?.sourceMap.forEach((value, node) => {
851
882
  if (node instanceof Match) {
852
883
  const { cases, expression } = node || {};
853
884
  const typeAnnotationMap: any = {};
@@ -857,7 +888,7 @@ export class NaslServer {
857
888
  count: 0,
858
889
  };
859
890
  if (Array.isArray(cases)) {
860
- cases.forEach(async (caseItem, index) => {
891
+ cases.forEach((caseItem, index) => {
861
892
  let isDisabled = false;
862
893
  // 是最后一项
863
894
  if (index === cases.length - 1) {
@@ -997,7 +1028,7 @@ export class NaslServer {
997
1028
  if (removed)
998
1029
  return diagnostics;
999
1030
 
1000
- fileNode?.sourceMap.forEach(async (value, node) => {
1031
+ fileNode?.sourceMap.forEach((value, node) => {
1001
1032
  if (node instanceof ViewElement && node.view === fileNode) {
1002
1033
  if (node.tag) {
1003
1034
  node.bindAttrs.forEach((bindAttr) => {
@@ -1035,6 +1066,9 @@ export class NaslServer {
1035
1066
  // 子页面内部逻辑过滤
1036
1067
  if (nodeIn.view !== fileNode)
1037
1068
  return;
1069
+ // 当局部变量、输出参数属于页面内逻辑时,需过滤同页面下不同逻辑下的同名变量
1070
+ if (node.logic && node.logic !== nodeIn.logic)
1071
+ return;
1038
1072
  // 跟变量无关的赋值过滤
1039
1073
  const jsCode = nodeIn.toJS();
1040
1074
  if (!jsCode.includes(`${node.name} = `))
@@ -1108,6 +1142,40 @@ export class NaslServer {
1108
1142
  },
1109
1143
  };
1110
1144
  diagnostics.push(diagnostic);
1145
+ } else if (propertyValue.value) {
1146
+ const dataSource: any = fileNode;
1147
+ // 数据源有连接错误
1148
+ let envText;
1149
+ if (propertyValue.env === 'dev') {
1150
+ if (dataSource.__devConnectError) {
1151
+ envText = '开发';
1152
+ } else if (dataSource.__devConnectError === false) {
1153
+ return;
1154
+ }
1155
+ } else if (propertyValue.env === 'online') {
1156
+ if (dataSource.__onlineConnectError) {
1157
+ envText = '生产';
1158
+ } else if (dataSource.__onlineConnectError === false) {
1159
+ return;
1160
+ }
1161
+ }
1162
+ // 手动插入报错
1163
+ if (envText) {
1164
+ const diagnostic = {
1165
+ node: fileNode,
1166
+ severity: 'error',
1167
+ message: `数据源配置:数据源 ${property.name} ${envText}环境数据源连接不通,请先检查${envText}环境数据源配置`,
1168
+ // 保留原来的内容方便查询一些问题
1169
+ originalDiagnostic: {
1170
+ fileName: '',
1171
+ start: <any>null,
1172
+ end: <any>null,
1173
+ category: 'error',
1174
+ text: `DataSource connection error`,
1175
+ },
1176
+ };
1177
+ return diagnostics.push(diagnostic);
1178
+ }
1111
1179
  }
1112
1180
  });
1113
1181
  }
@@ -1118,17 +1186,18 @@ export class NaslServer {
1118
1186
  if (fileNode.parentNode instanceof App && !fileNode.parentNode.logics.includes(fileNode))
1119
1187
  return diagnostics;
1120
1188
 
1121
- fileNode?.sourceMap.forEach(async (value, node) => {
1189
+ fileNode?.sourceMap.forEach((value, node) => {
1190
+ //OQL支持返回复合类型数据了
1122
1191
  // SqlQueryComponent内部返回值类型,如果是嵌套的就需要报错
1123
- if ((node instanceof OqlQueryComponent || node instanceof SqlQueryComponent) && (node as SqlQueryComponent).getTypeBanError()) {
1124
- const diagnostic = {
1125
- node,
1126
- severity: 'error',
1127
- message: 'SQL查询:返回类型内部,不支持复杂类型。',
1128
- };
1129
- node.tsErrorDetail = diagnostic;
1130
- diagnostics.push(diagnostic);
1131
- }
1192
+ // if ((node instanceof OqlQueryComponent || node instanceof SqlQueryComponent) && (node as SqlQueryComponent).getTypeBanError()) {
1193
+ // const diagnostic = {
1194
+ // node,
1195
+ // severity: 'error',
1196
+ // message: 'SQL查询:返回类型内部,不支持复杂类型。',
1197
+ // };
1198
+ // node.tsErrorDetail = diagnostic;
1199
+ // diagnostics.push(diagnostic);
1200
+ // }
1132
1201
  if (node instanceof Return || node instanceof Variable) {
1133
1202
  if (!node.typeAnnotation && !node.__TypeAnnotation) {
1134
1203
  const nodeTypeName = node.concept === 'Return' ? '输出参数' : '局部变量';
@@ -1164,6 +1233,11 @@ export class NaslServer {
1164
1233
  this.checkNodeError(node, diagnostics);
1165
1234
  });
1166
1235
  }
1236
+ if (fileNode instanceof Process) {
1237
+ fileNode?.sourceMap.forEach((value, node) => {
1238
+ this.checkNodeError(node, diagnostics);
1239
+ });
1240
+ }
1167
1241
  return diagnostics;
1168
1242
  }
1169
1243
 
@@ -1223,6 +1297,19 @@ export class NaslServer {
1223
1297
  }
1224
1298
  });
1225
1299
  }
1300
+ if (node instanceof MatchCase && (node.getAncestor('Match') as Match)?.isExpression && node.body.length === 0) {
1301
+ // 如果不是其他就标红
1302
+ if ((node?.getIndexOfParent() !== ((node.getAncestor('Match') as Match)?.cases?.length || 0) - 1)) {
1303
+ const diagnostic = {
1304
+ node,
1305
+ severity: 'error',
1306
+ message: '匹配分支:表达式不能为空',
1307
+ titleTip: '表达式不能为空',
1308
+ };
1309
+ node.tsErrorDetail = diagnostic;
1310
+ diagnostics.push(diagnostic);
1311
+ }
1312
+ }
1226
1313
  // 如果节点是match的patterns 里的
1227
1314
  if (node?.parentKey === 'patterns' && node.parentNode instanceof MatchCase) {
1228
1315
  const matchNode = node.getAncestor('Match');
@@ -1241,9 +1328,30 @@ export class NaslServer {
1241
1328
  node.tsErrorDetail = diagnostic;
1242
1329
  diagnostics.push(diagnostic);
1243
1330
  }
1331
+ // 如果TypeAnnotation 还存在,但是本身已经不是union类型,就是已经从union换别的类型了就都要报错
1332
+ } else if (node instanceof TypeAnnotation && matchExpressionType?.typeKind !== 'union') {
1333
+ const diagnostic = {
1334
+ node,
1335
+ severity: 'error',
1336
+ message: '匹配:选择类型不存在',
1337
+ titleTip: '该类型已被删除',
1338
+ };
1339
+ node.tsErrorDetail = diagnostic;
1340
+ diagnostics.push(diagnostic);
1341
+ // 如果可枚举变量的 ,变量 还存在,但是本身已经是union类型,就是已经从别的类型 换了union就都要报错
1342
+ } else if (!(node instanceof TypeAnnotation) && matchExpressionType?.typeKind === 'union') {
1343
+ const diagnostic = {
1344
+ node,
1345
+ severity: 'error',
1346
+ message: '匹配:选择值不存在',
1347
+ titleTip: '该值无法匹配,请重新选择类型',
1348
+ };
1349
+ node.tsErrorDetail = diagnostic;
1350
+ diagnostics.push(diagnostic);
1244
1351
  }
1245
1352
  if (node.tsErrorDetail) {
1246
- if (matchExpressionType?.typeNamespace?.includes('enums')) {
1353
+ // 如果父级是枚举,而且子集选的是变量,就提示枚举值已被删除
1354
+ if (matchExpressionType?.typeNamespace?.includes('enums') && (node instanceof MemberExpression)) {
1247
1355
  node.tsErrorDetail.titleTip = '该枚举值已被删除';
1248
1356
  } else if (!node.tsErrorDetail.titleTip) {
1249
1357
  node.tsErrorDetail.titleTip = '该值已被删除';
@@ -1260,6 +1368,25 @@ export class NaslServer {
1260
1368
  node.tsErrorDetail = diagnostic;
1261
1369
  diagnostics.push(diagnostic);
1262
1370
  }
1371
+ /**
1372
+ * 如果节点是内置函数
1373
+ * 穷举在线上的情况,不在线上就void报错, calllogic 和 callinterface 因为原来有报错,所以就忽略掉
1374
+ * && 他在父级中,不在body
1375
+ * && 也不再 if的线上
1376
+ * && 也不再 switch的线上consequent
1377
+ * && 也不再草稿区域
1378
+ * && 不在 parentNode.parentNode(只用处理两层的,超过两层上就需要报错,只用直接是参数位第一层的需要) 是 callfunction 和 callInfterfase中,因为这两本身有强制类型,内置函数或者一些带T的声明那种,
1379
+ * && 而且也没有类型,就说明在槽位里,就需要报错
1380
+ */
1381
+ if (node instanceof CallFunction && node.parentKey !== 'body' && node.parentKey !== 'alternate' && node.parentKey !== 'playground' && node.parentKey !== 'consequent' && node.parentNode?.parentNode?.concept !== 'CallLogic' && node.parentNode?.parentNode?.concept !== 'CallInterface' && !node.__TypeAnnotation) {
1382
+ const diagnostic = {
1383
+ node,
1384
+ severity: 'error',
1385
+ message: `类型不匹配,传入类型:void`,
1386
+ };
1387
+ node.tsErrorDetail = diagnostic;
1388
+ diagnostics.push(diagnostic);
1389
+ }
1263
1390
  }
1264
1391
 
1265
1392
  /* 接口导入查找 */
@@ -1983,12 +2110,8 @@ export class NaslServer {
1983
2110
  const minRange: MinRange = this._findMinRange(record, fileNode as FileNode);
1984
2111
  if (minRange) {
1985
2112
  // 如果找到节点是callLogic就去更新
1986
- if (minRange.node instanceof CallLogic && node instanceof Param) {
1987
- minRange.node.setCalleeArgName(parantNode as Logic);
1988
- }
1989
- // 如果节点参数增加页面也要更新
1990
- if (minRange.node instanceof Destination && node instanceof Param) {
1991
- minRange.node.setViewArgument(parantNode as View);
2113
+ if ((minRange.node instanceof CallLogic || minRange.node instanceof Destination) && node instanceof Param) {
2114
+ minRange.node.addCalleeArg(parantNode as any);
1992
2115
  }
1993
2116
  }
1994
2117
  });
@@ -2290,7 +2413,7 @@ export class NaslServer {
2290
2413
  * @returns 不需要去查就可以返回类型的节点
2291
2414
  */
2292
2415
  getCurrentNodeKnownTypeAnnotation(node: BaseNode) {
2293
- if (node.concept === 'StringLiteral' || node.concept === 'BooleanLiteral' || node.concept === 'NullLiteral') {
2416
+ if (node.concept === 'StringLiteral' || node.concept === 'StringInterpolation' || node.concept === 'BooleanLiteral' || node.concept === 'NullLiteral') {
2294
2417
  let type = 'String';
2295
2418
  switch (node.concept) {
2296
2419
  case 'NullLiteral':
@@ -2307,7 +2430,7 @@ export class NaslServer {
2307
2430
  return TypeAnnotation.createPrimitive('Boolean');
2308
2431
  }
2309
2432
  // Convert和new都是自身携带类型的,就不进行修改
2310
- if (node instanceof CallFunction && node.calleeNamespace === 'nasl.util' && (node.calleeName === 'Convert' || node.calleeName === 'New')) {
2433
+ if (node instanceof CallFunction && node.calleeNamespace === 'nasl.util' && (['Convert', 'New', 'FromString'].includes(node.calleeName))) {
2311
2434
  if (node.typeArguments.length) {
2312
2435
  return node.typeArguments[0];
2313
2436
  }
@@ -2397,6 +2520,9 @@ export class NaslServer {
2397
2520
  'Return',
2398
2521
  'Variable',
2399
2522
  'Match',
2523
+ 'NewComposite',
2524
+ 'NewList',
2525
+ 'NewMap',
2400
2526
  ].includes(node.concept))
2401
2527
  return;
2402
2528
  // 要去ls那边获取的
@@ -2443,12 +2569,18 @@ export class NaslServer {
2443
2569
  let newCode = item.code.substring(0, indexOf);
2444
2570
  newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
2445
2571
  fileDetail.offset = newCode.length + 'return '.length;
2572
+ } else if (['NewComposite', 'NewList', 'NewMap'].includes(node.concept)) {
2573
+ fileDetail.line = item.range.end.line;
2574
+ const indexOf = item.code.indexOf('return __newComposite');
2575
+ let newCode = item.code.substring(0, indexOf);
2576
+ newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
2577
+ fileDetail.offset = newCode.length + 'return '.length;
2446
2578
  }
2447
2579
  args.push(fileDetail);
2448
2580
  });
2449
- console.time('请求')
2581
+ console.time('请求');
2450
2582
  const resultMap: any = (await this.getNaslNodeTypeFull(args)).response;
2451
- console.timeEnd('请求')
2583
+ console.timeEnd('请求');
2452
2584
 
2453
2585
  // console.log(resultMap);
2454
2586
 
@@ -2489,14 +2621,24 @@ export class NaslServer {
2489
2621
  }
2490
2622
  });
2491
2623
 
2492
- // 重置类型状态
2624
+ // 重置类型状态, 并且赋值
2493
2625
  types.forEach((value, node) => {
2494
- node.__isCorrectTypeAnnotation = true;
2495
- if (value) {
2496
- if (value instanceof TypeAnnotation) {
2497
- node.__TypeAnnotation = (Object.freeze(value) as TypeAnnotation);
2498
- } else if (value.typeAnnotation) {
2499
- node.__TypeAnnotation = (Object.freeze(value.typeAnnotation) as TypeAnnotation);
2626
+ try {
2627
+ // 因为node可能是经过处理的TypeAnnotation
2628
+ node.__isCorrectTypeAnnotation = true;
2629
+ if (value) {
2630
+ if (value instanceof TypeAnnotation) {
2631
+ node.__TypeAnnotation = (Object.freeze(value) as TypeAnnotation);
2632
+ } else if (value.typeAnnotation) {
2633
+ node.__TypeAnnotation = (Object.freeze(value.typeAnnotation) as TypeAnnotation);
2634
+ }
2635
+ } else {
2636
+ // 清空原来已经赋值上去的类型,可能原来有现在没有了
2637
+ node.__TypeAnnotation = null;
2638
+ }
2639
+ } catch (err) {
2640
+ if (globalThis.window) {
2641
+ console.log(err);
2500
2642
  }
2501
2643
  }
2502
2644
  });
@@ -2767,7 +2909,7 @@ export class NaslServer {
2767
2909
  };
2768
2910
  }
2769
2911
 
2770
- async getCurrentTypeAnnotation(node: BaseNode) {
2912
+ async getCurrentTypeAnnotation(node: BaseNode, outTime: number = 600) {
2771
2913
  if (node.__TypeAnnotation) {
2772
2914
  return node.__TypeAnnotation;
2773
2915
  }
@@ -2781,7 +2923,7 @@ export class NaslServer {
2781
2923
  } else {
2782
2924
  resolve(null);
2783
2925
  }
2784
- }, 600);
2926
+ }, outTime);
2785
2927
  const mySetInterval = setInterval(() => {
2786
2928
  if (node.__isCorrectTypeAnnotation) {
2787
2929
  resolve(node.__TypeAnnotation);
@@ -89,6 +89,10 @@ export function processToTreeFragment(process: Process) {
89
89
  k.getNamespace = function () {
90
90
  return path;
91
91
  };
92
+ const api = `/api/${process.name}/${e.name}/${k.name}`;
93
+ k.getPath = function () {
94
+ return api;
95
+ };
92
96
  });
93
97
 
94
98
  fragment.elements.push({
@@ -107,6 +111,10 @@ export function processToTreeFragment(process: Process) {
107
111
  launchLogic.getNamespace = function () {
108
112
  return path;
109
113
  };
114
+ const api = `/api/${process.name}/${launchLogic.name}`;
115
+ launchLogic.getPath = function () {
116
+ return api;
117
+ };
110
118
 
111
119
  fragment.logics.push(launchLogic);
112
120
  launchLogic.parentKey = 'readonly';