@lcap/nasl 1.0.0 → 2.12.0-beta

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 (422) hide show
  1. package/out/automate/engine/index.js +39 -127
  2. package/out/automate/engine/index.js.map +1 -1
  3. package/out/automate/engine/operators.d.ts +13 -0
  4. package/out/automate/engine/operators.js +63 -0
  5. package/out/automate/engine/operators.js.map +1 -0
  6. package/out/automate/engine/uniqueName.d.ts +6 -0
  7. package/out/automate/engine/uniqueName.js +39 -0
  8. package/out/automate/engine/uniqueName.js.map +1 -0
  9. package/out/automate/engine/utils.d.ts +1 -0
  10. package/out/automate/engine/utils.js +105 -67
  11. package/out/automate/engine/utils.js.map +1 -1
  12. package/out/common/BaseNode.d.ts +1 -1
  13. package/out/common/BaseNode.js +13 -3
  14. package/out/common/BaseNode.js.map +1 -1
  15. package/out/concepts/App__.d.ts +52 -49
  16. package/out/concepts/App__.js +95 -60
  17. package/out/concepts/App__.js.map +1 -1
  18. package/out/concepts/Argument__.js +1 -1
  19. package/out/concepts/Argument__.js.map +1 -1
  20. package/out/concepts/Assignee__.d.ts +11 -0
  21. package/out/concepts/Assignee__.js +36 -2
  22. package/out/concepts/Assignee__.js.map +1 -1
  23. package/out/concepts/Assignment__.js +1 -1
  24. package/out/concepts/Assignment__.js.map +1 -1
  25. package/out/concepts/Attribute__.js +1 -1
  26. package/out/concepts/Attribute__.js.map +1 -1
  27. package/out/concepts/BinaryExpression__.js +1 -1
  28. package/out/concepts/BinaryExpression__.js.map +1 -1
  29. package/out/concepts/BindAttribute__.js +4 -4
  30. package/out/concepts/BindAttribute__.js.map +1 -1
  31. package/out/concepts/BindDirective__.js +2 -2
  32. package/out/concepts/BindDirective__.js.map +1 -1
  33. package/out/concepts/BindEvent__.js +11 -6
  34. package/out/concepts/BindEvent__.js.map +1 -1
  35. package/out/concepts/BooleanLiteral__.js +1 -1
  36. package/out/concepts/BooleanLiteral__.js.map +1 -1
  37. package/out/concepts/CallFunction__.js +25 -5
  38. package/out/concepts/CallFunction__.js.map +1 -1
  39. package/out/concepts/CallInterface__.js +1 -1
  40. package/out/concepts/CallInterface__.js.map +1 -1
  41. package/out/concepts/CallLogic__.js +24 -22
  42. package/out/concepts/CallLogic__.js.map +1 -1
  43. package/out/concepts/CallQueryComponent__.d.ts +35 -5
  44. package/out/concepts/CallQueryComponent__.js +344 -99
  45. package/out/concepts/CallQueryComponent__.js.map +1 -1
  46. package/out/concepts/Comment__.js +2 -2
  47. package/out/concepts/Comment__.js.map +1 -1
  48. package/out/concepts/CompletionProperty__.js +1 -1
  49. package/out/concepts/CompletionProperty__.js.map +1 -1
  50. package/out/concepts/ConfigGroup__.d.ts +1 -0
  51. package/out/concepts/ConfigGroup__.js +9 -2
  52. package/out/concepts/ConfigGroup__.js.map +1 -1
  53. package/out/concepts/ConfigPropertyValue__.js +1 -1
  54. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  55. package/out/concepts/ConfigProperty__.d.ts +1 -0
  56. package/out/concepts/ConfigProperty__.js +5 -2
  57. package/out/concepts/ConfigProperty__.js.map +1 -1
  58. package/out/concepts/Configuration__.d.ts +1 -0
  59. package/out/concepts/Configuration__.js +5 -2
  60. package/out/concepts/Configuration__.js.map +1 -1
  61. package/out/concepts/Constant__.js +7 -7
  62. package/out/concepts/Constant__.js.map +1 -1
  63. package/out/concepts/DataElement__.js +1 -1
  64. package/out/concepts/DataElement__.js.map +1 -1
  65. package/out/concepts/DataSource__.d.ts +143 -0
  66. package/out/concepts/DataSource__.js +316 -0
  67. package/out/concepts/DataSource__.js.map +1 -0
  68. package/out/concepts/Destination__.js +26 -9
  69. package/out/concepts/Destination__.js.map +1 -1
  70. package/out/concepts/End__.js +3 -3
  71. package/out/concepts/End__.js.map +1 -1
  72. package/out/concepts/EntityIndex__.d.ts +5 -0
  73. package/out/concepts/EntityIndex__.js +11 -3
  74. package/out/concepts/EntityIndex__.js.map +1 -1
  75. package/out/concepts/EntityProperty__.d.ts +9 -0
  76. package/out/concepts/EntityProperty__.js +23 -8
  77. package/out/concepts/EntityProperty__.js.map +1 -1
  78. package/out/concepts/Entity__.d.ts +6 -3
  79. package/out/concepts/Entity__.js +28 -24
  80. package/out/concepts/Entity__.js.map +1 -1
  81. package/out/concepts/EnumItem__.js +1 -1
  82. package/out/concepts/EnumItem__.js.map +1 -1
  83. package/out/concepts/Enum__.d.ts +1 -0
  84. package/out/concepts/Enum__.js +15 -5
  85. package/out/concepts/Enum__.js.map +1 -1
  86. package/out/concepts/Event__.js +2 -2
  87. package/out/concepts/Event__.js.map +1 -1
  88. package/out/concepts/ForEachStatement__.d.ts +1 -1
  89. package/out/concepts/ForEachStatement__.js +5 -5
  90. package/out/concepts/ForEachStatement__.js.map +1 -1
  91. package/out/concepts/Function__.d.ts +18 -0
  92. package/out/concepts/Function__.js +100 -5
  93. package/out/concepts/Function__.js.map +1 -1
  94. package/out/concepts/Identifier__.js +2 -12
  95. package/out/concepts/Identifier__.js.map +1 -1
  96. package/out/concepts/IfStatement__.js +9 -9
  97. package/out/concepts/IfStatement__.js.map +1 -1
  98. package/out/concepts/InterfaceParam__.js +10 -5
  99. package/out/concepts/InterfaceParam__.js.map +1 -1
  100. package/out/concepts/Interface__.js +21 -14
  101. package/out/concepts/Interface__.js.map +1 -1
  102. package/out/concepts/JSBlock__.js +1 -1
  103. package/out/concepts/JSBlock__.js.map +1 -1
  104. package/out/concepts/LogicItem__.js +1 -1
  105. package/out/concepts/LogicItem__.js.map +1 -1
  106. package/out/concepts/Logic__.d.ts +4 -0
  107. package/out/concepts/Logic__.js +59 -46
  108. package/out/concepts/Logic__.js.map +1 -1
  109. package/out/concepts/MemberExpression__.js +1 -2
  110. package/out/concepts/MemberExpression__.js.map +1 -1
  111. package/out/concepts/Module__.d.ts +1 -85
  112. package/out/concepts/Module__.js +13 -114
  113. package/out/concepts/Module__.js.map +1 -1
  114. package/out/concepts/Namespace__.d.ts +0 -86
  115. package/out/concepts/Namespace__.js +12 -119
  116. package/out/concepts/Namespace__.js.map +1 -1
  117. package/out/concepts/NullLiteral__.js +1 -1
  118. package/out/concepts/NullLiteral__.js.map +1 -1
  119. package/out/concepts/NumericLiteral__.js +1 -1
  120. package/out/concepts/NumericLiteral__.js.map +1 -1
  121. package/out/concepts/Param__.d.ts +3 -2
  122. package/out/concepts/Param__.js +15 -8
  123. package/out/concepts/Param__.js.map +1 -1
  124. package/out/concepts/Point__.js +1 -1
  125. package/out/concepts/Point__.js.map +1 -1
  126. package/out/concepts/ProcessComponent__.js +3 -3
  127. package/out/concepts/ProcessComponent__.js.map +1 -1
  128. package/out/concepts/ProcessElement__.js +39 -18
  129. package/out/concepts/ProcessElement__.js.map +1 -1
  130. package/out/concepts/ProcessOutcome__.js +1 -1
  131. package/out/concepts/ProcessOutcome__.js.map +1 -1
  132. package/out/concepts/Process__.js +21 -14
  133. package/out/concepts/Process__.js.map +1 -1
  134. package/out/concepts/QueryAggregateExpression__.js +2 -2
  135. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  136. package/out/concepts/QueryFieldExpression__.d.ts +1 -0
  137. package/out/concepts/QueryFieldExpression__.js +12 -2
  138. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  139. package/out/concepts/QueryFromExpression__.d.ts +4 -0
  140. package/out/concepts/QueryFromExpression__.js +14 -3
  141. package/out/concepts/QueryFromExpression__.js.map +1 -1
  142. package/out/concepts/QueryGroupByExpression__.d.ts +3 -0
  143. package/out/concepts/QueryGroupByExpression__.js +21 -1
  144. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  145. package/out/concepts/QueryJoinExpression__.d.ts +4 -0
  146. package/out/concepts/QueryJoinExpression__.js +16 -5
  147. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  148. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  149. package/out/concepts/QueryOrderByExpression__.js +1 -1
  150. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  151. package/out/concepts/QuerySelectExpression__.js +2 -2
  152. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  153. package/out/concepts/Rect__.js +1 -1
  154. package/out/concepts/Rect__.js.map +1 -1
  155. package/out/concepts/Return__.d.ts +1 -1
  156. package/out/concepts/Return__.js +16 -11
  157. package/out/concepts/Return__.js.map +1 -1
  158. package/out/concepts/Role__.js +11 -4
  159. package/out/concepts/Role__.js.map +1 -1
  160. package/out/concepts/Slot__.js +1 -1
  161. package/out/concepts/Slot__.js.map +1 -1
  162. package/out/concepts/SqlQueryComponent__.d.ts +10 -0
  163. package/out/concepts/SqlQueryComponent__.js +32 -5
  164. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  165. package/out/concepts/Start__.js +1 -1
  166. package/out/concepts/Start__.js.map +1 -1
  167. package/out/concepts/StringLiteral__.js +2 -9
  168. package/out/concepts/StringLiteral__.js.map +1 -1
  169. package/out/concepts/StructureProperty__.js +6 -6
  170. package/out/concepts/StructureProperty__.js.map +1 -1
  171. package/out/concepts/Structure__.js +22 -15
  172. package/out/concepts/Structure__.js.map +1 -1
  173. package/out/concepts/SwitchCase__.js +6 -6
  174. package/out/concepts/SwitchCase__.js.map +1 -1
  175. package/out/concepts/SwitchStatement__.js +1 -1
  176. package/out/concepts/SwitchStatement__.js.map +1 -1
  177. package/out/concepts/Theme__.js +1 -1
  178. package/out/concepts/Theme__.js.map +1 -1
  179. package/out/concepts/Transactional__.js +1 -1
  180. package/out/concepts/Transactional__.js.map +1 -1
  181. package/out/concepts/TypeAnnotation__.d.ts +8 -0
  182. package/out/concepts/TypeAnnotation__.js +56 -6
  183. package/out/concepts/TypeAnnotation__.js.map +1 -1
  184. package/out/concepts/TypeParam__.js +1 -1
  185. package/out/concepts/TypeParam__.js.map +1 -1
  186. package/out/concepts/UnaryExpression__.js +1 -1
  187. package/out/concepts/UnaryExpression__.js.map +1 -1
  188. package/out/concepts/Unparsed__.js +1 -1
  189. package/out/concepts/Unparsed__.js.map +1 -1
  190. package/out/concepts/UseComponent__.js +1 -1
  191. package/out/concepts/UseComponent__.js.map +1 -1
  192. package/out/concepts/ValidationRule__.js +1 -1
  193. package/out/concepts/ValidationRule__.js.map +1 -1
  194. package/out/concepts/Variable__.d.ts +1 -1
  195. package/out/concepts/Variable__.js +16 -11
  196. package/out/concepts/Variable__.js.map +1 -1
  197. package/out/concepts/ViewComponent__.js +6 -6
  198. package/out/concepts/ViewComponent__.js.map +1 -1
  199. package/out/concepts/ViewElement__.js +21 -21
  200. package/out/concepts/ViewElement__.js.map +1 -1
  201. package/out/concepts/View__.d.ts +3 -1
  202. package/out/concepts/View__.js +53 -32
  203. package/out/concepts/View__.js.map +1 -1
  204. package/out/concepts/WhileStatement__.js +5 -5
  205. package/out/concepts/WhileStatement__.js.map +1 -1
  206. package/out/concepts/basics/stdlib/nasl.configuration.js +1 -1
  207. package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
  208. package/out/concepts/basics/stdlib/nasl.interface.d.ts +2 -0
  209. package/out/concepts/basics/stdlib/nasl.interface.js +4 -4
  210. package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
  211. package/out/concepts/basics/stdlib/nasl.util.js +268 -6
  212. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  213. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +1 -1
  214. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -1
  215. package/out/concepts/basics/types/index.d.ts +1 -0
  216. package/out/concepts/basics/types/index.js +3 -1
  217. package/out/concepts/basics/types/index.js.map +1 -1
  218. package/out/concepts/index__.d.ts +1 -0
  219. package/out/concepts/index__.js +1 -0
  220. package/out/concepts/index__.js.map +1 -1
  221. package/out/enums/KEYWORDS.js +0 -9
  222. package/out/enums/KEYWORDS.js.map +1 -1
  223. package/out/generator/genBundleFiles.js +8 -3
  224. package/out/generator/genBundleFiles.js.map +1 -1
  225. package/out/generator/genMetaData.js +13 -12
  226. package/out/generator/genMetaData.js.map +1 -1
  227. package/out/manager/diagnostic.d.ts +1 -1
  228. package/out/server/createUiTs.js +1 -0
  229. package/out/server/createUiTs.js.map +1 -1
  230. package/out/server/extendBaseNode.d.ts +1 -0
  231. package/out/server/extendBaseNode.js +323 -0
  232. package/out/server/extendBaseNode.js.map +1 -0
  233. package/out/server/getLogics.js +31 -2
  234. package/out/server/getLogics.js.map +1 -1
  235. package/out/server/getMemberIdentifier.js +47 -2
  236. package/out/server/getMemberIdentifier.js.map +1 -1
  237. package/out/server/getProcesses.d.ts +7 -2
  238. package/out/server/getProcesses.js +220 -20
  239. package/out/server/getProcesses.js.map +1 -1
  240. package/out/server/getScope.d.ts +3 -1
  241. package/out/server/getScope.js +30 -14
  242. package/out/server/getScope.js.map +1 -1
  243. package/out/server/index.d.ts +1 -0
  244. package/out/server/index.js +1 -0
  245. package/out/server/index.js.map +1 -1
  246. package/out/server/naslServer.d.ts +7 -5
  247. package/out/server/naslServer.js +249 -372
  248. package/out/server/naslServer.js.map +1 -1
  249. package/out/server/process2LogicNamespace.js +10 -1
  250. package/out/server/process2LogicNamespace.js.map +1 -1
  251. package/out/server/translator.d.ts +1 -1
  252. package/out/server/translator.js +22 -2
  253. package/out/server/translator.js.map +1 -1
  254. package/out/service/storage/init.js +32 -11
  255. package/out/service/storage/init.js.map +1 -1
  256. package/out/templator/genCreateBlock.js +15 -11
  257. package/out/templator/genCreateBlock.js.map +1 -1
  258. package/out/templator/genCurdEditMultipleKeyBlock.js +15 -12
  259. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  260. package/out/templator/genCurdMultipleKeyBlock.js +25 -21
  261. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  262. package/out/templator/genEditTableBlock.js +12 -12
  263. package/out/templator/genEditTableBlock.js.map +1 -1
  264. package/out/templator/genGetBlock.js +1 -1
  265. package/out/templator/genGetBlock.js.map +1 -1
  266. package/out/templator/genGridViewBlock.js +21 -20
  267. package/out/templator/genGridViewBlock.js.map +1 -1
  268. package/out/templator/genListViewBlock.js +6 -3
  269. package/out/templator/genListViewBlock.js.map +1 -1
  270. package/out/templator/genQueryComponent.js +11 -8
  271. package/out/templator/genQueryComponent.js.map +1 -1
  272. package/out/templator/genSelectBlock.js +13 -22
  273. package/out/templator/genSelectBlock.js.map +1 -1
  274. package/out/templator/genTableBlock.js +17 -15
  275. package/out/templator/genTableBlock.js.map +1 -1
  276. package/out/templator/genUpdateBlock.js +16 -12
  277. package/out/templator/genUpdateBlock.js.map +1 -1
  278. package/out/templator/utils.d.ts +5 -3
  279. package/out/templator/utils.js +2 -1
  280. package/out/templator/utils.js.map +1 -1
  281. package/out/test/integration/connect-file.js +6 -6
  282. package/out/test/integration/connect-file.js.map +1 -1
  283. package/out/translator/index.js +1 -1
  284. package/out/translator/index.js.map +1 -1
  285. package/out/utils/index.d.ts +4 -0
  286. package/out/utils/index.js +38 -2
  287. package/out/utils/index.js.map +1 -1
  288. package/out/utils/string.d.ts +1 -1
  289. package/out/utils/string.js +38 -9
  290. package/out/utils/string.js.map +1 -1
  291. package/package.json +1 -2
  292. package/src/automate/engine/index.js +38 -128
  293. package/src/automate/engine/operators.js +63 -0
  294. package/src/automate/engine/uniqueName.js +36 -0
  295. package/src/automate/engine/utils.js +108 -69
  296. package/src/common/BaseNode.ts +14 -3
  297. package/src/concepts/App__.ts +138 -101
  298. package/src/concepts/Argument__.ts +1 -1
  299. package/src/concepts/Assignee__.ts +32 -2
  300. package/src/concepts/Assignment__.ts +1 -1
  301. package/src/concepts/Attribute__.ts +1 -1
  302. package/src/concepts/BinaryExpression__.ts +1 -1
  303. package/src/concepts/BindAttribute__.ts +4 -4
  304. package/src/concepts/BindDirective__.ts +2 -2
  305. package/src/concepts/BindEvent__.ts +10 -6
  306. package/src/concepts/BooleanLiteral__.ts +1 -1
  307. package/src/concepts/CallFunction__.ts +36 -18
  308. package/src/concepts/CallInterface__.ts +1 -1
  309. package/src/concepts/CallLogic__.ts +55 -24
  310. package/src/concepts/CallQueryComponent__.ts +357 -134
  311. package/src/concepts/Comment__.ts +2 -2
  312. package/src/concepts/CompletionProperty__.ts +1 -1
  313. package/src/concepts/ConfigGroup__.ts +5 -3
  314. package/src/concepts/ConfigPropertyValue__.ts +1 -1
  315. package/src/concepts/ConfigProperty__.ts +6 -2
  316. package/src/concepts/Configuration__.ts +5 -2
  317. package/src/concepts/Constant__.ts +7 -7
  318. package/src/concepts/DataElement__.ts +1 -1
  319. package/src/concepts/DataSource__.ts +389 -0
  320. package/src/concepts/Destination__.ts +28 -10
  321. package/src/concepts/End__.ts +3 -3
  322. package/src/concepts/EntityIndex__.ts +12 -3
  323. package/src/concepts/EntityProperty__.ts +24 -8
  324. package/src/concepts/Entity__.ts +39 -27
  325. package/src/concepts/EnumItem__.ts +1 -1
  326. package/src/concepts/Enum__.ts +16 -5
  327. package/src/concepts/Event__.ts +2 -2
  328. package/src/concepts/ForEachStatement__.ts +5 -5
  329. package/src/concepts/Function__.ts +101 -7
  330. package/src/concepts/Identifier__.ts +2 -12
  331. package/src/concepts/IfStatement__.ts +10 -10
  332. package/src/concepts/InterfaceParam__.ts +10 -5
  333. package/src/concepts/Interface__.ts +22 -14
  334. package/src/concepts/JSBlock__.ts +1 -1
  335. package/src/concepts/LogicItem__.ts +1 -1
  336. package/src/concepts/Logic__.ts +60 -43
  337. package/src/concepts/MemberExpression__.ts +1 -2
  338. package/src/concepts/Module__.ts +16 -211
  339. package/src/concepts/Namespace__.ts +12 -215
  340. package/src/concepts/NullLiteral__.ts +1 -1
  341. package/src/concepts/NumericLiteral__.ts +1 -1
  342. package/src/concepts/Param__.ts +17 -9
  343. package/src/concepts/Point__.ts +1 -1
  344. package/src/concepts/ProcessComponent__.ts +3 -3
  345. package/src/concepts/ProcessElement__.ts +43 -21
  346. package/src/concepts/ProcessOutcome__.ts +1 -1
  347. package/src/concepts/Process__.ts +21 -15
  348. package/src/concepts/QueryAggregateExpression__.ts +2 -2
  349. package/src/concepts/QueryFieldExpression__.ts +14 -2
  350. package/src/concepts/QueryFromExpression__.ts +14 -3
  351. package/src/concepts/QueryGroupByExpression__.ts +24 -1
  352. package/src/concepts/QueryJoinExpression__.ts +16 -5
  353. package/src/concepts/QueryLimitExpression__.ts +9 -0
  354. package/src/concepts/QueryOrderByExpression__.ts +1 -1
  355. package/src/concepts/QuerySelectExpression__.ts +2 -2
  356. package/src/concepts/Rect__.ts +1 -1
  357. package/src/concepts/Return__.ts +16 -11
  358. package/src/concepts/Role__.ts +11 -5
  359. package/src/concepts/Slot__.ts +1 -1
  360. package/src/concepts/SqlQueryComponent__.ts +30 -11
  361. package/src/concepts/Start__.ts +1 -1
  362. package/src/concepts/StringLiteral__.ts +2 -9
  363. package/src/concepts/StructureProperty__.ts +6 -6
  364. package/src/concepts/Structure__.ts +22 -14
  365. package/src/concepts/SwitchCase__.ts +6 -6
  366. package/src/concepts/SwitchStatement__.ts +1 -1
  367. package/src/concepts/Theme__.ts +1 -1
  368. package/src/concepts/Transactional__.ts +1 -1
  369. package/src/concepts/TypeAnnotation__.ts +55 -25
  370. package/src/concepts/TypeParam__.ts +1 -1
  371. package/src/concepts/UnaryExpression__.ts +1 -1
  372. package/src/concepts/Unparsed__.ts +1 -1
  373. package/src/concepts/UseComponent__.ts +1 -1
  374. package/src/concepts/ValidationRule__.ts +1 -1
  375. package/src/concepts/Variable__.ts +16 -11
  376. package/src/concepts/ViewComponent__.ts +6 -6
  377. package/src/concepts/ViewElement__.ts +21 -21
  378. package/src/concepts/View__.ts +54 -32
  379. package/src/concepts/WhileStatement__.ts +5 -5
  380. package/src/concepts/basics/stdlib/nasl.configuration.ts +1 -1
  381. package/src/concepts/basics/stdlib/nasl.interface.ts +1 -1
  382. package/src/concepts/basics/stdlib/nasl.util.ts +269 -6
  383. package/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts +1 -1
  384. package/src/concepts/basics/types/index.ts +1 -0
  385. package/src/concepts/index__.ts +1 -0
  386. package/src/enums/KEYWORDS.ts +0 -9
  387. package/src/generator/genBundleFiles.ts +8 -3
  388. package/src/generator/genMetaData.ts +13 -13
  389. package/src/manager/diagnostic.ts +1 -1
  390. package/src/server/createUiTs.ts +1 -0
  391. package/src/server/extendBaseNode.ts +318 -0
  392. package/src/server/getLogics.ts +33 -4
  393. package/src/server/getMemberIdentifier.ts +49 -2
  394. package/src/server/getProcesses.ts +231 -21
  395. package/src/server/getScope.ts +41 -24
  396. package/src/server/index.ts +1 -0
  397. package/src/server/naslServer.ts +248 -366
  398. package/src/server/process2LogicNamespace.ts +29 -19
  399. package/src/server/translator.ts +25 -2
  400. package/src/service/storage/init.ts +32 -12
  401. package/src/templator/genCreateBlock.ts +16 -13
  402. package/src/templator/genCurdEditMultipleKeyBlock.ts +16 -13
  403. package/src/templator/genCurdMultipleKeyBlock.ts +26 -22
  404. package/src/templator/genEditTableBlock.ts +14 -13
  405. package/src/templator/genGetBlock.ts +1 -1
  406. package/src/templator/genGridViewBlock.ts +22 -21
  407. package/src/templator/genListViewBlock.ts +9 -5
  408. package/src/templator/genQueryComponent.ts +12 -9
  409. package/src/templator/genSelectBlock.ts +14 -23
  410. package/src/templator/genTableBlock.ts +18 -16
  411. package/src/templator/genUpdateBlock.ts +17 -13
  412. package/src/templator/utils.ts +5 -2
  413. package/src/test/integration/connect-file.ts +6 -6
  414. package/src/translator/index.ts +1 -1
  415. package/src/utils/index.ts +38 -1
  416. package/src/utils/string.ts +39 -9
  417. package/out/concepts/basics/stdlib/nasl.browser copy.d.ts +0 -3
  418. package/out/concepts/basics/stdlib/nasl.browser copy.js +0 -70
  419. package/out/concepts/basics/stdlib/nasl.browser copy.js.map +0 -1
  420. package/out/terms/LEVEL_NAME_MAP.d.ts +0 -26
  421. package/out/terms/LEVEL_NAME_MAP.js +0 -30
  422. package/out/terms/LEVEL_NAME_MAP.js.map +0 -1
