@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,1492 +1,1547 @@
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 Namespace_1;
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Namespace = void 0;
37
- const decorators_1 = require("../decorators");
38
- const utils = __importStar(require("../utils"));
39
- const BaseNode_1 = __importDefault(require("../common/BaseNode"));
40
- const Process__1 = __importDefault(require("./Process__"));
41
- const Structure__1 = __importDefault(require("./Structure__"));
42
- const Enum__1 = __importDefault(require("./Enum__"));
43
- const Logic__1 = __importDefault(require("./Logic__"));
44
- const Function__1 = __importDefault(require("./Function__"));
45
- const Interface__1 = __importDefault(require("./Interface__"));
46
- const View__1 = __importDefault(require("./View__"));
47
- const Variable__1 = __importDefault(require("./Variable__"));
48
- const ViewComponent__1 = __importDefault(require("./ViewComponent__"));
49
- const ProcessComponent__1 = __importDefault(require("./ProcessComponent__"));
50
- /**
51
- * 命名空间
52
- */
53
- let Namespace = class Namespace extends BaseNode_1.default {
54
- static { Namespace_1 = this; }
55
- /** 类名 */
56
- static ConceptName = 'Namespace';
57
- /**
58
- * 产品概念
59
- */
60
- concept;
61
- /**
62
- * 表示是从实体还是流程等概念产生的
63
- */
64
- // @ts-ignore
65
- originConcept;
66
- /**
67
- * 命名空间名称
68
- */
69
- // @ts-ignore
70
- name;
71
- /**
72
- * 命名空间标题
73
- */
74
- // @ts-ignore
75
- title;
76
- /**
77
- * 命名空间描述
78
- */
79
- // @ts-ignore
80
- description;
81
- /**
82
- * 命名空间列表
83
- */
84
- children = [];
85
- /**
86
- * 流程列表
87
- */
88
- processes = [];
89
- /**
90
- * 数据结构列表
91
- */
92
- structures = [];
93
- /**
94
- * 枚举列表
95
- */
96
- enums = [];
97
- /**
98
- * 逻辑列表
99
- */
100
- logics = [];
101
- /**
102
- * 函数列表
103
- */
104
- functions = [];
105
- /**
106
- * 接口列表
107
- */
108
- interfaces = [];
109
- /**
110
- * 页面列表
111
- */
112
- views = [];
113
- /**
114
- * 变量列表
115
- */
116
- frontendVariables = [];
117
- /**
118
- * 变量列表
119
- */
120
- variables = [];
121
- /**
122
- * 页面组件列表
123
- */
124
- viewComponents = [];
125
- /**
126
- * 流程组件列表
127
- */
128
- processComponents = [];
129
- /**
130
- * @param source 需要合并的部分参数
131
- */
132
- constructor(source) {
133
- source = Object.assign({}, Namespace_1.getDefaultOptions(), source);
134
- super(source);
135
- super.subConstructor(source);
136
- }
137
- static from(source, parentNode, parentKey) {
138
- return super.from(source, parentNode, parentKey);
139
- }
140
- /**
141
- * 从父级删除该节点
142
- * @internal
143
- */
144
- _delete() {
145
- let params = null;
146
- if (this.parentNode) {
147
- params = this.parentNode?.__removeNamespace?.(this);
148
- }
149
- return params;
150
- }
151
- getNamespaceExistingNames(excludedList = []) {
152
- const excludedSet = new Set(excludedList);
153
- return (this.children || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
154
- }
155
- getNamespaceUniqueName(name = 'namespace1') {
156
- return utils.unique(name, this.getNamespaceExistingNames(), undefined, false);
157
- }
158
- _insertNamespaceAt(options, index) {
159
- const namespaceOptions = {};
160
- const relationOptions = { parentNode: this, parentKey: 'children' };
161
- let namespace;
162
- if (!options) {
163
- namespace = Namespace_1.from({
164
- ...namespaceOptions,
165
- name: this.getNamespaceUniqueName(),
166
- }, this, 'children');
167
- }
168
- else if (typeof options === 'string') {
169
- namespace = Namespace_1.from({
170
- ...namespaceOptions,
171
- name: options,
172
- }, this, 'children');
173
- }
174
- else if (options instanceof Namespace_1) {
175
- options.ensureDelete(); // 同一实例不支持多处存在
176
- namespace = options;
177
- Object.assign(namespace, relationOptions);
178
- }
179
- else {
180
- namespace = Namespace_1.from({
181
- ...namespaceOptions,
182
- ...options,
183
- }, this, 'children');
184
- }
185
- this.children.splice(index, 0, namespace);
186
- return namespace;
187
- }
188
- insertNamespaceAt(options, index) {
189
- const node = this._insertNamespaceAt(options, index);
190
- node.create({
191
- index,
192
- parentNode: this,
193
- parentKey: 'children',
194
- });
195
- return node;
196
- }
197
- _addNamespace(options) {
198
- const index = this.children.length;
199
- return this._insertNamespaceAt(options, index);
200
- }
201
- addNamespace(options) {
202
- const node = this._addNamespace(options);
203
- const index = this.children.indexOf(node);
204
- node.create({
205
- index,
206
- parentNode: this,
207
- parentKey: 'children',
208
- });
209
- return node;
210
- }
211
- getProcessExistingNames(excludedList = []) {
212
- const excludedSet = new Set(excludedList);
213
- return (this.processes || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
214
- }
215
- getProcessUniqueName(name = 'Process1') {
216
- return utils.unique(name, this.getProcessExistingNames(), undefined, false);
217
- }
218
- _insertProcessAt(options, index) {
219
- const processOptions = {};
220
- const relationOptions = { parentNode: this, parentKey: 'processes' };
221
- let process;
222
- if (!options) {
223
- process = Process__1.default.from({
224
- ...processOptions,
225
- name: this.getProcessUniqueName(),
226
- }, this, 'processes');
227
- }
228
- else if (typeof options === 'string') {
229
- process = Process__1.default.from({
230
- ...processOptions,
231
- name: options,
232
- }, this, 'processes');
233
- }
234
- else if (options instanceof Process__1.default) {
235
- options.ensureDelete(); // 同一实例不支持多处存在
236
- process = options;
237
- Object.assign(process, relationOptions);
238
- }
239
- else {
240
- process = Process__1.default.from({
241
- ...processOptions,
242
- ...options,
243
- }, this, 'processes');
244
- }
245
- this.processes.splice(index, 0, process);
246
- return process;
247
- }
248
- insertProcessAt(options, index) {
249
- const node = this._insertProcessAt(options, index);
250
- node.create({
251
- index,
252
- parentNode: this,
253
- parentKey: 'processes',
254
- });
255
- return node;
256
- }
257
- _addProcess(options) {
258
- const index = 0;
259
- return this._insertProcessAt(options, index);
260
- }
261
- addProcess(options) {
262
- const node = this._addProcess(options);
263
- const index = this.processes.indexOf(node);
264
- node.create({
265
- index,
266
- parentNode: this,
267
- parentKey: 'processes',
268
- });
269
- return node;
270
- }
271
- getStructureExistingNames(excludedList = []) {
272
- const excludedSet = new Set(excludedList);
273
- return (this.structures || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
274
- }
275
- getStructureUniqueName(name = 'Structure1') {
276
- return utils.unique(name, this.getStructureExistingNames(), undefined, false);
277
- }
278
- _insertStructureAt(options, index) {
279
- const structureOptions = {};
280
- const relationOptions = { parentNode: this, parentKey: 'structures' };
281
- let structure;
282
- if (!options) {
283
- structure = Structure__1.default.from({
284
- ...structureOptions,
285
- name: this.getStructureUniqueName(),
286
- }, this, 'structures');
287
- }
288
- else if (typeof options === 'string') {
289
- structure = Structure__1.default.from({
290
- ...structureOptions,
291
- name: options,
292
- }, this, 'structures');
293
- }
294
- else if (options instanceof Structure__1.default) {
295
- options.ensureDelete(); // 同一实例不支持多处存在
296
- structure = options;
297
- Object.assign(structure, relationOptions);
298
- }
299
- else {
300
- structure = Structure__1.default.from({
301
- ...structureOptions,
302
- ...options,
303
- }, this, 'structures');
304
- }
305
- this.structures.splice(index, 0, structure);
306
- return structure;
307
- }
308
- insertStructureAt(options, index) {
309
- const node = this._insertStructureAt(options, index);
310
- node.create({
311
- index,
312
- parentNode: this,
313
- parentKey: 'structures',
314
- });
315
- return node;
316
- }
317
- _addStructure(options) {
318
- const index = 0;
319
- return this._insertStructureAt(options, index);
320
- }
321
- addStructure(options) {
322
- const node = this._addStructure(options);
323
- const index = this.structures.indexOf(node);
324
- node.create({
325
- index,
326
- parentNode: this,
327
- parentKey: 'structures',
328
- });
329
- return node;
330
- }
331
- getEnumExistingNames(excludedList = []) {
332
- const excludedSet = new Set(excludedList);
333
- return (this.enums || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
334
- }
335
- getEnumUniqueName(name = 'Enum1') {
336
- return utils.unique(name, this.getEnumExistingNames(), undefined, false);
337
- }
338
- _insertEnumAt(options, index) {
339
- const enumerationOptions = {};
340
- const relationOptions = { parentNode: this, parentKey: 'enums' };
341
- let enumeration;
342
- if (!options) {
343
- enumeration = Enum__1.default.from({
344
- ...enumerationOptions,
345
- name: this.getEnumUniqueName(),
346
- }, this, 'enums');
347
- }
348
- else if (typeof options === 'string') {
349
- enumeration = Enum__1.default.from({
350
- ...enumerationOptions,
351
- name: options,
352
- }, this, 'enums');
353
- }
354
- else if (options instanceof Enum__1.default) {
355
- options.ensureDelete(); // 同一实例不支持多处存在
356
- enumeration = options;
357
- Object.assign(enumeration, relationOptions);
358
- }
359
- else {
360
- enumeration = Enum__1.default.from({
361
- ...enumerationOptions,
362
- ...options,
363
- }, this, 'enums');
364
- }
365
- this.enums.splice(index, 0, enumeration);
366
- return enumeration;
367
- }
368
- insertEnumAt(options, index) {
369
- const node = this._insertEnumAt(options, index);
370
- node.create({
371
- index,
372
- parentNode: this,
373
- parentKey: 'enums',
374
- });
375
- return node;
376
- }
377
- _addEnum(options) {
378
- const index = 0;
379
- return this._insertEnumAt(options, index);
380
- }
381
- addEnum(options) {
382
- const node = this._addEnum(options);
383
- const index = this.enums.indexOf(node);
384
- node.create({
385
- index,
386
- parentNode: this,
387
- parentKey: 'enums',
388
- });
389
- return node;
390
- }
391
- getLogicExistingNames(excludedList = []) {
392
- const excludedSet = new Set(excludedList);
393
- return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
394
- }
395
- getLogicUniqueName(name = 'logic1') {
396
- return utils.unique(name, this.getLogicExistingNames(), undefined, false);
397
- }
398
- _insertLogicAt(options, index) {
399
- const logicOptions = {};
400
- const relationOptions = { parentNode: this, parentKey: 'logics' };
401
- let logic;
402
- if (!options) {
403
- logic = Logic__1.default.from({
404
- ...logicOptions,
405
- name: this.getLogicUniqueName(),
406
- }, this, 'logics');
407
- }
408
- else if (typeof options === 'string') {
409
- logic = Logic__1.default.from({
410
- ...logicOptions,
411
- name: options,
412
- }, this, 'logics');
413
- }
414
- else if (options instanceof Logic__1.default) {
415
- options.ensureDelete(); // 同一实例不支持多处存在
416
- logic = options;
417
- Object.assign(logic, relationOptions);
418
- }
419
- else {
420
- logic = Logic__1.default.from({
421
- ...logicOptions,
422
- ...options,
423
- }, this, 'logics');
424
- }
425
- this.logics.splice(index, 0, logic);
426
- return logic;
427
- }
428
- insertLogicAt(options, index) {
429
- const node = this._insertLogicAt(options, index);
430
- node.create({
431
- index,
432
- parentNode: this,
433
- parentKey: 'logics',
434
- });
435
- return node;
436
- }
437
- _addLogic(options) {
438
- const index = 0;
439
- return this._insertLogicAt(options, index);
440
- }
441
- addLogic(options) {
442
- const node = this._addLogic(options);
443
- const index = this.logics.indexOf(node);
444
- node.create({
445
- index,
446
- parentNode: this,
447
- parentKey: 'logics',
448
- });
449
- return node;
450
- }
451
- getFunctionExistingNames(excludedList = []) {
452
- const excludedSet = new Set(excludedList);
453
- return (this.functions || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
454
- }
455
- getFunctionUniqueName(name = 'func1') {
456
- return utils.unique(name, this.getFunctionExistingNames(), undefined, false);
457
- }
458
- _insertFunctionAt(options, index) {
459
- const funcOptions = {};
460
- const relationOptions = { parentNode: this, parentKey: 'functions' };
461
- let func;
462
- if (!options) {
463
- func = Function__1.default.from({
464
- ...funcOptions,
465
- name: this.getFunctionUniqueName(),
466
- }, this, 'functions');
467
- }
468
- else if (typeof options === 'string') {
469
- func = Function__1.default.from({
470
- ...funcOptions,
471
- name: options,
472
- }, this, 'functions');
473
- }
474
- else if (options instanceof Function__1.default) {
475
- options.ensureDelete(); // 同一实例不支持多处存在
476
- func = options;
477
- Object.assign(func, relationOptions);
478
- }
479
- else {
480
- func = Function__1.default.from({
481
- ...funcOptions,
482
- ...options,
483
- }, this, 'functions');
484
- }
485
- this.functions.splice(index, 0, func);
486
- return func;
487
- }
488
- insertFunctionAt(options, index) {
489
- const node = this._insertFunctionAt(options, index);
490
- node.create({
491
- index,
492
- parentNode: this,
493
- parentKey: 'functions',
494
- });
495
- return node;
496
- }
497
- _addFunction(options) {
498
- const index = 0;
499
- return this._insertFunctionAt(options, index);
500
- }
501
- addFunction(options) {
502
- const node = this._addFunction(options);
503
- const index = this.functions.indexOf(node);
504
- node.create({
505
- index,
506
- parentNode: this,
507
- parentKey: 'functions',
508
- });
509
- return node;
510
- }
511
- getInterfaceExistingNames(excludedList = []) {
512
- const excludedSet = new Set(excludedList);
513
- return (this.interfaces || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
514
- }
515
- getInterfaceUniqueName(name = 'Interface1') {
516
- return utils.unique(name, this.getInterfaceExistingNames(), undefined, false);
517
- }
518
- _insertInterfaceAt(options, index) {
519
- const itfaceOptions = {};
520
- const relationOptions = { parentNode: this, parentKey: 'interfaces' };
521
- let itface;
522
- if (!options) {
523
- itface = Interface__1.default.from({
524
- ...itfaceOptions,
525
- name: this.getInterfaceUniqueName(),
526
- }, this, 'interfaces');
527
- }
528
- else if (typeof options === 'string') {
529
- itface = Interface__1.default.from({
530
- ...itfaceOptions,
531
- name: options,
532
- }, this, 'interfaces');
533
- }
534
- else if (options instanceof Interface__1.default) {
535
- options.ensureDelete(); // 同一实例不支持多处存在
536
- itface = options;
537
- Object.assign(itface, relationOptions);
538
- }
539
- else {
540
- itface = Interface__1.default.from({
541
- ...itfaceOptions,
542
- ...options,
543
- }, this, 'interfaces');
544
- }
545
- this.interfaces.splice(index, 0, itface);
546
- return itface;
547
- }
548
- insertInterfaceAt(options, index) {
549
- const node = this._insertInterfaceAt(options, index);
550
- node.create({
551
- index,
552
- parentNode: this,
553
- parentKey: 'interfaces',
554
- });
555
- return node;
556
- }
557
- _addInterface(options) {
558
- const index = 0;
559
- return this._insertInterfaceAt(options, index);
560
- }
561
- addInterface(options) {
562
- const node = this._addInterface(options);
563
- const index = this.interfaces.indexOf(node);
564
- node.create({
565
- index,
566
- parentNode: this,
567
- parentKey: 'interfaces',
568
- });
569
- return node;
570
- }
571
- getViewExistingNames(excludedList = []) {
572
- const excludedSet = new Set(excludedList);
573
- return (this.views || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
574
- }
575
- getViewUniqueName(name = 'view1') {
576
- return utils.unique(name, this.getViewExistingNames(), undefined, false);
577
- }
578
- _insertViewAt(options, index) {
579
- const viewOptions = {};
580
- const relationOptions = { parentNode: this, parentKey: 'views' };
581
- let view;
582
- if (!options) {
583
- view = View__1.default.from({
584
- ...viewOptions,
585
- name: this.getViewUniqueName(),
586
- }, this, 'views');
587
- }
588
- else if (typeof options === 'string') {
589
- view = View__1.default.from({
590
- ...viewOptions,
591
- name: options,
592
- }, this, 'views');
593
- }
594
- else if (options instanceof View__1.default) {
595
- options.ensureDelete(); // 同一实例不支持多处存在
596
- view = options;
597
- Object.assign(view, relationOptions);
598
- }
599
- else {
600
- view = View__1.default.from({
601
- ...viewOptions,
602
- ...options,
603
- }, this, 'views');
604
- }
605
- this.views.splice(index, 0, view);
606
- return view;
607
- }
608
- insertViewAt(options, index) {
609
- const node = this._insertViewAt(options, index);
610
- node.create({
611
- index,
612
- parentNode: this,
613
- parentKey: 'views',
614
- });
615
- return node;
616
- }
617
- _addView(options) {
618
- const index = this.views.length;
619
- return this._insertViewAt(options, index);
620
- }
621
- addView(options) {
622
- const node = this._addView(options);
623
- const index = this.views.indexOf(node);
624
- node.create({
625
- index,
626
- parentNode: this,
627
- parentKey: 'views',
628
- });
629
- return node;
630
- }
631
- getVarExistingNames(excludedList = []) {
632
- const excludedSet = new Set(excludedList);
633
- return (this.frontendVariables || [])
634
- .filter((item) => !excludedSet.has(item))
635
- .map((item) => item.name);
636
- }
637
- getVariableUniqueName(name = 'variable1') {
638
- return utils.unique(name, this.getVarExistingNames(), undefined, true);
639
- }
640
- _insertVariableInFrontendVariablesAt(options, index) {
641
- const variableOptions = {};
642
- const relationOptions = { parentNode: this, parentKey: 'frontendVariables' };
643
- let variable;
644
- if (!options) {
645
- variable = Variable__1.default.from({
646
- ...variableOptions,
647
- name: this.getVariableUniqueName(),
648
- }, this, 'frontendVariables');
649
- }
650
- else if (typeof options === 'string') {
651
- variable = Variable__1.default.from({
652
- ...variableOptions,
653
- name: options,
654
- }, this, 'frontendVariables');
655
- }
656
- else if (options instanceof Variable__1.default) {
657
- options.ensureDelete(); // 同一实例不支持多处存在
658
- variable = options;
659
- Object.assign(variable, relationOptions);
660
- }
661
- else {
662
- variable = Variable__1.default.from({
663
- ...variableOptions,
664
- ...options,
665
- }, this, 'frontendVariables');
666
- }
667
- this.frontendVariables.splice(index, 0, variable);
668
- return variable;
669
- }
670
- insertVariableInFrontendVariablesAt(options, index) {
671
- const node = this._insertVariableInFrontendVariablesAt(options, index);
672
- node.create({
673
- index,
674
- parentNode: this,
675
- parentKey: 'frontendVariables',
676
- });
677
- return node;
678
- }
679
- _addVariableInFrontendVariables(options) {
680
- const index = this.frontendVariables.length;
681
- return this._insertVariableInFrontendVariablesAt(options, index);
682
- }
683
- addVariableInFrontendVariables(options) {
684
- const node = this._addVariableInFrontendVariables(options);
685
- const index = this.frontendVariables.indexOf(node);
686
- node.create({
687
- index,
688
- parentNode: this,
689
- parentKey: 'frontendVariables',
690
- });
691
- return node;
692
- }
693
- _insertVariableInVariablesAt(options, index) {
694
- const variableOptions = {};
695
- const relationOptions = { parentNode: this, parentKey: 'variables' };
696
- let variable;
697
- if (!options) {
698
- variable = Variable__1.default.from({
699
- ...variableOptions,
700
- name: this.getVariableUniqueName(),
701
- }, this, 'variables');
702
- }
703
- else if (typeof options === 'string') {
704
- variable = Variable__1.default.from({
705
- ...variableOptions,
706
- name: options,
707
- }, this, 'variables');
708
- }
709
- else if (options instanceof Variable__1.default) {
710
- options.ensureDelete(); // 同一实例不支持多处存在
711
- variable = options;
712
- Object.assign(variable, relationOptions);
713
- }
714
- else {
715
- variable = Variable__1.default.from({
716
- ...variableOptions,
717
- ...options,
718
- }, this, 'variables');
719
- }
720
- this.variables.splice(index, 0, variable);
721
- return variable;
722
- }
723
- insertVariableInVariablesAt(options, index) {
724
- const node = this._insertVariableInVariablesAt(options, index);
725
- node.create({
726
- index,
727
- parentNode: this,
728
- parentKey: 'variables',
729
- });
730
- return node;
731
- }
732
- _addVariableInVariables(options) {
733
- const index = this.variables.length;
734
- return this._insertVariableInVariablesAt(options, index);
735
- }
736
- addVariableInVariables(options) {
737
- const node = this._addVariableInVariables(options);
738
- const index = this.variables.indexOf(node);
739
- node.create({
740
- index,
741
- parentNode: this,
742
- parentKey: 'variables',
743
- });
744
- return node;
745
- }
746
- getViewComponentExistingNames(excludedList = []) {
747
- const excludedSet = new Set(excludedList);
748
- return (this.viewComponents || [])
749
- .filter((item) => !excludedSet.has(item))
750
- .map((item) => item.name);
751
- }
752
- getViewComponentUniqueName(name = 'viewComponent1') {
753
- return utils.unique(name, this.getViewComponentExistingNames(), undefined, false);
754
- }
755
- _insertViewComponentAt(options, index) {
756
- const viewComponentOptions = {};
757
- const relationOptions = { parentNode: this, parentKey: 'viewComponents' };
758
- let viewComponent;
759
- if (!options) {
760
- viewComponent = ViewComponent__1.default.from({
761
- ...viewComponentOptions,
762
- name: this.getViewComponentUniqueName(),
763
- }, this, 'viewComponents');
764
- }
765
- else if (typeof options === 'string') {
766
- viewComponent = ViewComponent__1.default.from({
767
- ...viewComponentOptions,
768
- name: options,
769
- }, this, 'viewComponents');
770
- }
771
- else if (options instanceof ViewComponent__1.default) {
772
- options.ensureDelete(); // 同一实例不支持多处存在
773
- viewComponent = options;
774
- Object.assign(viewComponent, relationOptions);
775
- }
776
- else {
777
- viewComponent = ViewComponent__1.default.from({
778
- ...viewComponentOptions,
779
- ...options,
780
- }, this, 'viewComponents');
781
- }
782
- this.viewComponents.splice(index, 0, viewComponent);
783
- return viewComponent;
784
- }
785
- insertViewComponentAt(options, index) {
786
- const node = this._insertViewComponentAt(options, index);
787
- node.create({
788
- index,
789
- parentNode: this,
790
- parentKey: 'viewComponents',
791
- });
792
- return node;
793
- }
794
- _addViewComponent(options) {
795
- const index = this.viewComponents.length;
796
- return this._insertViewComponentAt(options, index);
797
- }
798
- addViewComponent(options) {
799
- const node = this._addViewComponent(options);
800
- const index = this.viewComponents.indexOf(node);
801
- node.create({
802
- index,
803
- parentNode: this,
804
- parentKey: 'viewComponents',
805
- });
806
- return node;
807
- }
808
- getProcessComponentExistingNames(excludedList = []) {
809
- const excludedSet = new Set(excludedList);
810
- return (this.processComponents || [])
811
- .filter((item) => !excludedSet.has(item))
812
- .map((item) => item.name);
813
- }
814
- getProcessComponentUniqueName(name = 'processComponent1') {
815
- return utils.unique(name, this.getProcessComponentExistingNames(), undefined, false);
816
- }
817
- _insertProcessComponentAt(options, index) {
818
- const processComponentOptions = {};
819
- const relationOptions = { parentNode: this, parentKey: 'processComponents' };
820
- let processComponent;
821
- if (!options) {
822
- processComponent = ProcessComponent__1.default.from({
823
- ...processComponentOptions,
824
- name: this.getProcessComponentUniqueName(),
825
- }, this, 'processComponents');
826
- }
827
- else if (typeof options === 'string') {
828
- processComponent = ProcessComponent__1.default.from({
829
- ...processComponentOptions,
830
- name: options,
831
- }, this, 'processComponents');
832
- }
833
- else if (options instanceof ProcessComponent__1.default) {
834
- options.ensureDelete(); // 同一实例不支持多处存在
835
- processComponent = options;
836
- Object.assign(processComponent, relationOptions);
837
- }
838
- else {
839
- processComponent = ProcessComponent__1.default.from({
840
- ...processComponentOptions,
841
- ...options,
842
- }, this, 'processComponents');
843
- }
844
- this.processComponents.splice(index, 0, processComponent);
845
- return processComponent;
846
- }
847
- insertProcessComponentAt(options, index) {
848
- const node = this._insertProcessComponentAt(options, index);
849
- node.create({
850
- index,
851
- parentNode: this,
852
- parentKey: 'processComponents',
853
- });
854
- return node;
855
- }
856
- _addProcessComponent(options) {
857
- const index = this.processComponents.length;
858
- return this._insertProcessComponentAt(options, index);
859
- }
860
- addProcessComponent(options) {
861
- const node = this._addProcessComponent(options);
862
- const index = this.processComponents.indexOf(node);
863
- node.create({
864
- index,
865
- parentNode: this,
866
- parentKey: 'processComponents',
867
- });
868
- return node;
869
- }
870
- removeNamespace(options) {
871
- let namespace;
872
- if (typeof options === 'string') {
873
- namespace = this.children.find((item) => item.name === options);
874
- if (!namespace) {
875
- throw new Error('找不到命名空间 ' + options);
876
- }
877
- }
878
- else {
879
- namespace = options;
880
- }
881
- return namespace.delete();
882
- }
883
- __removeNamespace(namespace) {
884
- const parentKey = namespace.parentKey;
885
- const params = {
886
- parentNode: this,
887
- parentKey,
888
- index: -1,
889
- object: null,
890
- oldObject: namespace,
891
- };
892
- if (parentKey) {
893
- params.parentKey = parentKey;
894
- // @ts-ignore
895
- const t = this.__v_raw || this;
896
- // @ts-ignore
897
- const n = namespace.__v_raw || namespace;
898
- if (Array.isArray(t[parentKey])) {
899
- const index = t[parentKey].indexOf(n);
900
- ~index && this[parentKey].splice(index, 1);
901
- params.index = index;
902
- }
903
- else if (t[parentKey] === n) {
904
- params.index = 0;
905
- this[parentKey] = undefined;
906
- }
907
- }
908
- return params;
909
- }
910
- removeProcess(options) {
911
- let process;
912
- if (typeof options === 'string') {
913
- process = this.processes.find((item) => item.name === options);
914
- if (!process) {
915
- throw new Error('找不到流程 ' + options);
916
- }
917
- }
918
- else {
919
- process = options;
920
- }
921
- return process.delete();
922
- }
923
- __removeProcess(process) {
924
- const parentKey = process.parentKey;
925
- const params = {
926
- parentNode: this,
927
- parentKey,
928
- index: -1,
929
- object: null,
930
- oldObject: process,
931
- };
932
- if (parentKey) {
933
- params.parentKey = parentKey;
934
- // @ts-ignore
935
- const t = this.__v_raw || this;
936
- // @ts-ignore
937
- const n = process.__v_raw || process;
938
- if (Array.isArray(t[parentKey])) {
939
- const index = t[parentKey].indexOf(n);
940
- ~index && this[parentKey].splice(index, 1);
941
- params.index = index;
942
- }
943
- else if (t[parentKey] === n) {
944
- params.index = 0;
945
- this[parentKey] = undefined;
946
- }
947
- }
948
- return params;
949
- }
950
- removeStructure(options) {
951
- let structure;
952
- if (typeof options === 'string') {
953
- structure = this.structures.find((item) => item.name === options);
954
- if (!structure) {
955
- throw new Error('找不到数据结构 ' + options);
956
- }
957
- }
958
- else {
959
- structure = options;
960
- }
961
- return structure.delete();
962
- }
963
- __removeStructure(structure) {
964
- const parentKey = structure.parentKey;
965
- const params = {
966
- parentNode: this,
967
- parentKey,
968
- index: -1,
969
- object: null,
970
- oldObject: structure,
971
- };
972
- if (parentKey) {
973
- params.parentKey = parentKey;
974
- // @ts-ignore
975
- const t = this.__v_raw || this;
976
- // @ts-ignore
977
- const n = structure.__v_raw || structure;
978
- if (Array.isArray(t[parentKey])) {
979
- const index = t[parentKey].indexOf(n);
980
- ~index && this[parentKey].splice(index, 1);
981
- params.index = index;
982
- }
983
- else if (t[parentKey] === n) {
984
- params.index = 0;
985
- this[parentKey] = undefined;
986
- }
987
- }
988
- return params;
989
- }
990
- removeEnum(options) {
991
- let enumeration;
992
- if (typeof options === 'string') {
993
- enumeration = this.enums.find((item) => item.name === options);
994
- if (!enumeration) {
995
- throw new Error('找不到枚举 ' + options);
996
- }
997
- }
998
- else {
999
- enumeration = options;
1000
- }
1001
- return enumeration.delete();
1002
- }
1003
- __removeEnum(enumeration) {
1004
- const parentKey = enumeration.parentKey;
1005
- const params = {
1006
- parentNode: this,
1007
- parentKey,
1008
- index: -1,
1009
- object: null,
1010
- oldObject: enumeration,
1011
- };
1012
- if (parentKey) {
1013
- params.parentKey = parentKey;
1014
- // @ts-ignore
1015
- const t = this.__v_raw || this;
1016
- // @ts-ignore
1017
- const n = enumeration.__v_raw || enumeration;
1018
- if (Array.isArray(t[parentKey])) {
1019
- const index = t[parentKey].indexOf(n);
1020
- ~index && this[parentKey].splice(index, 1);
1021
- params.index = index;
1022
- }
1023
- else if (t[parentKey] === n) {
1024
- params.index = 0;
1025
- this[parentKey] = undefined;
1026
- }
1027
- }
1028
- return params;
1029
- }
1030
- removeLogic(options) {
1031
- let logic;
1032
- if (typeof options === 'string') {
1033
- logic = this.logics.find((item) => item.name === options);
1034
- if (!logic) {
1035
- throw new Error('找不到逻辑 ' + options);
1036
- }
1037
- }
1038
- else {
1039
- logic = options;
1040
- }
1041
- return logic.delete();
1042
- }
1043
- __removeLogic(logic) {
1044
- const parentKey = logic.parentKey;
1045
- const params = {
1046
- parentNode: this,
1047
- parentKey,
1048
- index: -1,
1049
- object: null,
1050
- oldObject: logic,
1051
- };
1052
- if (parentKey) {
1053
- params.parentKey = parentKey;
1054
- // @ts-ignore
1055
- const t = this.__v_raw || this;
1056
- // @ts-ignore
1057
- const n = logic.__v_raw || logic;
1058
- if (Array.isArray(t[parentKey])) {
1059
- const index = t[parentKey].indexOf(n);
1060
- ~index && this[parentKey].splice(index, 1);
1061
- params.index = index;
1062
- }
1063
- else if (t[parentKey] === n) {
1064
- params.index = 0;
1065
- this[parentKey] = undefined;
1066
- }
1067
- }
1068
- return params;
1069
- }
1070
- removeFunction(options) {
1071
- let func;
1072
- if (typeof options === 'string') {
1073
- func = this.functions.find((item) => item.name === options);
1074
- if (!func) {
1075
- throw new Error('找不到函数 ' + options);
1076
- }
1077
- }
1078
- else {
1079
- func = options;
1080
- }
1081
- return func.delete();
1082
- }
1083
- __removeFunction(func) {
1084
- const parentKey = func.parentKey;
1085
- const params = {
1086
- parentNode: this,
1087
- parentKey,
1088
- index: -1,
1089
- object: null,
1090
- oldObject: func,
1091
- };
1092
- if (parentKey) {
1093
- params.parentKey = parentKey;
1094
- // @ts-ignore
1095
- const t = this.__v_raw || this;
1096
- // @ts-ignore
1097
- const n = func.__v_raw || func;
1098
- if (Array.isArray(t[parentKey])) {
1099
- const index = t[parentKey].indexOf(n);
1100
- ~index && this[parentKey].splice(index, 1);
1101
- params.index = index;
1102
- }
1103
- else if (t[parentKey] === n) {
1104
- params.index = 0;
1105
- this[parentKey] = undefined;
1106
- }
1107
- }
1108
- return params;
1109
- }
1110
- removeInterface(options) {
1111
- let itface;
1112
- if (typeof options === 'string') {
1113
- itface = this.interfaces.find((item) => item.name === options);
1114
- if (!itface) {
1115
- throw new Error('找不到接口 ' + options);
1116
- }
1117
- }
1118
- else {
1119
- itface = options;
1120
- }
1121
- return itface.delete();
1122
- }
1123
- __removeInterface(itface) {
1124
- const parentKey = itface.parentKey;
1125
- const params = {
1126
- parentNode: this,
1127
- parentKey,
1128
- index: -1,
1129
- object: null,
1130
- oldObject: itface,
1131
- };
1132
- if (parentKey) {
1133
- params.parentKey = parentKey;
1134
- // @ts-ignore
1135
- const t = this.__v_raw || this;
1136
- // @ts-ignore
1137
- const n = itface.__v_raw || itface;
1138
- if (Array.isArray(t[parentKey])) {
1139
- const index = t[parentKey].indexOf(n);
1140
- ~index && this[parentKey].splice(index, 1);
1141
- params.index = index;
1142
- }
1143
- else if (t[parentKey] === n) {
1144
- params.index = 0;
1145
- this[parentKey] = undefined;
1146
- }
1147
- }
1148
- return params;
1149
- }
1150
- removeView(options) {
1151
- let view;
1152
- if (typeof options === 'string') {
1153
- view = this.views.find((item) => item.name === options);
1154
- if (!view) {
1155
- throw new Error('找不到页面 ' + options);
1156
- }
1157
- }
1158
- else {
1159
- view = options;
1160
- }
1161
- return view.delete();
1162
- }
1163
- __removeView(view) {
1164
- const parentKey = view.parentKey;
1165
- const params = {
1166
- parentNode: this,
1167
- parentKey,
1168
- index: -1,
1169
- object: null,
1170
- oldObject: view,
1171
- };
1172
- if (parentKey) {
1173
- params.parentKey = parentKey;
1174
- // @ts-ignore
1175
- const t = this.__v_raw || this;
1176
- // @ts-ignore
1177
- const n = view.__v_raw || view;
1178
- if (Array.isArray(t[parentKey])) {
1179
- const index = t[parentKey].indexOf(n);
1180
- ~index && this[parentKey].splice(index, 1);
1181
- params.index = index;
1182
- }
1183
- else if (t[parentKey] === n) {
1184
- params.index = 0;
1185
- this[parentKey] = undefined;
1186
- }
1187
- }
1188
- return params;
1189
- }
1190
- removeVariableInFrontendVariables(options) {
1191
- let variable;
1192
- if (typeof options === 'string') {
1193
- variable = this.frontendVariables.find((item) => item.name === options);
1194
- if (!variable) {
1195
- throw new Error('找不到变量 ' + options);
1196
- }
1197
- }
1198
- else {
1199
- variable = options;
1200
- }
1201
- return variable.delete();
1202
- }
1203
- removeVariableInVariables(options) {
1204
- let variable;
1205
- if (typeof options === 'string') {
1206
- variable = this.variables.find((item) => item.name === options);
1207
- if (!variable) {
1208
- throw new Error('找不到变量 ' + options);
1209
- }
1210
- }
1211
- else {
1212
- variable = options;
1213
- }
1214
- return variable.delete();
1215
- }
1216
- __removeVariable(variable) {
1217
- const parentKey = variable.parentKey;
1218
- const params = {
1219
- parentNode: this,
1220
- parentKey,
1221
- index: -1,
1222
- object: null,
1223
- oldObject: variable,
1224
- };
1225
- if (parentKey) {
1226
- params.parentKey = parentKey;
1227
- // @ts-ignore
1228
- const t = this.__v_raw || this;
1229
- // @ts-ignore
1230
- const n = variable.__v_raw || variable;
1231
- if (Array.isArray(t[parentKey])) {
1232
- const index = t[parentKey].indexOf(n);
1233
- ~index && this[parentKey].splice(index, 1);
1234
- params.index = index;
1235
- }
1236
- else if (t[parentKey] === n) {
1237
- params.index = 0;
1238
- this[parentKey] = undefined;
1239
- }
1240
- }
1241
- return params;
1242
- }
1243
- removeViewComponent(options) {
1244
- let viewComponent;
1245
- if (typeof options === 'string') {
1246
- viewComponent = this.viewComponents.find((item) => item.name === options);
1247
- if (!viewComponent) {
1248
- throw new Error('找不到页面组件 ' + options);
1249
- }
1250
- }
1251
- else {
1252
- viewComponent = options;
1253
- }
1254
- return viewComponent.delete();
1255
- }
1256
- __removeViewComponent(viewComponent) {
1257
- const parentKey = viewComponent.parentKey;
1258
- const params = {
1259
- parentNode: this,
1260
- parentKey,
1261
- index: -1,
1262
- object: null,
1263
- oldObject: viewComponent,
1264
- };
1265
- if (parentKey) {
1266
- params.parentKey = parentKey;
1267
- // @ts-ignore
1268
- const t = this.__v_raw || this;
1269
- // @ts-ignore
1270
- const n = viewComponent.__v_raw || viewComponent;
1271
- if (Array.isArray(t[parentKey])) {
1272
- const index = t[parentKey].indexOf(n);
1273
- ~index && this[parentKey].splice(index, 1);
1274
- params.index = index;
1275
- }
1276
- else if (t[parentKey] === n) {
1277
- params.index = 0;
1278
- this[parentKey] = undefined;
1279
- }
1280
- }
1281
- return params;
1282
- }
1283
- removeProcessComponent(options) {
1284
- let processComponent;
1285
- if (typeof options === 'string') {
1286
- processComponent = this.processComponents.find((item) => item.name === options);
1287
- if (!processComponent) {
1288
- throw new Error('找不到流程组件 ' + options);
1289
- }
1290
- }
1291
- else {
1292
- processComponent = options;
1293
- }
1294
- return processComponent.delete();
1295
- }
1296
- __removeProcessComponent(processComponent) {
1297
- const parentKey = processComponent.parentKey;
1298
- const params = {
1299
- parentNode: this,
1300
- parentKey,
1301
- index: -1,
1302
- object: null,
1303
- oldObject: processComponent,
1304
- };
1305
- if (parentKey) {
1306
- params.parentKey = parentKey;
1307
- // @ts-ignore
1308
- const t = this.__v_raw || this;
1309
- // @ts-ignore
1310
- const n = processComponent.__v_raw || processComponent;
1311
- if (Array.isArray(t[parentKey])) {
1312
- const index = t[parentKey].indexOf(n);
1313
- ~index && this[parentKey].splice(index, 1);
1314
- params.index = index;
1315
- }
1316
- else if (t[parentKey] === n) {
1317
- params.index = 0;
1318
- this[parentKey] = undefined;
1319
- }
1320
- }
1321
- return params;
1322
- }
1323
- //================================================================================
1324
- // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1325
- // 自动生成的代码已结束。下面可以手动编写。
1326
- //================================================================================
1327
- findEnumByName(name) {
1328
- return this.enums.find((enumItem) => enumItem.name === name);
1329
- }
1330
- findStructureByName(name) {
1331
- return this.structures.find((item) => item.name === name);
1332
- }
1333
- findLogicByName(name) {
1334
- return this.logics.find((logic) => logic.name === name);
1335
- }
1336
- path = undefined;
1337
- /**
1338
- * 获取命名空间
1339
- */
1340
- getNamespace() {
1341
- if (this.path)
1342
- return this.path;
1343
- if (this.parentNode.concept === 'Connector') {
1344
- return `${this.parentNode.getNamespace()}`;
1345
- }
1346
- if (this.parentNode && this.parentNode.getNamespace)
1347
- return `${this.parentNode.getNamespace()}`;
1348
- throw new Error('无法获取命名空间,请设置 parentNode 或临时的 path!');
1349
- }
1350
- /**
1351
- * 获取命名空间
1352
- */
1353
- getTsNamespace() {
1354
- if (this.path)
1355
- return this.path;
1356
- if (this.parentNode.concept === 'Connector') {
1357
- return `${this.parentNode.getNamespace()}`;
1358
- }
1359
- if (this.parentNode && this.parentNode.getNamespace)
1360
- return `${this.parentNode.getNamespace()}.${this.tsName}`;
1361
- throw new Error('无法获取命名空间,请设置 parentNode 或临时的 path!');
1362
- }
1363
- findChild(name) {
1364
- return this.children.find((child) => child.name === name);
1365
- }
1366
- findLogic(name) {
1367
- return this.logics.find((logic) => logic.name === name);
1368
- }
1369
- getLogicExistingTitles(excludedList = []) {
1370
- const excludedSet = new Set(excludedList);
1371
- return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.title);
1372
- }
1373
- };
1374
- exports.Namespace = Namespace;
1375
- __decorate([
1376
- (0, decorators_1.property)('concept')
1377
- // @ts-ignore
1378
- ], Namespace.prototype, "concept", void 0);
1379
- __decorate([
1380
- (0, decorators_1.property)()
1381
- // @ts-ignore
1382
- ], Namespace.prototype, "originConcept", void 0);
1383
- __decorate([
1384
- (0, decorators_1.property)()
1385
- // @ts-ignore
1386
- ], Namespace.prototype, "name", void 0);
1387
- __decorate([
1388
- (0, decorators_1.property)()
1389
- // @ts-ignore
1390
- ], Namespace.prototype, "title", void 0);
1391
- __decorate([
1392
- (0, decorators_1.property)()
1393
- // @ts-ignore
1394
- ], Namespace.prototype, "description", void 0);
1395
- __decorate([
1396
- (0, decorators_1.property)({
1397
- objectRef: 'Namespace',
1398
- isArray: true,
1399
- defaultValue: [],
1400
- })
1401
- ], Namespace.prototype, "children", void 0);
1402
- __decorate([
1403
- (0, decorators_1.property)({
1404
- objectRef: 'Process',
1405
- isArray: true,
1406
- defaultValue: [],
1407
- })
1408
- ], Namespace.prototype, "processes", void 0);
1409
- __decorate([
1410
- (0, decorators_1.property)({
1411
- objectRef: 'Structure',
1412
- isArray: true,
1413
- defaultValue: [],
1414
- })
1415
- ], Namespace.prototype, "structures", void 0);
1416
- __decorate([
1417
- (0, decorators_1.property)({
1418
- objectRef: 'Enum',
1419
- isArray: true,
1420
- defaultValue: [],
1421
- })
1422
- ], Namespace.prototype, "enums", void 0);
1423
- __decorate([
1424
- (0, decorators_1.property)({
1425
- objectRef: 'Logic',
1426
- isArray: true,
1427
- defaultValue: [],
1428
- })
1429
- ], Namespace.prototype, "logics", void 0);
1430
- __decorate([
1431
- (0, decorators_1.property)({
1432
- objectRef: 'Function',
1433
- isArray: true,
1434
- defaultValue: [],
1435
- })
1436
- ], Namespace.prototype, "functions", void 0);
1437
- __decorate([
1438
- (0, decorators_1.property)({
1439
- objectRef: 'Interface',
1440
- isArray: true,
1441
- defaultValue: [],
1442
- })
1443
- ], Namespace.prototype, "interfaces", void 0);
1444
- __decorate([
1445
- (0, decorators_1.property)({
1446
- objectRef: 'View',
1447
- isArray: true,
1448
- defaultValue: [],
1449
- })
1450
- ], Namespace.prototype, "views", void 0);
1451
- __decorate([
1452
- (0, decorators_1.property)({
1453
- objectRef: 'Variable',
1454
- isArray: true,
1455
- defaultValue: [],
1456
- })
1457
- ], Namespace.prototype, "frontendVariables", void 0);
1458
- __decorate([
1459
- (0, decorators_1.property)({
1460
- objectRef: 'Variable',
1461
- isArray: true,
1462
- defaultValue: [],
1463
- })
1464
- ], Namespace.prototype, "variables", void 0);
1465
- __decorate([
1466
- (0, decorators_1.property)({
1467
- objectRef: 'ViewComponent',
1468
- isArray: true,
1469
- defaultValue: [],
1470
- })
1471
- ], Namespace.prototype, "viewComponents", void 0);
1472
- __decorate([
1473
- (0, decorators_1.property)({
1474
- objectRef: 'ProcessComponent',
1475
- isArray: true,
1476
- defaultValue: [],
1477
- })
1478
- ], Namespace.prototype, "processComponents", void 0);
1479
- __decorate([
1480
- (0, decorators_1.property)()
1481
- ], Namespace.prototype, "path", void 0);
1482
- exports.Namespace = Namespace = Namespace_1 = __decorate([
1483
- decorators_1.className,
1484
- (0, decorators_1.concept)('命名空间')
1485
- // @ts-ignore
1486
- ], Namespace);
1487
- exports.default = Namespace;
1488
- //================================================================================
1489
- // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1490
- // 自动生成的代码已结束。下面可以手动编写。
1491
- //================================================================================
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 Namespace_1;
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Namespace = void 0;
37
+ const Interface__1 = __importDefault(require("./Interface__"));
38
+ const decorators_1 = require("../decorators");
39
+ const utils = __importStar(require("../utils"));
40
+ const BaseNode_1 = __importDefault(require("../common/BaseNode"));
41
+ const Process__1 = __importDefault(require("./Process__"));
42
+ const Structure__1 = __importDefault(require("./Structure__"));
43
+ const Enum__1 = __importDefault(require("./Enum__"));
44
+ const Logic__1 = __importDefault(require("./Logic__"));
45
+ const Function__1 = __importDefault(require("./Function__"));
46
+ const View__1 = __importDefault(require("./View__"));
47
+ const Variable__1 = __importDefault(require("./Variable__"));
48
+ const ViewComponent__1 = __importDefault(require("./ViewComponent__"));
49
+ const ProcessComponent__1 = __importDefault(require("./ProcessComponent__"));
50
+ /**
51
+ * 命名空间
52
+ */
53
+ let Namespace = Namespace_1 =
54
+ // @ts-ignore
55
+ class Namespace extends BaseNode_1.default {
56
+ /** 类名 */
57
+ static ConceptName = 'Namespace';
58
+ /** 继承链 */
59
+ static inheritanceChain = ['BaseNode'];
60
+ /**
61
+ * 产品概念
62
+ */
63
+ concept;
64
+ /**
65
+ * 表示是从实体还是流程等概念产生的
66
+ */
67
+ // @ts-ignore
68
+ originConcept;
69
+ /**
70
+ * 命名空间名称
71
+ */
72
+ // @ts-ignore
73
+ name;
74
+ /**
75
+ * 命名空间标题
76
+ */
77
+ // @ts-ignore
78
+ title;
79
+ /**
80
+ * 命名空间描述
81
+ */
82
+ // @ts-ignore
83
+ description;
84
+ /**
85
+ * 命名空间列表
86
+ */
87
+ children = [];
88
+ /**
89
+ * 流程列表
90
+ */
91
+ processes = [];
92
+ /**
93
+ * 数据结构列表
94
+ */
95
+ structures = [];
96
+ /**
97
+ * 枚举列表
98
+ */
99
+ enums = [];
100
+ /**
101
+ * 逻辑列表
102
+ */
103
+ logics = [];
104
+ /**
105
+ * 函数列表
106
+ */
107
+ functions = [];
108
+ /**
109
+ * 接口列表
110
+ */
111
+ interfaces = [];
112
+ /**
113
+ * 页面列表
114
+ */
115
+ views = [];
116
+ /**
117
+ * 变量列表
118
+ */
119
+ frontendVariables = [];
120
+ /**
121
+ * 变量列表
122
+ */
123
+ variables = [];
124
+ /**
125
+ * 页面组件列表
126
+ */
127
+ viewComponents = [];
128
+ /**
129
+ * 流程组件列表
130
+ */
131
+ processComponents = [];
132
+ /**
133
+ * @param source 需要合并的部分参数
134
+ */
135
+ constructor(source) {
136
+ source = Object.assign({}, Namespace_1.getDefaultOptions(), source);
137
+ super(source);
138
+ super.subConstructor(source);
139
+ }
140
+ static from(source, parentNode, parentKey) {
141
+ return super.from(source, parentNode, parentKey);
142
+ }
143
+ /**
144
+ * 从父级删除该节点
145
+ * @internal
146
+ */
147
+ _delete() {
148
+ let params = null;
149
+ if (this.parentNode) {
150
+ params = this.parentNode?.__removeNamespace?.(this);
151
+ }
152
+ return params;
153
+ }
154
+ getNamespaceExistingNames(excludedList = []) {
155
+ const excludedSet = new Set(excludedList);
156
+ return (this.children || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
157
+ }
158
+ getNamespaceUniqueName(name = 'namespace1') {
159
+ return utils.unique(name, this.getNamespaceExistingNames(), undefined, false);
160
+ }
161
+ _insertNamespaceAt(options, index) {
162
+ const namespaceOptions = {};
163
+ const relationOptions = { parentNode: this, parentKey: 'children' };
164
+ let namespace;
165
+ if (!options) {
166
+ namespace = Namespace_1.from({
167
+ ...namespaceOptions,
168
+ name: this.getNamespaceUniqueName(),
169
+ }, this, 'children');
170
+ }
171
+ else if (typeof options === 'string') {
172
+ namespace = Namespace_1.from({
173
+ ...namespaceOptions,
174
+ name: options,
175
+ }, this, 'children');
176
+ }
177
+ else if (options instanceof Namespace_1) {
178
+ options.ensureDelete(); // 同一实例不支持多处存在
179
+ namespace = options;
180
+ Object.assign(namespace, relationOptions);
181
+ }
182
+ else {
183
+ namespace = Namespace_1.from({
184
+ ...namespaceOptions,
185
+ ...options,
186
+ }, this, 'children');
187
+ }
188
+ this.children.splice(index, 0, namespace);
189
+ return namespace;
190
+ }
191
+ insertNamespaceAt(options, index) {
192
+ const node = this._insertNamespaceAt(options, index);
193
+ node.create({
194
+ index,
195
+ parentNode: this,
196
+ parentKey: 'children',
197
+ });
198
+ return node;
199
+ }
200
+ _addNamespace(options) {
201
+ const index = this.children.length;
202
+ return this._insertNamespaceAt(options, index);
203
+ }
204
+ addNamespace(options) {
205
+ const node = this._addNamespace(options);
206
+ const index = this.children.indexOf(node);
207
+ node.create({
208
+ index,
209
+ parentNode: this,
210
+ parentKey: 'children',
211
+ });
212
+ return node;
213
+ }
214
+ getProcessExistingNames(excludedList = []) {
215
+ const excludedSet = new Set(excludedList);
216
+ return (this.processes || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
217
+ }
218
+ getProcessUniqueName(name = 'Process1') {
219
+ return utils.unique(name, this.getProcessExistingNames(), undefined, false);
220
+ }
221
+ _insertProcessAt(options, index) {
222
+ const processOptions = {};
223
+ const relationOptions = { parentNode: this, parentKey: 'processes' };
224
+ let process;
225
+ if (!options) {
226
+ process = Process__1.default.from({
227
+ ...processOptions,
228
+ name: this.getProcessUniqueName(),
229
+ }, this, 'processes');
230
+ }
231
+ else if (typeof options === 'string') {
232
+ process = Process__1.default.from({
233
+ ...processOptions,
234
+ name: options,
235
+ }, this, 'processes');
236
+ }
237
+ else if (options instanceof Process__1.default) {
238
+ options.ensureDelete(); // 同一实例不支持多处存在
239
+ process = options;
240
+ Object.assign(process, relationOptions);
241
+ }
242
+ else {
243
+ process = Process__1.default.from({
244
+ ...processOptions,
245
+ ...options,
246
+ }, this, 'processes');
247
+ }
248
+ this.processes.splice(index, 0, process);
249
+ return process;
250
+ }
251
+ insertProcessAt(options, index) {
252
+ const node = this._insertProcessAt(options, index);
253
+ node.create({
254
+ index,
255
+ parentNode: this,
256
+ parentKey: 'processes',
257
+ });
258
+ return node;
259
+ }
260
+ _addProcess(options) {
261
+ const index = 0;
262
+ return this._insertProcessAt(options, index);
263
+ }
264
+ addProcess(options) {
265
+ const node = this._addProcess(options);
266
+ const index = this.processes.indexOf(node);
267
+ node.create({
268
+ index,
269
+ parentNode: this,
270
+ parentKey: 'processes',
271
+ });
272
+ return node;
273
+ }
274
+ getStructureExistingNames(excludedList = []) {
275
+ const excludedSet = new Set(excludedList);
276
+ return (this.structures || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
277
+ }
278
+ getStructureUniqueName(name = 'Structure1') {
279
+ return utils.unique(name, this.getStructureExistingNames(), undefined, false);
280
+ }
281
+ _insertStructureAt(options, index) {
282
+ const structureOptions = {};
283
+ const relationOptions = { parentNode: this, parentKey: 'structures' };
284
+ let structure;
285
+ if (!options) {
286
+ structure = Structure__1.default.from({
287
+ ...structureOptions,
288
+ name: this.getStructureUniqueName(),
289
+ }, this, 'structures');
290
+ }
291
+ else if (typeof options === 'string') {
292
+ structure = Structure__1.default.from({
293
+ ...structureOptions,
294
+ name: options,
295
+ }, this, 'structures');
296
+ }
297
+ else if (options instanceof Structure__1.default) {
298
+ options.ensureDelete(); // 同一实例不支持多处存在
299
+ structure = options;
300
+ Object.assign(structure, relationOptions);
301
+ }
302
+ else {
303
+ structure = Structure__1.default.from({
304
+ ...structureOptions,
305
+ ...options,
306
+ }, this, 'structures');
307
+ }
308
+ this.structures.splice(index, 0, structure);
309
+ return structure;
310
+ }
311
+ insertStructureAt(options, index) {
312
+ const node = this._insertStructureAt(options, index);
313
+ node.create({
314
+ index,
315
+ parentNode: this,
316
+ parentKey: 'structures',
317
+ });
318
+ return node;
319
+ }
320
+ _addStructure(options) {
321
+ const index = 0;
322
+ return this._insertStructureAt(options, index);
323
+ }
324
+ addStructure(options) {
325
+ const node = this._addStructure(options);
326
+ const index = this.structures.indexOf(node);
327
+ node.create({
328
+ index,
329
+ parentNode: this,
330
+ parentKey: 'structures',
331
+ });
332
+ return node;
333
+ }
334
+ getEnumExistingNames(excludedList = []) {
335
+ const excludedSet = new Set(excludedList);
336
+ return (this.enums || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
337
+ }
338
+ getEnumUniqueName(name = 'Enum1') {
339
+ return utils.unique(name, this.getEnumExistingNames(), undefined, false);
340
+ }
341
+ _insertEnumAt(options, index) {
342
+ const enumerationOptions = {};
343
+ const relationOptions = { parentNode: this, parentKey: 'enums' };
344
+ let enumeration;
345
+ if (!options) {
346
+ enumeration = Enum__1.default.from({
347
+ ...enumerationOptions,
348
+ name: this.getEnumUniqueName(),
349
+ }, this, 'enums');
350
+ }
351
+ else if (typeof options === 'string') {
352
+ enumeration = Enum__1.default.from({
353
+ ...enumerationOptions,
354
+ name: options,
355
+ }, this, 'enums');
356
+ }
357
+ else if (options instanceof Enum__1.default) {
358
+ options.ensureDelete(); // 同一实例不支持多处存在
359
+ enumeration = options;
360
+ Object.assign(enumeration, relationOptions);
361
+ }
362
+ else {
363
+ enumeration = Enum__1.default.from({
364
+ ...enumerationOptions,
365
+ ...options,
366
+ }, this, 'enums');
367
+ }
368
+ this.enums.splice(index, 0, enumeration);
369
+ return enumeration;
370
+ }
371
+ insertEnumAt(options, index) {
372
+ const node = this._insertEnumAt(options, index);
373
+ node.create({
374
+ index,
375
+ parentNode: this,
376
+ parentKey: 'enums',
377
+ });
378
+ return node;
379
+ }
380
+ _addEnum(options) {
381
+ const index = 0;
382
+ return this._insertEnumAt(options, index);
383
+ }
384
+ addEnum(options) {
385
+ const node = this._addEnum(options);
386
+ const index = this.enums.indexOf(node);
387
+ node.create({
388
+ index,
389
+ parentNode: this,
390
+ parentKey: 'enums',
391
+ });
392
+ return node;
393
+ }
394
+ getLogicExistingNames(excludedList = []) {
395
+ const excludedSet = new Set(excludedList);
396
+ return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
397
+ }
398
+ getLogicUniqueName(name = 'logic1') {
399
+ return utils.unique(name, this.getLogicExistingNames(), undefined, false);
400
+ }
401
+ _insertLogicAt(options, index) {
402
+ const logicOptions = {};
403
+ const relationOptions = { parentNode: this, parentKey: 'logics' };
404
+ let logic;
405
+ if (!options) {
406
+ logic = Logic__1.default.from({
407
+ ...logicOptions,
408
+ name: this.getLogicUniqueName(),
409
+ }, this, 'logics');
410
+ }
411
+ else if (typeof options === 'string') {
412
+ logic = Logic__1.default.from({
413
+ ...logicOptions,
414
+ name: options,
415
+ }, this, 'logics');
416
+ }
417
+ else if (options instanceof Logic__1.default) {
418
+ options.ensureDelete(); // 同一实例不支持多处存在
419
+ logic = options;
420
+ Object.assign(logic, relationOptions);
421
+ }
422
+ else {
423
+ logic = Logic__1.default.from({
424
+ ...logicOptions,
425
+ ...options,
426
+ }, this, 'logics');
427
+ }
428
+ this.logics.splice(index, 0, logic);
429
+ return logic;
430
+ }
431
+ insertLogicAt(options, index) {
432
+ const node = this._insertLogicAt(options, index);
433
+ node.create({
434
+ index,
435
+ parentNode: this,
436
+ parentKey: 'logics',
437
+ });
438
+ return node;
439
+ }
440
+ _addLogic(options) {
441
+ const index = 0;
442
+ return this._insertLogicAt(options, index);
443
+ }
444
+ addLogic(options) {
445
+ const node = this._addLogic(options);
446
+ const index = this.logics.indexOf(node);
447
+ node.create({
448
+ index,
449
+ parentNode: this,
450
+ parentKey: 'logics',
451
+ });
452
+ return node;
453
+ }
454
+ getFunctionExistingNames(excludedList = []) {
455
+ const excludedSet = new Set(excludedList);
456
+ return (this.functions || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
457
+ }
458
+ getFunctionUniqueName(name = 'func1') {
459
+ return utils.unique(name, this.getFunctionExistingNames(), undefined, false);
460
+ }
461
+ _insertFunctionAt(options, index) {
462
+ const funcOptions = {};
463
+ const relationOptions = { parentNode: this, parentKey: 'functions' };
464
+ let func;
465
+ if (!options) {
466
+ func = Function__1.default.from({
467
+ ...funcOptions,
468
+ name: this.getFunctionUniqueName(),
469
+ }, this, 'functions');
470
+ }
471
+ else if (typeof options === 'string') {
472
+ func = Function__1.default.from({
473
+ ...funcOptions,
474
+ name: options,
475
+ }, this, 'functions');
476
+ }
477
+ else if (options instanceof Function__1.default) {
478
+ options.ensureDelete(); // 同一实例不支持多处存在
479
+ func = options;
480
+ Object.assign(func, relationOptions);
481
+ }
482
+ else {
483
+ func = Function__1.default.from({
484
+ ...funcOptions,
485
+ ...options,
486
+ }, this, 'functions');
487
+ }
488
+ this.functions.splice(index, 0, func);
489
+ return func;
490
+ }
491
+ insertFunctionAt(options, index) {
492
+ const node = this._insertFunctionAt(options, index);
493
+ node.create({
494
+ index,
495
+ parentNode: this,
496
+ parentKey: 'functions',
497
+ });
498
+ return node;
499
+ }
500
+ _addFunction(options) {
501
+ const index = 0;
502
+ return this._insertFunctionAt(options, index);
503
+ }
504
+ addFunction(options) {
505
+ const node = this._addFunction(options);
506
+ const index = this.functions.indexOf(node);
507
+ node.create({
508
+ index,
509
+ parentNode: this,
510
+ parentKey: 'functions',
511
+ });
512
+ return node;
513
+ }
514
+ getAbstractInterfaceExistingNames(excludedList = []) {
515
+ const excludedSet = new Set(excludedList);
516
+ return (this.interfaces || [])
517
+ .filter((item) => !excludedSet.has(item))
518
+ .map((item) => item.name);
519
+ }
520
+ getAbstractInterfaceUniqueName(name = 'Interface1') {
521
+ return utils.unique(name, this.getAbstractInterfaceExistingNames(), undefined, false);
522
+ }
523
+ getViewExistingNames(excludedList = []) {
524
+ const excludedSet = new Set(excludedList);
525
+ return (this.views || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
526
+ }
527
+ getViewUniqueName(name = 'view1') {
528
+ return utils.unique(name, this.getViewExistingNames(), undefined, false);
529
+ }
530
+ _insertViewAt(options, index) {
531
+ const viewOptions = {};
532
+ const relationOptions = { parentNode: this, parentKey: 'views' };
533
+ let view;
534
+ if (!options) {
535
+ view = View__1.default.from({
536
+ ...viewOptions,
537
+ name: this.getViewUniqueName(),
538
+ }, this, 'views');
539
+ }
540
+ else if (typeof options === 'string') {
541
+ view = View__1.default.from({
542
+ ...viewOptions,
543
+ name: options,
544
+ }, this, 'views');
545
+ }
546
+ else if (options instanceof View__1.default) {
547
+ options.ensureDelete(); // 同一实例不支持多处存在
548
+ view = options;
549
+ Object.assign(view, relationOptions);
550
+ }
551
+ else {
552
+ view = View__1.default.from({
553
+ ...viewOptions,
554
+ ...options,
555
+ }, this, 'views');
556
+ }
557
+ this.views.splice(index, 0, view);
558
+ return view;
559
+ }
560
+ insertViewAt(options, index) {
561
+ const node = this._insertViewAt(options, index);
562
+ node.create({
563
+ index,
564
+ parentNode: this,
565
+ parentKey: 'views',
566
+ });
567
+ return node;
568
+ }
569
+ _addView(options) {
570
+ const index = this.views.length;
571
+ return this._insertViewAt(options, index);
572
+ }
573
+ addView(options) {
574
+ const node = this._addView(options);
575
+ const index = this.views.indexOf(node);
576
+ node.create({
577
+ index,
578
+ parentNode: this,
579
+ parentKey: 'views',
580
+ });
581
+ return node;
582
+ }
583
+ getVarExistingNames(excludedList = []) {
584
+ const excludedSet = new Set(excludedList);
585
+ return (this.frontendVariables || [])
586
+ .filter((item) => !excludedSet.has(item))
587
+ .map((item) => item.name);
588
+ }
589
+ getVariableUniqueName(name = 'variable1') {
590
+ return utils.unique(name, this.getVarExistingNames(), undefined, true);
591
+ }
592
+ _insertVariableInFrontendVariablesAt(options, index) {
593
+ const variableOptions = {};
594
+ const relationOptions = { parentNode: this, parentKey: 'frontendVariables' };
595
+ let variable;
596
+ if (!options) {
597
+ variable = Variable__1.default.from({
598
+ ...variableOptions,
599
+ name: this.getVariableUniqueName(),
600
+ }, this, 'frontendVariables');
601
+ }
602
+ else if (typeof options === 'string') {
603
+ variable = Variable__1.default.from({
604
+ ...variableOptions,
605
+ name: options,
606
+ }, this, 'frontendVariables');
607
+ }
608
+ else if (options instanceof Variable__1.default) {
609
+ options.ensureDelete(); // 同一实例不支持多处存在
610
+ variable = options;
611
+ Object.assign(variable, relationOptions);
612
+ }
613
+ else {
614
+ variable = Variable__1.default.from({
615
+ ...variableOptions,
616
+ ...options,
617
+ }, this, 'frontendVariables');
618
+ }
619
+ this.frontendVariables.splice(index, 0, variable);
620
+ return variable;
621
+ }
622
+ insertVariableInFrontendVariablesAt(options, index) {
623
+ const node = this._insertVariableInFrontendVariablesAt(options, index);
624
+ node.create({
625
+ index,
626
+ parentNode: this,
627
+ parentKey: 'frontendVariables',
628
+ });
629
+ return node;
630
+ }
631
+ _addVariableInFrontendVariables(options) {
632
+ const index = this.frontendVariables.length;
633
+ return this._insertVariableInFrontendVariablesAt(options, index);
634
+ }
635
+ addVariableInFrontendVariables(options) {
636
+ const node = this._addVariableInFrontendVariables(options);
637
+ const index = this.frontendVariables.indexOf(node);
638
+ node.create({
639
+ index,
640
+ parentNode: this,
641
+ parentKey: 'frontendVariables',
642
+ });
643
+ return node;
644
+ }
645
+ _insertVariableInVariablesAt(options, index) {
646
+ const variableOptions = {};
647
+ const relationOptions = { parentNode: this, parentKey: 'variables' };
648
+ let variable;
649
+ if (!options) {
650
+ variable = Variable__1.default.from({
651
+ ...variableOptions,
652
+ name: this.getVariableUniqueName(),
653
+ }, this, 'variables');
654
+ }
655
+ else if (typeof options === 'string') {
656
+ variable = Variable__1.default.from({
657
+ ...variableOptions,
658
+ name: options,
659
+ }, this, 'variables');
660
+ }
661
+ else if (options instanceof Variable__1.default) {
662
+ options.ensureDelete(); // 同一实例不支持多处存在
663
+ variable = options;
664
+ Object.assign(variable, relationOptions);
665
+ }
666
+ else {
667
+ variable = Variable__1.default.from({
668
+ ...variableOptions,
669
+ ...options,
670
+ }, this, 'variables');
671
+ }
672
+ this.variables.splice(index, 0, variable);
673
+ return variable;
674
+ }
675
+ insertVariableInVariablesAt(options, index) {
676
+ const node = this._insertVariableInVariablesAt(options, index);
677
+ node.create({
678
+ index,
679
+ parentNode: this,
680
+ parentKey: 'variables',
681
+ });
682
+ return node;
683
+ }
684
+ _addVariableInVariables(options) {
685
+ const index = this.variables.length;
686
+ return this._insertVariableInVariablesAt(options, index);
687
+ }
688
+ addVariableInVariables(options) {
689
+ const node = this._addVariableInVariables(options);
690
+ const index = this.variables.indexOf(node);
691
+ node.create({
692
+ index,
693
+ parentNode: this,
694
+ parentKey: 'variables',
695
+ });
696
+ return node;
697
+ }
698
+ getViewComponentExistingNames(excludedList = []) {
699
+ const excludedSet = new Set(excludedList);
700
+ return (this.viewComponents || [])
701
+ .filter((item) => !excludedSet.has(item))
702
+ .map((item) => item.name);
703
+ }
704
+ getViewComponentUniqueName(name = 'viewComponent1') {
705
+ return utils.unique(name, this.getViewComponentExistingNames(), undefined, false);
706
+ }
707
+ _insertViewComponentAt(options, index) {
708
+ const viewComponentOptions = {};
709
+ const relationOptions = { parentNode: this, parentKey: 'viewComponents' };
710
+ let viewComponent;
711
+ if (!options) {
712
+ viewComponent = ViewComponent__1.default.from({
713
+ ...viewComponentOptions,
714
+ name: this.getViewComponentUniqueName(),
715
+ }, this, 'viewComponents');
716
+ }
717
+ else if (typeof options === 'string') {
718
+ viewComponent = ViewComponent__1.default.from({
719
+ ...viewComponentOptions,
720
+ name: options,
721
+ }, this, 'viewComponents');
722
+ }
723
+ else if (options instanceof ViewComponent__1.default) {
724
+ options.ensureDelete(); // 同一实例不支持多处存在
725
+ viewComponent = options;
726
+ Object.assign(viewComponent, relationOptions);
727
+ }
728
+ else {
729
+ viewComponent = ViewComponent__1.default.from({
730
+ ...viewComponentOptions,
731
+ ...options,
732
+ }, this, 'viewComponents');
733
+ }
734
+ this.viewComponents.splice(index, 0, viewComponent);
735
+ return viewComponent;
736
+ }
737
+ insertViewComponentAt(options, index) {
738
+ const node = this._insertViewComponentAt(options, index);
739
+ node.create({
740
+ index,
741
+ parentNode: this,
742
+ parentKey: 'viewComponents',
743
+ });
744
+ return node;
745
+ }
746
+ _addViewComponent(options) {
747
+ const index = this.viewComponents.length;
748
+ return this._insertViewComponentAt(options, index);
749
+ }
750
+ addViewComponent(options) {
751
+ const node = this._addViewComponent(options);
752
+ const index = this.viewComponents.indexOf(node);
753
+ node.create({
754
+ index,
755
+ parentNode: this,
756
+ parentKey: 'viewComponents',
757
+ });
758
+ return node;
759
+ }
760
+ getProcessComponentExistingNames(excludedList = []) {
761
+ const excludedSet = new Set(excludedList);
762
+ return (this.processComponents || [])
763
+ .filter((item) => !excludedSet.has(item))
764
+ .map((item) => item.name);
765
+ }
766
+ getProcessComponentUniqueName(name = 'processComponent1') {
767
+ return utils.unique(name, this.getProcessComponentExistingNames(), undefined, false);
768
+ }
769
+ _insertProcessComponentAt(options, index) {
770
+ const processComponentOptions = {};
771
+ const relationOptions = { parentNode: this, parentKey: 'processComponents' };
772
+ let processComponent;
773
+ if (!options) {
774
+ processComponent = ProcessComponent__1.default.from({
775
+ ...processComponentOptions,
776
+ name: this.getProcessComponentUniqueName(),
777
+ }, this, 'processComponents');
778
+ }
779
+ else if (typeof options === 'string') {
780
+ processComponent = ProcessComponent__1.default.from({
781
+ ...processComponentOptions,
782
+ name: options,
783
+ }, this, 'processComponents');
784
+ }
785
+ else if (options instanceof ProcessComponent__1.default) {
786
+ options.ensureDelete(); // 同一实例不支持多处存在
787
+ processComponent = options;
788
+ Object.assign(processComponent, relationOptions);
789
+ }
790
+ else {
791
+ processComponent = ProcessComponent__1.default.from({
792
+ ...processComponentOptions,
793
+ ...options,
794
+ }, this, 'processComponents');
795
+ }
796
+ this.processComponents.splice(index, 0, processComponent);
797
+ return processComponent;
798
+ }
799
+ insertProcessComponentAt(options, index) {
800
+ const node = this._insertProcessComponentAt(options, index);
801
+ node.create({
802
+ index,
803
+ parentNode: this,
804
+ parentKey: 'processComponents',
805
+ });
806
+ return node;
807
+ }
808
+ _addProcessComponent(options) {
809
+ const index = this.processComponents.length;
810
+ return this._insertProcessComponentAt(options, index);
811
+ }
812
+ addProcessComponent(options) {
813
+ const node = this._addProcessComponent(options);
814
+ const index = this.processComponents.indexOf(node);
815
+ node.create({
816
+ index,
817
+ parentNode: this,
818
+ parentKey: 'processComponents',
819
+ });
820
+ return node;
821
+ }
822
+ removeNamespace(options) {
823
+ let namespace;
824
+ if (typeof options === 'string') {
825
+ namespace = this.children.find((item) => item.name === options);
826
+ if (!namespace) {
827
+ throw new Error('找不到命名空间 ' + options);
828
+ }
829
+ }
830
+ else {
831
+ namespace = options;
832
+ }
833
+ return namespace.delete();
834
+ }
835
+ __removeNamespace(namespace) {
836
+ const parentKey = namespace.parentKey;
837
+ const params = {
838
+ parentNode: this,
839
+ parentKey,
840
+ index: -1,
841
+ object: null,
842
+ oldObject: namespace,
843
+ };
844
+ if (parentKey) {
845
+ params.parentKey = parentKey;
846
+ // @ts-ignore
847
+ const t = this.__v_raw || this;
848
+ // @ts-ignore
849
+ const n = namespace.__v_raw || namespace;
850
+ if (Array.isArray(t[parentKey])) {
851
+ // @ts-ignore
852
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
853
+ ~index && this[parentKey].splice(index, 1);
854
+ params.index = index;
855
+ }
856
+ else if (t[parentKey] === n) {
857
+ params.index = 0;
858
+ this[parentKey] = undefined;
859
+ }
860
+ }
861
+ return params;
862
+ }
863
+ removeProcess(options) {
864
+ let process;
865
+ if (typeof options === 'string') {
866
+ process = this.processes.find((item) => item.name === options);
867
+ if (!process) {
868
+ throw new Error('找不到流程 ' + options);
869
+ }
870
+ }
871
+ else {
872
+ process = options;
873
+ }
874
+ return process.delete();
875
+ }
876
+ __removeProcess(process) {
877
+ const parentKey = process.parentKey;
878
+ const params = {
879
+ parentNode: this,
880
+ parentKey,
881
+ index: -1,
882
+ object: null,
883
+ oldObject: process,
884
+ };
885
+ if (parentKey) {
886
+ params.parentKey = parentKey;
887
+ // @ts-ignore
888
+ const t = this.__v_raw || this;
889
+ // @ts-ignore
890
+ const n = process.__v_raw || process;
891
+ if (Array.isArray(t[parentKey])) {
892
+ // @ts-ignore
893
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
894
+ ~index && this[parentKey].splice(index, 1);
895
+ params.index = index;
896
+ }
897
+ else if (t[parentKey] === n) {
898
+ params.index = 0;
899
+ this[parentKey] = undefined;
900
+ }
901
+ }
902
+ return params;
903
+ }
904
+ removeStructure(options) {
905
+ let structure;
906
+ if (typeof options === 'string') {
907
+ structure = this.structures.find((item) => item.name === options);
908
+ if (!structure) {
909
+ throw new Error('找不到数据结构 ' + options);
910
+ }
911
+ }
912
+ else {
913
+ structure = options;
914
+ }
915
+ return structure.delete();
916
+ }
917
+ __removeStructure(structure) {
918
+ const parentKey = structure.parentKey;
919
+ const params = {
920
+ parentNode: this,
921
+ parentKey,
922
+ index: -1,
923
+ object: null,
924
+ oldObject: structure,
925
+ };
926
+ if (parentKey) {
927
+ params.parentKey = parentKey;
928
+ // @ts-ignore
929
+ const t = this.__v_raw || this;
930
+ // @ts-ignore
931
+ const n = structure.__v_raw || structure;
932
+ if (Array.isArray(t[parentKey])) {
933
+ // @ts-ignore
934
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
935
+ ~index && this[parentKey].splice(index, 1);
936
+ params.index = index;
937
+ }
938
+ else if (t[parentKey] === n) {
939
+ params.index = 0;
940
+ this[parentKey] = undefined;
941
+ }
942
+ }
943
+ return params;
944
+ }
945
+ removeEnum(options) {
946
+ let enumeration;
947
+ if (typeof options === 'string') {
948
+ enumeration = this.enums.find((item) => item.name === options);
949
+ if (!enumeration) {
950
+ throw new Error('找不到枚举 ' + options);
951
+ }
952
+ }
953
+ else {
954
+ enumeration = options;
955
+ }
956
+ return enumeration.delete();
957
+ }
958
+ __removeEnum(enumeration) {
959
+ const parentKey = enumeration.parentKey;
960
+ const params = {
961
+ parentNode: this,
962
+ parentKey,
963
+ index: -1,
964
+ object: null,
965
+ oldObject: enumeration,
966
+ };
967
+ if (parentKey) {
968
+ params.parentKey = parentKey;
969
+ // @ts-ignore
970
+ const t = this.__v_raw || this;
971
+ // @ts-ignore
972
+ const n = enumeration.__v_raw || enumeration;
973
+ if (Array.isArray(t[parentKey])) {
974
+ // @ts-ignore
975
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
976
+ ~index && this[parentKey].splice(index, 1);
977
+ params.index = index;
978
+ }
979
+ else if (t[parentKey] === n) {
980
+ params.index = 0;
981
+ this[parentKey] = undefined;
982
+ }
983
+ }
984
+ return params;
985
+ }
986
+ removeLogic(options) {
987
+ let logic;
988
+ if (typeof options === 'string') {
989
+ logic = this.logics.find((item) => item.name === options);
990
+ if (!logic) {
991
+ throw new Error('找不到逻辑 ' + options);
992
+ }
993
+ }
994
+ else {
995
+ logic = options;
996
+ }
997
+ return logic.delete();
998
+ }
999
+ __removeLogic(logic) {
1000
+ const parentKey = logic.parentKey;
1001
+ const params = {
1002
+ parentNode: this,
1003
+ parentKey,
1004
+ index: -1,
1005
+ object: null,
1006
+ oldObject: logic,
1007
+ };
1008
+ if (parentKey) {
1009
+ params.parentKey = parentKey;
1010
+ // @ts-ignore
1011
+ const t = this.__v_raw || this;
1012
+ // @ts-ignore
1013
+ const n = logic.__v_raw || logic;
1014
+ if (Array.isArray(t[parentKey])) {
1015
+ // @ts-ignore
1016
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1017
+ ~index && this[parentKey].splice(index, 1);
1018
+ params.index = index;
1019
+ }
1020
+ else if (t[parentKey] === n) {
1021
+ params.index = 0;
1022
+ this[parentKey] = undefined;
1023
+ }
1024
+ }
1025
+ return params;
1026
+ }
1027
+ removeFunction(options) {
1028
+ let func;
1029
+ if (typeof options === 'string') {
1030
+ func = this.functions.find((item) => item.name === options);
1031
+ if (!func) {
1032
+ throw new Error('找不到函数 ' + options);
1033
+ }
1034
+ }
1035
+ else {
1036
+ func = options;
1037
+ }
1038
+ return func.delete();
1039
+ }
1040
+ __removeFunction(func) {
1041
+ const parentKey = func.parentKey;
1042
+ const params = {
1043
+ parentNode: this,
1044
+ parentKey,
1045
+ index: -1,
1046
+ object: null,
1047
+ oldObject: func,
1048
+ };
1049
+ if (parentKey) {
1050
+ params.parentKey = parentKey;
1051
+ // @ts-ignore
1052
+ const t = this.__v_raw || this;
1053
+ // @ts-ignore
1054
+ const n = func.__v_raw || func;
1055
+ if (Array.isArray(t[parentKey])) {
1056
+ // @ts-ignore
1057
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1058
+ ~index && this[parentKey].splice(index, 1);
1059
+ params.index = index;
1060
+ }
1061
+ else if (t[parentKey] === n) {
1062
+ params.index = 0;
1063
+ this[parentKey] = undefined;
1064
+ }
1065
+ }
1066
+ return params;
1067
+ }
1068
+ removeAbstractInterface(options) {
1069
+ let itface;
1070
+ if (typeof options === 'string') {
1071
+ itface = this.interfaces.find((item) => item.name === options);
1072
+ if (!itface) {
1073
+ throw new Error('找不到接口 ' + options);
1074
+ }
1075
+ }
1076
+ else {
1077
+ itface = options;
1078
+ }
1079
+ return itface.delete();
1080
+ }
1081
+ __removeAbstractInterface(itface) {
1082
+ const parentKey = itface.parentKey;
1083
+ const params = {
1084
+ parentNode: this,
1085
+ parentKey,
1086
+ index: -1,
1087
+ object: null,
1088
+ oldObject: itface,
1089
+ };
1090
+ if (parentKey) {
1091
+ params.parentKey = parentKey;
1092
+ // @ts-ignore
1093
+ const t = this.__v_raw || this;
1094
+ // @ts-ignore
1095
+ const n = itface.__v_raw || itface;
1096
+ if (Array.isArray(t[parentKey])) {
1097
+ // @ts-ignore
1098
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1099
+ ~index && this[parentKey].splice(index, 1);
1100
+ params.index = index;
1101
+ }
1102
+ else if (t[parentKey] === n) {
1103
+ params.index = 0;
1104
+ this[parentKey] = undefined;
1105
+ }
1106
+ }
1107
+ return params;
1108
+ }
1109
+ removeView(options) {
1110
+ let view;
1111
+ if (typeof options === 'string') {
1112
+ view = this.views.find((item) => item.name === options);
1113
+ if (!view) {
1114
+ throw new Error('找不到页面 ' + options);
1115
+ }
1116
+ }
1117
+ else {
1118
+ view = options;
1119
+ }
1120
+ return view.delete();
1121
+ }
1122
+ __removeView(view) {
1123
+ const parentKey = view.parentKey;
1124
+ const params = {
1125
+ parentNode: this,
1126
+ parentKey,
1127
+ index: -1,
1128
+ object: null,
1129
+ oldObject: view,
1130
+ };
1131
+ if (parentKey) {
1132
+ params.parentKey = parentKey;
1133
+ // @ts-ignore
1134
+ const t = this.__v_raw || this;
1135
+ // @ts-ignore
1136
+ const n = view.__v_raw || view;
1137
+ if (Array.isArray(t[parentKey])) {
1138
+ // @ts-ignore
1139
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1140
+ ~index && this[parentKey].splice(index, 1);
1141
+ params.index = index;
1142
+ }
1143
+ else if (t[parentKey] === n) {
1144
+ params.index = 0;
1145
+ this[parentKey] = undefined;
1146
+ }
1147
+ }
1148
+ return params;
1149
+ }
1150
+ removeVariableInFrontendVariables(options) {
1151
+ let variable;
1152
+ if (typeof options === 'string') {
1153
+ variable = this.frontendVariables.find((item) => item.name === options);
1154
+ if (!variable) {
1155
+ throw new Error('找不到变量 ' + options);
1156
+ }
1157
+ }
1158
+ else {
1159
+ variable = options;
1160
+ }
1161
+ return variable.delete();
1162
+ }
1163
+ removeVariableInVariables(options) {
1164
+ let variable;
1165
+ if (typeof options === 'string') {
1166
+ variable = this.variables.find((item) => item.name === options);
1167
+ if (!variable) {
1168
+ throw new Error('找不到变量 ' + options);
1169
+ }
1170
+ }
1171
+ else {
1172
+ variable = options;
1173
+ }
1174
+ return variable.delete();
1175
+ }
1176
+ __removeVariable(variable) {
1177
+ const parentKey = variable.parentKey;
1178
+ const params = {
1179
+ parentNode: this,
1180
+ parentKey,
1181
+ index: -1,
1182
+ object: null,
1183
+ oldObject: variable,
1184
+ };
1185
+ if (parentKey) {
1186
+ params.parentKey = parentKey;
1187
+ // @ts-ignore
1188
+ const t = this.__v_raw || this;
1189
+ // @ts-ignore
1190
+ const n = variable.__v_raw || variable;
1191
+ if (Array.isArray(t[parentKey])) {
1192
+ // @ts-ignore
1193
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1194
+ ~index && this[parentKey].splice(index, 1);
1195
+ params.index = index;
1196
+ }
1197
+ else if (t[parentKey] === n) {
1198
+ params.index = 0;
1199
+ this[parentKey] = undefined;
1200
+ }
1201
+ }
1202
+ return params;
1203
+ }
1204
+ removeViewComponent(options) {
1205
+ let viewComponent;
1206
+ if (typeof options === 'string') {
1207
+ viewComponent = this.viewComponents.find((item) => item.name === options);
1208
+ if (!viewComponent) {
1209
+ throw new Error('找不到页面组件 ' + options);
1210
+ }
1211
+ }
1212
+ else {
1213
+ viewComponent = options;
1214
+ }
1215
+ return viewComponent.delete();
1216
+ }
1217
+ __removeViewComponent(viewComponent) {
1218
+ const parentKey = viewComponent.parentKey;
1219
+ const params = {
1220
+ parentNode: this,
1221
+ parentKey,
1222
+ index: -1,
1223
+ object: null,
1224
+ oldObject: viewComponent,
1225
+ };
1226
+ if (parentKey) {
1227
+ params.parentKey = parentKey;
1228
+ // @ts-ignore
1229
+ const t = this.__v_raw || this;
1230
+ // @ts-ignore
1231
+ const n = viewComponent.__v_raw || viewComponent;
1232
+ if (Array.isArray(t[parentKey])) {
1233
+ // @ts-ignore
1234
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1235
+ ~index && this[parentKey].splice(index, 1);
1236
+ params.index = index;
1237
+ }
1238
+ else if (t[parentKey] === n) {
1239
+ params.index = 0;
1240
+ this[parentKey] = undefined;
1241
+ }
1242
+ }
1243
+ return params;
1244
+ }
1245
+ removeProcessComponent(options) {
1246
+ let processComponent;
1247
+ if (typeof options === 'string') {
1248
+ processComponent = this.processComponents.find((item) => item.name === options);
1249
+ if (!processComponent) {
1250
+ throw new Error('找不到流程组件 ' + options);
1251
+ }
1252
+ }
1253
+ else {
1254
+ processComponent = options;
1255
+ }
1256
+ return processComponent.delete();
1257
+ }
1258
+ __removeProcessComponent(processComponent) {
1259
+ const parentKey = processComponent.parentKey;
1260
+ const params = {
1261
+ parentNode: this,
1262
+ parentKey,
1263
+ index: -1,
1264
+ object: null,
1265
+ oldObject: processComponent,
1266
+ };
1267
+ if (parentKey) {
1268
+ params.parentKey = parentKey;
1269
+ // @ts-ignore
1270
+ const t = this.__v_raw || this;
1271
+ // @ts-ignore
1272
+ const n = processComponent.__v_raw || processComponent;
1273
+ if (Array.isArray(t[parentKey])) {
1274
+ // @ts-ignore
1275
+ const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1276
+ ~index && this[parentKey].splice(index, 1);
1277
+ params.index = index;
1278
+ }
1279
+ else if (t[parentKey] === n) {
1280
+ params.index = 0;
1281
+ this[parentKey] = undefined;
1282
+ }
1283
+ }
1284
+ return params;
1285
+ }
1286
+ //================================================================================
1287
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1288
+ // 自动生成的代码已结束。下面可以手动编写。
1289
+ //================================================================================
1290
+ findEnumByName(name) {
1291
+ return this.enums.find((enumItem) => enumItem.name === name);
1292
+ }
1293
+ findStructureByName(name) {
1294
+ return this.structures.find((item) => item.name === name);
1295
+ }
1296
+ findLogicByName(name) {
1297
+ return this.logics.find((logic) => logic.name === name);
1298
+ }
1299
+ path = undefined;
1300
+ /**
1301
+ * 获取命名空间
1302
+ */
1303
+ getNamespace() {
1304
+ if (this.path)
1305
+ return this.path;
1306
+ if (this.parentNode.concept === 'Connector') {
1307
+ return `${this.parentNode.getNamespace()}`;
1308
+ }
1309
+ if (this.parentNode && this.parentNode.getNamespace)
1310
+ return `${this.parentNode.getNamespace()}`;
1311
+ throw new Error('无法获取命名空间,请设置 parentNode 或临时的 path!');
1312
+ }
1313
+ /**
1314
+ * 获取命名空间
1315
+ */
1316
+ getTsNamespace() {
1317
+ if (this.path)
1318
+ return this.path;
1319
+ if (this.parentNode.concept === 'Connector') {
1320
+ return `${this.parentNode.getNamespace()}`;
1321
+ }
1322
+ if (this.parentNode && this.parentNode.getNamespace)
1323
+ return `${this.parentNode.getNamespace()}.${this.tsName}`;
1324
+ throw new Error('无法获取命名空间,请设置 parentNode 或临时的 path!');
1325
+ }
1326
+ findChild(name) {
1327
+ return this.children.find((child) => child.name === name);
1328
+ }
1329
+ findLogic(name) {
1330
+ return this.logics.find((logic) => logic.name === name);
1331
+ }
1332
+ getLogicExistingTitles(excludedList = []) {
1333
+ const excludedSet = new Set(excludedList);
1334
+ return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.title);
1335
+ }
1336
+ //todo 集合替换
1337
+ getInterfaceExistingNames(excludedList = []) {
1338
+ const excludedSet = new Set(excludedList);
1339
+ return (this.interfaces || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1340
+ }
1341
+ getInterfaceUniqueName(name = 'Interface1') {
1342
+ return utils.unique(name, this.getInterfaceExistingNames(), undefined, false);
1343
+ }
1344
+ _insertInterfaceAt(options, index) {
1345
+ const itfaceOptions = {};
1346
+ const relationOptions = { parentNode: this, parentKey: 'interfaces' };
1347
+ let itface;
1348
+ if (!options) {
1349
+ itface = Interface__1.default.from({
1350
+ ...itfaceOptions,
1351
+ name: this.getInterfaceUniqueName(),
1352
+ }, this, 'interfaces');
1353
+ }
1354
+ else if (typeof options === 'string') {
1355
+ itface = Interface__1.default.from({
1356
+ ...itfaceOptions,
1357
+ name: options,
1358
+ }, this, 'interfaces');
1359
+ }
1360
+ else if (options instanceof Interface__1.default) {
1361
+ options.ensureDelete(); // 同一实例不支持多处存在
1362
+ itface = options;
1363
+ Object.assign(itface, relationOptions);
1364
+ }
1365
+ else {
1366
+ itface = Interface__1.default.from({
1367
+ ...itfaceOptions,
1368
+ ...options,
1369
+ }, this, 'interfaces');
1370
+ }
1371
+ this.interfaces.splice(index, 0, itface);
1372
+ return itface;
1373
+ }
1374
+ insertInterfaceAt(options, index) {
1375
+ const node = this._insertInterfaceAt(options, index);
1376
+ node.create({
1377
+ index,
1378
+ parentNode: this,
1379
+ parentKey: 'interfaces',
1380
+ });
1381
+ return node;
1382
+ }
1383
+ _addInterface(options) {
1384
+ const index = 0;
1385
+ return this._insertInterfaceAt(options, index);
1386
+ }
1387
+ addInterface(options) {
1388
+ const node = this._addInterface(options);
1389
+ const index = this.interfaces.indexOf(node);
1390
+ node.create({
1391
+ index,
1392
+ parentNode: this,
1393
+ parentKey: 'interfaces',
1394
+ });
1395
+ return node;
1396
+ }
1397
+ removeInterface(options) {
1398
+ let itface;
1399
+ if (typeof options === 'string') {
1400
+ itface = this.interfaces.find((item) => item.name === options);
1401
+ if (!itface) {
1402
+ throw new Error('找不到接口 ' + options);
1403
+ }
1404
+ }
1405
+ else {
1406
+ itface = options;
1407
+ }
1408
+ return itface.delete();
1409
+ }
1410
+ __removeInterface(itface) {
1411
+ const parentKey = itface.parentKey;
1412
+ const params = {
1413
+ parentNode: this,
1414
+ parentKey,
1415
+ index: -1,
1416
+ object: null,
1417
+ oldObject: itface,
1418
+ };
1419
+ if (parentKey) {
1420
+ params.parentKey = parentKey;
1421
+ if (Array.isArray(this[parentKey])) {
1422
+ const index = this[parentKey].indexOf(itface);
1423
+ ~index && this[parentKey].splice(index, 1);
1424
+ params.index = index;
1425
+ }
1426
+ else if (this[parentKey] === itface) {
1427
+ params.index = 0;
1428
+ this[parentKey] = undefined;
1429
+ }
1430
+ }
1431
+ return params;
1432
+ }
1433
+ };
1434
+ __decorate([
1435
+ (0, decorators_1.property)('concept')
1436
+ ], Namespace.prototype, "concept", void 0);
1437
+ __decorate([
1438
+ (0, decorators_1.property)()
1439
+ ], Namespace.prototype, "originConcept", void 0);
1440
+ __decorate([
1441
+ (0, decorators_1.property)()
1442
+ ], Namespace.prototype, "name", void 0);
1443
+ __decorate([
1444
+ (0, decorators_1.property)()
1445
+ ], Namespace.prototype, "title", void 0);
1446
+ __decorate([
1447
+ (0, decorators_1.property)()
1448
+ ], Namespace.prototype, "description", void 0);
1449
+ __decorate([
1450
+ (0, decorators_1.property)({
1451
+ objectRef: 'Namespace',
1452
+ isArray: true,
1453
+ defaultValue: [],
1454
+ })
1455
+ ], Namespace.prototype, "children", void 0);
1456
+ __decorate([
1457
+ (0, decorators_1.property)({
1458
+ objectRef: 'Process',
1459
+ isArray: true,
1460
+ defaultValue: [],
1461
+ })
1462
+ ], Namespace.prototype, "processes", void 0);
1463
+ __decorate([
1464
+ (0, decorators_1.property)({
1465
+ objectRef: 'Structure',
1466
+ isArray: true,
1467
+ defaultValue: [],
1468
+ })
1469
+ ], Namespace.prototype, "structures", void 0);
1470
+ __decorate([
1471
+ (0, decorators_1.property)({
1472
+ objectRef: 'Enum',
1473
+ isArray: true,
1474
+ defaultValue: [],
1475
+ })
1476
+ ], Namespace.prototype, "enums", void 0);
1477
+ __decorate([
1478
+ (0, decorators_1.property)({
1479
+ objectRef: 'Logic',
1480
+ isArray: true,
1481
+ defaultValue: [],
1482
+ })
1483
+ ], Namespace.prototype, "logics", void 0);
1484
+ __decorate([
1485
+ (0, decorators_1.property)({
1486
+ objectRef: 'Function',
1487
+ isArray: true,
1488
+ defaultValue: [],
1489
+ })
1490
+ ], Namespace.prototype, "functions", void 0);
1491
+ __decorate([
1492
+ (0, decorators_1.property)({
1493
+ objectRef: 'AbstractInterface',
1494
+ isArray: true,
1495
+ defaultValue: [],
1496
+ })
1497
+ ], Namespace.prototype, "interfaces", void 0);
1498
+ __decorate([
1499
+ (0, decorators_1.property)({
1500
+ objectRef: 'View',
1501
+ isArray: true,
1502
+ defaultValue: [],
1503
+ })
1504
+ ], Namespace.prototype, "views", void 0);
1505
+ __decorate([
1506
+ (0, decorators_1.property)({
1507
+ objectRef: 'Variable',
1508
+ isArray: true,
1509
+ defaultValue: [],
1510
+ })
1511
+ ], Namespace.prototype, "frontendVariables", void 0);
1512
+ __decorate([
1513
+ (0, decorators_1.property)({
1514
+ objectRef: 'Variable',
1515
+ isArray: true,
1516
+ defaultValue: [],
1517
+ })
1518
+ ], Namespace.prototype, "variables", void 0);
1519
+ __decorate([
1520
+ (0, decorators_1.property)({
1521
+ objectRef: 'ViewComponent',
1522
+ isArray: true,
1523
+ defaultValue: [],
1524
+ })
1525
+ ], Namespace.prototype, "viewComponents", void 0);
1526
+ __decorate([
1527
+ (0, decorators_1.property)({
1528
+ objectRef: 'ProcessComponent',
1529
+ isArray: true,
1530
+ defaultValue: [],
1531
+ })
1532
+ ], Namespace.prototype, "processComponents", void 0);
1533
+ __decorate([
1534
+ (0, decorators_1.property)()
1535
+ ], Namespace.prototype, "path", void 0);
1536
+ Namespace = Namespace_1 = __decorate([
1537
+ decorators_1.className,
1538
+ (0, decorators_1.concept)('命名空间')
1539
+ // @ts-ignore
1540
+ ], Namespace);
1541
+ exports.Namespace = Namespace;
1542
+ exports.default = Namespace;
1543
+ //================================================================================
1544
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1545
+ // 自动生成的代码已结束。下面可以手动编写。
1546
+ //================================================================================
1492
1547
  //# sourceMappingURL=Namespace__.js.map