@lcap/nasl 3.4.0-beta.3 → 3.4.0-beta.4

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 (880) hide show
  1. package/out/automate/engine/index.d.ts +4 -4
  2. package/out/automate/engine/index.js +363 -363
  3. package/out/automate/engine/operators.d.ts +26 -16
  4. package/out/automate/engine/operators.js +363 -363
  5. package/out/automate/engine/uniqueName.d.ts +12 -12
  6. package/out/automate/engine/uniqueName.js +111 -111
  7. package/out/automate/engine/utils.d.ts +25 -25
  8. package/out/automate/engine/utils.js +443 -443
  9. package/out/automate/engine/viewCache.d.ts +19 -18
  10. package/out/automate/engine/viewCache.js +44 -44
  11. package/out/automate/template/myProcess.d.ts +10 -9
  12. package/out/automate/template/myProcess.js +11501 -11500
  13. package/out/automate/template/myProcess.js.map +1 -1
  14. package/out/automate/upgrader/2.12.d.ts +7 -7
  15. package/out/automate/upgrader/2.12.js +62 -62
  16. package/out/automate/upgrader/2.14-components.d.ts +1115 -1115
  17. package/out/automate/upgrader/2.14-components.js +1086 -1086
  18. package/out/automate/upgrader/2.14.d.ts +10 -10
  19. package/out/automate/upgrader/2.14.js +235 -235
  20. package/out/automate/upgrader/2.14.old.d.ts +1 -1
  21. package/out/automate/upgrader/2.14.old.js +124 -124
  22. package/out/automate/upgrader/2.16.d.ts +10 -10
  23. package/out/automate/upgrader/2.16.js +74 -74
  24. package/out/automate/upgrader/2.17.d.ts +21 -21
  25. package/out/automate/upgrader/2.17.js +556 -556
  26. package/out/automate/upgrader/2.18.d.ts +10 -10
  27. package/out/automate/upgrader/2.18.js +106 -106
  28. package/out/automate/upgrader/2.20.d.ts +17 -17
  29. package/out/automate/upgrader/2.20.js +67 -67
  30. package/out/bak/translator.d.ts +1 -1
  31. package/out/bak/translator.js +143 -143
  32. package/out/breakpoint/generator/AfterStartNode.d.ts +7 -7
  33. package/out/breakpoint/generator/AfterStartNode.js +29 -29
  34. package/out/breakpoint/generator/BeforeEndNode.d.ts +7 -7
  35. package/out/breakpoint/generator/BeforeEndNode.js +27 -27
  36. package/out/breakpoint/generator/BreakpointNode.d.ts +15 -15
  37. package/out/breakpoint/generator/BreakpointNode.js +283 -283
  38. package/out/breakpoint/generator/CallbackNode.d.ts +4 -4
  39. package/out/breakpoint/generator/CallbackNode.js +21 -21
  40. package/out/breakpoint/generator/FragmentNode.d.ts +4 -4
  41. package/out/breakpoint/generator/FragmentNode.js +17 -17
  42. package/out/breakpoint/generator/index.d.ts +4 -4
  43. package/out/breakpoint/generator/index.js +118 -118
  44. package/out/breakpoint/index.d.ts +3 -3
  45. package/out/breakpoint/index.js +19 -19
  46. package/out/breakpoint/shared/constants.d.ts +37 -37
  47. package/out/breakpoint/shared/constants.js +105 -105
  48. package/out/breakpoint/shared/index.d.ts +3 -3
  49. package/out/breakpoint/shared/index.js +32 -32
  50. package/out/breakpoint/shared/operations.d.ts +10 -10
  51. package/out/breakpoint/shared/operations.js +24 -24
  52. package/out/breakpoint/shared/socket.d.ts +48 -48
  53. package/out/breakpoint/shared/socket.js +256 -256
  54. package/out/breakpoint/shared/utils.d.ts +27 -27
  55. package/out/breakpoint/shared/utils.js +228 -228
  56. package/out/breakpoint/store/core.d.ts +80 -80
  57. package/out/breakpoint/store/core.js +415 -415
  58. package/out/breakpoint/store/dock.d.ts +1 -1
  59. package/out/breakpoint/store/dock.js +159 -159
  60. package/out/breakpoint/store/index.d.ts +2 -2
  61. package/out/breakpoint/store/index.js +18 -18
  62. package/out/common/BaseNode.d.ts +347 -334
  63. package/out/common/BaseNode.js +1376 -1325
  64. package/out/common/BaseNode.js.map +1 -1
  65. package/out/common/Command.d.ts +21 -21
  66. package/out/common/Command.js +78 -78
  67. package/out/common/ComponentAPI.d.ts +110 -110
  68. package/out/common/ComponentAPI.js +2 -2
  69. package/out/common/EventEmitter.d.ts +60 -60
  70. package/out/common/EventEmitter.js +68 -68
  71. package/out/common/EventEmitter.js.map +1 -1
  72. package/out/common/Messager.d.ts +91 -91
  73. package/out/common/Messager.js +206 -206
  74. package/out/common/asyncFuncMap.d.ts +2 -2
  75. package/out/common/asyncFuncMap.js +15 -15
  76. package/out/common/index.d.ts +3 -3
  77. package/out/common/index.js +19 -19
  78. package/out/concepts/Abort__.d.ts +28 -26
  79. package/out/concepts/Abort__.js +83 -81
  80. package/out/concepts/Abort__.js.map +1 -1
  81. package/out/concepts/AbstractInterface__.d.ts +22 -0
  82. package/out/concepts/AbstractInterface__.js +60 -0
  83. package/out/concepts/AbstractInterface__.js.map +1 -0
  84. package/out/concepts/Anchor__.d.ts +48 -46
  85. package/out/concepts/Anchor__.js +208 -206
  86. package/out/concepts/Anchor__.js.map +1 -1
  87. package/out/concepts/AnonymousFunction__.d.ts +175 -173
  88. package/out/concepts/AnonymousFunction__.js +548 -546
  89. package/out/concepts/AnonymousFunction__.js.map +1 -1
  90. package/out/concepts/App__.d.ts +1770 -1687
  91. package/out/concepts/App__.js +2777 -2670
  92. package/out/concepts/App__.js.map +1 -1
  93. package/out/concepts/Argument__.d.ts +70 -68
  94. package/out/concepts/Argument__.js +285 -285
  95. package/out/concepts/Argument__.js.map +1 -1
  96. package/out/concepts/Assignee__.d.ts +291 -289
  97. package/out/concepts/Assignee__.js +455 -452
  98. package/out/concepts/Assignee__.js.map +1 -1
  99. package/out/concepts/AssignmentLine__.d.ts +44 -42
  100. package/out/concepts/AssignmentLine__.js +120 -118
  101. package/out/concepts/AssignmentLine__.js.map +1 -1
  102. package/out/concepts/Assignment__.d.ts +77 -75
  103. package/out/concepts/Assignment__.js +328 -327
  104. package/out/concepts/Assignment__.js.map +1 -1
  105. package/out/concepts/Attribute__.d.ts +112 -110
  106. package/out/concepts/Attribute__.js +259 -265
  107. package/out/concepts/Attribute__.js.map +1 -1
  108. package/out/concepts/AuthInterface__.d.ts +38 -36
  109. package/out/concepts/AuthInterface__.js +86 -85
  110. package/out/concepts/AuthInterface__.js.map +1 -1
  111. package/out/concepts/AuthLogicForCallInterface__.d.ts +141 -139
  112. package/out/concepts/AuthLogicForCallInterface__.js +535 -532
  113. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  114. package/out/concepts/AuthLogic__.d.ts +69 -67
  115. package/out/concepts/AuthLogic__.js +222 -221
  116. package/out/concepts/AuthLogic__.js.map +1 -1
  117. package/out/concepts/BackendVariable__.d.ts +148 -146
  118. package/out/concepts/BackendVariable__.js +482 -481
  119. package/out/concepts/BackendVariable__.js.map +1 -1
  120. package/out/concepts/Backend__.d.ts +137 -135
  121. package/out/concepts/Backend__.js +287 -285
  122. package/out/concepts/Backend__.js.map +1 -1
  123. package/out/concepts/BatchAssignment__.d.ts +255 -253
  124. package/out/concepts/BatchAssignment__.js +883 -880
  125. package/out/concepts/BatchAssignment__.js.map +1 -1
  126. package/out/concepts/BinaryExpression__.d.ts +74 -72
  127. package/out/concepts/BinaryExpression__.js +398 -398
  128. package/out/concepts/BinaryExpression__.js.map +1 -1
  129. package/out/concepts/BindAttribute__.d.ts +330 -328
  130. package/out/concepts/BindAttribute__.js +1064 -1071
  131. package/out/concepts/BindAttribute__.js.map +1 -1
  132. package/out/concepts/BindDirective__.d.ts +169 -167
  133. package/out/concepts/BindDirective__.js +558 -562
  134. package/out/concepts/BindDirective__.js.map +1 -1
  135. package/out/concepts/BindEvent__.d.ts +255 -253
  136. package/out/concepts/BindEvent__.js +943 -942
  137. package/out/concepts/BindEvent__.js.map +1 -1
  138. package/out/concepts/BindStyle__.d.ts +142 -140
  139. package/out/concepts/BindStyle__.js +424 -423
  140. package/out/concepts/BindStyle__.js.map +1 -1
  141. package/out/concepts/BooleanLiteral__.d.ts +38 -36
  142. package/out/concepts/BooleanLiteral__.js +109 -108
  143. package/out/concepts/BooleanLiteral__.js.map +1 -1
  144. package/out/concepts/CallAuthInterface__.d.ts +128 -126
  145. package/out/concepts/CallAuthInterface__.js +421 -414
  146. package/out/concepts/CallAuthInterface__.js.map +1 -1
  147. package/out/concepts/CallConnector__.d.ts +49 -47
  148. package/out/concepts/CallConnector__.js +267 -266
  149. package/out/concepts/CallConnector__.js.map +1 -1
  150. package/out/concepts/CallFunction__.d.ts +161 -159
  151. package/out/concepts/CallFunction__.js +589 -568
  152. package/out/concepts/CallFunction__.js.map +1 -1
  153. package/out/concepts/CallInterface__.d.ts +132 -130
  154. package/out/concepts/CallInterface__.js +808 -802
  155. package/out/concepts/CallInterface__.js.map +1 -1
  156. package/out/concepts/CallLogic__.d.ts +233 -231
  157. package/out/concepts/CallLogic__.js +1317 -1319
  158. package/out/concepts/CallLogic__.js.map +1 -1
  159. package/out/concepts/CallQueryComponent__.d.ts +435 -433
  160. package/out/concepts/CallQueryComponent__.js +1313 -1325
  161. package/out/concepts/CallQueryComponent__.js.map +1 -1
  162. package/out/concepts/Comment__.d.ts +35 -33
  163. package/out/concepts/Comment__.js +101 -100
  164. package/out/concepts/Comment__.js.map +1 -1
  165. package/out/concepts/CompletionProperty__.d.ts +107 -105
  166. package/out/concepts/CompletionProperty__.js +279 -283
  167. package/out/concepts/CompletionProperty__.js.map +1 -1
  168. package/out/concepts/ConfigGroup__.d.ts +127 -125
  169. package/out/concepts/ConfigGroup__.js +266 -264
  170. package/out/concepts/ConfigGroup__.js.map +1 -1
  171. package/out/concepts/ConfigPropertyValue__.d.ts +47 -45
  172. package/out/concepts/ConfigPropertyValue__.js +110 -110
  173. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  174. package/out/concepts/ConfigProperty__.d.ts +156 -154
  175. package/out/concepts/ConfigProperty__.js +334 -334
  176. package/out/concepts/ConfigProperty__.js.map +1 -1
  177. package/out/concepts/Configuration__.d.ts +126 -124
  178. package/out/concepts/Configuration__.js +239 -236
  179. package/out/concepts/Configuration__.js.map +1 -1
  180. package/out/concepts/Connection__.d.ts +168 -166
  181. package/out/concepts/Connection__.js +347 -347
  182. package/out/concepts/Connection__.js.map +1 -1
  183. package/out/concepts/ConnectorTrigger__.d.ts +81 -79
  184. package/out/concepts/ConnectorTrigger__.js +160 -161
  185. package/out/concepts/ConnectorTrigger__.js.map +1 -1
  186. package/out/concepts/Connector__.d.ts +929 -570
  187. package/out/concepts/Connector__.js +1346 -907
  188. package/out/concepts/Connector__.js.map +1 -1
  189. package/out/concepts/Constant__.d.ts +121 -119
  190. package/out/concepts/Constant__.js +313 -313
  191. package/out/concepts/Constant__.js.map +1 -1
  192. package/out/concepts/DataSource__.d.ts +171 -169
  193. package/out/concepts/DataSource__.js +477 -477
  194. package/out/concepts/DataSource__.js.map +1 -1
  195. package/out/concepts/DatabaseTypeAnnotation__.d.ts +34 -32
  196. package/out/concepts/DatabaseTypeAnnotation__.js +82 -82
  197. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
  198. package/out/concepts/DefaultValue__.d.ts +98 -98
  199. package/out/concepts/DefaultValue__.js +210 -209
  200. package/out/concepts/DefaultValue__.js.map +1 -1
  201. package/out/concepts/Destination__.d.ts +160 -158
  202. package/out/concepts/Destination__.js +804 -804
  203. package/out/concepts/Destination__.js.map +1 -1
  204. package/out/concepts/End__.d.ts +27 -25
  205. package/out/concepts/End__.js +117 -115
  206. package/out/concepts/End__.js.map +1 -1
  207. package/out/concepts/EntityIndex__.d.ts +98 -96
  208. package/out/concepts/EntityIndex__.js +227 -229
  209. package/out/concepts/EntityIndex__.js.map +1 -1
  210. package/out/concepts/EntityProperty__.d.ts +289 -287
  211. package/out/concepts/EntityProperty__.js +883 -888
  212. package/out/concepts/EntityProperty__.js.map +1 -1
  213. package/out/concepts/Entity__.d.ts +342 -340
  214. package/out/concepts/Entity__.js +779 -769
  215. package/out/concepts/Entity__.js.map +1 -1
  216. package/out/concepts/EnumItem__.d.ts +67 -65
  217. package/out/concepts/EnumItem__.js +155 -155
  218. package/out/concepts/EnumItem__.js.map +1 -1
  219. package/out/concepts/Enum__.d.ts +141 -139
  220. package/out/concepts/Enum__.js +341 -341
  221. package/out/concepts/Enum__.js.map +1 -1
  222. package/out/concepts/Event__.d.ts +146 -144
  223. package/out/concepts/Event__.js +261 -263
  224. package/out/concepts/Event__.js.map +1 -1
  225. package/out/concepts/ExternalDestination__.d.ts +78 -76
  226. package/out/concepts/ExternalDestination__.js +292 -291
  227. package/out/concepts/ExternalDestination__.js.map +1 -1
  228. package/out/concepts/ForEachStatement__.d.ts +173 -190
  229. package/out/concepts/ForEachStatement__.js +533 -534
  230. package/out/concepts/ForEachStatement__.js.map +1 -1
  231. package/out/concepts/FrontendLibrary__.d.ts +216 -214
  232. package/out/concepts/FrontendLibrary__.js +374 -372
  233. package/out/concepts/FrontendLibrary__.js.map +1 -1
  234. package/out/concepts/FrontendVariable__.d.ts +24 -22
  235. package/out/concepts/FrontendVariable__.js +66 -63
  236. package/out/concepts/FrontendVariable__.js.map +1 -1
  237. package/out/concepts/Frontend__.d.ts +511 -509
  238. package/out/concepts/Frontend__.js +1043 -1003
  239. package/out/concepts/Frontend__.js.map +1 -1
  240. package/out/concepts/Function__.d.ts +420 -418
  241. package/out/concepts/Function__.js +805 -801
  242. package/out/concepts/Function__.js.map +1 -1
  243. package/out/concepts/I18nInfo__.d.ts +44 -44
  244. package/out/concepts/I18nInfo__.js +110 -110
  245. package/out/concepts/I18nInfo__.js.map +1 -1
  246. package/out/concepts/Identifier__.d.ts +54 -52
  247. package/out/concepts/Identifier__.js +309 -305
  248. package/out/concepts/Identifier__.js.map +1 -1
  249. package/out/concepts/IfStatement__.d.ts +161 -159
  250. package/out/concepts/IfStatement__.js +353 -352
  251. package/out/concepts/IfStatement__.js.map +1 -1
  252. package/out/concepts/Integration__.d.ts +146 -144
  253. package/out/concepts/Integration__.js +301 -298
  254. package/out/concepts/Integration__.js.map +1 -1
  255. package/out/concepts/InterfaceFromExample__.d.ts +88 -0
  256. package/out/concepts/InterfaceFromExample__.js +172 -0
  257. package/out/concepts/InterfaceFromExample__.js.map +1 -0
  258. package/out/concepts/InterfaceParam__.d.ts +151 -144
  259. package/out/concepts/InterfaceParam__.js +354 -346
  260. package/out/concepts/InterfaceParam__.js.map +1 -1
  261. package/out/concepts/Interface__.d.ts +334 -331
  262. package/out/concepts/Interface__.js +923 -910
  263. package/out/concepts/Interface__.js.map +1 -1
  264. package/out/concepts/JSBlock__.d.ts +37 -35
  265. package/out/concepts/JSBlock__.js +113 -112
  266. package/out/concepts/JSBlock__.js.map +1 -1
  267. package/out/concepts/JavaLogic__.d.ts +45 -43
  268. package/out/concepts/JavaLogic__.js +127 -128
  269. package/out/concepts/JavaLogic__.js.map +1 -1
  270. package/out/concepts/LogicItem__.d.ts +154 -152
  271. package/out/concepts/LogicItem__.js +289 -291
  272. package/out/concepts/LogicItem__.js.map +1 -1
  273. package/out/concepts/Logic__.d.ts +648 -644
  274. package/out/concepts/Logic__.js +1967 -1946
  275. package/out/concepts/Logic__.js.map +1 -1
  276. package/out/concepts/MatchCase__.d.ts +261 -259
  277. package/out/concepts/MatchCase__.js +703 -693
  278. package/out/concepts/MatchCase__.js.map +1 -1
  279. package/out/concepts/Match__.d.ts +127 -125
  280. package/out/concepts/Match__.js +697 -695
  281. package/out/concepts/Match__.js.map +1 -1
  282. package/out/concepts/MemberExpression__.d.ts +77 -75
  283. package/out/concepts/MemberExpression__.js +496 -495
  284. package/out/concepts/MemberExpression__.js.map +1 -1
  285. package/out/concepts/MicroApp__.d.ts +54 -52
  286. package/out/concepts/MicroApp__.js +122 -127
  287. package/out/concepts/MicroApp__.js.map +1 -1
  288. package/out/concepts/Module__.d.ts +985 -1236
  289. package/out/concepts/Module__.js +1450 -1756
  290. package/out/concepts/Module__.js.map +1 -1
  291. package/out/concepts/MsgTriggerEvent__.d.ts +140 -138
  292. package/out/concepts/MsgTriggerEvent__.js +239 -236
  293. package/out/concepts/MsgTriggerEvent__.js.map +1 -1
  294. package/out/concepts/MsgTriggerLauncher__.d.ts +129 -127
  295. package/out/concepts/MsgTriggerLauncher__.js +234 -232
  296. package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
  297. package/out/concepts/Namespace__.d.ts +1086 -1070
  298. package/out/concepts/Namespace__.js +1546 -1491
  299. package/out/concepts/Namespace__.js.map +1 -1
  300. package/out/concepts/NewComposite__.d.ts +351 -349
  301. package/out/concepts/NewComposite__.js +1261 -1311
  302. package/out/concepts/NewComposite__.js.map +1 -1
  303. package/out/concepts/NewList__.d.ts +138 -136
  304. package/out/concepts/NewList__.js +455 -449
  305. package/out/concepts/NewList__.js.map +1 -1
  306. package/out/concepts/NewMap__.d.ts +229 -227
  307. package/out/concepts/NewMap__.js +600 -589
  308. package/out/concepts/NewMap__.js.map +1 -1
  309. package/out/concepts/New__.d.ts +23 -21
  310. package/out/concepts/New__.js +71 -69
  311. package/out/concepts/New__.js.map +1 -1
  312. package/out/concepts/NullLiteral__.d.ts +29 -27
  313. package/out/concepts/NullLiteral__.js +84 -82
  314. package/out/concepts/NullLiteral__.js.map +1 -1
  315. package/out/concepts/NumericLiteral__.d.ts +59 -57
  316. package/out/concepts/NumericLiteral__.js +190 -189
  317. package/out/concepts/NumericLiteral__.js.map +1 -1
  318. package/out/concepts/OqlQueryComponent__.d.ts +76 -74
  319. package/out/concepts/OqlQueryComponent__.js +368 -365
  320. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  321. package/out/concepts/OverriddenLogic__.d.ts +637 -635
  322. package/out/concepts/OverriddenLogic__.js +1693 -1691
  323. package/out/concepts/OverriddenLogic__.js.map +1 -1
  324. package/out/concepts/Param__.d.ts +182 -180
  325. package/out/concepts/Param__.js +512 -512
  326. package/out/concepts/Param__.js.map +1 -1
  327. package/out/concepts/Point__.d.ts +34 -32
  328. package/out/concepts/Point__.js +82 -82
  329. package/out/concepts/Point__.js.map +1 -1
  330. package/out/concepts/ProcessComponent__.d.ts +222 -220
  331. package/out/concepts/ProcessComponent__.js +360 -360
  332. package/out/concepts/ProcessComponent__.js.map +1 -1
  333. package/out/concepts/ProcessElement__.d.ts +649 -647
  334. package/out/concepts/ProcessElement__.js +1335 -1334
  335. package/out/concepts/ProcessElement__.js.map +1 -1
  336. package/out/concepts/ProcessOutcome__.d.ts +33 -32
  337. package/out/concepts/ProcessOutcome__.js +108 -92
  338. package/out/concepts/ProcessOutcome__.js.map +1 -1
  339. package/out/concepts/ProcessOutcomes__.d.ts +33 -32
  340. package/out/concepts/ProcessOutcomes__.js +110 -93
  341. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  342. package/out/concepts/Process__.d.ts +616 -614
  343. package/out/concepts/Process__.js +1139 -1135
  344. package/out/concepts/Process__.js.map +1 -1
  345. package/out/concepts/QueryAggregateExpression__.d.ts +54 -52
  346. package/out/concepts/QueryAggregateExpression__.js +159 -159
  347. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  348. package/out/concepts/QueryFieldExpression__.d.ts +56 -54
  349. package/out/concepts/QueryFieldExpression__.js +163 -164
  350. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  351. package/out/concepts/QueryFromExpression__.d.ts +101 -99
  352. package/out/concepts/QueryFromExpression__.js +220 -220
  353. package/out/concepts/QueryFromExpression__.js.map +1 -1
  354. package/out/concepts/QueryGroupByExpression__.d.ts +49 -47
  355. package/out/concepts/QueryGroupByExpression__.js +150 -148
  356. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  357. package/out/concepts/QueryJoinExpression__.d.ts +188 -186
  358. package/out/concepts/QueryJoinExpression__.js +347 -348
  359. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  360. package/out/concepts/QueryLimitExpression__.d.ts +60 -58
  361. package/out/concepts/QueryLimitExpression__.js +172 -171
  362. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  363. package/out/concepts/QueryOrderByExpression__.d.ts +71 -69
  364. package/out/concepts/QueryOrderByExpression__.js +185 -184
  365. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  366. package/out/concepts/QuerySelectExpression__.d.ts +206 -204
  367. package/out/concepts/QuerySelectExpression__.js +311 -308
  368. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  369. package/out/concepts/Rect__.d.ts +42 -40
  370. package/out/concepts/Rect__.js +98 -100
  371. package/out/concepts/Rect__.js.map +1 -1
  372. package/out/concepts/Return__.d.ts +147 -145
  373. package/out/concepts/Return__.js +410 -409
  374. package/out/concepts/Return__.js.map +1 -1
  375. package/out/concepts/Role__.d.ts +65 -63
  376. package/out/concepts/Role__.js +172 -173
  377. package/out/concepts/Role__.js.map +1 -1
  378. package/out/concepts/SelectMembers__.d.ts +145 -143
  379. package/out/concepts/SelectMembers__.js +307 -305
  380. package/out/concepts/SelectMembers__.js.map +1 -1
  381. package/out/concepts/Slot__.d.ts +77 -75
  382. package/out/concepts/Slot__.js +175 -178
  383. package/out/concepts/Slot__.js.map +1 -1
  384. package/out/concepts/SqlQueryComponent__.d.ts +74 -72
  385. package/out/concepts/SqlQueryComponent__.js +291 -292
  386. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  387. package/out/concepts/Start__.d.ts +27 -25
  388. package/out/concepts/Start__.js +76 -74
  389. package/out/concepts/Start__.js.map +1 -1
  390. package/out/concepts/StringInterpolation__.d.ts +118 -116
  391. package/out/concepts/StringInterpolation__.js +275 -272
  392. package/out/concepts/StringInterpolation__.js.map +1 -1
  393. package/out/concepts/StringLiteral__.d.ts +45 -43
  394. package/out/concepts/StringLiteral__.js +165 -157
  395. package/out/concepts/StringLiteral__.js.map +1 -1
  396. package/out/concepts/StructureProperty__.d.ts +150 -148
  397. package/out/concepts/StructureProperty__.js +373 -372
  398. package/out/concepts/StructureProperty__.js.map +1 -1
  399. package/out/concepts/Structure__.d.ts +252 -248
  400. package/out/concepts/Structure__.js +521 -506
  401. package/out/concepts/Structure__.js.map +1 -1
  402. package/out/concepts/SwitchCase__.d.ts +97 -95
  403. package/out/concepts/SwitchCase__.js +287 -281
  404. package/out/concepts/SwitchCase__.js.map +1 -1
  405. package/out/concepts/SwitchStatement__.d.ts +87 -85
  406. package/out/concepts/SwitchStatement__.js +212 -209
  407. package/out/concepts/SwitchStatement__.js.map +1 -1
  408. package/out/concepts/Theme__.d.ts +40 -38
  409. package/out/concepts/Theme__.js +91 -89
  410. package/out/concepts/Theme__.js.map +1 -1
  411. package/out/concepts/Transactional__.d.ts +90 -88
  412. package/out/concepts/Transactional__.js +171 -172
  413. package/out/concepts/Transactional__.js.map +1 -1
  414. package/out/concepts/TriggerEvent__.d.ts +123 -121
  415. package/out/concepts/TriggerEvent__.js +236 -234
  416. package/out/concepts/TriggerEvent__.js.map +1 -1
  417. package/out/concepts/TriggerLauncher__.d.ts +84 -82
  418. package/out/concepts/TriggerLauncher__.js +223 -225
  419. package/out/concepts/TriggerLauncher__.js.map +1 -1
  420. package/out/concepts/TypeAnnotation__.d.ts +304 -299
  421. package/out/concepts/TypeAnnotation__.js +1054 -1025
  422. package/out/concepts/TypeAnnotation__.js.map +1 -1
  423. package/out/concepts/TypeParam__.d.ts +28 -26
  424. package/out/concepts/TypeParam__.js +82 -81
  425. package/out/concepts/TypeParam__.js.map +1 -1
  426. package/out/concepts/UnaryExpression__.d.ts +52 -50
  427. package/out/concepts/UnaryExpression__.js +200 -199
  428. package/out/concepts/UnaryExpression__.js.map +1 -1
  429. package/out/concepts/Unparsed__.d.ts +36 -33
  430. package/out/concepts/Unparsed__.js +103 -102
  431. package/out/concepts/Unparsed__.js.map +1 -1
  432. package/out/concepts/UseComponent__.d.ts +34 -32
  433. package/out/concepts/UseComponent__.js +82 -82
  434. package/out/concepts/UseComponent__.js.map +1 -1
  435. package/out/concepts/ValidationRule__.d.ts +152 -150
  436. package/out/concepts/ValidationRule__.js +531 -525
  437. package/out/concepts/ValidationRule__.js.map +1 -1
  438. package/out/concepts/Variable__.d.ts +167 -165
  439. package/out/concepts/Variable__.js +479 -478
  440. package/out/concepts/Variable__.js.map +1 -1
  441. package/out/concepts/ViewBlock__.d.ts +38 -36
  442. package/out/concepts/ViewBlock__.js +90 -91
  443. package/out/concepts/ViewBlock__.js.map +1 -1
  444. package/out/concepts/ViewComponent__.d.ts +568 -566
  445. package/out/concepts/ViewComponent__.js +819 -816
  446. package/out/concepts/ViewComponent__.js.map +1 -1
  447. package/out/concepts/ViewElement__.d.ts +628 -626
  448. package/out/concepts/ViewElement__.js +2315 -2316
  449. package/out/concepts/ViewElement__.js.map +1 -1
  450. package/out/concepts/View__.d.ts +725 -723
  451. package/out/concepts/View__.js +2219 -2217
  452. package/out/concepts/View__.js.map +1 -1
  453. package/out/concepts/WhileStatement__.d.ts +100 -98
  454. package/out/concepts/WhileStatement__.js +251 -247
  455. package/out/concepts/WhileStatement__.js.map +1 -1
  456. package/out/concepts/basics/constants.d.ts +1 -0
  457. package/out/concepts/basics/constants.js +6 -0
  458. package/out/concepts/basics/constants.js.map +1 -0
  459. package/out/concepts/basics/stdlib/index.d.ts +4 -4
  460. package/out/concepts/basics/stdlib/index.js +44 -44
  461. package/out/concepts/basics/stdlib/nasl.auth.d.ts +7 -7
  462. package/out/concepts/basics/stdlib/nasl.auth.js +163 -163
  463. package/out/concepts/basics/stdlib/nasl.browser.d.ts +3 -3
  464. package/out/concepts/basics/stdlib/nasl.browser.js +148 -148
  465. package/out/concepts/basics/stdlib/nasl.collection.d.ts +7 -7
  466. package/out/concepts/basics/stdlib/nasl.collection.js +51 -51
  467. package/out/concepts/basics/stdlib/nasl.configuration.d.ts +3 -3
  468. package/out/concepts/basics/stdlib/nasl.configuration.js +55 -55
  469. package/out/concepts/basics/stdlib/nasl.core.d.ts +5 -5
  470. package/out/concepts/basics/stdlib/nasl.core.js +48 -48
  471. package/out/concepts/basics/stdlib/nasl.event.d.ts +3 -3
  472. package/out/concepts/basics/stdlib/nasl.event.js +24 -24
  473. package/out/concepts/basics/stdlib/nasl.http.d.ts +7 -7
  474. package/out/concepts/basics/stdlib/nasl.http.js +168 -168
  475. package/out/concepts/basics/stdlib/nasl.interface.d.ts +7 -7
  476. package/out/concepts/basics/stdlib/nasl.interface.js +42 -42
  477. package/out/concepts/basics/stdlib/nasl.io.d.ts +3 -3
  478. package/out/concepts/basics/stdlib/nasl.io.js +51 -51
  479. package/out/concepts/basics/stdlib/nasl.logging.d.ts +3 -3
  480. package/out/concepts/basics/stdlib/nasl.logging.js +55 -55
  481. package/out/concepts/basics/stdlib/nasl.process.d.ts +7 -7
  482. package/out/concepts/basics/stdlib/nasl.process.js +637 -637
  483. package/out/concepts/basics/stdlib/nasl.ui.d.ts +7 -7
  484. package/out/concepts/basics/stdlib/nasl.ui.js +1062 -1062
  485. package/out/concepts/basics/stdlib/nasl.util.d.ts +5 -5
  486. package/out/concepts/basics/stdlib/nasl.util.js +2291 -2291
  487. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  488. package/out/concepts/basics/stdlib/nasl.validation.d.ts +3 -3
  489. package/out/concepts/basics/stdlib/nasl.validation.js +564 -564
  490. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts +5 -5
  491. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +25 -25
  492. package/out/concepts/basics/stdlib/timeZone.d.ts +5 -5
  493. package/out/concepts/basics/stdlib/timeZone.js +195 -195
  494. package/out/concepts/basics/types/coreTypeList.d.ts +2 -2
  495. package/out/concepts/basics/types/coreTypeList.js +14 -14
  496. package/out/concepts/basics/types/index.d.ts +16 -16
  497. package/out/concepts/basics/types/index.js +34 -34
  498. package/out/concepts/index.d.ts +6 -6
  499. package/out/concepts/index.js +24 -24
  500. package/out/concepts/index__.d.ts +126 -124
  501. package/out/concepts/index__.js +142 -140
  502. package/out/concepts/index__.js.map +1 -1
  503. package/out/concepts/types__.d.ts +128 -126
  504. package/out/concepts/types__.js +2 -2
  505. package/out/config.d.ts +43 -43
  506. package/out/config.js +71 -71
  507. package/out/decorators/index.d.ts +69 -57
  508. package/out/decorators/index.js +216 -172
  509. package/out/decorators/index.js.map +1 -1
  510. package/out/decorators/promise.d.ts +7 -7
  511. package/out/decorators/promise.js +27 -27
  512. package/out/enums/KEYWORDS.d.ts +6 -6
  513. package/out/enums/KEYWORDS.js +1245 -1243
  514. package/out/enums/KEYWORDS.js.map +1 -1
  515. package/out/enums/LEVEL_NAME_MAP.d.ts +26 -26
  516. package/out/enums/LEVEL_NAME_MAP.js +29 -29
  517. package/out/eventBus.d.ts +3 -3
  518. package/out/eventBus.js +6 -6
  519. package/out/generator/compileComponent.d.ts +11 -11
  520. package/out/generator/compileComponent.js +11 -11
  521. package/out/generator/genBundleFiles.d.ts +34 -34
  522. package/out/generator/genBundleFiles.js +356 -356
  523. package/out/generator/genBundleFiles.js.map +1 -1
  524. package/out/generator/genHash.d.ts +7 -7
  525. package/out/generator/genHash.js +38 -38
  526. package/out/generator/genMetaData.d.ts +31 -31
  527. package/out/generator/genMetaData.js +305 -301
  528. package/out/generator/genMetaData.js.map +1 -1
  529. package/out/generator/genReleaseBody.d.ts +72 -72
  530. package/out/generator/genReleaseBody.js +323 -321
  531. package/out/generator/genReleaseBody.js.map +1 -1
  532. package/out/generator/icestark.d.ts +2 -2
  533. package/out/generator/icestark.js +7 -5
  534. package/out/generator/icestark.js.map +1 -1
  535. package/out/generator/index.d.ts +7 -7
  536. package/out/generator/index.js +23 -23
  537. package/out/generator/microApp.d.ts +2 -2
  538. package/out/generator/microApp.js +35 -35
  539. package/out/generator/permission.d.ts +10 -10
  540. package/out/generator/permission.js +269 -269
  541. package/out/generator/qiankun.d.ts +2 -2
  542. package/out/generator/qiankun.js +6 -4
  543. package/out/generator/qiankun.js.map +1 -1
  544. package/out/generator/styleReplacer.d.ts +3 -3
  545. package/out/generator/styleReplacer.js +67 -67
  546. package/out/index.d.ts +13 -13
  547. package/out/index.js +66 -66
  548. package/out/manager/diagnostic.d.ts +35 -35
  549. package/out/manager/diagnostic.js +62 -62
  550. package/out/manager/stepRecorder.d.ts +20 -20
  551. package/out/manager/stepRecorder.js +108 -108
  552. package/out/natural/componentData.d.ts +31 -31
  553. package/out/natural/componentData.js +84 -84
  554. package/out/natural/genNaturalTS.d.ts +3 -3
  555. package/out/natural/genNaturalTS.js +89 -90
  556. package/out/natural/genNaturalTS.js.map +1 -1
  557. package/out/natural/index.d.ts +2 -2
  558. package/out/natural/index.js +18 -18
  559. package/out/natural/naslStdlibMap.d.ts +2 -2
  560. package/out/natural/naslStdlibMap.js +25 -25
  561. package/out/natural/transformTSCode.d.ts +7 -7
  562. package/out/natural/transformTSCode.js +919 -877
  563. package/out/natural/transformTSCode.js.map +1 -1
  564. package/out/sentry/index.d.ts +34 -34
  565. package/out/sentry/index.js +148 -147
  566. package/out/sentry/index.js.map +1 -1
  567. package/out/server/createUiTs.d.ts +16 -16
  568. package/out/server/createUiTs.js +242 -242
  569. package/out/server/entity2LogicNamespace.d.ts +10 -10
  570. package/out/server/entity2LogicNamespace.js +381 -381
  571. package/out/server/event.d.ts +30 -30
  572. package/out/server/event.js +150 -150
  573. package/out/server/extendBaseNode.d.ts +1 -1
  574. package/out/server/extendBaseNode.js +574 -543
  575. package/out/server/extendBaseNode.js.map +1 -1
  576. package/out/server/formatTsUtils.d.ts +37 -37
  577. package/out/server/formatTsUtils.js +851 -851
  578. package/out/server/getConnector.d.ts +14 -14
  579. package/out/server/getConnector.js +77 -77
  580. package/out/server/getExtensionModules.d.ts +3 -3
  581. package/out/server/getExtensionModules.js +33 -33
  582. package/out/server/getFunctions.d.ts +3 -3
  583. package/out/server/getFunctions.js +19 -19
  584. package/out/server/getInterfaces.d.ts +2 -2
  585. package/out/server/getInterfaces.js +47 -47
  586. package/out/server/getLogging.d.ts +1 -1
  587. package/out/server/getLogging.js +8 -8
  588. package/out/server/getLogics.d.ts +4 -4
  589. package/out/server/getLogics.js +380 -380
  590. package/out/server/getMemberIdentifier.d.ts +17 -17
  591. package/out/server/getMemberIdentifier.js +508 -508
  592. package/out/server/getProcessComponents.d.ts +2 -2
  593. package/out/server/getProcessComponents.js +12 -12
  594. package/out/server/getProcesses.d.ts +33 -33
  595. package/out/server/getProcesses.js +596 -596
  596. package/out/server/getScope.d.ts +13 -13
  597. package/out/server/getScope.js +60 -60
  598. package/out/server/getValidates.d.ts +3 -3
  599. package/out/server/getValidates.js +13 -13
  600. package/out/server/index.d.ts +5 -5
  601. package/out/server/index.js +41 -41
  602. package/out/server/naslServer.d.ts +375 -371
  603. package/out/server/naslServer.js +4706 -4585
  604. package/out/server/naslServer.js.map +1 -1
  605. package/out/server/naslStdlibMap.d.ts +2 -2
  606. package/out/server/naslStdlibMap.js +53 -53
  607. package/out/server/process2LogicNamespace.d.ts +26 -26
  608. package/out/server/process2LogicNamespace.js +108 -108
  609. package/out/server/translator.d.ts +26 -26
  610. package/out/server/translator.js +819 -805
  611. package/out/server/translator.js.map +1 -1
  612. package/out/service/creator/add.configs.d.ts +1 -1
  613. package/out/service/creator/add.configs.js +102 -102
  614. package/out/service/creator/errHandles.d.ts +18 -18
  615. package/out/service/creator/errHandles.js +67 -67
  616. package/out/service/creator/index.d.ts +1 -1
  617. package/out/service/creator/index.js +86 -86
  618. package/out/service/datasource/api.d.ts +12 -12
  619. package/out/service/datasource/api.js +13 -13
  620. package/out/service/datasource/index.d.ts +2 -2
  621. package/out/service/datasource/index.js +9 -9
  622. package/out/service/defaultErrorMessage.json +98 -98
  623. package/out/service/logic/api.d.ts +9 -9
  624. package/out/service/logic/api.js +10 -10
  625. package/out/service/logic/checktypeSocket.d.ts +5 -5
  626. package/out/service/logic/checktypeSocket.js +54 -54
  627. package/out/service/logic/index.d.ts +2 -2
  628. package/out/service/logic/index.js +9 -9
  629. package/out/service/storage/api.d.ts +54 -54
  630. package/out/service/storage/api.js +41 -41
  631. package/out/service/storage/index.d.ts +2 -2
  632. package/out/service/storage/index.js +9 -9
  633. package/out/service/storage/init.d.ts +102 -102
  634. package/out/service/storage/init.js +1161 -1161
  635. package/out/service/storage/jsoner.d.ts +36 -36
  636. package/out/service/storage/jsoner.js +128 -130
  637. package/out/service/storage/jsoner.js.map +1 -1
  638. package/out/service/storage/map.d.ts +4 -4
  639. package/out/service/storage/map.js +53 -53
  640. package/out/service/storage/service.d.ts +25 -25
  641. package/out/service/storage/service.js +79 -79
  642. package/out/service/storage/storagePoint.d.ts +17 -17
  643. package/out/service/storage/storagePoint.js +75 -75
  644. package/out/service/video/BaseService.d.ts +7 -7
  645. package/out/service/video/BaseService.js +60 -60
  646. package/out/service/video/MainCallbackService.d.ts +12 -12
  647. package/out/service/video/MainCallbackService.js +182 -182
  648. package/out/service/video/VideoTranscribe.d.ts +15 -15
  649. package/out/service/video/VideoTranscribe.js +95 -95
  650. package/out/service/video/publishService.d.ts +1 -1
  651. package/out/service/video/publishService.js +57 -57
  652. package/out/templator/genCallComponentLogic.d.ts +17 -17
  653. package/out/templator/genCallComponentLogic.js +28 -28
  654. package/out/templator/genCreateBlock.d.ts +10 -10
  655. package/out/templator/genCreateBlock.js +297 -297
  656. package/out/templator/genCurdEditMultipleKeyBlock.d.ts +8 -8
  657. package/out/templator/genCurdEditMultipleKeyBlock.js +398 -398
  658. package/out/templator/genCurdMultipleKeyBlock.d.ts +34 -34
  659. package/out/templator/genCurdMultipleKeyBlock.js +541 -541
  660. package/out/templator/genEditTableBlock.d.ts +51 -51
  661. package/out/templator/genEditTableBlock.js +255 -255
  662. package/out/templator/genEnumSelectBlock.d.ts +10 -10
  663. package/out/templator/genEnumSelectBlock.js +21 -21
  664. package/out/templator/genGetBlock.d.ts +6 -6
  665. package/out/templator/genGetBlock.js +96 -96
  666. package/out/templator/genGridViewBlock.d.ts +55 -55
  667. package/out/templator/genGridViewBlock.js +286 -286
  668. package/out/templator/genListViewBlock.d.ts +19 -19
  669. package/out/templator/genListViewBlock.js +108 -108
  670. package/out/templator/genQueryComponent.d.ts +34 -34
  671. package/out/templator/genQueryComponent.js +348 -348
  672. package/out/templator/genSelectBlock.d.ts +45 -45
  673. package/out/templator/genSelectBlock.js +340 -340
  674. package/out/templator/genTableBlock.d.ts +53 -53
  675. package/out/templator/genTableBlock.js +226 -226
  676. package/out/templator/genUpdateBlock.d.ts +6 -6
  677. package/out/templator/genUpdateBlock.js +322 -322
  678. package/out/templator/index.d.ts +19 -19
  679. package/out/templator/index.js +37 -37
  680. package/out/templator/utils.d.ts +683 -683
  681. package/out/templator/utils.js +458 -458
  682. package/out/translator/constant.d.ts +6 -6
  683. package/out/translator/constant.js +9 -9
  684. package/out/translator/index.d.ts +3 -3
  685. package/out/translator/index.js +19 -19
  686. package/out/translator/types.d.ts +33 -32
  687. package/out/translator/types.js +2 -2
  688. package/out/translator/utils.d.ts +17 -17
  689. package/out/translator/utils.js +110 -97
  690. package/out/translator/utils.js.map +1 -1
  691. package/out/utils/cookie.d.ts +9 -9
  692. package/out/utils/cookie.js +61 -61
  693. package/out/utils/env.d.ts +2 -2
  694. package/out/utils/env.js +5 -5
  695. package/out/utils/i18nInfo.d.ts +5 -5
  696. package/out/utils/i18nInfo.js +60 -60
  697. package/out/utils/index.d.ts +44 -44
  698. package/out/utils/index.js +200 -200
  699. package/out/utils/logger.d.ts +7 -7
  700. package/out/utils/logger.js +22 -22
  701. package/out/utils/sortTsString.d.ts +1 -1
  702. package/out/utils/sortTsString.js +43 -37
  703. package/out/utils/sortTsString.js.map +1 -1
  704. package/out/utils/string.d.ts +51 -51
  705. package/out/utils/string.js +106 -106
  706. package/out/utils/time-slicing.d.ts +41 -41
  707. package/out/utils/time-slicing.js +81 -81
  708. package/out/utils/traverse.d.ts +36 -36
  709. package/out/utils/traverse.js +142 -142
  710. package/out/utils/types.d.ts +1 -1
  711. package/out/utils/types.js +2 -2
  712. package/out/utils/window.d.ts +7 -7
  713. package/out/utils/window.js +13 -13
  714. package/package.json +8 -8
  715. package/sandbox/stdlib/nasl.oql.ts +6 -1
  716. package/sandbox-natural/stdlib/nasl.core.ts +6 -3
  717. package/sandbox-natural/stdlib/nasl.oql.ts +6 -0
  718. package/sandbox-natural/stdlib/nasl.util.ts +2 -1
  719. package/src/automate/template/myProcess.js +3 -2
  720. package/src/common/BaseNode.ts +108 -51
  721. package/src/concepts/Abort__.ts +4 -1
  722. package/src/concepts/AbstractInterface__.ts +64 -0
  723. package/src/concepts/Anchor__.ts +6 -2
  724. package/src/concepts/AnonymousFunction__.ts +11 -5
  725. package/src/concepts/App__.ts +1648 -1378
  726. package/src/concepts/Argument__.ts +7 -3
  727. package/src/concepts/Assignee__.ts +10 -5
  728. package/src/concepts/AssignmentLine__.ts +3 -0
  729. package/src/concepts/Assignment__.ts +8 -4
  730. package/src/concepts/Attribute__.ts +7 -2
  731. package/src/concepts/AuthInterface__.ts +3 -0
  732. package/src/concepts/AuthLogicForCallInterface__.ts +8 -4
  733. package/src/concepts/AuthLogic__.ts +3 -0
  734. package/src/concepts/BackendVariable__.ts +11 -4
  735. package/src/concepts/Backend__.ts +5 -1
  736. package/src/concepts/BatchAssignment__.ts +13 -8
  737. package/src/concepts/BinaryExpression__.ts +10 -6
  738. package/src/concepts/BindAttribute__.ts +6 -2
  739. package/src/concepts/BindDirective__.ts +11 -4
  740. package/src/concepts/BindEvent__.ts +8 -3
  741. package/src/concepts/BindStyle__.ts +5 -1
  742. package/src/concepts/BooleanLiteral__.ts +4 -1
  743. package/src/concepts/CallAuthInterface__.ts +11 -3
  744. package/src/concepts/CallConnector__.ts +3 -0
  745. package/src/concepts/CallFunction__.ts +41 -15
  746. package/src/concepts/CallInterface__.ts +33 -21
  747. package/src/concepts/CallLogic__.ts +41 -35
  748. package/src/concepts/CallQueryComponent__.ts +11 -14
  749. package/src/concepts/Comment__.ts +3 -0
  750. package/src/concepts/CompletionProperty__.ts +5 -1
  751. package/src/concepts/ConfigGroup__.ts +5 -1
  752. package/src/concepts/ConfigPropertyValue__.ts +3 -0
  753. package/src/concepts/ConfigProperty__.ts +5 -1
  754. package/src/concepts/Configuration__.ts +5 -1
  755. package/src/concepts/Connection__.ts +5 -1
  756. package/src/concepts/ConnectorTrigger__.ts +3 -0
  757. package/src/concepts/Connector__.ts +910 -25
  758. package/src/concepts/Constant__.ts +9 -4
  759. package/src/concepts/DataSource__.ts +5 -1
  760. package/src/concepts/DatabaseTypeAnnotation__.ts +3 -0
  761. package/src/concepts/DefaultValue__.ts +4 -3
  762. package/src/concepts/Destination__.ts +8 -4
  763. package/src/concepts/End__.ts +3 -0
  764. package/src/concepts/EntityIndex__.ts +3 -0
  765. package/src/concepts/EntityProperty__.ts +14 -4
  766. package/src/concepts/Entity__.ts +17 -2
  767. package/src/concepts/EnumItem__.ts +3 -0
  768. package/src/concepts/Enum__.ts +5 -1
  769. package/src/concepts/Event__.ts +5 -1
  770. package/src/concepts/ExternalDestination__.ts +7 -3
  771. package/src/concepts/ForEachStatement__.ts +21 -16
  772. package/src/concepts/FrontendLibrary__.ts +7 -2
  773. package/src/concepts/FrontendVariable__.ts +3 -0
  774. package/src/concepts/Frontend__.ts +59 -14
  775. package/src/concepts/Function__.ts +15 -7
  776. package/src/concepts/I18nInfo__.ts +1 -0
  777. package/src/concepts/Identifier__.ts +9 -2
  778. package/src/concepts/IfStatement__.ts +25 -22
  779. package/src/concepts/Integration__.ts +8 -4
  780. package/src/concepts/InterfaceFromExample__.ts +194 -0
  781. package/src/concepts/InterfaceParam__.ts +20 -4
  782. package/src/concepts/Interface__.ts +51 -25
  783. package/src/concepts/JSBlock__.ts +3 -0
  784. package/src/concepts/JavaLogic__.ts +3 -0
  785. package/src/concepts/LogicItem__.ts +3 -0
  786. package/src/concepts/Logic__.ts +48 -19
  787. package/src/concepts/MatchCase__.ts +16 -5
  788. package/src/concepts/Match__.ts +8 -4
  789. package/src/concepts/MemberExpression__.ts +8 -4
  790. package/src/concepts/MicroApp__.ts +3 -0
  791. package/src/concepts/Module__.ts +286 -893
  792. package/src/concepts/MsgTriggerEvent__.ts +5 -1
  793. package/src/concepts/MsgTriggerLauncher__.ts +6 -2
  794. package/src/concepts/Namespace__.ts +246 -173
  795. package/src/concepts/NewComposite__.ts +54 -103
  796. package/src/concepts/NewList__.ts +27 -18
  797. package/src/concepts/NewMap__.ts +29 -15
  798. package/src/concepts/New__.ts +3 -0
  799. package/src/concepts/NullLiteral__.ts +4 -1
  800. package/src/concepts/NumericLiteral__.ts +6 -2
  801. package/src/concepts/OqlQueryComponent__.ts +8 -1
  802. package/src/concepts/OverriddenLogic__.ts +18 -7
  803. package/src/concepts/Param__.ts +8 -2
  804. package/src/concepts/Point__.ts +3 -0
  805. package/src/concepts/ProcessComponent__.ts +7 -2
  806. package/src/concepts/ProcessElement__.ts +19 -8
  807. package/src/concepts/ProcessOutcome__.ts +20 -2
  808. package/src/concepts/ProcessOutcomes__.ts +20 -2
  809. package/src/concepts/Process__.ts +15 -7
  810. package/src/concepts/QueryAggregateExpression__.ts +5 -1
  811. package/src/concepts/QueryFieldExpression__.ts +3 -0
  812. package/src/concepts/QueryFromExpression__.ts +5 -1
  813. package/src/concepts/QueryGroupByExpression__.ts +5 -1
  814. package/src/concepts/QueryJoinExpression__.ts +5 -1
  815. package/src/concepts/QueryLimitExpression__.ts +5 -1
  816. package/src/concepts/QueryOrderByExpression__.ts +5 -1
  817. package/src/concepts/QuerySelectExpression__.ts +5 -1
  818. package/src/concepts/Rect__.ts +3 -0
  819. package/src/concepts/Return__.ts +9 -3
  820. package/src/concepts/Role__.ts +3 -0
  821. package/src/concepts/SelectMembers__.ts +5 -1
  822. package/src/concepts/Slot__.ts +5 -1
  823. package/src/concepts/SqlQueryComponent__.ts +5 -1
  824. package/src/concepts/Start__.ts +3 -0
  825. package/src/concepts/StringInterpolation__.ts +7 -3
  826. package/src/concepts/StringLiteral__.ts +12 -3
  827. package/src/concepts/StructureProperty__.ts +12 -4
  828. package/src/concepts/Structure__.ts +25 -3
  829. package/src/concepts/SwitchCase__.ts +9 -1
  830. package/src/concepts/SwitchStatement__.ts +7 -3
  831. package/src/concepts/Theme__.ts +3 -0
  832. package/src/concepts/Transactional__.ts +3 -0
  833. package/src/concepts/TriggerEvent__.ts +5 -1
  834. package/src/concepts/TriggerLauncher__.ts +3 -0
  835. package/src/concepts/TypeAnnotation__.ts +62 -23
  836. package/src/concepts/TypeParam__.ts +3 -0
  837. package/src/concepts/UnaryExpression__.ts +8 -4
  838. package/src/concepts/Unparsed__.ts +5 -2
  839. package/src/concepts/UseComponent__.ts +3 -0
  840. package/src/concepts/ValidationRule__.ts +21 -7
  841. package/src/concepts/Variable__.ts +10 -4
  842. package/src/concepts/ViewBlock__.ts +3 -0
  843. package/src/concepts/ViewComponent__.ts +15 -6
  844. package/src/concepts/ViewElement__.ts +13 -5
  845. package/src/concepts/View__.ts +27 -11
  846. package/src/concepts/WhileStatement__.ts +7 -1
  847. package/src/concepts/basics/constants.ts +2 -0
  848. package/src/concepts/basics/stdlib/nasl.util.ts +3 -3
  849. package/src/concepts/index__.ts +2 -0
  850. package/src/concepts/types__.ts +4 -0
  851. package/src/decorators/index.ts +55 -0
  852. package/src/enums/KEYWORDS.ts +2 -0
  853. package/src/generator/genBundleFiles.ts +7 -7
  854. package/src/generator/genMetaData.ts +7 -2
  855. package/src/generator/genReleaseBody.ts +8 -4
  856. package/src/generator/icestark.ts +4 -2
  857. package/src/generator/qiankun.ts +3 -1
  858. package/src/natural/genNaturalTS.ts +5 -6
  859. package/src/natural/transformTSCode.ts +53 -13
  860. package/src/sentry/index.ts +3 -1
  861. package/src/server/extendBaseNode.ts +30 -2
  862. package/src/server/naslServer.ts +142 -22
  863. package/src/server/translator.ts +13 -1
  864. package/src/service/storage/jsoner.ts +2 -2
  865. package/src/translator/types.ts +1 -0
  866. package/src/translator/utils.ts +15 -0
  867. package/src/utils/sortTsString.ts +9 -4
  868. package/test/concepts/call-function/__snapshots__/toEmbeddedTS.spec.ts.snap +26 -0
  869. package/test/concepts/call-function/__snapshots__/toJS.spec.ts.snap +26 -0
  870. package/test/concepts/call-function/constant.ts +5 -0
  871. package/test/concepts/call-function/fixtures/from-string.json +100 -0
  872. package/test/concepts/call-function/fixtures/to-string-global-tz.json +99 -0
  873. package/test/concepts/call-function/fixtures/to-string-no-tz.json +89 -0
  874. package/test/concepts/call-function/fixtures/to-string-user-tz.json +101 -0
  875. package/test/concepts/call-function/fixtures/to-string-utc-tz.json +101 -0
  876. package/test/concepts/call-function/toEmbeddedTS.spec.ts +14 -0
  877. package/test/concepts/call-function/toJS.spec.ts +14 -0
  878. package/test/concepts/call-interface/__snapshots__/toEmbeddedTS.spec.ts.snap +6 -3
  879. package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +3 -3
  880. package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +3 -3
