@lcap/nasl-concepts 3.9.0-beta.1

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