@@ -14,7 +14,7 @@ import * as utils from '../utils';
14
14
  import { v4 as uuidv4 } from 'uuid';
15
15
  import BaseNode from '../common/BaseNode';
16
16
  import classMap from '../common/classMap';
17
- import Entity from './Entity__';
17
+ import DataSource from './DataSource__';
18
18
  import Structure from './Structure__';
19
19
  import Enum from './Enum__';
20
20
  import Logic from './Logic__';
@@ -110,10 +110,10 @@ export class App extends BaseNode {
110
110
  hasAuth: boolean = undefined;
111
111
 
112
112
  /**
113
- * 实体列表
113
+ * 数据源列表
114
114
  */
115
- @property('Entity')
116
- entities: Array<Entity> = [];
115
+ @property('DataSource')
116
+ dataSources: Array<DataSource> = [];
117
117
 
118
118
  /**
119
119
  * 数据结构列表
@@ -237,143 +237,143 @@ export class App extends BaseNode {
237
237
  });
238
238
  }
239
239
 
240
- getEntityExistingNames(excludedList: Array<Entity> = []) {
240
+ getDataSourceExistingNames(excludedList: Array<DataSource> = []) {
241
241
  const excludedSet = new Set(excludedList);
242
- return (this.entities || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
242
+ return (this.dataSources || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
243
243
  }
244
- getEntityUniqueName(name = 'Entity1') {
245
- return utils.unique(name, this.getEntityExistingNames());
244
+ getDataSourceUniqueName(name = 'DataSource1') {
245
+ return utils.unique(name, this.getDataSourceExistingNames(), undefined, true);
246
246
  }
247
247
 
248
248
  /**
249
- * 插入实体
249
+ * 插入数据源
250
250
  * @internal
251
- * @param name 实体名称,如果不填会自动生成一个唯一名称
251
+ * @param name 数据源名称,如果不填会自动生成一个唯一名称
252
252
  */
253
- _insertEntityAt(name: string, index: number): Entity;
253
+ _insertDataSourceAt(name: string, index: number): DataSource;
254
254
 
255
255
  /**
256
- * 插入实体
256
+ * 插入数据源
257
257
  * @internal
258
- * @param entityOptions 实体参数
258
+ * @param dataSourceOptions 数据源参数
259
259
  */
260
- _insertEntityAt(entityOptions: Partial<Entity>, index: number): Entity;
260
+ _insertDataSourceAt(dataSourceOptions: Partial<DataSource>, index: number): DataSource;
261
261
 
262
262
  /**
263
- * 插入实体
263
+ * 插入数据源
264
264
  * @internal
265
- * @param entity 已有的实体实例
265
+ * @param dataSource 已有的数据源实例
266
266
  */
267
- _insertEntityAt(entity: Entity, index: number): Entity;
267
+ _insertDataSourceAt(dataSource: DataSource, index: number): DataSource;
268
268
 
269
- _insertEntityAt(options: string | Partial<Entity> | Entity, index: number) {
270
- const entityOptions: any = {};
271
- const relationOptions = { parentNode: this, parentKey: 'entities' };
272
- let entity: Entity;
269
+ _insertDataSourceAt(options: string | Partial<DataSource> | DataSource, index: number) {
270
+ const dataSourceOptions: any = {};
271
+ const relationOptions = { parentNode: this, parentKey: 'dataSources' };
272
+ let dataSource: DataSource;
273
273
  if (!options) {
274
- entity = Entity.from({
275
- ...entityOptions,
276
- name: this.getEntityUniqueName(),
277
- }, this, 'entities');
274
+ dataSource = DataSource.from({
275
+ ...dataSourceOptions,
276
+ name: this.getDataSourceUniqueName(),
277
+ }, this, 'dataSources');
278
278
  } else if (typeof options === 'string') {
279
- entity = Entity.from({
280
- ...entityOptions,
279
+ dataSource = DataSource.from({
280
+ ...dataSourceOptions,
281
281
  name: options,
282
- }, this, 'entities');
283
- } else if (options instanceof Entity) {
282
+ }, this, 'dataSources');
283
+ } else if (options instanceof DataSource) {
284
284
  options.ensureDelete(); // 同一实例不支持多处存在
285
- entity = options;
286
- Object.assign(entity, relationOptions);
285
+ dataSource = options;
286
+ Object.assign(dataSource, relationOptions);
287
287
  } else {
288
- entity = Entity.from({
289
- ...entityOptions,
288
+ dataSource = DataSource.from({
289
+ ...dataSourceOptions,
290
290
  ...options,
291
- }, this, 'entities');
291
+ }, this, 'dataSources');
292
292
  }
293
- this.entities.splice(index, 0, entity);
294
- return entity;
293
+ this.dataSources.splice(index, 0, dataSource);
294
+ return dataSource;
295
295
  }
296
296
 
297
297
  /**
298
- * 插入实体
299
- * @param name 实体名称,如果不填会自动生成一个唯一名称
298
+ * 插入数据源
299
+ * @param name 数据源名称,如果不填会自动生成一个唯一名称
300
300
  */
301
- insertEntityAt(name: string, index: number): Entity;
301
+ insertDataSourceAt(name: string, index: number): DataSource;
302
302
 
303
303
  /**
304
- * 插入实体
305
- * @param entityOptions 实体参数
304
+ * 插入数据源
305
+ * @param dataSourceOptions 数据源参数
306
306
  */
307
- insertEntityAt(entityOptions: Partial<Entity>, index: number): Entity;
307
+ insertDataSourceAt(dataSourceOptions: Partial<DataSource>, index: number): DataSource;
308
308
 
309
309
  /**
310
- * 插入实体
311
- * @param entity 已有的实体实例
310
+ * 插入数据源
311
+ * @param dataSource 已有的数据源实例
312
312
  */
313
- insertEntityAt(entity: Entity, index: number): Entity;
313
+ insertDataSourceAt(dataSource: DataSource, index: number): DataSource;
314
314
 
315
- insertEntityAt(options: string | Partial<Entity> | Entity, index: number) {
316
- const node = this._insertEntityAt(options as any, index);
315
+ insertDataSourceAt(options: string | Partial<DataSource> | DataSource, index: number) {
316
+ const node = this._insertDataSourceAt(options as any, index);
317
317
  node.create({
318
318
  index,
319
319
  parentNode: this,
320
- parentKey: 'entities',
320
+ parentKey: 'dataSources',
321
321
  });
322
322
  return node;
323
323
  }
324
324
 
325
325
  /**
326
- * 添加实体
326
+ * 添加数据源
327
327
  * @internal
328
- * @param name 实体名称,如果不填会自动生成一个唯一名称
328
+ * @param name 数据源名称,如果不填会自动生成一个唯一名称
329
329
  */
330
- _addEntity(name?: string): Entity;
330
+ _addDataSource(name?: string): DataSource;
331
331
 
332
332
  /**
333
- * 添加实体
333
+ * 添加数据源
334
334
  * @internal
335
- * @param entityOptions 实体参数
335
+ * @param dataSourceOptions 数据源参数
336
336
  */
337
- _addEntity(entityOptions: Partial<Entity>): Entity;
337
+ _addDataSource(dataSourceOptions: Partial<DataSource>): DataSource;
338
338
 
339
339
  /**
340
- * 添加实体
340
+ * 添加数据源
341
341
  * @internal
342
- * @param entity 已有的实体实例
342
+ * @param dataSource 已有的数据源实例
343
343
  */
344
- _addEntity(entity: Entity): Entity;
344
+ _addDataSource(dataSource: DataSource): DataSource;
345
345
 
346
- _addEntity(options?: string | Partial<Entity> | Entity) {
347
- const index = 0;
348
- return this._insertEntityAt(options as any, index);
346
+ _addDataSource(options?: string | Partial<DataSource> | DataSource) {
347
+ const index = this.dataSources.length;
348
+ return this._insertDataSourceAt(options as any, index);
349
349
  }
350
350
 
351
351
  /**
352
- * 添加实体
352
+ * 添加数据源
353
353
  * @internal
354
- * @param name 实体名称,如果不填会自动生成一个唯一名称
354
+ * @param name 数据源名称,如果不填会自动生成一个唯一名称
355
355
  */
356
- addEntity(name?: string): Entity;
356
+ addDataSource(name?: string): DataSource;
357
357
 
358
358
  /**
359
- * 添加实体
360
- * @param entityOptions 实体参数
359
+ * 添加数据源
360
+ * @param dataSourceOptions 数据源参数
361
361
  */
362
- addEntity(entityOptions: Partial<Entity>): Entity;
362
+ addDataSource(dataSourceOptions: Partial<DataSource>): DataSource;
363
363
 
364
364
  /**
365
- * 添加实体
366
- * @param entity 已有的实体实例
365
+ * 添加数据源
366
+ * @param dataSource 已有的数据源实例
367
367
  */
368
- addEntity(entity: Entity): Entity;
368
+ addDataSource(dataSource: DataSource): DataSource;
369
369
 
370
- addEntity(options?: string | Partial<Entity> | Entity) {
371
- const node = this._addEntity(options as any);
372
- const index = this.entities.indexOf(node);
370
+ addDataSource(options?: string | Partial<DataSource> | DataSource) {
371
+ const node = this._addDataSource(options as any);
372
+ const index = this.dataSources.indexOf(node);
373
373
  node.create({
374
374
  index,
375
375
  parentNode: this,
376
- parentKey: 'entities',
376
+ parentKey: 'dataSources',
377
377
  });
378
378
  return node;
379
379
  }
@@ -384,7 +384,7 @@ export class App extends BaseNode {
384
384
  return (this.structures || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
385
385
  }
386
386
  getStructureUniqueName(name = 'Structure1') {
387
- return utils.unique(name, this.getStructureExistingNames());
387
+ return utils.unique(name, this.getStructureExistingNames(), undefined, true);
388
388
  }
389
389
 
390
390
  /**
@@ -526,7 +526,7 @@ export class App extends BaseNode {
526
526
  return (this.enums || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
527
527
  }
528
528
  getEnumUniqueName(name = 'Enum1') {
529
- return utils.unique(name, this.getEnumExistingNames());
529
+ return utils.unique(name, this.getEnumExistingNames(), undefined, true);
530
530
  }
531
531
 
532
532
  /**
@@ -668,7 +668,7 @@ export class App extends BaseNode {
668
668
  return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
669
669
  }
670
670
  getLogicUniqueName(name = 'logic1') {
671
- return utils.unique(name, this.getLogicExistingNames());
671
+ return utils.unique(name, this.getLogicExistingNames(), undefined, true);
672
672
  }
673
673
 
674
674
  /**
@@ -810,7 +810,7 @@ export class App extends BaseNode {
810
810
  return (this.interfaces || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
811
811
  }
812
812
  getInterfaceUniqueName(name = 'Interface1') {
813
- return utils.unique(name, this.getInterfaceExistingNames());
813
+ return utils.unique(name, this.getInterfaceExistingNames(), undefined, true);
814
814
  }
815
815
 
816
816
  /**
@@ -952,7 +952,7 @@ export class App extends BaseNode {
952
952
  return (this.views || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
953
953
  }
954
954
  getViewUniqueName(name = 'view1') {
955
- return utils.unique(name, this.getViewExistingNames());
955
+ return utils.unique(name, this.getViewExistingNames(), undefined, true);
956
956
  }
957
957
 
958
958
  /**
@@ -1094,7 +1094,7 @@ export class App extends BaseNode {
1094
1094
  return (this.processes || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1095
1095
  }
1096
1096
  getProcessUniqueName(name = 'Process1') {
1097
- return utils.unique(name, this.getProcessExistingNames());
1097
+ return utils.unique(name, this.getProcessExistingNames(), undefined, true);
1098
1098
  }
1099
1099
 
1100
1100
  /**
@@ -1236,7 +1236,7 @@ export class App extends BaseNode {
1236
1236
  return (this.roles || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1237
1237
  }
1238
1238
  getRoleUniqueName(name = 'role1') {
1239
- return utils.unique(name, this.getRoleExistingNames());
1239
+ return utils.unique(name, this.getRoleExistingNames(), undefined, true);
1240
1240
  }
1241
1241
 
1242
1242
  /**
@@ -1378,7 +1378,7 @@ export class App extends BaseNode {
1378
1378
  return (this.dependencies || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1379
1379
  }
1380
1380
  getModuleUniqueName(name = 'module1') {
1381
- return utils.unique(name, this.getModuleExistingNames());
1381
+ return utils.unique(name, this.getModuleExistingNames(), undefined, false);
1382
1382
  }
1383
1383
 
1384
1384
  /**
@@ -1784,46 +1784,46 @@ export class App extends BaseNode {
1784
1784
 
1785
1785
 
1786
1786
  /**
1787
- * 删除实体
1788
- * @param name 实体名称
1787
+ * 删除数据源
1788
+ * @param name 数据源名称
1789
1789
  */
1790
- removeEntity(name: string): void;
1790
+ removeDataSource(name: string): void;
1791
1791
 
1792
1792
  /**
1793
- * 删除实体
1794
- * @param entity 已有的实体实例
1793
+ * 删除数据源
1794
+ * @param dataSource 已有的数据源实例
1795
1795
  */
1796
- removeEntity(entity: Entity): void;
1796
+ removeDataSource(dataSource: DataSource): void;
1797
1797
 
1798
- removeEntity(options: string | Entity) {
1799
- let entity: Entity;
1798
+ removeDataSource(options: string | DataSource) {
1799
+ let dataSource: DataSource;
1800
1800
  if (typeof options === 'string') {
1801
- entity = this.entities.find((item) => item.name === options);
1802
- if (!entity) {
1803
- throw new Error('找不到实体 ' + options);
1801
+ dataSource = this.dataSources.find((item) => item.name === options);
1802
+ if (!dataSource) {
1803
+ throw new Error('找不到数据源 ' + options);
1804
1804
  }
1805
1805
  } else {
1806
- entity = options;
1806
+ dataSource = options;
1807
1807
  }
1808
- return entity.delete();
1808
+ return dataSource.delete();
1809
1809
  }
1810
1810
 
1811
- __removeEntity(entity: Entity) {
1812
- const parentKey = entity.parentKey;
1811
+ __removeDataSource(dataSource: DataSource) {
1812
+ const parentKey = dataSource.parentKey;
1813
1813
  const params: Params = {
1814
1814
  parentNode: this,
1815
1815
  parentKey,
1816
1816
  index: -1,
1817
1817
  object: null,
1818
- oldObject: entity,
1818
+ oldObject: dataSource,
1819
1819
  };
1820
1820
  if (parentKey) {
1821
1821
  params.parentKey = parentKey;
1822
1822
  if (Array.isArray((this as any)[parentKey])) {
1823
- const index = (this as any)[parentKey].indexOf(entity);
1823
+ const index = (this as any)[parentKey].indexOf(dataSource);
1824
1824
  ~index && (this as any)[parentKey].splice(index, 1);
1825
1825
  params.index = index;
1826
- } else if ((this as any)[parentKey] === entity) {
1826
+ } else if ((this as any)[parentKey] === dataSource) {
1827
1827
  params.index = 0;
1828
1828
  (this as any)[parentKey] = undefined;
1829
1829
  }
@@ -2393,8 +2393,12 @@ export class App extends BaseNode {
2393
2393
  return this.componentDependencies.find((componentDependency) => componentDependency.name === name);
2394
2394
  }
2395
2395
 
2396
- findEntityByName(name: string) {
2397
- return this.entities.find((entity) => entity.name === name);
2396
+ findDataSourceByName(name: string) {
2397
+ return this.dataSources.find((dataSourceItem) => dataSourceItem.name === name);
2398
+ }
2399
+
2400
+ get defaultDS() {
2401
+ return this.dataSources?.find((dataSource) => dataSource.name === 'defaultDS');
2398
2402
  }
2399
2403
 
2400
2404
  findEnumByName(name: string) {
@@ -2467,6 +2471,10 @@ export class App extends BaseNode {
2467
2471
  * 获取命名空间
2468
2472
  */
2469
2473
  getNamespace() {
2474
+ return 'app';
2475
+ }
2476
+
2477
+ getTsNamespace() {
2470
2478
  return `app`;
2471
2479
  }
2472
2480
 
@@ -2494,6 +2502,35 @@ export class App extends BaseNode {
2494
2502
  return node;
2495
2503
  }
2496
2504
 
2505
+ findNodeByCompleteName(completeName: string) {
2506
+ const nameArr = completeName?.split('.') || [];
2507
+ const start = nameArr.shift();
2508
+ let node: any = this;
2509
+ const mod = 0;
2510
+ const modulesMap: any = {
2511
+ extensions: node.dependencies,
2512
+ apis: node.interfaceDependencies,
2513
+ };
2514
+ const modules = modulesMap[start];
2515
+ if (Array.isArray(modules)) {
2516
+ const moduleName = nameArr.shift();
2517
+ node = modules.find((moduleItem) => moduleItem.name === moduleName);
2518
+ }
2519
+ for (let index = 0; index < nameArr.length; index++) {
2520
+ if (!node) {
2521
+ return null;
2522
+ }
2523
+ const nameItem = nameArr[index];
2524
+ const isKeyword = index % 2 === mod;
2525
+ if (!isKeyword && Array.isArray(node)) {
2526
+ node = node.find(({ name }) => name === nameItem);
2527
+ } else {
2528
+ node = node[nameItem];
2529
+ }
2530
+ }
2531
+ return node;
2532
+ }
2533
+
2497
2534
  /**
2498
2535
  * @param path 路径
2499
2536
  * path 为要查找路径:如 /dashboard/student/list、/dashboard/student/list
@@ -209,7 +209,7 @@ export class Argument extends LogicItem {
209
209
  //================================================================================
210
210
  }
211
211
 
212
- classMap['Argument'] = Argument;
212
+ classMap.Argument = Argument;
213
213
  export default Argument;
214
214
  //================================================================================
215
215
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
@@ -1,3 +1,6 @@
1
+ import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState, embeddedTSEmitter } from '../translator';
2
+ import { ProcessElement, Process, } from '..';
3
+
1
4
  //================================================================================
2
5
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
3
6
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -71,7 +74,7 @@ export class Assignee extends LogicItem {
71
74
  return (this.dynamicUsers || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
72
75
  }
73
76
  getLogicItemUniqueName(name = 'logicItem1') {
74
- return utils.unique(name, this.getLogicItemExistingNames());
77
+ return utils.unique(name, this.getLogicItemExistingNames(), undefined, false);
75
78
  }
76
79
 
77
80
  /**
@@ -422,14 +425,41 @@ export class Assignee extends LogicItem {
422
425
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
423
426
  // 自动生成的代码已结束。下面可以手动编写。
424
427
  //================================================================================
428
+ /**
429
+ * 祖先 ProcessElement
430
+ */
431
+ get processElement() {
432
+ return this.getAncestor('ProcessElement') as ProcessElement;
433
+ }
434
+ /**
435
+ * 祖先 Process
436
+ */
437
+ get process() {
438
+ return this.getAncestor('Process') as Process;
439
+ }
425
440
 
441
+ @withSourceMap()
442
+ toEmbeddedTSInProcess(state: TranslatorState, prevCode: string): string {
443
+ // const tab = indent(state.tabSize);
444
+ // let code = `const plainuser = [];\n`
445
+ // code += `const dynamicuser = [];\n`
446
+ let code = prevCode;
447
+ code += `return nasl.util.concatString(`;
448
+ this.dynamicUsers.forEach(u => {
449
+ code += u.toEmbeddedTS(shiftState(state, code));
450
+ code += ',\n';
451
+ })
452
+ code += ')\n';
453
+ // code += `${this.dynamicUsers.map(u => u.toEmbeddedTS(shiftState(state, code))).join(',\n')})\n`;
454
+ return code;
455
+ }
426
456
  //================================================================================
427
457
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
428
458
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
429
459
  //================================================================================
430
460
  }
431
461
 
432
- classMap['Assignee'] = Assignee;
462
+ classMap.Assignee = Assignee;
433
463
  export default Assignee;
434
464
  //================================================================================
435
465
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
@@ -231,7 +231,7 @@ export class Assignment extends LogicItem {
231
231
  //================================================================================
232
232
  }
233
233
 
234
- classMap['Assignment'] = Assignment;
234
+ classMap.Assignment = Assignment;
235
235
  export default Assignment;
236
236
  //================================================================================
237
237
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
@@ -244,7 +244,7 @@ export class Attribute extends BaseNode {
244
244
  //================================================================================
245
245
  }
246
246
 
247
- classMap['Attribute'] = Attribute;
247
+ classMap.Attribute = Attribute;
248
248
  export default Attribute;
249
249
  //================================================================================
250
250
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
@@ -281,7 +281,7 @@ export class BinaryExpression extends LogicItem {
281
281
  //================================================================================
282
282
  }
283
283
 
284
- classMap['BinaryExpression'] = BinaryExpression;
284
+ classMap.BinaryExpression = BinaryExpression;
285
285
  export default BinaryExpression;
286
286
  //================================================================================
287
287
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
@@ -223,7 +223,7 @@ export class BindAttribute extends BaseNode {
223
223
  return (this.rules || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
224
224
  }
225
225
  getValidationRuleUniqueName(name = 'validationRule1') {
226
- return utils.unique(name, this.getValidationRuleExistingNames());
226
+ return utils.unique(name, this.getValidationRuleExistingNames(), undefined, false);
227
227
  }
228
228
 
229
229
  /**
@@ -548,9 +548,9 @@ export class BindAttribute extends BaseNode {
548
548
  toEmbeddedTS(state?: TranslatorState): string {
549
549
  let code = '';
550
550
  if (this.name === 'destination') {
551
- code += this.destination.toEmbeddedTS(shiftState(state, code, { tabSize: state.tabSize + 1 }));
551
+ code += this.destination.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
552
552
  } else if (this.expression) {
553
- code += this.expression.toEmbeddedTS(shiftState(state, code, { tabSize: state.tabSize + 1 }));
553
+ code += this.expression.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
554
554
  }
555
555
  return code;
556
556
  }
@@ -560,7 +560,7 @@ export class BindAttribute extends BaseNode {
560
560
  //================================================================================
561
561
  }
562
562
 
563
- classMap['BindAttribute'] = BindAttribute;
563
+ classMap.BindAttribute = BindAttribute;
564
564
  export default BindAttribute;
565
565
  //================================================================================
566
566
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
@@ -218,7 +218,7 @@ export class BindDirective extends BaseNode {
218
218
  if (this.expression) {
219
219
  value = this.expression.toVue(options);
220
220
  if (this.expression.concept === 'StringLiteral') {
221
- value = `'${value}'`;
221
+ value = `${value}`;
222
222
  }
223
223
  value = value?.replace(/"/g, "'");
224
224
  }
@@ -253,7 +253,7 @@ export class BindDirective extends BaseNode {
253
253
  //================================================================================
254
254
  }
255
255
 
256
- classMap['BindDirective'] = BindDirective;
256
+ classMap.BindDirective = BindDirective;
257
257
  export default BindDirective;
258
258
  //================================================================================
259
259
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
@@ -339,10 +339,10 @@ export class BindEvent extends BaseNode {
339
339
  return `${this.calleeKey}();`;
340
340
  }
341
341
  let code = `${this.toHump(this.name) || '__IDENTIFIER__'}: (event) => [\n`;
342
- code += indent(state.tabSize + 1);
342
+ code += indent((state?.tabSize || 0) + 1);
343
343
  code += `() => {${this.calleeKey}()}`;
344
344
  code += '\n';
345
- code += indent(state.tabSize);
345
+ code += indent((state?.tabSize || 0));
346
346
  code += '],\n';
347
347
  return code;
348
348
  }
@@ -354,10 +354,10 @@ export class BindEvent extends BaseNode {
354
354
  // let code = '';
355
355
  // if (this.name) {
356
356
  // code = `function ${this.name || '__IDENTIFIER__'} () {\n`;
357
- // code += indent(state.tabSize + 1);
357
+ // code += indent((state?.tabSize || 0) + 1);
358
358
  // code += `${this.calleeKey}()`;
359
359
  // code += '\n';
360
- // code += indent(state.tabSize);
360
+ // code += indent((state?.tabSize || 0));
361
361
  // code += '};\n';
362
362
  // }
363
363
  // return code;
@@ -367,8 +367,12 @@ export class BindEvent extends BaseNode {
367
367
  * 设置callee
368
368
  */
369
369
  setCallee(logic: Logic) {
370
+ let calleeNamespace = logic.getNamespace();
371
+ if (logic.parentNode instanceof View) {
372
+ calleeNamespace = '';
373
+ }
370
374
  const object = {
371
- calleeNamespace: logic.getNamespace(),
375
+ calleeNamespace,
372
376
  calleeName: logic.name,
373
377
  };
374
378
  this.update({
@@ -436,7 +440,7 @@ export class BindEvent extends BaseNode {
436
440
  //================================================================================
437
441
  }
438
442
 
439
- classMap['BindEvent'] = BindEvent;
443
+ classMap.BindEvent = BindEvent;
440
444
  export default BindEvent;
441
445
  //================================================================================
442
446
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
@@ -82,7 +82,7 @@ export class BooleanLiteral extends LogicItem {
82
82
  //================================================================================
83
83
  }
84
84
 
85
- classMap['BooleanLiteral'] = BooleanLiteral;
85
+ classMap.BooleanLiteral = BooleanLiteral;
86
86
  export default BooleanLiteral;
87
87
  //================================================================================
88
88
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