@lcap/nasl 3.3.2-beta.4 → 3.3.3-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 (753) hide show
  1. package/coverage/index.html +108 -108
  2. package/coverage/src/automate/engine/index.html +1 -1
  3. package/coverage/src/automate/engine/utils.js.html +36 -36
  4. package/coverage/src/bak/index.html +15 -15
  5. package/coverage/src/bak/translator.js.html +183 -60
  6. package/coverage/src/breakpoint/generator/AfterStartNode.ts.html +1 -1
  7. package/coverage/src/breakpoint/generator/BeforeEndNode.ts.html +1 -1
  8. package/coverage/src/breakpoint/generator/BreakpointNode.ts.html +1 -1
  9. package/coverage/src/breakpoint/generator/CallbackNode.ts.html +1 -1
  10. package/coverage/src/breakpoint/generator/index.html +1 -1
  11. package/coverage/src/breakpoint/generator/index.ts.html +1 -1
  12. package/coverage/src/breakpoint/index.html +1 -1
  13. package/coverage/src/breakpoint/index.ts.html +1 -1
  14. package/coverage/src/breakpoint/shared/constants.ts.html +1 -1
  15. package/coverage/src/breakpoint/shared/index.html +1 -1
  16. package/coverage/src/breakpoint/shared/index.ts.html +1 -1
  17. package/coverage/src/breakpoint/shared/operations.ts.html +1 -1
  18. package/coverage/src/breakpoint/shared/socket.ts.html +1 -1
  19. package/coverage/src/breakpoint/shared/utils.ts.html +1 -1
  20. package/coverage/src/breakpoint/store/core.ts.html +1 -1
  21. package/coverage/src/breakpoint/store/dock.ts.html +1 -1
  22. package/coverage/src/breakpoint/store/index.html +1 -1
  23. package/coverage/src/breakpoint/store/index.ts.html +1 -1
  24. package/coverage/src/common/BaseNode.ts.html +92 -62
  25. package/coverage/src/common/Command.ts.html +1 -1
  26. package/coverage/src/common/EventEmitter.ts.html +1 -1
  27. package/coverage/src/common/Messager.ts.html +1 -1
  28. package/coverage/src/common/asyncFuncMap.ts.html +1 -1
  29. package/coverage/src/common/index.html +14 -14
  30. package/coverage/src/common/index.ts.html +1 -1
  31. package/coverage/src/concepts/Abort__.ts.html +9 -6
  32. package/coverage/src/concepts/Anchor__.ts.html +36 -21
  33. package/coverage/src/concepts/AnonymousFunction__.ts.html +62 -20
  34. package/coverage/src/concepts/App__.ts.html +917 -74
  35. package/coverage/src/concepts/Argument__.ts.html +41 -26
  36. package/coverage/src/concepts/Assignee__.ts.html +40 -13
  37. package/coverage/src/concepts/AssignmentLine__.ts.html +9 -6
  38. package/coverage/src/concepts/Assignment__.ts.html +61 -22
  39. package/coverage/src/concepts/Attribute__.ts.html +25 -10
  40. package/coverage/src/concepts/AuthInterface__.ts.html +9 -6
  41. package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +25 -10
  42. package/coverage/src/concepts/AuthLogic__.ts.html +18 -6
  43. package/coverage/src/concepts/BackendVariable__.ts.html +25 -10
  44. package/coverage/src/concepts/Backend__.ts.html +25 -10
  45. package/coverage/src/concepts/BatchAssignment__.ts.html +61 -16
  46. package/coverage/src/concepts/BinaryExpression__.ts.html +141 -39
  47. package/coverage/src/concepts/BindAttribute__.ts.html +134 -41
  48. package/coverage/src/concepts/BindDirective__.ts.html +79 -16
  49. package/coverage/src/concepts/BindEvent__.ts.html +80 -23
  50. package/coverage/src/concepts/BindStyle__.ts.html +25 -10
  51. package/coverage/src/concepts/BooleanLiteral__.ts.html +9 -6
  52. package/coverage/src/concepts/CallAuthInterface__.ts.html +25 -10
  53. package/coverage/src/concepts/CallConnector__.ts.html +9 -6
  54. package/coverage/src/concepts/CallFunction__.ts.html +56 -38
  55. package/coverage/src/concepts/CallInterface__.ts.html +81 -36
  56. package/coverage/src/concepts/CallLogic__.ts.html +195 -264
  57. package/coverage/src/concepts/CallQueryComponent__.ts.html +40 -13
  58. package/coverage/src/concepts/Comment__.ts.html +11 -8
  59. package/coverage/src/concepts/CompletionProperty__.ts.html +25 -10
  60. package/coverage/src/concepts/ConfigGroup__.ts.html +25 -10
  61. package/coverage/src/concepts/ConfigPropertyValue__.ts.html +9 -6
  62. package/coverage/src/concepts/ConfigProperty__.ts.html +25 -10
  63. package/coverage/src/concepts/Configuration__.ts.html +25 -10
  64. package/coverage/src/concepts/Connection__.ts.html +26 -11
  65. package/coverage/src/concepts/ConnectorTrigger__.ts.html +9 -6
  66. package/coverage/src/concepts/Connector__.ts.html +85 -22
  67. package/coverage/src/concepts/Constant__.ts.html +25 -10
  68. package/coverage/src/concepts/DataSource__.ts.html +26 -11
  69. package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +9 -6
  70. package/coverage/src/concepts/Destination__.ts.html +24 -12
  71. package/coverage/src/concepts/End__.ts.html +9 -6
  72. package/coverage/src/concepts/EntityIndex__.ts.html +9 -6
  73. package/coverage/src/concepts/EntityProperty__.ts.html +62 -14
  74. package/coverage/src/concepts/Entity__.ts.html +41 -14
  75. package/coverage/src/concepts/EnumItem__.ts.html +9 -6
  76. package/coverage/src/concepts/Enum__.ts.html +25 -10
  77. package/coverage/src/concepts/Event__.ts.html +25 -10
  78. package/coverage/src/concepts/ExternalDestination__.ts.html +25 -10
  79. package/coverage/src/concepts/ForEachStatement__.ts.html +68 -47
  80. package/coverage/src/concepts/FrontendLibrary__.ts.html +40 -13
  81. package/coverage/src/concepts/FrontendVariable__.ts.html +1 -1
  82. package/coverage/src/concepts/Frontend__.ts.html +86 -23
  83. package/coverage/src/concepts/Function__.ts.html +92 -26
  84. package/coverage/src/concepts/Identifier__.ts.html +28 -25
  85. package/coverage/src/concepts/IfStatement__.ts.html +83 -56
  86. package/coverage/src/concepts/Integration__.ts.html +40 -13
  87. package/coverage/src/concepts/InterfaceParam__.ts.html +25 -10
  88. package/coverage/src/concepts/Interface__.ts.html +61 -22
  89. package/coverage/src/concepts/JSBlock__.ts.html +188 -8
  90. package/coverage/src/concepts/JavaLogic__.ts.html +9 -6
  91. package/coverage/src/concepts/LogicItem__.ts.html +15 -12
  92. package/coverage/src/concepts/Logic__.ts.html +117 -81
  93. package/coverage/src/concepts/MatchCase__.ts.html +100 -61
  94. package/coverage/src/concepts/Match__.ts.html +48 -27
  95. package/coverage/src/concepts/MemberExpression__.ts.html +72 -66
  96. package/coverage/src/concepts/MetadataType__.ts.html +1996 -0
  97. package/coverage/src/concepts/MicroApp__.ts.html +9 -6
  98. package/coverage/src/concepts/Module__.ts.html +672 -18
  99. package/coverage/src/concepts/MsgTriggerEvent__.ts.html +25 -10
  100. package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +25 -10
  101. package/coverage/src/concepts/Namespace__.ts.html +175 -40
  102. package/coverage/src/concepts/NewComposite__.ts.html +93 -27
  103. package/coverage/src/concepts/NewList__.ts.html +44 -14
  104. package/coverage/src/concepts/NewMap__.ts.html +44 -14
  105. package/coverage/src/concepts/New__.ts.html +1 -1
  106. package/coverage/src/concepts/NullLiteral__.ts.html +9 -6
  107. package/coverage/src/concepts/NumericLiteral__.ts.html +27 -12
  108. package/coverage/src/concepts/OqlQueryComponent__.ts.html +103 -13
  109. package/coverage/src/concepts/OverriddenLogic__.ts.html +100 -25
  110. package/coverage/src/concepts/Param__.ts.html +24 -15
  111. package/coverage/src/concepts/Point__.ts.html +9 -6
  112. package/coverage/src/concepts/ProcessComponent__.ts.html +40 -13
  113. package/coverage/src/concepts/ProcessElement__.ts.html +128 -29
  114. package/coverage/src/concepts/ProcessOutcome__.ts.html +9 -6
  115. package/coverage/src/concepts/ProcessOutcomes__.ts.html +9 -6
  116. package/coverage/src/concepts/Process__.ts.html +85 -22
  117. package/coverage/src/concepts/QueryAggregateExpression__.ts.html +25 -10
  118. package/coverage/src/concepts/QueryFieldExpression__.ts.html +9 -6
  119. package/coverage/src/concepts/QueryFromExpression__.ts.html +25 -10
  120. package/coverage/src/concepts/QueryGroupByExpression__.ts.html +25 -10
  121. package/coverage/src/concepts/QueryJoinExpression__.ts.html +25 -10
  122. package/coverage/src/concepts/QueryLimitExpression__.ts.html +25 -10
  123. package/coverage/src/concepts/QueryOrderByExpression__.ts.html +25 -10
  124. package/coverage/src/concepts/QuerySelectExpression__.ts.html +25 -10
  125. package/coverage/src/concepts/Rect__.ts.html +9 -6
  126. package/coverage/src/concepts/Return__.ts.html +25 -10
  127. package/coverage/src/concepts/Role__.ts.html +9 -6
  128. package/coverage/src/concepts/SelectMembers__.ts.html +25 -10
  129. package/coverage/src/concepts/Slot__.ts.html +25 -10
  130. package/coverage/src/concepts/SqlQueryComponent__.ts.html +25 -10
  131. package/coverage/src/concepts/Start__.ts.html +9 -6
  132. package/coverage/src/concepts/StringInterpolation__.ts.html +40 -19
  133. package/coverage/src/concepts/StringLiteral__.ts.html +9 -6
  134. package/coverage/src/concepts/StructureProperty__.ts.html +25 -10
  135. package/coverage/src/concepts/Structure__.ts.html +40 -13
  136. package/coverage/src/concepts/SwitchCase__.ts.html +33 -18
  137. package/coverage/src/concepts/SwitchStatement__.ts.html +38 -23
  138. package/coverage/src/concepts/Theme__.ts.html +9 -6
  139. package/coverage/src/concepts/Transactional__.ts.html +9 -6
  140. package/coverage/src/concepts/TriggerEvent__.ts.html +25 -10
  141. package/coverage/src/concepts/TriggerLauncher__.ts.html +9 -6
  142. package/coverage/src/concepts/TypeAnnotation__.ts.html +223 -61
  143. package/coverage/src/concepts/TypeParam__.ts.html +10 -7
  144. package/coverage/src/concepts/UnaryExpression__.ts.html +40 -13
  145. package/coverage/src/concepts/Unparsed__.ts.html +11 -8
  146. package/coverage/src/concepts/UseComponent__.ts.html +9 -6
  147. package/coverage/src/concepts/ValidationRule__.ts.html +30 -15
  148. package/coverage/src/concepts/Variable__.ts.html +61 -16
  149. package/coverage/src/concepts/ViewBlock__.ts.html +9 -6
  150. package/coverage/src/concepts/ViewComponent__.ts.html +99 -24
  151. package/coverage/src/concepts/ViewElement__.ts.html +334 -181
  152. package/coverage/src/concepts/View__.ts.html +326 -71
  153. package/coverage/src/concepts/WhileStatement__.ts.html +78 -45
  154. package/coverage/src/concepts/basics/stdlib/index.html +1 -1
  155. package/coverage/src/concepts/basics/stdlib/index.ts.html +1 -1
  156. package/coverage/src/concepts/basics/stdlib/nasl.auth.ts.html +1 -1
  157. package/coverage/src/concepts/basics/stdlib/nasl.browser.ts.html +1 -1
  158. package/coverage/src/concepts/basics/stdlib/nasl.collection.ts.html +1 -1
  159. package/coverage/src/concepts/basics/stdlib/nasl.configuration.ts.html +1 -1
  160. package/coverage/src/concepts/basics/stdlib/nasl.core.ts.html +1 -1
  161. package/coverage/src/concepts/basics/stdlib/nasl.event.ts.html +1 -1
  162. package/coverage/src/concepts/basics/stdlib/nasl.http.ts.html +1 -1
  163. package/coverage/src/concepts/basics/stdlib/nasl.interface.ts.html +1 -1
  164. package/coverage/src/concepts/basics/stdlib/nasl.io.ts.html +1 -1
  165. package/coverage/src/concepts/basics/stdlib/nasl.logging.ts.html +1 -1
  166. package/coverage/src/concepts/basics/stdlib/nasl.process.ts.html +1 -1
  167. package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +1 -1
  168. package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +1 -1
  169. package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +1 -1
  170. package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +1 -1
  171. package/coverage/src/concepts/basics/stdlib/timeZone.ts.html +1 -1
  172. package/coverage/src/concepts/basics/types/coreTypeList.ts.html +1 -1
  173. package/coverage/src/concepts/basics/types/index.html +1 -1
  174. package/coverage/src/concepts/basics/types/index.ts.html +1 -1
  175. package/coverage/src/concepts/index.html +823 -808
  176. package/coverage/src/concepts/index.ts.html +1 -1
  177. package/coverage/src/concepts/index__.ts.html +7 -4
  178. package/coverage/src/config.ts.html +1 -1
  179. package/coverage/src/decorators/index.html +1 -1
  180. package/coverage/src/decorators/index.ts.html +24 -24
  181. package/coverage/src/decorators/promise.ts.html +1 -1
  182. package/coverage/src/eventBus.ts.html +1 -1
  183. package/coverage/src/generator/compileComponent.ts.html +1 -1
  184. package/coverage/src/generator/genBundleFiles.ts.html +13 -19
  185. package/coverage/src/generator/genHash.ts.html +1 -1
  186. package/coverage/src/generator/genMetaData.ts.html +103 -16
  187. package/coverage/src/generator/genReleaseBody.ts.html +1 -1
  188. package/coverage/src/generator/icestark.ts.html +1 -1
  189. package/coverage/src/generator/index.html +15 -15
  190. package/coverage/src/generator/index.ts.html +1 -1
  191. package/coverage/src/generator/microApp.ts.html +1 -1
  192. package/coverage/src/generator/permission.ts.html +1 -1
  193. package/coverage/src/generator/qiankun.ts.html +1 -1
  194. package/coverage/src/generator/styleReplacer.ts.html +1 -1
  195. package/coverage/src/index.html +7 -7
  196. package/coverage/src/index.ts.html +4 -4
  197. package/coverage/src/manager/diagnostic.ts.html +1 -1
  198. package/coverage/src/manager/index.html +1 -1
  199. package/coverage/src/manager/stepRecorder.ts.html +1 -1
  200. package/coverage/src/natural/genNaturalTS.ts.html +1 -1
  201. package/coverage/src/natural/index.html +15 -15
  202. package/coverage/src/natural/index.ts.html +1 -1
  203. package/coverage/src/natural/naslStdlibMap.ts.html +1 -1
  204. package/coverage/src/natural/transformTSCode.ts.html +78 -18
  205. package/coverage/src/sentry/index.html +1 -1
  206. package/coverage/src/sentry/index.ts.html +21 -21
  207. package/coverage/src/server/createUiTs.ts.html +15 -6
  208. package/coverage/src/server/entity2LogicNamespace.ts.html +1 -1
  209. package/coverage/src/server/event.js.html +1 -1
  210. package/coverage/src/server/extendBaseNode.ts.html +7 -4
  211. package/coverage/src/server/formatTsUtils.ts.html +1 -1
  212. package/coverage/src/server/getConnector.ts.html +1 -1
  213. package/coverage/src/server/getExtensionModules.ts.html +1 -1
  214. package/coverage/src/server/getFunctions.ts.html +1 -1
  215. package/coverage/src/server/getInterfaces.ts.html +1 -1
  216. package/coverage/src/server/getLogging.ts.html +1 -1
  217. package/coverage/src/server/getLogics.ts.html +1 -1
  218. package/coverage/src/server/getMemberIdentifier.ts.html +161 -113
  219. package/coverage/src/server/getProcessComponents.ts.html +1 -1
  220. package/coverage/src/server/getProcesses.ts.html +1 -1
  221. package/coverage/src/server/getValidates.ts.html +1 -1
  222. package/coverage/src/server/index.html +25 -25
  223. package/coverage/src/server/index.ts.html +1 -1
  224. package/coverage/src/server/naslServer.ts.html +470 -59
  225. package/coverage/src/server/naslStdlibMap.ts.html +1 -1
  226. package/coverage/src/server/process2LogicNamespace.ts.html +1 -1
  227. package/coverage/src/server/translator.ts.html +3 -3
  228. package/coverage/src/service/creator/add.configs.js.html +26 -8
  229. package/coverage/src/service/creator/errHandles.js.html +19 -37
  230. package/coverage/src/service/creator/index.html +22 -22
  231. package/coverage/src/service/creator/index.js.html +1 -1
  232. package/coverage/src/service/datasource/api.js.html +1 -1
  233. package/coverage/src/service/datasource/index.html +1 -1
  234. package/coverage/src/service/datasource/index.js.html +1 -1
  235. package/coverage/src/service/logic/api.js.html +1 -1
  236. package/coverage/src/service/logic/index.html +1 -1
  237. package/coverage/src/service/logic/index.js.html +1 -1
  238. package/coverage/src/service/storage/api.js.html +1 -1
  239. package/coverage/src/service/storage/index.html +19 -19
  240. package/coverage/src/service/storage/index.ts.html +1 -1
  241. package/coverage/src/service/storage/init.ts.html +1498 -598
  242. package/coverage/src/service/storage/jsoner.ts.html +3 -3
  243. package/coverage/src/service/storage/map.ts.html +1 -1
  244. package/coverage/src/service/storage/service.ts.html +1 -1
  245. package/coverage/src/service/storage/storagePoint.ts.html +1 -1
  246. package/coverage/src/templator/genCallComponentLogic.ts.html +1 -1
  247. package/coverage/src/templator/genCreateBlock.ts.html +47 -56
  248. package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +49 -31
  249. package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +81 -93
  250. package/coverage/src/templator/genEditTableBlock.ts.html +80 -11
  251. package/coverage/src/templator/genEnumSelectBlock.ts.html +1 -1
  252. package/coverage/src/templator/genGetBlock.ts.html +1 -1
  253. package/coverage/src/templator/genGridViewBlock.ts.html +1 -1
  254. package/coverage/src/templator/genListViewBlock.ts.html +1 -1
  255. package/coverage/src/templator/genQueryComponent.ts.html +1 -1
  256. package/coverage/src/templator/genSelectBlock.ts.html +1 -1
  257. package/coverage/src/templator/genTableBlock.ts.html +66 -3
  258. package/coverage/src/templator/genUpdateBlock.ts.html +48 -36
  259. package/coverage/src/templator/index.html +39 -39
  260. package/coverage/src/templator/index.ts.html +1 -1
  261. package/coverage/src/templator/utils.ts.html +77 -11
  262. package/coverage/src/translator/constant.ts.html +1 -1
  263. package/coverage/src/translator/index.html +20 -20
  264. package/coverage/src/translator/index.ts.html +1 -1
  265. package/coverage/src/translator/utils.ts.html +87 -30
  266. package/coverage/src/utils/cookie.ts.html +1 -1
  267. package/coverage/src/utils/env.ts.html +1 -1
  268. package/coverage/src/utils/index.html +27 -27
  269. package/coverage/src/utils/index.ts.html +115 -22
  270. package/coverage/src/utils/logger.ts.html +1 -1
  271. package/coverage/src/utils/sortTsString.ts.html +1 -1
  272. package/coverage/src/utils/string.ts.html +110 -8
  273. package/coverage/src/utils/time-slicing.ts.html +1 -1
  274. package/coverage/src/utils/traverse.ts.html +1 -1
  275. package/coverage/src/utils/window.ts.html +1 -1
  276. package/out/bak/translator.d.ts +1 -1
  277. package/out/bak/translator.js +42 -7
  278. package/out/bak/translator.js.map +1 -1
  279. package/out/common/BaseNode.d.ts +9 -4
  280. package/out/common/BaseNode.js +48 -9
  281. package/out/common/BaseNode.js.map +1 -1
  282. package/out/concepts/Abort__.js +3 -1
  283. package/out/concepts/Abort__.js.map +1 -1
  284. package/out/concepts/Anchor__.js +10 -4
  285. package/out/concepts/Anchor__.js.map +1 -1
  286. package/out/concepts/AnonymousFunction__.js +27 -11
  287. package/out/concepts/AnonymousFunction__.js.map +1 -1
  288. package/out/concepts/App__.d.ts +85 -0
  289. package/out/concepts/App__.js +241 -63
  290. package/out/concepts/App__.js.map +1 -1
  291. package/out/concepts/Argument__.js +16 -5
  292. package/out/concepts/Argument__.js.map +1 -1
  293. package/out/concepts/Assignee__.js +17 -7
  294. package/out/concepts/Assignee__.js.map +1 -1
  295. package/out/concepts/AssignmentLine__.js +3 -1
  296. package/out/concepts/AssignmentLine__.js.map +1 -1
  297. package/out/concepts/Assignment__.js +38 -9
  298. package/out/concepts/Assignment__.js.map +1 -1
  299. package/out/concepts/Attribute__.js +10 -4
  300. package/out/concepts/Attribute__.js.map +1 -1
  301. package/out/concepts/AuthInterface__.js +3 -1
  302. package/out/concepts/AuthInterface__.js.map +1 -1
  303. package/out/concepts/AuthLogicForCallInterface__.js +10 -4
  304. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  305. package/out/concepts/AuthLogic__.js +3 -1
  306. package/out/concepts/AuthLogic__.js.map +1 -1
  307. package/out/concepts/BackendVariable__.js +34 -6
  308. package/out/concepts/BackendVariable__.js.map +1 -1
  309. package/out/concepts/Backend__.js +10 -4
  310. package/out/concepts/Backend__.js.map +1 -1
  311. package/out/concepts/BatchAssignment__.js +27 -13
  312. package/out/concepts/BatchAssignment__.js.map +1 -1
  313. package/out/concepts/BinaryExpression__.js +50 -16
  314. package/out/concepts/BinaryExpression__.js.map +1 -1
  315. package/out/concepts/BindAttribute__.js +37 -6
  316. package/out/concepts/BindAttribute__.js.map +1 -1
  317. package/out/concepts/BindDirective__.js +27 -5
  318. package/out/concepts/BindDirective__.js.map +1 -1
  319. package/out/concepts/BindEvent__.js +17 -7
  320. package/out/concepts/BindEvent__.js.map +1 -1
  321. package/out/concepts/BindStyle__.js +10 -4
  322. package/out/concepts/BindStyle__.js.map +1 -1
  323. package/out/concepts/BooleanLiteral__.js +3 -1
  324. package/out/concepts/BooleanLiteral__.js.map +1 -1
  325. package/out/concepts/CallAuthInterface__.js +10 -4
  326. package/out/concepts/CallAuthInterface__.js.map +1 -1
  327. package/out/concepts/CallConnector__.js +3 -1
  328. package/out/concepts/CallConnector__.js.map +1 -1
  329. package/out/concepts/CallFunction__.js +45 -16
  330. package/out/concepts/CallFunction__.js.map +1 -1
  331. package/out/concepts/CallInterface__.js +14 -8
  332. package/out/concepts/CallInterface__.js.map +1 -1
  333. package/out/concepts/CallLogic__.js +49 -27
  334. package/out/concepts/CallLogic__.js.map +1 -1
  335. package/out/concepts/CallQueryComponent__.js +17 -7
  336. package/out/concepts/CallQueryComponent__.js.map +1 -1
  337. package/out/concepts/Comment__.js +3 -1
  338. package/out/concepts/Comment__.js.map +1 -1
  339. package/out/concepts/CompletionProperty__.js +10 -4
  340. package/out/concepts/CompletionProperty__.js.map +1 -1
  341. package/out/concepts/ConfigGroup__.js +10 -4
  342. package/out/concepts/ConfigGroup__.js.map +1 -1
  343. package/out/concepts/ConfigPropertyValue__.js +3 -1
  344. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  345. package/out/concepts/ConfigProperty__.js +10 -4
  346. package/out/concepts/ConfigProperty__.js.map +1 -1
  347. package/out/concepts/Configuration__.js +10 -4
  348. package/out/concepts/Configuration__.js.map +1 -1
  349. package/out/concepts/Connection__.js +10 -4
  350. package/out/concepts/Connection__.js.map +1 -1
  351. package/out/concepts/ConnectorTrigger__.js +3 -1
  352. package/out/concepts/ConnectorTrigger__.js.map +1 -1
  353. package/out/concepts/Connector__.js +38 -16
  354. package/out/concepts/Connector__.js.map +1 -1
  355. package/out/concepts/Constant__.js +10 -4
  356. package/out/concepts/Constant__.js.map +1 -1
  357. package/out/concepts/DataSource__.js +10 -4
  358. package/out/concepts/DataSource__.js.map +1 -1
  359. package/out/concepts/DatabaseTypeAnnotation__.js +3 -1
  360. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
  361. package/out/concepts/Destination__.js +10 -4
  362. package/out/concepts/Destination__.js.map +1 -1
  363. package/out/concepts/End__.js +3 -1
  364. package/out/concepts/End__.js.map +1 -1
  365. package/out/concepts/EntityIndex__.js +3 -1
  366. package/out/concepts/EntityIndex__.js.map +1 -1
  367. package/out/concepts/EntityProperty__.js +25 -8
  368. package/out/concepts/EntityProperty__.js.map +1 -1
  369. package/out/concepts/Entity__.js +17 -7
  370. package/out/concepts/Entity__.js.map +1 -1
  371. package/out/concepts/EnumItem__.js +3 -1
  372. package/out/concepts/EnumItem__.js.map +1 -1
  373. package/out/concepts/Enum__.js +10 -4
  374. package/out/concepts/Enum__.js.map +1 -1
  375. package/out/concepts/Event__.js +10 -4
  376. package/out/concepts/Event__.js.map +1 -1
  377. package/out/concepts/ExternalDestination__.js +10 -4
  378. package/out/concepts/ExternalDestination__.js.map +1 -1
  379. package/out/concepts/ForEachStatement__.js +32 -24
  380. package/out/concepts/ForEachStatement__.js.map +1 -1
  381. package/out/concepts/FrontendLibrary__.js +17 -7
  382. package/out/concepts/FrontendLibrary__.js.map +1 -1
  383. package/out/concepts/Frontend__.js +38 -16
  384. package/out/concepts/Frontend__.js.map +1 -1
  385. package/out/concepts/Function__.js +41 -17
  386. package/out/concepts/Function__.js.map +1 -1
  387. package/out/concepts/Identifier__.js +3 -1
  388. package/out/concepts/Identifier__.js.map +1 -1
  389. package/out/concepts/IfStatement__.js +25 -17
  390. package/out/concepts/IfStatement__.js.map +1 -1
  391. package/out/concepts/Integration__.js +17 -7
  392. package/out/concepts/Integration__.js.map +1 -1
  393. package/out/concepts/InterfaceParam__.js +10 -4
  394. package/out/concepts/InterfaceParam__.js.map +1 -1
  395. package/out/concepts/Interface__.js +24 -10
  396. package/out/concepts/Interface__.js.map +1 -1
  397. package/out/concepts/JSBlock__.js +59 -1
  398. package/out/concepts/JSBlock__.js.map +1 -1
  399. package/out/concepts/JavaLogic__.js +3 -1
  400. package/out/concepts/JavaLogic__.js.map +1 -1
  401. package/out/concepts/LogicItem__.d.ts +4 -4
  402. package/out/concepts/LogicItem__.js +7 -5
  403. package/out/concepts/LogicItem__.js.map +1 -1
  404. package/out/concepts/Logic__.js +49 -23
  405. package/out/concepts/Logic__.js.map +1 -1
  406. package/out/concepts/MatchCase__.js +32 -22
  407. package/out/concepts/MatchCase__.js.map +1 -1
  408. package/out/concepts/Match__.js +22 -16
  409. package/out/concepts/Match__.js.map +1 -1
  410. package/out/concepts/MemberExpression__.js +26 -20
  411. package/out/concepts/MemberExpression__.js.map +1 -1
  412. package/out/concepts/MetadataType__.d.ts +245 -0
  413. package/out/concepts/MetadataType__.js +483 -0
  414. package/out/concepts/MetadataType__.js.map +1 -0
  415. package/out/concepts/MicroApp__.js +3 -1
  416. package/out/concepts/MicroApp__.js.map +1 -1
  417. package/out/concepts/Module__.d.ts +85 -0
  418. package/out/concepts/Module__.js +115 -3
  419. package/out/concepts/Module__.js.map +1 -1
  420. package/out/concepts/MsgTriggerEvent__.js +10 -4
  421. package/out/concepts/MsgTriggerEvent__.js.map +1 -1
  422. package/out/concepts/MsgTriggerLauncher__.js +10 -4
  423. package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
  424. package/out/concepts/Namespace__.js +80 -34
  425. package/out/concepts/Namespace__.js.map +1 -1
  426. package/out/concepts/NewComposite__.js +37 -16
  427. package/out/concepts/NewComposite__.js.map +1 -1
  428. package/out/concepts/NewList__.d.ts +1 -0
  429. package/out/concepts/NewList__.js +39 -11
  430. package/out/concepts/NewList__.js.map +1 -1
  431. package/out/concepts/NewMap__.js +29 -11
  432. package/out/concepts/NewMap__.js.map +1 -1
  433. package/out/concepts/NullLiteral__.js +3 -1
  434. package/out/concepts/NullLiteral__.js.map +1 -1
  435. package/out/concepts/NumericLiteral__.js +11 -5
  436. package/out/concepts/NumericLiteral__.js.map +1 -1
  437. package/out/concepts/OqlQueryComponent__.js +34 -5
  438. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  439. package/out/concepts/OverriddenLogic__.js +45 -19
  440. package/out/concepts/OverriddenLogic__.js.map +1 -1
  441. package/out/concepts/Param__.js +34 -6
  442. package/out/concepts/Param__.js.map +1 -1
  443. package/out/concepts/Point__.js +3 -1
  444. package/out/concepts/Point__.js.map +1 -1
  445. package/out/concepts/ProcessComponent__.js +17 -7
  446. package/out/concepts/ProcessComponent__.js.map +1 -1
  447. package/out/concepts/ProcessElement__.js +59 -25
  448. package/out/concepts/ProcessElement__.js.map +1 -1
  449. package/out/concepts/ProcessOutcome__.js +3 -1
  450. package/out/concepts/ProcessOutcome__.js.map +1 -1
  451. package/out/concepts/ProcessOutcomes__.js +3 -1
  452. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  453. package/out/concepts/Process__.js +38 -16
  454. package/out/concepts/Process__.js.map +1 -1
  455. package/out/concepts/QueryAggregateExpression__.js +10 -4
  456. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  457. package/out/concepts/QueryFieldExpression__.js +3 -1
  458. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  459. package/out/concepts/QueryFromExpression__.js +10 -4
  460. package/out/concepts/QueryFromExpression__.js.map +1 -1
  461. package/out/concepts/QueryGroupByExpression__.js +10 -4
  462. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  463. package/out/concepts/QueryJoinExpression__.js +10 -4
  464. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  465. package/out/concepts/QueryLimitExpression__.js +10 -4
  466. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  467. package/out/concepts/QueryOrderByExpression__.js +10 -4
  468. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  469. package/out/concepts/QuerySelectExpression__.js +10 -4
  470. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  471. package/out/concepts/Rect__.js +3 -1
  472. package/out/concepts/Rect__.js.map +1 -1
  473. package/out/concepts/Return__.js +34 -6
  474. package/out/concepts/Return__.js.map +1 -1
  475. package/out/concepts/Role__.js +3 -1
  476. package/out/concepts/Role__.js.map +1 -1
  477. package/out/concepts/SelectMembers__.js +10 -4
  478. package/out/concepts/SelectMembers__.js.map +1 -1
  479. package/out/concepts/Slot__.js +10 -4
  480. package/out/concepts/Slot__.js.map +1 -1
  481. package/out/concepts/SqlQueryComponent__.js +10 -4
  482. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  483. package/out/concepts/Start__.js +3 -1
  484. package/out/concepts/Start__.js.map +1 -1
  485. package/out/concepts/StringInterpolation__.js +14 -6
  486. package/out/concepts/StringInterpolation__.js.map +1 -1
  487. package/out/concepts/StringLiteral__.js +3 -1
  488. package/out/concepts/StringLiteral__.js.map +1 -1
  489. package/out/concepts/StructureProperty__.js +10 -4
  490. package/out/concepts/StructureProperty__.js.map +1 -1
  491. package/out/concepts/Structure__.js +17 -7
  492. package/out/concepts/Structure__.js.map +1 -1
  493. package/out/concepts/SwitchCase__.js +14 -8
  494. package/out/concepts/SwitchCase__.js.map +1 -1
  495. package/out/concepts/SwitchStatement__.js +10 -4
  496. package/out/concepts/SwitchStatement__.js.map +1 -1
  497. package/out/concepts/Theme__.js +3 -1
  498. package/out/concepts/Theme__.js.map +1 -1
  499. package/out/concepts/Transactional__.js +3 -1
  500. package/out/concepts/Transactional__.js.map +1 -1
  501. package/out/concepts/TriggerEvent__.js +10 -4
  502. package/out/concepts/TriggerEvent__.js.map +1 -1
  503. package/out/concepts/TriggerLauncher__.js +3 -1
  504. package/out/concepts/TriggerLauncher__.js.map +1 -1
  505. package/out/concepts/TypeAnnotation__.d.ts +2 -1
  506. package/out/concepts/TypeAnnotation__.js +75 -15
  507. package/out/concepts/TypeAnnotation__.js.map +1 -1
  508. package/out/concepts/TypeParam__.js +3 -1
  509. package/out/concepts/TypeParam__.js.map +1 -1
  510. package/out/concepts/UnaryExpression__.js +16 -6
  511. package/out/concepts/UnaryExpression__.js.map +1 -1
  512. package/out/concepts/Unparsed__.js +3 -1
  513. package/out/concepts/Unparsed__.js.map +1 -1
  514. package/out/concepts/UseComponent__.js +3 -1
  515. package/out/concepts/UseComponent__.js.map +1 -1
  516. package/out/concepts/ValidationRule__.js +11 -5
  517. package/out/concepts/ValidationRule__.js.map +1 -1
  518. package/out/concepts/Variable__.js +35 -7
  519. package/out/concepts/Variable__.js.map +1 -1
  520. package/out/concepts/ViewBlock__.js +3 -1
  521. package/out/concepts/ViewBlock__.js.map +1 -1
  522. package/out/concepts/ViewComponent__.js +45 -19
  523. package/out/concepts/ViewComponent__.js.map +1 -1
  524. package/out/concepts/ViewElement__.d.ts +1 -0
  525. package/out/concepts/ViewElement__.js +83 -21
  526. package/out/concepts/ViewElement__.js.map +1 -1
  527. package/out/concepts/View__.d.ts +1 -0
  528. package/out/concepts/View__.js +85 -22
  529. package/out/concepts/View__.js.map +1 -1
  530. package/out/concepts/WhileStatement__.js +19 -11
  531. package/out/concepts/WhileStatement__.js.map +1 -1
  532. package/out/concepts/basics/stdlib/nasl.util.js +2 -2
  533. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  534. package/out/concepts/index__.d.ts +1 -0
  535. package/out/concepts/index__.js +1 -0
  536. package/out/concepts/index__.js.map +1 -1
  537. package/out/concepts/types__.d.ts +2 -1
  538. package/out/generator/genBundleFiles.js +0 -1
  539. package/out/generator/genBundleFiles.js.map +1 -1
  540. package/out/generator/genMetaData.js +32 -4
  541. package/out/generator/genMetaData.js.map +1 -1
  542. package/out/generator/permission.js +31 -6
  543. package/out/generator/permission.js.map +1 -1
  544. package/out/sentry/index.js +2 -1
  545. package/out/sentry/index.js.map +1 -1
  546. package/out/server/extendBaseNode.js +1 -1
  547. package/out/server/extendBaseNode.js.map +1 -1
  548. package/out/server/getMemberIdentifier.js +1 -1
  549. package/out/server/getMemberIdentifier.js.map +1 -1
  550. package/out/server/naslServer.d.ts +2 -0
  551. package/out/server/naslServer.js +143 -5
  552. package/out/server/naslServer.js.map +1 -1
  553. package/out/server/translator.js +5 -2
  554. package/out/server/translator.js.map +1 -1
  555. package/out/service/creator/add.configs.js +1 -1
  556. package/out/service/creator/add.configs.js.map +1 -1
  557. package/out/service/storage/init.d.ts +1 -1
  558. package/out/service/storage/init.js +45 -21
  559. package/out/service/storage/init.js.map +1 -1
  560. package/out/templator/genCreateBlock.js +13 -7
  561. package/out/templator/genCreateBlock.js.map +1 -1
  562. package/out/templator/genCurdEditMultipleKeyBlock.js +15 -9
  563. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  564. package/out/templator/genCurdMultipleKeyBlock.js +13 -10
  565. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  566. package/out/templator/genEditTableBlock.js +4 -4
  567. package/out/templator/genEditTableBlock.js.map +1 -1
  568. package/out/templator/genUpdateBlock.js +14 -10
  569. package/out/templator/genUpdateBlock.js.map +1 -1
  570. package/out/templator/utils.d.ts +6 -1
  571. package/out/templator/utils.js +24 -1
  572. package/out/templator/utils.js.map +1 -1
  573. package/out/translator/utils.d.ts +8 -0
  574. package/out/translator/utils.js +19 -1
  575. package/out/translator/utils.js.map +1 -1
  576. package/out/utils/cookie.d.ts +1 -1
  577. package/out/utils/cookie.js +2 -2
  578. package/out/utils/cookie.js.map +1 -1
  579. package/out/utils/index.js +19 -0
  580. package/out/utils/index.js.map +1 -1
  581. package/out/utils/sortTsString.js +10 -4
  582. package/out/utils/sortTsString.js.map +1 -1
  583. package/out/utils/string.d.ts +1 -0
  584. package/out/utils/string.js +33 -1
  585. package/out/utils/string.js.map +1 -1
  586. package/package.json +1 -1
  587. package/sandbox/stdlib/nasl.core.ts +187 -185
  588. package/src/bak/translator.js +76 -43
  589. package/src/common/BaseNode.ts +62 -12
  590. package/src/concepts/Abort__.ts +1 -0
  591. package/src/concepts/Anchor__.ts +19 -14
  592. package/src/concepts/AnonymousFunction__.ts +26 -12
  593. package/src/concepts/App__.ts +359 -76
  594. package/src/concepts/Argument__.ts +14 -4
  595. package/src/concepts/Assignee__.ts +15 -6
  596. package/src/concepts/AssignmentLine__.ts +1 -0
  597. package/src/concepts/Assignment__.ts +43 -11
  598. package/src/concepts/Attribute__.ts +8 -3
  599. package/src/concepts/AuthInterface__.ts +1 -0
  600. package/src/concepts/AuthLogicForCallInterface__.ts +8 -3
  601. package/src/concepts/AuthLogic__.ts +4 -0
  602. package/src/concepts/BackendVariable__.ts +30 -6
  603. package/src/concepts/Backend__.ts +8 -3
  604. package/src/concepts/BatchAssignment__.ts +28 -13
  605. package/src/concepts/BinaryExpression__.ts +56 -22
  606. package/src/concepts/BindAttribute__.ts +50 -18
  607. package/src/concepts/BindDirective__.ts +26 -5
  608. package/src/concepts/BindEvent__.ts +34 -15
  609. package/src/concepts/BindStyle__.ts +8 -3
  610. package/src/concepts/BooleanLiteral__.ts +1 -0
  611. package/src/concepts/CallAuthInterface__.ts +8 -3
  612. package/src/concepts/CallConnector__.ts +1 -0
  613. package/src/concepts/CallFunction__.ts +49 -27
  614. package/src/concepts/CallInterface__.ts +43 -28
  615. package/src/concepts/CallLogic__.ts +85 -62
  616. package/src/concepts/CallQueryComponent__.ts +15 -6
  617. package/src/concepts/Comment__.ts +2 -1
  618. package/src/concepts/CompletionProperty__.ts +8 -3
  619. package/src/concepts/ConfigGroup__.ts +8 -3
  620. package/src/concepts/ConfigPropertyValue__.ts +1 -0
  621. package/src/concepts/ConfigProperty__.ts +8 -3
  622. package/src/concepts/Configuration__.ts +8 -3
  623. package/src/concepts/Connection__.ts +9 -4
  624. package/src/concepts/ConnectorTrigger__.ts +1 -0
  625. package/src/concepts/Connector__.ts +36 -15
  626. package/src/concepts/Constant__.ts +8 -3
  627. package/src/concepts/DataSource__.ts +8 -3
  628. package/src/concepts/DatabaseTypeAnnotation__.ts +1 -0
  629. package/src/concepts/Destination__.ts +8 -4
  630. package/src/concepts/End__.ts +1 -0
  631. package/src/concepts/EntityIndex__.ts +1 -0
  632. package/src/concepts/EntityProperty__.ts +23 -7
  633. package/src/concepts/Entity__.ts +15 -6
  634. package/src/concepts/EnumItem__.ts +1 -0
  635. package/src/concepts/Enum__.ts +8 -3
  636. package/src/concepts/Event__.ts +8 -3
  637. package/src/concepts/ExternalDestination__.ts +8 -3
  638. package/src/concepts/ForEachStatement__.ts +43 -36
  639. package/src/concepts/FrontendLibrary__.ts +15 -6
  640. package/src/concepts/Frontend__.ts +36 -15
  641. package/src/concepts/Function__.ts +40 -18
  642. package/src/concepts/Identifier__.ts +1 -0
  643. package/src/concepts/IfStatement__.ts +29 -20
  644. package/src/concepts/Integration__.ts +15 -6
  645. package/src/concepts/InterfaceParam__.ts +8 -3
  646. package/src/concepts/Interface__.ts +28 -15
  647. package/src/concepts/JSBlock__.ts +60 -0
  648. package/src/concepts/JavaLogic__.ts +1 -0
  649. package/src/concepts/LogicItem__.ts +5 -4
  650. package/src/concepts/Logic__.ts +70 -58
  651. package/src/concepts/MatchCase__.ts +42 -29
  652. package/src/concepts/Match__.ts +23 -16
  653. package/src/concepts/MemberExpression__.ts +24 -19
  654. package/src/concepts/MetadataType__.ts +637 -0
  655. package/src/concepts/MicroApp__.ts +1 -0
  656. package/src/concepts/Module__.ts +227 -9
  657. package/src/concepts/MsgTriggerEvent__.ts +8 -3
  658. package/src/concepts/MsgTriggerLauncher__.ts +8 -3
  659. package/src/concepts/Namespace__.ts +78 -33
  660. package/src/concepts/NewComposite__.ts +41 -19
  661. package/src/concepts/NewList__.ts +41 -11
  662. package/src/concepts/NewMap__.ts +31 -11
  663. package/src/concepts/NullLiteral__.ts +1 -0
  664. package/src/concepts/NumericLiteral__.ts +9 -4
  665. package/src/concepts/OqlQueryComponent__.ts +35 -5
  666. package/src/concepts/OverriddenLogic__.ts +44 -19
  667. package/src/concepts/Param__.ts +38 -15
  668. package/src/concepts/Point__.ts +1 -0
  669. package/src/concepts/ProcessComponent__.ts +15 -6
  670. package/src/concepts/ProcessElement__.ts +57 -24
  671. package/src/concepts/ProcessOutcome__.ts +1 -0
  672. package/src/concepts/ProcessOutcomes__.ts +1 -0
  673. package/src/concepts/Process__.ts +36 -15
  674. package/src/concepts/QueryAggregateExpression__.ts +8 -3
  675. package/src/concepts/QueryFieldExpression__.ts +1 -0
  676. package/src/concepts/QueryFromExpression__.ts +8 -3
  677. package/src/concepts/QueryGroupByExpression__.ts +8 -3
  678. package/src/concepts/QueryJoinExpression__.ts +8 -3
  679. package/src/concepts/QueryLimitExpression__.ts +8 -3
  680. package/src/concepts/QueryOrderByExpression__.ts +8 -3
  681. package/src/concepts/QuerySelectExpression__.ts +8 -3
  682. package/src/concepts/Rect__.ts +1 -0
  683. package/src/concepts/Return__.ts +31 -6
  684. package/src/concepts/Role__.ts +1 -0
  685. package/src/concepts/SelectMembers__.ts +8 -3
  686. package/src/concepts/Slot__.ts +8 -3
  687. package/src/concepts/SqlQueryComponent__.ts +8 -3
  688. package/src/concepts/Start__.ts +1 -0
  689. package/src/concepts/StringInterpolation__.ts +14 -7
  690. package/src/concepts/StringLiteral__.ts +1 -0
  691. package/src/concepts/StructureProperty__.ts +8 -3
  692. package/src/concepts/Structure__.ts +15 -6
  693. package/src/concepts/SwitchCase__.ts +14 -9
  694. package/src/concepts/SwitchStatement__.ts +21 -16
  695. package/src/concepts/Theme__.ts +1 -0
  696. package/src/concepts/Transactional__.ts +1 -0
  697. package/src/concepts/TriggerEvent__.ts +8 -3
  698. package/src/concepts/TriggerLauncher__.ts +1 -0
  699. package/src/concepts/TypeAnnotation__.ts +75 -21
  700. package/src/concepts/TypeParam__.ts +2 -1
  701. package/src/concepts/UnaryExpression__.ts +15 -6
  702. package/src/concepts/Unparsed__.ts +2 -1
  703. package/src/concepts/UseComponent__.ts +1 -0
  704. package/src/concepts/ValidationRule__.ts +10 -5
  705. package/src/concepts/Variable__.ts +32 -8
  706. package/src/concepts/ViewBlock__.ts +1 -0
  707. package/src/concepts/ViewComponent__.ts +43 -18
  708. package/src/concepts/ViewElement__.ts +191 -120
  709. package/src/concepts/View__.ts +136 -58
  710. package/src/concepts/WhileStatement__.ts +26 -15
  711. package/src/concepts/basics/stdlib/nasl.util.ts +2 -2
  712. package/src/concepts/index__.ts +1 -0
  713. package/src/concepts/types__.ts +2 -0
  714. package/src/generator/genBundleFiles.ts +11 -13
  715. package/src/generator/genMetaData.ts +37 -8
  716. package/src/generator/permission.ts +33 -9
  717. package/src/sentry/index.ts +3 -1
  718. package/src/server/extendBaseNode.ts +2 -1
  719. package/src/server/getMemberIdentifier.ts +122 -121
  720. package/src/server/naslServer.ts +141 -5
  721. package/src/server/translator.ts +5 -2
  722. package/src/service/creator/add.configs.js +1 -1
  723. package/src/service/storage/init.ts +46 -22
  724. package/src/templator/genCreateBlock.ts +35 -38
  725. package/src/templator/genCurdEditMultipleKeyBlock.ts +31 -25
  726. package/src/templator/genCurdMultipleKeyBlock.ts +67 -71
  727. package/src/templator/genEditTableBlock.ts +7 -6
  728. package/src/templator/genUpdateBlock.ts +30 -26
  729. package/src/templator/utils.ts +23 -1
  730. package/src/translator/utils.ts +20 -0
  731. package/src/utils/cookie.ts +2 -2
  732. package/src/utils/index.ts +19 -1
  733. package/src/utils/sortTsString.ts +9 -4
  734. package/src/utils/string.ts +34 -0
  735. package/test/concepts/call-function/__snapshots__/toEmbeddedTS.spec.ts.snap +26 -0
  736. package/test/concepts/call-function/__snapshots__/toJS.spec.ts.snap +26 -0
  737. package/test/concepts/call-function/constant.ts +5 -0
  738. package/test/concepts/call-function/fixtures/from-string.json +100 -0
  739. package/test/concepts/call-function/fixtures/to-string-global-tz.json +99 -0
  740. package/test/concepts/call-function/fixtures/to-string-no-tz.json +89 -0
  741. package/test/concepts/call-function/fixtures/to-string-user-tz.json +101 -0
  742. package/test/concepts/call-function/fixtures/to-string-utc-tz.json +101 -0
  743. package/test/concepts/call-function/toEmbeddedTS.spec.ts +14 -0
  744. package/test/concepts/call-function/toJS.spec.ts +14 -0
  745. package/test/concepts/call-interface/__snapshots__/toJS.spec.ts.snap +2 -2
  746. package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +3 -3
  747. package/test/concepts/match/__snapshots__/toJS.spec.ts.snap +1 -1
  748. package/test/concepts/numeric-literal/__snapshots__/toJS.spec.ts.snap +1 -1
  749. package/test/concepts/validation-rule/__snapshots__/toJS.spec.ts.snap +3 -3
  750. package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +4 -0
  751. package/.nyc_output/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +0 -1
  752. package/.nyc_output/processinfo/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +0 -1
  753. package/.nyc_output/processinfo/index.json +0 -1
