@lcap/nasl 3.7.1-beta.1 → 3.7.2-alpha.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 (491) hide show
  1. package/out/common/BaseNode.js +3 -1
  2. package/out/common/BaseNode.js.map +1 -1
  3. package/out/concepts/AnonymousFunction__.d.ts +1 -1
  4. package/out/concepts/AnonymousFunction__.js.map +1 -1
  5. package/out/concepts/App__.js +9 -27
  6. package/out/concepts/App__.js.map +1 -1
  7. package/out/concepts/Argument__.d.ts +1 -1
  8. package/out/concepts/Argument__.js +2 -6
  9. package/out/concepts/Argument__.js.map +1 -1
  10. package/out/concepts/AssigneeV2__.js +0 -2
  11. package/out/concepts/AssigneeV2__.js.map +1 -1
  12. package/out/concepts/Assignee__.js +0 -2
  13. package/out/concepts/Assignee__.js.map +1 -1
  14. package/out/concepts/AssignmentLine__.js +0 -2
  15. package/out/concepts/AssignmentLine__.js.map +1 -1
  16. package/out/concepts/Assignment__.js +2 -4
  17. package/out/concepts/Assignment__.js.map +1 -1
  18. package/out/concepts/Attribute__.d.ts +1 -1
  19. package/out/concepts/Attribute__.js +7 -23
  20. package/out/concepts/Attribute__.js.map +1 -1
  21. package/out/concepts/AuthInterface__.js +1 -3
  22. package/out/concepts/AuthInterface__.js.map +1 -1
  23. package/out/concepts/AuthLogicForCallInterface__.js +7 -7
  24. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  25. package/out/concepts/AuthLogic__.js +1 -3
  26. package/out/concepts/AuthLogic__.js.map +1 -1
  27. package/out/concepts/BackendVariable__.d.ts +2 -2
  28. package/out/concepts/BackendVariable__.js +3 -9
  29. package/out/concepts/BackendVariable__.js.map +1 -1
  30. package/out/concepts/Backend__.js +1 -3
  31. package/out/concepts/Backend__.js.map +1 -1
  32. package/out/concepts/BatchAssignment__.js +1 -3
  33. package/out/concepts/BatchAssignment__.js.map +1 -1
  34. package/out/concepts/BinaryExpression__.js +4 -4
  35. package/out/concepts/BinaryExpression__.js.map +1 -1
  36. package/out/concepts/BindAttribute__.js +6 -58
  37. package/out/concepts/BindAttribute__.js.map +1 -1
  38. package/out/concepts/BindDirective__.d.ts +6 -6
  39. package/out/concepts/BindDirective__.js +7 -21
  40. package/out/concepts/BindDirective__.js.map +1 -1
  41. package/out/concepts/BindEvent__.d.ts +3 -3
  42. package/out/concepts/BindEvent__.js +3 -13
  43. package/out/concepts/BindEvent__.js.map +1 -1
  44. package/out/concepts/BindStyle__.js +1 -3
  45. package/out/concepts/BindStyle__.js.map +1 -1
  46. package/out/concepts/BooleanLiteral__.js +1 -3
  47. package/out/concepts/BooleanLiteral__.js.map +1 -1
  48. package/out/concepts/BusinessComponent__.js +11 -19
  49. package/out/concepts/BusinessComponent__.js.map +1 -1
  50. package/out/concepts/BusinessLogic__.js +8 -10
  51. package/out/concepts/BusinessLogic__.js.map +1 -1
  52. package/out/concepts/CallConnector__.js +2 -6
  53. package/out/concepts/CallConnector__.js.map +1 -1
  54. package/out/concepts/CallEvent__.js +2 -6
  55. package/out/concepts/CallEvent__.js.map +1 -1
  56. package/out/concepts/CallFunction__.d.ts +1 -1
  57. package/out/concepts/CallFunction__.js +4 -14
  58. package/out/concepts/CallFunction__.js.map +1 -1
  59. package/out/concepts/CallInterface__.d.ts +1 -1
  60. package/out/concepts/CallInterface__.js +3 -9
  61. package/out/concepts/CallInterface__.js.map +1 -1
  62. package/out/concepts/CallLogic__.d.ts +4 -4
  63. package/out/concepts/CallLogic__.js +10 -25
  64. package/out/concepts/CallLogic__.js.map +1 -1
  65. package/out/concepts/CallQueryComponent__.d.ts +2 -2
  66. package/out/concepts/CallQueryComponent__.js +2 -13
  67. package/out/concepts/CallQueryComponent__.js.map +1 -1
  68. package/out/concepts/Comment__.js +1 -3
  69. package/out/concepts/Comment__.js.map +1 -1
  70. package/out/concepts/CompletionProperty__.js +5 -15
  71. package/out/concepts/CompletionProperty__.js.map +1 -1
  72. package/out/concepts/ConfigGroup__.js +1 -3
  73. package/out/concepts/ConfigGroup__.js.map +1 -1
  74. package/out/concepts/ConfigPropertyValue__.d.ts +0 -1
  75. package/out/concepts/ConfigPropertyValue__.js +2 -13
  76. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  77. package/out/concepts/ConfigProperty__.js +3 -9
  78. package/out/concepts/ConfigProperty__.js.map +1 -1
  79. package/out/concepts/Configuration__.js.map +1 -1
  80. package/out/concepts/Connection__.js +3 -9
  81. package/out/concepts/Connection__.js.map +1 -1
  82. package/out/concepts/ConnectorLogic__.js +1 -3
  83. package/out/concepts/ConnectorLogic__.js.map +1 -1
  84. package/out/concepts/ConnectorTriggerLauncher__.js +6 -9
  85. package/out/concepts/ConnectorTriggerLauncher__.js.map +1 -1
  86. package/out/concepts/ConnectorTrigger__.js +2 -6
  87. package/out/concepts/ConnectorTrigger__.js.map +1 -1
  88. package/out/concepts/Connector__.js +3 -9
  89. package/out/concepts/Connector__.js.map +1 -1
  90. package/out/concepts/Constant__.js +2 -6
  91. package/out/concepts/Constant__.js.map +1 -1
  92. package/out/concepts/CountersignPolicyV2__.js +1 -3
  93. package/out/concepts/CountersignPolicyV2__.js.map +1 -1
  94. package/out/concepts/CountersignPolicy__.js +1 -3
  95. package/out/concepts/CountersignPolicy__.js.map +1 -1
  96. package/out/concepts/DataSource__.js +6 -12
  97. package/out/concepts/DataSource__.js.map +1 -1
  98. package/out/concepts/DatabaseTypeAnnotation__.js +6 -6
  99. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
  100. package/out/concepts/Destination__.js +3 -9
  101. package/out/concepts/Destination__.js.map +1 -1
  102. package/out/concepts/EntityIndex__.d.ts +2 -2
  103. package/out/concepts/EntityIndex__.js +4 -13
  104. package/out/concepts/EntityIndex__.js.map +1 -1
  105. package/out/concepts/EntityProperty__.d.ts +10 -12
  106. package/out/concepts/EntityProperty__.js +27 -44
  107. package/out/concepts/EntityProperty__.js.map +1 -1
  108. package/out/concepts/Entity__.d.ts +2 -2
  109. package/out/concepts/Entity__.js +11 -18
  110. package/out/concepts/Entity__.js.map +1 -1
  111. package/out/concepts/EnumItem__.d.ts +1 -1
  112. package/out/concepts/EnumItem__.js +6 -8
  113. package/out/concepts/EnumItem__.js.map +1 -1
  114. package/out/concepts/Enum__.js +7 -10
  115. package/out/concepts/Enum__.js.map +1 -1
  116. package/out/concepts/EventDeclaration__.js +4 -16
  117. package/out/concepts/EventDeclaration__.js.map +1 -1
  118. package/out/concepts/Event__.js +5 -15
  119. package/out/concepts/Event__.js.map +1 -1
  120. package/out/concepts/ExternalDestination__.d.ts +1 -1
  121. package/out/concepts/ExternalDestination__.js +1 -3
  122. package/out/concepts/ExternalDestination__.js.map +1 -1
  123. package/out/concepts/FieldPermissionV2__.js +2 -6
  124. package/out/concepts/FieldPermissionV2__.js.map +1 -1
  125. package/out/concepts/FlowConditionV2__.js +1 -3
  126. package/out/concepts/FlowConditionV2__.js.map +1 -1
  127. package/out/concepts/ForEachStatement__.d.ts +1 -1
  128. package/out/concepts/ForEachStatement__.js +1 -1
  129. package/out/concepts/ForEachStatement__.js.map +1 -1
  130. package/out/concepts/FrontendLibrary__.js +2 -6
  131. package/out/concepts/FrontendLibrary__.js.map +1 -1
  132. package/out/concepts/FrontendType__.d.ts +0 -4
  133. package/out/concepts/FrontendType__.js +2 -15
  134. package/out/concepts/FrontendType__.js.map +1 -1
  135. package/out/concepts/FrontendVariable__.js +1 -3
  136. package/out/concepts/FrontendVariable__.js.map +1 -1
  137. package/out/concepts/Frontend__.d.ts +0 -2
  138. package/out/concepts/Frontend__.js +8 -31
  139. package/out/concepts/Frontend__.js.map +1 -1
  140. package/out/concepts/Function__.js +2 -6
  141. package/out/concepts/Function__.js.map +1 -1
  142. package/out/concepts/HistoryProcessV2__.js +4 -12
  143. package/out/concepts/HistoryProcessV2__.js.map +1 -1
  144. package/out/concepts/I18nInfo__.d.ts +1 -1
  145. package/out/concepts/I18nInfo__.js +5 -9
  146. package/out/concepts/I18nInfo__.js.map +1 -1
  147. package/out/concepts/IconSetter__.js +1 -7
  148. package/out/concepts/IconSetter__.js.map +1 -1
  149. package/out/concepts/Identifier__.js +7 -7
  150. package/out/concepts/Identifier__.js.map +1 -1
  151. package/out/concepts/IfStatement__.js +2 -2
  152. package/out/concepts/IfStatement__.js.map +1 -1
  153. package/out/concepts/ImportedInterface__.d.ts +1 -1
  154. package/out/concepts/ImportedInterface__.js +1 -3
  155. package/out/concepts/ImportedInterface__.js.map +1 -1
  156. package/out/concepts/InputSetter__.js +1 -7
  157. package/out/concepts/InputSetter__.js.map +1 -1
  158. package/out/concepts/Integration__.js.map +1 -1
  159. package/out/concepts/InterfaceParam__.js +4 -12
  160. package/out/concepts/InterfaceParam__.js.map +1 -1
  161. package/out/concepts/Interface__.js +12 -19
  162. package/out/concepts/Interface__.js.map +1 -1
  163. package/out/concepts/JSBlock__.js +1 -3
  164. package/out/concepts/JSBlock__.js.map +1 -1
  165. package/out/concepts/JavaLogic__.js +3 -9
  166. package/out/concepts/JavaLogic__.js.map +1 -1
  167. package/out/concepts/LogicDeclaration__.js +3 -13
  168. package/out/concepts/LogicDeclaration__.js.map +1 -1
  169. package/out/concepts/LogicItem__.js +5 -31
  170. package/out/concepts/LogicItem__.js.map +1 -1
  171. package/out/concepts/Logic__.d.ts +6 -6
  172. package/out/concepts/Logic__.js +27 -36
  173. package/out/concepts/Logic__.js.map +1 -1
  174. package/out/concepts/MatchCase__.d.ts +2 -2
  175. package/out/concepts/MatchCase__.js +11 -11
  176. package/out/concepts/MatchCase__.js.map +1 -1
  177. package/out/concepts/Match__.js +1 -3
  178. package/out/concepts/Match__.js.map +1 -1
  179. package/out/concepts/MemberExpression__.js +6 -2
  180. package/out/concepts/MemberExpression__.js.map +1 -1
  181. package/out/concepts/MetadataType__.d.ts +1 -1
  182. package/out/concepts/MetadataType__.js +4 -12
  183. package/out/concepts/MetadataType__.js.map +1 -1
  184. package/out/concepts/MicroApp__.js +7 -21
  185. package/out/concepts/MicroApp__.js.map +1 -1
  186. package/out/concepts/Module__.d.ts +2 -2
  187. package/out/concepts/Module__.js +8 -24
  188. package/out/concepts/Module__.js.map +1 -1
  189. package/out/concepts/Namespace__.js +4 -12
  190. package/out/concepts/Namespace__.js.map +1 -1
  191. package/out/concepts/NewComposite__.js +6 -10
  192. package/out/concepts/NewComposite__.js.map +1 -1
  193. package/out/concepts/NewList__.d.ts +1 -1
  194. package/out/concepts/NewList__.js.map +1 -1
  195. package/out/concepts/NewMap__.d.ts +1 -1
  196. package/out/concepts/NewMap__.js +5 -2
  197. package/out/concepts/NewMap__.js.map +1 -1
  198. package/out/concepts/NumberInputSetter__.js +5 -35
  199. package/out/concepts/NumberInputSetter__.js.map +1 -1
  200. package/out/concepts/NumericLiteral__.js +1 -3
  201. package/out/concepts/NumericLiteral__.js.map +1 -1
  202. package/out/concepts/OperatePermissionV2__.js +4 -12
  203. package/out/concepts/OperatePermissionV2__.js.map +1 -1
  204. package/out/concepts/OqlQueryComponent__.d.ts +1 -1
  205. package/out/concepts/OqlQueryComponent__.js +2 -6
  206. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  207. package/out/concepts/OverriddenLogic__.js +12 -26
  208. package/out/concepts/OverriddenLogic__.js.map +1 -1
  209. package/out/concepts/ParamWithGroup__.js +2 -6
  210. package/out/concepts/ParamWithGroup__.js.map +1 -1
  211. package/out/concepts/Param__.d.ts +1 -1
  212. package/out/concepts/Param__.js +2 -14
  213. package/out/concepts/Param__.js.map +1 -1
  214. package/out/concepts/Point__.js +2 -6
  215. package/out/concepts/Point__.js.map +1 -1
  216. package/out/concepts/ProcessBindV2__.js +2 -6
  217. package/out/concepts/ProcessBindV2__.js.map +1 -1
  218. package/out/concepts/ProcessComponent__.js +4 -12
  219. package/out/concepts/ProcessComponent__.js.map +1 -1
  220. package/out/concepts/ProcessElementV2__.js +8 -24
  221. package/out/concepts/ProcessElementV2__.js.map +1 -1
  222. package/out/concepts/ProcessElement__.js +10 -22
  223. package/out/concepts/ProcessElement__.js.map +1 -1
  224. package/out/concepts/ProcessOutcome__.js +1 -3
  225. package/out/concepts/ProcessOutcome__.js.map +1 -1
  226. package/out/concepts/ProcessOutcomes__.js +0 -1
  227. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  228. package/out/concepts/ProcessV2__.js +6 -18
  229. package/out/concepts/ProcessV2__.js.map +1 -1
  230. package/out/concepts/Process__.js +3 -9
  231. package/out/concepts/Process__.js.map +1 -1
  232. package/out/concepts/PropDeclaration__.d.ts +4 -0
  233. package/out/concepts/PropDeclaration__.js +19 -84
  234. package/out/concepts/PropDeclaration__.js.map +1 -1
  235. package/out/concepts/QueryAggregateExpression__.js +2 -6
  236. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  237. package/out/concepts/QueryFieldExpression__.js +4 -12
  238. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  239. package/out/concepts/QueryFromExpression__.js +5 -11
  240. package/out/concepts/QueryFromExpression__.js.map +1 -1
  241. package/out/concepts/QueryJoinExpression__.js +6 -14
  242. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  243. package/out/concepts/QueryLimitExpression__.js +12 -4
  244. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  245. package/out/concepts/QueryOrderByExpression__.js +6 -2
  246. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  247. package/out/concepts/QuerySelectExpression__.js +5 -7
  248. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  249. package/out/concepts/Rect__.js +4 -12
  250. package/out/concepts/Rect__.js.map +1 -1
  251. package/out/concepts/Return__.d.ts +1 -1
  252. package/out/concepts/Return__.js +2 -10
  253. package/out/concepts/Return__.js.map +1 -1
  254. package/out/concepts/Role__.d.ts +4 -4
  255. package/out/concepts/Role__.js +6 -14
  256. package/out/concepts/Role__.js.map +1 -1
  257. package/out/concepts/SelectMembers__.js +1 -3
  258. package/out/concepts/SelectMembers__.js.map +1 -1
  259. package/out/concepts/SetterOption__.js +6 -34
  260. package/out/concepts/SetterOption__.js.map +1 -1
  261. package/out/concepts/SlotDeclaration__.js +5 -23
  262. package/out/concepts/SlotDeclaration__.js.map +1 -1
  263. package/out/concepts/SqlQueryComponent__.js +4 -12
  264. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  265. package/out/concepts/StaticString__.d.ts +1 -1
  266. package/out/concepts/StaticString__.js +6 -10
  267. package/out/concepts/StaticString__.js.map +1 -1
  268. package/out/concepts/StringLiteral__.d.ts +1 -1
  269. package/out/concepts/StringLiteral__.js +2 -6
  270. package/out/concepts/StringLiteral__.js.map +1 -1
  271. package/out/concepts/StructureProperty__.d.ts +5 -5
  272. package/out/concepts/StructureProperty__.js +9 -14
  273. package/out/concepts/StructureProperty__.js.map +1 -1
  274. package/out/concepts/Structure__.d.ts +0 -4
  275. package/out/concepts/Structure__.js +17 -20
  276. package/out/concepts/Structure__.js.map +1 -1
  277. package/out/concepts/SwitchCase__.d.ts +1 -1
  278. package/out/concepts/SwitchCase__.js.map +1 -1
  279. package/out/concepts/SwitchStatement__.js.map +1 -1
  280. package/out/concepts/ThemeVariable__.js +1 -3
  281. package/out/concepts/ThemeVariable__.js.map +1 -1
  282. package/out/concepts/Theme__.js +2 -6
  283. package/out/concepts/Theme__.js.map +1 -1
  284. package/out/concepts/Transactional__.d.ts +2 -2
  285. package/out/concepts/Transactional__.js +6 -12
  286. package/out/concepts/Transactional__.js.map +1 -1
  287. package/out/concepts/TriggerEvent__.js +1 -3
  288. package/out/concepts/TriggerEvent__.js.map +1 -1
  289. package/out/concepts/TriggerLauncher__.js +3 -9
  290. package/out/concepts/TriggerLauncher__.js.map +1 -1
  291. package/out/concepts/TypeAnnotation__.d.ts +2 -2
  292. package/out/concepts/TypeAnnotation__.js +24 -31
  293. package/out/concepts/TypeAnnotation__.js.map +1 -1
  294. package/out/concepts/TypeParam__.js +1 -3
  295. package/out/concepts/TypeParam__.js.map +1 -1
  296. package/out/concepts/UnaryExpression__.js +1 -3
  297. package/out/concepts/UnaryExpression__.js.map +1 -1
  298. package/out/concepts/Unparsed__.js +1 -3
  299. package/out/concepts/Unparsed__.js.map +1 -1
  300. package/out/concepts/UseComponent__.js +2 -6
  301. package/out/concepts/UseComponent__.js.map +1 -1
  302. package/out/concepts/ValidationRule__.d.ts +1 -6
  303. package/out/concepts/ValidationRule__.js +4 -23
  304. package/out/concepts/ValidationRule__.js.map +1 -1
  305. package/out/concepts/Variable__.d.ts +1 -1
  306. package/out/concepts/Variable__.js +2 -10
  307. package/out/concepts/Variable__.js.map +1 -1
  308. package/out/concepts/ViewBlockWithImage__.js +2 -6
  309. package/out/concepts/ViewBlockWithImage__.js.map +1 -1
  310. package/out/concepts/ViewBlock__.js +3 -13
  311. package/out/concepts/ViewBlock__.js.map +1 -1
  312. package/out/concepts/ViewComponentDeclaration__.d.ts +1 -1
  313. package/out/concepts/ViewComponentDeclaration__.js +8 -36
  314. package/out/concepts/ViewComponentDeclaration__.js.map +1 -1
  315. package/out/concepts/ViewElement__.js +92 -83
  316. package/out/concepts/ViewElement__.js.map +1 -1
  317. package/out/concepts/View__.js +22 -40
  318. package/out/concepts/View__.js.map +1 -1
  319. package/out/generator/genBundleFiles.js +1 -0
  320. package/out/generator/genBundleFiles.js.map +1 -1
  321. package/out/generator/release-body/utils.js +2 -1
  322. package/out/generator/release-body/utils.js.map +1 -1
  323. package/out/natural/genNaturalTS.d.ts +44 -1
  324. package/out/natural/genNaturalTS.js +61 -5
  325. package/out/natural/genNaturalTS.js.map +1 -1
  326. package/out/natural/getContext/index.js +3 -0
  327. package/out/natural/getContext/index.js.map +1 -1
  328. package/out/server/naslServer.js +24 -10
  329. package/out/server/naslServer.js.map +1 -1
  330. package/out/server/translator.js +47 -0
  331. package/out/server/translator.js.map +1 -1
  332. package/out/translator/types.d.ts +4 -0
  333. package/out/translator/utils.d.ts +1 -0
  334. package/out/translator/utils.js +6 -1
  335. package/out/translator/utils.js.map +1 -1
  336. package/out/utils/env.d.ts +2 -0
  337. package/out/utils/env.js +3 -1
  338. package/out/utils/env.js.map +1 -1
  339. package/package.json +1 -1
  340. package/src/common/BaseNode.ts +3 -1
  341. package/src/concepts/AnonymousFunction__.ts +1 -1
  342. package/src/concepts/App__.ts +9 -27
  343. package/src/concepts/Argument__.ts +3 -7
  344. package/src/concepts/AssigneeV2__.ts +0 -2
  345. package/src/concepts/Assignee__.ts +0 -2
  346. package/src/concepts/AssignmentLine__.ts +0 -2
  347. package/src/concepts/Assignment__.ts +2 -4
  348. package/src/concepts/Attribute__.ts +9 -21
  349. package/src/concepts/AuthInterface__.ts +1 -3
  350. package/src/concepts/AuthLogicForCallInterface__.ts +4 -5
  351. package/src/concepts/AuthLogic__.ts +1 -3
  352. package/src/concepts/BackendVariable__.ts +5 -11
  353. package/src/concepts/Backend__.ts +1 -3
  354. package/src/concepts/BatchAssignment__.ts +4 -4
  355. package/src/concepts/BinaryExpression__.ts +9 -7
  356. package/src/concepts/BindAttribute__.ts +26 -38
  357. package/src/concepts/BindDirective__.ts +13 -27
  358. package/src/concepts/BindEvent__.ts +7 -13
  359. package/src/concepts/BindStyle__.ts +1 -3
  360. package/src/concepts/BooleanLiteral__.ts +1 -3
  361. package/src/concepts/BusinessComponent__.ts +16 -20
  362. package/src/concepts/BusinessLogic__.ts +7 -10
  363. package/src/concepts/CallConnector__.ts +3 -7
  364. package/src/concepts/CallEvent__.ts +2 -6
  365. package/src/concepts/CallFunction__.ts +7 -14
  366. package/src/concepts/CallInterface__.ts +8 -15
  367. package/src/concepts/CallLogic__.ts +39 -46
  368. package/src/concepts/CallQueryComponent__.ts +9 -22
  369. package/src/concepts/Comment__.ts +1 -3
  370. package/src/concepts/CompletionProperty__.ts +5 -15
  371. package/src/concepts/ConfigGroup__.ts +2 -7
  372. package/src/concepts/ConfigPropertyValue__.ts +3 -15
  373. package/src/concepts/ConfigProperty__.ts +3 -9
  374. package/src/concepts/Configuration__.ts +1 -4
  375. package/src/concepts/Connection__.ts +3 -9
  376. package/src/concepts/ConnectorLogic__.ts +2 -4
  377. package/src/concepts/ConnectorTriggerLauncher__.ts +13 -11
  378. package/src/concepts/ConnectorTrigger__.ts +12 -12
  379. package/src/concepts/Connector__.ts +3 -9
  380. package/src/concepts/Constant__.ts +2 -6
  381. package/src/concepts/CountersignPolicyV2__.ts +1 -3
  382. package/src/concepts/CountersignPolicy__.ts +1 -3
  383. package/src/concepts/DataSource__.ts +16 -18
  384. package/src/concepts/DatabaseTypeAnnotation__.ts +6 -11
  385. package/src/concepts/Destination__.ts +3 -9
  386. package/src/concepts/EntityIndex__.ts +6 -15
  387. package/src/concepts/EntityProperty__.ts +40 -56
  388. package/src/concepts/Entity__.ts +13 -18
  389. package/src/concepts/EnumItem__.ts +15 -10
  390. package/src/concepts/Enum__.ts +9 -10
  391. package/src/concepts/EventDeclaration__.ts +5 -13
  392. package/src/concepts/Event__.ts +5 -15
  393. package/src/concepts/ExternalDestination__.ts +2 -4
  394. package/src/concepts/FieldPermissionV2__.ts +2 -6
  395. package/src/concepts/FlowConditionV2__.ts +1 -3
  396. package/src/concepts/ForEachStatement__.ts +2 -2
  397. package/src/concepts/FrontendLibrary__.ts +2 -6
  398. package/src/concepts/FrontendType__.ts +2 -14
  399. package/src/concepts/FrontendVariable__.ts +1 -3
  400. package/src/concepts/Frontend__.ts +11 -35
  401. package/src/concepts/Function__.ts +2 -6
  402. package/src/concepts/HistoryProcessV2__.ts +4 -12
  403. package/src/concepts/I18nInfo__.ts +8 -15
  404. package/src/concepts/IconSetter__.ts +2 -4
  405. package/src/concepts/Identifier__.ts +9 -10
  406. package/src/concepts/IfStatement__.ts +2 -2
  407. package/src/concepts/ImportedInterface__.ts +2 -4
  408. package/src/concepts/InputSetter__.ts +2 -4
  409. package/src/concepts/Integration__.ts +0 -1
  410. package/src/concepts/InterfaceParam__.ts +4 -12
  411. package/src/concepts/InterfaceTriggerEvent__.ts +1 -1
  412. package/src/concepts/Interface__.ts +16 -22
  413. package/src/concepts/JSBlock__.ts +1 -3
  414. package/src/concepts/JavaLogic__.ts +3 -9
  415. package/src/concepts/LogicDeclaration__.ts +4 -10
  416. package/src/concepts/LogicItem__.ts +9 -19
  417. package/src/concepts/Logic__.ts +46 -47
  418. package/src/concepts/MatchCase__.ts +12 -12
  419. package/src/concepts/Match__.ts +11 -8
  420. package/src/concepts/MemberExpression__.ts +8 -2
  421. package/src/concepts/MetadataType__.ts +9 -16
  422. package/src/concepts/MicroApp__.ts +7 -21
  423. package/src/concepts/Module__.ts +10 -26
  424. package/src/concepts/Namespace__.ts +4 -12
  425. package/src/concepts/NewComposite__.ts +18 -16
  426. package/src/concepts/NewList__.ts +1 -1
  427. package/src/concepts/NewMap__.ts +15 -6
  428. package/src/concepts/NumberInputSetter__.ts +10 -20
  429. package/src/concepts/NumericLiteral__.ts +1 -3
  430. package/src/concepts/OperatePermissionV2__.ts +4 -12
  431. package/src/concepts/OqlQueryComponent__.ts +3 -7
  432. package/src/concepts/OverriddenLogic__.ts +15 -25
  433. package/src/concepts/ParamWithGroup__.ts +2 -6
  434. package/src/concepts/Param__.ts +5 -9
  435. package/src/concepts/Point__.ts +2 -6
  436. package/src/concepts/ProcessBindV2__.ts +2 -6
  437. package/src/concepts/ProcessComponent__.ts +4 -12
  438. package/src/concepts/ProcessElementV2__.ts +11 -27
  439. package/src/concepts/ProcessElement__.ts +13 -23
  440. package/src/concepts/ProcessOutcome__.ts +1 -3
  441. package/src/concepts/ProcessOutcomes__.ts +0 -1
  442. package/src/concepts/ProcessV2__.ts +11 -19
  443. package/src/concepts/Process__.ts +3 -9
  444. package/src/concepts/PropDeclaration__.ts +31 -57
  445. package/src/concepts/QueryAggregateExpression__.ts +3 -8
  446. package/src/concepts/QueryFieldExpression__.ts +23 -30
  447. package/src/concepts/QueryFromExpression__.ts +5 -11
  448. package/src/concepts/QueryJoinExpression__.ts +7 -16
  449. package/src/concepts/QueryLimitExpression__.ts +16 -4
  450. package/src/concepts/QueryOrderByExpression__.ts +22 -13
  451. package/src/concepts/QuerySelectExpression__.ts +8 -13
  452. package/src/concepts/Rect__.ts +4 -12
  453. package/src/concepts/Return__.ts +4 -8
  454. package/src/concepts/Role__.ts +8 -16
  455. package/src/concepts/SelectMembers__.ts +1 -3
  456. package/src/concepts/SetterOption__.ts +10 -22
  457. package/src/concepts/SlotDeclaration__.ts +7 -17
  458. package/src/concepts/SqlQueryComponent__.ts +5 -13
  459. package/src/concepts/StaticString__.ts +9 -16
  460. package/src/concepts/StringLiteral__.ts +5 -11
  461. package/src/concepts/StructureProperty__.ts +16 -19
  462. package/src/concepts/Structure__.ts +20 -20
  463. package/src/concepts/SwitchCase__.ts +1 -1
  464. package/src/concepts/SwitchStatement__.ts +1 -1
  465. package/src/concepts/ThemeVariable__.ts +1 -3
  466. package/src/concepts/Theme__.ts +2 -6
  467. package/src/concepts/Transactional__.ts +10 -19
  468. package/src/concepts/TriggerEvent__.ts +1 -3
  469. package/src/concepts/TriggerLauncher__.ts +11 -15
  470. package/src/concepts/TypeAnnotation__.ts +50 -41
  471. package/src/concepts/TypeParam__.ts +1 -3
  472. package/src/concepts/UnaryExpression__.ts +1 -3
  473. package/src/concepts/Unparsed__.ts +1 -3
  474. package/src/concepts/UseComponent__.ts +2 -6
  475. package/src/concepts/ValidationRule__.ts +6 -17
  476. package/src/concepts/Variable__.ts +4 -8
  477. package/src/concepts/ViewBlockWithImage__.ts +2 -6
  478. package/src/concepts/ViewBlock__.ts +4 -10
  479. package/src/concepts/ViewComponentDeclaration__.ts +11 -27
  480. package/src/concepts/ViewElement__.ts +232 -157
  481. package/src/concepts/View__.ts +40 -54
  482. package/src/generator/genBundleFiles.ts +2 -1
  483. package/src/generator/release-body/utils.ts +3 -2
  484. package/src/natural/genNaturalTS.ts +91 -12
  485. package/src/natural/getContext/index.ts +3 -0
  486. package/src/server/naslServer.ts +24 -10
  487. package/src/server/translator.ts +49 -0
  488. package/src/translator/types.ts +4 -0
  489. package/src/translator/utils.ts +6 -0
  490. package/src/utils/env.ts +2 -0
  491. package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -2
