@lcap/nasl 3.8.3-beta.1 → 3.8.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 (812) hide show
  1. package/.nyc_output/943352aa-23df-44e0-863b-3dcd3e8bf57a.json +1 -0
  2. package/.nyc_output/processinfo/943352aa-23df-44e0-863b-3dcd3e8bf57a.json +1 -0
  3. package/.nyc_output/processinfo/index.json +1 -1
  4. package/coverage/cobertura-coverage.xml +66121 -10220
  5. package/coverage/index.html +50 -395
  6. package/coverage/src/automate/engine/index.html +19 -19
  7. package/coverage/src/automate/engine/utils.js.html +101 -101
  8. package/coverage/src/bak/index.html +19 -19
  9. package/coverage/src/bak/translator.js.html +96 -141
  10. package/coverage/src/breakpoint/generator/AfterStartNode.ts.html +13 -13
  11. package/coverage/src/breakpoint/generator/BeforeEndNode.ts.html +13 -13
  12. package/coverage/src/breakpoint/generator/BreakpointNode.ts.html +29 -29
  13. package/coverage/src/breakpoint/generator/CallbackNode.ts.html +10 -10
  14. package/coverage/src/breakpoint/generator/index.html +47 -47
  15. package/coverage/src/breakpoint/generator/index.ts.html +20 -20
  16. package/coverage/src/breakpoint/index.html +7 -7
  17. package/coverage/src/breakpoint/index.ts.html +6 -6
  18. package/coverage/src/breakpoint/shared/constants.ts.html +7 -7
  19. package/coverage/src/breakpoint/shared/index.html +45 -45
  20. package/coverage/src/breakpoint/shared/index.ts.html +5 -5
  21. package/coverage/src/breakpoint/shared/operations.ts.html +15 -15
  22. package/coverage/src/breakpoint/shared/socket.ts.html +85 -85
  23. package/coverage/src/breakpoint/shared/utils.ts.html +49 -49
  24. package/coverage/src/breakpoint/store/core.ts.html +100 -100
  25. package/coverage/src/breakpoint/store/dock.ts.html +46 -46
  26. package/coverage/src/breakpoint/store/index.html +33 -33
  27. package/coverage/src/breakpoint/store/index.ts.html +7 -7
  28. package/coverage/src/common/BaseNode.ts.html +350 -1187
  29. package/coverage/src/common/Command.ts.html +20 -20
  30. package/coverage/src/common/EventEmitter.ts.html +31 -49
  31. package/coverage/src/common/Messager.ts.html +28 -28
  32. package/coverage/src/common/asyncFuncMap.ts.html +7 -7
  33. package/coverage/src/common/index.html +55 -70
  34. package/coverage/src/common/index.ts.html +8 -11
  35. package/coverage/src/concepts/Abort__.ts.html +20 -56
  36. package/coverage/src/concepts/Anchor__.ts.html +51 -117
  37. package/coverage/src/concepts/AnonymousFunction__.ts.html +232 -343
  38. package/coverage/src/concepts/App__.ts.html +1283 -2681
  39. package/coverage/src/concepts/Argument__.ts.html +135 -135
  40. package/coverage/src/concepts/Assignee__.ts.html +91 -250
  41. package/coverage/src/concepts/AssignmentLine__.ts.html +28 -88
  42. package/coverage/src/concepts/Assignment__.ts.html +110 -206
  43. package/coverage/src/concepts/Attribute__.ts.html +50 -239
  44. package/coverage/src/concepts/AuthInterface__.ts.html +32 -26
  45. package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +188 -203
  46. package/coverage/src/concepts/AuthLogic__.ts.html +28 -43
  47. package/coverage/src/concepts/BackendVariable__.ts.html +132 -438
  48. package/coverage/src/concepts/Backend__.ts.html +57 -156
  49. package/coverage/src/concepts/BatchAssignment__.ts.html +270 -420
  50. package/coverage/src/concepts/BinaryExpression__.ts.html +158 -266
  51. package/coverage/src/concepts/BindAttribute__.ts.html +204 -399
  52. package/coverage/src/concepts/BindDirective__.ts.html +73 -217
  53. package/coverage/src/concepts/BindEvent__.ts.html +161 -293
  54. package/coverage/src/concepts/BindStyle__.ts.html +58 -139
  55. package/coverage/src/concepts/BooleanLiteral__.ts.html +33 -63
  56. package/coverage/src/concepts/CallAuthInterface__.ts.html +95 -236
  57. package/coverage/src/concepts/CallConnector__.ts.html +69 -108
  58. package/coverage/src/concepts/CallFunction__.ts.html +234 -399
  59. package/coverage/src/concepts/CallInterface__.ts.html +145 -241
  60. package/coverage/src/concepts/CallLogic__.ts.html +525 -633
  61. package/coverage/src/concepts/CallQueryComponent__.ts.html +232 -385
  62. package/coverage/src/concepts/Comment__.ts.html +27 -63
  63. package/coverage/src/concepts/CompletionProperty__.ts.html +51 -72
  64. package/coverage/src/concepts/ConfigGroup__.ts.html +51 -99
  65. package/coverage/src/concepts/ConfigPropertyValue__.ts.html +34 -40
  66. package/coverage/src/concepts/ConfigProperty__.ts.html +78 -150
  67. package/coverage/src/concepts/Configuration__.ts.html +48 -99
  68. package/coverage/src/concepts/Connection__.ts.html +64 -154
  69. package/coverage/src/concepts/ConnectorTrigger__.ts.html +32 -35
  70. package/coverage/src/concepts/Connector__.ts.html +228 -3117
  71. package/coverage/src/concepts/Constant__.ts.html +74 -374
  72. package/coverage/src/concepts/DataSource__.ts.html +104 -173
  73. package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +21 -27
  74. package/coverage/src/concepts/Destination__.ts.html +121 -190
  75. package/coverage/src/concepts/End__.ts.html +40 -76
  76. package/coverage/src/concepts/EntityIndex__.ts.html +44 -80
  77. package/coverage/src/concepts/EntityProperty__.ts.html +158 -440
  78. package/coverage/src/concepts/Entity__.ts.html +161 -326
  79. package/coverage/src/concepts/EnumItem__.ts.html +33 -66
  80. package/coverage/src/concepts/Enum__.ts.html +64 -139
  81. package/coverage/src/concepts/Event__.ts.html +51 -87
  82. package/coverage/src/concepts/ExternalDestination__.ts.html +60 -126
  83. package/coverage/src/concepts/ForEachStatement__.ts.html +152 -239
  84. package/coverage/src/concepts/FrontendLibrary__.ts.html +69 -153
  85. package/coverage/src/concepts/FrontendVariable__.ts.html +19 -76
  86. package/coverage/src/concepts/Frontend__.ts.html +161 -884
  87. package/coverage/src/concepts/Function__.ts.html +171 -396
  88. package/coverage/src/concepts/Identifier__.ts.html +100 -130
  89. package/coverage/src/concepts/IfStatement__.ts.html +110 -209
  90. package/coverage/src/concepts/Integration__.ts.html +57 -132
  91. package/coverage/src/concepts/InterfaceParam__.ts.html +76 -310
  92. package/coverage/src/concepts/Interface__.ts.html +183 -324
  93. package/coverage/src/concepts/JSBlock__.ts.html +26 -59
  94. package/coverage/src/concepts/JavaLogic__.ts.html +28 -58
  95. package/coverage/src/concepts/LogicItem__.ts.html +73 -151
  96. package/coverage/src/concepts/Logic__.ts.html +509 -965
  97. package/coverage/src/concepts/MatchCase__.ts.html +158 -281
  98. package/coverage/src/concepts/Match__.ts.html +121 -280
  99. package/coverage/src/concepts/MemberExpression__.ts.html +172 -256
  100. package/coverage/src/concepts/MicroApp__.ts.html +34 -25
  101. package/coverage/src/concepts/Module__.ts.html +1270 -1375
  102. package/coverage/src/concepts/MsgTriggerEvent__.ts.html +46 -94
  103. package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +48 -93
  104. package/coverage/src/concepts/Namespace__.ts.html +630 -1251
  105. package/coverage/src/concepts/NewComposite__.ts.html +341 -557
  106. package/coverage/src/concepts/NewList__.ts.html +111 -291
  107. package/coverage/src/concepts/NewMap__.ts.html +128 -332
  108. package/coverage/src/concepts/New__.ts.html +21 -57
  109. package/coverage/src/concepts/NullLiteral__.ts.html +23 -56
  110. package/coverage/src/concepts/NumericLiteral__.ts.html +51 -114
  111. package/coverage/src/concepts/OqlQueryComponent__.ts.html +76 -211
  112. package/coverage/src/concepts/OverriddenLogic__.ts.html +394 -643
  113. package/coverage/src/concepts/Param__.ts.html +174 -315
  114. package/coverage/src/concepts/Point__.ts.html +21 -27
  115. package/coverage/src/concepts/ProcessComponent__.ts.html +67 -145
  116. package/coverage/src/concepts/ProcessElement__.ts.html +281 -854
  117. package/coverage/src/concepts/ProcessOutcome__.ts.html +25 -100
  118. package/coverage/src/concepts/ProcessOutcomes__.ts.html +26 -113
  119. package/coverage/src/concepts/Process__.ts.html +201 -552
  120. package/coverage/src/concepts/QueryAggregateExpression__.ts.html +35 -89
  121. package/coverage/src/concepts/QueryFieldExpression__.ts.html +35 -62
  122. package/coverage/src/concepts/QueryFromExpression__.ts.html +47 -119
  123. package/coverage/src/concepts/QueryGroupByExpression__.ts.html +37 -97
  124. package/coverage/src/concepts/QueryJoinExpression__.ts.html +69 -153
  125. package/coverage/src/concepts/QueryLimitExpression__.ts.html +36 -105
  126. package/coverage/src/concepts/QueryOrderByExpression__.ts.html +36 -108
  127. package/coverage/src/concepts/QuerySelectExpression__.ts.html +50 -101
  128. package/coverage/src/concepts/Rect__.ts.html +25 -25
  129. package/coverage/src/concepts/Return__.ts.html +131 -368
  130. package/coverage/src/concepts/Role__.ts.html +37 -67
  131. package/coverage/src/concepts/SelectMembers__.ts.html +57 -141
  132. package/coverage/src/concepts/Slot__.ts.html +40 -64
  133. package/coverage/src/concepts/SqlQueryComponent__.ts.html +62 -122
  134. package/coverage/src/concepts/Start__.ts.html +25 -58
  135. package/coverage/src/concepts/StringInterpolation__.ts.html +77 -185
  136. package/coverage/src/concepts/StringLiteral__.ts.html +47 -158
  137. package/coverage/src/concepts/StructureProperty__.ts.html +78 -306
  138. package/coverage/src/concepts/Structure__.ts.html +90 -285
  139. package/coverage/src/concepts/SwitchCase__.ts.html +66 -141
  140. package/coverage/src/concepts/SwitchStatement__.ts.html +58 -136
  141. package/coverage/src/concepts/Theme__.ts.html +24 -36
  142. package/coverage/src/concepts/Transactional__.ts.html +33 -36
  143. package/coverage/src/concepts/TriggerEvent__.ts.html +480 -63
  144. package/coverage/src/concepts/TriggerLauncher__.ts.html +43 -73
  145. package/coverage/src/concepts/TypeAnnotation__.ts.html +231 -564
  146. package/coverage/src/concepts/TypeParam__.ts.html +23 -59
  147. package/coverage/src/concepts/UnaryExpression__.ts.html +47 -131
  148. package/coverage/src/concepts/Unparsed__.ts.html +29 -59
  149. package/coverage/src/concepts/UseComponent__.ts.html +21 -27
  150. package/coverage/src/concepts/ValidationRule__.ts.html +96 -234
  151. package/coverage/src/concepts/Variable__.ts.html +132 -456
  152. package/coverage/src/concepts/ViewBlock__.ts.html +23 -26
  153. package/coverage/src/concepts/ViewComponent__.ts.html +157 -394
  154. package/coverage/src/concepts/ViewElement__.ts.html +514 -910
  155. package/coverage/src/concepts/View__.ts.html +425 -1271
  156. package/coverage/src/concepts/WhileStatement__.ts.html +79 -175
  157. package/coverage/src/concepts/basics/stdlib/index.html +85 -85
  158. package/coverage/src/concepts/basics/stdlib/index.ts.html +29 -167
  159. package/coverage/src/concepts/basics/stdlib/nasl.auth.ts.html +152 -206
  160. package/coverage/src/concepts/basics/stdlib/nasl.browser.ts.html +139 -172
  161. package/coverage/src/concepts/basics/stdlib/nasl.collection.ts.html +47 -92
  162. package/coverage/src/concepts/basics/stdlib/nasl.configuration.ts.html +31 -130
  163. package/coverage/src/concepts/basics/stdlib/nasl.core.ts.html +43 -61
  164. package/coverage/src/concepts/basics/stdlib/nasl.event.ts.html +23 -53
  165. package/coverage/src/concepts/basics/stdlib/nasl.http.ts.html +167 -203
  166. package/coverage/src/concepts/basics/stdlib/nasl.interface.ts.html +45 -78
  167. package/coverage/src/concepts/basics/stdlib/nasl.io.ts.html +51 -81
  168. package/coverage/src/concepts/basics/stdlib/nasl.logging.ts.html +66 -69
  169. package/coverage/src/concepts/basics/stdlib/nasl.process.ts.html +606 -654
  170. package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +993 -1050
  171. package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +2131 -2236
  172. package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +563 -596
  173. package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +40 -28
  174. package/coverage/src/concepts/basics/stdlib/timeZone.ts.html +9 -9
  175. package/coverage/src/concepts/basics/types/coreTypeList.ts.html +7 -7
  176. package/coverage/src/concepts/basics/types/index.html +16 -16
  177. package/coverage/src/concepts/basics/types/index.ts.html +18 -18
  178. package/coverage/src/concepts/index.html +1215 -1365
  179. package/coverage/src/concepts/index.ts.html +7 -31
  180. package/coverage/src/concepts/index__.ts.html +8 -38
  181. package/coverage/src/config.ts.html +20 -2
  182. package/coverage/src/decorators/index.html +32 -32
  183. package/coverage/src/decorators/index.ts.html +93 -108
  184. package/coverage/src/decorators/promise.ts.html +26 -26
  185. package/coverage/src/eventBus.ts.html +7 -7
  186. package/coverage/src/generator/compileComponent.ts.html +10 -10
  187. package/coverage/src/generator/genBundleFiles.ts.html +45 -273
  188. package/coverage/src/generator/genHash.ts.html +8 -8
  189. package/coverage/src/generator/genMetaData.ts.html +49 -280
  190. package/coverage/src/generator/genReleaseBody.ts.html +98 -113
  191. package/coverage/src/generator/icestark.ts.html +8 -14
  192. package/coverage/src/generator/index.html +87 -87
  193. package/coverage/src/generator/index.ts.html +6 -6
  194. package/coverage/src/generator/microApp.ts.html +10 -10
  195. package/coverage/src/generator/permission.ts.html +80 -152
  196. package/coverage/src/generator/qiankun.ts.html +7 -13
  197. package/coverage/src/generator/styleReplacer.ts.html +17 -17
  198. package/coverage/src/index.html +10 -40
  199. package/coverage/src/index.ts.html +12 -15
  200. package/coverage/src/manager/diagnostic.ts.html +31 -28
  201. package/coverage/src/manager/index.html +27 -27
  202. package/coverage/src/manager/stepRecorder.ts.html +17 -17
  203. package/coverage/src/natural/genNaturalTS.ts.html +30 -30
  204. package/coverage/src/natural/index.html +41 -41
  205. package/coverage/src/natural/index.ts.html +6 -6
  206. package/coverage/src/natural/naslStdlibMap.ts.html +10 -10
  207. package/coverage/src/natural/transformTSCode.ts.html +137 -197
  208. package/coverage/src/sentry/index.html +19 -19
  209. package/coverage/src/sentry/index.ts.html +43 -49
  210. package/coverage/src/server/createUiTs.ts.html +37 -46
  211. package/coverage/src/server/entity2LogicNamespace.ts.html +21 -21
  212. package/coverage/src/server/event.js.html +7 -7
  213. package/coverage/src/server/extendBaseNode.ts.html +90 -132
  214. package/coverage/src/server/formatTsUtils.ts.html +105 -108
  215. package/coverage/src/server/getConnector.ts.html +24 -96
  216. package/coverage/src/server/getExtensionModules.ts.html +14 -14
  217. package/coverage/src/server/getFunctions.ts.html +15 -15
  218. package/coverage/src/server/getInterfaces.ts.html +18 -18
  219. package/coverage/src/server/getLogging.ts.html +11 -11
  220. package/coverage/src/server/getLogics.ts.html +74 -122
  221. package/coverage/src/server/getMemberIdentifier.ts.html +163 -358
  222. package/coverage/src/server/getProcessComponents.ts.html +13 -13
  223. package/coverage/src/server/getProcesses.ts.html +86 -236
  224. package/coverage/src/server/getValidates.ts.html +14 -17
  225. package/coverage/src/server/index.html +181 -181
  226. package/coverage/src/server/index.ts.html +8 -11
  227. package/coverage/src/server/naslServer.ts.html +1270 -1933
  228. package/coverage/src/server/naslStdlibMap.ts.html +10 -10
  229. package/coverage/src/server/process2LogicNamespace.ts.html +20 -20
  230. package/coverage/src/server/translator.ts.html +89 -134
  231. package/coverage/src/service/creator/add.configs.js.html +17 -35
  232. package/coverage/src/service/creator/errHandles.js.html +45 -36
  233. package/coverage/src/service/creator/index.html +35 -35
  234. package/coverage/src/service/creator/index.js.html +14 -14
  235. package/coverage/src/service/datasource/api.js.html +7 -7
  236. package/coverage/src/service/datasource/index.html +12 -12
  237. package/coverage/src/service/datasource/index.js.html +5 -5
  238. package/coverage/src/service/logic/api.js.html +7 -7
  239. package/coverage/src/service/logic/index.html +12 -12
  240. package/coverage/src/service/logic/index.js.html +5 -5
  241. package/coverage/src/service/storage/api.js.html +7 -7
  242. package/coverage/src/service/storage/index.html +56 -56
  243. package/coverage/src/service/storage/index.ts.html +5 -5
  244. package/coverage/src/service/storage/init.ts.html +624 -1758
  245. package/coverage/src/service/storage/jsoner.ts.html +23 -86
  246. package/coverage/src/service/storage/map.ts.html +21 -21
  247. package/coverage/src/service/storage/service.ts.html +14 -14
  248. package/coverage/src/service/storage/storagePoint.ts.html +9 -9
  249. package/coverage/src/templator/genCallComponentLogic.ts.html +12 -12
  250. package/coverage/src/templator/genCreateBlock.ts.html +94 -154
  251. package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +90 -90
  252. package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +150 -132
  253. package/coverage/src/templator/genEditTableBlock.ts.html +41 -104
  254. package/coverage/src/templator/genEnumSelectBlock.ts.html +12 -93
  255. package/coverage/src/templator/genGetBlock.ts.html +18 -18
  256. package/coverage/src/templator/genGridViewBlock.ts.html +35 -35
  257. package/coverage/src/templator/genListViewBlock.ts.html +15 -15
  258. package/coverage/src/templator/genQueryComponent.ts.html +35 -35
  259. package/coverage/src/templator/genSelectBlock.ts.html +20 -101
  260. package/coverage/src/templator/genTableBlock.ts.html +33 -96
  261. package/coverage/src/templator/genUpdateBlock.ts.html +78 -162
  262. package/coverage/src/templator/index.html +147 -147
  263. package/coverage/src/templator/index.ts.html +12 -12
  264. package/coverage/src/templator/utils.ts.html +32 -95
  265. package/coverage/src/translator/constant.ts.html +7 -7
  266. package/coverage/src/translator/index.html +28 -43
  267. package/coverage/src/translator/index.ts.html +6 -6
  268. package/coverage/src/translator/utils.ts.html +71 -452
  269. package/coverage/src/utils/cookie.ts.html +19 -19
  270. package/coverage/src/utils/env.ts.html +2 -2
  271. package/coverage/src/utils/index.html +37 -82
  272. package/coverage/src/utils/index.ts.html +798 -66
  273. package/coverage/src/utils/logger.ts.html +1 -1
  274. package/coverage/src/utils/sortTsString.ts.html +18 -33
  275. package/coverage/src/utils/string.ts.html +50 -8
  276. package/coverage/src/utils/time-slicing/controller.ts.html +8 -8
  277. package/coverage/src/utils/time-slicing/index.html +64 -79
  278. package/coverage/src/utils/time-slicing/index.ts.html +8 -8
  279. package/coverage/src/utils/time-slicing/page-state.ts.html +1 -1
  280. package/coverage/src/utils/time-slicing/performance.ts.html +4 -4
  281. package/coverage/src/utils/time-slicing/runner.ts.html +51 -51
  282. package/coverage/src/utils/time-slicing/tool.ts.html +29 -29
  283. package/coverage/src/utils/time-slicing/utils.ts.html +16 -16
  284. package/coverage/src/utils/time-slicing/wrapper.ts.html +50 -50
  285. package/coverage/src/utils/time-slicing.ts.html +1 -1
  286. package/coverage/src/utils/traverse.ts.html +27 -27
  287. package/coverage/src/utils/types.ts.html +1 -1
  288. package/coverage/src/utils/window.ts.html +1 -1
  289. package/out/common/BaseNode.d.ts +9 -4
  290. package/out/common/BaseNode.js +43 -10
  291. package/out/common/BaseNode.js.map +1 -1
  292. package/out/concepts/AuthLogicForCallInterface__.js +2 -50
  293. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  294. package/out/concepts/BusinessComponent__.js +2 -42
  295. package/out/concepts/BusinessComponent__.js.map +1 -1
  296. package/out/concepts/BusinessLogic__.js +2 -50
  297. package/out/concepts/BusinessLogic__.js.map +1 -1
  298. package/out/concepts/CallFunction__.d.ts +1 -1
  299. package/out/concepts/CallFunction__.js +1 -1
  300. package/out/concepts/Identifier__.d.ts +2 -0
  301. package/out/concepts/Identifier__.js +51 -5
  302. package/out/concepts/Identifier__.js.map +1 -1
  303. package/out/concepts/Logic__.js +6 -101
  304. package/out/concepts/Logic__.js.map +1 -1
  305. package/out/concepts/MemberExpression__.d.ts +1 -1
  306. package/out/concepts/MemberExpression__.js +15 -3
  307. package/out/concepts/MemberExpression__.js.map +1 -1
  308. package/out/concepts/OverriddenLogic__.js +2 -50
  309. package/out/concepts/OverriddenLogic__.js.map +1 -1
  310. package/out/concepts/ProcessElementV2__.js +4 -0
  311. package/out/concepts/ProcessElementV2__.js.map +1 -1
  312. package/out/concepts/ProcessElement__.js +4 -0
  313. package/out/concepts/ProcessElement__.js.map +1 -1
  314. package/out/concepts/ProcessV2__.js +4 -0
  315. package/out/concepts/ProcessV2__.js.map +1 -1
  316. package/out/concepts/Process__.js +4 -0
  317. package/out/concepts/Process__.js.map +1 -1
  318. package/out/concepts/SubLogic__.js +5 -50
  319. package/out/concepts/SubLogic__.js.map +1 -1
  320. package/out/concepts/View__.js +10 -49
  321. package/out/concepts/View__.js.map +1 -1
  322. package/out/natural/transformTS2UI.js +3 -3
  323. package/out/natural/transformTS2UI.js.map +1 -1
  324. package/out/natural/transforms/transform2LogicItem.js +3 -3
  325. package/out/natural/transforms/transform2LogicItem.js.map +1 -1
  326. package/out/server/naslServer.js +17 -2
  327. package/out/server/naslServer.js.map +1 -1
  328. package/out/server/semanticData.d.ts +32 -0
  329. package/out/server/semanticData.js +371 -0
  330. package/out/server/semanticData.js.map +1 -0
  331. package/out/templator/block2nasl/viewMergeBlock.js +2 -1
  332. package/out/templator/block2nasl/viewMergeBlock.js.map +1 -1
  333. package/package.json +1 -1
  334. package/src/common/BaseNode.ts +50 -8
  335. package/src/concepts/AuthLogicForCallInterface__.ts +3 -56
  336. package/src/concepts/BusinessComponent__.ts +6 -51
  337. package/src/concepts/BusinessLogic__.ts +4 -56
  338. package/src/concepts/CallFunction__.ts +1 -1
  339. package/src/concepts/Identifier__.ts +57 -6
  340. package/src/concepts/Logic__.ts +9 -111
  341. package/src/concepts/MemberExpression__.ts +21 -7
  342. package/src/concepts/OverriddenLogic__.ts +4 -56
  343. package/src/concepts/ProcessElementV2__.ts +4 -0
  344. package/src/concepts/ProcessElement__.ts +4 -0
  345. package/src/concepts/ProcessV2__.ts +5 -0
  346. package/src/concepts/Process__.ts +4 -0
  347. package/src/concepts/SubLogic__.ts +6 -56
  348. package/src/concepts/View__.ts +14 -54
  349. package/src/natural/transformTS2UI.ts +7 -7
  350. package/src/natural/transforms/transform2LogicItem.ts +3 -3
  351. package/src/server/naslServer.ts +22 -2
  352. package/src/server/semanticData.ts +447 -0
  353. package/src/templator/block2nasl/viewMergeBlock.ts +2 -1
  354. package/src/translator/utils.ts +1 -1
  355. package/test/concepts/logic/__snapshots__/toEmbeddedTS.spec.ts.snap +182 -0
  356. package/test/concepts/logic/constant.ts +5 -0
  357. package/test/concepts/logic/fixtures/variable-host-call-logic-member-expression.json +267 -0
  358. package/test/concepts/logic/fixtures/variable-host-call-logic-nested-member-expression copy.json +457 -0
  359. package/test/concepts/logic/fixtures/variable-host-call-logic-with-handle-error-member-expression.json +267 -0
  360. package/test/concepts/logic/toEmbeddedTS.spec.ts +15 -0
  361. package/.nyc_output/fe4ca6db-1eb6-4898-8aa5-ba8f8d4128f2.json +0 -1
  362. package/.nyc_output/processinfo/fe4ca6db-1eb6-4898-8aa5-ba8f8d4128f2.json +0 -1
  363. package/coverage/src/common/utils.ts.html +0 -136
  364. package/coverage/src/concepts/AbstractInterface__.ts.html +0 -277
  365. package/coverage/src/concepts/Block__.ts.html +0 -907
  366. package/coverage/src/concepts/CountersignPolicy__.ts.html +0 -319
  367. package/coverage/src/concepts/DefaultValue__.ts.html +0 -1024
  368. package/coverage/src/concepts/I18nInfo__.ts.html +0 -424
  369. package/coverage/src/concepts/ImportedInterface__.ts.html +0 -262
  370. package/coverage/src/concepts/MetadataType__.ts.html +0 -2035
  371. package/coverage/src/concepts/MultiApprovalPolicy__.ts.html +0 -301
  372. package/coverage/src/concepts/SequentialPolicy__.ts.html +0 -265
  373. package/coverage/src/concepts/StaticString__.ts.html +0 -397
  374. package/coverage/src/concepts/basics/constants.ts.html +0 -88
  375. package/coverage/src/concepts/basics/index.html +0 -116
  376. package/coverage/src/concepts/utils/asserts.ts.html +0 -28675
  377. package/coverage/src/concepts/utils/index.html +0 -131
  378. package/coverage/src/concepts/utils/types.ts.html +0 -2092
  379. package/coverage/src/translator/types.ts.html +0 -256
  380. package/coverage/src/utils/i18nInfo.ts.html +0 -166
  381. package/coverage/src/utils/time-slicing/constant.ts.html +0 -196
  382. package/dist/README.md +0 -97
  383. package/dist/index.d.ts +0 -26
  384. package/dist/index.js +0 -397
  385. package/dist/index.js.map +0 -1
  386. package/dist/package.json +0 -91
  387. package/dist/src/automate/engine/index.d.ts +0 -4
  388. package/dist/src/automate/engine/operators.d.ts +0 -26
  389. package/dist/src/automate/engine/uniqueName.d.ts +0 -12
  390. package/dist/src/automate/engine/utils.d.ts +0 -25
  391. package/dist/src/automate/engine/viewCache.d.ts +0 -19
  392. package/dist/src/automate/template/myProcess.d.ts +0 -10
  393. package/dist/src/automate/upgrader/2.12.d.ts +0 -7
  394. package/dist/src/automate/upgrader/2.14-components.d.ts +0 -1115
  395. package/dist/src/automate/upgrader/2.14.d.ts +0 -10
  396. package/dist/src/automate/upgrader/2.14.old.d.ts +0 -1
  397. package/dist/src/automate/upgrader/2.16.d.ts +0 -10
  398. package/dist/src/automate/upgrader/2.17.d.ts +0 -21
  399. package/dist/src/automate/upgrader/2.18.d.ts +0 -10
  400. package/dist/src/automate/upgrader/2.20.d.ts +0 -17
  401. package/dist/src/bak/translator.d.ts +0 -1
  402. package/dist/src/breakpoint/generator/AfterStartNode.d.ts +0 -7
  403. package/dist/src/breakpoint/generator/BeforeEndNode.d.ts +0 -7
  404. package/dist/src/breakpoint/generator/BreakpointNode.d.ts +0 -20
  405. package/dist/src/breakpoint/generator/CallbackNode.d.ts +0 -4
  406. package/dist/src/breakpoint/generator/FragmentNode.d.ts +0 -4
  407. package/dist/src/breakpoint/generator/index.d.ts +0 -4
  408. package/dist/src/breakpoint/index.d.ts +0 -3
  409. package/dist/src/breakpoint/shared/constants.d.ts +0 -37
  410. package/dist/src/breakpoint/shared/index.d.ts +0 -3
  411. package/dist/src/breakpoint/shared/operations.d.ts +0 -10
  412. package/dist/src/breakpoint/shared/socket.d.ts +0 -48
  413. package/dist/src/breakpoint/shared/utils.d.ts +0 -27
  414. package/dist/src/breakpoint/store/core.d.ts +0 -80
  415. package/dist/src/breakpoint/store/dock.d.ts +0 -1
  416. package/dist/src/breakpoint/store/index.d.ts +0 -2
  417. package/dist/src/common/BaseNode.d.ts +0 -384
  418. package/dist/src/common/Command.d.ts +0 -21
  419. package/dist/src/common/ComponentAPI.d.ts +0 -112
  420. package/dist/src/common/EventEmitter.d.ts +0 -61
  421. package/dist/src/common/Messager.d.ts +0 -91
  422. package/dist/src/common/asyncFuncMap.d.ts +0 -2
  423. package/dist/src/common/index.d.ts +0 -4
  424. package/dist/src/common/utils.d.ts +0 -2
  425. package/dist/src/concepts/Abort__.d.ts +0 -31
  426. package/dist/src/concepts/AbstractInterface__.d.ts +0 -25
  427. package/dist/src/concepts/Anchor__.d.ts +0 -42
  428. package/dist/src/concepts/AnonymousFunction__.d.ts +0 -144
  429. package/dist/src/concepts/App__.d.ts +0 -1711
  430. package/dist/src/concepts/Argument__.d.ts +0 -64
  431. package/dist/src/concepts/Assignee__.d.ts +0 -294
  432. package/dist/src/concepts/AssignmentLine__.d.ts +0 -43
  433. package/dist/src/concepts/Assignment__.d.ts +0 -57
  434. package/dist/src/concepts/Attribute__.d.ts +0 -75
  435. package/dist/src/concepts/AuthInterface__.d.ts +0 -38
  436. package/dist/src/concepts/AuthLogicForCallInterface__.d.ts +0 -145
  437. package/dist/src/concepts/AuthLogic__.d.ts +0 -69
  438. package/dist/src/concepts/BackendVariable__.d.ts +0 -118
  439. package/dist/src/concepts/Backend__.d.ts +0 -127
  440. package/dist/src/concepts/BaseSetter__.d.ts +0 -25
  441. package/dist/src/concepts/BatchAssignment__.d.ts +0 -244
  442. package/dist/src/concepts/BinaryExpression__.d.ts +0 -61
  443. package/dist/src/concepts/BindAttribute__.d.ts +0 -284
  444. package/dist/src/concepts/BindDirective__.d.ts +0 -156
  445. package/dist/src/concepts/BindEvent__.d.ts +0 -246
  446. package/dist/src/concepts/BindStyle__.d.ts +0 -127
  447. package/dist/src/concepts/Block__.d.ts +0 -88
  448. package/dist/src/concepts/BooleanLiteral__.d.ts +0 -44
  449. package/dist/src/concepts/BusinessComponent__.d.ts +0 -640
  450. package/dist/src/concepts/BusinessLogic__.d.ts +0 -44
  451. package/dist/src/concepts/CallAuthInterface__.d.ts +0 -132
  452. package/dist/src/concepts/CallConnector__.d.ts +0 -55
  453. package/dist/src/concepts/CallEvent__.d.ts +0 -100
  454. package/dist/src/concepts/CallFunction__.d.ts +0 -171
  455. package/dist/src/concepts/CallInterface__.d.ts +0 -143
  456. package/dist/src/concepts/CallLogic__.d.ts +0 -224
  457. package/dist/src/concepts/CallQueryComponent__.d.ts +0 -383
  458. package/dist/src/concepts/CapsulesSetter__.d.ts +0 -109
  459. package/dist/src/concepts/Comment__.d.ts +0 -41
  460. package/dist/src/concepts/CompletionProperty__.d.ts +0 -87
  461. package/dist/src/concepts/ConfigGroup__.d.ts +0 -121
  462. package/dist/src/concepts/ConfigPropertyValue__.d.ts +0 -42
  463. package/dist/src/concepts/ConfigProperty__.d.ts +0 -147
  464. package/dist/src/concepts/Configuration__.d.ts +0 -120
  465. package/dist/src/concepts/Connection__.d.ts +0 -159
  466. package/dist/src/concepts/ConnectorLogic__.d.ts +0 -33
  467. package/dist/src/concepts/ConnectorTriggerLauncher__.d.ts +0 -44
  468. package/dist/src/concepts/ConnectorTrigger__.d.ts +0 -76
  469. package/dist/src/concepts/Connector__.d.ts +0 -532
  470. package/dist/src/concepts/Constant__.d.ts +0 -94
  471. package/dist/src/concepts/CountersignPolicy__.d.ts +0 -29
  472. package/dist/src/concepts/DataSource__.d.ts +0 -163
  473. package/dist/src/concepts/DatabaseTypeAnnotation__.d.ts +0 -35
  474. package/dist/src/concepts/DefaultValue__.d.ts +0 -94
  475. package/dist/src/concepts/Destination__.d.ts +0 -150
  476. package/dist/src/concepts/End__.d.ts +0 -30
  477. package/dist/src/concepts/EntityIndex__.d.ts +0 -93
  478. package/dist/src/concepts/EntityProperty__.d.ts +0 -255
  479. package/dist/src/concepts/Entity__.d.ts +0 -332
  480. package/dist/src/concepts/EnumItem__.d.ts +0 -83
  481. package/dist/src/concepts/EnumSelectSetter__.d.ts +0 -109
  482. package/dist/src/concepts/Enum__.d.ts +0 -133
  483. package/dist/src/concepts/EventDeclaration__.d.ts +0 -41
  484. package/dist/src/concepts/Event__.d.ts +0 -149
  485. package/dist/src/concepts/ExternalDestination__.d.ts +0 -63
  486. package/dist/src/concepts/ForEachStatement__.d.ts +0 -126
  487. package/dist/src/concepts/FrontendLibrary__.d.ts +0 -208
  488. package/dist/src/concepts/FrontendType__.d.ts +0 -304
  489. package/dist/src/concepts/FrontendVariable__.d.ts +0 -41
  490. package/dist/src/concepts/Frontend__.d.ts +0 -389
  491. package/dist/src/concepts/Function__.d.ts +0 -399
  492. package/dist/src/concepts/I18nInfo__.d.ts +0 -47
  493. package/dist/src/concepts/IconSetter__.d.ts +0 -29
  494. package/dist/src/concepts/Identifier__.d.ts +0 -66
  495. package/dist/src/concepts/IfStatement__.d.ts +0 -155
  496. package/dist/src/concepts/ImageSetter__.d.ts +0 -25
  497. package/dist/src/concepts/ImportedInterface__.d.ts +0 -29
  498. package/dist/src/concepts/InputSetter__.d.ts +0 -29
  499. package/dist/src/concepts/Integration__.d.ts +0 -127
  500. package/dist/src/concepts/InterfaceParam__.d.ts +0 -119
  501. package/dist/src/concepts/InterfaceTriggerEvent__.d.ts +0 -34
  502. package/dist/src/concepts/Interface__.d.ts +0 -323
  503. package/dist/src/concepts/JSBlock__.d.ts +0 -38
  504. package/dist/src/concepts/JavaLogic__.d.ts +0 -50
  505. package/dist/src/concepts/LogicDeclaration__.d.ts +0 -289
  506. package/dist/src/concepts/LogicItem__.d.ts +0 -171
  507. package/dist/src/concepts/Logic__.d.ts +0 -632
  508. package/dist/src/concepts/MatchCase__.d.ts +0 -264
  509. package/dist/src/concepts/Match__.d.ts +0 -122
  510. package/dist/src/concepts/MemberExpression__.d.ts +0 -64
  511. package/dist/src/concepts/MetadataType__.d.ts +0 -220
  512. package/dist/src/concepts/MicroApp__.d.ts +0 -53
  513. package/dist/src/concepts/Module__.d.ts +0 -1142
  514. package/dist/src/concepts/MsgTriggerEvent__.d.ts +0 -138
  515. package/dist/src/concepts/MsgTriggerLauncher__.d.ts +0 -119
  516. package/dist/src/concepts/MultiApprovalPolicy__.d.ts +0 -25
  517. package/dist/src/concepts/Namespace__.d.ts +0 -1060
  518. package/dist/src/concepts/NewComposite__.d.ts +0 -346
  519. package/dist/src/concepts/NewList__.d.ts +0 -135
  520. package/dist/src/concepts/NewMap__.d.ts +0 -226
  521. package/dist/src/concepts/New__.d.ts +0 -30
  522. package/dist/src/concepts/NullLiteral__.d.ts +0 -36
  523. package/dist/src/concepts/NumberInputSetter__.d.ts +0 -45
  524. package/dist/src/concepts/NumericLiteral__.d.ts +0 -53
  525. package/dist/src/concepts/OqlQueryComponent__.d.ts +0 -67
  526. package/dist/src/concepts/OverriddenLogic__.d.ts +0 -615
  527. package/dist/src/concepts/Paginate__.d.ts +0 -59
  528. package/dist/src/concepts/ParamWithGroup__.d.ts +0 -44
  529. package/dist/src/concepts/Param__.d.ts +0 -140
  530. package/dist/src/concepts/Point__.d.ts +0 -33
  531. package/dist/src/concepts/ProcessComponent__.d.ts +0 -214
  532. package/dist/src/concepts/ProcessElement__.d.ts +0 -620
  533. package/dist/src/concepts/ProcessOutcome__.d.ts +0 -35
  534. package/dist/src/concepts/ProcessOutcomes__.d.ts +0 -35
  535. package/dist/src/concepts/Process__.d.ts +0 -605
  536. package/dist/src/concepts/PropDeclaration__.d.ts +0 -99
  537. package/dist/src/concepts/PropertySelectSetter__.d.ts +0 -25
  538. package/dist/src/concepts/QueryAggregateExpression__.d.ts +0 -50
  539. package/dist/src/concepts/QueryFieldExpression__.d.ts +0 -66
  540. package/dist/src/concepts/QueryFromExpression__.d.ts +0 -107
  541. package/dist/src/concepts/QueryGroupByExpression__.d.ts +0 -46
  542. package/dist/src/concepts/QueryJoinExpression__.d.ts +0 -194
  543. package/dist/src/concepts/QueryLimitExpression__.d.ts +0 -46
  544. package/dist/src/concepts/QueryOrderByExpression__.d.ts +0 -57
  545. package/dist/src/concepts/QuerySelectExpression__.d.ts +0 -213
  546. package/dist/src/concepts/Rect__.d.ts +0 -41
  547. package/dist/src/concepts/Return__.d.ts +0 -120
  548. package/dist/src/concepts/Role__.d.ts +0 -58
  549. package/dist/src/concepts/SelectMembers__.d.ts +0 -134
  550. package/dist/src/concepts/SequentialPolicy__.d.ts +0 -25
  551. package/dist/src/concepts/SetterOption__.d.ts +0 -49
  552. package/dist/src/concepts/SlotDeclaration__.d.ts +0 -213
  553. package/dist/src/concepts/Slot__.d.ts +0 -53
  554. package/dist/src/concepts/SqlQueryComponent__.d.ts +0 -63
  555. package/dist/src/concepts/Start__.d.ts +0 -30
  556. package/dist/src/concepts/StaticString__.d.ts +0 -49
  557. package/dist/src/concepts/StringInterpolation__.d.ts +0 -122
  558. package/dist/src/concepts/StringLiteral__.d.ts +0 -51
  559. package/dist/src/concepts/StructureProperty__.d.ts +0 -119
  560. package/dist/src/concepts/Structure__.d.ts +0 -243
  561. package/dist/src/concepts/SwitchCase__.d.ts +0 -91
  562. package/dist/src/concepts/SwitchSetter__.d.ts +0 -25
  563. package/dist/src/concepts/SwitchStatement__.d.ts +0 -90
  564. package/dist/src/concepts/ThemeVariable__.d.ts +0 -29
  565. package/dist/src/concepts/Theme__.d.ts +0 -39
  566. package/dist/src/concepts/Transactional__.d.ts +0 -85
  567. package/dist/src/concepts/TriggerEvent__.d.ts +0 -42
  568. package/dist/src/concepts/TriggerLauncher__.d.ts +0 -76
  569. package/dist/src/concepts/TypeAnnotation__.d.ts +0 -303
  570. package/dist/src/concepts/TypeParam__.d.ts +0 -34
  571. package/dist/src/concepts/UnaryExpression__.d.ts +0 -45
  572. package/dist/src/concepts/Unparsed__.d.ts +0 -41
  573. package/dist/src/concepts/UseComponent__.d.ts +0 -33
  574. package/dist/src/concepts/ValidationRule__.d.ts +0 -133
  575. package/dist/src/concepts/Variable__.d.ts +0 -137
  576. package/dist/src/concepts/ViewBlockWithImage__.d.ts +0 -33
  577. package/dist/src/concepts/ViewBlock__.d.ts +0 -37
  578. package/dist/src/concepts/ViewComponentDeclaration__.d.ts +0 -721
  579. package/dist/src/concepts/ViewElement__.d.ts +0 -652
  580. package/dist/src/concepts/View__.d.ts +0 -728
  581. package/dist/src/concepts/WhileStatement__.d.ts +0 -94
  582. package/dist/src/concepts/basics/constants.d.ts +0 -1
  583. package/dist/src/concepts/basics/stdlib/index.d.ts +0 -16
  584. package/dist/src/concepts/basics/stdlib/nasl.auth.d.ts +0 -9
  585. package/dist/src/concepts/basics/stdlib/nasl.browser.d.ts +0 -5
  586. package/dist/src/concepts/basics/stdlib/nasl.collection.d.ts +0 -9
  587. package/dist/src/concepts/basics/stdlib/nasl.configuration.d.ts +0 -9
  588. package/dist/src/concepts/basics/stdlib/nasl.core.d.ts +0 -7
  589. package/dist/src/concepts/basics/stdlib/nasl.event.d.ts +0 -5
  590. package/dist/src/concepts/basics/stdlib/nasl.http.d.ts +0 -9
  591. package/dist/src/concepts/basics/stdlib/nasl.interface.d.ts +0 -9
  592. package/dist/src/concepts/basics/stdlib/nasl.io.d.ts +0 -5
  593. package/dist/src/concepts/basics/stdlib/nasl.logging.d.ts +0 -5
  594. package/dist/src/concepts/basics/stdlib/nasl.process.d.ts +0 -9
  595. package/dist/src/concepts/basics/stdlib/nasl.ui.d.ts +0 -9
  596. package/dist/src/concepts/basics/stdlib/nasl.util.d.ts +0 -6
  597. package/dist/src/concepts/basics/stdlib/nasl.validation.d.ts +0 -5
  598. package/dist/src/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts +0 -4
  599. package/dist/src/concepts/basics/stdlib/timeZone.d.ts +0 -5
  600. package/dist/src/concepts/basics/types/coreTypeList.d.ts +0 -2
  601. package/dist/src/concepts/basics/types/index.d.ts +0 -17
  602. package/dist/src/concepts/index.d.ts +0 -7
  603. package/dist/src/concepts/index__.d.ts +0 -156
  604. package/dist/src/concepts/utils/asserts.d.ts +0 -7825
  605. package/dist/src/concepts/utils/quick-info.d.ts +0 -13
  606. package/dist/src/concepts/utils/types.d.ts +0 -510
  607. package/dist/src/config.d.ts +0 -52
  608. package/dist/src/decorators/index.d.ts +0 -67
  609. package/dist/src/decorators/promise.d.ts +0 -7
  610. package/dist/src/enums/KEYWORDS.d.ts +0 -6
  611. package/dist/src/enums/LEVEL_NAME_MAP.d.ts +0 -26
  612. package/dist/src/eventBus.d.ts +0 -3
  613. package/dist/src/generator/compileComponent.d.ts +0 -11
  614. package/dist/src/generator/genBundleFiles.d.ts +0 -37
  615. package/dist/src/generator/genHash.d.ts +0 -7
  616. package/dist/src/generator/genMetaData.d.ts +0 -31
  617. package/dist/src/generator/icestark.d.ts +0 -2
  618. package/dist/src/generator/index.d.ts +0 -7
  619. package/dist/src/generator/microApp.d.ts +0 -2
  620. package/dist/src/generator/permission.d.ts +0 -14
  621. package/dist/src/generator/qiankun.d.ts +0 -2
  622. package/dist/src/generator/release-body/body.d.ts +0 -42
  623. package/dist/src/generator/release-body/data.d.ts +0 -45
  624. package/dist/src/generator/release-body/index.d.ts +0 -2
  625. package/dist/src/generator/release-body/internal.d.ts +0 -622
  626. package/dist/src/generator/release-body/types.d.ts +0 -57
  627. package/dist/src/generator/release-body/utils.d.ts +0 -418
  628. package/dist/src/generator/release-body/validation.d.ts +0 -3
  629. package/dist/src/generator/styleReplacer.d.ts +0 -3
  630. package/dist/src/index.d.ts +0 -14
  631. package/dist/src/manager/diagnostic.d.ts +0 -39
  632. package/dist/src/manager/stepRecorder.d.ts +0 -20
  633. package/dist/src/natural/componentData.d.ts +0 -31
  634. package/dist/src/natural/genNaturalTS.d.ts +0 -241
  635. package/dist/src/natural/index.d.ts +0 -6
  636. package/dist/src/natural/naslStdlibMap.d.ts +0 -1
  637. package/dist/src/natural/prompt/analyzeClaims.d.ts +0 -1
  638. package/dist/src/natural/prompt/analyzeFormatOutput.d.ts +0 -1
  639. package/dist/src/natural/prompt/analyzeTasks.d.ts +0 -1
  640. package/dist/src/natural/prompt/executeClaims.d.ts +0 -1
  641. package/dist/src/natural/transformTSCode.d.ts +0 -7
  642. package/dist/src/sentry/index.d.ts +0 -34
  643. package/dist/src/server/createUiTs.d.ts +0 -17
  644. package/dist/src/server/entity2LogicNamespace.d.ts +0 -10
  645. package/dist/src/server/event.d.ts +0 -30
  646. package/dist/src/server/extendBaseNode.d.ts +0 -1
  647. package/dist/src/server/formatTsUtils.d.ts +0 -36
  648. package/dist/src/server/getConnector.d.ts +0 -15
  649. package/dist/src/server/getExtensionModules.d.ts +0 -3
  650. package/dist/src/server/getFunctions.d.ts +0 -3
  651. package/dist/src/server/getInterfaces.d.ts +0 -2
  652. package/dist/src/server/getLogging.d.ts +0 -1
  653. package/dist/src/server/getLogics.d.ts +0 -5
  654. package/dist/src/server/getMemberIdentifier.d.ts +0 -17
  655. package/dist/src/server/getProcessComponents.d.ts +0 -2
  656. package/dist/src/server/getProcesses.d.ts +0 -33
  657. package/dist/src/server/getScope.d.ts +0 -13
  658. package/dist/src/server/getValidates.d.ts +0 -3
  659. package/dist/src/server/index.d.ts +0 -5
  660. package/dist/src/server/naslServer.d.ts +0 -391
  661. package/dist/src/server/naslStdlibMap.d.ts +0 -2
  662. package/dist/src/server/process2LogicNamespace.d.ts +0 -26
  663. package/dist/src/server/translator.d.ts +0 -26
  664. package/dist/src/service/creator/add.configs.d.ts +0 -1
  665. package/dist/src/service/creator/errHandles.d.ts +0 -18
  666. package/dist/src/service/creator/index.d.ts +0 -1
  667. package/dist/src/service/datasource/api.d.ts +0 -12
  668. package/dist/src/service/datasource/index.d.ts +0 -2
  669. package/dist/src/service/logic/api.d.ts +0 -9
  670. package/dist/src/service/logic/checktypeSocket.d.ts +0 -5
  671. package/dist/src/service/logic/index.d.ts +0 -2
  672. package/dist/src/service/storage/api.d.ts +0 -54
  673. package/dist/src/service/storage/index.d.ts +0 -2
  674. package/dist/src/service/storage/init.d.ts +0 -105
  675. package/dist/src/service/storage/jsoner.d.ts +0 -36
  676. package/dist/src/service/storage/map.d.ts +0 -4
  677. package/dist/src/service/storage/service.d.ts +0 -25
  678. package/dist/src/service/storage/storagePoint.d.ts +0 -17
  679. package/dist/src/service/video/BaseService.d.ts +0 -7
  680. package/dist/src/service/video/MainCallbackService.d.ts +0 -12
  681. package/dist/src/service/video/VideoTranscribe.d.ts +0 -15
  682. package/dist/src/service/video/publishService.d.ts +0 -1
  683. package/dist/src/templator/genCallComponentLogic.d.ts +0 -17
  684. package/dist/src/templator/genCreateBlock.d.ts +0 -10
  685. package/dist/src/templator/genCurdEditMultipleKeyBlock.d.ts +0 -8
  686. package/dist/src/templator/genCurdMultipleKeyBlock.d.ts +0 -61
  687. package/dist/src/templator/genEditTableBlock.d.ts +0 -51
  688. package/dist/src/templator/genEnumSelectBlock.d.ts +0 -10
  689. package/dist/src/templator/genGetBlock.d.ts +0 -6
  690. package/dist/src/templator/genGridViewBlock.d.ts +0 -55
  691. package/dist/src/templator/genListViewBlock.d.ts +0 -19
  692. package/dist/src/templator/genQueryComponent.d.ts +0 -34
  693. package/dist/src/templator/genSelectBlock.d.ts +0 -45
  694. package/dist/src/templator/genTableBlock.d.ts +0 -55
  695. package/dist/src/templator/genUpdateBlock.d.ts +0 -6
  696. package/dist/src/templator/index.d.ts +0 -19
  697. package/dist/src/templator/utils.d.ts +0 -683
  698. package/dist/src/translator/constant.d.ts +0 -6
  699. package/dist/src/translator/index.d.ts +0 -3
  700. package/dist/src/translator/types.d.ts +0 -85
  701. package/dist/src/translator/utils.d.ts +0 -47
  702. package/dist/src/utils/cookie.d.ts +0 -9
  703. package/dist/src/utils/create.d.ts +0 -2
  704. package/dist/src/utils/env.d.ts +0 -2
  705. package/dist/src/utils/file.d.ts +0 -33
  706. package/dist/src/utils/i18nInfo.d.ts +0 -5
  707. package/dist/src/utils/index.d.ts +0 -72
  708. package/dist/src/utils/logger.d.ts +0 -8
  709. package/dist/src/utils/sortTsString.d.ts +0 -1
  710. package/dist/src/utils/string.d.ts +0 -64
  711. package/dist/src/utils/time-slicing/constant.d.ts +0 -35
  712. package/dist/src/utils/time-slicing/controller.d.ts +0 -53
  713. package/dist/src/utils/time-slicing/index.d.ts +0 -5
  714. package/dist/src/utils/time-slicing/page-state.d.ts +0 -2
  715. package/dist/src/utils/time-slicing/performance.d.ts +0 -11
  716. package/dist/src/utils/time-slicing/runner.d.ts +0 -12
  717. package/dist/src/utils/time-slicing/tool.d.ts +0 -24
  718. package/dist/src/utils/time-slicing/utils.d.ts +0 -62
  719. package/dist/src/utils/time-slicing/wrapper.d.ts +0 -18
  720. package/dist/src/utils/traverse.d.ts +0 -36
  721. package/dist/src/utils/types.d.ts +0 -13
  722. package/dist/src/utils/window.d.ts +0 -7
  723. package/dist/test/concepts/anonymous-function/constant.d.ts +0 -2
  724. package/dist/test/concepts/anonymous-function/toEmbeddedTS.spec.d.ts +0 -1
  725. package/dist/test/concepts/anonymous-function/toJS.spec.d.ts +0 -1
  726. package/dist/test/concepts/anonymous-function/toVue.spec.d.ts +0 -1
  727. package/dist/test/concepts/assignment/constant.d.ts +0 -2
  728. package/dist/test/concepts/assignment/toEmbeddedTS.spec.d.ts +0 -1
  729. package/dist/test/concepts/assignment/toJS.spec.d.ts +0 -1
  730. package/dist/test/concepts/assignment/toVue.spec.d.ts +0 -1
  731. package/dist/test/concepts/batch-assignment/constant.d.ts +0 -2
  732. package/dist/test/concepts/batch-assignment/toEmbeddedTS.spec.d.ts +0 -1
  733. package/dist/test/concepts/batch-assignment/toJS.spec.d.ts +0 -1
  734. package/dist/test/concepts/batch-assignment/toVue.spec.d.ts +0 -1
  735. package/dist/test/concepts/binary-expression/constant.d.ts +0 -2
  736. package/dist/test/concepts/binary-expression/getQuickInfoOffset.spec.d.ts +0 -1
  737. package/dist/test/concepts/binary-expression/toEmbeddedTS.spec.d.ts +0 -1
  738. package/dist/test/concepts/binary-expression/toJS.spec.d.ts +0 -1
  739. package/dist/test/concepts/binary-expression/toVue.spec.d.ts +0 -1
  740. package/dist/test/concepts/boolean-literal/constant.d.ts +0 -2
  741. package/dist/test/concepts/boolean-literal/toEmbeddedTS.spec.d.ts +0 -1
  742. package/dist/test/concepts/boolean-literal/toJS.spec.d.ts +0 -1
  743. package/dist/test/concepts/boolean-literal/toVue.spec.d.ts +0 -1
  744. package/dist/test/concepts/call-function/constant.d.ts +0 -2
  745. package/dist/test/concepts/call-function/getQuickInfoOffset.spec.d.ts +0 -1
  746. package/dist/test/concepts/call-function/toEmbeddedTS.spec.d.ts +0 -1
  747. package/dist/test/concepts/call-function/toJS.spec.d.ts +0 -1
  748. package/dist/test/concepts/call-interface/constant.d.ts +0 -2
  749. package/dist/test/concepts/call-interface/getQuickInfoOffset.spec.d.ts +0 -1
  750. package/dist/test/concepts/call-interface/toEmbeddedTS.spec.d.ts +0 -1
  751. package/dist/test/concepts/call-interface/toJS.spec.d.ts +0 -1
  752. package/dist/test/concepts/call-logic/constant.d.ts +0 -2
  753. package/dist/test/concepts/call-logic/getQuickInfoOffset.spec.d.ts +0 -1
  754. package/dist/test/concepts/call-logic/toEmbeddedTS.spec.d.ts +0 -1
  755. package/dist/test/concepts/call-logic/toJS.spec.d.ts +0 -1
  756. package/dist/test/concepts/call-logic/toUI.spec.d.ts +0 -1
  757. package/dist/test/concepts/call-logic/toVue.spec.d.ts +0 -1
  758. package/dist/test/concepts/call-logic/toVueDesigner.spec.d.ts +0 -1
  759. package/dist/test/concepts/data-source/constant.d.ts +0 -2
  760. package/dist/test/concepts/data-source/toEmbeddedTS.spec.d.ts +0 -1
  761. package/dist/test/concepts/data-source/toEmbeddedTSFile.spec.d.ts +0 -1
  762. package/dist/test/concepts/entity/constant.d.ts +0 -2
  763. package/dist/test/concepts/entity/toEmbeddedTS.spec.d.ts +0 -1
  764. package/dist/test/concepts/entity/toEmbeddedTSFile.spec.d.ts +0 -1
  765. package/dist/test/concepts/identifier/constant.d.ts +0 -2
  766. package/dist/test/concepts/identifier/toEmbeddedTS.spec.d.ts +0 -1
  767. package/dist/test/concepts/identifier/toJS.spec.d.ts +0 -1
  768. package/dist/test/concepts/identifier/toVue.spec.d.ts +0 -1
  769. package/dist/test/concepts/match/constant.d.ts +0 -2
  770. package/dist/test/concepts/match/toEmbeddedTS.spec.d.ts +0 -1
  771. package/dist/test/concepts/match/toJS.spec.d.ts +0 -1
  772. package/dist/test/concepts/member-expression/constant.d.ts +0 -2
  773. package/dist/test/concepts/member-expression/toEmbeddedTS.spec.d.ts +0 -1
  774. package/dist/test/concepts/member-expression/toJS.spec.d.ts +0 -1
  775. package/dist/test/concepts/member-expression/toVue.spec.d.ts +0 -1
  776. package/dist/test/concepts/new-composite/constant.d.ts +0 -2
  777. package/dist/test/concepts/new-composite/getQuickInfoOffset.spec.d.ts +0 -1
  778. package/dist/test/concepts/new-composite/toEmbeddedTS.spec.d.ts +0 -1
  779. package/dist/test/concepts/new-composite/toJS.spec.d.ts +0 -1
  780. package/dist/test/concepts/new-list/constant.d.ts +0 -2
  781. package/dist/test/concepts/new-list/getQuickInfoOffset.spec.d.ts +0 -1
  782. package/dist/test/concepts/new-list/toEmbeddedTS.spec.d.ts +0 -1
  783. package/dist/test/concepts/new-list/toJS.spec.d.ts +0 -1
  784. package/dist/test/concepts/new-map/constant.d.ts +0 -2
  785. package/dist/test/concepts/new-map/getQuickInfoOffset.spec.d.ts +0 -1
  786. package/dist/test/concepts/new-map/toEmbeddedTS.spec.d.ts +0 -1
  787. package/dist/test/concepts/new-map/toJS.spec.d.ts +0 -1
  788. package/dist/test/concepts/null-literal/constant.d.ts +0 -2
  789. package/dist/test/concepts/null-literal/toEmbeddedTS.spec.d.ts +0 -1
  790. package/dist/test/concepts/null-literal/toJS.spec.d.ts +0 -1
  791. package/dist/test/concepts/null-literal/toVue.spec.d.ts +0 -1
  792. package/dist/test/concepts/numeric-literal/constant.d.ts +0 -2
  793. package/dist/test/concepts/numeric-literal/toEmbeddedTS.spec.d.ts +0 -1
  794. package/dist/test/concepts/numeric-literal/toJS.spec.d.ts +0 -1
  795. package/dist/test/concepts/numeric-literal/toVue.spec.d.ts +0 -1
  796. package/dist/test/concepts/string-literal/constant.d.ts +0 -2
  797. package/dist/test/concepts/string-literal/toEmbeddedTS.spec.d.ts +0 -1
  798. package/dist/test/concepts/string-literal/toJS.spec.d.ts +0 -1
  799. package/dist/test/concepts/string-literal/toVue.spec.d.ts +0 -1
  800. package/dist/test/concepts/utils.d.ts +0 -13
  801. package/dist/test/concepts/validation-rule/constant.d.ts +0 -2
  802. package/dist/test/concepts/validation-rule/toEmbeddedTS.spec.d.ts +0 -1
  803. package/dist/test/concepts/validation-rule/toJS.spec.d.ts +0 -1
  804. package/dist/test/concepts/validation-rule/validation-rule.spec.d.ts +0 -1
  805. package/dist/test/concepts/view-element/constant.d.ts +0 -2
  806. package/dist/test/concepts/view-element/toEmbeddedTS.spec.d.ts +0 -1
  807. package/dist/test/concepts/view-element/toVue.spec.d.ts +0 -1
  808. package/dist/test/setup.d.ts +0 -1
  809. package/dist/test/time-slicing/runner.spec.d.ts +0 -1
  810. package/dist/test/time-slicing/time-slicing-nodejs.spec.d.ts +0 -1
  811. package/dist/test/time-slicing/utils.d.ts +0 -1
  812. package/dist/test/time-slicing/wrapper.spec.d.ts +0 -1