@@ -1,1757 +1,1451 @@
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 Module_1;
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Module = void 0;
37
- const moduleNameSpace = {
38
- dependencies: 'extensions',
39
- interfaceDependencies: 'apis',
40
- componentDependencies: 'components',
41
- };
42
- const ConfigProperty__1 = __importDefault(require("./ConfigProperty__"));
43
- const decorators_1 = require("../decorators");
44
- const utils = __importStar(require("../utils"));
45
- const BaseNode_1 = __importDefault(require("../common/BaseNode"));
46
- const DataSource__1 = __importDefault(require("./DataSource__"));
47
- const Structure__1 = __importDefault(require("./Structure__"));
48
- const Enum__1 = __importDefault(require("./Enum__"));
49
- const Logic__1 = __importDefault(require("./Logic__"));
50
- const Interface__1 = __importDefault(require("./Interface__"));
51
- const View__1 = __importDefault(require("./View__"));
52
- const Variable__1 = __importDefault(require("./Variable__"));
53
- const Process__1 = __importDefault(require("./Process__"));
54
- const FrontendLibrary__1 = __importDefault(require("./FrontendLibrary__"));
55
- const TriggerLauncher__1 = __importDefault(require("./TriggerLauncher__"));
56
- const Connection__1 = __importDefault(require("./Connection__"));
57
- /**
58
- * 模块
59
- */
60
- let Module = class Module extends BaseNode_1.default {
61
- static { Module_1 = this; }
62
- /** 类名 */
63
- static ConceptName = 'Module';
64
- /**
65
- * 产品概念
66
- */
67
- concept;
68
- /**
69
- * type
70
- */
71
- // @ts-ignore
72
- type;
73
- /**
74
- * version
75
- */
76
- // @ts-ignore
77
- version;
78
- /**
79
- * 模块名称
80
- */
81
- // @ts-ignore
82
- name;
83
- /**
84
- * 模块标题
85
- */
86
- // @ts-ignore
87
- title;
88
- /**
89
- * 模块描述
90
- */
91
- // @ts-ignore
92
- description;
93
- /**
94
- * provider
95
- */
96
- // @ts-ignore
97
- provider;
98
- /**
99
- * 外部语言依赖
100
- */
101
- // @ts-ignore
102
- externalDependencyMap;
103
- /**
104
- * 外部语言依赖
105
- */
106
- // @ts-ignore
107
- compilerInfoMap;
108
- /**
109
- * 数据源列表
110
- */
111
- dataSources = [];
112
- /**
113
- * 数据结构列表
114
- */
115
- structures = [];
116
- /**
117
- * 枚举列表
118
- */
119
- enums = [];
120
- /**
121
- * 逻辑列表
122
- */
123
- logics = [];
124
- /**
125
- * 接口列表
126
- */
127
- interfaces = [];
128
- /**
129
- * 页面列表
130
- */
131
- views = [];
132
- /**
133
- * 变量列表
134
- */
135
- frontendVariables = [];
136
- /**
137
- * 流程列表
138
- */
139
- processes = [];
140
- /**
141
- * 前端库列表
142
- */
143
- frontends = [];
144
- /**
145
- * 配置管理
146
- */
147
- // @ts-ignore
148
- configuration;
149
- /**
150
- * 暴露接口的接口鉴权
151
- */
152
- authLogics = [];
153
- /**
154
- * 调用接口的鉴权模板
155
- */
156
- authLogicsForCallInterface = [];
157
- /**
158
- * 触发器启动器列表
159
- */
160
- triggerLaunchers = [];
161
- /**
162
- * 连接列表
163
- */
164
- connections = [];
165
- /**
166
- * 祖先 App
167
- */
168
- get app() {
169
- return this.getAncestor('App');
170
- }
171
- /**
172
- * @param source 需要合并的部分参数
173
- */
174
- constructor(source) {
175
- source = Object.assign({}, Module_1.getDefaultOptions(), source);
176
- super(source);
177
- super.subConstructor(source);
178
- }
179
- static from(source, parentNode, parentKey) {
180
- return super.from(source, parentNode, parentKey);
181
- }
182
- /**
183
- * 从父级删除该节点
184
- * @internal
185
- */
186
- _delete() {
187
- let params = null;
188
- if (this.parentNode) {
189
- params = this.parentNode?.__removeModule?.(this);
190
- }
191
- return params;
192
- }
193
- getDataSourceExistingNames(excludedList = []) {
194
- const excludedSet = new Set(excludedList);
195
- return (this.dataSources || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
196
- }
197
- getDataSourceUniqueName(name = 'dataSource1') {
198
- return utils.unique(name, this.getDataSourceExistingNames(), undefined, false);
199
- }
200
- _insertDataSourceAt(options, index) {
201
- const dataSourceOptions = {};
202
- const relationOptions = { parentNode: this, parentKey: 'dataSources' };
203
- let dataSource;
204
- if (!options) {
205
- dataSource = DataSource__1.default.from({
206
- ...dataSourceOptions,
207
- name: this.getDataSourceUniqueName(),
208
- }, this, 'dataSources');
209
- }
210
- else if (typeof options === 'string') {
211
- dataSource = DataSource__1.default.from({
212
- ...dataSourceOptions,
213
- name: options,
214
- }, this, 'dataSources');
215
- }
216
- else if (options instanceof DataSource__1.default) {
217
- options.ensureDelete(); // 同一实例不支持多处存在
218
- dataSource = options;
219
- Object.assign(dataSource, relationOptions);
220
- }
221
- else {
222
- dataSource = DataSource__1.default.from({
223
- ...dataSourceOptions,
224
- ...options,
225
- }, this, 'dataSources');
226
- }
227
- this.dataSources.splice(index, 0, dataSource);
228
- return dataSource;
229
- }
230
- insertDataSourceAt(options, index) {
231
- const node = this._insertDataSourceAt(options, index);
232
- node.create({
233
- index,
234
- parentNode: this,
235
- parentKey: 'dataSources',
236
- });
237
- return node;
238
- }
239
- _addDataSource(options) {
240
- const index = 0;
241
- return this._insertDataSourceAt(options, index);
242
- }
243
- addDataSource(options) {
244
- const node = this._addDataSource(options);
245
- const index = this.dataSources.indexOf(node);
246
- node.create({
247
- index,
248
- parentNode: this,
249
- parentKey: 'dataSources',
250
- });
251
- return node;
252
- }
253
- getStructureExistingNames(excludedList = []) {
254
- const excludedSet = new Set(excludedList);
255
- return (this.structures || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
256
- }
257
- getStructureUniqueName(name = 'Structure1') {
258
- return utils.unique(name, this.getStructureExistingNames(), undefined, false);
259
- }
260
- _insertStructureAt(options, index) {
261
- const structureOptions = {};
262
- const relationOptions = { parentNode: this, parentKey: 'structures' };
263
- let structure;
264
- if (!options) {
265
- structure = Structure__1.default.from({
266
- ...structureOptions,
267
- name: this.getStructureUniqueName(),
268
- }, this, 'structures');
269
- }
270
- else if (typeof options === 'string') {
271
- structure = Structure__1.default.from({
272
- ...structureOptions,
273
- name: options,
274
- }, this, 'structures');
275
- }
276
- else if (options instanceof Structure__1.default) {
277
- options.ensureDelete(); // 同一实例不支持多处存在
278
- structure = options;
279
- Object.assign(structure, relationOptions);
280
- }
281
- else {
282
- structure = Structure__1.default.from({
283
- ...structureOptions,
284
- ...options,
285
- }, this, 'structures');
286
- }
287
- this.structures.splice(index, 0, structure);
288
- return structure;
289
- }
290
- insertStructureAt(options, index) {
291
- const node = this._insertStructureAt(options, index);
292
- node.create({
293
- index,
294
- parentNode: this,
295
- parentKey: 'structures',
296
- });
297
- return node;
298
- }
299
- _addStructure(options) {
300
- const index = 0;
301
- return this._insertStructureAt(options, index);
302
- }
303
- addStructure(options) {
304
- const node = this._addStructure(options);
305
- const index = this.structures.indexOf(node);
306
- node.create({
307
- index,
308
- parentNode: this,
309
- parentKey: 'structures',
310
- });
311
- return node;
312
- }
313
- getEnumExistingNames(excludedList = []) {
314
- const excludedSet = new Set(excludedList);
315
- return (this.enums || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
316
- }
317
- getEnumUniqueName(name = 'Enum1') {
318
- return utils.unique(name, this.getEnumExistingNames(), undefined, false);
319
- }
320
- _insertEnumAt(options, index) {
321
- const enumerationOptions = {};
322
- const relationOptions = { parentNode: this, parentKey: 'enums' };
323
- let enumeration;
324
- if (!options) {
325
- enumeration = Enum__1.default.from({
326
- ...enumerationOptions,
327
- name: this.getEnumUniqueName(),
328
- }, this, 'enums');
329
- }
330
- else if (typeof options === 'string') {
331
- enumeration = Enum__1.default.from({
332
- ...enumerationOptions,
333
- name: options,
334
- }, this, 'enums');
335
- }
336
- else if (options instanceof Enum__1.default) {
337
- options.ensureDelete(); // 同一实例不支持多处存在
338
- enumeration = options;
339
- Object.assign(enumeration, relationOptions);
340
- }
341
- else {
342
- enumeration = Enum__1.default.from({
343
- ...enumerationOptions,
344
- ...options,
345
- }, this, 'enums');
346
- }
347
- this.enums.splice(index, 0, enumeration);
348
- return enumeration;
349
- }
350
- insertEnumAt(options, index) {
351
- const node = this._insertEnumAt(options, index);
352
- node.create({
353
- index,
354
- parentNode: this,
355
- parentKey: 'enums',
356
- });
357
- return node;
358
- }
359
- _addEnum(options) {
360
- const index = 0;
361
- return this._insertEnumAt(options, index);
362
- }
363
- addEnum(options) {
364
- const node = this._addEnum(options);
365
- const index = this.enums.indexOf(node);
366
- node.create({
367
- index,
368
- parentNode: this,
369
- parentKey: 'enums',
370
- });
371
- return node;
372
- }
373
- getLogicExistingNames(excludedList = []) {
374
- const excludedSet = new Set(excludedList);
375
- return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
376
- }
377
- getLogicUniqueName(name = 'logic1') {
378
- return utils.unique(name, this.getLogicExistingNames(), undefined, false);
379
- }
380
- _insertLogicInLogicsAt(options, index) {
381
- const logicOptions = {};
382
- const relationOptions = { parentNode: this, parentKey: 'logics' };
383
- let logic;
384
- if (!options) {
385
- logic = Logic__1.default.from({
386
- ...logicOptions,
387
- name: this.getLogicUniqueName(),
388
- }, this, 'logics');
389
- }
390
- else if (typeof options === 'string') {
391
- logic = Logic__1.default.from({
392
- ...logicOptions,
393
- name: options,
394
- }, this, 'logics');
395
- }
396
- else if (options instanceof Logic__1.default) {
397
- options.ensureDelete(); // 同一实例不支持多处存在
398
- logic = options;
399
- Object.assign(logic, relationOptions);
400
- }
401
- else {
402
- logic = Logic__1.default.from({
403
- ...logicOptions,
404
- ...options,
405
- }, this, 'logics');
406
- }
407
- this.logics.splice(index, 0, logic);
408
- return logic;
409
- }
410
- insertLogicInLogicsAt(options, index) {
411
- const node = this._insertLogicInLogicsAt(options, index);
412
- node.create({
413
- index,
414
- parentNode: this,
415
- parentKey: 'logics',
416
- });
417
- return node;
418
- }
419
- _addLogicInLogics(options) {
420
- const index = 0;
421
- return this._insertLogicInLogicsAt(options, index);
422
- }
423
- addLogicInLogics(options) {
424
- const node = this._addLogicInLogics(options);
425
- const index = this.logics.indexOf(node);
426
- node.create({
427
- index,
428
- parentNode: this,
429
- parentKey: 'logics',
430
- });
431
- return node;
432
- }
433
- _insertAuthLogicInAuthLogicsAt(options, index) {
434
- const authLogicOptions = {};
435
- const relationOptions = { parentNode: this, parentKey: 'authLogics' };
436
- let authLogic;
437
- if (!options) {
438
- // authLogic = AuthLogic.from({
439
- // ...authLogicOptions,
440
- // name: this.getAuthLogicUniqueName(),
441
- // }, this, 'authLogics');
442
- throw Error('请先调用from方法');
443
- }
444
- else if (typeof options === 'string') {
445
- // authLogic = AuthLogic.from({
446
- // ...authLogicOptions,
447
- // name: options,
448
- // }, this, 'authLogics');
449
- // FIXME : dont change
450
- throw Error('请先调用from方法');
451
- }
452
- else if (options.concept === 'AuthLogic') {
453
- options.ensureDelete(); // 同一实例不支持多处存在
454
- authLogic = options;
455
- Object.assign(authLogic, relationOptions);
456
- }
457
- else {
458
- // authLogic = AuthLogic.from({
459
- // ...authLogicOptions,
460
- // ...options,
461
- // }, this, 'authLogics');
462
- throw Error('请先调用from方法');
463
- }
464
- this.authLogics.splice(index, 0, authLogic);
465
- return authLogic;
466
- }
467
- insertAuthLogicInAuthLogicsAt(options, index) {
468
- const node = this._insertAuthLogicInAuthLogicsAt(options, index);
469
- node.create({
470
- index,
471
- parentNode: this,
472
- parentKey: 'authLogics',
473
- });
474
- return node;
475
- }
476
- _addAuthLogicInAuthLogics(options) {
477
- const index = this.authLogics.length;
478
- return this._insertAuthLogicInAuthLogicsAt(options, index);
479
- }
480
- addAuthLogicInAuthLogics(options) {
481
- const node = this._addAuthLogicInAuthLogics(options);
482
- const index = this.authLogics.indexOf(node);
483
- node.create({
484
- index,
485
- parentNode: this,
486
- parentKey: 'authLogics',
487
- });
488
- return node;
489
- }
490
- getInterfaceExistingNames(excludedList = []) {
491
- const excludedSet = new Set(excludedList);
492
- return (this.interfaces || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
493
- }
494
- getInterfaceUniqueName(name = 'Interface1') {
495
- return utils.unique(name, this.getInterfaceExistingNames(), undefined, false);
496
- }
497
- _insertInterfaceAt(options, index) {
498
- const itfaceOptions = {};
499
- const relationOptions = { parentNode: this, parentKey: 'interfaces' };
500
- let itface;
501
- if (!options) {
502
- itface = Interface__1.default.from({
503
- ...itfaceOptions,
504
- name: this.getInterfaceUniqueName(),
505
- }, this, 'interfaces');
506
- }
507
- else if (typeof options === 'string') {
508
- itface = Interface__1.default.from({
509
- ...itfaceOptions,
510
- name: options,
511
- }, this, 'interfaces');
512
- }
513
- else if (options instanceof Interface__1.default) {
514
- options.ensureDelete(); // 同一实例不支持多处存在
515
- itface = options;
516
- Object.assign(itface, relationOptions);
517
- }
518
- else {
519
- itface = Interface__1.default.from({
520
- ...itfaceOptions,
521
- ...options,
522
- }, this, 'interfaces');
523
- }
524
- this.interfaces.splice(index, 0, itface);
525
- return itface;
526
- }
527
- insertInterfaceAt(options, index) {
528
- const node = this._insertInterfaceAt(options, index);
529
- node.create({
530
- index,
531
- parentNode: this,
532
- parentKey: 'interfaces',
533
- });
534
- return node;
535
- }
536
- _addInterface(options) {
537
- const index = 0;
538
- return this._insertInterfaceAt(options, index);
539
- }
540
- addInterface(options) {
541
- const node = this._addInterface(options);
542
- const index = this.interfaces.indexOf(node);
543
- node.create({
544
- index,
545
- parentNode: this,
546
- parentKey: 'interfaces',
547
- });
548
- return node;
549
- }
550
- getViewExistingNames(excludedList = []) {
551
- const excludedSet = new Set(excludedList);
552
- return (this.views || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
553
- }
554
- getViewUniqueName(name = 'view1') {
555
- return utils.unique(name, this.getViewExistingNames(), undefined, false);
556
- }
557
- _insertViewAt(options, index) {
558
- const viewOptions = {};
559
- const relationOptions = { parentNode: this, parentKey: 'views' };
560
- let view;
561
- if (!options) {
562
- view = View__1.default.from({
563
- ...viewOptions,
564
- name: this.getViewUniqueName(),
565
- }, this, 'views');
566
- }
567
- else if (typeof options === 'string') {
568
- view = View__1.default.from({
569
- ...viewOptions,
570
- name: options,
571
- }, this, 'views');
572
- }
573
- else if (options instanceof View__1.default) {
574
- options.ensureDelete(); // 同一实例不支持多处存在
575
- view = options;
576
- Object.assign(view, relationOptions);
577
- }
578
- else {
579
- view = View__1.default.from({
580
- ...viewOptions,
581
- ...options,
582
- }, this, 'views');
583
- }
584
- this.views.splice(index, 0, view);
585
- return view;
586
- }
587
- insertViewAt(options, index) {
588
- const node = this._insertViewAt(options, index);
589
- node.create({
590
- index,
591
- parentNode: this,
592
- parentKey: 'views',
593
- });
594
- return node;
595
- }
596
- _addView(options) {
597
- const index = this.views.length;
598
- return this._insertViewAt(options, index);
599
- }
600
- addView(options) {
601
- const node = this._addView(options);
602
- const index = this.views.indexOf(node);
603
- node.create({
604
- index,
605
- parentNode: this,
606
- parentKey: 'views',
607
- });
608
- return node;
609
- }
610
- getVarExistingNames(excludedList = []) {
611
- const excludedSet = new Set(excludedList);
612
- return (this.frontendVariables || [])
613
- .filter((item) => !excludedSet.has(item))
614
- .map((item) => item.name);
615
- }
616
- getVariableUniqueName(name = 'variable1') {
617
- return utils.unique(name, this.getVarExistingNames(), undefined, true);
618
- }
619
- _insertVariableAt(options, index) {
620
- const variableOptions = {};
621
- const relationOptions = { parentNode: this, parentKey: 'frontendVariables' };
622
- let variable;
623
- if (!options) {
624
- variable = Variable__1.default.from({
625
- ...variableOptions,
626
- name: this.getVariableUniqueName(),
627
- }, this, 'frontendVariables');
628
- }
629
- else if (typeof options === 'string') {
630
- variable = Variable__1.default.from({
631
- ...variableOptions,
632
- name: options,
633
- }, this, 'frontendVariables');
634
- }
635
- else if (options instanceof Variable__1.default) {
636
- options.ensureDelete(); // 同一实例不支持多处存在
637
- variable = options;
638
- Object.assign(variable, relationOptions);
639
- }
640
- else {
641
- variable = Variable__1.default.from({
642
- ...variableOptions,
643
- ...options,
644
- }, this, 'frontendVariables');
645
- }
646
- this.frontendVariables.splice(index, 0, variable);
647
- return variable;
648
- }
649
- insertVariableAt(options, index) {
650
- const node = this._insertVariableAt(options, index);
651
- node.create({
652
- index,
653
- parentNode: this,
654
- parentKey: 'frontendVariables',
655
- });
656
- return node;
657
- }
658
- _addVariable(options) {
659
- const index = this.frontendVariables.length;
660
- return this._insertVariableAt(options, index);
661
- }
662
- addVariable(options) {
663
- const node = this._addVariable(options);
664
- const index = this.frontendVariables.indexOf(node);
665
- node.create({
666
- index,
667
- parentNode: this,
668
- parentKey: 'frontendVariables',
669
- });
670
- return node;
671
- }
672
- getProcessExistingNames(excludedList = []) {
673
- const excludedSet = new Set(excludedList);
674
- return (this.processes || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
675
- }
676
- getProcessUniqueName(name = 'Process1') {
677
- return utils.unique(name, this.getProcessExistingNames(), undefined, false);
678
- }
679
- _insertProcessAt(options, index) {
680
- const processOptions = {};
681
- const relationOptions = { parentNode: this, parentKey: 'processes' };
682
- let process;
683
- if (!options) {
684
- process = Process__1.default.from({
685
- ...processOptions,
686
- name: this.getProcessUniqueName(),
687
- }, this, 'processes');
688
- }
689
- else if (typeof options === 'string') {
690
- process = Process__1.default.from({
691
- ...processOptions,
692
- name: options,
693
- }, this, 'processes');
694
- }
695
- else if (options instanceof Process__1.default) {
696
- options.ensureDelete(); // 同一实例不支持多处存在
697
- process = options;
698
- Object.assign(process, relationOptions);
699
- }
700
- else {
701
- process = Process__1.default.from({
702
- ...processOptions,
703
- ...options,
704
- }, this, 'processes');
705
- }
706
- this.processes.splice(index, 0, process);
707
- return process;
708
- }
709
- insertProcessAt(options, index) {
710
- const node = this._insertProcessAt(options, index);
711
- node.create({
712
- index,
713
- parentNode: this,
714
- parentKey: 'processes',
715
- });
716
- return node;
717
- }
718
- _addProcess(options) {
719
- const index = 0;
720
- return this._insertProcessAt(options, index);
721
- }
722
- addProcess(options) {
723
- const node = this._addProcess(options);
724
- const index = this.processes.indexOf(node);
725
- node.create({
726
- index,
727
- parentNode: this,
728
- parentKey: 'processes',
729
- });
730
- return node;
731
- }
732
- getFrontendLibraryExistingNames(excludedList = []) {
733
- const excludedSet = new Set(excludedList);
734
- return (this.frontends || [])
735
- .filter((item) => !excludedSet.has(item))
736
- .map((item) => item.name);
737
- }
738
- getFrontendLibraryUniqueName(name = 'frontendLibrary1') {
739
- return utils.unique(name, this.getFrontendLibraryExistingNames(), undefined, false);
740
- }
741
- _insertFrontendLibraryAt(options, index) {
742
- const frontendLibraryOptions = {};
743
- const relationOptions = { parentNode: this, parentKey: 'frontends' };
744
- let frontendLibrary;
745
- if (!options) {
746
- frontendLibrary = FrontendLibrary__1.default.from({
747
- ...frontendLibraryOptions,
748
- name: this.getFrontendLibraryUniqueName(),
749
- }, this, 'frontends');
750
- }
751
- else if (typeof options === 'string') {
752
- frontendLibrary = FrontendLibrary__1.default.from({
753
- ...frontendLibraryOptions,
754
- name: options,
755
- }, this, 'frontends');
756
- }
757
- else if (options instanceof FrontendLibrary__1.default) {
758
- options.ensureDelete(); // 同一实例不支持多处存在
759
- frontendLibrary = options;
760
- Object.assign(frontendLibrary, relationOptions);
761
- }
762
- else {
763
- frontendLibrary = FrontendLibrary__1.default.from({
764
- ...frontendLibraryOptions,
765
- ...options,
766
- }, this, 'frontends');
767
- }
768
- this.frontends.splice(index, 0, frontendLibrary);
769
- return frontendLibrary;
770
- }
771
- insertFrontendLibraryAt(options, index) {
772
- const node = this._insertFrontendLibraryAt(options, index);
773
- node.create({
774
- index,
775
- parentNode: this,
776
- parentKey: 'frontends',
777
- });
778
- return node;
779
- }
780
- _addFrontendLibrary(options) {
781
- const index = this.frontends.length;
782
- return this._insertFrontendLibraryAt(options, index);
783
- }
784
- addFrontendLibrary(options) {
785
- const node = this._addFrontendLibrary(options);
786
- const index = this.frontends.indexOf(node);
787
- node.create({
788
- index,
789
- parentNode: this,
790
- parentKey: 'frontends',
791
- });
792
- return node;
793
- }
794
- getAuthLogicForCallInterfaceExistingNames(excludedList = []) {
795
- const excludedSet = new Set(excludedList);
796
- return (this.authLogicsForCallInterface || [])
797
- .filter((item) => !excludedSet.has(item))
798
- .map((item) => item.name);
799
- }
800
- getAuthLogicForCallInterfaceUniqueName(name = 'authLogicForCallInterface1') {
801
- return utils.unique(name, this.getAuthLogicForCallInterfaceExistingNames(), undefined, false);
802
- }
803
- _insertAuthLogicForCallInterfaceAt(options, index) {
804
- const authLogicForCallInterfaceOptions = {};
805
- const relationOptions = { parentNode: this, parentKey: 'authLogicsForCallInterface' };
806
- let authLogicForCallInterface;
807
- if (!options) {
808
- throw Error('请先调用from方法创建AuthLogicForCallInterface实例');
809
- }
810
- else if (typeof options === 'string') {
811
- throw Error('请先调用from方法创建AuthLogicForCallInterface实例');
812
- // FIXME : dont change
813
- }
814
- else if (options.concept === 'AuthLogicForCallInterface') {
815
- options.ensureDelete(); // 同一实例不支持多处存在
816
- authLogicForCallInterface = options;
817
- Object.assign(authLogicForCallInterface, relationOptions);
818
- }
819
- else {
820
- throw Error('请先调用from方法创建AuthLogicForCallInterface实例');
821
- }
822
- this.authLogicsForCallInterface.splice(index, 0, authLogicForCallInterface);
823
- return authLogicForCallInterface;
824
- }
825
- insertAuthLogicForCallInterfaceAt(options, index) {
826
- const node = this._insertAuthLogicForCallInterfaceAt(options, index);
827
- node.create({
828
- index,
829
- parentNode: this,
830
- parentKey: 'authLogicsForCallInterface',
831
- });
832
- return node;
833
- }
834
- _addAuthLogicForCallInterface(options) {
835
- const index = this.authLogicsForCallInterface.length;
836
- return this._insertAuthLogicForCallInterfaceAt(options, index);
837
- }
838
- addAuthLogicForCallInterface(options) {
839
- const node = this._addAuthLogicForCallInterface(options);
840
- const index = this.authLogicsForCallInterface.indexOf(node);
841
- node.create({
842
- index,
843
- parentNode: this,
844
- parentKey: 'authLogicsForCallInterface',
845
- });
846
- return node;
847
- }
848
- getTriggerLauncherExistingNames(excludedList = []) {
849
- const excludedSet = new Set(excludedList);
850
- return (this.triggerLaunchers || [])
851
- .filter((item) => !excludedSet.has(item))
852
- .map((item) => item.name);
853
- }
854
- getTriggerLauncherUniqueName(name = 'triggerLauncher1') {
855
- return utils.unique(name, this.getTriggerLauncherExistingNames(), undefined, false);
856
- }
857
- _insertTriggerLauncherAt(options, index) {
858
- const triggerLauncherOptions = {};
859
- const relationOptions = { parentNode: this, parentKey: 'triggerLaunchers' };
860
- let triggerLauncher;
861
- if (!options) {
862
- triggerLauncher = TriggerLauncher__1.default.from({
863
- ...triggerLauncherOptions,
864
- name: this.getTriggerLauncherUniqueName(),
865
- }, this, 'triggerLaunchers');
866
- }
867
- else if (typeof options === 'string') {
868
- triggerLauncher = TriggerLauncher__1.default.from({
869
- ...triggerLauncherOptions,
870
- name: options,
871
- }, this, 'triggerLaunchers');
872
- }
873
- else if (options instanceof TriggerLauncher__1.default) {
874
- options.ensureDelete(); // 同一实例不支持多处存在
875
- triggerLauncher = options;
876
- Object.assign(triggerLauncher, relationOptions);
877
- }
878
- else {
879
- triggerLauncher = TriggerLauncher__1.default.from({
880
- ...triggerLauncherOptions,
881
- ...options,
882
- }, this, 'triggerLaunchers');
883
- }
884
- this.triggerLaunchers.splice(index, 0, triggerLauncher);
885
- return triggerLauncher;
886
- }
887
- insertTriggerLauncherAt(options, index) {
888
- const node = this._insertTriggerLauncherAt(options, index);
889
- node.create({
890
- index,
891
- parentNode: this,
892
- parentKey: 'triggerLaunchers',
893
- });
894
- return node;
895
- }
896
- _addTriggerLauncher(options) {
897
- const index = 0;
898
- return this._insertTriggerLauncherAt(options, index);
899
- }
900
- addTriggerLauncher(options) {
901
- const node = this._addTriggerLauncher(options);
902
- const index = this.triggerLaunchers.indexOf(node);
903
- node.create({
904
- index,
905
- parentNode: this,
906
- parentKey: 'triggerLaunchers',
907
- });
908
- return node;
909
- }
910
- getConnectionExistingNames(excludedList = []) {
911
- const excludedSet = new Set(excludedList);
912
- return (this.connections || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
913
- }
914
- getConnectionUniqueName(name = 'connection1') {
915
- return utils.unique(name, this.getConnectionExistingNames(), undefined, false);
916
- }
917
- _insertConnectionAt(options, index) {
918
- const connectionOptions = {};
919
- const relationOptions = { parentNode: this, parentKey: 'connections' };
920
- let connection;
921
- if (!options) {
922
- connection = Connection__1.default.from({
923
- ...connectionOptions,
924
- name: this.getConnectionUniqueName(),
925
- }, this, 'connections');
926
- }
927
- else if (typeof options === 'string') {
928
- connection = Connection__1.default.from({
929
- ...connectionOptions,
930
- name: options,
931
- }, this, 'connections');
932
- }
933
- else if (options instanceof Connection__1.default) {
934
- options.ensureDelete(); // 同一实例不支持多处存在
935
- connection = options;
936
- Object.assign(connection, relationOptions);
937
- }
938
- else {
939
- connection = Connection__1.default.from({
940
- ...connectionOptions,
941
- ...options,
942
- }, this, 'connections');
943
- }
944
- this.connections.splice(index, 0, connection);
945
- return connection;
946
- }
947
- insertConnectionAt(options, index) {
948
- const node = this._insertConnectionAt(options, index);
949
- node.create({
950
- index,
951
- parentNode: this,
952
- parentKey: 'connections',
953
- });
954
- return node;
955
- }
956
- _addConnection(options) {
957
- const index = 0;
958
- return this._insertConnectionAt(options, index);
959
- }
960
- addConnection(options) {
961
- const node = this._addConnection(options);
962
- const index = this.connections.indexOf(node);
963
- node.create({
964
- index,
965
- parentNode: this,
966
- parentKey: 'connections',
967
- });
968
- return node;
969
- }
970
- removeDataSource(options) {
971
- let dataSource;
972
- if (typeof options === 'string') {
973
- dataSource = this.dataSources.find((item) => item.name === options);
974
- if (!dataSource) {
975
- throw new Error('找不到数据源 ' + options);
976
- }
977
- }
978
- else {
979
- dataSource = options;
980
- }
981
- return dataSource.delete();
982
- }
983
- __removeDataSource(dataSource) {
984
- const parentKey = dataSource.parentKey;
985
- const params = {
986
- parentNode: this,
987
- parentKey,
988
- index: -1,
989
- object: null,
990
- oldObject: dataSource,
991
- };
992
- if (parentKey) {
993
- params.parentKey = parentKey;
994
- if (Array.isArray(this[parentKey])) {
995
- const index = this[parentKey].indexOf(dataSource);
996
- ~index && this[parentKey].splice(index, 1);
997
- params.index = index;
998
- }
999
- else if (this[parentKey] === dataSource) {
1000
- params.index = 0;
1001
- this[parentKey] = undefined;
1002
- }
1003
- }
1004
- return params;
1005
- }
1006
- removeStructure(options) {
1007
- let structure;
1008
- if (typeof options === 'string') {
1009
- structure = this.structures.find((item) => item.name === options);
1010
- if (!structure) {
1011
- throw new Error('找不到数据结构 ' + options);
1012
- }
1013
- }
1014
- else {
1015
- structure = options;
1016
- }
1017
- return structure.delete();
1018
- }
1019
- __removeStructure(structure) {
1020
- const parentKey = structure.parentKey;
1021
- const params = {
1022
- parentNode: this,
1023
- parentKey,
1024
- index: -1,
1025
- object: null,
1026
- oldObject: structure,
1027
- };
1028
- if (parentKey) {
1029
- params.parentKey = parentKey;
1030
- if (Array.isArray(this[parentKey])) {
1031
- const index = this[parentKey].indexOf(structure);
1032
- ~index && this[parentKey].splice(index, 1);
1033
- params.index = index;
1034
- }
1035
- else if (this[parentKey] === structure) {
1036
- params.index = 0;
1037
- this[parentKey] = undefined;
1038
- }
1039
- }
1040
- return params;
1041
- }
1042
- removeEnum(options) {
1043
- let enumeration;
1044
- if (typeof options === 'string') {
1045
- enumeration = this.enums.find((item) => item.name === options);
1046
- if (!enumeration) {
1047
- throw new Error('找不到枚举 ' + options);
1048
- }
1049
- }
1050
- else {
1051
- enumeration = options;
1052
- }
1053
- return enumeration.delete();
1054
- }
1055
- __removeEnum(enumeration) {
1056
- const parentKey = enumeration.parentKey;
1057
- const params = {
1058
- parentNode: this,
1059
- parentKey,
1060
- index: -1,
1061
- object: null,
1062
- oldObject: enumeration,
1063
- };
1064
- if (parentKey) {
1065
- params.parentKey = parentKey;
1066
- if (Array.isArray(this[parentKey])) {
1067
- const index = this[parentKey].indexOf(enumeration);
1068
- ~index && this[parentKey].splice(index, 1);
1069
- params.index = index;
1070
- }
1071
- else if (this[parentKey] === enumeration) {
1072
- params.index = 0;
1073
- this[parentKey] = undefined;
1074
- }
1075
- }
1076
- return params;
1077
- }
1078
- removeLogicInLogics(options) {
1079
- let logic;
1080
- if (typeof options === 'string') {
1081
- logic = this.logics.find((item) => item.name === options);
1082
- if (!logic) {
1083
- throw new Error('找不到逻辑 ' + options);
1084
- }
1085
- }
1086
- else {
1087
- logic = options;
1088
- }
1089
- return logic.delete();
1090
- }
1091
- removeAuthLogicInAuthLogics(options) {
1092
- let authLogic;
1093
- if (typeof options === 'string') {
1094
- authLogic = this.authLogics.find((item) => item.name === options);
1095
- if (!authLogic) {
1096
- throw new Error('找不到鉴权逻辑 ' + options);
1097
- }
1098
- }
1099
- else {
1100
- authLogic = options;
1101
- }
1102
- return authLogic.delete();
1103
- }
1104
- __removeLogic(logic) {
1105
- const parentKey = logic.parentKey;
1106
- const params = {
1107
- parentNode: this,
1108
- parentKey,
1109
- index: -1,
1110
- object: null,
1111
- oldObject: logic,
1112
- };
1113
- if (parentKey) {
1114
- params.parentKey = parentKey;
1115
- if (Array.isArray(this[parentKey])) {
1116
- const index = this[parentKey].indexOf(logic);
1117
- ~index && this[parentKey].splice(index, 1);
1118
- params.index = index;
1119
- }
1120
- else if (this[parentKey] === logic) {
1121
- params.index = 0;
1122
- this[parentKey] = undefined;
1123
- }
1124
- }
1125
- return params;
1126
- }
1127
- removeInterface(options) {
1128
- let itface;
1129
- if (typeof options === 'string') {
1130
- itface = this.interfaces.find((item) => item.name === options);
1131
- if (!itface) {
1132
- throw new Error('找不到接口 ' + options);
1133
- }
1134
- }
1135
- else {
1136
- itface = options;
1137
- }
1138
- return itface.delete();
1139
- }
1140
- __removeInterface(itface) {
1141
- const parentKey = itface.parentKey;
1142
- const params = {
1143
- parentNode: this,
1144
- parentKey,
1145
- index: -1,
1146
- object: null,
1147
- oldObject: itface,
1148
- };
1149
- if (parentKey) {
1150
- params.parentKey = parentKey;
1151
- if (Array.isArray(this[parentKey])) {
1152
- const index = this[parentKey].indexOf(itface);
1153
- ~index && this[parentKey].splice(index, 1);
1154
- params.index = index;
1155
- }
1156
- else if (this[parentKey] === itface) {
1157
- params.index = 0;
1158
- this[parentKey] = undefined;
1159
- }
1160
- }
1161
- return params;
1162
- }
1163
- removeView(options) {
1164
- let view;
1165
- if (typeof options === 'string') {
1166
- view = this.views.find((item) => item.name === options);
1167
- if (!view) {
1168
- throw new Error('找不到页面 ' + options);
1169
- }
1170
- }
1171
- else {
1172
- view = options;
1173
- }
1174
- return view.delete();
1175
- }
1176
- __removeView(view) {
1177
- const parentKey = view.parentKey;
1178
- const params = {
1179
- parentNode: this,
1180
- parentKey,
1181
- index: -1,
1182
- object: null,
1183
- oldObject: view,
1184
- };
1185
- if (parentKey) {
1186
- params.parentKey = parentKey;
1187
- if (Array.isArray(this[parentKey])) {
1188
- const index = this[parentKey].indexOf(view);
1189
- ~index && this[parentKey].splice(index, 1);
1190
- params.index = index;
1191
- }
1192
- else if (this[parentKey] === view) {
1193
- params.index = 0;
1194
- this[parentKey] = undefined;
1195
- }
1196
- }
1197
- return params;
1198
- }
1199
- removeVariable(options) {
1200
- let variable;
1201
- if (typeof options === 'string') {
1202
- variable = this.frontendVariables.find((item) => item.name === options);
1203
- if (!variable) {
1204
- throw new Error('找不到变量 ' + options);
1205
- }
1206
- }
1207
- else {
1208
- variable = options;
1209
- }
1210
- return variable.delete();
1211
- }
1212
- __removeVariable(variable) {
1213
- const parentKey = variable.parentKey;
1214
- const params = {
1215
- parentNode: this,
1216
- parentKey,
1217
- index: -1,
1218
- object: null,
1219
- oldObject: variable,
1220
- };
1221
- if (parentKey) {
1222
- params.parentKey = parentKey;
1223
- if (Array.isArray(this[parentKey])) {
1224
- const index = this[parentKey].indexOf(variable);
1225
- ~index && this[parentKey].splice(index, 1);
1226
- params.index = index;
1227
- }
1228
- else if (this[parentKey] === variable) {
1229
- params.index = 0;
1230
- this[parentKey] = undefined;
1231
- }
1232
- }
1233
- return params;
1234
- }
1235
- removeProcess(options) {
1236
- let process;
1237
- if (typeof options === 'string') {
1238
- process = this.processes.find((item) => item.name === options);
1239
- if (!process) {
1240
- throw new Error('找不到流程 ' + options);
1241
- }
1242
- }
1243
- else {
1244
- process = options;
1245
- }
1246
- return process.delete();
1247
- }
1248
- __removeProcess(process) {
1249
- const parentKey = process.parentKey;
1250
- const params = {
1251
- parentNode: this,
1252
- parentKey,
1253
- index: -1,
1254
- object: null,
1255
- oldObject: process,
1256
- };
1257
- if (parentKey) {
1258
- params.parentKey = parentKey;
1259
- if (Array.isArray(this[parentKey])) {
1260
- const index = this[parentKey].indexOf(process);
1261
- ~index && this[parentKey].splice(index, 1);
1262
- params.index = index;
1263
- }
1264
- else if (this[parentKey] === process) {
1265
- params.index = 0;
1266
- this[parentKey] = undefined;
1267
- }
1268
- }
1269
- return params;
1270
- }
1271
- removeFrontendLibrary(options) {
1272
- let frontendLibrary;
1273
- if (typeof options === 'string') {
1274
- frontendLibrary = this.frontends.find((item) => item.name === options);
1275
- if (!frontendLibrary) {
1276
- throw new Error('找不到前端库 ' + options);
1277
- }
1278
- }
1279
- else {
1280
- frontendLibrary = options;
1281
- }
1282
- return frontendLibrary.delete();
1283
- }
1284
- __removeFrontendLibrary(frontendLibrary) {
1285
- const parentKey = frontendLibrary.parentKey;
1286
- const params = {
1287
- parentNode: this,
1288
- parentKey,
1289
- index: -1,
1290
- object: null,
1291
- oldObject: frontendLibrary,
1292
- };
1293
- if (parentKey) {
1294
- params.parentKey = parentKey;
1295
- if (Array.isArray(this[parentKey])) {
1296
- const index = this[parentKey].indexOf(frontendLibrary);
1297
- ~index && this[parentKey].splice(index, 1);
1298
- params.index = index;
1299
- }
1300
- else if (this[parentKey] === frontendLibrary) {
1301
- params.index = 0;
1302
- this[parentKey] = undefined;
1303
- }
1304
- }
1305
- return params;
1306
- }
1307
- removeConfiguration(options) {
1308
- let configuration;
1309
- if (typeof options === 'string') {
1310
- configuration = this.configuration;
1311
- if (!configuration) {
1312
- throw new Error('找不到配置管理 ' + options);
1313
- }
1314
- }
1315
- else {
1316
- configuration = options;
1317
- }
1318
- return configuration.delete();
1319
- }
1320
- __removeConfiguration(configuration) {
1321
- const parentKey = configuration.parentKey;
1322
- const params = {
1323
- parentNode: this,
1324
- parentKey,
1325
- index: -1,
1326
- object: null,
1327
- oldObject: configuration,
1328
- };
1329
- if (parentKey) {
1330
- params.parentKey = parentKey;
1331
- if (Array.isArray(this[parentKey])) {
1332
- const index = this[parentKey].indexOf(configuration);
1333
- ~index && this[parentKey].splice(index, 1);
1334
- params.index = index;
1335
- }
1336
- else if (this[parentKey] === configuration) {
1337
- params.index = 0;
1338
- this[parentKey] = undefined;
1339
- }
1340
- }
1341
- return params;
1342
- }
1343
- removeAuthLogicForCallInterface(options) {
1344
- let authLogicForCallInterface;
1345
- if (typeof options === 'string') {
1346
- authLogicForCallInterface = this.authLogicsForCallInterface.find((item) => item.name === options);
1347
- if (!authLogicForCallInterface) {
1348
- throw new Error('找不到调用接口的鉴权逻辑 ' + options);
1349
- }
1350
- }
1351
- else {
1352
- authLogicForCallInterface = options;
1353
- }
1354
- return authLogicForCallInterface.delete();
1355
- }
1356
- __removeAuthLogic(authLogic) {
1357
- const parentKey = authLogic.parentKey;
1358
- const params = {
1359
- parentNode: this,
1360
- parentKey,
1361
- index: -1,
1362
- object: null,
1363
- oldObject: authLogic,
1364
- };
1365
- if (parentKey) {
1366
- params.parentKey = parentKey;
1367
- if (Array.isArray(this[parentKey])) {
1368
- const index = this[parentKey].indexOf(authLogic);
1369
- ~index && this[parentKey].splice(index, 1);
1370
- params.index = index;
1371
- }
1372
- else if (this[parentKey] === authLogic) {
1373
- params.index = 0;
1374
- this[parentKey] = undefined;
1375
- }
1376
- }
1377
- return params;
1378
- }
1379
- removeTriggerLauncher(options) {
1380
- let triggerLauncher;
1381
- if (typeof options === 'string') {
1382
- triggerLauncher = this.triggerLaunchers.find((item) => item.name === options);
1383
- if (!triggerLauncher) {
1384
- throw new Error('找不到触发器启动器 ' + options);
1385
- }
1386
- }
1387
- else {
1388
- triggerLauncher = options;
1389
- }
1390
- return triggerLauncher.delete();
1391
- }
1392
- __removeTriggerLauncher(triggerLauncher) {
1393
- const parentKey = triggerLauncher.parentKey;
1394
- const params = {
1395
- parentNode: this,
1396
- parentKey,
1397
- index: -1,
1398
- object: null,
1399
- oldObject: triggerLauncher,
1400
- };
1401
- if (parentKey) {
1402
- params.parentKey = parentKey;
1403
- if (Array.isArray(this[parentKey])) {
1404
- const index = this[parentKey].indexOf(triggerLauncher);
1405
- ~index && this[parentKey].splice(index, 1);
1406
- params.index = index;
1407
- }
1408
- else if (this[parentKey] === triggerLauncher) {
1409
- params.index = 0;
1410
- this[parentKey] = undefined;
1411
- }
1412
- }
1413
- return params;
1414
- }
1415
- removeConnection(options) {
1416
- let connection;
1417
- if (typeof options === 'string') {
1418
- connection = this.connections.find((item) => item.name === options);
1419
- if (!connection) {
1420
- throw new Error('找不到连接 ' + options);
1421
- }
1422
- }
1423
- else {
1424
- connection = options;
1425
- }
1426
- return connection.delete();
1427
- }
1428
- __removeConnection(connection) {
1429
- const parentKey = connection.parentKey;
1430
- const params = {
1431
- parentNode: this,
1432
- parentKey,
1433
- index: -1,
1434
- object: null,
1435
- oldObject: connection,
1436
- };
1437
- if (parentKey) {
1438
- params.parentKey = parentKey;
1439
- if (Array.isArray(this[parentKey])) {
1440
- const index = this[parentKey].indexOf(connection);
1441
- ~index && this[parentKey].splice(index, 1);
1442
- params.index = index;
1443
- }
1444
- else if (this[parentKey] === connection) {
1445
- params.index = 0;
1446
- this[parentKey] = undefined;
1447
- }
1448
- }
1449
- return params;
1450
- }
1451
- //================================================================================
1452
- // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1453
- // 自动生成的代码已结束。下面可以手动编写。
1454
- //================================================================================
1455
- /**
1456
- * 用于区分存量应用新导入模块,存量应用替换数据结构使用
1457
- */
1458
- isAdd;
1459
- /**
1460
- * 是否启动
1461
- */
1462
- enable;
1463
- /**
1464
- * 依赖列表
1465
- */
1466
- dependencies = [];
1467
- setIsAdd(isAdd) {
1468
- const object = {
1469
- isAdd,
1470
- };
1471
- this.update({
1472
- ...object,
1473
- });
1474
- }
1475
- /**
1476
- * 生成宿主语言的文件路径
1477
- * @param name 一般不用传,用于 rename
1478
- */
1479
- getEmbeddedFilePath(name = this.name) {
1480
- return `/embedded/${this.app.name}/${this.parentKey}/${this.name}`;
1481
- }
1482
- /**
1483
- * 获取命名空间和
1484
- * 暂时不考虑 Module 嵌套的情况
1485
- */
1486
- getNamespace() {
1487
- // connector namespace 为 connector + connectorName
1488
- if (this.type === 'connector') {
1489
- return `connector.${this.name}`;
1490
- }
1491
- return `${moduleNameSpace[this.parentKey]}`;
1492
- }
1493
- getTsNamespace() {
1494
- if (this.type === 'connector') {
1495
- return 'connector';
1496
- }
1497
- return `${moduleNameSpace[this.parentKey]}`;
1498
- }
1499
- getTsNamespaceAndName() {
1500
- if (this.type === 'connector') {
1501
- return 'connector';
1502
- }
1503
- return `${moduleNameSpace[this.parentKey]}.${this.name}`;
1504
- }
1505
- findEnumByName(name) {
1506
- return this.enums.find((enumItem) => enumItem.name === name);
1507
- }
1508
- /**
1509
- * 获取属性节点是否存在
1510
- */
1511
- findProperty(name, propertyType) {
1512
- return this[propertyType].find((item) => item.name === name);
1513
- }
1514
- delete() {
1515
- this.parentNode?.emit('collect:start', {
1516
- actionMsg: '移除依赖库',
1517
- });
1518
- super.delete();
1519
- this._delete();
1520
- // if (this.dependencies) {
1521
- // // 删除依赖链中的依赖
1522
- // this.dependencies.forEach((tag) => {
1523
- // const [name, version] = tag.split('-');
1524
- // const existNode = this.app.dependencies.find((m) => m.name === name && m.version === version);
1525
- // existNode?.delete();
1526
- // });
1527
- // }
1528
- // 处理同名依赖 重新生成文件
1529
- // if (this.enable) {
1530
- // 删[数据源]
1531
- const dataSourceGroup = this.parentNode?.configuration?.getGroup('dataSource');
1532
- if (this.dataSources && dataSourceGroup) {
1533
- this.dataSources.forEach((datasource) => {
1534
- this.parentNode?.emit('clear:datasourceError', datasource);
1535
- try {
1536
- dataSourceGroup.removeConfigProperty(datasource.name);
1537
- }
1538
- catch (e) { }
1539
- });
1540
- }
1541
- // // 已启用的依赖库被删除时,将后续被禁用的同名依赖库 切换为启用
1542
- // const index = this.app.dependencies.findIndex((m) => m.enable === false && m.name === this.name);
1543
- // if (index >= 0) {
1544
- // const nextMainModule = this.app.dependencies[index];
1545
- // // 更新[禁用的依赖]enable:true
1546
- // nextMainModule.update({ enable: true });
1547
- // nextMainModule.softDelete({ index });
1548
- // }
1549
- // }
1550
- this.parentNode?.emit('collect:end');
1551
- }
1552
- // 删除再添加 触发文件生成
1553
- softDelete(options) {
1554
- // 删[禁用的依赖]
1555
- super.delete();
1556
- // 创建[禁用的依赖]
1557
- this.app.insertModuleInDependenciesAt(this, options.index);
1558
- // 创建[禁用的依赖]的数据源
1559
- const dataSourceGroup = this.parentNode?.configuration?.getGroup('dataSource');
1560
- if (this.dataSources && dataSourceGroup) {
1561
- this.dataSources.forEach((datasource) => {
1562
- const body = ConfigProperty__1.default.from({
1563
- name: datasource.name,
1564
- description: '',
1565
- isPrivate: false,
1566
- values: [
1567
- { env: 'dev', value: '', concept: 'ConfigPropertyValue' },
1568
- { env: 'online', value: '', concept: 'ConfigPropertyValue' },
1569
- ],
1570
- });
1571
- dataSourceGroup.addConfigProperty(body);
1572
- });
1573
- }
1574
- }
1575
- getAuthLogicExistingNames(excludedList = []) {
1576
- const excludedSet = new Set(excludedList);
1577
- return (this.authLogics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1578
- }
1579
- getAuthLogicUniqueName(name = 'authentication1') {
1580
- return utils.unique(name, this.getAuthLogicExistingNames(), undefined, true);
1581
- }
1582
- setInterfaces(interfaces) {
1583
- this.update({
1584
- interfaces,
1585
- });
1586
- }
1587
- // 获取数据结构被接口的引用关系
1588
- getInterfaceStructureMap() {
1589
- const structureMap = new Map();
1590
- this.interfaces.forEach(itf => {
1591
- const structures = itf.getRefStructures(this.structures);
1592
- structures.forEach(s => {
1593
- if (structureMap.has(s)) {
1594
- structureMap.get(s).add(itf);
1595
- }
1596
- else {
1597
- structureMap.set(s, new Set([itf]));
1598
- }
1599
- });
1600
- });
1601
- return structureMap;
1602
- }
1603
- };
1604
- exports.Module = Module;
1605
- __decorate([
1606
- (0, decorators_1.property)('concept')
1607
- // @ts-ignore
1608
- ], Module.prototype, "concept", void 0);
1609
- __decorate([
1610
- (0, decorators_1.property)()
1611
- // @ts-ignore
1612
- ], Module.prototype, "type", void 0);
1613
- __decorate([
1614
- (0, decorators_1.property)()
1615
- // @ts-ignore
1616
- ], Module.prototype, "version", void 0);
1617
- __decorate([
1618
- (0, decorators_1.property)()
1619
- // @ts-ignore
1620
- ], Module.prototype, "name", void 0);
1621
- __decorate([
1622
- (0, decorators_1.property)()
1623
- // @ts-ignore
1624
- ], Module.prototype, "title", void 0);
1625
- __decorate([
1626
- (0, decorators_1.property)()
1627
- // @ts-ignore
1628
- ], Module.prototype, "description", void 0);
1629
- __decorate([
1630
- (0, decorators_1.property)()
1631
- // @ts-ignore
1632
- ], Module.prototype, "provider", void 0);
1633
- __decorate([
1634
- (0, decorators_1.property)()
1635
- // @ts-ignore
1636
- ], Module.prototype, "externalDependencyMap", void 0);
1637
- __decorate([
1638
- (0, decorators_1.property)()
1639
- // @ts-ignore
1640
- ], Module.prototype, "compilerInfoMap", void 0);
1641
- __decorate([
1642
- (0, decorators_1.property)({
1643
- objectRef: 'DataSource',
1644
- isArray: true,
1645
- defaultValue: [],
1646
- })
1647
- ], Module.prototype, "dataSources", void 0);
1648
- __decorate([
1649
- (0, decorators_1.property)({
1650
- objectRef: 'Structure',
1651
- isArray: true,
1652
- defaultValue: [],
1653
- })
1654
- ], Module.prototype, "structures", void 0);
1655
- __decorate([
1656
- (0, decorators_1.property)({
1657
- objectRef: 'Enum',
1658
- isArray: true,
1659
- defaultValue: [],
1660
- })
1661
- ], Module.prototype, "enums", void 0);
1662
- __decorate([
1663
- (0, decorators_1.property)({
1664
- objectRef: 'Logic',
1665
- isArray: true,
1666
- defaultValue: [],
1667
- })
1668
- ], Module.prototype, "logics", void 0);
1669
- __decorate([
1670
- (0, decorators_1.property)({
1671
- objectRef: 'Interface',
1672
- isArray: true,
1673
- defaultValue: [],
1674
- })
1675
- ], Module.prototype, "interfaces", void 0);
1676
- __decorate([
1677
- (0, decorators_1.property)({
1678
- objectRef: 'View',
1679
- isArray: true,
1680
- defaultValue: [],
1681
- })
1682
- ], Module.prototype, "views", void 0);
1683
- __decorate([
1684
- (0, decorators_1.property)({
1685
- objectRef: 'Variable',
1686
- isArray: true,
1687
- defaultValue: [],
1688
- })
1689
- ], Module.prototype, "frontendVariables", void 0);
1690
- __decorate([
1691
- (0, decorators_1.property)({
1692
- objectRef: 'Process',
1693
- isArray: true,
1694
- defaultValue: [],
1695
- })
1696
- ], Module.prototype, "processes", void 0);
1697
- __decorate([
1698
- (0, decorators_1.property)({
1699
- objectRef: 'FrontendLibrary',
1700
- isArray: true,
1701
- defaultValue: [],
1702
- })
1703
- ], Module.prototype, "frontends", void 0);
1704
- __decorate([
1705
- (0, decorators_1.property)({
1706
- objectRef: 'Configuration',
1707
- })
1708
- // @ts-ignore
1709
- ], Module.prototype, "configuration", void 0);
1710
- __decorate([
1711
- (0, decorators_1.property)({
1712
- objectRef: 'AuthLogic',
1713
- isArray: true,
1714
- defaultValue: [],
1715
- })
1716
- ], Module.prototype, "authLogics", void 0);
1717
- __decorate([
1718
- (0, decorators_1.property)({
1719
- objectRef: 'AuthLogicForCallInterface',
1720
- isArray: true,
1721
- defaultValue: [],
1722
- })
1723
- ], Module.prototype, "authLogicsForCallInterface", void 0);
1724
- __decorate([
1725
- (0, decorators_1.property)({
1726
- objectRef: 'TriggerLauncher',
1727
- isArray: true,
1728
- defaultValue: [],
1729
- })
1730
- ], Module.prototype, "triggerLaunchers", void 0);
1731
- __decorate([
1732
- (0, decorators_1.property)({
1733
- objectRef: 'Connection',
1734
- isArray: true,
1735
- defaultValue: [],
1736
- })
1737
- ], Module.prototype, "connections", void 0);
1738
- __decorate([
1739
- (0, decorators_1.property)()
1740
- ], Module.prototype, "isAdd", void 0);
1741
- __decorate([
1742
- (0, decorators_1.property)()
1743
- ], Module.prototype, "enable", void 0);
1744
- __decorate([
1745
- (0, decorators_1.property)()
1746
- ], Module.prototype, "dependencies", void 0);
1747
- exports.Module = Module = Module_1 = __decorate([
1748
- decorators_1.className,
1749
- (0, decorators_1.concept)('模块')
1750
- // @ts-ignore
1751
- ], Module);
1752
- exports.default = Module;
1753
- //================================================================================
1754
- // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1755
- // 自动生成的代码已结束。下面可以手动编写。
1756
- //================================================================================
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 Module_1;
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Module = void 0;
37
+ const moduleNameSpace = {
38
+ dependencies: 'extensions',
39
+ interfaceDependencies: 'apis',
40
+ componentDependencies: 'components',
41
+ };
42
+ const ConfigProperty__1 = __importDefault(require("./ConfigProperty__"));
43
+ const decorators_1 = require("../decorators");
44
+ const utils = __importStar(require("../utils"));
45
+ const BaseNode_1 = __importDefault(require("../common/BaseNode"));
46
+ const DataSource__1 = __importDefault(require("./DataSource__"));
47
+ const Structure__1 = __importDefault(require("./Structure__"));
48
+ const Enum__1 = __importDefault(require("./Enum__"));
49
+ const Logic__1 = __importDefault(require("./Logic__"));
50
+ const Interface__1 = __importDefault(require("./Interface__"));
51
+ const InterfaceFromExample__1 = __importDefault(require("./InterfaceFromExample__"));
52
+ const View__1 = __importDefault(require("./View__"));
53
+ const Variable__1 = __importDefault(require("./Variable__"));
54
+ const Process__1 = __importDefault(require("./Process__"));
55
+ const FrontendLibrary__1 = __importDefault(require("./FrontendLibrary__"));
56
+ /**
57
+ * 模块
58
+ */
59
+ let Module = Module_1 =
60
+ // @ts-ignore
61
+ class Module extends BaseNode_1.default {
62
+ /** 类名 */
63
+ static ConceptName = 'Module';
64
+ /** 继承链 */
65
+ static inheritanceChain = ['BaseNode'];
66
+ /**
67
+ * 产品概念
68
+ */
69
+ concept;
70
+ /**
71
+ * type
72
+ */
73
+ // @ts-ignore
74
+ type;
75
+ /**
76
+ * version
77
+ */
78
+ // @ts-ignore
79
+ version;
80
+ /**
81
+ * 模块名称
82
+ */
83
+ // @ts-ignore
84
+ name;
85
+ /**
86
+ * 模块标题
87
+ */
88
+ // @ts-ignore
89
+ title;
90
+ /**
91
+ * 模块描述
92
+ */
93
+ // @ts-ignore
94
+ description;
95
+ /**
96
+ * provider
97
+ */
98
+ // @ts-ignore
99
+ provider;
100
+ /**
101
+ * 外部语言依赖
102
+ */
103
+ // @ts-ignore
104
+ externalDependencyMap;
105
+ /**
106
+ * 外部语言依赖
107
+ */
108
+ // @ts-ignore
109
+ compilerInfoMap;
110
+ /**
111
+ * 数据源列表
112
+ */
113
+ dataSources = [];
114
+ /**
115
+ * 数据结构列表
116
+ */
117
+ structures = [];
118
+ /**
119
+ * 枚举列表
120
+ */
121
+ enums = [];
122
+ /**
123
+ * 逻辑列表
124
+ */
125
+ logics = [];
126
+ /**
127
+ * interfaces
128
+ */
129
+ interfaces = [];
130
+ /**
131
+ * 页面列表
132
+ */
133
+ views = [];
134
+ /**
135
+ * 变量列表
136
+ */
137
+ frontendVariables = [];
138
+ /**
139
+ * 流程列表
140
+ */
141
+ processes = [];
142
+ /**
143
+ * 前端库列表
144
+ */
145
+ frontends = [];
146
+ /**
147
+ * 配置管理
148
+ */
149
+ // @ts-ignore
150
+ configuration;
151
+ /**
152
+ * 祖先 App
153
+ */
154
+ get app() {
155
+ return this.getAncestor('App');
156
+ }
157
+ /**
158
+ * @param source 需要合并的部分参数
159
+ */
160
+ constructor(source) {
161
+ source = Object.assign({}, Module_1.getDefaultOptions(), source);
162
+ super(source);
163
+ super.subConstructor(source);
164
+ }
165
+ static from(source, parentNode, parentKey) {
166
+ return super.from(source, parentNode, parentKey);
167
+ }
168
+ /**
169
+ * 从父级删除该节点
170
+ * @internal
171
+ */
172
+ _delete() {
173
+ let params = null;
174
+ if (this.parentNode) {
175
+ params = this.parentNode?.__removeModule?.(this);
176
+ }
177
+ return params;
178
+ }
179
+ getDataSourceExistingNames(excludedList = []) {
180
+ const excludedSet = new Set(excludedList);
181
+ return (this.dataSources || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
182
+ }
183
+ getDataSourceUniqueName(name = 'dataSource1') {
184
+ return utils.unique(name, this.getDataSourceExistingNames(), undefined, false);
185
+ }
186
+ _insertDataSourceAt(options, index) {
187
+ const dataSourceOptions = {};
188
+ const relationOptions = { parentNode: this, parentKey: 'dataSources' };
189
+ let dataSource;
190
+ if (!options) {
191
+ dataSource = DataSource__1.default.from({
192
+ ...dataSourceOptions,
193
+ name: this.getDataSourceUniqueName(),
194
+ }, this, 'dataSources');
195
+ }
196
+ else if (typeof options === 'string') {
197
+ dataSource = DataSource__1.default.from({
198
+ ...dataSourceOptions,
199
+ name: options,
200
+ }, this, 'dataSources');
201
+ }
202
+ else if (options instanceof DataSource__1.default) {
203
+ options.ensureDelete(); // 同一实例不支持多处存在
204
+ dataSource = options;
205
+ Object.assign(dataSource, relationOptions);
206
+ }
207
+ else {
208
+ dataSource = DataSource__1.default.from({
209
+ ...dataSourceOptions,
210
+ ...options,
211
+ }, this, 'dataSources');
212
+ }
213
+ this.dataSources.splice(index, 0, dataSource);
214
+ return dataSource;
215
+ }
216
+ insertDataSourceAt(options, index) {
217
+ const node = this._insertDataSourceAt(options, index);
218
+ node.create({
219
+ index,
220
+ parentNode: this,
221
+ parentKey: 'dataSources',
222
+ });
223
+ return node;
224
+ }
225
+ _addDataSource(options) {
226
+ const index = 0;
227
+ return this._insertDataSourceAt(options, index);
228
+ }
229
+ addDataSource(options) {
230
+ const node = this._addDataSource(options);
231
+ const index = this.dataSources.indexOf(node);
232
+ node.create({
233
+ index,
234
+ parentNode: this,
235
+ parentKey: 'dataSources',
236
+ });
237
+ return node;
238
+ }
239
+ getStructureExistingNames(excludedList = []) {
240
+ const excludedSet = new Set(excludedList);
241
+ return (this.structures || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
242
+ }
243
+ getStructureUniqueName(name = 'Structure1') {
244
+ return utils.unique(name, this.getStructureExistingNames(), undefined, false);
245
+ }
246
+ _insertStructureAt(options, index) {
247
+ const structureOptions = {};
248
+ const relationOptions = { parentNode: this, parentKey: 'structures' };
249
+ let structure;
250
+ if (!options) {
251
+ structure = Structure__1.default.from({
252
+ ...structureOptions,
253
+ name: this.getStructureUniqueName(),
254
+ }, this, 'structures');
255
+ }
256
+ else if (typeof options === 'string') {
257
+ structure = Structure__1.default.from({
258
+ ...structureOptions,
259
+ name: options,
260
+ }, this, 'structures');
261
+ }
262
+ else if (options instanceof Structure__1.default) {
263
+ options.ensureDelete(); // 同一实例不支持多处存在
264
+ structure = options;
265
+ Object.assign(structure, relationOptions);
266
+ }
267
+ else {
268
+ structure = Structure__1.default.from({
269
+ ...structureOptions,
270
+ ...options,
271
+ }, this, 'structures');
272
+ }
273
+ this.structures.splice(index, 0, structure);
274
+ return structure;
275
+ }
276
+ insertStructureAt(options, index) {
277
+ const node = this._insertStructureAt(options, index);
278
+ node.create({
279
+ index,
280
+ parentNode: this,
281
+ parentKey: 'structures',
282
+ });
283
+ return node;
284
+ }
285
+ _addStructure(options) {
286
+ const index = 0;
287
+ return this._insertStructureAt(options, index);
288
+ }
289
+ addStructure(options) {
290
+ const node = this._addStructure(options);
291
+ const index = this.structures.indexOf(node);
292
+ node.create({
293
+ index,
294
+ parentNode: this,
295
+ parentKey: 'structures',
296
+ });
297
+ return node;
298
+ }
299
+ getEnumExistingNames(excludedList = []) {
300
+ const excludedSet = new Set(excludedList);
301
+ return (this.enums || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
302
+ }
303
+ getEnumUniqueName(name = 'Enum1') {
304
+ return utils.unique(name, this.getEnumExistingNames(), undefined, false);
305
+ }
306
+ _insertEnumAt(options, index) {
307
+ const enumerationOptions = {};
308
+ const relationOptions = { parentNode: this, parentKey: 'enums' };
309
+ let enumeration;
310
+ if (!options) {
311
+ enumeration = Enum__1.default.from({
312
+ ...enumerationOptions,
313
+ name: this.getEnumUniqueName(),
314
+ }, this, 'enums');
315
+ }
316
+ else if (typeof options === 'string') {
317
+ enumeration = Enum__1.default.from({
318
+ ...enumerationOptions,
319
+ name: options,
320
+ }, this, 'enums');
321
+ }
322
+ else if (options instanceof Enum__1.default) {
323
+ options.ensureDelete(); // 同一实例不支持多处存在
324
+ enumeration = options;
325
+ Object.assign(enumeration, relationOptions);
326
+ }
327
+ else {
328
+ enumeration = Enum__1.default.from({
329
+ ...enumerationOptions,
330
+ ...options,
331
+ }, this, 'enums');
332
+ }
333
+ this.enums.splice(index, 0, enumeration);
334
+ return enumeration;
335
+ }
336
+ insertEnumAt(options, index) {
337
+ const node = this._insertEnumAt(options, index);
338
+ node.create({
339
+ index,
340
+ parentNode: this,
341
+ parentKey: 'enums',
342
+ });
343
+ return node;
344
+ }
345
+ _addEnum(options) {
346
+ const index = 0;
347
+ return this._insertEnumAt(options, index);
348
+ }
349
+ addEnum(options) {
350
+ const node = this._addEnum(options);
351
+ const index = this.enums.indexOf(node);
352
+ node.create({
353
+ index,
354
+ parentNode: this,
355
+ parentKey: 'enums',
356
+ });
357
+ return node;
358
+ }
359
+ getLogicExistingNames(excludedList = []) {
360
+ const excludedSet = new Set(excludedList);
361
+ return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
362
+ }
363
+ getLogicUniqueName(name = 'logic1') {
364
+ return utils.unique(name, this.getLogicExistingNames(), undefined, false);
365
+ }
366
+ _insertLogicAt(options, index) {
367
+ const logicOptions = {};
368
+ const relationOptions = { parentNode: this, parentKey: 'logics' };
369
+ let logic;
370
+ if (!options) {
371
+ logic = Logic__1.default.from({
372
+ ...logicOptions,
373
+ name: this.getLogicUniqueName(),
374
+ }, this, 'logics');
375
+ }
376
+ else if (typeof options === 'string') {
377
+ logic = Logic__1.default.from({
378
+ ...logicOptions,
379
+ name: options,
380
+ }, this, 'logics');
381
+ }
382
+ else if (options instanceof Logic__1.default) {
383
+ options.ensureDelete(); // 同一实例不支持多处存在
384
+ logic = options;
385
+ Object.assign(logic, relationOptions);
386
+ }
387
+ else {
388
+ logic = Logic__1.default.from({
389
+ ...logicOptions,
390
+ ...options,
391
+ }, this, 'logics');
392
+ }
393
+ this.logics.splice(index, 0, logic);
394
+ return logic;
395
+ }
396
+ insertLogicAt(options, index) {
397
+ const node = this._insertLogicAt(options, index);
398
+ node.create({
399
+ index,
400
+ parentNode: this,
401
+ parentKey: 'logics',
402
+ });
403
+ return node;
404
+ }
405
+ _addLogic(options) {
406
+ const index = 0;
407
+ return this._insertLogicAt(options, index);
408
+ }
409
+ addLogic(options) {
410
+ const node = this._addLogic(options);
411
+ const index = this.logics.indexOf(node);
412
+ node.create({
413
+ index,
414
+ parentNode: this,
415
+ parentKey: 'logics',
416
+ });
417
+ return node;
418
+ }
419
+ getInterfaceExistingNames(excludedList = []) {
420
+ const excludedSet = new Set(excludedList);
421
+ return (this.interfaces || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
422
+ }
423
+ getInterfaceUniqueName(name = 'Interface1') {
424
+ return utils.unique(name, this.getInterfaceExistingNames(), undefined, false);
425
+ }
426
+ _insertInterfaceAt(options, index) {
427
+ const itfaceOptions = {};
428
+ const relationOptions = { parentNode: this, parentKey: 'interfaces' };
429
+ let itface;
430
+ if (!options) {
431
+ itface = Interface__1.default.from({
432
+ ...itfaceOptions,
433
+ name: this.getInterfaceUniqueName(),
434
+ }, this, 'interfaces');
435
+ }
436
+ else if (typeof options === 'string') {
437
+ itface = Interface__1.default.from({
438
+ ...itfaceOptions,
439
+ name: options,
440
+ }, this, 'interfaces');
441
+ }
442
+ else if (options instanceof Interface__1.default) {
443
+ options.ensureDelete(); // 同一实例不支持多处存在
444
+ itface = options;
445
+ Object.assign(itface, relationOptions);
446
+ }
447
+ else {
448
+ itface = Interface__1.default.from({
449
+ ...itfaceOptions,
450
+ ...options,
451
+ }, this, 'interfaces');
452
+ }
453
+ this.interfaces.splice(index, 0, itface);
454
+ return itface;
455
+ }
456
+ insertInterfaceAt(options, index) {
457
+ const node = this._insertInterfaceAt(options, index);
458
+ node.create({
459
+ index,
460
+ parentNode: this,
461
+ parentKey: 'interfaces',
462
+ });
463
+ return node;
464
+ }
465
+ _addInterface(options) {
466
+ const index = 0;
467
+ return this._insertInterfaceAt(options, index);
468
+ }
469
+ addInterface(options) {
470
+ const node = this._addInterface(options);
471
+ const index = this.interfaces.indexOf(node);
472
+ node.create({
473
+ index,
474
+ parentNode: this,
475
+ parentKey: 'interfaces',
476
+ });
477
+ return node;
478
+ }
479
+ getInterfaceFromExampleExistingNames(excludedList = []) {
480
+ const excludedSet = new Set(excludedList);
481
+ return (this.interfaces || [])
482
+ .filter((item) => !excludedSet.has(item))
483
+ .map((item) => item.name);
484
+ }
485
+ getInterfaceFromExampleUniqueName(name = 'Interface1') {
486
+ return utils.unique(name, this.getInterfaceFromExampleExistingNames(), undefined, false);
487
+ }
488
+ _insertInterfaceFromExampleAt(options, index) {
489
+ const itfaceOptions = {};
490
+ const relationOptions = { parentNode: this, parentKey: 'interfaces' };
491
+ let itface;
492
+ if (!options) {
493
+ itface = InterfaceFromExample__1.default.from({
494
+ ...itfaceOptions,
495
+ name: this.getInterfaceFromExampleUniqueName(),
496
+ }, this, 'interfaces');
497
+ }
498
+ else if (typeof options === 'string') {
499
+ itface = InterfaceFromExample__1.default.from({
500
+ ...itfaceOptions,
501
+ name: options,
502
+ }, this, 'interfaces');
503
+ }
504
+ else if (options instanceof InterfaceFromExample__1.default) {
505
+ options.ensureDelete(); // 同一实例不支持多处存在
506
+ itface = options;
507
+ Object.assign(itface, relationOptions);
508
+ }
509
+ else {
510
+ itface = InterfaceFromExample__1.default.from({
511
+ ...itfaceOptions,
512
+ ...options,
513
+ }, this, 'interfaces');
514
+ }
515
+ this.interfaces.splice(index, 0, itface);
516
+ return itface;
517
+ }
518
+ insertInterfaceFromExampleAt(options, index) {
519
+ const node = this._insertInterfaceFromExampleAt(options, index);
520
+ node.create({
521
+ index,
522
+ parentNode: this,
523
+ parentKey: 'interfaces',
524
+ });
525
+ return node;
526
+ }
527
+ _addInterfaceFromExample(options) {
528
+ const index = 0;
529
+ return this._insertInterfaceFromExampleAt(options, index);
530
+ }
531
+ addInterfaceFromExample(options) {
532
+ const node = this._addInterfaceFromExample(options);
533
+ const index = this.interfaces.indexOf(node);
534
+ node.create({
535
+ index,
536
+ parentNode: this,
537
+ parentKey: 'interfaces',
538
+ });
539
+ return node;
540
+ }
541
+ getViewExistingNames(excludedList = []) {
542
+ const excludedSet = new Set(excludedList);
543
+ return (this.views || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
544
+ }
545
+ getViewUniqueName(name = 'view1') {
546
+ return utils.unique(name, this.getViewExistingNames(), undefined, false);
547
+ }
548
+ _insertViewAt(options, index) {
549
+ const viewOptions = {};
550
+ const relationOptions = { parentNode: this, parentKey: 'views' };
551
+ let view;
552
+ if (!options) {
553
+ view = View__1.default.from({
554
+ ...viewOptions,
555
+ name: this.getViewUniqueName(),
556
+ }, this, 'views');
557
+ }
558
+ else if (typeof options === 'string') {
559
+ view = View__1.default.from({
560
+ ...viewOptions,
561
+ name: options,
562
+ }, this, 'views');
563
+ }
564
+ else if (options instanceof View__1.default) {
565
+ options.ensureDelete(); // 同一实例不支持多处存在
566
+ view = options;
567
+ Object.assign(view, relationOptions);
568
+ }
569
+ else {
570
+ view = View__1.default.from({
571
+ ...viewOptions,
572
+ ...options,
573
+ }, this, 'views');
574
+ }
575
+ this.views.splice(index, 0, view);
576
+ return view;
577
+ }
578
+ insertViewAt(options, index) {
579
+ const node = this._insertViewAt(options, index);
580
+ node.create({
581
+ index,
582
+ parentNode: this,
583
+ parentKey: 'views',
584
+ });
585
+ return node;
586
+ }
587
+ _addView(options) {
588
+ const index = this.views.length;
589
+ return this._insertViewAt(options, index);
590
+ }
591
+ addView(options) {
592
+ const node = this._addView(options);
593
+ const index = this.views.indexOf(node);
594
+ node.create({
595
+ index,
596
+ parentNode: this,
597
+ parentKey: 'views',
598
+ });
599
+ return node;
600
+ }
601
+ getVarExistingNames(excludedList = []) {
602
+ const excludedSet = new Set(excludedList);
603
+ return (this.frontendVariables || [])
604
+ .filter((item) => !excludedSet.has(item))
605
+ .map((item) => item.name);
606
+ }
607
+ getVariableUniqueName(name = 'variable1') {
608
+ return utils.unique(name, this.getVarExistingNames(), undefined, true);
609
+ }
610
+ _insertVariableAt(options, index) {
611
+ const variableOptions = {};
612
+ const relationOptions = { parentNode: this, parentKey: 'frontendVariables' };
613
+ let variable;
614
+ if (!options) {
615
+ variable = Variable__1.default.from({
616
+ ...variableOptions,
617
+ name: this.getVariableUniqueName(),
618
+ }, this, 'frontendVariables');
619
+ }
620
+ else if (typeof options === 'string') {
621
+ variable = Variable__1.default.from({
622
+ ...variableOptions,
623
+ name: options,
624
+ }, this, 'frontendVariables');
625
+ }
626
+ else if (options instanceof Variable__1.default) {
627
+ options.ensureDelete(); // 同一实例不支持多处存在
628
+ variable = options;
629
+ Object.assign(variable, relationOptions);
630
+ }
631
+ else {
632
+ variable = Variable__1.default.from({
633
+ ...variableOptions,
634
+ ...options,
635
+ }, this, 'frontendVariables');
636
+ }
637
+ this.frontendVariables.splice(index, 0, variable);
638
+ return variable;
639
+ }
640
+ insertVariableAt(options, index) {
641
+ const node = this._insertVariableAt(options, index);
642
+ node.create({
643
+ index,
644
+ parentNode: this,
645
+ parentKey: 'frontendVariables',
646
+ });
647
+ return node;
648
+ }
649
+ _addVariable(options) {
650
+ const index = this.frontendVariables.length;
651
+ return this._insertVariableAt(options, index);
652
+ }
653
+ addVariable(options) {
654
+ const node = this._addVariable(options);
655
+ const index = this.frontendVariables.indexOf(node);
656
+ node.create({
657
+ index,
658
+ parentNode: this,
659
+ parentKey: 'frontendVariables',
660
+ });
661
+ return node;
662
+ }
663
+ getProcessExistingNames(excludedList = []) {
664
+ const excludedSet = new Set(excludedList);
665
+ return (this.processes || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
666
+ }
667
+ getProcessUniqueName(name = 'Process1') {
668
+ return utils.unique(name, this.getProcessExistingNames(), undefined, false);
669
+ }
670
+ _insertProcessAt(options, index) {
671
+ const processOptions = {};
672
+ const relationOptions = { parentNode: this, parentKey: 'processes' };
673
+ let process;
674
+ if (!options) {
675
+ process = Process__1.default.from({
676
+ ...processOptions,
677
+ name: this.getProcessUniqueName(),
678
+ }, this, 'processes');
679
+ }
680
+ else if (typeof options === 'string') {
681
+ process = Process__1.default.from({
682
+ ...processOptions,
683
+ name: options,
684
+ }, this, 'processes');
685
+ }
686
+ else if (options instanceof Process__1.default) {
687
+ options.ensureDelete(); // 同一实例不支持多处存在
688
+ process = options;
689
+ Object.assign(process, relationOptions);
690
+ }
691
+ else {
692
+ process = Process__1.default.from({
693
+ ...processOptions,
694
+ ...options,
695
+ }, this, 'processes');
696
+ }
697
+ this.processes.splice(index, 0, process);
698
+ return process;
699
+ }
700
+ insertProcessAt(options, index) {
701
+ const node = this._insertProcessAt(options, index);
702
+ node.create({
703
+ index,
704
+ parentNode: this,
705
+ parentKey: 'processes',
706
+ });
707
+ return node;
708
+ }
709
+ _addProcess(options) {
710
+ const index = 0;
711
+ return this._insertProcessAt(options, index);
712
+ }
713
+ addProcess(options) {
714
+ const node = this._addProcess(options);
715
+ const index = this.processes.indexOf(node);
716
+ node.create({
717
+ index,
718
+ parentNode: this,
719
+ parentKey: 'processes',
720
+ });
721
+ return node;
722
+ }
723
+ getFrontendLibraryExistingNames(excludedList = []) {
724
+ const excludedSet = new Set(excludedList);
725
+ return (this.frontends || [])
726
+ .filter((item) => !excludedSet.has(item))
727
+ .map((item) => item.name);
728
+ }
729
+ getFrontendLibraryUniqueName(name = 'frontendLibrary1') {
730
+ return utils.unique(name, this.getFrontendLibraryExistingNames(), undefined, false);
731
+ }
732
+ _insertFrontendLibraryAt(options, index) {
733
+ const frontendLibraryOptions = {};
734
+ const relationOptions = { parentNode: this, parentKey: 'frontends' };
735
+ let frontendLibrary;
736
+ if (!options) {
737
+ frontendLibrary = FrontendLibrary__1.default.from({
738
+ ...frontendLibraryOptions,
739
+ name: this.getFrontendLibraryUniqueName(),
740
+ }, this, 'frontends');
741
+ }
742
+ else if (typeof options === 'string') {
743
+ frontendLibrary = FrontendLibrary__1.default.from({
744
+ ...frontendLibraryOptions,
745
+ name: options,
746
+ }, this, 'frontends');
747
+ }
748
+ else if (options instanceof FrontendLibrary__1.default) {
749
+ options.ensureDelete(); // 同一实例不支持多处存在
750
+ frontendLibrary = options;
751
+ Object.assign(frontendLibrary, relationOptions);
752
+ }
753
+ else {
754
+ frontendLibrary = FrontendLibrary__1.default.from({
755
+ ...frontendLibraryOptions,
756
+ ...options,
757
+ }, this, 'frontends');
758
+ }
759
+ this.frontends.splice(index, 0, frontendLibrary);
760
+ return frontendLibrary;
761
+ }
762
+ insertFrontendLibraryAt(options, index) {
763
+ const node = this._insertFrontendLibraryAt(options, index);
764
+ node.create({
765
+ index,
766
+ parentNode: this,
767
+ parentKey: 'frontends',
768
+ });
769
+ return node;
770
+ }
771
+ _addFrontendLibrary(options) {
772
+ const index = this.frontends.length;
773
+ return this._insertFrontendLibraryAt(options, index);
774
+ }
775
+ addFrontendLibrary(options) {
776
+ const node = this._addFrontendLibrary(options);
777
+ const index = this.frontends.indexOf(node);
778
+ node.create({
779
+ index,
780
+ parentNode: this,
781
+ parentKey: 'frontends',
782
+ });
783
+ return node;
784
+ }
785
+ removeDataSource(options) {
786
+ let dataSource;
787
+ if (typeof options === 'string') {
788
+ dataSource = this.dataSources.find((item) => item.name === options);
789
+ if (!dataSource) {
790
+ throw new Error('找不到数据源 ' + options);
791
+ }
792
+ }
793
+ else {
794
+ dataSource = options;
795
+ }
796
+ return dataSource.delete();
797
+ }
798
+ __removeDataSource(dataSource) {
799
+ const parentKey = dataSource.parentKey;
800
+ const params = {
801
+ parentNode: this,
802
+ parentKey,
803
+ index: -1,
804
+ object: null,
805
+ oldObject: dataSource,
806
+ };
807
+ if (parentKey) {
808
+ params.parentKey = parentKey;
809
+ if (Array.isArray(this[parentKey])) {
810
+ const index = this[parentKey].indexOf(dataSource);
811
+ ~index && this[parentKey].splice(index, 1);
812
+ params.index = index;
813
+ }
814
+ else if (this[parentKey] === dataSource) {
815
+ params.index = 0;
816
+ this[parentKey] = undefined;
817
+ }
818
+ }
819
+ return params;
820
+ }
821
+ removeStructure(options) {
822
+ let structure;
823
+ if (typeof options === 'string') {
824
+ structure = this.structures.find((item) => item.name === options);
825
+ if (!structure) {
826
+ throw new Error('找不到数据结构 ' + options);
827
+ }
828
+ }
829
+ else {
830
+ structure = options;
831
+ }
832
+ return structure.delete();
833
+ }
834
+ __removeStructure(structure) {
835
+ const parentKey = structure.parentKey;
836
+ const params = {
837
+ parentNode: this,
838
+ parentKey,
839
+ index: -1,
840
+ object: null,
841
+ oldObject: structure,
842
+ };
843
+ if (parentKey) {
844
+ params.parentKey = parentKey;
845
+ if (Array.isArray(this[parentKey])) {
846
+ const index = this[parentKey].indexOf(structure);
847
+ ~index && this[parentKey].splice(index, 1);
848
+ params.index = index;
849
+ }
850
+ else if (this[parentKey] === structure) {
851
+ params.index = 0;
852
+ this[parentKey] = undefined;
853
+ }
854
+ }
855
+ return params;
856
+ }
857
+ removeEnum(options) {
858
+ let enumeration;
859
+ if (typeof options === 'string') {
860
+ enumeration = this.enums.find((item) => item.name === options);
861
+ if (!enumeration) {
862
+ throw new Error('找不到枚举 ' + options);
863
+ }
864
+ }
865
+ else {
866
+ enumeration = options;
867
+ }
868
+ return enumeration.delete();
869
+ }
870
+ __removeEnum(enumeration) {
871
+ const parentKey = enumeration.parentKey;
872
+ const params = {
873
+ parentNode: this,
874
+ parentKey,
875
+ index: -1,
876
+ object: null,
877
+ oldObject: enumeration,
878
+ };
879
+ if (parentKey) {
880
+ params.parentKey = parentKey;
881
+ if (Array.isArray(this[parentKey])) {
882
+ const index = this[parentKey].indexOf(enumeration);
883
+ ~index && this[parentKey].splice(index, 1);
884
+ params.index = index;
885
+ }
886
+ else if (this[parentKey] === enumeration) {
887
+ params.index = 0;
888
+ this[parentKey] = undefined;
889
+ }
890
+ }
891
+ return params;
892
+ }
893
+ removeLogic(options) {
894
+ let logic;
895
+ if (typeof options === 'string') {
896
+ logic = this.logics.find((item) => item.name === options);
897
+ if (!logic) {
898
+ throw new Error('找不到逻辑 ' + options);
899
+ }
900
+ }
901
+ else {
902
+ logic = options;
903
+ }
904
+ return logic.delete();
905
+ }
906
+ __removeLogic(logic) {
907
+ const parentKey = logic.parentKey;
908
+ const params = {
909
+ parentNode: this,
910
+ parentKey,
911
+ index: -1,
912
+ object: null,
913
+ oldObject: logic,
914
+ };
915
+ if (parentKey) {
916
+ params.parentKey = parentKey;
917
+ if (Array.isArray(this[parentKey])) {
918
+ const index = this[parentKey].indexOf(logic);
919
+ ~index && this[parentKey].splice(index, 1);
920
+ params.index = index;
921
+ }
922
+ else if (this[parentKey] === logic) {
923
+ params.index = 0;
924
+ this[parentKey] = undefined;
925
+ }
926
+ }
927
+ return params;
928
+ }
929
+ removeInterface(options) {
930
+ let itface;
931
+ if (typeof options === 'string') {
932
+ itface = this.interfaces.find((item) => item.name === options);
933
+ if (!itface) {
934
+ throw new Error('找不到接口 ' + options);
935
+ }
936
+ }
937
+ else {
938
+ itface = options;
939
+ }
940
+ return itface.delete();
941
+ }
942
+ __removeAbstractInterface(itface) {
943
+ const parentKey = itface.parentKey;
944
+ const params = {
945
+ parentNode: this,
946
+ parentKey,
947
+ index: -1,
948
+ object: null,
949
+ oldObject: itface,
950
+ };
951
+ if (parentKey) {
952
+ params.parentKey = parentKey;
953
+ if (Array.isArray(this[parentKey])) {
954
+ const index = this[parentKey].indexOf(itface);
955
+ ~index && this[parentKey].splice(index, 1);
956
+ params.index = index;
957
+ }
958
+ else if (this[parentKey] === itface) {
959
+ params.index = 0;
960
+ this[parentKey] = undefined;
961
+ }
962
+ }
963
+ return params;
964
+ }
965
+ removeInterfaceFromExample(options) {
966
+ let itface;
967
+ if (typeof options === 'string') {
968
+ itface = this.interfaces.find((item) => item.name === options);
969
+ if (!itface) {
970
+ throw new Error('找不到由JSON生成接口 ' + options);
971
+ }
972
+ }
973
+ else {
974
+ itface = options;
975
+ }
976
+ return itface.delete();
977
+ }
978
+ __removeInterfaceFromExample(itface) {
979
+ const parentKey = itface.parentKey;
980
+ const params = {
981
+ parentNode: this,
982
+ parentKey,
983
+ index: -1,
984
+ object: null,
985
+ oldObject: itface,
986
+ };
987
+ if (parentKey) {
988
+ params.parentKey = parentKey;
989
+ if (Array.isArray(this[parentKey])) {
990
+ const index = this[parentKey].indexOf(itface);
991
+ ~index && this[parentKey].splice(index, 1);
992
+ params.index = index;
993
+ }
994
+ else if (this[parentKey] === itface) {
995
+ params.index = 0;
996
+ this[parentKey] = undefined;
997
+ }
998
+ }
999
+ return params;
1000
+ }
1001
+ removeView(options) {
1002
+ let view;
1003
+ if (typeof options === 'string') {
1004
+ view = this.views.find((item) => item.name === options);
1005
+ if (!view) {
1006
+ throw new Error('找不到页面 ' + options);
1007
+ }
1008
+ }
1009
+ else {
1010
+ view = options;
1011
+ }
1012
+ return view.delete();
1013
+ }
1014
+ __removeView(view) {
1015
+ const parentKey = view.parentKey;
1016
+ const params = {
1017
+ parentNode: this,
1018
+ parentKey,
1019
+ index: -1,
1020
+ object: null,
1021
+ oldObject: view,
1022
+ };
1023
+ if (parentKey) {
1024
+ params.parentKey = parentKey;
1025
+ if (Array.isArray(this[parentKey])) {
1026
+ const index = this[parentKey].indexOf(view);
1027
+ ~index && this[parentKey].splice(index, 1);
1028
+ params.index = index;
1029
+ }
1030
+ else if (this[parentKey] === view) {
1031
+ params.index = 0;
1032
+ this[parentKey] = undefined;
1033
+ }
1034
+ }
1035
+ return params;
1036
+ }
1037
+ removeVariable(options) {
1038
+ let variable;
1039
+ if (typeof options === 'string') {
1040
+ variable = this.frontendVariables.find((item) => item.name === options);
1041
+ if (!variable) {
1042
+ throw new Error('找不到变量 ' + options);
1043
+ }
1044
+ }
1045
+ else {
1046
+ variable = options;
1047
+ }
1048
+ return variable.delete();
1049
+ }
1050
+ __removeVariable(variable) {
1051
+ const parentKey = variable.parentKey;
1052
+ const params = {
1053
+ parentNode: this,
1054
+ parentKey,
1055
+ index: -1,
1056
+ object: null,
1057
+ oldObject: variable,
1058
+ };
1059
+ if (parentKey) {
1060
+ params.parentKey = parentKey;
1061
+ if (Array.isArray(this[parentKey])) {
1062
+ const index = this[parentKey].indexOf(variable);
1063
+ ~index && this[parentKey].splice(index, 1);
1064
+ params.index = index;
1065
+ }
1066
+ else if (this[parentKey] === variable) {
1067
+ params.index = 0;
1068
+ this[parentKey] = undefined;
1069
+ }
1070
+ }
1071
+ return params;
1072
+ }
1073
+ removeProcess(options) {
1074
+ let process;
1075
+ if (typeof options === 'string') {
1076
+ process = this.processes.find((item) => item.name === options);
1077
+ if (!process) {
1078
+ throw new Error('找不到流程 ' + options);
1079
+ }
1080
+ }
1081
+ else {
1082
+ process = options;
1083
+ }
1084
+ return process.delete();
1085
+ }
1086
+ __removeProcess(process) {
1087
+ const parentKey = process.parentKey;
1088
+ const params = {
1089
+ parentNode: this,
1090
+ parentKey,
1091
+ index: -1,
1092
+ object: null,
1093
+ oldObject: process,
1094
+ };
1095
+ if (parentKey) {
1096
+ params.parentKey = parentKey;
1097
+ if (Array.isArray(this[parentKey])) {
1098
+ const index = this[parentKey].indexOf(process);
1099
+ ~index && this[parentKey].splice(index, 1);
1100
+ params.index = index;
1101
+ }
1102
+ else if (this[parentKey] === process) {
1103
+ params.index = 0;
1104
+ this[parentKey] = undefined;
1105
+ }
1106
+ }
1107
+ return params;
1108
+ }
1109
+ removeFrontendLibrary(options) {
1110
+ let frontendLibrary;
1111
+ if (typeof options === 'string') {
1112
+ frontendLibrary = this.frontends.find((item) => item.name === options);
1113
+ if (!frontendLibrary) {
1114
+ throw new Error('找不到前端库 ' + options);
1115
+ }
1116
+ }
1117
+ else {
1118
+ frontendLibrary = options;
1119
+ }
1120
+ return frontendLibrary.delete();
1121
+ }
1122
+ __removeFrontendLibrary(frontendLibrary) {
1123
+ const parentKey = frontendLibrary.parentKey;
1124
+ const params = {
1125
+ parentNode: this,
1126
+ parentKey,
1127
+ index: -1,
1128
+ object: null,
1129
+ oldObject: frontendLibrary,
1130
+ };
1131
+ if (parentKey) {
1132
+ params.parentKey = parentKey;
1133
+ if (Array.isArray(this[parentKey])) {
1134
+ const index = this[parentKey].indexOf(frontendLibrary);
1135
+ ~index && this[parentKey].splice(index, 1);
1136
+ params.index = index;
1137
+ }
1138
+ else if (this[parentKey] === frontendLibrary) {
1139
+ params.index = 0;
1140
+ this[parentKey] = undefined;
1141
+ }
1142
+ }
1143
+ return params;
1144
+ }
1145
+ removeConfiguration(options) {
1146
+ let configuration;
1147
+ if (typeof options === 'string') {
1148
+ configuration = this.configuration;
1149
+ if (!configuration) {
1150
+ throw new Error('找不到配置管理 ' + options);
1151
+ }
1152
+ }
1153
+ else {
1154
+ configuration = options;
1155
+ }
1156
+ return configuration.delete();
1157
+ }
1158
+ __removeConfiguration(configuration) {
1159
+ const parentKey = configuration.parentKey;
1160
+ const params = {
1161
+ parentNode: this,
1162
+ parentKey,
1163
+ index: -1,
1164
+ object: null,
1165
+ oldObject: configuration,
1166
+ };
1167
+ if (parentKey) {
1168
+ params.parentKey = parentKey;
1169
+ if (Array.isArray(this[parentKey])) {
1170
+ const index = this[parentKey].indexOf(configuration);
1171
+ ~index && this[parentKey].splice(index, 1);
1172
+ params.index = index;
1173
+ }
1174
+ else if (this[parentKey] === configuration) {
1175
+ params.index = 0;
1176
+ this[parentKey] = undefined;
1177
+ }
1178
+ }
1179
+ return params;
1180
+ }
1181
+ //================================================================================
1182
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1183
+ // 自动生成的代码已结束。下面可以手动编写。
1184
+ //================================================================================
1185
+ /**
1186
+ * 用于区分存量应用新导入模块,存量应用替换数据结构使用
1187
+ */
1188
+ isAdd;
1189
+ /**
1190
+ * 是否启动
1191
+ */
1192
+ enable;
1193
+ /**
1194
+ * 依赖列表
1195
+ */
1196
+ dependencies = [];
1197
+ setIsAdd(isAdd) {
1198
+ const object = {
1199
+ isAdd,
1200
+ };
1201
+ this.update({
1202
+ ...object,
1203
+ });
1204
+ }
1205
+ /**
1206
+ * 生成宿主语言的文件路径
1207
+ * @param name 一般不用传,用于 rename
1208
+ */
1209
+ getEmbeddedFilePath(name = this.name) {
1210
+ return `/embedded/${this.app.name}/${this.parentKey}/${this.name}`;
1211
+ }
1212
+ /**
1213
+ * 获取命名空间和
1214
+ * 暂时不考虑 Module 嵌套的情况
1215
+ */
1216
+ getNamespace() {
1217
+ // connector namespace 为 connector + connectorName
1218
+ if (this.type === 'connector') {
1219
+ return `connector.${this.name}`;
1220
+ }
1221
+ return `${moduleNameSpace[this.parentKey]}`;
1222
+ }
1223
+ getTsNamespace() {
1224
+ if (this.type === 'connector') {
1225
+ return 'connector';
1226
+ }
1227
+ return `${moduleNameSpace[this.parentKey]}`;
1228
+ }
1229
+ getTsNamespaceAndName() {
1230
+ if (this.type === 'connector') {
1231
+ return 'connector';
1232
+ }
1233
+ return `${moduleNameSpace[this.parentKey]}.${this.name}`;
1234
+ }
1235
+ findEnumByName(name) {
1236
+ return this.enums.find((enumItem) => enumItem.name === name);
1237
+ }
1238
+ /**
1239
+ * 获取属性节点是否存在
1240
+ */
1241
+ findProperty(name, propertyType) {
1242
+ return this[propertyType].find((item) => item.name === name);
1243
+ }
1244
+ delete() {
1245
+ this.parentNode?.emit('collect:start', {
1246
+ actionMsg: '移除依赖库',
1247
+ });
1248
+ super.delete();
1249
+ this._delete();
1250
+ // if (this.dependencies) {
1251
+ // // 删除依赖链中的依赖
1252
+ // this.dependencies.forEach((tag) => {
1253
+ // const [name, version] = tag.split('-');
1254
+ // const existNode = this.app.dependencies.find((m) => m.name === name && m.version === version);
1255
+ // existNode?.delete();
1256
+ // });
1257
+ // }
1258
+ // 处理同名依赖 重新生成文件
1259
+ // if (this.enable) {
1260
+ // [数据源]
1261
+ const dataSourceGroup = this.parentNode?.configuration?.getGroup('dataSource');
1262
+ if (this.dataSources && dataSourceGroup) {
1263
+ this.dataSources.forEach((datasource) => {
1264
+ this.parentNode?.emit('clear:datasourceError', datasource);
1265
+ try {
1266
+ dataSourceGroup.removeConfigProperty(datasource.name);
1267
+ }
1268
+ catch (e) { }
1269
+ });
1270
+ }
1271
+ // // 已启用的依赖库被删除时,将后续被禁用的同名依赖库 切换为启用
1272
+ // const index = this.app.dependencies.findIndex((m) => m.enable === false && m.name === this.name);
1273
+ // if (index >= 0) {
1274
+ // const nextMainModule = this.app.dependencies[index];
1275
+ // // 更新[禁用的依赖]enable:true
1276
+ // nextMainModule.update({ enable: true });
1277
+ // nextMainModule.softDelete({ index });
1278
+ // }
1279
+ // }
1280
+ this.parentNode?.emit('collect:end');
1281
+ }
1282
+ // 删除再添加 触发文件生成
1283
+ softDelete(options) {
1284
+ // 删[禁用的依赖]
1285
+ super.delete();
1286
+ // 创建[禁用的依赖]
1287
+ this.app.insertModuleInDependenciesAt(this, options.index);
1288
+ // 创建[禁用的依赖]的数据源
1289
+ const dataSourceGroup = this.parentNode?.configuration?.getGroup('dataSource');
1290
+ if (this.dataSources && dataSourceGroup) {
1291
+ this.dataSources.forEach((datasource) => {
1292
+ const body = ConfigProperty__1.default.from({
1293
+ name: datasource.name,
1294
+ description: '',
1295
+ isPrivate: false,
1296
+ values: [
1297
+ { env: 'dev', value: '', concept: 'ConfigPropertyValue' },
1298
+ { env: 'online', value: '', concept: 'ConfigPropertyValue' },
1299
+ ],
1300
+ });
1301
+ dataSourceGroup.addConfigProperty(body);
1302
+ });
1303
+ }
1304
+ }
1305
+ setInterfaces(interfaces) {
1306
+ this.update({
1307
+ interfaces,
1308
+ });
1309
+ }
1310
+ // 获取数据结构被接口的引用关系
1311
+ getInterfaceStructureMap() {
1312
+ const structureMap = new Map();
1313
+ this.interfaces.forEach((itf) => {
1314
+ const stashItf = itf instanceof Interface__1.default ? itf : itf.inter;
1315
+ const structures = stashItf.getRefStructures(this.structures);
1316
+ structures.forEach((s) => {
1317
+ if (structureMap.has(s)) {
1318
+ structureMap.get(s).add(stashItf);
1319
+ }
1320
+ else {
1321
+ structureMap.set(s, new Set([stashItf]));
1322
+ }
1323
+ });
1324
+ });
1325
+ return structureMap;
1326
+ }
1327
+ /**
1328
+ * 设置版本号
1329
+ */
1330
+ setVersion(version) {
1331
+ this.update({
1332
+ version,
1333
+ });
1334
+ }
1335
+ };
1336
+ __decorate([
1337
+ (0, decorators_1.property)('concept')
1338
+ ], Module.prototype, "concept", void 0);
1339
+ __decorate([
1340
+ (0, decorators_1.property)()
1341
+ ], Module.prototype, "type", void 0);
1342
+ __decorate([
1343
+ (0, decorators_1.property)()
1344
+ ], Module.prototype, "version", void 0);
1345
+ __decorate([
1346
+ (0, decorators_1.property)()
1347
+ ], Module.prototype, "name", void 0);
1348
+ __decorate([
1349
+ (0, decorators_1.property)()
1350
+ ], Module.prototype, "title", void 0);
1351
+ __decorate([
1352
+ (0, decorators_1.property)()
1353
+ ], Module.prototype, "description", void 0);
1354
+ __decorate([
1355
+ (0, decorators_1.property)()
1356
+ ], Module.prototype, "provider", void 0);
1357
+ __decorate([
1358
+ (0, decorators_1.property)()
1359
+ ], Module.prototype, "externalDependencyMap", void 0);
1360
+ __decorate([
1361
+ (0, decorators_1.property)()
1362
+ ], Module.prototype, "compilerInfoMap", void 0);
1363
+ __decorate([
1364
+ (0, decorators_1.property)({
1365
+ objectRef: 'DataSource',
1366
+ isArray: true,
1367
+ defaultValue: [],
1368
+ })
1369
+ ], Module.prototype, "dataSources", void 0);
1370
+ __decorate([
1371
+ (0, decorators_1.property)({
1372
+ objectRef: 'Structure',
1373
+ isArray: true,
1374
+ defaultValue: [],
1375
+ })
1376
+ ], Module.prototype, "structures", void 0);
1377
+ __decorate([
1378
+ (0, decorators_1.property)({
1379
+ objectRef: 'Enum',
1380
+ isArray: true,
1381
+ defaultValue: [],
1382
+ })
1383
+ ], Module.prototype, "enums", void 0);
1384
+ __decorate([
1385
+ (0, decorators_1.property)({
1386
+ objectRef: 'Logic',
1387
+ isArray: true,
1388
+ defaultValue: [],
1389
+ })
1390
+ ], Module.prototype, "logics", void 0);
1391
+ __decorate([
1392
+ (0, decorators_1.property)({
1393
+ objectRef: 'Interface | InterfaceFromExample',
1394
+ isArray: true,
1395
+ defaultValue: [],
1396
+ })
1397
+ ], Module.prototype, "interfaces", void 0);
1398
+ __decorate([
1399
+ (0, decorators_1.property)({
1400
+ objectRef: 'View',
1401
+ isArray: true,
1402
+ defaultValue: [],
1403
+ })
1404
+ ], Module.prototype, "views", void 0);
1405
+ __decorate([
1406
+ (0, decorators_1.property)({
1407
+ objectRef: 'Variable',
1408
+ isArray: true,
1409
+ defaultValue: [],
1410
+ })
1411
+ ], Module.prototype, "frontendVariables", void 0);
1412
+ __decorate([
1413
+ (0, decorators_1.property)({
1414
+ objectRef: 'Process',
1415
+ isArray: true,
1416
+ defaultValue: [],
1417
+ })
1418
+ ], Module.prototype, "processes", void 0);
1419
+ __decorate([
1420
+ (0, decorators_1.property)({
1421
+ objectRef: 'FrontendLibrary',
1422
+ isArray: true,
1423
+ defaultValue: [],
1424
+ })
1425
+ ], Module.prototype, "frontends", void 0);
1426
+ __decorate([
1427
+ (0, decorators_1.property)({
1428
+ objectRef: 'Configuration',
1429
+ })
1430
+ ], Module.prototype, "configuration", void 0);
1431
+ __decorate([
1432
+ (0, decorators_1.property)()
1433
+ ], Module.prototype, "isAdd", void 0);
1434
+ __decorate([
1435
+ (0, decorators_1.property)()
1436
+ ], Module.prototype, "enable", void 0);
1437
+ __decorate([
1438
+ (0, decorators_1.property)()
1439
+ ], Module.prototype, "dependencies", void 0);
1440
+ Module = Module_1 = __decorate([
1441
+ decorators_1.className,
1442
+ (0, decorators_1.concept)('模块')
1443
+ // @ts-ignore
1444
+ ], Module);
1445
+ exports.Module = Module;
1446
+ exports.default = Module;
1447
+ //================================================================================
1448
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1449
+ // 自动生成的代码已结束。下面可以手动编写。
1450
+ //================================================================================
1757
1451
  //# sourceMappingURL=Module__.js.map