@lcap/nasl 3.6.0-alpha.7 → 3.6.0-alpha.8

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 (934) hide show
  1. package/out/automate/engine/index.d.ts +4 -0
  2. package/out/automate/engine/index.js +443 -0
  3. package/out/automate/engine/index.js.map +1 -0
  4. package/out/automate/engine/operators.d.ts +26 -0
  5. package/out/automate/engine/operators.js +364 -0
  6. package/out/automate/engine/operators.js.map +1 -0
  7. package/out/automate/engine/uniqueName.d.ts +12 -0
  8. package/out/automate/engine/uniqueName.js +116 -0
  9. package/out/automate/engine/uniqueName.js.map +1 -0
  10. package/out/automate/engine/utils.d.ts +25 -0
  11. package/out/automate/engine/utils.js +440 -0
  12. package/out/automate/engine/utils.js.map +1 -0
  13. package/out/automate/engine/viewCache.d.ts +19 -0
  14. package/out/automate/engine/viewCache.js +45 -0
  15. package/out/automate/engine/viewCache.js.map +1 -0
  16. package/out/automate/template/myProcess.d.ts +10 -0
  17. package/out/automate/template/myProcess.js +11502 -0
  18. package/out/automate/template/myProcess.js.map +1 -0
  19. package/out/automate/upgrader/2.12.d.ts +7 -0
  20. package/out/automate/upgrader/2.12.js +63 -0
  21. package/out/automate/upgrader/2.12.js.map +1 -0
  22. package/out/automate/upgrader/2.14-components.d.ts +1115 -0
  23. package/out/automate/upgrader/2.14-components.js +1087 -0
  24. package/out/automate/upgrader/2.14-components.js.map +1 -0
  25. package/out/automate/upgrader/2.14.d.ts +10 -0
  26. package/out/automate/upgrader/2.14.js +236 -0
  27. package/out/automate/upgrader/2.14.js.map +1 -0
  28. package/out/automate/upgrader/2.14.old.d.ts +1 -0
  29. package/out/automate/upgrader/2.14.old.js +125 -0
  30. package/out/automate/upgrader/2.14.old.js.map +1 -0
  31. package/out/automate/upgrader/2.16.d.ts +10 -0
  32. package/out/automate/upgrader/2.16.js +75 -0
  33. package/out/automate/upgrader/2.16.js.map +1 -0
  34. package/out/automate/upgrader/2.17.d.ts +21 -0
  35. package/out/automate/upgrader/2.17.js +557 -0
  36. package/out/automate/upgrader/2.17.js.map +1 -0
  37. package/out/automate/upgrader/2.18.d.ts +10 -0
  38. package/out/automate/upgrader/2.18.js +107 -0
  39. package/out/automate/upgrader/2.18.js.map +1 -0
  40. package/out/automate/upgrader/2.20.d.ts +17 -0
  41. package/out/automate/upgrader/2.20.js +68 -0
  42. package/out/automate/upgrader/2.20.js.map +1 -0
  43. package/out/bak/translator.d.ts +1 -0
  44. package/out/bak/translator.js +305 -0
  45. package/out/bak/translator.js.map +1 -0
  46. package/out/breakpoint/generator/AfterStartNode.d.ts +7 -0
  47. package/out/breakpoint/generator/AfterStartNode.js +30 -0
  48. package/out/breakpoint/generator/AfterStartNode.js.map +1 -0
  49. package/out/breakpoint/generator/BeforeEndNode.d.ts +7 -0
  50. package/out/breakpoint/generator/BeforeEndNode.js +28 -0
  51. package/out/breakpoint/generator/BeforeEndNode.js.map +1 -0
  52. package/out/breakpoint/generator/BreakpointNode.d.ts +18 -0
  53. package/out/breakpoint/generator/BreakpointNode.js +293 -0
  54. package/out/breakpoint/generator/BreakpointNode.js.map +1 -0
  55. package/out/breakpoint/generator/CallbackNode.d.ts +4 -0
  56. package/out/breakpoint/generator/CallbackNode.js +37 -0
  57. package/out/breakpoint/generator/CallbackNode.js.map +1 -0
  58. package/out/breakpoint/generator/FragmentNode.d.ts +4 -0
  59. package/out/breakpoint/generator/FragmentNode.js +18 -0
  60. package/out/breakpoint/generator/FragmentNode.js.map +1 -0
  61. package/out/breakpoint/generator/index.d.ts +4 -0
  62. package/out/breakpoint/generator/index.js +119 -0
  63. package/out/breakpoint/generator/index.js.map +1 -0
  64. package/out/breakpoint/index.d.ts +3 -0
  65. package/out/breakpoint/index.js +20 -0
  66. package/out/breakpoint/index.js.map +1 -0
  67. package/out/breakpoint/shared/constants.d.ts +37 -0
  68. package/out/breakpoint/shared/constants.js +108 -0
  69. package/out/breakpoint/shared/constants.js.map +1 -0
  70. package/out/breakpoint/shared/index.d.ts +3 -0
  71. package/out/breakpoint/shared/index.js +33 -0
  72. package/out/breakpoint/shared/index.js.map +1 -0
  73. package/out/breakpoint/shared/operations.d.ts +10 -0
  74. package/out/breakpoint/shared/operations.js +25 -0
  75. package/out/breakpoint/shared/operations.js.map +1 -0
  76. package/out/breakpoint/shared/socket.d.ts +48 -0
  77. package/out/breakpoint/shared/socket.js +257 -0
  78. package/out/breakpoint/shared/socket.js.map +1 -0
  79. package/out/breakpoint/shared/utils.d.ts +27 -0
  80. package/out/breakpoint/shared/utils.js +217 -0
  81. package/out/breakpoint/shared/utils.js.map +1 -0
  82. package/out/breakpoint/store/core.d.ts +80 -0
  83. package/out/breakpoint/store/core.js +416 -0
  84. package/out/breakpoint/store/core.js.map +1 -0
  85. package/out/breakpoint/store/dock.d.ts +1 -0
  86. package/out/breakpoint/store/dock.js +160 -0
  87. package/out/breakpoint/store/dock.js.map +1 -0
  88. package/out/breakpoint/store/index.d.ts +2 -0
  89. package/out/breakpoint/store/index.js +19 -0
  90. package/out/breakpoint/store/index.js.map +1 -0
  91. package/out/common/BaseNode.d.ts +377 -0
  92. package/out/common/BaseNode.js +1432 -0
  93. package/out/common/BaseNode.js.map +1 -0
  94. package/out/common/Command.d.ts +21 -0
  95. package/out/common/Command.js +79 -0
  96. package/out/common/Command.js.map +1 -0
  97. package/out/common/ComponentAPI.d.ts +112 -0
  98. package/out/common/ComponentAPI.js +3 -0
  99. package/out/common/ComponentAPI.js.map +1 -0
  100. package/out/common/EventEmitter.d.ts +61 -0
  101. package/out/common/EventEmitter.js +71 -0
  102. package/out/common/EventEmitter.js.map +1 -0
  103. package/out/common/Messager.d.ts +91 -0
  104. package/out/common/Messager.js +205 -0
  105. package/out/common/Messager.js.map +1 -0
  106. package/out/common/asyncFuncMap.d.ts +2 -0
  107. package/out/common/asyncFuncMap.js +16 -0
  108. package/out/common/asyncFuncMap.js.map +1 -0
  109. package/out/common/index.d.ts +4 -0
  110. package/out/common/index.js +21 -0
  111. package/out/common/index.js.map +1 -0
  112. package/out/common/utils.d.ts +2 -0
  113. package/out/common/utils.js +18 -0
  114. package/out/common/utils.js.map +1 -0
  115. package/out/concepts/Abort__.d.ts +28 -0
  116. package/out/concepts/Abort__.js +80 -0
  117. package/out/concepts/Abort__.js.map +1 -0
  118. package/out/concepts/AbstractInterface__.d.ts +22 -0
  119. package/out/concepts/AbstractInterface__.js +56 -0
  120. package/out/concepts/AbstractInterface__.js.map +1 -0
  121. package/out/concepts/Anchor__.d.ts +48 -0
  122. package/out/concepts/Anchor__.js +200 -0
  123. package/out/concepts/Anchor__.js.map +1 -0
  124. package/out/concepts/AnonymousFunction__.d.ts +180 -0
  125. package/out/concepts/AnonymousFunction__.js +555 -0
  126. package/out/concepts/AnonymousFunction__.js.map +1 -0
  127. package/out/concepts/App__.d.ts +1818 -0
  128. package/out/concepts/App__.js +2983 -0
  129. package/out/concepts/App__.js.map +1 -0
  130. package/out/concepts/Argument__.d.ts +70 -0
  131. package/out/concepts/Argument__.js +270 -0
  132. package/out/concepts/Argument__.js.map +1 -0
  133. package/out/concepts/Assignee__.d.ts +291 -0
  134. package/out/concepts/Assignee__.js +461 -0
  135. package/out/concepts/Assignee__.js.map +1 -0
  136. package/out/concepts/AssignmentLine__.d.ts +44 -0
  137. package/out/concepts/AssignmentLine__.js +114 -0
  138. package/out/concepts/AssignmentLine__.js.map +1 -0
  139. package/out/concepts/Assignment__.d.ts +77 -0
  140. package/out/concepts/Assignment__.js +338 -0
  141. package/out/concepts/Assignment__.js.map +1 -0
  142. package/out/concepts/Attribute__.d.ts +112 -0
  143. package/out/concepts/Attribute__.js +208 -0
  144. package/out/concepts/Attribute__.js.map +1 -0
  145. package/out/concepts/AuthInterface__.d.ts +38 -0
  146. package/out/concepts/AuthInterface__.js +74 -0
  147. package/out/concepts/AuthInterface__.js.map +1 -0
  148. package/out/concepts/AuthLogicForCallInterface__.d.ts +141 -0
  149. package/out/concepts/AuthLogicForCallInterface__.js +514 -0
  150. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -0
  151. package/out/concepts/AuthLogic__.d.ts +69 -0
  152. package/out/concepts/AuthLogic__.js +210 -0
  153. package/out/concepts/AuthLogic__.js.map +1 -0
  154. package/out/concepts/BackendVariable__.d.ts +145 -0
  155. package/out/concepts/BackendVariable__.js +502 -0
  156. package/out/concepts/BackendVariable__.js.map +1 -0
  157. package/out/concepts/Backend__.d.ts +134 -0
  158. package/out/concepts/Backend__.js +280 -0
  159. package/out/concepts/Backend__.js.map +1 -0
  160. package/out/concepts/BatchAssignment__.d.ts +255 -0
  161. package/out/concepts/BatchAssignment__.js +881 -0
  162. package/out/concepts/BatchAssignment__.js.map +1 -0
  163. package/out/concepts/BinaryExpression__.d.ts +76 -0
  164. package/out/concepts/BinaryExpression__.js +422 -0
  165. package/out/concepts/BinaryExpression__.js.map +1 -0
  166. package/out/concepts/BindAttribute__.d.ts +329 -0
  167. package/out/concepts/BindAttribute__.js +1130 -0
  168. package/out/concepts/BindAttribute__.js.map +1 -0
  169. package/out/concepts/BindDirective__.d.ts +170 -0
  170. package/out/concepts/BindDirective__.js +573 -0
  171. package/out/concepts/BindDirective__.js.map +1 -0
  172. package/out/concepts/BindEvent__.d.ts +254 -0
  173. package/out/concepts/BindEvent__.js +959 -0
  174. package/out/concepts/BindEvent__.js.map +1 -0
  175. package/out/concepts/BindStyle__.d.ts +142 -0
  176. package/out/concepts/BindStyle__.js +453 -0
  177. package/out/concepts/BindStyle__.js.map +1 -0
  178. package/out/concepts/Block__.d.ts +84 -0
  179. package/out/concepts/Block__.js +215 -0
  180. package/out/concepts/Block__.js.map +1 -0
  181. package/out/concepts/BooleanLiteral__.d.ts +38 -0
  182. package/out/concepts/BooleanLiteral__.js +97 -0
  183. package/out/concepts/BooleanLiteral__.js.map +1 -0
  184. package/out/concepts/BusinessComponent__.d.ts +641 -0
  185. package/out/concepts/BusinessComponent__.js +1944 -0
  186. package/out/concepts/BusinessComponent__.js.map +1 -0
  187. package/out/concepts/BusinessLogic__.d.ts +38 -0
  188. package/out/concepts/BusinessLogic__.js +358 -0
  189. package/out/concepts/BusinessLogic__.js.map +1 -0
  190. package/out/concepts/CallAuthInterface__.d.ts +130 -0
  191. package/out/concepts/CallAuthInterface__.js +438 -0
  192. package/out/concepts/CallAuthInterface__.js.map +1 -0
  193. package/out/concepts/CallConnector__.d.ts +49 -0
  194. package/out/concepts/CallConnector__.js +257 -0
  195. package/out/concepts/CallConnector__.js.map +1 -0
  196. package/out/concepts/CallEvent__.d.ts +101 -0
  197. package/out/concepts/CallEvent__.js +280 -0
  198. package/out/concepts/CallEvent__.js.map +1 -0
  199. package/out/concepts/CallFunction__.d.ts +162 -0
  200. package/out/concepts/CallFunction__.js +600 -0
  201. package/out/concepts/CallFunction__.js.map +1 -0
  202. package/out/concepts/CallInterface__.d.ts +136 -0
  203. package/out/concepts/CallInterface__.js +814 -0
  204. package/out/concepts/CallInterface__.js.map +1 -0
  205. package/out/concepts/CallLogic__.d.ts +235 -0
  206. package/out/concepts/CallLogic__.js +1361 -0
  207. package/out/concepts/CallLogic__.js.map +1 -0
  208. package/out/concepts/CallQueryComponent__.d.ts +435 -0
  209. package/out/concepts/CallQueryComponent__.js +1235 -0
  210. package/out/concepts/CallQueryComponent__.js.map +1 -0
  211. package/out/concepts/Comment__.d.ts +35 -0
  212. package/out/concepts/Comment__.js +94 -0
  213. package/out/concepts/Comment__.js.map +1 -0
  214. package/out/concepts/CompletionProperty__.d.ts +107 -0
  215. package/out/concepts/CompletionProperty__.js +239 -0
  216. package/out/concepts/CompletionProperty__.js.map +1 -0
  217. package/out/concepts/ConfigGroup__.d.ts +127 -0
  218. package/out/concepts/ConfigGroup__.js +258 -0
  219. package/out/concepts/ConfigGroup__.js.map +1 -0
  220. package/out/concepts/ConfigPropertyValue__.d.ts +47 -0
  221. package/out/concepts/ConfigPropertyValue__.js +93 -0
  222. package/out/concepts/ConfigPropertyValue__.js.map +1 -0
  223. package/out/concepts/ConfigProperty__.d.ts +153 -0
  224. package/out/concepts/ConfigProperty__.js +321 -0
  225. package/out/concepts/ConfigProperty__.js.map +1 -0
  226. package/out/concepts/Configuration__.d.ts +126 -0
  227. package/out/concepts/Configuration__.js +236 -0
  228. package/out/concepts/Configuration__.js.map +1 -0
  229. package/out/concepts/Connection__.d.ts +165 -0
  230. package/out/concepts/Connection__.js +330 -0
  231. package/out/concepts/Connection__.js.map +1 -0
  232. package/out/concepts/ConnectorTrigger__.d.ts +81 -0
  233. package/out/concepts/ConnectorTrigger__.js +138 -0
  234. package/out/concepts/ConnectorTrigger__.js.map +1 -0
  235. package/out/concepts/Connector__.d.ts +929 -0
  236. package/out/concepts/Connector__.js +1343 -0
  237. package/out/concepts/Connector__.js.map +1 -0
  238. package/out/concepts/Constant__.d.ts +121 -0
  239. package/out/concepts/Constant__.js +331 -0
  240. package/out/concepts/Constant__.js.map +1 -0
  241. package/out/concepts/CountersignPolicy__.d.ts +28 -0
  242. package/out/concepts/CountersignPolicy__.js +62 -0
  243. package/out/concepts/CountersignPolicy__.js.map +1 -0
  244. package/out/concepts/DataSource__.d.ts +168 -0
  245. package/out/concepts/DataSource__.js +460 -0
  246. package/out/concepts/DataSource__.js.map +1 -0
  247. package/out/concepts/DatabaseTypeAnnotation__.d.ts +34 -0
  248. package/out/concepts/DatabaseTypeAnnotation__.js +65 -0
  249. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -0
  250. package/out/concepts/DefaultValue__.d.ts +104 -0
  251. package/out/concepts/DefaultValue__.js +242 -0
  252. package/out/concepts/DefaultValue__.js.map +1 -0
  253. package/out/concepts/Destination__.d.ts +160 -0
  254. package/out/concepts/Destination__.js +799 -0
  255. package/out/concepts/Destination__.js.map +1 -0
  256. package/out/concepts/End__.d.ts +27 -0
  257. package/out/concepts/End__.js +115 -0
  258. package/out/concepts/End__.js.map +1 -0
  259. package/out/concepts/EntityIndex__.d.ts +98 -0
  260. package/out/concepts/EntityIndex__.js +201 -0
  261. package/out/concepts/EntityIndex__.js.map +1 -0
  262. package/out/concepts/EntityProperty__.d.ts +293 -0
  263. package/out/concepts/EntityProperty__.js +824 -0
  264. package/out/concepts/EntityProperty__.js.map +1 -0
  265. package/out/concepts/Entity__.d.ts +339 -0
  266. package/out/concepts/Entity__.js +764 -0
  267. package/out/concepts/Entity__.js.map +1 -0
  268. package/out/concepts/EnumItem__.d.ts +67 -0
  269. package/out/concepts/EnumItem__.js +131 -0
  270. package/out/concepts/EnumItem__.js.map +1 -0
  271. package/out/concepts/Enum__.d.ts +138 -0
  272. package/out/concepts/Enum__.js +321 -0
  273. package/out/concepts/Enum__.js.map +1 -0
  274. package/out/concepts/Event__.d.ts +160 -0
  275. package/out/concepts/Event__.js +294 -0
  276. package/out/concepts/Event__.js.map +1 -0
  277. package/out/concepts/ExternalDestination__.d.ts +78 -0
  278. package/out/concepts/ExternalDestination__.js +309 -0
  279. package/out/concepts/ExternalDestination__.js.map +1 -0
  280. package/out/concepts/ForEachStatement__.d.ts +173 -0
  281. package/out/concepts/ForEachStatement__.js +497 -0
  282. package/out/concepts/ForEachStatement__.js.map +1 -0
  283. package/out/concepts/FrontendLibrary__.d.ts +216 -0
  284. package/out/concepts/FrontendLibrary__.js +364 -0
  285. package/out/concepts/FrontendLibrary__.js.map +1 -0
  286. package/out/concepts/FrontendType__.d.ts +308 -0
  287. package/out/concepts/FrontendType__.js +606 -0
  288. package/out/concepts/FrontendType__.js.map +1 -0
  289. package/out/concepts/FrontendVariable__.d.ts +36 -0
  290. package/out/concepts/FrontendVariable__.js +77 -0
  291. package/out/concepts/FrontendVariable__.js.map +1 -0
  292. package/out/concepts/Frontend__.d.ts +420 -0
  293. package/out/concepts/Frontend__.js +915 -0
  294. package/out/concepts/Frontend__.js.map +1 -0
  295. package/out/concepts/Function__.d.ts +420 -0
  296. package/out/concepts/Function__.js +805 -0
  297. package/out/concepts/Function__.js.map +1 -0
  298. package/out/concepts/I18nInfo__.d.ts +46 -0
  299. package/out/concepts/I18nInfo__.js +90 -0
  300. package/out/concepts/I18nInfo__.js.map +1 -0
  301. package/out/concepts/Identifier__.d.ts +59 -0
  302. package/out/concepts/Identifier__.js +326 -0
  303. package/out/concepts/Identifier__.js.map +1 -0
  304. package/out/concepts/IfStatement__.d.ts +161 -0
  305. package/out/concepts/IfStatement__.js +372 -0
  306. package/out/concepts/IfStatement__.js.map +1 -0
  307. package/out/concepts/ImportedInterface__.d.ts +20 -0
  308. package/out/concepts/ImportedInterface__.js +48 -0
  309. package/out/concepts/ImportedInterface__.js.map +1 -0
  310. package/out/concepts/Integration__.d.ts +146 -0
  311. package/out/concepts/Integration__.js +296 -0
  312. package/out/concepts/Integration__.js.map +1 -0
  313. package/out/concepts/InterfaceParam__.d.ts +146 -0
  314. package/out/concepts/InterfaceParam__.js +342 -0
  315. package/out/concepts/InterfaceParam__.js.map +1 -0
  316. package/out/concepts/Interface__.d.ts +328 -0
  317. package/out/concepts/Interface__.js +892 -0
  318. package/out/concepts/Interface__.js.map +1 -0
  319. package/out/concepts/JSBlock__.d.ts +37 -0
  320. package/out/concepts/JSBlock__.js +104 -0
  321. package/out/concepts/JSBlock__.js.map +1 -0
  322. package/out/concepts/JavaLogic__.d.ts +45 -0
  323. package/out/concepts/JavaLogic__.js +109 -0
  324. package/out/concepts/JavaLogic__.js.map +1 -0
  325. package/out/concepts/LogicItem__.d.ts +155 -0
  326. package/out/concepts/LogicItem__.js +284 -0
  327. package/out/concepts/LogicItem__.js.map +1 -0
  328. package/out/concepts/Logic__.d.ts +649 -0
  329. package/out/concepts/Logic__.js +1939 -0
  330. package/out/concepts/Logic__.js.map +1 -0
  331. package/out/concepts/MatchCase__.d.ts +261 -0
  332. package/out/concepts/MatchCase__.js +706 -0
  333. package/out/concepts/MatchCase__.js.map +1 -0
  334. package/out/concepts/Match__.d.ts +127 -0
  335. package/out/concepts/Match__.js +731 -0
  336. package/out/concepts/Match__.js.map +1 -0
  337. package/out/concepts/MemberExpression__.d.ts +80 -0
  338. package/out/concepts/MemberExpression__.js +529 -0
  339. package/out/concepts/MemberExpression__.js.map +1 -0
  340. package/out/concepts/MetadataType__.d.ts +236 -0
  341. package/out/concepts/MetadataType__.js +464 -0
  342. package/out/concepts/MetadataType__.js.map +1 -0
  343. package/out/concepts/MicroApp__.d.ts +54 -0
  344. package/out/concepts/MicroApp__.js +80 -0
  345. package/out/concepts/MicroApp__.js.map +1 -0
  346. package/out/concepts/Module__.d.ts +1171 -0
  347. package/out/concepts/Module__.js +1747 -0
  348. package/out/concepts/Module__.js.map +1 -0
  349. package/out/concepts/MsgTriggerEvent__.d.ts +140 -0
  350. package/out/concepts/MsgTriggerEvent__.js +236 -0
  351. package/out/concepts/MsgTriggerEvent__.js.map +1 -0
  352. package/out/concepts/MsgTriggerLauncher__.d.ts +129 -0
  353. package/out/concepts/MsgTriggerLauncher__.js +226 -0
  354. package/out/concepts/MsgTriggerLauncher__.js.map +1 -0
  355. package/out/concepts/MultiApprovalPolicy__.d.ts +26 -0
  356. package/out/concepts/MultiApprovalPolicy__.js +59 -0
  357. package/out/concepts/MultiApprovalPolicy__.js.map +1 -0
  358. package/out/concepts/Namespace__.d.ts +1086 -0
  359. package/out/concepts/Namespace__.js +1555 -0
  360. package/out/concepts/Namespace__.js.map +1 -0
  361. package/out/concepts/NewComposite__.d.ts +353 -0
  362. package/out/concepts/NewComposite__.js +1277 -0
  363. package/out/concepts/NewComposite__.js.map +1 -0
  364. package/out/concepts/NewList__.d.ts +141 -0
  365. package/out/concepts/NewList__.js +470 -0
  366. package/out/concepts/NewList__.js.map +1 -0
  367. package/out/concepts/NewMap__.d.ts +231 -0
  368. package/out/concepts/NewMap__.js +604 -0
  369. package/out/concepts/NewMap__.js.map +1 -0
  370. package/out/concepts/New__.d.ts +23 -0
  371. package/out/concepts/New__.js +65 -0
  372. package/out/concepts/New__.js.map +1 -0
  373. package/out/concepts/NullLiteral__.d.ts +29 -0
  374. package/out/concepts/NullLiteral__.js +77 -0
  375. package/out/concepts/NullLiteral__.js.map +1 -0
  376. package/out/concepts/NumericLiteral__.d.ts +59 -0
  377. package/out/concepts/NumericLiteral__.js +177 -0
  378. package/out/concepts/NumericLiteral__.js.map +1 -0
  379. package/out/concepts/OqlQueryComponent__.d.ts +76 -0
  380. package/out/concepts/OqlQueryComponent__.js +351 -0
  381. package/out/concepts/OqlQueryComponent__.js.map +1 -0
  382. package/out/concepts/OverriddenLogic__.d.ts +634 -0
  383. package/out/concepts/OverriddenLogic__.js +1661 -0
  384. package/out/concepts/OverriddenLogic__.js.map +1 -0
  385. package/out/concepts/Paginate__.d.ts +97 -0
  386. package/out/concepts/Paginate__.js +267 -0
  387. package/out/concepts/Paginate__.js.map +1 -0
  388. package/out/concepts/ParamWithGroup__.d.ts +39 -0
  389. package/out/concepts/ParamWithGroup__.js +85 -0
  390. package/out/concepts/ParamWithGroup__.js.map +1 -0
  391. package/out/concepts/Param__.d.ts +182 -0
  392. package/out/concepts/Param__.js +524 -0
  393. package/out/concepts/Param__.js.map +1 -0
  394. package/out/concepts/Point__.d.ts +34 -0
  395. package/out/concepts/Point__.js +65 -0
  396. package/out/concepts/Point__.js.map +1 -0
  397. package/out/concepts/ProcessComponent__.d.ts +222 -0
  398. package/out/concepts/ProcessComponent__.js +340 -0
  399. package/out/concepts/ProcessComponent__.js.map +1 -0
  400. package/out/concepts/ProcessElement__.d.ts +665 -0
  401. package/out/concepts/ProcessElement__.js +1354 -0
  402. package/out/concepts/ProcessElement__.js.map +1 -0
  403. package/out/concepts/ProcessOutcome__.d.ts +34 -0
  404. package/out/concepts/ProcessOutcome__.js +97 -0
  405. package/out/concepts/ProcessOutcome__.js.map +1 -0
  406. package/out/concepts/ProcessOutcomes__.d.ts +34 -0
  407. package/out/concepts/ProcessOutcomes__.js +104 -0
  408. package/out/concepts/ProcessOutcomes__.js.map +1 -0
  409. package/out/concepts/Process__.d.ts +615 -0
  410. package/out/concepts/Process__.js +1117 -0
  411. package/out/concepts/Process__.js.map +1 -0
  412. package/out/concepts/QueryAggregateExpression__.d.ts +54 -0
  413. package/out/concepts/QueryAggregateExpression__.js +140 -0
  414. package/out/concepts/QueryAggregateExpression__.js.map +1 -0
  415. package/out/concepts/QueryFieldExpression__.d.ts +56 -0
  416. package/out/concepts/QueryFieldExpression__.js +142 -0
  417. package/out/concepts/QueryFieldExpression__.js.map +1 -0
  418. package/out/concepts/QueryFromExpression__.d.ts +101 -0
  419. package/out/concepts/QueryFromExpression__.js +227 -0
  420. package/out/concepts/QueryFromExpression__.js.map +1 -0
  421. package/out/concepts/QueryGroupByExpression__.d.ts +50 -0
  422. package/out/concepts/QueryGroupByExpression__.js +142 -0
  423. package/out/concepts/QueryGroupByExpression__.js.map +1 -0
  424. package/out/concepts/QueryJoinExpression__.d.ts +188 -0
  425. package/out/concepts/QueryJoinExpression__.js +327 -0
  426. package/out/concepts/QueryJoinExpression__.js.map +1 -0
  427. package/out/concepts/QueryLimitExpression__.d.ts +60 -0
  428. package/out/concepts/QueryLimitExpression__.js +159 -0
  429. package/out/concepts/QueryLimitExpression__.js.map +1 -0
  430. package/out/concepts/QueryOrderByExpression__.d.ts +71 -0
  431. package/out/concepts/QueryOrderByExpression__.js +172 -0
  432. package/out/concepts/QueryOrderByExpression__.js.map +1 -0
  433. package/out/concepts/QuerySelectExpression__.d.ts +206 -0
  434. package/out/concepts/QuerySelectExpression__.js +308 -0
  435. package/out/concepts/QuerySelectExpression__.js.map +1 -0
  436. package/out/concepts/Rect__.d.ts +42 -0
  437. package/out/concepts/Rect__.js +71 -0
  438. package/out/concepts/Rect__.js.map +1 -0
  439. package/out/concepts/Return__.d.ts +147 -0
  440. package/out/concepts/Return__.js +429 -0
  441. package/out/concepts/Return__.js.map +1 -0
  442. package/out/concepts/Role__.d.ts +62 -0
  443. package/out/concepts/Role__.js +151 -0
  444. package/out/concepts/Role__.js.map +1 -0
  445. package/out/concepts/SelectMembers__.d.ts +145 -0
  446. package/out/concepts/SelectMembers__.js +300 -0
  447. package/out/concepts/SelectMembers__.js.map +1 -0
  448. package/out/concepts/SequentialPolicy__.d.ts +20 -0
  449. package/out/concepts/SequentialPolicy__.js +48 -0
  450. package/out/concepts/SequentialPolicy__.js.map +1 -0
  451. package/out/concepts/Slot__.d.ts +77 -0
  452. package/out/concepts/Slot__.js +141 -0
  453. package/out/concepts/Slot__.js.map +1 -0
  454. package/out/concepts/SqlQueryComponent__.d.ts +74 -0
  455. package/out/concepts/SqlQueryComponent__.js +269 -0
  456. package/out/concepts/SqlQueryComponent__.js.map +1 -0
  457. package/out/concepts/Start__.d.ts +27 -0
  458. package/out/concepts/Start__.js +69 -0
  459. package/out/concepts/Start__.js.map +1 -0
  460. package/out/concepts/StaticString__.d.ts +49 -0
  461. package/out/concepts/StaticString__.js +91 -0
  462. package/out/concepts/StaticString__.js.map +1 -0
  463. package/out/concepts/StringInterpolation__.d.ts +118 -0
  464. package/out/concepts/StringInterpolation__.js +284 -0
  465. package/out/concepts/StringInterpolation__.js.map +1 -0
  466. package/out/concepts/StringLiteral__.d.ts +45 -0
  467. package/out/concepts/StringLiteral__.js +159 -0
  468. package/out/concepts/StringLiteral__.js.map +1 -0
  469. package/out/concepts/StructureProperty__.d.ts +154 -0
  470. package/out/concepts/StructureProperty__.js +338 -0
  471. package/out/concepts/StructureProperty__.js.map +1 -0
  472. package/out/concepts/Structure__.d.ts +250 -0
  473. package/out/concepts/Structure__.js +508 -0
  474. package/out/concepts/Structure__.js.map +1 -0
  475. package/out/concepts/SwitchCase__.d.ts +97 -0
  476. package/out/concepts/SwitchCase__.js +305 -0
  477. package/out/concepts/SwitchCase__.js.map +1 -0
  478. package/out/concepts/SwitchStatement__.d.ts +87 -0
  479. package/out/concepts/SwitchStatement__.js +234 -0
  480. package/out/concepts/SwitchStatement__.js.map +1 -0
  481. package/out/concepts/Theme__.d.ts +40 -0
  482. package/out/concepts/Theme__.js +84 -0
  483. package/out/concepts/Theme__.js.map +1 -0
  484. package/out/concepts/Transactional__.d.ts +90 -0
  485. package/out/concepts/Transactional__.js +149 -0
  486. package/out/concepts/Transactional__.js.map +1 -0
  487. package/out/concepts/TriggerEvent__.d.ts +54 -0
  488. package/out/concepts/TriggerEvent__.js +137 -0
  489. package/out/concepts/TriggerEvent__.js.map +1 -0
  490. package/out/concepts/TriggerLauncher__.d.ts +81 -0
  491. package/out/concepts/TriggerLauncher__.js +197 -0
  492. package/out/concepts/TriggerLauncher__.js.map +1 -0
  493. package/out/concepts/TypeAnnotation__.d.ts +305 -0
  494. package/out/concepts/TypeAnnotation__.js +1095 -0
  495. package/out/concepts/TypeAnnotation__.js.map +1 -0
  496. package/out/concepts/TypeParam__.d.ts +28 -0
  497. package/out/concepts/TypeParam__.js +71 -0
  498. package/out/concepts/TypeParam__.js.map +1 -0
  499. package/out/concepts/UnaryExpression__.d.ts +52 -0
  500. package/out/concepts/UnaryExpression__.js +191 -0
  501. package/out/concepts/UnaryExpression__.js.map +1 -0
  502. package/out/concepts/Unparsed__.d.ts +36 -0
  503. package/out/concepts/Unparsed__.js +91 -0
  504. package/out/concepts/Unparsed__.js.map +1 -0
  505. package/out/concepts/UseComponent__.d.ts +34 -0
  506. package/out/concepts/UseComponent__.js +65 -0
  507. package/out/concepts/UseComponent__.js.map +1 -0
  508. package/out/concepts/ValidationRule__.d.ts +152 -0
  509. package/out/concepts/ValidationRule__.js +535 -0
  510. package/out/concepts/ValidationRule__.js.map +1 -0
  511. package/out/concepts/Variable__.d.ts +164 -0
  512. package/out/concepts/Variable__.js +505 -0
  513. package/out/concepts/Variable__.js.map +1 -0
  514. package/out/concepts/ViewBlock__.d.ts +38 -0
  515. package/out/concepts/ViewBlock__.js +68 -0
  516. package/out/concepts/ViewBlock__.js.map +1 -0
  517. package/out/concepts/ViewComponent__.d.ts +568 -0
  518. package/out/concepts/ViewComponent__.js +809 -0
  519. package/out/concepts/ViewComponent__.js.map +1 -0
  520. package/out/concepts/ViewElement__.d.ts +656 -0
  521. package/out/concepts/ViewElement__.js +2727 -0
  522. package/out/concepts/ViewElement__.js.map +1 -0
  523. package/out/concepts/View__.d.ts +747 -0
  524. package/out/concepts/View__.js +2633 -0
  525. package/out/concepts/View__.js.map +1 -0
  526. package/out/concepts/WhileStatement__.d.ts +100 -0
  527. package/out/concepts/WhileStatement__.js +269 -0
  528. package/out/concepts/WhileStatement__.js.map +1 -0
  529. package/out/concepts/basics/constants.d.ts +1 -0
  530. package/out/concepts/basics/constants.js +6 -0
  531. package/out/concepts/basics/constants.js.map +1 -0
  532. package/out/concepts/basics/stdlib/index.d.ts +16 -0
  533. package/out/concepts/basics/stdlib/index.js +90 -0
  534. package/out/concepts/basics/stdlib/index.js.map +1 -0
  535. package/out/concepts/basics/stdlib/nasl.auth.d.ts +9 -0
  536. package/out/concepts/basics/stdlib/nasl.auth.js +206 -0
  537. package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -0
  538. package/out/concepts/basics/stdlib/nasl.browser.d.ts +5 -0
  539. package/out/concepts/basics/stdlib/nasl.browser.js +158 -0
  540. package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -0
  541. package/out/concepts/basics/stdlib/nasl.collection.d.ts +9 -0
  542. package/out/concepts/basics/stdlib/nasl.collection.js +57 -0
  543. package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -0
  544. package/out/concepts/basics/stdlib/nasl.configuration.d.ts +5 -0
  545. package/out/concepts/basics/stdlib/nasl.configuration.js +65 -0
  546. package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -0
  547. package/out/concepts/basics/stdlib/nasl.core.d.ts +7 -0
  548. package/out/concepts/basics/stdlib/nasl.core.js +47 -0
  549. package/out/concepts/basics/stdlib/nasl.core.js.map +1 -0
  550. package/out/concepts/basics/stdlib/nasl.event.d.ts +5 -0
  551. package/out/concepts/basics/stdlib/nasl.event.js +34 -0
  552. package/out/concepts/basics/stdlib/nasl.event.js.map +1 -0
  553. package/out/concepts/basics/stdlib/nasl.http.d.ts +9 -0
  554. package/out/concepts/basics/stdlib/nasl.http.js +174 -0
  555. package/out/concepts/basics/stdlib/nasl.http.js.map +1 -0
  556. package/out/concepts/basics/stdlib/nasl.interface.d.ts +9 -0
  557. package/out/concepts/basics/stdlib/nasl.interface.js +49 -0
  558. package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -0
  559. package/out/concepts/basics/stdlib/nasl.io.d.ts +5 -0
  560. package/out/concepts/basics/stdlib/nasl.io.js +61 -0
  561. package/out/concepts/basics/stdlib/nasl.io.js.map +1 -0
  562. package/out/concepts/basics/stdlib/nasl.logging.d.ts +5 -0
  563. package/out/concepts/basics/stdlib/nasl.logging.js +65 -0
  564. package/out/concepts/basics/stdlib/nasl.logging.js.map +1 -0
  565. package/out/concepts/basics/stdlib/nasl.process.d.ts +9 -0
  566. package/out/concepts/basics/stdlib/nasl.process.js +643 -0
  567. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -0
  568. package/out/concepts/basics/stdlib/nasl.ui.d.ts +9 -0
  569. package/out/concepts/basics/stdlib/nasl.ui.js +1038 -0
  570. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -0
  571. package/out/concepts/basics/stdlib/nasl.util.d.ts +6 -0
  572. package/out/concepts/basics/stdlib/nasl.util.js +2285 -0
  573. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -0
  574. package/out/concepts/basics/stdlib/nasl.validation.d.ts +5 -0
  575. package/out/concepts/basics/stdlib/nasl.validation.js +574 -0
  576. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -0
  577. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts +4 -0
  578. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +47 -0
  579. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -0
  580. package/out/concepts/basics/stdlib/timeZone.d.ts +5 -0
  581. package/out/concepts/basics/stdlib/timeZone.js +196 -0
  582. package/out/concepts/basics/stdlib/timeZone.js.map +1 -0
  583. package/out/concepts/basics/types/coreTypeList.d.ts +2 -0
  584. package/out/concepts/basics/types/coreTypeList.js +15 -0
  585. package/out/concepts/basics/types/coreTypeList.js.map +1 -0
  586. package/out/concepts/basics/types/index.d.ts +16 -0
  587. package/out/concepts/basics/types/index.js +35 -0
  588. package/out/concepts/basics/types/index.js.map +1 -0
  589. package/out/concepts/index.d.ts +7 -0
  590. package/out/concepts/index.js +41 -0
  591. package/out/concepts/index.js.map +1 -0
  592. package/out/concepts/index__.d.ts +138 -0
  593. package/out/concepts/index__.js +155 -0
  594. package/out/concepts/index__.js.map +1 -0
  595. package/out/concepts/types__.d.ts +0 -0
  596. package/out/concepts/types__.js +1 -0
  597. package/out/concepts/types__.js.map +1 -0
  598. package/out/concepts/utils/asserts.d.ts +6982 -0
  599. package/out/concepts/utils/asserts.js +9276 -0
  600. package/out/concepts/utils/asserts.js.map +1 -0
  601. package/out/concepts/utils/quick-info.d.ts +13 -0
  602. package/out/concepts/utils/quick-info.js +51 -0
  603. package/out/concepts/utils/quick-info.js.map +1 -0
  604. package/out/concepts/utils/types.d.ts +450 -0
  605. package/out/concepts/utils/types.js +3 -0
  606. package/out/concepts/utils/types.js.map +1 -0
  607. package/out/config.d.ts +43 -0
  608. package/out/config.js +72 -0
  609. package/out/config.js.map +1 -0
  610. package/out/decorators/index.d.ts +67 -0
  611. package/out/decorators/index.js +213 -0
  612. package/out/decorators/index.js.map +1 -0
  613. package/out/decorators/promise.d.ts +7 -0
  614. package/out/decorators/promise.js +28 -0
  615. package/out/decorators/promise.js.map +1 -0
  616. package/out/enums/KEYWORDS.d.ts +6 -0
  617. package/out/enums/KEYWORDS.js +1248 -0
  618. package/out/enums/KEYWORDS.js.map +1 -0
  619. package/out/enums/LEVEL_NAME_MAP.d.ts +26 -0
  620. package/out/enums/LEVEL_NAME_MAP.js +30 -0
  621. package/out/enums/LEVEL_NAME_MAP.js.map +1 -0
  622. package/out/eventBus.d.ts +3 -0
  623. package/out/eventBus.js +7 -0
  624. package/out/eventBus.js.map +1 -0
  625. package/out/generator/compileComponent.d.ts +11 -0
  626. package/out/generator/compileComponent.js +12 -0
  627. package/out/generator/compileComponent.js.map +1 -0
  628. package/out/generator/genBundleFiles.d.ts +37 -0
  629. package/out/generator/genBundleFiles.js +678 -0
  630. package/out/generator/genBundleFiles.js.map +1 -0
  631. package/out/generator/genHash.d.ts +7 -0
  632. package/out/generator/genHash.js +39 -0
  633. package/out/generator/genHash.js.map +1 -0
  634. package/out/generator/genMetaData.d.ts +31 -0
  635. package/out/generator/genMetaData.js +365 -0
  636. package/out/generator/genMetaData.js.map +1 -0
  637. package/out/generator/genReleaseBody.d.ts +72 -0
  638. package/out/generator/genReleaseBody.js +333 -0
  639. package/out/generator/genReleaseBody.js.map +1 -0
  640. package/out/generator/icestark.d.ts +2 -0
  641. package/out/generator/icestark.js +50 -0
  642. package/out/generator/icestark.js.map +1 -0
  643. package/out/generator/index.d.ts +7 -0
  644. package/out/generator/index.js +24 -0
  645. package/out/generator/index.js.map +1 -0
  646. package/out/generator/microApp.d.ts +2 -0
  647. package/out/generator/microApp.js +36 -0
  648. package/out/generator/microApp.js.map +1 -0
  649. package/out/generator/permission.d.ts +14 -0
  650. package/out/generator/permission.js +296 -0
  651. package/out/generator/permission.js.map +1 -0
  652. package/out/generator/qiankun.d.ts +2 -0
  653. package/out/generator/qiankun.js +54 -0
  654. package/out/generator/qiankun.js.map +1 -0
  655. package/out/generator/styleReplacer.d.ts +3 -0
  656. package/out/generator/styleReplacer.js +68 -0
  657. package/out/generator/styleReplacer.js.map +1 -0
  658. package/out/index.d.ts +13 -0
  659. package/out/index.js +67 -0
  660. package/out/index.js.map +1 -0
  661. package/out/manager/diagnostic.d.ts +35 -0
  662. package/out/manager/diagnostic.js +64 -0
  663. package/out/manager/diagnostic.js.map +1 -0
  664. package/out/manager/stepRecorder.d.ts +20 -0
  665. package/out/manager/stepRecorder.js +114 -0
  666. package/out/manager/stepRecorder.js.map +1 -0
  667. package/out/natural/componentData.d.ts +31 -0
  668. package/out/natural/componentData.js +85 -0
  669. package/out/natural/componentData.js.map +1 -0
  670. package/out/natural/genNaturalTS.d.ts +3 -0
  671. package/out/natural/genNaturalTS.js +87 -0
  672. package/out/natural/genNaturalTS.js.map +1 -0
  673. package/out/natural/index.d.ts +4 -0
  674. package/out/natural/index.js +21 -0
  675. package/out/natural/index.js.map +1 -0
  676. package/out/natural/naslStdlibMap.d.ts +1 -0
  677. package/out/natural/naslStdlibMap.js +35 -0
  678. package/out/natural/naslStdlibMap.js.map +1 -0
  679. package/out/natural/prompt/analyzeClaims.d.ts +1 -0
  680. package/out/natural/prompt/analyzeClaims.js +21 -0
  681. package/out/natural/prompt/analyzeClaims.js.map +1 -0
  682. package/out/natural/prompt/executeClaims.d.ts +1 -0
  683. package/out/natural/prompt/executeClaims.js +73 -0
  684. package/out/natural/prompt/executeClaims.js.map +1 -0
  685. package/out/natural/transformTSCode.d.ts +7 -0
  686. package/out/natural/transformTSCode.js +931 -0
  687. package/out/natural/transformTSCode.js.map +1 -0
  688. package/out/sentry/index.d.ts +34 -0
  689. package/out/sentry/index.js +149 -0
  690. package/out/sentry/index.js.map +1 -0
  691. package/out/server/createUiTs.d.ts +17 -0
  692. package/out/server/createUiTs.js +268 -0
  693. package/out/server/createUiTs.js.map +1 -0
  694. package/out/server/entity2LogicNamespace.d.ts +10 -0
  695. package/out/server/entity2LogicNamespace.js +382 -0
  696. package/out/server/entity2LogicNamespace.js.map +1 -0
  697. package/out/server/event.d.ts +30 -0
  698. package/out/server/event.js +151 -0
  699. package/out/server/event.js.map +1 -0
  700. package/out/server/extendBaseNode.d.ts +1 -0
  701. package/out/server/extendBaseNode.js +605 -0
  702. package/out/server/extendBaseNode.js.map +1 -0
  703. package/out/server/formatTsUtils.d.ts +36 -0
  704. package/out/server/formatTsUtils.js +854 -0
  705. package/out/server/formatTsUtils.js.map +1 -0
  706. package/out/server/getConnector.d.ts +14 -0
  707. package/out/server/getConnector.js +101 -0
  708. package/out/server/getConnector.js.map +1 -0
  709. package/out/server/getExtensionModules.d.ts +3 -0
  710. package/out/server/getExtensionModules.js +34 -0
  711. package/out/server/getExtensionModules.js.map +1 -0
  712. package/out/server/getFunctions.d.ts +3 -0
  713. package/out/server/getFunctions.js +20 -0
  714. package/out/server/getFunctions.js.map +1 -0
  715. package/out/server/getInterfaces.d.ts +2 -0
  716. package/out/server/getInterfaces.js +48 -0
  717. package/out/server/getInterfaces.js.map +1 -0
  718. package/out/server/getLogging.d.ts +1 -0
  719. package/out/server/getLogging.js +9 -0
  720. package/out/server/getLogging.js.map +1 -0
  721. package/out/server/getLogics.d.ts +5 -0
  722. package/out/server/getLogics.js +454 -0
  723. package/out/server/getLogics.js.map +1 -0
  724. package/out/server/getMemberIdentifier.d.ts +17 -0
  725. package/out/server/getMemberIdentifier.js +594 -0
  726. package/out/server/getMemberIdentifier.js.map +1 -0
  727. package/out/server/getProcessComponents.d.ts +2 -0
  728. package/out/server/getProcessComponents.js +13 -0
  729. package/out/server/getProcessComponents.js.map +1 -0
  730. package/out/server/getProcesses.d.ts +33 -0
  731. package/out/server/getProcesses.js +647 -0
  732. package/out/server/getProcesses.js.map +1 -0
  733. package/out/server/getScope.d.ts +13 -0
  734. package/out/server/getScope.js +61 -0
  735. package/out/server/getScope.js.map +1 -0
  736. package/out/server/getValidates.d.ts +3 -0
  737. package/out/server/getValidates.js +14 -0
  738. package/out/server/getValidates.js.map +1 -0
  739. package/out/server/index.d.ts +5 -0
  740. package/out/server/index.js +43 -0
  741. package/out/server/index.js.map +1 -0
  742. package/out/server/naslServer.d.ts +375 -0
  743. package/out/server/naslServer.js +4735 -0
  744. package/out/server/naslServer.js.map +1 -0
  745. package/out/server/naslStdlibMap.d.ts +2 -0
  746. package/out/server/naslStdlibMap.js +54 -0
  747. package/out/server/naslStdlibMap.js.map +1 -0
  748. package/out/server/process2LogicNamespace.d.ts +26 -0
  749. package/out/server/process2LogicNamespace.js +109 -0
  750. package/out/server/process2LogicNamespace.js.map +1 -0
  751. package/out/server/translator.d.ts +26 -0
  752. package/out/server/translator.js +847 -0
  753. package/out/server/translator.js.map +1 -0
  754. package/out/service/creator/add.configs.d.ts +1 -0
  755. package/out/service/creator/add.configs.js +103 -0
  756. package/out/service/creator/add.configs.js.map +1 -0
  757. package/out/service/creator/errHandles.d.ts +18 -0
  758. package/out/service/creator/errHandles.js +71 -0
  759. package/out/service/creator/errHandles.js.map +1 -0
  760. package/out/service/creator/index.d.ts +1 -0
  761. package/out/service/creator/index.js +87 -0
  762. package/out/service/creator/index.js.map +1 -0
  763. package/out/service/datasource/api.d.ts +12 -0
  764. package/out/service/datasource/api.js +14 -0
  765. package/out/service/datasource/api.js.map +1 -0
  766. package/out/service/datasource/index.d.ts +2 -0
  767. package/out/service/datasource/index.js +10 -0
  768. package/out/service/datasource/index.js.map +1 -0
  769. package/out/service/defaultErrorMessage.json +98 -0
  770. package/out/service/logic/api.d.ts +9 -0
  771. package/out/service/logic/api.js +11 -0
  772. package/out/service/logic/api.js.map +1 -0
  773. package/out/service/logic/checktypeSocket.d.ts +5 -0
  774. package/out/service/logic/checktypeSocket.js +55 -0
  775. package/out/service/logic/checktypeSocket.js.map +1 -0
  776. package/out/service/logic/index.d.ts +2 -0
  777. package/out/service/logic/index.js +10 -0
  778. package/out/service/logic/index.js.map +1 -0
  779. package/out/service/storage/api.d.ts +54 -0
  780. package/out/service/storage/api.js +42 -0
  781. package/out/service/storage/api.js.map +1 -0
  782. package/out/service/storage/index.d.ts +2 -0
  783. package/out/service/storage/index.js +10 -0
  784. package/out/service/storage/index.js.map +1 -0
  785. package/out/service/storage/init.d.ts +105 -0
  786. package/out/service/storage/init.js +1232 -0
  787. package/out/service/storage/init.js.map +1 -0
  788. package/out/service/storage/jsoner.d.ts +36 -0
  789. package/out/service/storage/jsoner.js +148 -0
  790. package/out/service/storage/jsoner.js.map +1 -0
  791. package/out/service/storage/map.d.ts +4 -0
  792. package/out/service/storage/map.js +54 -0
  793. package/out/service/storage/map.js.map +1 -0
  794. package/out/service/storage/service.d.ts +25 -0
  795. package/out/service/storage/service.js +80 -0
  796. package/out/service/storage/service.js.map +1 -0
  797. package/out/service/storage/storagePoint.d.ts +17 -0
  798. package/out/service/storage/storagePoint.js +76 -0
  799. package/out/service/storage/storagePoint.js.map +1 -0
  800. package/out/service/video/BaseService.d.ts +7 -0
  801. package/out/service/video/BaseService.js +61 -0
  802. package/out/service/video/BaseService.js.map +1 -0
  803. package/out/service/video/MainCallbackService.d.ts +12 -0
  804. package/out/service/video/MainCallbackService.js +183 -0
  805. package/out/service/video/MainCallbackService.js.map +1 -0
  806. package/out/service/video/VideoTranscribe.d.ts +15 -0
  807. package/out/service/video/VideoTranscribe.js +96 -0
  808. package/out/service/video/VideoTranscribe.js.map +1 -0
  809. package/out/service/video/publishService.d.ts +1 -0
  810. package/out/service/video/publishService.js +58 -0
  811. package/out/service/video/publishService.js.map +1 -0
  812. package/out/templator/genCallComponentLogic.d.ts +17 -0
  813. package/out/templator/genCallComponentLogic.js +29 -0
  814. package/out/templator/genCallComponentLogic.js.map +1 -0
  815. package/out/templator/genCreateBlock.d.ts +10 -0
  816. package/out/templator/genCreateBlock.js +372 -0
  817. package/out/templator/genCreateBlock.js.map +1 -0
  818. package/out/templator/genCurdEditMultipleKeyBlock.d.ts +8 -0
  819. package/out/templator/genCurdEditMultipleKeyBlock.js +527 -0
  820. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -0
  821. package/out/templator/genCurdMultipleKeyBlock.d.ts +61 -0
  822. package/out/templator/genCurdMultipleKeyBlock.js +1378 -0
  823. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -0
  824. package/out/templator/genEditTableBlock.d.ts +51 -0
  825. package/out/templator/genEditTableBlock.js +325 -0
  826. package/out/templator/genEditTableBlock.js.map +1 -0
  827. package/out/templator/genEnumSelectBlock.d.ts +10 -0
  828. package/out/templator/genEnumSelectBlock.js +53 -0
  829. package/out/templator/genEnumSelectBlock.js.map +1 -0
  830. package/out/templator/genGetBlock.d.ts +6 -0
  831. package/out/templator/genGetBlock.js +139 -0
  832. package/out/templator/genGetBlock.js.map +1 -0
  833. package/out/templator/genGridViewBlock.d.ts +55 -0
  834. package/out/templator/genGridViewBlock.js +359 -0
  835. package/out/templator/genGridViewBlock.js.map +1 -0
  836. package/out/templator/genListViewBlock.d.ts +19 -0
  837. package/out/templator/genListViewBlock.js +148 -0
  838. package/out/templator/genListViewBlock.js.map +1 -0
  839. package/out/templator/genQueryComponent.d.ts +34 -0
  840. package/out/templator/genQueryComponent.js +344 -0
  841. package/out/templator/genQueryComponent.js.map +1 -0
  842. package/out/templator/genSelectBlock.d.ts +45 -0
  843. package/out/templator/genSelectBlock.js +415 -0
  844. package/out/templator/genSelectBlock.js.map +1 -0
  845. package/out/templator/genTableBlock.d.ts +55 -0
  846. package/out/templator/genTableBlock.js +421 -0
  847. package/out/templator/genTableBlock.js.map +1 -0
  848. package/out/templator/genUpdateBlock.d.ts +6 -0
  849. package/out/templator/genUpdateBlock.js +414 -0
  850. package/out/templator/genUpdateBlock.js.map +1 -0
  851. package/out/templator/index.d.ts +19 -0
  852. package/out/templator/index.js +38 -0
  853. package/out/templator/index.js.map +1 -0
  854. package/out/templator/utils.d.ts +683 -0
  855. package/out/templator/utils.js +472 -0
  856. package/out/templator/utils.js.map +1 -0
  857. package/out/translator/constant.d.ts +6 -0
  858. package/out/translator/constant.js +10 -0
  859. package/out/translator/constant.js.map +1 -0
  860. package/out/translator/index.d.ts +3 -0
  861. package/out/translator/index.js +20 -0
  862. package/out/translator/index.js.map +1 -0
  863. package/out/translator/types.d.ts +49 -0
  864. package/out/translator/types.js +3 -0
  865. package/out/translator/types.js.map +1 -0
  866. package/out/translator/utils.d.ts +44 -0
  867. package/out/translator/utils.js +241 -0
  868. package/out/translator/utils.js.map +1 -0
  869. package/out/utils/cookie.d.ts +9 -0
  870. package/out/utils/cookie.js +62 -0
  871. package/out/utils/cookie.js.map +1 -0
  872. package/out/utils/env.d.ts +2 -0
  873. package/out/utils/env.js +6 -0
  874. package/out/utils/env.js.map +1 -0
  875. package/out/utils/i18nInfo.d.ts +5 -0
  876. package/out/utils/i18nInfo.js +36 -0
  877. package/out/utils/i18nInfo.js.map +1 -0
  878. package/out/utils/index.d.ts +61 -0
  879. package/out/utils/index.js +386 -0
  880. package/out/utils/index.js.map +1 -0
  881. package/out/utils/logger.d.ts +7 -0
  882. package/out/utils/logger.js +23 -0
  883. package/out/utils/logger.js.map +1 -0
  884. package/out/utils/sortTsString.d.ts +1 -0
  885. package/out/utils/sortTsString.js +44 -0
  886. package/out/utils/sortTsString.js.map +1 -0
  887. package/out/utils/string.d.ts +64 -0
  888. package/out/utils/string.js +153 -0
  889. package/out/utils/string.js.map +1 -0
  890. package/out/utils/time-slicing/constant.d.ts +35 -0
  891. package/out/utils/time-slicing/constant.js +40 -0
  892. package/out/utils/time-slicing/constant.js.map +1 -0
  893. package/out/utils/time-slicing/controller.d.ts +53 -0
  894. package/out/utils/time-slicing/controller.js +294 -0
  895. package/out/utils/time-slicing/controller.js.map +1 -0
  896. package/out/utils/time-slicing/index.d.ts +5 -0
  897. package/out/utils/time-slicing/index.js +26 -0
  898. package/out/utils/time-slicing/index.js.map +1 -0
  899. package/out/utils/time-slicing/page-state.d.ts +2 -0
  900. package/out/utils/time-slicing/page-state.js +14 -0
  901. package/out/utils/time-slicing/page-state.js.map +1 -0
  902. package/out/utils/time-slicing/performance.d.ts +11 -0
  903. package/out/utils/time-slicing/performance.js +50 -0
  904. package/out/utils/time-slicing/performance.js.map +1 -0
  905. package/out/utils/time-slicing/runner.d.ts +12 -0
  906. package/out/utils/time-slicing/runner.js +52 -0
  907. package/out/utils/time-slicing/runner.js.map +1 -0
  908. package/out/utils/time-slicing/tool.d.ts +24 -0
  909. package/out/utils/time-slicing/tool.js +47 -0
  910. package/out/utils/time-slicing/tool.js.map +1 -0
  911. package/out/utils/time-slicing/utils.d.ts +62 -0
  912. package/out/utils/time-slicing/utils.js +47 -0
  913. package/out/utils/time-slicing/utils.js.map +1 -0
  914. package/out/utils/time-slicing/wrapper.d.ts +18 -0
  915. package/out/utils/time-slicing/wrapper.js +55 -0
  916. package/out/utils/time-slicing/wrapper.js.map +1 -0
  917. package/out/utils/traverse.d.ts +36 -0
  918. package/out/utils/traverse.js +143 -0
  919. package/out/utils/traverse.js.map +1 -0
  920. package/out/utils/types.d.ts +13 -0
  921. package/out/utils/types.js +3 -0
  922. package/out/utils/types.js.map +1 -0
  923. package/out/utils/window.d.ts +7 -0
  924. package/out/utils/window.js +14 -0
  925. package/out/utils/window.js.map +1 -0
  926. package/package.json +1 -1
  927. package/sandbox/stdlib/nasl.oql.ts +2 -2
  928. package/src/concepts/NewComposite__.ts +2 -2
  929. package/src/server/translator.ts +1 -1
  930. package/src/templator/genTableBlock.ts +5 -1
  931. package/test/concepts/new-composite/__snapshots__/getQuickInfoOffset.spec.ts.snap +7 -7
  932. package/test/concepts/new-composite/__snapshots__/toEmbeddedTS.spec.ts.snap +11 -7
  933. package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +139 -189
  934. package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +9 -1