@@ -9,6 +9,7 @@ import {
9
9
  withSourceMapGenerator,
10
10
  withGenerator,
11
11
  TranslatorGenerator,
12
+ createDescriptionComment,
12
13
  } from '../translator';
13
14
  import type Namespace from './Namespace__';
14
15
  import type TypeAnnotation from './TypeAnnotation__';
@@ -62,41 +63,31 @@ export class Interface extends ImportedInterface {
62
63
  /**
63
64
  * 接口名称
64
65
  */
65
- @property({
66
- objectRef: '',
67
- })
66
+ @property()
68
67
  name: string = '';
69
68
 
70
69
  /**
71
70
  * 导出的来源
72
71
  */
73
- @property({
74
- objectRef: '',
75
- })
72
+ @property()
76
73
  originLogicName: string;
77
74
 
78
75
  /**
79
76
  * 接口路径
80
77
  */
81
- @property({
82
- objectRef: '',
83
- })
78
+ @property()
84
79
  path: string;
85
80
 
86
81
  /**
87
82
  * 接口方法
88
83
  */
89
- @property({
90
- objectRef: '',
91
- })
84
+ @property()
92
85
  method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
93
86
 
94
87
  /**
95
88
  * 接口描述
96
89
  */
97
- @property({
98
- objectRef: '',
99
- })
90
+ @property()
100
91
  description: string;
101
92
 
102
93
  /**
@@ -622,17 +613,17 @@ export class Interface extends ImportedInterface {
622
613
  });
623
614
  super.delete();
624
615
  if (this.originLogicName) {
625
- const logic = this.app.logics?.find((logic) => logic.name === this.originLogicName)
616
+ const logic = this.app.logics?.find((logic) => logic.name === this.originLogicName);
626
617
  this.app.naslServer?.embeddedTSEmitter.emit('change', {
627
618
  value: [
628
619
  {
629
620
  originEvent: {
630
621
  action: 'update',
631
622
  target: logic,
632
- }
633
- }
634
- ]
635
- })
623
+ },
624
+ },
625
+ ],
626
+ });
636
627
  }
637
628
  this.app?.emit('collect:end');
638
629
  }
@@ -988,7 +979,11 @@ export class Interface extends ImportedInterface {
988
979
  @withSourceMap()
989
980
  toNaturalTS(state = createCompilerState(), interfaceName: string): string {
990
981
  const { name, params, returns } = this || {};
991
- let code = `declare function ${interfaceName || name}(`;
982
+
983
+ let code = '';
984
+ if (state.descriptionComment)
985
+ code += createDescriptionComment(state, this, ['description']);
986
+ code = `declare function ${interfaceName || name}(`;
992
987
  if (params?.length) {
993
988
  code += '{';
994
989
  params?.forEach((param, index) => {
@@ -1006,7 +1001,6 @@ export class Interface extends ImportedInterface {
1006
1001
  return code;
1007
1002
  }
1008
1003
 
1009
-
1010
1004
  getNamespace(): string {
1011
1005
  // 针对 Connector 下的 Interface 需要做额外的兼容处理
1012
1006
  // 本来 Connector 对应的 Namespace 是 connector,走默认逻辑就成
@@ -45,9 +45,7 @@ export class JSBlock extends LogicItem {
45
45
  /**
46
46
  * 代码内容
47
47
  */
48
- @property({
49
- objectRef: '',
50
- })
48
+ @property()
51
49
  code: string;
52
50
 
53
51
  /**
@@ -45,25 +45,19 @@ export class JavaLogic extends LogicItem {
45
45
  /**
46
46
  * 包名
47
47
  */
48
- @property({
49
- objectRef: '',
50
- })
48
+ @property()
51
49
  packageName: string;
52
50
 
53
51
  /**
54
52
  * className
55
53
  */
56
- @property({
57
- objectRef: '',
58
- })
54
+ @property()
59
55
  className: string;
60
56
 
61
57
  /**
62
58
  * 代码内容
63
59
  */
64
- @property({
65
- objectRef: '',
66
- })
60
+ @property()
67
61
  code: string;
68
62
 
69
63
  /**
@@ -38,25 +38,19 @@ export class LogicDeclaration extends BaseNode {
38
38
  /**
39
39
  * 逻辑名称
40
40
  */
41
- @property({
42
- objectRef: '',
43
- })
41
+ @property()
44
42
  name: string = '';
45
43
 
46
44
  /**
47
45
  * 逻辑标题
48
46
  */
49
- @property({
50
- objectRef: '',
51
- })
47
+ @property()
52
48
  title: string;
53
49
 
54
50
  /**
55
51
  * 逻辑描述
56
52
  */
57
- @property({
58
- objectRef: '',
59
- })
53
+ @property()
60
54
  description: string;
61
55
 
62
56
  /**
@@ -67,7 +61,7 @@ export class LogicDeclaration extends BaseNode {
67
61
  isArray: true,
68
62
  defaultValue: null,
69
63
  })
70
- typeParams?: Array<TypeParam> = null;
64
+ typeParams?: Array<TypeParam>;
71
65
 
72
66
  /**
73
67
  * 输入参数列表
@@ -117,42 +117,32 @@ export abstract class LogicItem extends BaseNode {
117
117
  /**
118
118
  * 逻辑项标题
119
119
  */
120
- @property({
121
- objectRef: '',
122
- })
123
- label?: string = null;
120
+ @property()
121
+ label?: string;
124
122
 
125
123
  /**
126
124
  * 逻辑项描述
127
125
  */
128
- @property({
129
- objectRef: '',
130
- })
131
- description?: string = null;
126
+ @property()
127
+ description?: string;
132
128
 
133
129
  /**
134
130
  * 是否折叠
135
131
  */
136
- @property({
137
- objectRef: '',
138
- })
132
+ @property()
139
133
  folded?: boolean = false;
140
134
 
141
135
  /**
142
136
  * offsetX
143
137
  */
144
- @property({
145
- objectRef: '',
146
- })
147
- offsetX?: number = null;
138
+ @property()
139
+ offsetX?: number;
148
140
 
149
141
  /**
150
142
  * offsetY
151
143
  */
152
- @property({
153
- objectRef: '',
154
- })
155
- offsetY?: number = null;
144
+ @property()
145
+ offsetY?: number;
156
146
 
157
147
  /**
158
148
  * @param source 需要合并的部分参数
@@ -17,6 +17,7 @@ import {
17
17
  withSourceMapGenerator,
18
18
  withGenerator,
19
19
  TranslatorGenerator,
20
+ createDescriptionComment,
20
21
  } from '../translator';
21
22
  import type App from './App__';
22
23
  import type Namespace from './Namespace__';
@@ -89,50 +90,38 @@ export class Logic extends BaseNode {
89
90
  /**
90
91
  * 逻辑名称
91
92
  */
92
- @property({
93
- objectRef: '',
94
- })
93
+ @property()
95
94
  name: string = '';
96
95
 
97
96
  /**
98
97
  * 逻辑标题
99
98
  */
100
- @property({
101
- objectRef: '',
102
- })
103
- title: string;
99
+ @property()
100
+ title?: string;
104
101
 
105
102
  /**
106
103
  * 逻辑描述
107
104
  */
108
- @property({
109
- objectRef: '',
110
- })
111
- description: string;
105
+ @property()
106
+ description?: string;
112
107
 
113
108
  /**
114
109
  * 触发方式
115
110
  */
116
- @property({
117
- objectRef: '',
118
- })
119
- triggerType: string;
111
+ @property()
112
+ triggerType?: string;
120
113
 
121
114
  /**
122
115
  * 定时任务表达式
123
116
  */
124
- @property({
125
- objectRef: '',
126
- })
127
- cron: string;
117
+ @property()
118
+ cron?: string;
128
119
 
129
120
  /**
130
121
  * 是否可覆写
131
122
  */
132
- @property({
133
- objectRef: '',
134
- })
135
- overridable: boolean;
123
+ @property()
124
+ overridable?: boolean;
136
125
 
137
126
  /**
138
127
  * 事务
@@ -140,7 +129,7 @@ export class Logic extends BaseNode {
140
129
  @property({
141
130
  objectRef: 'Transactional',
142
131
  })
143
- transactional: Transactional;
132
+ transactional?: Transactional;
144
133
 
145
134
  /**
146
135
  * 类型参数列表
@@ -150,7 +139,7 @@ export class Logic extends BaseNode {
150
139
  isArray: true,
151
140
  defaultValue: null,
152
141
  })
153
- typeParams?: Array<TypeParam> = null;
142
+ typeParams?: Array<TypeParam>;
154
143
 
155
144
  /**
156
145
  * 输入参数列表
@@ -1574,14 +1563,13 @@ export class Logic extends BaseNode {
1574
1563
  // const needGetSourceMapOqlList: Promise<any>[] = [];
1575
1564
  yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
1576
1565
  if (
1577
- el && (
1578
- // 批量赋值
1579
- asserts.isBatchAssignment(el) ||
1566
+ el &&
1567
+ // 批量赋值
1568
+ (asserts.isBatchAssignment(el) ||
1580
1569
  // 赋值
1581
1570
  (asserts.isAssignment(el) && el.left?.name) ||
1582
1571
  // 内置函数对集合类型的推导
1583
- (asserts.isCallFunction(el) && el.derivablecollection?.name)
1584
- )
1572
+ (asserts.isCallFunction(el) && el.derivablecollection?.name))
1585
1573
  ) {
1586
1574
  if (asserts.isAssignment(el)) {
1587
1575
  const advanceVar = self.variables?.find(
@@ -1610,7 +1598,7 @@ export class Logic extends BaseNode {
1610
1598
  leftIndex.length === 1
1611
1599
  ? yield* el.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
1612
1600
  : yield* el.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
1613
- returnOrigin('');
1601
+ returnOrigin('');
1614
1602
  const advanceVar = self.variables?.find(
1615
1603
  (variable) => !variable.typeAnnotation && leftCode === variable.name,
1616
1604
  );
@@ -1663,7 +1651,7 @@ export class Logic extends BaseNode {
1663
1651
  leftIndex.length === 1
1664
1652
  ? yield* assignment.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
1665
1653
  : yield* assignment.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
1666
- returnOrigin('');
1654
+ returnOrigin('');
1667
1655
  if (leftCode === node.name) {
1668
1656
  const rightNode: any =
1669
1657
  rightIndex.length === 1
@@ -1788,7 +1776,11 @@ export class Logic extends BaseNode {
1788
1776
  }
1789
1777
 
1790
1778
  @withSourceMapGenerator
1791
- *toEmbeddedDeclarationTS(state = createCompilerState(), prefix?: string, hideDefaultValue?: boolean): TranslatorGenerator {
1779
+ *toEmbeddedDeclarationTS(
1780
+ state = createCompilerState(),
1781
+ prefix?: string,
1782
+ hideDefaultValue?: boolean,
1783
+ ): TranslatorGenerator {
1792
1784
  const self = this;
1793
1785
  let code = '';
1794
1786
  if (!prefix) {
@@ -1831,7 +1823,6 @@ export class Logic extends BaseNode {
1831
1823
  return code;
1832
1824
  }
1833
1825
 
1834
-
1835
1826
  @withSourceMapGenerator
1836
1827
  *toEmbeddedTS(state = createCompilerState(), prefix?: string, hideDefaultValue?: boolean): TranslatorGenerator {
1837
1828
  const self = this;
@@ -1874,14 +1865,13 @@ export class Logic extends BaseNode {
1874
1865
  const callFunctionAdvanceMap: Map<Return | Variable, CallFunction> = new Map();
1875
1866
  yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
1876
1867
  if (
1877
- el && (
1878
- // 批量赋值
1879
- asserts.isBatchAssignment(el) ||
1868
+ el &&
1869
+ // 批量赋值
1870
+ (asserts.isBatchAssignment(el) ||
1880
1871
  // 赋值
1881
1872
  (asserts.isAssignment(el) && el.left?.name) ||
1882
1873
  // 内置函数对集合类型的推导
1883
- (asserts.isCallFunction(el) && el.derivablecollection?.name)
1884
- )
1874
+ (asserts.isCallFunction(el) && el.derivablecollection?.name))
1885
1875
  ) {
1886
1876
  if (asserts.isAssignment(el)) {
1887
1877
  const advanceVar = self.variables?.find(
@@ -1910,7 +1900,7 @@ export class Logic extends BaseNode {
1910
1900
  leftIndex.length === 1
1911
1901
  ? yield* el.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
1912
1902
  : yield* el.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
1913
- returnOrigin('');
1903
+ returnOrigin('');
1914
1904
  const advanceVar = self.variables?.find(
1915
1905
  (variable) => !variable.typeAnnotation && leftCode === variable.name,
1916
1906
  );
@@ -1935,7 +1925,7 @@ export class Logic extends BaseNode {
1935
1925
  code += '{\n';
1936
1926
  if (self.exportInterface) {
1937
1927
  code += indent((state?.tabSize || 0) + 1);
1938
- code += `let exportInterface = app.interfaces.${self.exportInterface.name};\n`
1928
+ code += `let exportInterface = app.interfaces.${self.exportInterface.name};\n`;
1939
1929
  }
1940
1930
  // 用于虚拟节点的查找引用
1941
1931
  if (Array.isArray(self.virtualParams)) {
@@ -1989,7 +1979,7 @@ export class Logic extends BaseNode {
1989
1979
  leftIndex.length === 1
1990
1980
  ? yield* assignment.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
1991
1981
  : yield* assignment.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
1992
- returnOrigin('');
1982
+ returnOrigin('');
1993
1983
  if (leftCode === node.name) {
1994
1984
  const rightNode: any =
1995
1985
  rightIndex.length === 1
@@ -2178,6 +2168,8 @@ export class Logic extends BaseNode {
2178
2168
  @withSourceMap()
2179
2169
  toNaturalTS(state = createCompilerState()): string {
2180
2170
  let code = '';
2171
+ if (state.descriptionComment)
2172
+ code += createDescriptionComment(state, this, ['description']);
2181
2173
 
2182
2174
  let logicName = this.name;
2183
2175
  if (state.autoPrefixName) {
@@ -2234,7 +2226,8 @@ export class Logic extends BaseNode {
2234
2226
  });
2235
2227
 
2236
2228
  if (!this.body.length || this.body.length === 2) {
2237
- if (`${this.nodePath}.body[1]` === state.focusedNodePath) code += `${indent(state.tabSize + 1)}/* 当前位置 */\n`;
2229
+ if (`${this.nodePath}.body[1]` === state.focusedNodePath)
2230
+ code += `${indent(state.tabSize + 1)}/* 当前位置 */\n`;
2238
2231
  code += `${indent(state.tabSize + 1)}return ${this?.returns?.[0]?.name || ''};\n`;
2239
2232
  } else {
2240
2233
  this.body.forEach((item) => {
@@ -2419,8 +2412,8 @@ export class Logic extends BaseNode {
2419
2412
  collectionTSCode === '__IDENTIFIER__'
2420
2413
  ? collectionTSCode
2421
2414
  : callFunction.isLoopMap && index === 0
2422
- ? `${collectionTSCode}.__getKey(0)`
2423
- : `${collectionTSCode}.__get(0)`,
2415
+ ? `${collectionTSCode}.__getKey(0)`
2416
+ : `${collectionTSCode}.__get(0)`,
2424
2417
  );
2425
2418
  }
2426
2419
  });
@@ -2562,8 +2555,9 @@ export class Logic extends BaseNode {
2562
2555
  if (asserts.isFrontendLibrary(this.parentNode)) {
2563
2556
  _path += `/frontends/${this.parentNode.type}`;
2564
2557
  } else if (this.parentNode.concept === 'BindEvent' && this.getAncestor('Frontend')) {
2565
- _path += `/frontendTypes/${this.getAncestor('FrontendType')?.name}/frontends/${this.getAncestor('Frontend')?.name
2566
- }/bindEvents/${name}.ts`;
2558
+ _path += `/frontendTypes/${this.getAncestor('FrontendType')?.name}/frontends/${
2559
+ this.getAncestor('Frontend')?.name
2560
+ }/bindEvents/${name}.ts`;
2567
2561
  }
2568
2562
  return `/embedded/${this.getAncestor('App')?.name}${_path}/logics/${name}.ts`;
2569
2563
  }
@@ -2651,6 +2645,11 @@ export class Logic extends BaseNode {
2651
2645
  actionMsg,
2652
2646
  });
2653
2647
  super.delete();
2648
+ this.body.forEach((el) => {
2649
+ if (asserts.isCallInterface(el)) {
2650
+ el.deleteCallNode()
2651
+ }
2652
+ })
2654
2653
  this.traverseChildren(async (el) => {
2655
2654
  if (el?.concept === 'CallQueryComponent') (el as CallQueryComponent).removeStructure();
2656
2655
  // 仅仅针对 自定义连接器下的 Loigc,其他需要界定边界
@@ -73,9 +73,7 @@ export class MatchCase extends LogicItem {
73
73
  /**
74
74
  * 是否可枚举
75
75
  */
76
- @property({
77
- objectRef: '',
78
- })
76
+ @property()
79
77
  isMatchedTypeEnumable: boolean = false;
80
78
 
81
79
  /**
@@ -152,14 +150,6 @@ export class MatchCase extends LogicItem {
152
150
  return logicItem;
153
151
  }
154
152
 
155
- getLogicItemExistingNames(excludedList: Array<LogicItem> = []) {
156
- const excludedSet = new Set(excludedList);
157
- return ((this.patterns as LogicItem[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
158
- }
159
- getLogicItemUniqueName(name = 'logicItem1') {
160
- return utils.unique(name, this.getLogicItemExistingNames(), undefined, false);
161
- }
162
-
163
153
  /**
164
154
  * 插入逻辑项
165
155
  * @param logicItemOptions 逻辑项参数
@@ -592,6 +582,14 @@ export class MatchCase extends LogicItem {
592
582
  // 自动生成的代码已结束。下面可以手动编写。
593
583
  //================================================================================
594
584
 
585
+ getLogicItemExistingNames(excludedList: Array<LogicItem> = []) {
586
+ const excludedSet = new Set(excludedList);
587
+ return ((this.patterns as LogicItem[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
588
+ }
589
+ getLogicItemUniqueName(name = 'logicItem1') {
590
+ return utils.unique(name, this.getLogicItemExistingNames(), undefined, false);
591
+ }
592
+
595
593
  // 是否处于禁用状态
596
594
  get isDisabled() {
597
595
  const matchExpression = this.parentNode as Match;
@@ -928,7 +926,9 @@ export class MatchCase extends LogicItem {
928
926
  @withSourceMap()
929
927
  toTextualNASL(state = createCompilerState()): string {
930
928
  let code = '';
931
- code += this.patterns.length ? this.patterns.map((pattern) => pattern.toTextualNASL(shiftState(state, code, { inline: true }))).join(' | ') : '_';
929
+ code += this.patterns.length
930
+ ? this.patterns.map((pattern) => pattern.toTextualNASL(shiftState(state, code, { inline: true }))).join(' | ')
931
+ : '_';
932
932
  code += ` => `;
933
933
  if ((this.parentNode as Match)?.isExpression) {
934
934
  this.body.forEach((logicItem) => {
@@ -63,9 +63,7 @@ export class Match extends LogicItem {
63
63
  /**
64
64
  * 是否表达式形态
65
65
  */
66
- @property({
67
- objectRef: '',
68
- })
66
+ @property()
69
67
  isExpression: boolean = false;
70
68
 
71
69
  /**
@@ -285,7 +283,7 @@ export class Match extends LogicItem {
285
283
  if (enabled && messagesLanguageList?.length) {
286
284
  const filterChildren = children.filter((child) => {
287
285
  return messagesLanguageList.find((langId) => 'I18nEnum.' + langId === child.value);
288
- })
286
+ });
289
287
  return filterChildren.map((child) => child?.expression);
290
288
  }
291
289
  }
@@ -749,9 +747,15 @@ export class Match extends LogicItem {
749
747
  // 最后一项是else
750
748
  this.cases.forEach((item, index) => {
751
749
  // 如果是最后一项
752
- code += item.toNaturalTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1, inline: true }), index, parentCode);
750
+ code += item.toNaturalTS(
751
+ shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1, inline: true }),
752
+ index,
753
+ parentCode,
754
+ );
753
755
  });
754
- code += `${indent(state?.tabSize || 0)}})(${this.expression?.toNaturalTS(shiftState(state, code, { inline: true }))})`;
756
+ code += `${indent(state?.tabSize || 0)}})(${this.expression?.toNaturalTS(
757
+ shiftState(state, code, { inline: true }),
758
+ )})`;
755
759
 
756
760
  if (
757
761
  this.parentNode?.concept !== 'Argument' &&
@@ -777,8 +781,7 @@ export class Match extends LogicItem {
777
781
  code += this.expression?.toTextualNASL(shiftState(state, '', { inline: true }));
778
782
  code += ` {\n`;
779
783
  this.cases.forEach((item, index) => {
780
- if (item.body.length)
781
- code += item.toTextualNASL(shiftState(state, code, { tabSize: state.tabSize + 1 }));
784
+ if (item.body.length) code += item.toTextualNASL(shiftState(state, code, { tabSize: state.tabSize + 1 }));
782
785
  });
783
786
  code += `${indent(state.tabSize)}}\n`;
784
787
  return code;
@@ -540,7 +540,9 @@ export class MemberExpression extends LogicItem {
540
540
  @withSourceMap()
541
541
  toNaturalTS(state = createCompilerState()): string {
542
542
  let code = '';
543
- const leftCode = this.object ? `${this.object.toNaturalTS(shiftState(state, code, { inline: true }))}.` : '__IDENTIFIER__';
543
+ const leftCode = this.object
544
+ ? `${this.object.toNaturalTS(shiftState(state, code, { inline: true }))}.`
545
+ : '__IDENTIFIER__';
544
546
  code += this.object ? `${this.object.toNaturalTS(shiftState(state, code, { inline: true }))}.` : '__IDENTIFIER__';
545
547
  code += this.property ? this.property.toNaturalTS(shiftState(state, code, { inline: true })) : '__IDENTIFIER__';
546
548
  // 就说明这是一个枚举取值操作,直接啊app.enums.color.red 要转成字符串
@@ -558,7 +560,11 @@ export class MemberExpression extends LogicItem {
558
560
  toTextualNASL(state = createCompilerState()): string {
559
561
  let code = '';
560
562
  // const leftCode = this.object ? `${this.object.toTextualNASL(shiftState(state, code, { inline: true }))}.` : '';
561
- code += this.object ? `${this.object.toTextualNASL(shiftState(state, code, { inline: true }))}${(this.object as Identifier)?.namespace?.includes('.enums') ? '::' : '.'}` : '__IDENTIFIER__';
563
+ code += this.object
564
+ ? `${this.object.toTextualNASL(shiftState(state, code, { inline: true }))}${
565
+ (this.object as Identifier)?.namespace?.includes('.enums') ? '::' : '.'
566
+ }`
567
+ : '__IDENTIFIER__';
562
568
  code += this.property ? this.property.toTextualNASL(shiftState(state, code, { inline: true })) : '__IDENTIFIER__';
563
569
  return code;
564
570
  }
@@ -54,26 +54,20 @@ export class MetadataType extends BaseNode {
54
54
  /**
55
55
  * 名称
56
56
  */
57
- @property({
58
- objectRef: '',
59
- })
57
+ @property()
60
58
  name: string = '';
61
59
 
62
60
  /**
63
61
  * 标题
64
62
  */
65
- @property({
66
- objectRef: '',
67
- })
63
+ @property()
68
64
  label: string = '元数据';
69
65
 
70
66
  /**
71
67
  * 描述
72
68
  */
73
- @property({
74
- objectRef: '',
75
- })
76
- description: string;
69
+ @property()
70
+ description?: string;
77
71
 
78
72
  /**
79
73
  * 类型
@@ -106,9 +100,7 @@ export class MetadataType extends BaseNode {
106
100
  /**
107
101
  * 唯一标识
108
102
  */
109
- @property({
110
- objectRef: '',
111
- })
103
+ @property()
112
104
  uuid: string = createUUID();
113
105
 
114
106
  /**
@@ -549,8 +541,7 @@ export class MetadataType extends BaseNode {
549
541
  let code = '';
550
542
 
551
543
  this.rules.forEach((rule, index) => {
552
- if (index > 0)
553
- code += indent(state.tabSize);
544
+ if (index > 0) code += indent(state.tabSize);
554
545
 
555
546
  code += `${rule.toTextualNASL(shiftState(state, code, { tabSize: state.tabSize + 1 }))}\n`;
556
547
  });
@@ -565,7 +556,9 @@ export class MetadataType extends BaseNode {
565
556
  code += `type ${this.name} = ${this.typeAnnotation.toTextualNASL(state)} {\n`;
566
557
 
567
558
  this.rules.forEach((rule) => {
568
- code += `${indent(state.tabSize)}${rule.toTextualNASL(shiftState(state, code, { tabSize: state.tabSize + 1 }))};\n`;
559
+ code += `${indent(state.tabSize)}${rule.toTextualNASL(
560
+ shiftState(state, code, { tabSize: state.tabSize + 1 }),
561
+ )};\n`;
569
562
  });
570
563
 
571
564
  code += `${indent(state.tabSize)}}\n`;