@@ -25,7 +25,6 @@ import Module from './Module__';
25
25
  import App from './App__';
26
26
  import Frontend from './Frontend__';
27
27
  import Process from './Process__';
28
- import Identifier from './Identifier__';
29
28
 
30
29
  /**
31
30
  * 元素绑定属性
@@ -40,6 +39,7 @@ export class BindAttribute extends BaseNode {
40
39
  /**
41
40
  * 产品概念
42
41
  */
42
+ @property('concept')
43
43
  // @ts-ignore
44
44
  readonly concept!: 'BindAttribute';
45
45
 
@@ -669,11 +669,15 @@ export class BindAttribute extends BaseNode {
669
669
  };
670
670
  if (parentKey) {
671
671
  params.parentKey = parentKey;
672
- if (Array.isArray((this as any)[parentKey])) {
673
- const index = (this as any)[parentKey].indexOf(logicItem);
672
+ // @ts-ignore
673
+ const t = this.__v_raw || this;
674
+ // @ts-ignore
675
+ const n = logicItem.__v_raw || logicItem;
676
+ if (Array.isArray((t as any)[parentKey])) {
677
+ const index = (t as any)[parentKey].indexOf(n);
674
678
  ~index && (this as any)[parentKey].splice(index, 1);
675
679
  params.index = index;
676
- } else if ((this as any)[parentKey] === logicItem) {
680
+ } else if ((t as any)[parentKey] === n) {
677
681
  params.index = 0;
678
682
  (this as any)[parentKey] = undefined;
679
683
  }
@@ -1004,7 +1008,23 @@ export class BindAttribute extends BaseNode {
1004
1008
  // 文本默认要经过toString转换
1005
1009
  if (options?.finalCode !== false && name === 'text' && !this.sync && this.type === 'dynamic') {
1006
1010
  const expTypeAnnotation = (this.expression as any)?.typeAnnotation || this.expression?.__TypeAnnotation;
1007
- value = `$utils['ToString']('${expTypeAnnotation?.sortedTypeKey}', ${value})`;
1011
+ // 针对union类型,typeAnntatation拿不到app数据,暂时先在这里处理
1012
+ if (expTypeAnnotation?.typeKind === 'union' && expTypeAnnotation?.typeArguments?.length) {
1013
+ expTypeAnnotation?.typeArguments?.forEach((typeArg: any) => {
1014
+ if (typeArg.typeNamespace?.endsWith('.metadataTypes')) {
1015
+ const referenceNode = this.app.findNodeByCompleteName(typeArg.typeNamespace + '.' + typeArg.typeName)?.typeAnnotation || {};
1016
+ typeArg.typeName = referenceNode.typeName
1017
+ typeArg.typeKind = referenceNode.typeKind
1018
+ typeArg.typeNamespace = referenceNode.typeNamespace
1019
+ }
1020
+ })
1021
+ }
1022
+ if (expTypeAnnotation?.typeNamespace?.endsWith('.metadataTypes')) {
1023
+ const referenceNode = this.app.findNodeByCompleteName(expTypeAnnotation.typeNamespace + '.' + expTypeAnnotation.typeName)?.typeAnnotation || {};
1024
+ value = `$utils['ToString']('${referenceNode?.typeNamespace}.${referenceNode.typeName}', ${value})`;
1025
+ } else {
1026
+ value = `$utils['ToString']('${expTypeAnnotation?.sortedTypeKey}', ${value})`;
1027
+ }
1008
1028
  }
1009
1029
  if (this.type === 'string' && name !== 'rules') {
1010
1030
  if (options?.finalCode !== false) {
@@ -1088,22 +1108,25 @@ export class BindAttribute extends BaseNode {
1088
1108
  return code;
1089
1109
  }
1090
1110
 
1091
- toEmbeddedTSVariableDefinition(state?: TranslatorState, attrList?: string[], elementName?: string, currentLevel?: string): string {
1111
+ toEmbeddedTSVariableDefinition(
1112
+ state?: TranslatorState,
1113
+ attrList?: string[],
1114
+ elementName?: string,
1115
+ currentLevel?: string,
1116
+ ): string {
1092
1117
  let code = '';
1093
1118
  let arrCode = '';
1094
1119
  code += indent((state?.tabSize || 0) + 3);
1095
1120
  code += `${attrConvertCamelCase(this.name)}: `;
1096
1121
  if (this.expression) {
1097
1122
  if (this.name === 'data-source') {
1098
- code += `ReturnType<typeof __elements_stashFunctionVariable.${elementName}_${attrConvertCamelCase(
1099
- this.name,
1100
- )}>`;
1123
+ code += `ReturnType<typeof __elements_stashFunctionVariable.${elementName}_${attrConvertCamelCase(this.name)}>`;
1101
1124
  } else {
1102
1125
  code += `ReturnType<typeof __elements_stashFunctionVariable.${elementName}_${attrConvertCamelCase(this.name)}>`;
1103
1126
  }
1104
1127
  arrCode = `() => {
1105
1128
  return __elements_variable_function.${currentLevel}?.${attrConvertCamelCase(this.name)}?.()
1106
- }`
1129
+ }`;
1107
1130
  } else if (this.name === 'sorting') {
1108
1131
  code += `{
1109
1132
  field: nasl.core.String
@@ -1144,24 +1167,34 @@ export class BindAttribute extends BaseNode {
1144
1167
  } else {
1145
1168
  stashVariable = `${this.expression.toEmbeddedTS()}`;
1146
1169
  }
1147
- code += `() => {\n`
1170
+ code += `() => {\n`;
1148
1171
  code += indent((state?.tabSize || 0) + 5);
1149
- code += `return ${stashVariable}\n`
1172
+ code += `return ${stashVariable}\n`;
1150
1173
  code += indent((state?.tabSize || 0) + 4);
1151
- code += `},\n`
1174
+ code += `},\n`;
1152
1175
  }
1153
1176
  return code;
1154
1177
  }
1155
1178
 
1156
1179
  findCurrentElementParent(node: any): ViewElement | undefined {
1157
1180
  if (node.parentNode instanceof ViewElement) {
1158
- if (['u-table-view', 'u-list-view', 'u-grid-view', 'u-list-components', 'van-list-view', 'van-grid-view', 'van-for-components'].includes(node.parentNode.tag)) {
1159
- return node.parentNode
1181
+ if (
1182
+ [
1183
+ 'u-table-view',
1184
+ 'u-list-view',
1185
+ 'u-grid-view',
1186
+ 'u-list-components',
1187
+ 'van-list-view',
1188
+ 'van-grid-view',
1189
+ 'van-for-components',
1190
+ ].includes(node.parentNode.tag)
1191
+ ) {
1192
+ return node.parentNode;
1160
1193
  } else {
1161
- return this.findCurrentElementParent(node.parentNode)
1194
+ return this.findCurrentElementParent(node.parentNode);
1162
1195
  }
1163
1196
  } else {
1164
- return undefined
1197
+ return undefined;
1165
1198
  }
1166
1199
  }
1167
1200
  @withSourceMap()
@@ -1247,4 +1280,3 @@ export function attrConvertCamelCase(str: string) {
1247
1280
  });
1248
1281
  return strList.join('');
1249
1282
  }
1250
-
@@ -31,6 +31,7 @@ export class BindDirective extends BaseNode {
31
31
  /**
32
32
  * 产品概念
33
33
  */
34
+ @property('concept')
34
35
  // @ts-ignore
35
36
  readonly concept!: 'BindDirective';
36
37
 
@@ -306,11 +307,15 @@ export class BindDirective extends BaseNode {
306
307
  };
307
308
  if (parentKey) {
308
309
  params.parentKey = parentKey;
309
- if (Array.isArray((this as any)[parentKey])) {
310
- const index = (this as any)[parentKey].indexOf(logicItem);
310
+ // @ts-ignore
311
+ const t = this.__v_raw || this;
312
+ // @ts-ignore
313
+ const n = logicItem.__v_raw || logicItem;
314
+ if (Array.isArray((t as any)[parentKey])) {
315
+ const index = (t as any)[parentKey].indexOf(n);
311
316
  ~index && (this as any)[parentKey].splice(index, 1);
312
317
  params.index = index;
313
- } else if ((this as any)[parentKey] === logicItem) {
318
+ } else if ((t as any)[parentKey] === n) {
314
319
  params.index = 0;
315
320
  (this as any)[parentKey] = undefined;
316
321
  }
@@ -526,7 +531,21 @@ export class BindDirective extends BaseNode {
526
531
  toVue(options?: ElementToVueOptions) {
527
532
  let str = '';
528
533
  // eslint-disable-next-line no-nested-ternary
529
- let value = (this.type ?? 'string') !== 'string' ? this.value : this.value ? `'${this.value}'` : '';
534
+ let value = this.value;
535
+ if(this.type === 'string') {
536
+ value = value.replace(/['"`\\]/g, (m) => {
537
+ let escape = '\\\\';
538
+ escape = '\\\\';
539
+ /// #if process.env.BUILD_TARGET === 'node'
540
+ escape = '\\';
541
+ /// #endif
542
+ if (m === '\\') {
543
+ return `${escape}${escape}`;
544
+ }
545
+ return `${escape}${m}`;
546
+ });
547
+ }
548
+ value = (this.type ?? 'string') !== 'string' ? this.value : value ? `\`${value}\`` : '';
530
549
  // 需要用标识符替换
531
550
  // if (options.finalCode !== false && this.needReplaceWithIdentifier) {
532
551
  // const argsList = this.getArgsList();
@@ -537,7 +556,9 @@ export class BindDirective extends BaseNode {
537
556
  if (this.expression.concept === 'StringLiteral') {
538
557
  value = `${value}`;
539
558
  }
540
- value = value?.replace(/"/g, "'");
559
+ }
560
+ if (value !== undefined && value !== null && typeof value === 'string') {
561
+ value = value?.replace(/"/g, "'");
541
562
  }
542
563
  if (this.name === 'auth' && !!this.value) {
543
564
  const regex = /(.\w+\[name=\w+\])/g;
@@ -38,6 +38,7 @@ export class BindEvent extends BaseNode {
38
38
  /**
39
39
  * 产品概念
40
40
  */
41
+ @property('concept')
41
42
  // @ts-ignore
42
43
  readonly concept!: 'BindEvent';
43
44
 
@@ -455,11 +456,15 @@ export class BindEvent extends BaseNode {
455
456
  };
456
457
  if (parentKey) {
457
458
  params.parentKey = parentKey;
458
- if (Array.isArray((this as any)[parentKey])) {
459
- const index = (this as any)[parentKey].indexOf(logic);
459
+ // @ts-ignore
460
+ const t = this.__v_raw || this;
461
+ // @ts-ignore
462
+ const n = logic.__v_raw || logic;
463
+ if (Array.isArray((t as any)[parentKey])) {
464
+ const index = (t as any)[parentKey].indexOf(n);
460
465
  ~index && (this as any)[parentKey].splice(index, 1);
461
466
  params.index = index;
462
- } else if ((this as any)[parentKey] === logic) {
467
+ } else if ((t as any)[parentKey] === n) {
463
468
  params.index = 0;
464
469
  (this as any)[parentKey] = undefined;
465
470
  }
@@ -489,11 +494,15 @@ export class BindEvent extends BaseNode {
489
494
  };
490
495
  if (parentKey) {
491
496
  params.parentKey = parentKey;
492
- if (Array.isArray((this as any)[parentKey])) {
493
- const index = (this as any)[parentKey].indexOf(logicItem);
497
+ // @ts-ignore
498
+ const t = this.__v_raw || this;
499
+ // @ts-ignore
500
+ const n = logicItem.__v_raw || logicItem;
501
+ if (Array.isArray((t as any)[parentKey])) {
502
+ const index = (t as any)[parentKey].indexOf(n);
494
503
  ~index && (this as any)[parentKey].splice(index, 1);
495
504
  params.index = index;
496
- } else if ((this as any)[parentKey] === logicItem) {
505
+ } else if ((t as any)[parentKey] === n) {
497
506
  params.index = 0;
498
507
  (this as any)[parentKey] = undefined;
499
508
  }
@@ -677,9 +686,13 @@ export class BindEvent extends BaseNode {
677
686
  this.logics.forEach((logic, index) => {
678
687
  const logicName = `viewLogic_${logic.name}${index}`;
679
688
  // logic.name = logic.view.name + logic.name + index;
680
- code += logic.toNaturalTS(shiftState(state, code, {
681
- tabSize: state.tabSize,
682
- }), 'noExport', logicName);
689
+ code += logic.toNaturalTS(
690
+ shiftState(state, code, {
691
+ tabSize: state.tabSize,
692
+ }),
693
+ 'noExport',
694
+ logicName,
695
+ );
683
696
 
684
697
  // logic.name = logicName;
685
698
  // code += indent(state.tabSize);
@@ -704,17 +717,23 @@ export class BindEvent extends BaseNode {
704
717
  // logic.name = '__' + logic.view.name + (logic.parentNode as BindEvent).element.name + logic.name;
705
718
  logic.name = logic.name.replace(/-/g, '');
706
719
  try {
707
- code += logic.toNaturalTS(shiftState(state, code, {
708
- tabSize: state.tabSize,
709
- }), 'noExport');
720
+ code += logic.toNaturalTS(
721
+ shiftState(state, code, {
722
+ tabSize: state.tabSize,
723
+ }),
724
+ 'noExport',
725
+ );
710
726
  } finally {
711
727
  // 翻译logic可能出错
712
728
  logic.name = logicName;
713
729
  }
714
730
  } else {
715
- code += logic.toNaturalTS(shiftState(state, code, {
716
- tabSize: state.tabSize,
717
- }), 'noExport');
731
+ code += logic.toNaturalTS(
732
+ shiftState(state, code, {
733
+ tabSize: state.tabSize,
734
+ }),
735
+ 'noExport',
736
+ );
718
737
  }
719
738
 
720
739
  code += indent(state.tabSize);
@@ -31,6 +31,7 @@ export class BindStyle extends BaseNode {
31
31
  /**
32
32
  * 产品概念
33
33
  */
34
+ @property('concept')
34
35
  // @ts-ignore
35
36
  readonly concept!: 'BindStyle';
36
37
 
@@ -271,11 +272,15 @@ export class BindStyle extends BaseNode {
271
272
  };
272
273
  if (parentKey) {
273
274
  params.parentKey = parentKey;
274
- if (Array.isArray((this as any)[parentKey])) {
275
- const index = (this as any)[parentKey].indexOf(logicItem);
275
+ // @ts-ignore
276
+ const t = this.__v_raw || this;
277
+ // @ts-ignore
278
+ const n = logicItem.__v_raw || logicItem;
279
+ if (Array.isArray((t as any)[parentKey])) {
280
+ const index = (t as any)[parentKey].indexOf(n);
276
281
  ~index && (this as any)[parentKey].splice(index, 1);
277
282
  params.index = index;
278
- } else if ((this as any)[parentKey] === logicItem) {
283
+ } else if ((t as any)[parentKey] === n) {
279
284
  params.index = 0;
280
285
  (this as any)[parentKey] = undefined;
281
286
  }
@@ -25,6 +25,7 @@ export class BooleanLiteral extends LogicItem {
25
25
  /**
26
26
  * 产品概念
27
27
  */
28
+ @property('concept')
28
29
  // @ts-ignore
29
30
  readonly concept!: 'BooleanLiteral';
30
31
 
@@ -30,6 +30,7 @@ export class CallAuthInterface extends CallInterface {
30
30
  /**
31
31
  * 产品概念
32
32
  */
33
+ @property('concept')
33
34
  // @ts-ignore
34
35
  readonly concept!: 'CallAuthInterface';
35
36
 
@@ -241,11 +242,15 @@ export class CallAuthInterface extends CallInterface {
241
242
  };
242
243
  if (parentKey) {
243
244
  params.parentKey = parentKey;
244
- if (Array.isArray((this as any)[parentKey])) {
245
- const index = (this as any)[parentKey].indexOf(logicItem);
245
+ // @ts-ignore
246
+ const t = this.__v_raw || this;
247
+ // @ts-ignore
248
+ const n = logicItem.__v_raw || logicItem;
249
+ if (Array.isArray((t as any)[parentKey])) {
250
+ const index = (t as any)[parentKey].indexOf(n);
246
251
  ~index && (this as any)[parentKey].splice(index, 1);
247
252
  params.index = index;
248
- } else if ((this as any)[parentKey] === logicItem) {
253
+ } else if ((t as any)[parentKey] === n) {
249
254
  params.index = 0;
250
255
  (this as any)[parentKey] = undefined;
251
256
  }
@@ -33,6 +33,7 @@ export class CallConnector extends CallLogic {
33
33
  /**
34
34
  * 产品概念
35
35
  */
36
+ @property('concept')
36
37
  // @ts-ignore
37
38
  readonly concept!: 'CallConnector';
38
39
 
@@ -1,4 +1,4 @@
1
- import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
1
+ import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState, transfromMetadataType } from '../translator';
2
2
  import Function from './Function__';
3
3
  import { ElementToVueOptions } from './ViewElement__';
4
4
  import Identifier from './Identifier__';
@@ -20,7 +20,6 @@ import BaseNode from '../common/BaseNode';
20
20
  import TypeAnnotation from './TypeAnnotation__';
21
21
  import Argument from './Argument__';
22
22
  import LogicItem from './LogicItem__';
23
- import StringLiteral from './StringLiteral__';
24
23
 
25
24
  /**
26
25
  * 调用函数
@@ -35,6 +34,7 @@ export class CallFunction extends LogicItem {
35
34
  /**
36
35
  * 产品概念
37
36
  */
37
+ @property('concept')
38
38
  // @ts-ignore
39
39
  readonly concept!: 'CallFunction';
40
40
 
@@ -312,11 +312,15 @@ export class CallFunction extends LogicItem {
312
312
  };
313
313
  if (parentKey) {
314
314
  params.parentKey = parentKey;
315
- if (Array.isArray((this as any)[parentKey])) {
316
- const index = (this as any)[parentKey].indexOf(typeAnnotation);
315
+ // @ts-ignore
316
+ const t = this.__v_raw || this;
317
+ // @ts-ignore
318
+ const n = typeAnnotation.__v_raw || typeAnnotation;
319
+ if (Array.isArray((t as any)[parentKey])) {
320
+ const index = (t as any)[parentKey].indexOf(n);
317
321
  ~index && (this as any)[parentKey].splice(index, 1);
318
322
  params.index = index;
319
- } else if ((this as any)[parentKey] === typeAnnotation) {
323
+ } else if ((t as any)[parentKey] === n) {
320
324
  params.index = 0;
321
325
  (this as any)[parentKey] = undefined;
322
326
  }
@@ -346,11 +350,15 @@ export class CallFunction extends LogicItem {
346
350
  };
347
351
  if (parentKey) {
348
352
  params.parentKey = parentKey;
349
- if (Array.isArray((this as any)[parentKey])) {
350
- const index = (this as any)[parentKey].indexOf(logicItem);
353
+ // @ts-ignore
354
+ const t = this.__v_raw || this;
355
+ // @ts-ignore
356
+ const n = logicItem.__v_raw || logicItem;
357
+ if (Array.isArray((t as any)[parentKey])) {
358
+ const index = (t as any)[parentKey].indexOf(n);
351
359
  ~index && (this as any)[parentKey].splice(index, 1);
352
360
  params.index = index;
353
- } else if ((this as any)[parentKey] === logicItem) {
361
+ } else if ((t as any)[parentKey] === n) {
354
362
  params.index = 0;
355
363
  (this as any)[parentKey] = undefined;
356
364
  }
@@ -368,22 +376,41 @@ export class CallFunction extends LogicItem {
368
376
  }
369
377
  let code = `$utils['${this.calleeName}']`;
370
378
  code += '(';
379
+ let argTyAnno;
380
+ if (this.calleeName === 'ToString') {
381
+ const arg0 = this.arguments[0];
382
+ argTyAnno = (arg0 as any).typeAnnotation || arg0.__TypeAnnotation;
383
+ } else if (this.calleeName === 'FromString') {
384
+ argTyAnno = this.typeArguments?.[0];
385
+ }
386
+
387
+ // 调整 ToString 的 typeKey 到第一个参数,剩下的以后重构。
388
+ // 事实上,大部分编译器都会选择把 type tag 放到前端来做运行时匹配,而非末位。
389
+ if (this.calleeName === 'ToString' && argTyAnno) {
390
+ code += `'${argTyAnno?.sortedTypeKey}', `;
391
+ }
392
+
371
393
  if (Array.isArray(this.arguments) && this.arguments.length) {
372
394
  const needToString = ['Concat'].includes(this.calleeName);
373
395
  this.arguments?.forEach((arg: any, index) => {
374
396
  let argStr = arg?.toVue(options);
375
397
  const argTypeAnnotation = arg.typeAnnotation || arg.__TypeAnnotation;
376
-
398
+ const { sortedTypeKey } = transfromMetadataType(argTypeAnnotation, this.app)
377
399
  if (needToString) {
378
- argStr = `$utils['ToString'](${argStr}, '${argTypeAnnotation?.sortedTypeKey}')`;
400
+ argStr = `$utils['ToString']('${sortedTypeKey}', ${argStr})`;
379
401
  } else if (['HasValue'].includes(this.calleeName)) {
380
- argStr = `{ type: '${argTypeAnnotation?.sortedTypeKey}', value: ${argStr} }`;
402
+ argStr = `{ type: '${sortedTypeKey}', value: ${argStr} }`;
381
403
  }
382
404
  code += argStr;
383
405
  if (index !== this.arguments?.length - 1) code += ', ';
384
406
  });
385
407
  }
386
- if (this.typeArguments && this.typeArguments.length) {
408
+ if (this.calleeName === 'FromString' && argTyAnno) {
409
+ code += `, '${argTyAnno?.sortedTypeKey}'`;
410
+ }
411
+ // 用作做语义控制。后面这段代码没完全理解,需要保持进入条件不变。
412
+ const flagControl = ['ToString', 'FromString'].includes(this.calleeName) && argTyAnno;
413
+ if (!flagControl && Array.isArray(this.typeArguments) && this.typeArguments.length) {
387
414
  if (this.arguments?.length) code += ', ';
388
415
  this.typeArguments?.forEach((arg, index) => {
389
416
  code += arg?.toJS().replace(/"/g, "'");
@@ -426,7 +453,6 @@ export class CallFunction extends LogicItem {
426
453
  code += `this.$utils['${calleeName}']`;
427
454
  code += '(';
428
455
 
429
-
430
456
  let argTyAnno;
431
457
  if (this.calleeName === 'ToString') {
432
458
  const arg0 = this.arguments[0];
@@ -435,11 +461,10 @@ export class CallFunction extends LogicItem {
435
461
  argTyAnno = this.typeArguments?.[0];
436
462
  }
437
463
 
438
-
439
464
  // 调整 ToString 的 typeKey 到第一个参数,剩下的以后重构。
440
465
  // 事实上,大部分编译器都会选择把 type tag 放到前端来做运行时匹配,而非末位。
441
466
  if (this.calleeName === 'ToString' && argTyAnno) {
442
- code += `'${argTyAnno?.sortedTypeKey}', `
467
+ code += `'${argTyAnno?.sortedTypeKey}', `;
443
468
  }
444
469
 
445
470
  if (Array.isArray(this.arguments) && this.arguments.length) {
@@ -448,22 +473,22 @@ export class CallFunction extends LogicItem {
448
473
  this.arguments.forEach((arg: any, index) => {
449
474
  let argStr = arg?.toJS(shiftState(state, code));
450
475
  const argTypeAnnotation = arg.typeAnnotation || arg.__TypeAnnotation;
451
-
476
+ const { sortedTypeKey } = transfromMetadataType(argTypeAnnotation, this.app)
452
477
  if (needToString) {
453
- argStr = `this.$utils['ToString']('${argTypeAnnotation?.sortedTypeKey}', ${argStr})`;
478
+ argStr = `this.$utils['ToString']('${sortedTypeKey}', ${argStr})`;
454
479
  } else if (['HasValue'].includes(this.calleeName)) {
455
- argStr = `{ type: '${argTypeAnnotation?.sortedTypeKey}', value: ${argStr} }`;
480
+ argStr = `{ type: '${sortedTypeKey}', value: ${argStr} }`;
456
481
  }
457
482
  code += argStr;
458
483
  if (index !== this.arguments?.length - 1) code += ', ';
459
484
  });
460
485
  }
461
486
 
462
- if (this.calleeName === 'fromString' && argTyAnno) {
463
- code += `, '${argTyAnno?.sortedTypeKey}'`
487
+ if (this.calleeName === 'FromString' && argTyAnno) {
488
+ code += `, '${argTyAnno?.sortedTypeKey}'`;
464
489
  }
465
490
  // 用作做语义控制。后面这段代码没完全理解,需要保持进入条件不变。
466
- const flagControl = ['ToString', 'fromString'].includes(this.calleeName) && argTyAnno;
491
+ const flagControl = ['ToString', 'FromString'].includes(this.calleeName) && argTyAnno;
467
492
  if (!flagControl && Array.isArray(this.typeArguments) && this.typeArguments.length) {
468
493
  if (this.arguments?.length) code += ', ';
469
494
 
@@ -476,8 +501,7 @@ export class CallFunction extends LogicItem {
476
501
  code += ')';
477
502
  const tyAnno = (this as any).typeAnnotation || this.__TypeAnnotation;
478
503
  const needGenInitFromSchema =
479
- tyAnno &&
480
- (!['primitive', 'union'].includes(tyAnno.typeKind) || tyAnno.typeName === 'DateTime');
504
+ tyAnno && (!['primitive', 'union'].includes(tyAnno.typeKind) || tyAnno.typeName === 'DateTime');
481
505
  if (needGenInitFromSchema) {
482
506
  code = `this.$genInitFromSchema('${tyAnno?.sortedTypeKey}', ${code})`;
483
507
  }
@@ -634,12 +658,10 @@ export class CallFunction extends LogicItem {
634
658
  code += '(';
635
659
  this.arguments.forEach((arg, index) => {
636
660
  code += arg.toNaturalTS(shiftState(state, code, { tabSize: 0 }));
637
- if (index !== this.arguments.length - 1)
638
- code += ', ';
661
+ if (index !== this.arguments.length - 1) code += ', ';
639
662
  });
640
663
  if (this?.typeArguments?.[0]?.typeKind === 'reference') {
641
- if (this.arguments?.length > 0)
642
- code += ', ';
664
+ if (this.arguments?.length > 0) code += ', ';
643
665
  code += `{ typeNamespace: '${this.typeArguments[0].typeNamespace}' }`;
644
666
  }
645
667
  code += `)`;
@@ -1,4 +1,4 @@
1
- import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
1
+ import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
2
2
  import Interface from './Interface__';
3
3
  import { ElementToVueOptions } from './ViewElement__';
4
4
  import { getNodeByNodeCallee } from '../automate/engine/utils';
@@ -35,6 +35,7 @@ export class CallInterface extends LogicItem {
35
35
  /**
36
36
  * 产品概念
37
37
  */
38
+ @property('concept')
38
39
  // @ts-ignore
39
40
  readonly concept!: 'CallInterface' | 'CallAuthInterface';
40
41
 
@@ -206,11 +207,15 @@ export class CallInterface extends LogicItem {
206
207
  };
207
208
  if (parentKey) {
208
209
  params.parentKey = parentKey;
209
- if (Array.isArray((this as any)[parentKey])) {
210
- const index = (this as any)[parentKey].indexOf(logicItem);
210
+ // @ts-ignore
211
+ const t = this.__v_raw || this;
212
+ // @ts-ignore
213
+ const n = logicItem.__v_raw || logicItem;
214
+ if (Array.isArray((t as any)[parentKey])) {
215
+ const index = (t as any)[parentKey].indexOf(n);
211
216
  ~index && (this as any)[parentKey].splice(index, 1);
212
217
  params.index = index;
213
- } else if ((this as any)[parentKey] === logicItem) {
218
+ } else if ((t as any)[parentKey] === n) {
214
219
  params.index = 0;
215
220
  (this as any)[parentKey] = undefined;
216
221
  }
@@ -264,12 +269,12 @@ export class CallInterface extends LogicItem {
264
269
  this.app.emit('collect:start', { actionMsg: '删除接口' });
265
270
  const parentModule = oldItf.module || oldItf.connector;
266
271
  if (oldItf.module) {
267
- const shouldDeleteStructures: Structure[] = []
272
+ const shouldDeleteStructures: Structure[] = [];
268
273
  oldItf.module.getInterfaceStructureMap().forEach((itfs, stru) => {
269
274
  if (itfs.size === 1 && itfs.has(oldItf)) {
270
- shouldDeleteStructures.push(stru)
275
+ shouldDeleteStructures.push(stru);
271
276
  }
272
- })
277
+ });
273
278
  shouldDeleteStructures.forEach((s: Structure) => s.delete());
274
279
  } else {
275
280
  const shouldDeleteStructures = oldItf.getRefStructures(parentModule.structures);
@@ -618,23 +623,33 @@ export class CallInterface extends LogicItem {
618
623
  const calleeNamespace = _interface.getNamespace();
619
624
  const calleeName = _interface.name;
620
625
  const params = _interface.params.map((param) => {
621
- const oldArgument = this.arguments.find((node) => node.keyword === param.name)
622
- return Argument.from({
623
- keyword: param.name,
624
- expression: oldArgument ? oldArgument.expression : undefined
625
- }, this, 'arguments');
626
+ const oldArgument = this.arguments.find((node) => node.keyword === param.name);
627
+ return Argument.from(
628
+ {
629
+ keyword: param.name,
630
+ expression: oldArgument ? oldArgument.expression : undefined,
631
+ },
632
+ this,
633
+ 'arguments',
634
+ );
626
635
  });
627
636
  const oldArguments = this.arguments.reduce((res, argumentNode) => {
628
- const targetParam = _interface.params.find((item) => item.name === argumentNode.keyword)
637
+ const targetParam = _interface.params.find((item) => item.name === argumentNode.keyword);
629
638
  if (!targetParam) {
630
- res.push(Argument.from({
631
- keyword: argumentNode.keyword,
632
- expression: argumentNode ? argumentNode.expression : undefined
633
- }, this, 'arguments'))
639
+ res.push(
640
+ Argument.from(
641
+ {
642
+ keyword: argumentNode.keyword,
643
+ expression: argumentNode ? argumentNode.expression : undefined,
644
+ },
645
+ this,
646
+ 'arguments',
647
+ ),
648
+ );
634
649
  }
635
- return res
636
- }, [])
637
- params.push(...oldArguments)
650
+ return res;
651
+ }, []);
652
+ params.push(...oldArguments);
638
653
 
639
654
  if (this.app) {
640
655
  this.app.emit('collect:start', {
@@ -833,13 +848,13 @@ export class CallInterface extends LogicItem {
833
848
  // 仅被自己引用则删除
834
849
  if (!isSameItf && isSelfRef && refCount === 1) {
835
850
  // 删除旧的数据结构
836
- const shouldDeleteStructures: Structure[] = []
837
- const structureMap = oldItf.module.getInterfaceStructureMap()
851
+ const shouldDeleteStructures: Structure[] = [];
852
+ const structureMap = oldItf.module.getInterfaceStructureMap();
838
853
  structureMap.forEach((itfs, stru) => {
839
854
  if (itfs.size === 1 && itfs.has(oldItf)) {
840
- shouldDeleteStructures.push(stru)
855
+ shouldDeleteStructures.push(stru);
841
856
  }
842
- })
857
+ });
843
858
  shouldDeleteStructures.forEach((s: Structure) => s.delete());
844
859
  oldItf.delete();
845
860
  oldItf.afterDelete();
@@ -854,12 +869,12 @@ export class CallInterface extends LogicItem {
854
869
  // 递归找出 response/request 的 Body/Returns 引用的数据结构
855
870
  const newStructuresSet = targetItf.getRefStructures(moduleData.structures);
856
871
  // 新导入的数据结构在系统中已存在时 提前进行删除
857
- newStructuresSet.forEach(stru => {
858
- const target = targetItf.module.structures.find(node => node.name === stru.name)
872
+ newStructuresSet.forEach((stru) => {
873
+ const target = targetItf.module.structures.find((node) => node.name === stru.name);
859
874
  if (target) {
860
- oldStructuresSet.add(target)
875
+ oldStructuresSet.add(target);
861
876
  }
862
- })
877
+ });
863
878
  // 删除旧的数据结构
864
879
  oldStructuresSet.forEach((s) => s.delete());
865
880
  newStructuresSet.forEach((s) => module.addStructure(Structure.from(s)));