@@ -0,0 +1,447 @@
1
+ import { App, Identifier, MemberExpression, View, ViewElement, BaseNode, Return, Variable,
2
+ Assignment, BatchAssignment, CallFunction, AuthLogicForCallInterface, BusinessComponent, BusinessLogic,
3
+ Logic, OverriddenLogic, SubLogic,
4
+ Process,
5
+ ProcessV2,
6
+ ProcessElement,
7
+ ProcessElementV2,
8
+ } from '..';
9
+
10
+ import { SyntaxNode } from '../concepts/utils/types';
11
+
12
+ import { createCompilerState, shiftState } from '../translator';
13
+ import { runGeneratorAsync, runGeneratorSync, wrapForEachToGenerator, returnOrigin } from '../utils';
14
+
15
+ type VarScopeCtx = {
16
+ // 优化首屏 getAncestor 热点代码
17
+ app: App;
18
+ isFirstScreen: boolean;
19
+ frontendGlobalVars: Set<string>;
20
+ varInViewOrComponent: Set<string>;
21
+ logicInViewOrComponent: Set<string>;
22
+ idToView: Map<Identifier, View>;
23
+ ctxViewElement: Array<ViewElement>;
24
+ ctxView: Array<View>;
25
+ isInViewOrComponent: boolean;
26
+ memExprToViewElem: Map<MemberExpression, ViewElement>;
27
+ }
28
+
29
+ type TyInferCtx = {
30
+ // 优化首屏 类型推导,变量提升
31
+ inferViaAsgnMap: Map<Return | Variable , Assignment | BatchAssignment | CallFunction>,
32
+ inferViaFnCallMap: Map<Return | Variable , CallFunction>,
33
+ scope: Array<AuthLogicForCallInterface | BusinessComponent | BusinessLogic | Logic | OverriddenLogic | SubLogic | View>,
34
+ // key 用 name 是不精确的,应该用地址。 暂时用 name,后面比较的时候简单点,暂时应该没 bug
35
+ // 全局变量暂不支持推导
36
+ capturedVars: Map<string, Variable | Return>,
37
+ }
38
+
39
+ type SubLogicCtx = {
40
+ // naslNodesCount: number;
41
+ ctx: Logic | Process | ProcessV2 | ProcessElement | ProcessElementV2 | null;
42
+ // 我也不知道为啥 view 这么特殊
43
+ viewSubLogics: Set<SubLogic>;
44
+ }
45
+
46
+ // 前端全局变量很少,一般就十个以内,所以 map 大小可以忽略不计
47
+ export const varScopeCtx : VarScopeCtx = {
48
+ app: null,
49
+ isFirstScreen: false,
50
+ frontendGlobalVars: new Set<string>(),
51
+ // Collect all params, (local) variables, and logic names under business component
52
+ // Note that within a business component, one can only refer to the above variables, and cannot refer to
53
+ // frontend global variables and any other variables under Views; therefore, checking the Name already suffices.
54
+ // 收集业务组件下的所有参数、(局部)变量和逻辑名称,请注意,在业务组件中,只能引用上述变量,
55
+ // 而不能引用前端全局变量和其他任何 “视图 ”下的变量;因此,检查 “Name” 已经足够了。
56
+ varInViewOrComponent: new Set<string>(),
57
+
58
+ logicInViewOrComponent: new Set<string>(),
59
+
60
+ // Collect all params, (local) variables, and logic names under views
61
+ // Actually, frontendGlobalVars U idInView U idInComponent should be the complete set of accessible variables
62
+ // 事实上,frontendGlobalVars 并上 idInView 并上 idInComponent 应该是前端所有能访问到的变量(名的集合)
63
+
64
+ // 赫基 27w 应用,前端 View 下有 2000 个变量名字;56176 个变量引用,内存占用约 1M。
65
+ idToView: new Map<Identifier, View>(),
66
+
67
+ // 路径上的 ViewElement 节点
68
+ ctxViewElement: [],
69
+
70
+ // 路径上的 View 节点
71
+ ctxView: [],
72
+
73
+ isInViewOrComponent: false,
74
+
75
+ memExprToViewElem: new Map<MemberExpression, ViewElement>(),
76
+ };
77
+
78
+ export const tyInferCtx : TyInferCtx = {
79
+ inferViaAsgnMap: new Map(),
80
+ inferViaFnCallMap: new Map(),
81
+ scope: [],
82
+ capturedVars: new Map(),
83
+ }
84
+
85
+ export const subLogicCtx : SubLogicCtx = {
86
+ // naslNodesCount: 0,
87
+ ctx: null, // 当前逻辑
88
+ viewSubLogics : new Set<SubLogic>(), // 隶属于 view 的 SubLogic,需要排除掉隶属于 Logic 的 SubLogic。
89
+ }
90
+
91
+ const last = <T>(arr: Array<T>) => arr[arr.length - 1];
92
+
93
+
94
+ export function *collectAllSemanticCtx(app: App) {
95
+ varScopeCtx.app = app;
96
+ varScopeCtx.isFirstScreen = true;
97
+ const tasks = [
98
+ // collectFrontendVariablesTask, 这样不值得,能快一点还是快一点吧,
99
+ collectVarInViewOrComponentCtxTask,
100
+ collectLogicInViewOrComponentTask,
101
+ // collectMemExprToViewElemCtxTask, // 因为 $ce 的原因,暂时用不了
102
+ collectIdToViewCtxTask,
103
+ collectSubLogicCtxTask,
104
+ collectTyInferCtxTask
105
+ ];
106
+
107
+ const cleanups = [
108
+ collectVarInViewOrComponentCtxCleanup,
109
+ // collectLogicInViewOrComponentCleanup,
110
+ // collectMemExprToViewElemCtxCleanup, // 因为 $ce 的原因,暂时用不了
111
+ collectIdToViewCtxCleanup,
112
+ collectSubLogicCtxCleanup,
113
+ collectTyInferCtxCleanup
114
+ ];
115
+
116
+ runGeneratorSync(collectFrontendVariablesTask(app));
117
+ runGeneratorSync(app.traverseStrictChildrenDoMultiTasks(tasks, cleanups));
118
+ }
119
+
120
+
121
+ function *collectFrontendVariablesTask(app: App) {
122
+ app.frontendTypes.forEach(ft => {
123
+ ft.frontends.forEach(f => {
124
+ f.variables.forEach(v => {
125
+ varScopeCtx.frontendGlobalVars.add(v.name);
126
+ });
127
+ });
128
+ })
129
+ }
130
+
131
+ function *collectVarInViewOrComponentCtxTask(nd: SyntaxNode) {
132
+ switch (nd.concept) {
133
+ case 'Variable': /* FALL THROUGH */
134
+ case 'Param': /* FALL THROUGH */
135
+ case 'Return': {
136
+ if (varScopeCtx.isInViewOrComponent) {
137
+ varScopeCtx.varInViewOrComponent.add(nd.name);
138
+ }
139
+ break;
140
+ }
141
+ case 'View': /* FALL THROUGH */
142
+ case 'BusinessComponent': varScopeCtx.isInViewOrComponent = true; break;
143
+ default: break;
144
+ }
145
+ }
146
+
147
+ function *collectVarInViewOrComponentCtxCleanup(nd: SyntaxNode) {
148
+ if (nd.concept === 'View' || nd.concept === 'BusinessComponent') {
149
+ varScopeCtx.isInViewOrComponent = false;
150
+ }
151
+ }
152
+
153
+
154
+ // component-like:业务组件下的变量引用
155
+ function *collectLogicInViewOrComponentTask(nd: SyntaxNode) {
156
+ if (nd.concept === 'Logic' || nd.concept === 'BusinessComponent') {
157
+ if (varScopeCtx.isInViewOrComponent) {
158
+ varScopeCtx.logicInViewOrComponent.add(nd.name);
159
+ }
160
+ }
161
+ }
162
+ // collectLogicInViewOrComponentCleanup 的事情被 collectVarInViewOrComponentCtxPost 做了
163
+
164
+
165
+ function *collectMemExprToViewElemCtxTask(nd: SyntaxNode) {
166
+ // view 下的 identifier 的 getAncestor 必定有 view
167
+ switch (nd.concept) {
168
+ case 'ViewElement': {
169
+ varScopeCtx.ctxViewElement.push(nd as ViewElement);
170
+ break;
171
+ }
172
+ case 'MemberExpression': {
173
+ if (varScopeCtx.ctxViewElement) {
174
+ varScopeCtx.memExprToViewElem.set(nd as MemberExpression, last(varScopeCtx.ctxViewElement));
175
+ }
176
+ break;
177
+ }
178
+ default: break;
179
+ }
180
+ }
181
+
182
+ function *collectMemExprToViewElemCtxCleanup(nd: SyntaxNode) {
183
+ if (nd.concept === 'ViewElement') {
184
+ varScopeCtx.ctxViewElement.pop();
185
+ }
186
+ }
187
+
188
+
189
+ function *collectIdToViewCtxTask(nd: SyntaxNode) {
190
+ // view 下的 identifier 的 getAncestor 必定有 view
191
+ switch (nd.concept) {
192
+ case 'View': varScopeCtx.ctxView.push(nd); break;
193
+ case 'Identifier': {
194
+ if (varScopeCtx.ctxView.length > 0) {
195
+ varScopeCtx.idToView.set(nd as Identifier, last(varScopeCtx.ctxView));
196
+ }
197
+ break;
198
+ }
199
+ default: break;
200
+ }
201
+ }
202
+
203
+ function *collectIdToViewCtxCleanup(nd: SyntaxNode) {
204
+ switch (nd.concept) {
205
+ case 'View': varScopeCtx.ctxView.pop(); break;
206
+ default: break;
207
+ }
208
+ }
209
+
210
+
211
+ function *collectSubLogicCtxTask(nd : SyntaxNode) {
212
+ switch (nd.concept) {
213
+ case 'Logic': /* FALL THROUGH */
214
+ /* 流程支持子逻辑 */
215
+ /* 流程变量不支持类型推导 */
216
+ case 'Process': /* FALL THROUGH */
217
+ case 'ProcessV2': /* FALL THROUGH */
218
+ case 'ProcessElement': /* FALL THROUGH */
219
+ case 'ProcessElementV2': /* FALL THROUGH */
220
+ case 'BusinessLogic': subLogicCtx.ctx = nd; break;
221
+ case 'SubLogic': {
222
+ // 收集子逻辑
223
+ if (subLogicCtx.ctx) {
224
+ subLogicCtx.ctx.subLogics.push(nd as SubLogic);
225
+ // console.log('逻辑或流程的子逻辑:', subLogicCtx.ctx)
226
+ } else {
227
+ subLogicCtx.viewSubLogics.add(nd as SubLogic);
228
+ }
229
+ break;
230
+ }
231
+ default: break;
232
+ }
233
+ }
234
+
235
+ function *collectSubLogicCtxCleanup(nd : SyntaxNode) {
236
+ switch (nd.concept) {
237
+ /* 流程支持子逻辑 */
238
+ /* 流程变量不支持类型推导 */
239
+ case 'Logic': /* FALL THROUGH */
240
+ case 'Process': /* FALL THROUGH */
241
+ case 'ProcessV2': /* FALL THROUGH */
242
+ case 'ProcessElement': /* FALL THROUGH */
243
+ case 'ProcessElementV2': subLogicCtx.ctx = null; break;
244
+ // 可能是有人忘了给业务组件加 subLogics?
245
+ case 'View': {
246
+ subLogicCtx.viewSubLogics.forEach(sl => { nd.subLogics.push(sl); });
247
+ // console.log('View 的子逻辑:', nd.subLogics)
248
+ subLogicCtx.viewSubLogics.clear();
249
+ break;
250
+ }
251
+ default: break;
252
+ }
253
+ }
254
+
255
+
256
+ const addVars = (nd : Array<Variable> | Array<Return>, s : Map<string, Variable | Return>) => {
257
+ nd.forEach(v => {
258
+ if (!v.typeAnnotation) {
259
+ s.set(v.name, v);
260
+ }
261
+ })
262
+ }
263
+
264
+ const removeVars = (nd : Array<Variable> | Array<Return>, s : Map<string, Variable | Return>) => {
265
+ nd.forEach(v => s.delete(v.name))
266
+ }
267
+
268
+
269
+ // OQL 批量优化优化完成前请勿移除
270
+ // const oqlSet = new Set<string>();
271
+
272
+ function *collectTyInferCtxTask(nd : SyntaxNode) {
273
+ // ++subLogicCtx.naslNodesCount;
274
+ // if (nd.concept === 'OqlQueryComponent') {
275
+ // oqlSet.add(nd.code);
276
+ // }
277
+ switch (nd.concept) {
278
+ case 'Logic': /* FALL THROUGH */
279
+ case 'AuthLogicForCallInterface': /* FALL THROUGH */
280
+ case 'BusinessLogic': /* FALL THROUGH */
281
+ case 'OverriddenLogic': /* FALL THROUGH */
282
+ case 'SubLogic': {
283
+ // 全局变量不支持类型推导;逻辑的变量也不支持跨子逻辑推导
284
+ // addVars(nd.variables, tyInferCtx.capturedVars);
285
+ // addVars(nd.returns, tyInferCtx.capturedVars);
286
+ tyInferCtx.scope.push(nd);
287
+ break;
288
+ }
289
+ case 'View': /* FALL THROUGH */
290
+ case 'BusinessComponent': {
291
+ addVars(nd.variables, tyInferCtx.capturedVars);
292
+ tyInferCtx.scope.push(nd);
293
+ break;
294
+ }
295
+ default: {
296
+ runGeneratorAsync(
297
+ collectAsgn(tyInferCtx.inferViaAsgnMap, tyInferCtx.inferViaFnCallMap, nd));
298
+ break;
299
+ }
300
+ }
301
+ }
302
+
303
+ function *collectTyInferCtxCleanup(nd : SyntaxNode) {
304
+ switch (nd.concept) {
305
+ case 'Logic': /* FALL THROUGH */
306
+ case 'AuthLogicForCallInterface': /* FALL THROUGH */
307
+ case 'BusinessLogic': /* FALL THROUGH */
308
+ case 'OverriddenLogic': /* FALL THROUGH */
309
+ case 'SubLogic': {
310
+ // removeVars(nd.variables, tyInferCtx.capturedVars);
311
+ // removeVars(nd.returns, tyInferCtx.capturedVars);
312
+ tyInferCtx.scope.pop();
313
+ break;
314
+ }
315
+
316
+ case 'View': /* FALL THROUGH */
317
+ case 'BusinessComponent': {
318
+ removeVars(nd.variables, tyInferCtx.capturedVars);
319
+ tyInferCtx.scope.pop();
320
+ break;
321
+ }
322
+ default: break;
323
+ }
324
+ }
325
+
326
+
327
+ type LogicContainer = AuthLogicForCallInterface | BusinessComponent | BusinessLogic | Logic | OverriddenLogic | SubLogic | View;
328
+
329
+ export function *reCollectTyInferCtx(
330
+ inferViaAsgn: Map<Return | Variable, Assignment | BatchAssignment | CallFunction>,
331
+ inferViaFnCall: Map<Return | Variable, CallFunction>,
332
+ self: LogicContainer) {
333
+
334
+ // No (types of) variables to be inferred
335
+ // @ts-ignore
336
+ const preTest = self.variables?.some((v : Variable) => !v.typeAnnotation) || self.returns?.some((v : Variable) => !v.typeAnnotation)
337
+ if (!preTest) {
338
+ return;
339
+ }
340
+
341
+ // 非首次则清空脏 map,重新收集所需上下文
342
+ if (!varScopeCtx.isFirstScreen) {
343
+ tyInferCtx.inferViaAsgnMap.clear();
344
+ tyInferCtx.inferViaFnCallMap.clear();
345
+ yield* self.traverseChildrenGenerator(collectTyInferCtxTask);
346
+ }
347
+
348
+ self.variables.forEach((locVar : Variable) => {
349
+ if (tyInferCtx.inferViaAsgnMap.has(locVar)){
350
+ inferViaAsgn.set(locVar, tyInferCtx.inferViaAsgnMap.get(locVar))
351
+ } else if (tyInferCtx.inferViaFnCallMap.has(locVar)){
352
+ inferViaFnCall.set(locVar, tyInferCtx.inferViaFnCallMap.get(locVar))
353
+ }
354
+ });
355
+ // @ts-ignore
356
+ self.returns?.forEach((locRet : Return) => {
357
+ if (tyInferCtx.inferViaAsgnMap.has(locRet)){
358
+ inferViaAsgn.set(locRet, tyInferCtx.inferViaAsgnMap.get(locRet))
359
+ } else if (tyInferCtx.inferViaFnCallMap.has(locRet)){
360
+ inferViaFnCall.set(locRet, tyInferCtx.inferViaFnCallMap.get(locRet))
361
+ }
362
+ });
363
+ }
364
+
365
+ function *collectAsgn(
366
+ inferViaAsgnMap: Map<Return | Variable, Assignment | BatchAssignment | CallFunction>,
367
+ inferViaBuiltinFnMap: Map<Return | Variable, CallFunction>,
368
+ nd: SyntaxNode) {
369
+ const self = last(tyInferCtx.scope); // 可能是 undefined
370
+ if (!nd || !self) {
371
+ return;
372
+ }
373
+
374
+ if (nd.concept === 'Assignment' && nd.left?.name) {
375
+ if (!self) {
376
+ console.log('nd', nd)
377
+ }
378
+ const hoistVar = self.variables?.find(v => nd.left?.name === v.name && !v.typeAnnotation)
379
+ // View 和 BusinessComponent 没有 returns
380
+ // @ts-ignore
381
+ ?? self.returns?.find(ret => nd.left?.name === ret.name && !ret.typeAnnotation)
382
+ ?? tyInferCtx.capturedVars.get(nd.left.name);
383
+ if (hoistVar && !inferViaAsgnMap.has(hoistVar)) {
384
+ inferViaAsgnMap.set(hoistVar, nd);
385
+ }
386
+ } else if (nd.concept === 'BatchAssignment') {
387
+ yield* wrapForEachToGenerator(nd.assignmentLines, function* warpForEachGenerator({ leftIndex }) {
388
+ const leftCode =
389
+ leftIndex.length === 1
390
+ ? yield* nd.left.expression.toEmbeddedTS(shiftState(createCompilerState(), '', { inline: true }))
391
+ : yield* nd.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(createCompilerState(), '', { inline: true })) ??
392
+ returnOrigin('');
393
+ const hoistVar = self.variables?.find((v : Variable) => leftCode === v.name && !v.typeAnnotation)
394
+ // View 和 BusinessComponent 没有 returns
395
+ // @ts-ignore
396
+ ?? self.returns?.find(ret => leftCode === ret.name && !ret.typeAnnotation)
397
+ ?? tyInferCtx.capturedVars.get(leftCode);
398
+ if (hoistVar && !inferViaAsgnMap.has(hoistVar)) {
399
+ inferViaAsgnMap.set(hoistVar, nd);
400
+ }
401
+ });
402
+ } else if (nd.concept === 'CallFunction' && nd.derivableCollection?.name) {
403
+ // 需要被推导的集合
404
+ const expr = nd.derivableCollection;
405
+ // 宽泛意义上的变量(变量+出参),View 和 BusinessComponent 没有 returns
406
+ const hoistVar = self.variables.find((v) => expr?.name === v.name && !v.typeAnnotation)
407
+ // @ts-ignore
408
+ ?? self.returns?.find(ret => expr?.name === ret.name && !ret.typeAnnotation)
409
+ ?? tyInferCtx.capturedVars.get(expr.name);
410
+ if (hoistVar && !inferViaBuiltinFnMap.has(hoistVar)) {
411
+ inferViaBuiltinFnMap.set(hoistVar, nd);
412
+ }
413
+ }
414
+ }
415
+
416
+ export const clearSemanticData = () => {
417
+ varScopeCtx.isFirstScreen = false;
418
+ varScopeCtx.frontendGlobalVars.clear();
419
+ varScopeCtx.varInViewOrComponent.clear();
420
+ varScopeCtx.logicInViewOrComponent.clear();
421
+ varScopeCtx.idToView.clear();
422
+ varScopeCtx.ctxViewElement = [];
423
+ varScopeCtx.memExprToViewElem.clear();
424
+ tyInferCtx.inferViaAsgnMap.clear();
425
+ tyInferCtx.inferViaFnCallMap.clear();
426
+ tyInferCtx.scope = [];
427
+ tyInferCtx.capturedVars.clear();
428
+ subLogicCtx.viewSubLogics.clear();
429
+ subLogicCtx.ctx = null;
430
+ }
431
+
432
+ export function printSemanticDataInfo() {
433
+ console.log('frontendGlobalVars', varScopeCtx.frontendGlobalVars)
434
+ console.log('varInViewOrComponent', varScopeCtx.varInViewOrComponent)
435
+ console.log('logicInViewOrComponent', varScopeCtx.logicInViewOrComponent)
436
+ console.log('idToView', varScopeCtx.idToView)
437
+ console.log('memExprToViewElem', varScopeCtx.memExprToViewElem)
438
+ console.log('inferViaAsgnMap', tyInferCtx.inferViaAsgnMap)
439
+ console.log('inferViaFnCallMap', tyInferCtx.inferViaFnCallMap)
440
+ // console.log(oqlSet)
441
+ // console.log('capturedVars', tyInferCtx.capturedVars)
442
+ // console.log('viewSubLogics', subLogicCtx.viewSubLogics)
443
+ // console.log('naslNodesCount', subLogicCtx.naslNodesCount)
444
+ // console.log('ctx', subLogicCtx.ctx)
445
+ // console.log('scope', tyInferCtx.scope)
446
+ // console.log('isFirstScreen', varScopeCtx.isFirstScreen)
447
+ }
@@ -37,7 +37,8 @@ export function viewMergeBlock({
37
37
  const naslCode = tryTransformBlock2Nasl(code);
38
38
  const blockView = naslCode.view;
39
39
  // vue2需要对tag进行转换 kebab-case
40
- if(((((view as any)?.parentNode as Frontend))?.parentNode as FrontendType)?.frameworkKind === 'vue2') {
40
+ const frontendType = (view as any)?.getAncestor('FrontendType');
41
+ if((frontendType as any)?.frameworkKind === 'vue2') {
41
42
  traverse(({ node }) => {
42
43
  if (node.concept === 'ViewElement') {
43
44
  node.tag = Camel2kebab(node.tag);
@@ -314,4 +314,4 @@ export function createIdentifierCode(name: string) {
314
314
 
315
315
  export function textualNamespace(name: string) {
316
316
  return name.replace(/\./g, '::');
317
- }
317
+ }
@@ -0,0 +1,182 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`logic:toEmbeddedTS variable-host-call-logic-member-expression 1`] = `
4
+ "export function logic3() {
5
+ // @ts-ignore
6
+ let result = (() => {
7
+ const __$1 = app.logics.logic2();
8
+ return __$1.a;
9
+ })();
10
+
11
+ nasl.core.assign(result, app.logics.logic2().a);
12
+ return result;
13
+ /* -----以下是 returns 的默认值草稿------ */
14
+ }
15
+ "
16
+ `;
17
+
18
+ exports[`logic:toEmbeddedTS variable-host-call-logic-nested-member-expression copy 1`] = `
19
+ "export function logic3() {
20
+ // @ts-ignore
21
+ let result = (() => {
22
+ const __$1 = app.logics.logic4(
23
+ (() => {
24
+ const __$1 = app.logics.logic2();
25
+ return __$1.b;
26
+ })()
27
+ );
28
+ return __$1.a;
29
+ })();
30
+
31
+ nasl.core.assign(result, app.logics.logic4(app.logics.logic2().b).a);
32
+ return result;
33
+ /* -----以下是 returns 的默认值草稿------ */
34
+ }
35
+ "
36
+ `;
37
+
38
+ exports[`logic:toEmbeddedTS variable-host-call-logic-with-handle-error-member-expression 1`] = `
39
+ "export function logic3() {
40
+ // @ts-ignore
41
+ let result = (() => {
42
+ const __$1 = (() => {
43
+ const __wrapper = nasl.util.autoHandleError(app.logics.logic2);
44
+ return __wrapper();
45
+ })();
46
+ return __$1.a;
47
+ })();
48
+
49
+ nasl.core.assign(
50
+ result,
51
+ (() => {
52
+ const __wrapper = nasl.util.autoHandleError(app.logics.logic2);
53
+ return __wrapper();
54
+ })().a
55
+ );
56
+ return result;
57
+ /* -----以下是 returns 的默认值草稿------ */
58
+ }
59
+ "
60
+ `;
61
+
62
+ exports[`logic:toEmbeddedTS variable-host-call-query-conponent 1`] = `
63
+ "export function logic2(): {
64
+ list: nasl.collection.List<{
65
+ entity1: app.dataSources.defaultDS.entities.Entity1;
66
+ __name: \\"AStructure_62305639\\";
67
+ }>;
68
+ total: nasl.core.Long;
69
+ __name: \\"AStructure_7d582107\\";
70
+ } {
71
+ let result: {
72
+ list: nasl.collection.List<{
73
+ entity1: app.dataSources.defaultDS.entities.Entity1;
74
+ __name: \\"AStructure_62305639\\";
75
+ }>;
76
+ total: nasl.core.Long;
77
+ __name: \\"AStructure_7d582107\\";
78
+ };
79
+
80
+ nasl.core.assign(
81
+ result,
82
+ nasl.util.paginateLimit(
83
+ (function (): nasl.collection.List<{
84
+ entity1: app.dataSources.defaultDS.entities.Entity1;
85
+ __name: \\"AStructure_62305639\\";
86
+ }> {
87
+ nasl.langUtil
88
+ .FROM(
89
+ new nasl.langUtil.Collection<
90
+ [app.dataSources.defaultDS.entities.Entity1]
91
+ >()
92
+ )
93
+ .SELECT(() => new app.dataSources.defaultDS.entities.Entity1())
94
+ .ORDER_BY(() => [
95
+ new app.dataSources.defaultDS.entities.Entity1().createdTime,
96
+ new nasl.core.String(\\"StringLiteral\\"),
97
+ ]);
98
+ return;
99
+ })(),
100
+ new nasl.core.Long(10),
101
+ new nasl.core.Long(10)
102
+ )
103
+ );
104
+ return result;
105
+ /* -----以下是 returns 的默认值草稿------ */
106
+ }
107
+ "
108
+ `;
109
+
110
+ exports[`logic:toEmbeddedTS variable-host-call-query-conponent-wrapper 1`] = `
111
+ "export function logic2(): {
112
+ list: nasl.collection.List<{
113
+ entity1: app.dataSources.defaultDS.entities.Entity1;
114
+ __name: \\"AStructure_62305639\\";
115
+ }>;
116
+ total: nasl.core.Long;
117
+ __name: \\"AStructure_7d582107\\";
118
+ } {
119
+ let result: {
120
+ list: nasl.collection.List<{
121
+ entity1: app.dataSources.defaultDS.entities.Entity1;
122
+ __name: \\"AStructure_62305639\\";
123
+ }>;
124
+ total: nasl.core.Long;
125
+ __name: \\"AStructure_7d582107\\";
126
+ };
127
+
128
+ nasl.core.assign(
129
+ result,
130
+ nasl.util.paginateLimit(
131
+ (function (): nasl.collection.List<{
132
+ entity1: app.dataSources.defaultDS.entities.Entity1;
133
+ __name: \\"AStructure_62305639\\";
134
+ }> {
135
+ nasl.langUtil
136
+ .FROM(
137
+ new nasl.langUtil.Collection<
138
+ [app.dataSources.defaultDS.entities.Entity1]
139
+ >()
140
+ )
141
+ .SELECT(() => new app.dataSources.defaultDS.entities.Entity1())
142
+ .ORDER_BY(() => [
143
+ new app.dataSources.defaultDS.entities.Entity1().createdTime,
144
+ new nasl.core.String(\\"StringLiteral\\"),
145
+ ]);
146
+ return;
147
+ })(),
148
+ new nasl.core.Long(10),
149
+ new nasl.core.Long(10)
150
+ )
151
+ );
152
+ return result;
153
+ /* -----以下是 returns 的默认值草稿------ */
154
+ }
155
+ "
156
+ `;
157
+
158
+ exports[`logic:toEmbeddedTS with-annotation 1`] = `
159
+ "export function logic1(param1: nasl.core.String): nasl.core.String {
160
+ let result: nasl.core.String;
161
+
162
+ nasl.core.assign(result, param1);
163
+ return result;
164
+ /* -----以下是 returns 的默认值草稿------ */
165
+ /* -----以下是 params 的默认值草稿------ */
166
+ }
167
+ "
168
+ `;
169
+
170
+ exports[`logic:toEmbeddedTS with-annotation-with-default 1`] = `
171
+ "export function logic1(
172
+ param1: nasl.core.String = new nasl.core.String(\\"StringLiteral\\")
173
+ ): nasl.core.String {
174
+ let result: nasl.core.String;
175
+
176
+ nasl.core.assign(result, param1);
177
+ return result;
178
+ /* -----以下是 returns 的默认值草稿------ */
179
+ /* -----以下是 params 的默认值草稿------ */
180
+ }
181
+ "
182
+ `;
@@ -0,0 +1,5 @@
1
+ import { basename } from 'path';
2
+ import { getCases } from '../utils';
3
+
4
+ export const ConceptName = basename(__dirname);
5
+ export const cases = getCases(ConceptName);