@@ -0,0 +1,1939 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || function (mod) {
25
+ if (mod && mod.__esModule) return mod;
26
+ var result = {};
27
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
+ __setModuleDefault(result, mod);
29
+ return result;
30
+ };
31
+ var __importDefault = (this && this.__importDefault) || function (mod) {
32
+ return (mod && mod.__esModule) ? mod : { "default": mod };
33
+ };
34
+ var Logic_1;
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Logic = void 0;
37
+ const time_slicing_1 = require("../utils/time-slicing");
38
+ const common_1 = require("../common");
39
+ const translator_1 = require("../translator");
40
+ const constants_1 = require("./basics/constants");
41
+ const decorators_1 = require("../decorators");
42
+ const utils = __importStar(require("../utils"));
43
+ const asserts = __importStar(require("./utils/asserts"));
44
+ const BaseNode_1 = __importDefault(require("../common/BaseNode"));
45
+ /**
46
+ * 逻辑
47
+ */
48
+ let Logic = Logic_1 = class Logic extends BaseNode_1.default {
49
+ /**
50
+ * @param source 需要合并的部分参数
51
+ */
52
+ constructor(source) {
53
+ source = { ...Logic_1.getDefaultOptions(), ...source };
54
+ super(source);
55
+ /**
56
+ * 类型参数列表
57
+ */
58
+ this.typeParams = null;
59
+ /**
60
+ * 输入参数列表
61
+ */
62
+ this.params = [];
63
+ /**
64
+ * 输出参数列表
65
+ */
66
+ this.returns = [];
67
+ /**
68
+ * 变量列表
69
+ */
70
+ this.variables = [];
71
+ /**
72
+ * 逻辑项列表
73
+ */
74
+ this.body = [];
75
+ /**
76
+ * 逻辑项列表
77
+ */
78
+ this.playground = [];
79
+ // 是不是内部有错误
80
+ this.haveError = false;
81
+ // 是否body为空
82
+ this.isSmpty = false;
83
+ // 虚拟输入参数列表
84
+ this.virtualParams = [];
85
+ super.subConstructor(source);
86
+ }
87
+ /**
88
+ * 祖先 Module
89
+ */
90
+ get module() {
91
+ return this.getAncestor('Module');
92
+ }
93
+ /**
94
+ * 祖先 App
95
+ */
96
+ get app() {
97
+ return this.getAncestor('App');
98
+ }
99
+ /**
100
+ * 祖先 Connector
101
+ */
102
+ get connector() {
103
+ return this.getAncestor('Connector');
104
+ }
105
+ /**
106
+ * 祖先 View
107
+ */
108
+ get view() {
109
+ return this.getAncestor('View');
110
+ }
111
+ /**
112
+ * 祖先 Frontend
113
+ */
114
+ get frontend() {
115
+ return this.getAncestor('Frontend');
116
+ }
117
+ /**
118
+ * 祖先 ProcessElement
119
+ */
120
+ get processElement() {
121
+ return this.getAncestor('ProcessElement');
122
+ }
123
+ /**
124
+ * 祖先 Process
125
+ */
126
+ get process() {
127
+ return this.getAncestor('Process');
128
+ }
129
+ static from(source, parentNode, parentKey) {
130
+ return super.from(source, parentNode, parentKey);
131
+ }
132
+ /**
133
+ * 从父级删除该节点
134
+ * @internal
135
+ */
136
+ _delete() {
137
+ let params = null;
138
+ if (this.parentNode) {
139
+ params = this.parentNode?.__removeLogic?.(this);
140
+ }
141
+ return params;
142
+ }
143
+ /**
144
+ * 设置逻辑名称
145
+ */
146
+ setName(name) {
147
+ const object = {
148
+ name,
149
+ };
150
+ this.update({
151
+ ...object,
152
+ field: 'name',
153
+ });
154
+ }
155
+ /**
156
+ * 设置逻辑标题
157
+ */
158
+ setTitle(title) {
159
+ const object = {
160
+ title,
161
+ };
162
+ this.update({
163
+ ...object,
164
+ });
165
+ }
166
+ /**
167
+ * 设置逻辑描述
168
+ */
169
+ setDescription(description) {
170
+ const object = {
171
+ description,
172
+ };
173
+ this.update({
174
+ ...object,
175
+ });
176
+ }
177
+ /**
178
+ * 设置触发方式
179
+ */
180
+ setTriggerType(triggerType) {
181
+ const object = {
182
+ triggerType,
183
+ };
184
+ this.update({
185
+ ...object,
186
+ });
187
+ }
188
+ /**
189
+ * 设置定时任务表达式
190
+ */
191
+ setCron(cron) {
192
+ const object = {
193
+ cron,
194
+ };
195
+ this.update({
196
+ ...object,
197
+ });
198
+ }
199
+ /**
200
+ * 设置是否可覆写
201
+ */
202
+ setOverridable(overridable) {
203
+ const object = {
204
+ overridable,
205
+ };
206
+ this.update({
207
+ ...object,
208
+ });
209
+ }
210
+ /**
211
+ * 设置事务
212
+ */
213
+ setTransactional(transactional) {
214
+ transactional._delete();
215
+ const relationOptions = { parentNode: this, parentKey: 'transactional' };
216
+ Object.assign(transactional, relationOptions);
217
+ const object = {
218
+ transactional,
219
+ };
220
+ this.update({
221
+ ...object,
222
+ });
223
+ }
224
+ getTypeParamExistingNames(excludedList = []) {
225
+ const excludedSet = new Set(excludedList);
226
+ return (this.typeParams || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
227
+ }
228
+ getTypeParamUniqueName(name = 'typeParam1') {
229
+ return utils.unique(name, this.getTypeParamExistingNames(), undefined, false);
230
+ }
231
+ _insertTypeParamAt(options, index) {
232
+ const typeParamOptions = {};
233
+ const relationOptions = { parentNode: this, parentKey: 'typeParams' };
234
+ const TypeParam = (0, decorators_1.getConceptConstructor)('TypeParam');
235
+ let typeParam;
236
+ if (!options) {
237
+ typeParam = TypeParam.from({
238
+ ...typeParamOptions,
239
+ name: this.getTypeParamUniqueName(),
240
+ }, this, 'typeParams');
241
+ }
242
+ else if (typeof options === 'string') {
243
+ typeParam = TypeParam.from({
244
+ ...typeParamOptions,
245
+ name: options,
246
+ }, this, 'typeParams');
247
+ }
248
+ else if (asserts.isTypeParam(options)) {
249
+ options.ensureDelete(); // 同一实例不支持多处存在
250
+ typeParam = options;
251
+ Object.assign(typeParam, relationOptions);
252
+ }
253
+ else {
254
+ typeParam = TypeParam.from({
255
+ ...typeParamOptions,
256
+ ...options,
257
+ }, this, 'typeParams');
258
+ }
259
+ this.typeParams.splice(index, 0, typeParam);
260
+ return typeParam;
261
+ }
262
+ insertTypeParamAt(options, index) {
263
+ const node = this._insertTypeParamAt(options, index);
264
+ node.create({
265
+ index,
266
+ parentNode: this,
267
+ parentKey: 'typeParams',
268
+ });
269
+ return node;
270
+ }
271
+ _addTypeParam(options) {
272
+ const index = this.typeParams.length;
273
+ return this._insertTypeParamAt(options, index);
274
+ }
275
+ addTypeParam(options) {
276
+ const node = this._addTypeParam(options);
277
+ const index = this.typeParams.indexOf(node);
278
+ node.create({
279
+ index,
280
+ parentNode: this,
281
+ parentKey: 'typeParams',
282
+ });
283
+ return node;
284
+ }
285
+ getParamUniqueName(name = 'param1') {
286
+ return utils.unique(name, this.getVarExistingNames(), undefined, false);
287
+ }
288
+ _insertParamAt(options, index) {
289
+ const paramOptions = {};
290
+ const relationOptions = { parentNode: this, parentKey: 'params' };
291
+ const Param = (0, decorators_1.getConceptConstructor)('Param');
292
+ let param;
293
+ if (!options) {
294
+ param = Param.from({
295
+ ...paramOptions,
296
+ name: this.getParamUniqueName(),
297
+ }, this, 'params');
298
+ }
299
+ else if (typeof options === 'string') {
300
+ param = Param.from({
301
+ ...paramOptions,
302
+ name: options,
303
+ }, this, 'params');
304
+ }
305
+ else if (asserts.isParam(options)) {
306
+ options.ensureDelete(); // 同一实例不支持多处存在
307
+ param = options;
308
+ Object.assign(param, relationOptions);
309
+ }
310
+ else {
311
+ param = Param.from({
312
+ ...paramOptions,
313
+ ...options,
314
+ }, this, 'params');
315
+ }
316
+ this.params.splice(index, 0, param);
317
+ return param;
318
+ }
319
+ insertParamAt(options, index) {
320
+ const node = this._insertParamAt(options, index);
321
+ node.create({
322
+ index,
323
+ parentNode: this,
324
+ parentKey: 'params',
325
+ });
326
+ return node;
327
+ }
328
+ _addParam(options) {
329
+ const index = this.params.length;
330
+ return this._insertParamAt(options, index);
331
+ }
332
+ addParam(options) {
333
+ const node = this._addParam(options);
334
+ const index = this.params.indexOf(node);
335
+ node.create({
336
+ index,
337
+ parentNode: this,
338
+ parentKey: 'params',
339
+ });
340
+ return node;
341
+ }
342
+ getReturnUniqueName(name = 'result') {
343
+ return utils.unique(name, this.getVarExistingNames(), undefined, false);
344
+ }
345
+ _insertReturnAt(options, index) {
346
+ const retOptions = {};
347
+ const relationOptions = { parentNode: this, parentKey: 'returns' };
348
+ const Return = (0, decorators_1.getConceptConstructor)('Return');
349
+ let ret;
350
+ if (!options) {
351
+ ret = Return.from({
352
+ ...retOptions,
353
+ name: this.getReturnUniqueName(),
354
+ }, this, 'returns');
355
+ }
356
+ else if (typeof options === 'string') {
357
+ ret = Return.from({
358
+ ...retOptions,
359
+ name: options,
360
+ }, this, 'returns');
361
+ }
362
+ else if (asserts.isReturn(options)) {
363
+ options.ensureDelete(); // 同一实例不支持多处存在
364
+ ret = options;
365
+ Object.assign(ret, relationOptions);
366
+ }
367
+ else {
368
+ ret = Return.from({
369
+ ...retOptions,
370
+ ...options,
371
+ }, this, 'returns');
372
+ }
373
+ this.returns.splice(index, 0, ret);
374
+ return ret;
375
+ }
376
+ insertReturnAt(options, index) {
377
+ const node = this._insertReturnAt(options, index);
378
+ node.create({
379
+ index,
380
+ parentNode: this,
381
+ parentKey: 'returns',
382
+ });
383
+ return node;
384
+ }
385
+ _addReturn(options) {
386
+ const index = this.returns.length;
387
+ return this._insertReturnAt(options, index);
388
+ }
389
+ addReturn(options) {
390
+ const node = this._addReturn(options);
391
+ const index = this.returns.indexOf(node);
392
+ node.create({
393
+ index,
394
+ parentNode: this,
395
+ parentKey: 'returns',
396
+ });
397
+ return node;
398
+ }
399
+ getVariableUniqueName(name = 'variable1') {
400
+ return utils.unique(name, this.getVarExistingNames(), undefined, false);
401
+ }
402
+ _insertVariableAt(options, index) {
403
+ const variableOptions = {};
404
+ const relationOptions = { parentNode: this, parentKey: 'variables' };
405
+ const Variable = (0, decorators_1.getConceptConstructor)('Variable');
406
+ let variable;
407
+ if (!options) {
408
+ variable = Variable.from({
409
+ ...variableOptions,
410
+ name: this.getVariableUniqueName(),
411
+ }, this, 'variables');
412
+ }
413
+ else if (typeof options === 'string') {
414
+ variable = Variable.from({
415
+ ...variableOptions,
416
+ name: options,
417
+ }, this, 'variables');
418
+ }
419
+ else if (asserts.isVariable(options)) {
420
+ options.ensureDelete(); // 同一实例不支持多处存在
421
+ variable = options;
422
+ Object.assign(variable, relationOptions);
423
+ }
424
+ else {
425
+ variable = Variable.from({
426
+ ...variableOptions,
427
+ ...options,
428
+ }, this, 'variables');
429
+ }
430
+ this.variables.splice(index, 0, variable);
431
+ return variable;
432
+ }
433
+ insertVariableAt(options, index) {
434
+ const node = this._insertVariableAt(options, index);
435
+ node.create({
436
+ index,
437
+ parentNode: this,
438
+ parentKey: 'variables',
439
+ });
440
+ return node;
441
+ }
442
+ _addVariable(options) {
443
+ const index = this.variables.length;
444
+ return this._insertVariableAt(options, index);
445
+ }
446
+ addVariable(options) {
447
+ const node = this._addVariable(options);
448
+ const index = this.variables.indexOf(node);
449
+ node.create({
450
+ index,
451
+ parentNode: this,
452
+ parentKey: 'variables',
453
+ });
454
+ return node;
455
+ }
456
+ _insertItemInBodyAt(options, index) {
457
+ const logicItemOptions = {};
458
+ const relationOptions = { parentNode: this, parentKey: 'body' };
459
+ const LogicItem = (0, decorators_1.getConceptConstructor)('LogicItem');
460
+ let logicItem;
461
+ if (asserts.isLogicItem(options)) {
462
+ options.ensureDelete(); // 同一实例不支持多处存在
463
+ logicItem = options;
464
+ Object.assign(logicItem, relationOptions);
465
+ }
466
+ else {
467
+ logicItem = LogicItem.from({
468
+ ...logicItemOptions,
469
+ ...options,
470
+ }, this, 'body');
471
+ }
472
+ this.body.splice(index, 0, logicItem);
473
+ return logicItem;
474
+ }
475
+ insertItemInBodyAt(options, index) {
476
+ const node = this._insertItemInBodyAt(options, index);
477
+ node.create({
478
+ index,
479
+ parentNode: this,
480
+ parentKey: 'body',
481
+ });
482
+ return node;
483
+ }
484
+ _addItemInBody(options) {
485
+ const index = this.body.length;
486
+ return this._insertItemInBodyAt(options, index);
487
+ }
488
+ addItemInBody(options) {
489
+ const node = this._addItemInBody(options);
490
+ const index = this.body.indexOf(node);
491
+ node.create({
492
+ index,
493
+ parentNode: this,
494
+ parentKey: 'body',
495
+ });
496
+ return node;
497
+ }
498
+ _insertItemInPlaygroundAt(options, index) {
499
+ const logicItemOptions = {};
500
+ const relationOptions = { parentNode: this, parentKey: 'playground' };
501
+ const LogicItem = (0, decorators_1.getConceptConstructor)('LogicItem');
502
+ let logicItem;
503
+ if (asserts.isLogicItem(options)) {
504
+ options.ensureDelete(); // 同一实例不支持多处存在
505
+ logicItem = options;
506
+ Object.assign(logicItem, relationOptions);
507
+ }
508
+ else {
509
+ logicItem = LogicItem.from({
510
+ ...logicItemOptions,
511
+ ...options,
512
+ }, this, 'playground');
513
+ }
514
+ this.playground.splice(index, 0, logicItem);
515
+ return logicItem;
516
+ }
517
+ insertItemInPlaygroundAt(options, index) {
518
+ const node = this._insertItemInPlaygroundAt(options, index);
519
+ node.create({
520
+ index,
521
+ parentNode: this,
522
+ parentKey: 'playground',
523
+ });
524
+ return node;
525
+ }
526
+ _addItemInPlayground(options) {
527
+ const index = this.playground.length;
528
+ return this._insertItemInPlaygroundAt(options, index);
529
+ }
530
+ addItemInPlayground(options) {
531
+ const node = this._addItemInPlayground(options);
532
+ const index = this.playground.indexOf(node);
533
+ node.create({
534
+ index,
535
+ parentNode: this,
536
+ parentKey: 'playground',
537
+ });
538
+ return node;
539
+ }
540
+ removeTransactional(options) {
541
+ let transactional;
542
+ if (typeof options === 'string') {
543
+ transactional = this.transactional;
544
+ if (!transactional) {
545
+ throw new Error(`找不到事务 ${options}`);
546
+ }
547
+ }
548
+ else {
549
+ transactional = options;
550
+ }
551
+ return transactional.delete();
552
+ }
553
+ __removeTransactional(transactional) {
554
+ const { parentKey } = transactional;
555
+ const params = {
556
+ parentNode: this,
557
+ parentKey,
558
+ index: -1,
559
+ object: null,
560
+ oldObject: transactional,
561
+ };
562
+ if (parentKey) {
563
+ params.parentKey = parentKey;
564
+ // @ts-ignore
565
+ const t = this.__v_raw || this;
566
+ // @ts-ignore
567
+ const n = transactional.__v_raw || transactional;
568
+ if (Array.isArray(t[parentKey])) {
569
+ // @ts-ignore
570
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
571
+ ~index && this[parentKey].splice(index, 1);
572
+ params.index = index;
573
+ }
574
+ else {
575
+ const q = t[parentKey];
576
+ if ((q.__v_raw || q) === n) {
577
+ params.index = 0;
578
+ this[parentKey] = undefined;
579
+ }
580
+ }
581
+ }
582
+ return params;
583
+ }
584
+ removeTypeParam(options) {
585
+ let typeParam;
586
+ if (typeof options === 'string') {
587
+ typeParam = this.typeParams.find((item) => item.name === options);
588
+ if (!typeParam) {
589
+ throw new Error(`找不到类型参数 ${options}`);
590
+ }
591
+ }
592
+ else {
593
+ typeParam = options;
594
+ }
595
+ return typeParam.delete();
596
+ }
597
+ __removeTypeParam(typeParam) {
598
+ const { parentKey } = typeParam;
599
+ const params = {
600
+ parentNode: this,
601
+ parentKey,
602
+ index: -1,
603
+ object: null,
604
+ oldObject: typeParam,
605
+ };
606
+ if (parentKey) {
607
+ params.parentKey = parentKey;
608
+ // @ts-ignore
609
+ const t = this.__v_raw || this;
610
+ // @ts-ignore
611
+ const n = typeParam.__v_raw || typeParam;
612
+ if (Array.isArray(t[parentKey])) {
613
+ // @ts-ignore
614
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
615
+ ~index && this[parentKey].splice(index, 1);
616
+ params.index = index;
617
+ }
618
+ else {
619
+ const q = t[parentKey];
620
+ if ((q.__v_raw || q) === n) {
621
+ params.index = 0;
622
+ this[parentKey] = undefined;
623
+ }
624
+ }
625
+ }
626
+ return params;
627
+ }
628
+ removeParam(options) {
629
+ let param;
630
+ if (typeof options === 'string') {
631
+ param = this.params.find((item) => item.name === options);
632
+ if (!param) {
633
+ throw new Error(`找不到输入参数 ${options}`);
634
+ }
635
+ }
636
+ else {
637
+ param = options;
638
+ }
639
+ return param.delete();
640
+ }
641
+ __removeParam(param) {
642
+ const { parentKey } = param;
643
+ const params = {
644
+ parentNode: this,
645
+ parentKey,
646
+ index: -1,
647
+ object: null,
648
+ oldObject: param,
649
+ };
650
+ if (parentKey) {
651
+ params.parentKey = parentKey;
652
+ // @ts-ignore
653
+ const t = this.__v_raw || this;
654
+ // @ts-ignore
655
+ const n = param.__v_raw || param;
656
+ if (Array.isArray(t[parentKey])) {
657
+ // @ts-ignore
658
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
659
+ ~index && this[parentKey].splice(index, 1);
660
+ params.index = index;
661
+ }
662
+ else {
663
+ const q = t[parentKey];
664
+ if ((q.__v_raw || q) === n) {
665
+ params.index = 0;
666
+ this[parentKey] = undefined;
667
+ }
668
+ }
669
+ }
670
+ return params;
671
+ }
672
+ removeReturn(options) {
673
+ let ret;
674
+ if (typeof options === 'string') {
675
+ ret = this.returns.find((item) => item.name === options);
676
+ if (!ret) {
677
+ throw new Error(`找不到输出参数 ${options}`);
678
+ }
679
+ }
680
+ else {
681
+ ret = options;
682
+ }
683
+ return ret.delete();
684
+ }
685
+ __removeReturn(ret) {
686
+ const { parentKey } = ret;
687
+ const params = {
688
+ parentNode: this,
689
+ parentKey,
690
+ index: -1,
691
+ object: null,
692
+ oldObject: ret,
693
+ };
694
+ if (parentKey) {
695
+ params.parentKey = parentKey;
696
+ // @ts-ignore
697
+ const t = this.__v_raw || this;
698
+ // @ts-ignore
699
+ const n = ret.__v_raw || ret;
700
+ if (Array.isArray(t[parentKey])) {
701
+ // @ts-ignore
702
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
703
+ ~index && this[parentKey].splice(index, 1);
704
+ params.index = index;
705
+ }
706
+ else {
707
+ const q = t[parentKey];
708
+ if ((q.__v_raw || q) === n) {
709
+ params.index = 0;
710
+ this[parentKey] = undefined;
711
+ }
712
+ }
713
+ }
714
+ return params;
715
+ }
716
+ removeVariable(options) {
717
+ let variable;
718
+ if (typeof options === 'string') {
719
+ variable = this.variables.find((item) => item.name === options);
720
+ if (!variable) {
721
+ throw new Error(`找不到变量 ${options}`);
722
+ }
723
+ }
724
+ else {
725
+ variable = options;
726
+ }
727
+ return variable.delete();
728
+ }
729
+ __removeVariable(variable) {
730
+ const { parentKey } = variable;
731
+ const params = {
732
+ parentNode: this,
733
+ parentKey,
734
+ index: -1,
735
+ object: null,
736
+ oldObject: variable,
737
+ };
738
+ if (parentKey) {
739
+ params.parentKey = parentKey;
740
+ // @ts-ignore
741
+ const t = this.__v_raw || this;
742
+ // @ts-ignore
743
+ const n = variable.__v_raw || variable;
744
+ if (Array.isArray(t[parentKey])) {
745
+ // @ts-ignore
746
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
747
+ ~index && this[parentKey].splice(index, 1);
748
+ params.index = index;
749
+ }
750
+ else {
751
+ const q = t[parentKey];
752
+ if ((q.__v_raw || q) === n) {
753
+ params.index = 0;
754
+ this[parentKey] = undefined;
755
+ }
756
+ }
757
+ }
758
+ return params;
759
+ }
760
+ removeItemInBody(options) {
761
+ const logicItem = options;
762
+ return logicItem.delete();
763
+ }
764
+ removeItemInPlayground(options) {
765
+ const logicItem = options;
766
+ return logicItem.delete();
767
+ }
768
+ __removeLogicItem(logicItem) {
769
+ const { parentKey } = logicItem;
770
+ const params = {
771
+ parentNode: this,
772
+ parentKey,
773
+ index: -1,
774
+ object: null,
775
+ oldObject: logicItem,
776
+ };
777
+ if (parentKey) {
778
+ params.parentKey = parentKey;
779
+ // @ts-ignore
780
+ const t = this.__v_raw || this;
781
+ // @ts-ignore
782
+ const n = logicItem.__v_raw || logicItem;
783
+ if (Array.isArray(t[parentKey])) {
784
+ // @ts-ignore
785
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
786
+ ~index && this[parentKey].splice(index, 1);
787
+ params.index = index;
788
+ }
789
+ else {
790
+ const q = t[parentKey];
791
+ if ((q.__v_raw || q) === n) {
792
+ params.index = 0;
793
+ this[parentKey] = undefined;
794
+ }
795
+ }
796
+ }
797
+ return params;
798
+ }
799
+ //================================================================================
800
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
801
+ // 自动生成的代码已结束。下面可以手动编写。
802
+ //================================================================================
803
+ // 用于calllogic树中定位是那个logic,回显
804
+ get calleewholeKey() {
805
+ return `${this.getNamespace()}.${this.name}`;
806
+ }
807
+ // 设置定时任务
808
+ setCronAndTriggerType(cron, triggerType) {
809
+ const object = {
810
+ cron,
811
+ triggerType,
812
+ };
813
+ this.update({
814
+ ...object,
815
+ });
816
+ }
817
+ /**
818
+ * 创建的时候 打开事务 通过开关设置数据库事务
819
+ */
820
+ openTransactional(flag) {
821
+ const Transactional = (0, decorators_1.getConceptConstructor)('Transactional');
822
+ if (flag) {
823
+ const transactional = new Transactional({
824
+ enabled: flag,
825
+ });
826
+ transactional._delete();
827
+ const relationOptions = { parentNode: this, parentKey: 'transactional' };
828
+ Object.assign(transactional, relationOptions);
829
+ this.transactional = transactional;
830
+ }
831
+ }
832
+ findLogicItemByConcept(concept) {
833
+ let result;
834
+ utils.traverse((current) => {
835
+ if (current.node.concept === concept)
836
+ return (result = current.node);
837
+ }, { node: this }, {
838
+ mode: 'anyObject',
839
+ excludedKeySet: this.JSON_EXCLUDED_KEYS,
840
+ });
841
+ return result;
842
+ }
843
+ onChange($event) {
844
+ this.emit('change', $event);
845
+ }
846
+ getVarExistingNames(excludedList = []) {
847
+ const excludedSet = new Set(excludedList);
848
+ const varList = [];
849
+ if (Array.isArray(this.params)) {
850
+ varList.push(...this.params);
851
+ }
852
+ if (Array.isArray(this.returns)) {
853
+ varList.push(...this.returns);
854
+ }
855
+ if (Array.isArray(this.variables)) {
856
+ varList.push(...this.variables);
857
+ }
858
+ if (this.likeComponent) {
859
+ // 页面/业务组件下,变量名不可以跟逻辑名相同,会有js 翻译问题
860
+ varList.push(this);
861
+ if (Array.isArray(this.likeComponent.params)) {
862
+ varList.push(...this.likeComponent.params);
863
+ }
864
+ if (Array.isArray(this.likeComponent.variables)) {
865
+ varList.push(...this.likeComponent.variables);
866
+ }
867
+ }
868
+ this.traverseChildren((node) => {
869
+ switch (node?.concept) {
870
+ case 'ForEachStatement':
871
+ if (node.item) {
872
+ varList.push(node?.item);
873
+ }
874
+ if (node.index) {
875
+ varList.push(node?.index);
876
+ }
877
+ break;
878
+ case 'AnonymousFunction':
879
+ node.params?.forEach((param) => {
880
+ varList.push(param);
881
+ });
882
+ break;
883
+ }
884
+ });
885
+ return varList.filter((item) => !excludedSet.has(item)).map((item) => item?.name);
886
+ }
887
+ toJSContent(code, state) {
888
+ // params
889
+ if (Array.isArray(this.params)) {
890
+ this.params.forEach((param) => {
891
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}`;
892
+ code += param.toJS(state);
893
+ code += ';\n';
894
+ });
895
+ }
896
+ // variables
897
+ if (Array.isArray(this.variables)) {
898
+ this.variables.forEach((variable) => {
899
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
900
+ code += variable.toJS(state);
901
+ code += ';\n';
902
+ });
903
+ }
904
+ // returns
905
+ if (Array.isArray(this.returns)) {
906
+ this.returns.forEach((ret) => {
907
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
908
+ code += ret.toJS(state);
909
+ code += ';\n';
910
+ });
911
+ }
912
+ if (Array.isArray(this.body)) {
913
+ this.body.forEach((item) => {
914
+ code += item.toJS && item.toJS((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
915
+ code += '\n';
916
+ });
917
+ }
918
+ return code;
919
+ }
920
+ toJS(state, type) {
921
+ let code = '';
922
+ if (type === 'IIFE') {
923
+ code += `await (async () => {\n`;
924
+ code = this.toJSContent(code, state);
925
+ code += `${(0, translator_1.indent)(state?.tabSize || 0)}})();\n`;
926
+ return code;
927
+ }
928
+ code += `async ${this.name} (`;
929
+ if (this.params?.length) {
930
+ this.params.forEach((param, index) => {
931
+ code += param.name;
932
+ if (index !== this.params.length - 1)
933
+ code += ', ';
934
+ });
935
+ }
936
+ code += ') {\n';
937
+ code = this.toJSContent(code, state);
938
+ code += `${(0, translator_1.indent)(state?.tabSize || 0)}}\n`;
939
+ return code;
940
+ }
941
+ toProcessService() {
942
+ return {
943
+ config: {
944
+ serviceType: 'micro',
945
+ },
946
+ url: {
947
+ method: 'POST',
948
+ path: this.getPath(),
949
+ },
950
+ };
951
+ }
952
+ toMockService() {
953
+ // 本此考虑将return 的类型 生成到 returnType: {} 字段
954
+ // 在运行时根据类型直接生成mock数据
955
+ const mockService = this.toService();
956
+ mockService.returns = this.returns?.map(re => {
957
+ // if(!re?.typeAnnotation){debugger}
958
+ let tA = re?.typeAnnotation || re?.__TypeAnnotation;
959
+ return {
960
+ typeAnnotation: tA?.toJS()
961
+ };
962
+ });
963
+ return mockService;
964
+ }
965
+ toService() {
966
+ const { parentNode } = this;
967
+ const { concept, name: entityName } = parentNode || {};
968
+ const logicName = this.name;
969
+ let serviceType = 'micro';
970
+ let method = 'POST';
971
+ let path = `/api/lcplogics/${logicName}`;
972
+ if (concept === 'Module') {
973
+ path = `/api/${entityName.replace('-', '_')}/${logicName}`;
974
+ }
975
+ else if (concept === 'Namespace') {
976
+ serviceType = 'entity';
977
+ let entityPath = entityName.replace(/[A-Z]/g, (char, index) => {
978
+ const lowerChar = char.toLowerCase();
979
+ return index === 0 ? lowerChar : `-${lowerChar}`;
980
+ });
981
+ const dataSource = parentNode.getAncestor('DataSource');
982
+ // 默认数据源不动,其他数据源需要拼接数据源信息
983
+ if (dataSource && dataSource.name !== 'defaultDS') {
984
+ entityPath = `${dataSource.name}/${entityPath}`;
985
+ }
986
+ path = `/api/${entityPath}`;
987
+ switch (this.name) {
988
+ case 'get':
989
+ method = 'GET';
990
+ path = `/api/${entityPath}`;
991
+ break;
992
+ case 'create':
993
+ method = 'POST';
994
+ break;
995
+ case 'update':
996
+ method = 'PUT';
997
+ break;
998
+ case 'delete':
999
+ method = 'DELETE';
1000
+ path = `/api/${entityPath}`;
1001
+ break;
1002
+ case 'createOrUpdate':
1003
+ method = 'POST';
1004
+ path = `/api/${entityPath}/createOrUpdate`;
1005
+ break;
1006
+ case 'updateBy':
1007
+ method = 'PUT';
1008
+ path = `/api/${entityPath}/by`;
1009
+ break;
1010
+ case 'deleteBy':
1011
+ method = 'DELETE';
1012
+ path = `/api/${entityPath}/by`;
1013
+ break;
1014
+ case 'batchCreate':
1015
+ method = 'POST';
1016
+ path = `/api/${entityPath}/batch`;
1017
+ break;
1018
+ case 'batchUpdate':
1019
+ method = 'PUT';
1020
+ path = `/api/${entityPath}/batch`;
1021
+ break;
1022
+ case 'batchDelete':
1023
+ method = 'DELETE';
1024
+ path = `/api/${entityPath}/batch`;
1025
+ break;
1026
+ case 'import':
1027
+ method = 'POST';
1028
+ path = `/api/${entityPath}/import`;
1029
+ break;
1030
+ default:
1031
+ break;
1032
+ }
1033
+ }
1034
+ return {
1035
+ config: {
1036
+ serviceType,
1037
+ },
1038
+ url: {
1039
+ method,
1040
+ path,
1041
+ },
1042
+ };
1043
+ }
1044
+ *toEmbeddedTSInProcess(state = (0, translator_1.createCompilerState)(), prependCode, noName, prefix) {
1045
+ const self = this;
1046
+ let code = '';
1047
+ if (!prefix)
1048
+ code += `${noName ? '' : `${self.name}:`} function(`;
1049
+ else
1050
+ code += `function ${self.name}(`; // 加空格会导致无法查询到引用
1051
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.params, function* warpForEachGenerator(param, index) {
1052
+ code += yield* param.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
1053
+ if (index !== self.params.length - 1)
1054
+ code += ', ';
1055
+ });
1056
+ code += `) {\n`;
1057
+ code += prependCode || '';
1058
+ code += '\n';
1059
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.variables, function* warpForEachGenerator(variable) {
1060
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1061
+ code += yield* variable.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
1062
+ code += ';\n';
1063
+ });
1064
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.returns, function* warpForEachGenerator(ret) {
1065
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1066
+ code += yield* ret.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
1067
+ code += ';\n';
1068
+ });
1069
+ if (!self.body.length && self.returns.length) {
1070
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}return ${self.returns[0].name};\n`;
1071
+ }
1072
+ else {
1073
+ if (self.parentNode.type === 'ExclusiveGateway') {
1074
+ if (self.body.length <= 1) {
1075
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
1076
+ code += 'const __LogicEmpty: any = null;';
1077
+ }
1078
+ }
1079
+ else if (self.body.length <= 2 &&
1080
+ !asserts.isNamespace(self.parentNode) &&
1081
+ !asserts.isProcess(self.parentNode)) {
1082
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
1083
+ code += `${(0, translator_1.indent)(state?.tabSize || 0 + 4)}const __LogicEmpty: any = null;`;
1084
+ }
1085
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.body, function* warpForEachGenerator(item) {
1086
+ code += yield* item.toEmbeddedTS?.((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 })) ??
1087
+ (0, time_slicing_1.returnOrigin)('');
1088
+ code += ';\n';
1089
+ });
1090
+ }
1091
+ // 在body渲染完成之后把其余的节点放到下面
1092
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.playground, function* warpForEachGenerator(item) {
1093
+ code += yield* item.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
1094
+ code += '\n';
1095
+ });
1096
+ code += `${(0, translator_1.indent)(state?.tabSize || 0 + 4)}}`;
1097
+ code += '\n';
1098
+ return code;
1099
+ }
1100
+ toEmbeddedTSNoExport(state) {
1101
+ return (0, time_slicing_1.runGeneratorSync)(this.toEmbeddedTS(state, 'noExport'));
1102
+ }
1103
+ get tsName() {
1104
+ // 来自集成中心,且是连接内部的逻辑,则认为是编辑态的,需要加上后缀
1105
+ if (this.connector && this.integration) {
1106
+ return `${this.name}${constants_1.CUSTOM_CONNECTOR_EDITABLE_SUFFIX}`;
1107
+ }
1108
+ // 由于Logic name 已经是符合函数预期的,因此不再需要做格式化
1109
+ return this.name;
1110
+ }
1111
+ *toEmbeddedTS(state = (0, translator_1.createCompilerState)(), prefix, hideDefaultValue) {
1112
+ const self = this;
1113
+ // 等待 oql 查询返回内容
1114
+ yield (0, common_1.waitOqlQueryComponentChildrenFinish)(self);
1115
+ // 如果传了不要前缀那就为空, 要不用传进来的,要是都没有就默认导出
1116
+ let code = '';
1117
+ // 用来储存默认值翻译结构是__IDENTIFIER__或者__IDENTIFIER__()的节点
1118
+ const IDENTIFIERMAP = new Set();
1119
+ if (!prefix) {
1120
+ code += `export function ${self.tsName}`;
1121
+ }
1122
+ else if (prefix === 'noExport') {
1123
+ code += `function ${self.tsName}`;
1124
+ }
1125
+ else if (prefix === 'inObject') {
1126
+ code += `${self.tsName}`;
1127
+ }
1128
+ if (self.typeParams?.length) {
1129
+ code += '<';
1130
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.typeParams, function* warpForEachGenerator(typeParam, typeParamIndex) {
1131
+ code += yield* typeParam.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
1132
+ if (typeParamIndex !== self.typeParams.length - 1)
1133
+ code += ', ';
1134
+ });
1135
+ code += '>';
1136
+ }
1137
+ // 有参数长度
1138
+ if (self.params.length) {
1139
+ code += '(';
1140
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.params, function* warpForEachGenerator(param, index) {
1141
+ code += yield* param.toEmbeddedTS((0, translator_1.shiftState)(state, code));
1142
+ if (index !== self.params.length - 1)
1143
+ code += ', ';
1144
+ });
1145
+ code += ')';
1146
+ }
1147
+ else {
1148
+ // 没有参数的
1149
+ code += '()';
1150
+ }
1151
+ // 需要类型推导的局部变量/返回值需要调整申明顺序
1152
+ const advanceMap = new Map();
1153
+ // const needGetSourceMapOqlList: Promise<any>[] = [];
1154
+ yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
1155
+ if (el && (asserts.isBatchAssignment(el) || (asserts.isAssignment(el) && el.left?.name))) {
1156
+ if (asserts.isAssignment(el)) {
1157
+ const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && el.left?.name === variable.name);
1158
+ if (advanceVar && !advanceMap.get(advanceVar)) {
1159
+ advanceMap.set(advanceVar, el);
1160
+ }
1161
+ const advanceRn = self.returns?.find((ret) => !ret.typeAnnotation && el.left?.name === ret.name);
1162
+ if (advanceRn && !advanceMap.get(advanceRn)) {
1163
+ advanceMap.set(advanceRn, el);
1164
+ }
1165
+ }
1166
+ else if (asserts.isBatchAssignment(el)) {
1167
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(el.assignmentLines, function* warpForEachGenerator({ leftIndex }) {
1168
+ const leftCode = leftIndex.length === 1
1169
+ ? yield* el.left.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
1170
+ : yield* el.left.members[leftIndex[1]]?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
1171
+ (0, time_slicing_1.returnOrigin)('');
1172
+ const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && leftCode === variable.name);
1173
+ if (advanceVar && !advanceMap.get(advanceVar)) {
1174
+ advanceMap.set(advanceVar, el);
1175
+ }
1176
+ const advanceRn = self.returns?.find((ret) => !ret.typeAnnotation && leftCode === ret.name);
1177
+ if (advanceRn && !advanceMap.get(advanceRn)) {
1178
+ advanceMap.set(advanceRn, el);
1179
+ }
1180
+ });
1181
+ }
1182
+ }
1183
+ });
1184
+ // 兼容 return 没有类型情况
1185
+ if (self.returns.length && self.returns[0].typeAnnotation) {
1186
+ code += ': ';
1187
+ code += yield* self.returns[0].typeAnnotation?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
1188
+ (0, time_slicing_1.returnOrigin)('');
1189
+ }
1190
+ code += '{\n';
1191
+ // 用于虚拟节点的查找引用
1192
+ if (Array.isArray(self.virtualParams)) {
1193
+ for (const param of self.virtualParams) {
1194
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
1195
+ code += yield* param.toEmbeddedNameTS((0, translator_1.shiftState)(state, code, { inline: true }));
1196
+ code += '\n';
1197
+ }
1198
+ }
1199
+ for (const variable of self.variables) {
1200
+ const ts = yield* variable.defaultValue?.toEmbeddedTS?.() ?? utils.returnOrigin('');
1201
+ if (['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts)) {
1202
+ IDENTIFIERMAP.add(variable);
1203
+ }
1204
+ if (!advanceMap.get(variable)) {
1205
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1206
+ code += yield* variable.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
1207
+ code += ';\n';
1208
+ }
1209
+ }
1210
+ for (const ret of self.returns) {
1211
+ const ts = yield* ret.defaultValue?.toEmbeddedTS?.() ?? (0, time_slicing_1.returnOrigin)('');
1212
+ if (['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts)) {
1213
+ IDENTIFIERMAP.add(ret);
1214
+ }
1215
+ if (!advanceMap.get(ret)) {
1216
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1217
+ code += yield* ret.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
1218
+ code += ';\n';
1219
+ }
1220
+ }
1221
+ yield* (0, time_slicing_1.wrapIteratorToGenerator)(advanceMap.entries(), function* warpForEachGenerator([node, assignment]) {
1222
+ // 有默认值的用默认值来推导类型, 但是如果是__IDENTIFIER__或者__IDENTIFIER__(),就不需要默认值来推导了
1223
+ if (node.defaultValue?.expression && !IDENTIFIERMAP.has(node)) {
1224
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1225
+ code += yield* node.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
1226
+ return;
1227
+ }
1228
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}// @ts-ignore\n`;
1229
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
1230
+ code += yield* node.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
1231
+ if (asserts.isBatchAssignment(assignment)) {
1232
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(assignment.assignmentLines, function* warpForEachGenerator({ leftIndex, rightIndex }) {
1233
+ const leftCode = leftIndex.length === 1
1234
+ ? yield* assignment.left.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
1235
+ : yield* assignment.left.members[leftIndex[1]]?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
1236
+ (0, time_slicing_1.returnOrigin)('');
1237
+ if (leftCode === node.name) {
1238
+ const rightNode = rightIndex.length === 1
1239
+ ? assignment.rights[rightIndex[0]]?.expression
1240
+ : assignment.rights[rightIndex[0]]?.members[rightIndex[1]];
1241
+ // 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
1242
+ if (rightNode?.typeAnnotation && !(asserts.isCallQueryComponent(rightNode) && !rightNode.isAutoInfer())) {
1243
+ if (rightNode.concept === 'NewComposite' && rightNode.typeAnnotation?.typeKind === 'anonymousStructure') {
1244
+ code += '= ';
1245
+ code += (yield* rightNode.getInitCode((0, translator_1.shiftState)(state, code, { inline: true }))) || 'null';
1246
+ }
1247
+ else if (rightNode.concept === 'NewComposite' && rightNode.typeAnnotation?.typeKind === 'generic') {
1248
+ code += '= ';
1249
+ code += (yield* rightNode.getNewCompositeCode((0, translator_1.shiftState)(state, code, { inline: true }))) || 'null';
1250
+ }
1251
+ else {
1252
+ code += ': ';
1253
+ code += yield* rightNode.typeAnnotation?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
1254
+ (0, time_slicing_1.returnOrigin)('null');
1255
+ }
1256
+ }
1257
+ else {
1258
+ code += ' = ';
1259
+ const rightCode = yield* rightNode?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
1260
+ (0, time_slicing_1.returnOrigin)('');
1261
+ code += yield* self.getRightCode(rightCode, assignment, rightNode);
1262
+ }
1263
+ }
1264
+ });
1265
+ }
1266
+ else if (['NewList', 'NewMap'].includes(assignment.right?.concept) &&
1267
+ !assignment.right?.typeAnnotation) {
1268
+ const rightNode = assignment.right;
1269
+ code += ' = ';
1270
+ code += yield* rightNode.getInitCode((0, translator_1.shiftState)(state, code, { inline: true }));
1271
+ }
1272
+ else if (assignment.right?.concept === 'NewComposite' &&
1273
+ assignment.right?.typeAnnotation?.typeKind === 'anonymousStructure') {
1274
+ const rightNode = assignment.right;
1275
+ code += ' = ';
1276
+ code += yield* rightNode.getInitCode((0, translator_1.shiftState)(state, code, { inline: true }));
1277
+ }
1278
+ else if (assignment.right?.concept === 'NewComposite' &&
1279
+ assignment.right?.typeAnnotation?.typeKind === 'generic') {
1280
+ const rightNode = assignment.right;
1281
+ code += ' = ';
1282
+ code += yield* rightNode.getNewCompositeCode((0, translator_1.shiftState)(state, code, { inline: true }));
1283
+ }
1284
+ else {
1285
+ const rightNode = assignment.right;
1286
+ // 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
1287
+ if (rightNode?.typeAnnotation && !(asserts.isCallQueryComponent(rightNode) && !rightNode.isAutoInfer())) {
1288
+ code += ': ';
1289
+ code += yield* rightNode.typeAnnotation?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
1290
+ (0, time_slicing_1.returnOrigin)('null');
1291
+ }
1292
+ else {
1293
+ code += ' = ';
1294
+ let rightCode = '';
1295
+ // 因为右侧枚举要赋值就得new 一下;
1296
+ if (rightNode &&
1297
+ asserts.isIdentifier(rightNode) &&
1298
+ rightNode.namespace &&
1299
+ rightNode.namespace.endsWith('enums')) {
1300
+ rightCode += 'new ';
1301
+ }
1302
+ rightCode +=
1303
+ rightNode && rightNode.toEmbeddedTS
1304
+ ? yield* rightNode.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
1305
+ : '__RIGHT__';
1306
+ code += yield* self.getRightCode(rightCode, assignment, rightNode);
1307
+ }
1308
+ }
1309
+ code += ';\n';
1310
+ });
1311
+ // 参数的默认值是__IDENTIFIER__或者__IDENTIFIER__()时不赋默认值,但是需要ts翻译出来进行报错校验
1312
+ if (!hideDefaultValue) {
1313
+ for (const node of IDENTIFIERMAP.values()) {
1314
+ code += yield* node.defaultValue.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
1315
+ code += '; ';
1316
+ }
1317
+ code += '\n';
1318
+ }
1319
+ if (!this.body.length && this.returns.length) {
1320
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}return ${this.returns[0].name};\n`;
1321
+ }
1322
+ else {
1323
+ // 如果长度小于2 并且不是虚拟节点就 加 报错,
1324
+ if (self.body.length <= 2 && !asserts.isNamespace(self.parentNode)) {
1325
+ if (self.body.length && self.body[0].concept === 'JavaLogic') {
1326
+ code += '';
1327
+ }
1328
+ else {
1329
+ code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
1330
+ code += 'const __LogicEmpty: any = null;';
1331
+ }
1332
+ }
1333
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.body, function* warpForEachGenerator(item) {
1334
+ code += yield* item.toEmbeddedTS?.((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 })) ??
1335
+ (0, time_slicing_1.returnOrigin)('');
1336
+ code += ';\n';
1337
+ });
1338
+ }
1339
+ // 在body渲染完成之后把其余的节点放到下面
1340
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(self.playground, function* warpForEachGenerator(item) {
1341
+ code += yield* item.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
1342
+ code += ';\n';
1343
+ });
1344
+ if (!hideDefaultValue) {
1345
+ function* setPlaygroundCode(arr, name) {
1346
+ if (arr.length) {
1347
+ code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}/* -----以下是 ${name} 的默认值草稿------ */\n`;
1348
+ }
1349
+ for (const item1 of arr) {
1350
+ for (const item of item1.defaultValue?.playground ?? []) {
1351
+ code += yield* item.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
1352
+ code += ';\n';
1353
+ }
1354
+ }
1355
+ }
1356
+ yield* setPlaygroundCode(self.variables, 'variables');
1357
+ yield* setPlaygroundCode(self.returns, 'returns');
1358
+ yield* setPlaygroundCode(self.params, 'params');
1359
+ }
1360
+ code += `${(0, translator_1.indent)(state?.tabSize || 0)}}`;
1361
+ if (prefix === 'inObject') {
1362
+ code += `,`;
1363
+ }
1364
+ code += '\n';
1365
+ return code;
1366
+ }
1367
+ toNaturalTS(state = (0, translator_1.createCompilerState)(), prefix, logicName, currentNode) {
1368
+ // 如果传了不要前缀那就为空, 要不用传进来的,要是都没有就默认导出
1369
+ let code = '';
1370
+ if (currentNode === this) {
1371
+ code += `\n${(0, translator_1.indent)(state.tabSize)}/**
1372
+ ${(0, translator_1.indent)(state.tabSize)} * 当前逻辑
1373
+ ${(0, translator_1.indent)(state.tabSize)} */\n`;
1374
+ }
1375
+ if (!logicName) {
1376
+ const { name, parentNode } = this;
1377
+ if (parentNode?.concept === 'View') {
1378
+ logicName = `viewLogic_${name}`;
1379
+ }
1380
+ else if (parentNode?.concept === 'BindEvent') {
1381
+ logicName = `on_${parentNode?.parentNode?.name}_${name}`;
1382
+ }
1383
+ else if (this?.concept === 'BusinessLogic') {
1384
+ logicName = `businessLogic_${name}`;
1385
+ }
1386
+ else {
1387
+ logicName = this.name;
1388
+ }
1389
+ }
1390
+ if (!prefix) {
1391
+ code += `${(0, translator_1.indent)(state.tabSize)}export ${currentNode !== this ? 'declare function' : 'function'} ${logicName}`;
1392
+ }
1393
+ else if (prefix === 'noExport') {
1394
+ code += `${(0, translator_1.indent)(state.tabSize)}${currentNode !== this ? 'declare function' : 'function'} ${logicName}`;
1395
+ }
1396
+ else if (prefix === 'inObject') {
1397
+ code += `${logicName}`;
1398
+ }
1399
+ if (this.typeParams?.length) {
1400
+ code += '<';
1401
+ this.typeParams.forEach((typeParam, typeParamIndex) => {
1402
+ code += typeParam.toNaturalTS((0, translator_1.shiftState)(state, code, { inline: true }));
1403
+ if (typeParamIndex !== this.typeParams.length - 1)
1404
+ code += ', ';
1405
+ });
1406
+ code += '>';
1407
+ }
1408
+ // 有参数长度
1409
+ code += '(';
1410
+ this.params.forEach((param, index) => {
1411
+ code += param.toNaturalTS((0, translator_1.shiftState)(state, code, { inline: true }));
1412
+ if (index !== this.params.length - 1)
1413
+ code += ', ';
1414
+ });
1415
+ code += ')';
1416
+ // 需要类型推导的局部变量/返回值需要调整申明顺序
1417
+ const advanceMap = new Map();
1418
+ this.traverseChildren((el) => {
1419
+ if (el && (asserts.isBatchAssignment(el) || (asserts.isAssignment(el) && el.left?.name))) {
1420
+ const jsCode = el.toJS();
1421
+ const advanceVar = this.variables?.find((variable) => !variable.typeAnnotation && jsCode.includes(`${variable.name} = `));
1422
+ if (advanceVar && !advanceMap.get(advanceVar)) {
1423
+ advanceMap.set(advanceVar, el);
1424
+ }
1425
+ const advanceRn = this.returns?.find((ret) => !ret.typeAnnotation && jsCode.includes(`${ret.name} = `));
1426
+ if (advanceRn && !advanceMap.get(advanceRn)) {
1427
+ advanceMap.set(advanceRn, el);
1428
+ }
1429
+ }
1430
+ });
1431
+ // 兼容 return 没有类型情况
1432
+ if (this.returns.length && this.returns[0].typeAnnotation) {
1433
+ code += ': ';
1434
+ code += this.returns[0].typeAnnotation?.toNaturalTS((0, translator_1.shiftState)(state, code, { inline: true }));
1435
+ }
1436
+ if (currentNode !== this) {
1437
+ code += ';';
1438
+ }
1439
+ else {
1440
+ code += ' {\n';
1441
+ this.variables.forEach((variable) => {
1442
+ code += `${(0, translator_1.indent)(state.tabSize + 1)}let `;
1443
+ code += variable.toNaturalTS((0, translator_1.shiftState)(state, code, { inline: true }));
1444
+ code += ';\n';
1445
+ });
1446
+ this.returns.forEach((ret) => {
1447
+ code += `${(0, translator_1.indent)(state.tabSize + 1)}let `;
1448
+ code += ret.toNaturalTS((0, translator_1.shiftState)(state, code, { inline: true }));
1449
+ code += ';\n';
1450
+ });
1451
+ if (!this.body.length && this.returns.length) {
1452
+ if (!state.focusedNodePath || `${this.nodePath}.body[0]` === state.focusedNodePath)
1453
+ code += `${(0, translator_1.indent)(state.tabSize + 1)}// 当前位置\n`;
1454
+ code += `${(0, translator_1.indent)(state.tabSize + 1)}return ${this.returns[0].name};\n`;
1455
+ }
1456
+ else {
1457
+ this.body.forEach((item) => {
1458
+ let partialCode = '';
1459
+ if (!state.focusedNodePath && item.concept === 'End')
1460
+ code += `${(0, translator_1.indent)(state.tabSize + 1)}// 当前位置\n`;
1461
+ if (item.toNaturalTS) {
1462
+ partialCode = item.toNaturalTS((0, translator_1.shiftState)(state, code, { tabSize: state.tabSize + 1 }));
1463
+ }
1464
+ else if (item.toEmbeddedTS) {
1465
+ partialCode = (0, time_slicing_1.runGeneratorSync)(item.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: state.tabSize + 1 })));
1466
+ }
1467
+ if (partialCode.trim()) {
1468
+ code += partialCode;
1469
+ code += '\n';
1470
+ }
1471
+ });
1472
+ }
1473
+ code += `${(0, translator_1.indent)(state.tabSize)}}`;
1474
+ }
1475
+ if (prefix === 'inObject') {
1476
+ code += `,`;
1477
+ }
1478
+ code += '\n';
1479
+ return code;
1480
+ }
1481
+ *getRightCode(code, assignment, rightNode) {
1482
+ code = code.replaceAll('\n', ' ');
1483
+ if (asserts.isAssignment(assignment) && !assignment.right)
1484
+ return code;
1485
+ // 调用接口,参数替换成 null
1486
+ if (asserts.isCallInterface(rightNode)) {
1487
+ const { _interface } = rightNode.getModuleInterface();
1488
+ return _interface
1489
+ ? `${rightNode.tsCalleeKey}(${_interface.params.map(() => 'null').join(',')})`
1490
+ : null;
1491
+ }
1492
+ // 调用服务端逻辑,参数替换成 null
1493
+ if (asserts.isCallLogic(rightNode) && rightNode.calleeNamespace === 'app.logics') {
1494
+ const calleeName = rightNode?.calleeName;
1495
+ const calleeLogic = this.app.logics.find((l) => l.name === calleeName);
1496
+ return calleeLogic ? `app.logics.${calleeName}(${calleeLogic.params.map(() => 'null').join(',')})` : null;
1497
+ }
1498
+ // ForEachStatement 内部变量需要替换处理,如 item、index
1499
+ const forEachStatement = assignment.getAncestor('ForEachStatement');
1500
+ if (forEachStatement) {
1501
+ code = yield* this.handleForEachCode(code, forEachStatement);
1502
+ }
1503
+ // Match 需要针对分支缩小类型范围
1504
+ const matchCase = assignment.getAncestor('MatchCase');
1505
+ if (matchCase) {
1506
+ code = yield* this.handleMatchCaseCode(code, matchCase);
1507
+ }
1508
+ return code;
1509
+ }
1510
+ handleReplaceCode(code, variable, replaceCode) {
1511
+ return code.replace(/\S+/g, ($1) => {
1512
+ if ($1 === `${variable},`)
1513
+ return `${replaceCode},`;
1514
+ if ($1 === variable)
1515
+ return replaceCode;
1516
+ let fnCode = $1;
1517
+ if ($1.startsWith(`${variable}.`))
1518
+ fnCode = $1.replaceAll(`${variable}.`, `${replaceCode}.`);
1519
+ if ($1.startsWith(`${variable},`))
1520
+ fnCode = $1.replaceAll(`${variable},`, `${replaceCode},`);
1521
+ if ($1.includes(`(${variable},`))
1522
+ fnCode = $1.replaceAll(`(${variable},`, `(${replaceCode},`);
1523
+ if ($1.includes(`(${variable}.`))
1524
+ fnCode = $1.replaceAll(`(${variable}.`, `(${replaceCode}.`);
1525
+ if ($1.includes(`(${variable})`))
1526
+ fnCode = $1.replaceAll(`(${variable})`, `(${replaceCode})`);
1527
+ if ($1.includes(`,${variable},`))
1528
+ fnCode = $1.replaceAll(`,${variable},`, `,${replaceCode},`);
1529
+ if ($1.includes(`,${variable}.`))
1530
+ fnCode = $1.replaceAll(`,${variable}.`, `,${replaceCode}.`);
1531
+ if ($1.includes(`,${variable})`))
1532
+ fnCode = $1.replaceAll(`,${variable})`, `,${replaceCode})`);
1533
+ if ($1.includes(`...[${variable}.`))
1534
+ fnCode = $1.replaceAll(`...[${variable}.`, `...[${replaceCode}.`);
1535
+ return fnCode;
1536
+ });
1537
+ }
1538
+ *handleForEachCode(code, forEachStatement) {
1539
+ const { item, index, each } = forEachStatement;
1540
+ if (code.includes(item.name)) {
1541
+ const eachTSCode = each ? yield* each.toEmbeddedTS() : '__IDENTIFIER__';
1542
+ code = this.handleReplaceCode(code, item.name, eachTSCode === '__IDENTIFIER__' ? eachTSCode : `${eachTSCode}.__get(0)`);
1543
+ }
1544
+ if (code.includes(index.name)) {
1545
+ code = this.handleReplaceCode(code, index.name, 'new nasl.core.Long(0)');
1546
+ }
1547
+ const parentForEachStatement = forEachStatement.getAncestor('ForEachStatement');
1548
+ if (parentForEachStatement) {
1549
+ code = yield* this.handleForEachCode(code, parentForEachStatement);
1550
+ }
1551
+ return code;
1552
+ }
1553
+ *handleMatchCaseCode(code, matchCase) {
1554
+ const match = matchCase.getAncestor('Match');
1555
+ const expressionTsCode = yield* match.expression.toEmbeddedTS();
1556
+ if (code.includes(expressionTsCode)) {
1557
+ let typeCode = '';
1558
+ yield* (0, time_slicing_1.wrapForEachToGenerator)(matchCase.patterns, function* wrapForEach(pattern, index) {
1559
+ if (asserts.isTypeAnnotation(pattern)) {
1560
+ if (index === 0) {
1561
+ typeCode += yield* pattern.toEmbeddedTS();
1562
+ }
1563
+ else {
1564
+ typeCode += '|';
1565
+ typeCode += yield* pattern.toEmbeddedTS();
1566
+ }
1567
+ }
1568
+ });
1569
+ if (typeCode) {
1570
+ code = this.handleReplaceCode(code, expressionTsCode, `(${expressionTsCode} as ${typeCode})`);
1571
+ }
1572
+ }
1573
+ const parentMatchCase = match.getAncestor('MatchCase');
1574
+ if (parentMatchCase) {
1575
+ code = yield* this.handleMatchCaseCode(code, parentMatchCase);
1576
+ }
1577
+ return code;
1578
+ }
1579
+ getNamespace() {
1580
+ if (this.parentNode) {
1581
+ const parentNamespace = this.parentNode?.getNamespace();
1582
+ // 针对Connector, 其对应的引入入口只有连接器。且唯一标识由
1583
+ // calleeName、calleeNamespace 两个字段组合确认,
1584
+ // 故这里只返回 Connector 对应的nameSpace 且 俩字段组合默认会含带logic 字段
1585
+ // 因此最后 CallConnector 的 calleewholeKey 为 : `${calleeNamespace}.logics.${calleeName}`
1586
+ if (this.parentNode.concept === 'Connector') {
1587
+ return parentNamespace;
1588
+ }
1589
+ const parentName = this.parentNode.name;
1590
+ // 自定义连接器,增加了分组概念,故需要额外扩展一层namespace
1591
+ const connector = this.getAncestor('Connector');
1592
+ if (connector && connector.connectorKind === 'app') {
1593
+ return `${parentNamespace}.${parentName}`;
1594
+ }
1595
+ const arr = [parentNamespace];
1596
+ if (this.parentNode.concept !== 'App' && parentName) {
1597
+ arr.push(parentName);
1598
+ }
1599
+ let namespace = arr.join('.');
1600
+ if (![
1601
+ 'nasl.ui',
1602
+ 'nasl.utils',
1603
+ 'nasl.util',
1604
+ 'nasl.browser',
1605
+ 'nasl.auth',
1606
+ 'nasl.configuration',
1607
+ 'nasl.process',
1608
+ 'nasl.logging',
1609
+ 'nasl.io',
1610
+ 'nasl.event',
1611
+ ].includes(namespace) &&
1612
+ !namespace.includes('.logics')) {
1613
+ namespace = `${namespace}.logics`;
1614
+ }
1615
+ return namespace;
1616
+ }
1617
+ throw new Error('无法获取命名空间,请设置 parentNode!');
1618
+ }
1619
+ getTsNamespace() {
1620
+ if (this.parentNode) {
1621
+ const parentNamespace = this.parentNode?.getTsNamespace();
1622
+ // 对于parent类型为Namespace的情况,getTsNamespace 已经返回了具体的 name,
1623
+ // 为什么下文还要重新获取???
1624
+ const parentName = this.parentNode.tsName || this.parentNode.name;
1625
+ const arr = [parentNamespace];
1626
+ if (this.parentNode.concept !== 'App' && parentName) {
1627
+ arr.push(parentName);
1628
+ }
1629
+ let namespace = arr.join('.');
1630
+ if (![
1631
+ 'nasl.ui',
1632
+ 'nasl.utils',
1633
+ 'nasl.util',
1634
+ 'nasl.browser',
1635
+ 'nasl.auth',
1636
+ 'nasl.configuration',
1637
+ 'nasl.process',
1638
+ 'nasl.logging',
1639
+ 'nasl.io',
1640
+ ].includes(namespace) &&
1641
+ !namespace.includes('.logics')) {
1642
+ namespace = `${namespace}.logics`;
1643
+ }
1644
+ return namespace;
1645
+ }
1646
+ throw new Error('无法获取命名空间,请设置 parentNode!');
1647
+ }
1648
+ /**
1649
+ * 生成宿主语言的文件路径
1650
+ * @param name 一般不用传,用于 rename
1651
+ */
1652
+ getEmbeddedFilePath(name = this.name) {
1653
+ let _path = '';
1654
+ if (this.module) {
1655
+ _path = `/${this.module.parentKey}/${this.module.name}`;
1656
+ }
1657
+ // 由于 getAncestor逻辑变更导致现在在module 上也可以获取 connector ,导致之前的 else if 逻辑失效
1658
+ // 现断层处理
1659
+ if (this.connector) {
1660
+ // 自定义连接器 编辑态文件对应parentKey 为 connectors,
1661
+ // 稳定态文件对应parentKey 为 dependencies
1662
+ // 自定义连接器有分组的概念因此,需要做文件夹处理
1663
+ if (this.connector.connectorKind === 'app') {
1664
+ _path = `/${this.connector.parentKey}/${this.connector.name}/${this.parentNode.name}`;
1665
+ }
1666
+ else {
1667
+ _path = `/${this.connector.parentKey}/${this.connector.name}`;
1668
+ }
1669
+ }
1670
+ if (asserts.isFrontendLibrary(this.parentNode)) {
1671
+ _path += `/frontends/${this.parentNode.type}`;
1672
+ }
1673
+ else if (this.parentNode.concept === 'BindEvent' && this.getAncestor('Frontend')) {
1674
+ _path += `/frontendTypes/${this.getAncestor('FrontendType')?.name}/frontends/${this.getAncestor('Frontend')?.name}/bindEvents/${name}.ts`;
1675
+ }
1676
+ return `/embedded/${this.getAncestor('App')?.name}${_path}/logics/${name}.ts`;
1677
+ }
1678
+ *toEmbeddedTSFile() {
1679
+ let code = `namespace ${this.getTsNamespace()} {\n`;
1680
+ const state = (0, translator_1.createCompilerState)(code, { tabSize: 1 });
1681
+ try {
1682
+ code += yield* this.toEmbeddedTS(state);
1683
+ }
1684
+ catch (err) {
1685
+ console.log(err, `有问题翻译失败:${this.getTsNamespace()}.${this.name}`);
1686
+ code += '';
1687
+ console.log(err);
1688
+ }
1689
+ code += '}\n';
1690
+ return {
1691
+ code,
1692
+ filePath: this.getEmbeddedFilePath(),
1693
+ sourceMap: state.sourceMap,
1694
+ };
1695
+ }
1696
+ static getDefaultOptions() {
1697
+ return {
1698
+ body: [
1699
+ {
1700
+ concept: 'Start',
1701
+ label: '开始',
1702
+ kind: 'Statement',
1703
+ type: 'Start',
1704
+ },
1705
+ {
1706
+ concept: 'End',
1707
+ label: '结束',
1708
+ kind: 'Statement',
1709
+ type: 'End',
1710
+ },
1711
+ ],
1712
+ };
1713
+ }
1714
+ async saveStructureOfCallQueryComponents(root) {
1715
+ if (!root)
1716
+ root = this;
1717
+ const set = new Set();
1718
+ utils.traverse(({ node }) => {
1719
+ if (asserts.isCallQueryComponent(node)) {
1720
+ set.add(node);
1721
+ }
1722
+ }, { node: root }, {
1723
+ mode: 'anyObject',
1724
+ excludedKeySet: new Set(['parentNode', '__assignment__']),
1725
+ });
1726
+ for (const node of set) {
1727
+ node.saveStructure();
1728
+ }
1729
+ }
1730
+ // 通过开关设置数据库事务
1731
+ setTransactionEnabled(flag) {
1732
+ const Transactional = (0, decorators_1.getConceptConstructor)('Transactional');
1733
+ this.setTransactional(new Transactional({
1734
+ enabled: flag,
1735
+ }));
1736
+ }
1737
+ delete() {
1738
+ let actionMsg = '删除逻辑项';
1739
+ if (this.name)
1740
+ actionMsg += `“${this.name}”`;
1741
+ this.app?.emit('logicDeleted', { actionMsg: this.nodePath });
1742
+ this.app?.emit('collect:start', {
1743
+ actionMsg,
1744
+ });
1745
+ super.delete();
1746
+ this.traverseChildren(async (el) => {
1747
+ if (el?.concept === 'CallQueryComponent')
1748
+ el.removeStructure();
1749
+ // 仅仅针对 自定义连接器下的 Loigc,其他需要界定边界
1750
+ const connector = el?.getAncestor?.('Connector');
1751
+ if (['CallAuthInterface', 'CallInterface'].includes(el?.concept) && connector) {
1752
+ const { calleeName } = el;
1753
+ const targetInterface = connector.interfaces.find((i) => i.name === calleeName);
1754
+ if (targetInterface) {
1755
+ const refs = await this.app?.naslServer?._isHaveRef(targetInterface);
1756
+ // 如果只有两个引用,则必然为自身以及当前logic引用,需要删除此接口
1757
+ if (refs?.length <= 2) {
1758
+ targetInterface.deleteInterface();
1759
+ }
1760
+ }
1761
+ }
1762
+ });
1763
+ this.app?.emit('collect:end');
1764
+ }
1765
+ get exportInterface() {
1766
+ return this.rootNode?.interfaces?.find((item) => item.originLogicName === this.name);
1767
+ }
1768
+ get pathName() {
1769
+ if (this.likeComponent) {
1770
+ return this.getEventLogicName('chinese');
1771
+ }
1772
+ let { parentNode } = this;
1773
+ if (parentNode.concept === 'BindEvent' && parentNode.parentNode.concept === 'Frontend') {
1774
+ const frontEndEventNameMap = {
1775
+ rendered: '应用进入后',
1776
+ preRequest: '调用服务端逻辑前',
1777
+ postRequest: '调用服务端逻辑后',
1778
+ beforeRouter: '页面切换前',
1779
+ afterRouter: '页面切换后',
1780
+ };
1781
+ const pathName = [this.name];
1782
+ while (parentNode && parentNode.concept !== 'Frontend') {
1783
+ const name = frontEndEventNameMap[parentNode.name] || parentNode.name;
1784
+ pathName.unshift(name);
1785
+ parentNode = parentNode.parentNode;
1786
+ }
1787
+ return pathName.join('-');
1788
+ }
1789
+ const nameMap = {
1790
+ OnProcessStart: '流程开始时',
1791
+ OnTasksCreate: '任务创建时',
1792
+ OnTasksOpen: '任务打开时',
1793
+ OnTasksClose: '任务关闭时',
1794
+ OnCreate: '用户任务创建时',
1795
+ OnOpen: '用户任务打开时',
1796
+ OnClose: '用户任务关闭时',
1797
+ };
1798
+ const pathName = [this.name];
1799
+ parentNode = this.parentNode;
1800
+ while (parentNode && parentNode.concept !== 'Process') {
1801
+ const name = nameMap[parentNode.name] || parentNode.name;
1802
+ pathName.unshift(name);
1803
+ parentNode = parentNode.parentNode;
1804
+ }
1805
+ return pathName.join('-');
1806
+ }
1807
+ // 获取bindEvent下的logic的名称
1808
+ getEventLogicName(type) {
1809
+ if (asserts.isBindEvent(this.parentNode)) {
1810
+ if (type === 'chinese') {
1811
+ const bindEvent = this.parentNode;
1812
+ const bindChineseName = bindEvent.getPageViewEventChineseName();
1813
+ return `${bindChineseName} -${this.name} `;
1814
+ }
1815
+ }
1816
+ return this.name;
1817
+ }
1818
+ get getLogicBelongTo() {
1819
+ const [, belongTo] = this.calleewholeKey.split('.');
1820
+ return belongTo;
1821
+ }
1822
+ // 校验logic的返回值是不是有error类型
1823
+ static checkLogicReturnTypeHasError(logic) {
1824
+ let findHasError = false;
1825
+ if (!logic) {
1826
+ return findHasError;
1827
+ }
1828
+ if (logic.returns?.length && logic.returns[0]?.typeAnnotation) {
1829
+ // 如果新导入的logic还有Error类型
1830
+ const logicType = logic.returns[0].typeAnnotation;
1831
+ if (logicType.typeNamespace === 'nasl.ui' && logicType.typeName === 'Error') {
1832
+ findHasError = true;
1833
+ }
1834
+ else if (logicType.typeNamespace === 'nasl.core' && logicType.typeKind === 'union') {
1835
+ // 如果 logic 有 returns 而且,也有typeArguments的长度
1836
+ findHasError = Boolean(logicType.typeArguments?.find((item) => item?.typeNamespace === 'nasl.ui' && item?.typeName === 'Error'));
1837
+ }
1838
+ }
1839
+ return findHasError;
1840
+ }
1841
+ // 是否来自于 集成中心
1842
+ get integration() {
1843
+ return this.getAncestor('Integration');
1844
+ }
1845
+ get likeComponent() {
1846
+ return this.view || this?.getAncestor('BusinessComponent');
1847
+ }
1848
+ };
1849
+ /** 类名 */
1850
+ Logic.ConceptName = 'Logic';
1851
+ /** 继承链 */
1852
+ Logic.inheritanceChain = ['BaseNode'];
1853
+ __decorate([
1854
+ (0, decorators_1.property)('concept')
1855
+ ], Logic.prototype, "concept", void 0);
1856
+ __decorate([
1857
+ (0, decorators_1.property)()
1858
+ ], Logic.prototype, "name", void 0);
1859
+ __decorate([
1860
+ (0, decorators_1.property)()
1861
+ ], Logic.prototype, "title", void 0);
1862
+ __decorate([
1863
+ (0, decorators_1.property)()
1864
+ ], Logic.prototype, "description", void 0);
1865
+ __decorate([
1866
+ (0, decorators_1.property)()
1867
+ ], Logic.prototype, "triggerType", void 0);
1868
+ __decorate([
1869
+ (0, decorators_1.property)()
1870
+ ], Logic.prototype, "cron", void 0);
1871
+ __decorate([
1872
+ (0, decorators_1.property)()
1873
+ ], Logic.prototype, "overridable", void 0);
1874
+ __decorate([
1875
+ (0, decorators_1.property)({
1876
+ objectRef: 'Transactional',
1877
+ })
1878
+ ], Logic.prototype, "transactional", void 0);
1879
+ __decorate([
1880
+ (0, decorators_1.property)({
1881
+ objectRef: 'TypeParam',
1882
+ isArray: true,
1883
+ defaultValue: null,
1884
+ })
1885
+ ], Logic.prototype, "typeParams", void 0);
1886
+ __decorate([
1887
+ (0, decorators_1.property)({
1888
+ objectRef: 'Param',
1889
+ isArray: true,
1890
+ defaultValue: [],
1891
+ })
1892
+ ], Logic.prototype, "params", void 0);
1893
+ __decorate([
1894
+ (0, decorators_1.property)({
1895
+ objectRef: 'Return',
1896
+ isArray: true,
1897
+ defaultValue: [],
1898
+ })
1899
+ ], Logic.prototype, "returns", void 0);
1900
+ __decorate([
1901
+ (0, decorators_1.property)({
1902
+ objectRef: 'Variable',
1903
+ isArray: true,
1904
+ defaultValue: [],
1905
+ })
1906
+ ], Logic.prototype, "variables", void 0);
1907
+ __decorate([
1908
+ (0, decorators_1.property)({
1909
+ objectRef: 'LogicItem',
1910
+ isArray: true,
1911
+ defaultValue: [],
1912
+ })
1913
+ ], Logic.prototype, "body", void 0);
1914
+ __decorate([
1915
+ (0, decorators_1.property)({
1916
+ objectRef: 'LogicItem',
1917
+ isArray: true,
1918
+ defaultValue: [],
1919
+ })
1920
+ ], Logic.prototype, "playground", void 0);
1921
+ __decorate([
1922
+ translator_1.withSourceMapGenerator
1923
+ ], Logic.prototype, "toEmbeddedTSInProcess", null);
1924
+ __decorate([
1925
+ translator_1.withSourceMapGenerator
1926
+ ], Logic.prototype, "toEmbeddedTS", null);
1927
+ __decorate([
1928
+ (0, translator_1.withSourceMap)()
1929
+ ], Logic.prototype, "toNaturalTS", null);
1930
+ Logic = Logic_1 = __decorate([
1931
+ (0, decorators_1.concept)('逻辑')
1932
+ ], Logic);
1933
+ exports.Logic = Logic;
1934
+ exports.default = Logic;
1935
+ //================================================================================
1936
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1937
+ // 自动生成的代码已结束。下面可以手动编写。
1938
+ //================================================================================
1939
+ //# sourceMappingURL=Logic__.js.map