@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
@@ -3,6 +3,8 @@ import { getNaslNodeByNodeCallee, getNodeByNodeCallee } from '../automate/engine
3
3
  import ConfigProperty from './ConfigProperty__';
4
4
  import TypeAnnotation from './TypeAnnotation__';
5
5
  import View from './View__';
6
+ import AuthInterface from './AuthInterface__';
7
+ import Interface from './Interface__';
6
8
  // import CallLogic from './CallLogic__';
7
9
 
8
10
  export interface AssetsInfo {
@@ -19,6 +21,17 @@ interface MessageData {
19
21
  resultName?: string;
20
22
  }
21
23
 
24
+ interface compilerInfoMapProps {
25
+ java?: Array<{
26
+ packageName: string;
27
+ className: string;
28
+ naslName: string;
29
+ type: string;
30
+ javaTypes: Map<string, string>;
31
+ }>;
32
+ js?: { prefix: string };
33
+ }
34
+
22
35
  //================================================================================
23
36
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
24
37
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -34,8 +47,7 @@ import Structure from './Structure__';
34
47
  import Enum from './Enum__';
35
48
  import Logic from './Logic__';
36
49
  import OverriddenLogic from './OverriddenLogic__';
37
- import Interface from './Interface__';
38
- import AuthInterface from './AuthInterface__';
50
+ import AbstractInterface from './AbstractInterface__';
39
51
  import Frontend from './Frontend__';
40
52
  import Backend from './Backend__';
41
53
  import Process from './Process__';
@@ -59,6 +71,9 @@ export class App extends BaseNode {
59
71
  /** 类名 */
60
72
  static readonly ConceptName = 'App';
61
73
 
74
+ /** 继承链 */
75
+ static readonly inheritanceChain = ['BaseNode'];
76
+
62
77
  /**
63
78
  * 应用 Id
64
79
  */
@@ -180,14 +195,14 @@ export class App extends BaseNode {
180
195
  overriddenLogics: Array<OverriddenLogic> = [];
181
196
 
182
197
  /**
183
- * interfaces
198
+ * 接口列表
184
199
  */
185
200
  @property({
186
- objectRef: 'Interface | AuthInterface',
201
+ objectRef: 'AbstractInterface',
187
202
  isArray: true,
188
203
  defaultValue: [],
189
204
  })
190
- interfaces: Array<Interface | AuthInterface> = [];
205
+ interfaces: Array<AbstractInterface> = [];
191
206
 
192
207
  /**
193
208
  * 前端列表
@@ -1096,6 +1111,184 @@ export class App extends BaseNode {
1096
1111
  return node;
1097
1112
  }
1098
1113
 
1114
+ /**
1115
+ * 插入调用接口的鉴权逻辑
1116
+ * @internal
1117
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
1118
+ */
1119
+ _insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1120
+ name: string,
1121
+ index: number,
1122
+ ): AuthLogicForCallInterface;
1123
+
1124
+ /**
1125
+ * 插入调用接口的鉴权逻辑
1126
+ * @internal
1127
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
1128
+ */
1129
+ _insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1130
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
1131
+ index: number,
1132
+ ): AuthLogicForCallInterface;
1133
+
1134
+ /**
1135
+ * 插入调用接口的鉴权逻辑
1136
+ * @internal
1137
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
1138
+ */
1139
+ _insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1140
+ authLogicForCallInterface: AuthLogicForCallInterface,
1141
+ index: number,
1142
+ ): AuthLogicForCallInterface;
1143
+
1144
+ _insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1145
+ options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
1146
+ index: number,
1147
+ ) {
1148
+ const authLogicForCallInterfaceOptions: any = {};
1149
+ const relationOptions = { parentNode: this, parentKey: 'authLogicsForCallInterface' };
1150
+ let authLogicForCallInterface: AuthLogicForCallInterface;
1151
+ if (!options) {
1152
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
1153
+ {
1154
+ ...authLogicForCallInterfaceOptions,
1155
+ name: this.getAuthLogicForCallInterfaceUniqueName(),
1156
+ },
1157
+ this,
1158
+ 'authLogicsForCallInterface',
1159
+ );
1160
+ } else if (typeof options === 'string') {
1161
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
1162
+ {
1163
+ ...authLogicForCallInterfaceOptions,
1164
+ name: options,
1165
+ },
1166
+ this,
1167
+ 'authLogicsForCallInterface',
1168
+ );
1169
+ } else if (options instanceof AuthLogicForCallInterface) {
1170
+ options.ensureDelete(); // 同一实例不支持多处存在
1171
+ authLogicForCallInterface = options;
1172
+ Object.assign(authLogicForCallInterface, relationOptions);
1173
+ } else {
1174
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
1175
+ {
1176
+ ...authLogicForCallInterfaceOptions,
1177
+ ...options,
1178
+ },
1179
+ this,
1180
+ 'authLogicsForCallInterface',
1181
+ );
1182
+ }
1183
+ this.authLogicsForCallInterface.splice(index, 0, authLogicForCallInterface);
1184
+ return authLogicForCallInterface;
1185
+ }
1186
+
1187
+ /**
1188
+ * 插入调用接口的鉴权逻辑
1189
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
1190
+ */
1191
+ insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(name: string, index: number): AuthLogicForCallInterface;
1192
+
1193
+ /**
1194
+ * 插入调用接口的鉴权逻辑
1195
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
1196
+ */
1197
+ insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1198
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
1199
+ index: number,
1200
+ ): AuthLogicForCallInterface;
1201
+
1202
+ /**
1203
+ * 插入调用接口的鉴权逻辑
1204
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
1205
+ */
1206
+ insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1207
+ authLogicForCallInterface: AuthLogicForCallInterface,
1208
+ index: number,
1209
+ ): AuthLogicForCallInterface;
1210
+
1211
+ insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1212
+ options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
1213
+ index: number,
1214
+ ) {
1215
+ const node = this._insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(options as any, index);
1216
+ node.create({
1217
+ index,
1218
+ parentNode: this,
1219
+ parentKey: 'authLogicsForCallInterface',
1220
+ });
1221
+ return node;
1222
+ }
1223
+
1224
+ /**
1225
+ * 添加调用接口的鉴权逻辑
1226
+ * @internal
1227
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
1228
+ */
1229
+ _addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(name?: string): AuthLogicForCallInterface;
1230
+
1231
+ /**
1232
+ * 添加调用接口的鉴权逻辑
1233
+ * @internal
1234
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
1235
+ */
1236
+ _addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1237
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
1238
+ ): AuthLogicForCallInterface;
1239
+
1240
+ /**
1241
+ * 添加调用接口的鉴权逻辑
1242
+ * @internal
1243
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
1244
+ */
1245
+ _addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1246
+ authLogicForCallInterface: AuthLogicForCallInterface,
1247
+ ): AuthLogicForCallInterface;
1248
+
1249
+ _addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1250
+ options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
1251
+ ) {
1252
+ const index = this.authLogicsForCallInterface.length;
1253
+ return this._insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(options as any, index);
1254
+ }
1255
+
1256
+ /**
1257
+ * 添加调用接口的鉴权逻辑
1258
+ * @internal
1259
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
1260
+ */
1261
+ addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(name?: string): AuthLogicForCallInterface;
1262
+
1263
+ /**
1264
+ * 添加调用接口的鉴权逻辑
1265
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
1266
+ */
1267
+ addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1268
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
1269
+ ): AuthLogicForCallInterface;
1270
+
1271
+ /**
1272
+ * 添加调用接口的鉴权逻辑
1273
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
1274
+ */
1275
+ addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1276
+ authLogicForCallInterface: AuthLogicForCallInterface,
1277
+ ): AuthLogicForCallInterface;
1278
+
1279
+ addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1280
+ options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
1281
+ ) {
1282
+ const node = this._addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(options as any);
1283
+ const index = this.authLogicsForCallInterface.indexOf(node);
1284
+ node.create({
1285
+ index,
1286
+ parentNode: this,
1287
+ parentKey: 'authLogicsForCallInterface',
1288
+ });
1289
+ return node;
1290
+ }
1291
+
1099
1292
  getOverriddenLogicExistingNames(excludedList: Array<OverriddenLogic> = []) {
1100
1293
  const excludedSet = new Set(excludedList);
1101
1294
  return ((this.overriddenLogics as OverriddenLogic[]) || [])
@@ -1251,795 +1444,797 @@ export class App extends BaseNode {
1251
1444
  return node;
1252
1445
  }
1253
1446
 
1254
- getInterfaceExistingNames(excludedList: Array<Interface> = []) {
1447
+ getAbstractInterfaceExistingNames(excludedList: Array<AbstractInterface> = []) {
1255
1448
  const excludedSet = new Set(excludedList);
1256
- return ((this.interfaces as Interface[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1449
+ return ((this.interfaces as AbstractInterface[]) || [])
1450
+ .filter((item) => !excludedSet.has(item))
1451
+ .map((item) => item.name);
1257
1452
  }
1258
- getInterfaceUniqueName(name = 'Interface1') {
1259
- return utils.unique(name, this.getInterfaceExistingNames(), undefined, true);
1453
+ getAbstractInterfaceUniqueName(name = 'Interface1') {
1454
+ return utils.unique(name, this.getAbstractInterfaceExistingNames(), undefined, true);
1455
+ }
1456
+
1457
+ getFrontendExistingNames(excludedList: Array<Frontend> = []) {
1458
+ const excludedSet = new Set(excludedList);
1459
+ return ((this.frontends as Frontend[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1460
+ }
1461
+ getFrontendUniqueName(name = 'frontend1') {
1462
+ return utils.unique(name, this.getFrontendExistingNames(), undefined, true);
1260
1463
  }
1261
1464
 
1262
1465
  /**
1263
- * 插入接口
1466
+ * 插入前端
1264
1467
  * @internal
1265
- * @param name 接口名称,如果不填会自动生成一个唯一名称
1468
+ * @param name 前端名称,如果不填会自动生成一个唯一名称
1266
1469
  */
1267
- _insertInterfaceInInterfacesAt(name: string, index: number): Interface;
1470
+ _insertFrontendAt(name: string, index: number): Frontend;
1268
1471
 
1269
1472
  /**
1270
- * 插入接口
1473
+ * 插入前端
1271
1474
  * @internal
1272
- * @param itfaceOptions 接口参数
1475
+ * @param frontendOptions 前端参数
1273
1476
  */
1274
- _insertInterfaceInInterfacesAt(itfaceOptions: Partial<Interface>, index: number): Interface;
1477
+ _insertFrontendAt(frontendOptions: Partial<Frontend>, index: number): Frontend;
1275
1478
 
1276
1479
  /**
1277
- * 插入接口
1480
+ * 插入前端
1278
1481
  * @internal
1279
- * @param itface 已有的接口实例
1482
+ * @param frontend 已有的前端实例
1280
1483
  */
1281
- _insertInterfaceInInterfacesAt(itface: Interface, index: number): Interface;
1484
+ _insertFrontendAt(frontend: Frontend, index: number): Frontend;
1282
1485
 
1283
- _insertInterfaceInInterfacesAt(options: string | Partial<Interface> | Interface, index: number) {
1284
- const itfaceOptions: any = {};
1285
- const relationOptions = { parentNode: this, parentKey: 'interfaces' };
1286
- let itface: Interface;
1486
+ _insertFrontendAt(options: string | Partial<Frontend> | Frontend, index: number) {
1487
+ const frontendOptions: any = {};
1488
+ const relationOptions = { parentNode: this, parentKey: 'frontends' };
1489
+ let frontend: Frontend;
1287
1490
  if (!options) {
1288
- itface = Interface.from(
1491
+ frontend = Frontend.from(
1289
1492
  {
1290
- ...itfaceOptions,
1291
- name: this.getInterfaceUniqueName(),
1493
+ ...frontendOptions,
1494
+ name: this.getFrontendUniqueName(),
1292
1495
  },
1293
1496
  this,
1294
- 'interfaces',
1497
+ 'frontends',
1295
1498
  );
1296
1499
  } else if (typeof options === 'string') {
1297
- itface = Interface.from(
1500
+ frontend = Frontend.from(
1298
1501
  {
1299
- ...itfaceOptions,
1502
+ ...frontendOptions,
1300
1503
  name: options,
1301
1504
  },
1302
1505
  this,
1303
- 'interfaces',
1506
+ 'frontends',
1304
1507
  );
1305
- } else if (options instanceof Interface) {
1508
+ } else if (options instanceof Frontend) {
1306
1509
  options.ensureDelete(); // 同一实例不支持多处存在
1307
- itface = options;
1308
- Object.assign(itface, relationOptions);
1510
+ frontend = options;
1511
+ Object.assign(frontend, relationOptions);
1309
1512
  } else {
1310
- itface = Interface.from(
1513
+ frontend = Frontend.from(
1311
1514
  {
1312
- ...itfaceOptions,
1515
+ ...frontendOptions,
1313
1516
  ...options,
1314
1517
  },
1315
1518
  this,
1316
- 'interfaces',
1519
+ 'frontends',
1317
1520
  );
1318
1521
  }
1319
- this.interfaces.splice(index, 0, itface);
1320
- return itface;
1522
+ this.frontends.splice(index, 0, frontend);
1523
+ return frontend;
1321
1524
  }
1322
1525
 
1323
1526
  /**
1324
- * 插入接口
1325
- * @param name 接口名称,如果不填会自动生成一个唯一名称
1527
+ * 插入前端
1528
+ * @param name 前端名称,如果不填会自动生成一个唯一名称
1326
1529
  */
1327
- insertInterfaceInInterfacesAt(name: string, index: number): Interface;
1530
+ insertFrontendAt(name: string, index: number): Frontend;
1328
1531
 
1329
1532
  /**
1330
- * 插入接口
1331
- * @param itfaceOptions 接口参数
1533
+ * 插入前端
1534
+ * @param frontendOptions 前端参数
1332
1535
  */
1333
- insertInterfaceInInterfacesAt(itfaceOptions: Partial<Interface>, index: number): Interface;
1536
+ insertFrontendAt(frontendOptions: Partial<Frontend>, index: number): Frontend;
1334
1537
 
1335
1538
  /**
1336
- * 插入接口
1337
- * @param itface 已有的接口实例
1539
+ * 插入前端
1540
+ * @param frontend 已有的前端实例
1338
1541
  */
1339
- insertInterfaceInInterfacesAt(itface: Interface, index: number): Interface;
1542
+ insertFrontendAt(frontend: Frontend, index: number): Frontend;
1340
1543
 
1341
- insertInterfaceInInterfacesAt(options: string | Partial<Interface> | Interface, index: number) {
1342
- const node = this._insertInterfaceInInterfacesAt(options as any, index);
1544
+ insertFrontendAt(options: string | Partial<Frontend> | Frontend, index: number) {
1545
+ const node = this._insertFrontendAt(options as any, index);
1343
1546
  node.create({
1344
1547
  index,
1345
1548
  parentNode: this,
1346
- parentKey: 'interfaces',
1549
+ parentKey: 'frontends',
1347
1550
  });
1348
1551
  return node;
1349
1552
  }
1350
1553
 
1351
1554
  /**
1352
- * 添加接口
1555
+ * 添加前端
1353
1556
  * @internal
1354
- * @param name 接口名称,如果不填会自动生成一个唯一名称
1557
+ * @param name 前端名称,如果不填会自动生成一个唯一名称
1355
1558
  */
1356
- _addInterfaceInInterfaces(name?: string): Interface;
1559
+ _addFrontend(name?: string): Frontend;
1357
1560
 
1358
1561
  /**
1359
- * 添加接口
1562
+ * 添加前端
1360
1563
  * @internal
1361
- * @param itfaceOptions 接口参数
1564
+ * @param frontendOptions 前端参数
1362
1565
  */
1363
- _addInterfaceInInterfaces(itfaceOptions: Partial<Interface>): Interface;
1566
+ _addFrontend(frontendOptions: Partial<Frontend>): Frontend;
1364
1567
 
1365
1568
  /**
1366
- * 添加接口
1569
+ * 添加前端
1367
1570
  * @internal
1368
- * @param itface 已有的接口实例
1571
+ * @param frontend 已有的前端实例
1369
1572
  */
1370
- _addInterfaceInInterfaces(itface: Interface): Interface;
1573
+ _addFrontend(frontend: Frontend): Frontend;
1371
1574
 
1372
- _addInterfaceInInterfaces(options?: string | Partial<Interface> | Interface) {
1373
- const index = 0;
1374
- return this._insertInterfaceInInterfacesAt(options as any, index);
1575
+ _addFrontend(options?: string | Partial<Frontend> | Frontend) {
1576
+ const index = this.frontends.length;
1577
+ return this._insertFrontendAt(options as any, index);
1375
1578
  }
1376
1579
 
1377
1580
  /**
1378
- * 添加接口
1581
+ * 添加前端
1379
1582
  * @internal
1380
- * @param name 接口名称,如果不填会自动生成一个唯一名称
1583
+ * @param name 前端名称,如果不填会自动生成一个唯一名称
1381
1584
  */
1382
- addInterfaceInInterfaces(name?: string): Interface;
1585
+ addFrontend(name?: string): Frontend;
1383
1586
 
1384
1587
  /**
1385
- * 添加接口
1386
- * @param itfaceOptions 接口参数
1588
+ * 添加前端
1589
+ * @param frontendOptions 前端参数
1387
1590
  */
1388
- addInterfaceInInterfaces(itfaceOptions: Partial<Interface>): Interface;
1591
+ addFrontend(frontendOptions: Partial<Frontend>): Frontend;
1389
1592
 
1390
1593
  /**
1391
- * 添加接口
1392
- * @param itface 已有的接口实例
1594
+ * 添加前端
1595
+ * @param frontend 已有的前端实例
1393
1596
  */
1394
- addInterfaceInInterfaces(itface: Interface): Interface;
1597
+ addFrontend(frontend: Frontend): Frontend;
1395
1598
 
1396
- addInterfaceInInterfaces(options?: string | Partial<Interface> | Interface) {
1397
- const node = this._addInterfaceInInterfaces(options as any);
1398
- const index = this.interfaces.indexOf(node);
1599
+ addFrontend(options?: string | Partial<Frontend> | Frontend) {
1600
+ const node = this._addFrontend(options as any);
1601
+ const index = this.frontends.indexOf(node);
1399
1602
  node.create({
1400
1603
  index,
1401
1604
  parentNode: this,
1402
- parentKey: 'interfaces',
1605
+ parentKey: 'frontends',
1403
1606
  });
1404
1607
  return node;
1405
1608
  }
1406
1609
 
1610
+ getProcessExistingNames(excludedList: Array<Process> = []) {
1611
+ const excludedSet = new Set(excludedList);
1612
+ return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1613
+ }
1614
+ getProcessUniqueName(name = 'Process1') {
1615
+ return utils.unique(name, this.getProcessExistingNames(), undefined, true);
1616
+ }
1617
+
1407
1618
  /**
1408
- * 插入鉴权接口
1619
+ * 插入流程
1409
1620
  * @internal
1410
- * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
1621
+ * @param name 流程名称,如果不填会自动生成一个唯一名称
1411
1622
  */
1412
- _insertAuthInterfaceInInterfacesAt(name: string, index: number): AuthInterface;
1623
+ _insertProcessAt(name: string, index: number): Process;
1413
1624
 
1414
1625
  /**
1415
- * 插入鉴权接口
1626
+ * 插入流程
1416
1627
  * @internal
1417
- * @param itfaceOptions 鉴权接口参数
1628
+ * @param processOptions 流程参数
1418
1629
  */
1419
- _insertAuthInterfaceInInterfacesAt(itfaceOptions: Partial<AuthInterface>, index: number): AuthInterface;
1630
+ _insertProcessAt(processOptions: Partial<Process>, index: number): Process;
1420
1631
 
1421
1632
  /**
1422
- * 插入鉴权接口
1633
+ * 插入流程
1423
1634
  * @internal
1424
- * @param itface 已有的鉴权接口实例
1635
+ * @param process 已有的流程实例
1425
1636
  */
1426
- _insertAuthInterfaceInInterfacesAt(itface: AuthInterface, index: number): AuthInterface;
1637
+ _insertProcessAt(process: Process, index: number): Process;
1427
1638
 
1428
- _insertAuthInterfaceInInterfacesAt(options: string | Partial<AuthInterface> | AuthInterface, index: number) {
1429
- const itfaceOptions: any = {};
1430
- const relationOptions = { parentNode: this, parentKey: 'interfaces' };
1431
- let itface: AuthInterface;
1639
+ _insertProcessAt(options: string | Partial<Process> | Process, index: number) {
1640
+ const processOptions: any = {};
1641
+ const relationOptions = { parentNode: this, parentKey: 'processes' };
1642
+ let process: Process;
1432
1643
  if (!options) {
1433
- itface = AuthInterface.from(
1644
+ process = Process.from(
1434
1645
  {
1435
- ...itfaceOptions,
1436
- name: this.getAuthInterfaceUniqueName(),
1646
+ ...processOptions,
1647
+ name: this.getProcessUniqueName(),
1437
1648
  },
1438
1649
  this,
1439
- 'interfaces',
1650
+ 'processes',
1440
1651
  );
1441
1652
  } else if (typeof options === 'string') {
1442
- itface = AuthInterface.from(
1653
+ process = Process.from(
1443
1654
  {
1444
- ...itfaceOptions,
1655
+ ...processOptions,
1445
1656
  name: options,
1446
1657
  },
1447
1658
  this,
1448
- 'interfaces',
1659
+ 'processes',
1449
1660
  );
1450
- } else if (options instanceof AuthInterface) {
1661
+ } else if (options instanceof Process) {
1451
1662
  options.ensureDelete(); // 同一实例不支持多处存在
1452
- itface = options;
1453
- Object.assign(itface, relationOptions);
1663
+ process = options;
1664
+ Object.assign(process, relationOptions);
1454
1665
  } else {
1455
- itface = AuthInterface.from(
1666
+ process = Process.from(
1456
1667
  {
1457
- ...itfaceOptions,
1668
+ ...processOptions,
1458
1669
  ...options,
1459
1670
  },
1460
1671
  this,
1461
- 'interfaces',
1672
+ 'processes',
1462
1673
  );
1463
1674
  }
1464
- this.interfaces.splice(index, 0, itface);
1465
- return itface;
1675
+ this.processes.splice(index, 0, process);
1676
+ return process;
1466
1677
  }
1467
1678
 
1468
1679
  /**
1469
- * 插入鉴权接口
1470
- * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
1680
+ * 插入流程
1681
+ * @param name 流程名称,如果不填会自动生成一个唯一名称
1471
1682
  */
1472
- insertAuthInterfaceInInterfacesAt(name: string, index: number): AuthInterface;
1683
+ insertProcessAt(name: string, index: number): Process;
1473
1684
 
1474
1685
  /**
1475
- * 插入鉴权接口
1476
- * @param itfaceOptions 鉴权接口参数
1686
+ * 插入流程
1687
+ * @param processOptions 流程参数
1477
1688
  */
1478
- insertAuthInterfaceInInterfacesAt(itfaceOptions: Partial<AuthInterface>, index: number): AuthInterface;
1689
+ insertProcessAt(processOptions: Partial<Process>, index: number): Process;
1479
1690
 
1480
1691
  /**
1481
- * 插入鉴权接口
1482
- * @param itface 已有的鉴权接口实例
1692
+ * 插入流程
1693
+ * @param process 已有的流程实例
1483
1694
  */
1484
- insertAuthInterfaceInInterfacesAt(itface: AuthInterface, index: number): AuthInterface;
1695
+ insertProcessAt(process: Process, index: number): Process;
1485
1696
 
1486
- insertAuthInterfaceInInterfacesAt(options: string | Partial<AuthInterface> | AuthInterface, index: number) {
1487
- const node = this._insertAuthInterfaceInInterfacesAt(options as any, index);
1697
+ insertProcessAt(options: string | Partial<Process> | Process, index: number) {
1698
+ const node = this._insertProcessAt(options as any, index);
1488
1699
  node.create({
1489
1700
  index,
1490
1701
  parentNode: this,
1491
- parentKey: 'interfaces',
1702
+ parentKey: 'processes',
1492
1703
  });
1493
1704
  return node;
1494
1705
  }
1495
1706
 
1496
1707
  /**
1497
- * 添加鉴权接口
1708
+ * 添加流程
1498
1709
  * @internal
1499
- * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
1710
+ * @param name 流程名称,如果不填会自动生成一个唯一名称
1500
1711
  */
1501
- _addAuthInterfaceInInterfaces(name?: string): AuthInterface;
1712
+ _addProcess(name?: string): Process;
1502
1713
 
1503
1714
  /**
1504
- * 添加鉴权接口
1715
+ * 添加流程
1505
1716
  * @internal
1506
- * @param itfaceOptions 鉴权接口参数
1717
+ * @param processOptions 流程参数
1507
1718
  */
1508
- _addAuthInterfaceInInterfaces(itfaceOptions: Partial<AuthInterface>): AuthInterface;
1719
+ _addProcess(processOptions: Partial<Process>): Process;
1509
1720
 
1510
1721
  /**
1511
- * 添加鉴权接口
1722
+ * 添加流程
1512
1723
  * @internal
1513
- * @param itface 已有的鉴权接口实例
1724
+ * @param process 已有的流程实例
1514
1725
  */
1515
- _addAuthInterfaceInInterfaces(itface: AuthInterface): AuthInterface;
1726
+ _addProcess(process: Process): Process;
1516
1727
 
1517
- _addAuthInterfaceInInterfaces(options?: string | Partial<AuthInterface> | AuthInterface) {
1728
+ _addProcess(options?: string | Partial<Process> | Process) {
1518
1729
  const index = 0;
1519
- return this._insertAuthInterfaceInInterfacesAt(options as any, index);
1730
+ return this._insertProcessAt(options as any, index);
1520
1731
  }
1521
1732
 
1522
1733
  /**
1523
- * 添加鉴权接口
1734
+ * 添加流程
1524
1735
  * @internal
1525
- * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
1736
+ * @param name 流程名称,如果不填会自动生成一个唯一名称
1526
1737
  */
1527
- addAuthInterfaceInInterfaces(name?: string): AuthInterface;
1738
+ addProcess(name?: string): Process;
1528
1739
 
1529
1740
  /**
1530
- * 添加鉴权接口
1531
- * @param itfaceOptions 鉴权接口参数
1741
+ * 添加流程
1742
+ * @param processOptions 流程参数
1532
1743
  */
1533
- addAuthInterfaceInInterfaces(itfaceOptions: Partial<AuthInterface>): AuthInterface;
1744
+ addProcess(processOptions: Partial<Process>): Process;
1534
1745
 
1535
1746
  /**
1536
- * 添加鉴权接口
1537
- * @param itface 已有的鉴权接口实例
1747
+ * 添加流程
1748
+ * @param process 已有的流程实例
1538
1749
  */
1539
- addAuthInterfaceInInterfaces(itface: AuthInterface): AuthInterface;
1750
+ addProcess(process: Process): Process;
1540
1751
 
1541
- addAuthInterfaceInInterfaces(options?: string | Partial<AuthInterface> | AuthInterface) {
1542
- const node = this._addAuthInterfaceInInterfaces(options as any);
1543
- const index = this.interfaces.indexOf(node);
1752
+ addProcess(options?: string | Partial<Process> | Process) {
1753
+ const node = this._addProcess(options as any);
1754
+ const index = this.processes.indexOf(node);
1544
1755
  node.create({
1545
1756
  index,
1546
1757
  parentNode: this,
1547
- parentKey: 'interfaces',
1758
+ parentKey: 'processes',
1548
1759
  });
1549
1760
  return node;
1550
1761
  }
1551
1762
 
1552
- getFrontendExistingNames(excludedList: Array<Frontend> = []) {
1763
+ getRoleExistingNames(excludedList: Array<Role> = []) {
1553
1764
  const excludedSet = new Set(excludedList);
1554
- return ((this.frontends as Frontend[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1765
+ return ((this.roles as Role[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1555
1766
  }
1556
- getFrontendUniqueName(name = 'frontend1') {
1557
- return utils.unique(name, this.getFrontendExistingNames(), undefined, true);
1767
+ getRoleUniqueName(name = 'role1') {
1768
+ return utils.unique(name, this.getRoleExistingNames(), undefined, true);
1558
1769
  }
1559
1770
 
1560
1771
  /**
1561
- * 插入前端
1772
+ * 插入角色
1562
1773
  * @internal
1563
- * @param name 前端名称,如果不填会自动生成一个唯一名称
1774
+ * @param name 角色名称,如果不填会自动生成一个唯一名称
1564
1775
  */
1565
- _insertFrontendAt(name: string, index: number): Frontend;
1776
+ _insertRoleAt(name: string, index: number): Role;
1566
1777
 
1567
1778
  /**
1568
- * 插入前端
1779
+ * 插入角色
1569
1780
  * @internal
1570
- * @param frontendOptions 前端参数
1781
+ * @param roleOptions 角色参数
1571
1782
  */
1572
- _insertFrontendAt(frontendOptions: Partial<Frontend>, index: number): Frontend;
1783
+ _insertRoleAt(roleOptions: Partial<Role>, index: number): Role;
1573
1784
 
1574
1785
  /**
1575
- * 插入前端
1786
+ * 插入角色
1576
1787
  * @internal
1577
- * @param frontend 已有的前端实例
1788
+ * @param role 已有的角色实例
1578
1789
  */
1579
- _insertFrontendAt(frontend: Frontend, index: number): Frontend;
1790
+ _insertRoleAt(role: Role, index: number): Role;
1580
1791
 
1581
- _insertFrontendAt(options: string | Partial<Frontend> | Frontend, index: number) {
1582
- const frontendOptions: any = {};
1583
- const relationOptions = { parentNode: this, parentKey: 'frontends' };
1584
- let frontend: Frontend;
1792
+ _insertRoleAt(options: string | Partial<Role> | Role, index: number) {
1793
+ const roleOptions: any = {};
1794
+ const relationOptions = { parentNode: this, parentKey: 'roles' };
1795
+ let role: Role;
1585
1796
  if (!options) {
1586
- frontend = Frontend.from(
1797
+ role = Role.from(
1587
1798
  {
1588
- ...frontendOptions,
1589
- name: this.getFrontendUniqueName(),
1799
+ ...roleOptions,
1800
+ name: this.getRoleUniqueName(),
1590
1801
  },
1591
1802
  this,
1592
- 'frontends',
1803
+ 'roles',
1593
1804
  );
1594
1805
  } else if (typeof options === 'string') {
1595
- frontend = Frontend.from(
1806
+ role = Role.from(
1596
1807
  {
1597
- ...frontendOptions,
1808
+ ...roleOptions,
1598
1809
  name: options,
1599
1810
  },
1600
1811
  this,
1601
- 'frontends',
1812
+ 'roles',
1602
1813
  );
1603
- } else if (options instanceof Frontend) {
1814
+ } else if (options instanceof Role) {
1604
1815
  options.ensureDelete(); // 同一实例不支持多处存在
1605
- frontend = options;
1606
- Object.assign(frontend, relationOptions);
1816
+ role = options;
1817
+ Object.assign(role, relationOptions);
1607
1818
  } else {
1608
- frontend = Frontend.from(
1819
+ role = Role.from(
1609
1820
  {
1610
- ...frontendOptions,
1821
+ ...roleOptions,
1611
1822
  ...options,
1612
1823
  },
1613
1824
  this,
1614
- 'frontends',
1825
+ 'roles',
1615
1826
  );
1616
1827
  }
1617
- this.frontends.splice(index, 0, frontend);
1618
- return frontend;
1828
+ this.roles.splice(index, 0, role);
1829
+ return role;
1619
1830
  }
1620
1831
 
1621
1832
  /**
1622
- * 插入前端
1623
- * @param name 前端名称,如果不填会自动生成一个唯一名称
1833
+ * 插入角色
1834
+ * @param name 角色名称,如果不填会自动生成一个唯一名称
1624
1835
  */
1625
- insertFrontendAt(name: string, index: number): Frontend;
1836
+ insertRoleAt(name: string, index: number): Role;
1626
1837
 
1627
1838
  /**
1628
- * 插入前端
1629
- * @param frontendOptions 前端参数
1839
+ * 插入角色
1840
+ * @param roleOptions 角色参数
1630
1841
  */
1631
- insertFrontendAt(frontendOptions: Partial<Frontend>, index: number): Frontend;
1842
+ insertRoleAt(roleOptions: Partial<Role>, index: number): Role;
1632
1843
 
1633
1844
  /**
1634
- * 插入前端
1635
- * @param frontend 已有的前端实例
1845
+ * 插入角色
1846
+ * @param role 已有的角色实例
1636
1847
  */
1637
- insertFrontendAt(frontend: Frontend, index: number): Frontend;
1848
+ insertRoleAt(role: Role, index: number): Role;
1638
1849
 
1639
- insertFrontendAt(options: string | Partial<Frontend> | Frontend, index: number) {
1640
- const node = this._insertFrontendAt(options as any, index);
1850
+ insertRoleAt(options: string | Partial<Role> | Role, index: number) {
1851
+ const node = this._insertRoleAt(options as any, index);
1641
1852
  node.create({
1642
1853
  index,
1643
1854
  parentNode: this,
1644
- parentKey: 'frontends',
1855
+ parentKey: 'roles',
1645
1856
  });
1646
1857
  return node;
1647
1858
  }
1648
1859
 
1649
1860
  /**
1650
- * 添加前端
1861
+ * 添加角色
1651
1862
  * @internal
1652
- * @param name 前端名称,如果不填会自动生成一个唯一名称
1863
+ * @param name 角色名称,如果不填会自动生成一个唯一名称
1653
1864
  */
1654
- _addFrontend(name?: string): Frontend;
1865
+ _addRole(name?: string): Role;
1655
1866
 
1656
1867
  /**
1657
- * 添加前端
1868
+ * 添加角色
1658
1869
  * @internal
1659
- * @param frontendOptions 前端参数
1870
+ * @param roleOptions 角色参数
1660
1871
  */
1661
- _addFrontend(frontendOptions: Partial<Frontend>): Frontend;
1872
+ _addRole(roleOptions: Partial<Role>): Role;
1662
1873
 
1663
1874
  /**
1664
- * 添加前端
1875
+ * 添加角色
1665
1876
  * @internal
1666
- * @param frontend 已有的前端实例
1877
+ * @param role 已有的角色实例
1667
1878
  */
1668
- _addFrontend(frontend: Frontend): Frontend;
1879
+ _addRole(role: Role): Role;
1669
1880
 
1670
- _addFrontend(options?: string | Partial<Frontend> | Frontend) {
1671
- const index = this.frontends.length;
1672
- return this._insertFrontendAt(options as any, index);
1881
+ _addRole(options?: string | Partial<Role> | Role) {
1882
+ const index = this.roles.length;
1883
+ return this._insertRoleAt(options as any, index);
1673
1884
  }
1674
1885
 
1675
1886
  /**
1676
- * 添加前端
1887
+ * 添加角色
1677
1888
  * @internal
1678
- * @param name 前端名称,如果不填会自动生成一个唯一名称
1889
+ * @param name 角色名称,如果不填会自动生成一个唯一名称
1679
1890
  */
1680
- addFrontend(name?: string): Frontend;
1891
+ addRole(name?: string): Role;
1681
1892
 
1682
1893
  /**
1683
- * 添加前端
1684
- * @param frontendOptions 前端参数
1894
+ * 添加角色
1895
+ * @param roleOptions 角色参数
1685
1896
  */
1686
- addFrontend(frontendOptions: Partial<Frontend>): Frontend;
1897
+ addRole(roleOptions: Partial<Role>): Role;
1687
1898
 
1688
1899
  /**
1689
- * 添加前端
1690
- * @param frontend 已有的前端实例
1900
+ * 添加角色
1901
+ * @param role 已有的角色实例
1691
1902
  */
1692
- addFrontend(frontend: Frontend): Frontend;
1903
+ addRole(role: Role): Role;
1693
1904
 
1694
- addFrontend(options?: string | Partial<Frontend> | Frontend) {
1695
- const node = this._addFrontend(options as any);
1696
- const index = this.frontends.indexOf(node);
1905
+ addRole(options?: string | Partial<Role> | Role) {
1906
+ const node = this._addRole(options as any);
1907
+ const index = this.roles.indexOf(node);
1697
1908
  node.create({
1698
1909
  index,
1699
1910
  parentNode: this,
1700
- parentKey: 'frontends',
1911
+ parentKey: 'roles',
1701
1912
  });
1702
1913
  return node;
1703
1914
  }
1704
1915
 
1705
- getProcessExistingNames(excludedList: Array<Process> = []) {
1916
+ getModuleExistingNames(excludedList: Array<Module> = []) {
1706
1917
  const excludedSet = new Set(excludedList);
1707
- return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1918
+ return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1708
1919
  }
1709
- getProcessUniqueName(name = 'Process1') {
1710
- return utils.unique(name, this.getProcessExistingNames(), undefined, true);
1920
+ getModuleUniqueName(name = 'module1') {
1921
+ return utils.unique(name, this.getModuleExistingNames(), undefined, false);
1711
1922
  }
1712
1923
 
1713
1924
  /**
1714
- * 插入流程
1925
+ * 插入模块
1715
1926
  * @internal
1716
- * @param name 流程名称,如果不填会自动生成一个唯一名称
1927
+ * @param name 模块名称,如果不填会自动生成一个唯一名称
1717
1928
  */
1718
- _insertProcessAt(name: string, index: number): Process;
1929
+ _insertModuleInDependenciesAt(name: string, index: number): Module;
1719
1930
 
1720
1931
  /**
1721
- * 插入流程
1932
+ * 插入模块
1722
1933
  * @internal
1723
- * @param processOptions 流程参数
1934
+ * @param moduleOptions 模块参数
1724
1935
  */
1725
- _insertProcessAt(processOptions: Partial<Process>, index: number): Process;
1936
+ _insertModuleInDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
1726
1937
 
1727
1938
  /**
1728
- * 插入流程
1939
+ * 插入模块
1729
1940
  * @internal
1730
- * @param process 已有的流程实例
1941
+ * @param module 已有的模块实例
1731
1942
  */
1732
- _insertProcessAt(process: Process, index: number): Process;
1943
+ _insertModuleInDependenciesAt(module: Module, index: number): Module;
1733
1944
 
1734
- _insertProcessAt(options: string | Partial<Process> | Process, index: number) {
1735
- const processOptions: any = {};
1736
- const relationOptions = { parentNode: this, parentKey: 'processes' };
1737
- let process: Process;
1945
+ _insertModuleInDependenciesAt(options: string | Partial<Module> | Module, index: number) {
1946
+ const moduleOptions: any = {};
1947
+ const relationOptions = { parentNode: this, parentKey: 'dependencies' };
1948
+ let module: Module;
1738
1949
  if (!options) {
1739
- process = Process.from(
1950
+ module = Module.from(
1740
1951
  {
1741
- ...processOptions,
1742
- name: this.getProcessUniqueName(),
1952
+ ...moduleOptions,
1953
+ name: this.getModuleUniqueName(),
1743
1954
  },
1744
1955
  this,
1745
- 'processes',
1956
+ 'dependencies',
1746
1957
  );
1747
1958
  } else if (typeof options === 'string') {
1748
- process = Process.from(
1959
+ module = Module.from(
1749
1960
  {
1750
- ...processOptions,
1961
+ ...moduleOptions,
1751
1962
  name: options,
1752
1963
  },
1753
1964
  this,
1754
- 'processes',
1965
+ 'dependencies',
1755
1966
  );
1756
- } else if (options instanceof Process) {
1967
+ } else if (options instanceof Module) {
1757
1968
  options.ensureDelete(); // 同一实例不支持多处存在
1758
- process = options;
1759
- Object.assign(process, relationOptions);
1969
+ module = options;
1970
+ Object.assign(module, relationOptions);
1760
1971
  } else {
1761
- process = Process.from(
1972
+ module = Module.from(
1762
1973
  {
1763
- ...processOptions,
1974
+ ...moduleOptions,
1764
1975
  ...options,
1765
1976
  },
1766
1977
  this,
1767
- 'processes',
1978
+ 'dependencies',
1768
1979
  );
1769
1980
  }
1770
- this.processes.splice(index, 0, process);
1771
- return process;
1981
+ this.dependencies.splice(index, 0, module);
1982
+ return module;
1772
1983
  }
1773
1984
 
1774
1985
  /**
1775
- * 插入流程
1776
- * @param name 流程名称,如果不填会自动生成一个唯一名称
1986
+ * 插入模块
1987
+ * @param name 模块名称,如果不填会自动生成一个唯一名称
1777
1988
  */
1778
- insertProcessAt(name: string, index: number): Process;
1989
+ insertModuleInDependenciesAt(name: string, index: number): Module;
1779
1990
 
1780
1991
  /**
1781
- * 插入流程
1782
- * @param processOptions 流程参数
1992
+ * 插入模块
1993
+ * @param moduleOptions 模块参数
1783
1994
  */
1784
- insertProcessAt(processOptions: Partial<Process>, index: number): Process;
1995
+ insertModuleInDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
1785
1996
 
1786
1997
  /**
1787
- * 插入流程
1788
- * @param process 已有的流程实例
1998
+ * 插入模块
1999
+ * @param module 已有的模块实例
1789
2000
  */
1790
- insertProcessAt(process: Process, index: number): Process;
2001
+ insertModuleInDependenciesAt(module: Module, index: number): Module;
1791
2002
 
1792
- insertProcessAt(options: string | Partial<Process> | Process, index: number) {
1793
- const node = this._insertProcessAt(options as any, index);
2003
+ insertModuleInDependenciesAt(options: string | Partial<Module> | Module, index: number) {
2004
+ const node = this._insertModuleInDependenciesAt(options as any, index);
1794
2005
  node.create({
1795
2006
  index,
1796
2007
  parentNode: this,
1797
- parentKey: 'processes',
2008
+ parentKey: 'dependencies',
1798
2009
  });
1799
2010
  return node;
1800
2011
  }
1801
2012
 
1802
2013
  /**
1803
- * 添加流程
2014
+ * 添加模块
1804
2015
  * @internal
1805
- * @param name 流程名称,如果不填会自动生成一个唯一名称
2016
+ * @param name 模块名称,如果不填会自动生成一个唯一名称
1806
2017
  */
1807
- _addProcess(name?: string): Process;
2018
+ _addModuleInDependencies(name?: string): Module;
1808
2019
 
1809
2020
  /**
1810
- * 添加流程
2021
+ * 添加模块
1811
2022
  * @internal
1812
- * @param processOptions 流程参数
2023
+ * @param moduleOptions 模块参数
1813
2024
  */
1814
- _addProcess(processOptions: Partial<Process>): Process;
2025
+ _addModuleInDependencies(moduleOptions: Partial<Module>): Module;
1815
2026
 
1816
2027
  /**
1817
- * 添加流程
2028
+ * 添加模块
1818
2029
  * @internal
1819
- * @param process 已有的流程实例
2030
+ * @param module 已有的模块实例
1820
2031
  */
1821
- _addProcess(process: Process): Process;
2032
+ _addModuleInDependencies(module: Module): Module;
1822
2033
 
1823
- _addProcess(options?: string | Partial<Process> | Process) {
1824
- const index = 0;
1825
- return this._insertProcessAt(options as any, index);
2034
+ _addModuleInDependencies(options?: string | Partial<Module> | Module) {
2035
+ const index = this.dependencies.length;
2036
+ return this._insertModuleInDependenciesAt(options as any, index);
1826
2037
  }
1827
2038
 
1828
2039
  /**
1829
- * 添加流程
2040
+ * 添加模块
1830
2041
  * @internal
1831
- * @param name 流程名称,如果不填会自动生成一个唯一名称
2042
+ * @param name 模块名称,如果不填会自动生成一个唯一名称
1832
2043
  */
1833
- addProcess(name?: string): Process;
2044
+ addModuleInDependencies(name?: string): Module;
1834
2045
 
1835
2046
  /**
1836
- * 添加流程
1837
- * @param processOptions 流程参数
2047
+ * 添加模块
2048
+ * @param moduleOptions 模块参数
1838
2049
  */
1839
- addProcess(processOptions: Partial<Process>): Process;
2050
+ addModuleInDependencies(moduleOptions: Partial<Module>): Module;
1840
2051
 
1841
2052
  /**
1842
- * 添加流程
1843
- * @param process 已有的流程实例
2053
+ * 添加模块
2054
+ * @param module 已有的模块实例
1844
2055
  */
1845
- addProcess(process: Process): Process;
2056
+ addModuleInDependencies(module: Module): Module;
1846
2057
 
1847
- addProcess(options?: string | Partial<Process> | Process) {
1848
- const node = this._addProcess(options as any);
1849
- const index = this.processes.indexOf(node);
2058
+ addModuleInDependencies(options?: string | Partial<Module> | Module) {
2059
+ const node = this._addModuleInDependencies(options as any);
2060
+ const index = this.dependencies.indexOf(node);
1850
2061
  node.create({
1851
2062
  index,
1852
2063
  parentNode: this,
1853
- parentKey: 'processes',
2064
+ parentKey: 'dependencies',
1854
2065
  });
1855
2066
  return node;
1856
2067
  }
1857
2068
 
1858
- getRoleExistingNames(excludedList: Array<Role> = []) {
1859
- const excludedSet = new Set(excludedList);
1860
- return ((this.roles as Role[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1861
- }
1862
- getRoleUniqueName(name = 'role1') {
1863
- return utils.unique(name, this.getRoleExistingNames(), undefined, true);
1864
- }
1865
-
1866
2069
  /**
1867
- * 插入角色
2070
+ * 插入连接器
1868
2071
  * @internal
1869
- * @param name 角色名称,如果不填会自动生成一个唯一名称
2072
+ * @param name 连接器名称,如果不填会自动生成一个唯一名称
1870
2073
  */
1871
- _insertRoleAt(name: string, index: number): Role;
2074
+ _insertConnectorInDependenciesAt(name: string, index: number): Connector;
1872
2075
 
1873
2076
  /**
1874
- * 插入角色
2077
+ * 插入连接器
1875
2078
  * @internal
1876
- * @param roleOptions 角色参数
2079
+ * @param connectorOptions 连接器参数
1877
2080
  */
1878
- _insertRoleAt(roleOptions: Partial<Role>, index: number): Role;
2081
+ _insertConnectorInDependenciesAt(connectorOptions: Partial<Connector>, index: number): Connector;
1879
2082
 
1880
2083
  /**
1881
- * 插入角色
2084
+ * 插入连接器
1882
2085
  * @internal
1883
- * @param role 已有的角色实例
2086
+ * @param connector 已有的连接器实例
1884
2087
  */
1885
- _insertRoleAt(role: Role, index: number): Role;
2088
+ _insertConnectorInDependenciesAt(connector: Connector, index: number): Connector;
1886
2089
 
1887
- _insertRoleAt(options: string | Partial<Role> | Role, index: number) {
1888
- const roleOptions: any = {};
1889
- const relationOptions = { parentNode: this, parentKey: 'roles' };
1890
- let role: Role;
2090
+ _insertConnectorInDependenciesAt(options: string | Partial<Connector> | Connector, index: number) {
2091
+ const connectorOptions: any = {};
2092
+ const relationOptions = { parentNode: this, parentKey: 'dependencies' };
2093
+ let connector: Connector;
1891
2094
  if (!options) {
1892
- role = Role.from(
2095
+ connector = Connector.from(
1893
2096
  {
1894
- ...roleOptions,
1895
- name: this.getRoleUniqueName(),
2097
+ ...connectorOptions,
2098
+ name: this.getConnectorUniqueName(),
1896
2099
  },
1897
2100
  this,
1898
- 'roles',
2101
+ 'dependencies',
1899
2102
  );
1900
2103
  } else if (typeof options === 'string') {
1901
- role = Role.from(
2104
+ connector = Connector.from(
1902
2105
  {
1903
- ...roleOptions,
2106
+ ...connectorOptions,
1904
2107
  name: options,
1905
2108
  },
1906
2109
  this,
1907
- 'roles',
2110
+ 'dependencies',
1908
2111
  );
1909
- } else if (options instanceof Role) {
2112
+ } else if (options instanceof Connector) {
1910
2113
  options.ensureDelete(); // 同一实例不支持多处存在
1911
- role = options;
1912
- Object.assign(role, relationOptions);
2114
+ connector = options;
2115
+ Object.assign(connector, relationOptions);
1913
2116
  } else {
1914
- role = Role.from(
2117
+ connector = Connector.from(
1915
2118
  {
1916
- ...roleOptions,
2119
+ ...connectorOptions,
1917
2120
  ...options,
1918
2121
  },
1919
2122
  this,
1920
- 'roles',
2123
+ 'dependencies',
1921
2124
  );
1922
2125
  }
1923
- this.roles.splice(index, 0, role);
1924
- return role;
2126
+ this.dependencies.splice(index, 0, connector);
2127
+ return connector;
1925
2128
  }
1926
2129
 
1927
2130
  /**
1928
- * 插入角色
1929
- * @param name 角色名称,如果不填会自动生成一个唯一名称
2131
+ * 插入连接器
2132
+ * @param name 连接器名称,如果不填会自动生成一个唯一名称
1930
2133
  */
1931
- insertRoleAt(name: string, index: number): Role;
2134
+ insertConnectorInDependenciesAt(name: string, index: number): Connector;
1932
2135
 
1933
2136
  /**
1934
- * 插入角色
1935
- * @param roleOptions 角色参数
2137
+ * 插入连接器
2138
+ * @param connectorOptions 连接器参数
1936
2139
  */
1937
- insertRoleAt(roleOptions: Partial<Role>, index: number): Role;
2140
+ insertConnectorInDependenciesAt(connectorOptions: Partial<Connector>, index: number): Connector;
1938
2141
 
1939
2142
  /**
1940
- * 插入角色
1941
- * @param role 已有的角色实例
2143
+ * 插入连接器
2144
+ * @param connector 已有的连接器实例
1942
2145
  */
1943
- insertRoleAt(role: Role, index: number): Role;
2146
+ insertConnectorInDependenciesAt(connector: Connector, index: number): Connector;
1944
2147
 
1945
- insertRoleAt(options: string | Partial<Role> | Role, index: number) {
1946
- const node = this._insertRoleAt(options as any, index);
2148
+ insertConnectorInDependenciesAt(options: string | Partial<Connector> | Connector, index: number) {
2149
+ const node = this._insertConnectorInDependenciesAt(options as any, index);
1947
2150
  node.create({
1948
2151
  index,
1949
2152
  parentNode: this,
1950
- parentKey: 'roles',
2153
+ parentKey: 'dependencies',
1951
2154
  });
1952
2155
  return node;
1953
2156
  }
1954
2157
 
1955
2158
  /**
1956
- * 添加角色
2159
+ * 添加连接器
1957
2160
  * @internal
1958
- * @param name 角色名称,如果不填会自动生成一个唯一名称
2161
+ * @param name 连接器名称,如果不填会自动生成一个唯一名称
1959
2162
  */
1960
- _addRole(name?: string): Role;
2163
+ _addConnectorInDependencies(name?: string): Connector;
1961
2164
 
1962
2165
  /**
1963
- * 添加角色
2166
+ * 添加连接器
1964
2167
  * @internal
1965
- * @param roleOptions 角色参数
2168
+ * @param connectorOptions 连接器参数
1966
2169
  */
1967
- _addRole(roleOptions: Partial<Role>): Role;
2170
+ _addConnectorInDependencies(connectorOptions: Partial<Connector>): Connector;
1968
2171
 
1969
2172
  /**
1970
- * 添加角色
2173
+ * 添加连接器
1971
2174
  * @internal
1972
- * @param role 已有的角色实例
2175
+ * @param connector 已有的连接器实例
1973
2176
  */
1974
- _addRole(role: Role): Role;
2177
+ _addConnectorInDependencies(connector: Connector): Connector;
1975
2178
 
1976
- _addRole(options?: string | Partial<Role> | Role) {
1977
- const index = this.roles.length;
1978
- return this._insertRoleAt(options as any, index);
2179
+ _addConnectorInDependencies(options?: string | Partial<Connector> | Connector) {
2180
+ const index = this.dependencies.length;
2181
+ return this._insertConnectorInDependenciesAt(options as any, index);
1979
2182
  }
1980
2183
 
1981
2184
  /**
1982
- * 添加角色
2185
+ * 添加连接器
1983
2186
  * @internal
1984
- * @param name 角色名称,如果不填会自动生成一个唯一名称
2187
+ * @param name 连接器名称,如果不填会自动生成一个唯一名称
1985
2188
  */
1986
- addRole(name?: string): Role;
2189
+ addConnectorInDependencies(name?: string): Connector;
1987
2190
 
1988
2191
  /**
1989
- * 添加角色
1990
- * @param roleOptions 角色参数
2192
+ * 添加连接器
2193
+ * @param connectorOptions 连接器参数
1991
2194
  */
1992
- addRole(roleOptions: Partial<Role>): Role;
2195
+ addConnectorInDependencies(connectorOptions: Partial<Connector>): Connector;
1993
2196
 
1994
2197
  /**
1995
- * 添加角色
1996
- * @param role 已有的角色实例
2198
+ * 添加连接器
2199
+ * @param connector 已有的连接器实例
1997
2200
  */
1998
- addRole(role: Role): Role;
2201
+ addConnectorInDependencies(connector: Connector): Connector;
1999
2202
 
2000
- addRole(options?: string | Partial<Role> | Role) {
2001
- const node = this._addRole(options as any);
2002
- const index = this.roles.indexOf(node);
2203
+ addConnectorInDependencies(options?: string | Partial<Connector> | Connector) {
2204
+ const node = this._addConnectorInDependencies(options as any);
2205
+ const index = this.dependencies.indexOf(node);
2003
2206
  node.create({
2004
2207
  index,
2005
2208
  parentNode: this,
2006
- parentKey: 'roles',
2209
+ parentKey: 'dependencies',
2007
2210
  });
2008
2211
  return node;
2009
2212
  }
2010
2213
 
2011
- getModuleExistingNames(excludedList: Array<Module> = []) {
2012
- const excludedSet = new Set(excludedList);
2013
- return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
2014
- }
2015
- getModuleUniqueName(name = 'module1') {
2016
- return utils.unique(name, this.getModuleExistingNames(), undefined, false);
2017
- }
2018
-
2019
2214
  /**
2020
2215
  * 插入模块
2021
2216
  * @internal
2022
2217
  * @param name 模块名称,如果不填会自动生成一个唯一名称
2023
2218
  */
2024
- _insertModuleInDependenciesAt(name: string, index: number): Module;
2219
+ _insertModuleInInterfaceDependenciesAt(name: string, index: number): Module;
2025
2220
 
2026
2221
  /**
2027
2222
  * 插入模块
2028
2223
  * @internal
2029
2224
  * @param moduleOptions 模块参数
2030
2225
  */
2031
- _insertModuleInDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
2226
+ _insertModuleInInterfaceDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
2032
2227
 
2033
2228
  /**
2034
2229
  * 插入模块
2035
2230
  * @internal
2036
2231
  * @param module 已有的模块实例
2037
2232
  */
2038
- _insertModuleInDependenciesAt(module: Module, index: number): Module;
2233
+ _insertModuleInInterfaceDependenciesAt(module: Module, index: number): Module;
2039
2234
 
2040
- _insertModuleInDependenciesAt(options: string | Partial<Module> | Module, index: number) {
2235
+ _insertModuleInInterfaceDependenciesAt(options: string | Partial<Module> | Module, index: number) {
2041
2236
  const moduleOptions: any = {};
2042
- const relationOptions = { parentNode: this, parentKey: 'dependencies' };
2237
+ const relationOptions = { parentNode: this, parentKey: 'interfaceDependencies' };
2043
2238
  let module: Module;
2044
2239
  if (!options) {
2045
2240
  module = Module.from(
@@ -2048,7 +2243,7 @@ export class App extends BaseNode {
2048
2243
  name: this.getModuleUniqueName(),
2049
2244
  },
2050
2245
  this,
2051
- 'dependencies',
2246
+ 'interfaceDependencies',
2052
2247
  );
2053
2248
  } else if (typeof options === 'string') {
2054
2249
  module = Module.from(
@@ -2057,7 +2252,7 @@ export class App extends BaseNode {
2057
2252
  name: options,
2058
2253
  },
2059
2254
  this,
2060
- 'dependencies',
2255
+ 'interfaceDependencies',
2061
2256
  );
2062
2257
  } else if (options instanceof Module) {
2063
2258
  options.ensureDelete(); // 同一实例不支持多处存在
@@ -2070,10 +2265,10 @@ export class App extends BaseNode {
2070
2265
  ...options,
2071
2266
  },
2072
2267
  this,
2073
- 'dependencies',
2268
+ 'interfaceDependencies',
2074
2269
  );
2075
2270
  }
2076
- this.dependencies.splice(index, 0, module);
2271
+ this.interfaceDependencies.splice(index, 0, module);
2077
2272
  return module;
2078
2273
  }
2079
2274
 
@@ -2081,26 +2276,26 @@ export class App extends BaseNode {
2081
2276
  * 插入模块
2082
2277
  * @param name 模块名称,如果不填会自动生成一个唯一名称
2083
2278
  */
2084
- insertModuleInDependenciesAt(name: string, index: number): Module;
2279
+ insertModuleInInterfaceDependenciesAt(name: string, index: number): Module;
2085
2280
 
2086
2281
  /**
2087
2282
  * 插入模块
2088
2283
  * @param moduleOptions 模块参数
2089
2284
  */
2090
- insertModuleInDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
2285
+ insertModuleInInterfaceDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
2091
2286
 
2092
2287
  /**
2093
2288
  * 插入模块
2094
2289
  * @param module 已有的模块实例
2095
2290
  */
2096
- insertModuleInDependenciesAt(module: Module, index: number): Module;
2291
+ insertModuleInInterfaceDependenciesAt(module: Module, index: number): Module;
2097
2292
 
2098
- insertModuleInDependenciesAt(options: string | Partial<Module> | Module, index: number) {
2099
- const node = this._insertModuleInDependenciesAt(options as any, index);
2293
+ insertModuleInInterfaceDependenciesAt(options: string | Partial<Module> | Module, index: number) {
2294
+ const node = this._insertModuleInInterfaceDependenciesAt(options as any, index);
2100
2295
  node.create({
2101
2296
  index,
2102
2297
  parentNode: this,
2103
- parentKey: 'dependencies',
2298
+ parentKey: 'interfaceDependencies',
2104
2299
  });
2105
2300
  return node;
2106
2301
  }
@@ -2110,25 +2305,25 @@ export class App extends BaseNode {
2110
2305
  * @internal
2111
2306
  * @param name 模块名称,如果不填会自动生成一个唯一名称
2112
2307
  */
2113
- _addModuleInDependencies(name?: string): Module;
2308
+ _addModuleInInterfaceDependencies(name?: string): Module;
2114
2309
 
2115
2310
  /**
2116
2311
  * 添加模块
2117
2312
  * @internal
2118
2313
  * @param moduleOptions 模块参数
2119
2314
  */
2120
- _addModuleInDependencies(moduleOptions: Partial<Module>): Module;
2315
+ _addModuleInInterfaceDependencies(moduleOptions: Partial<Module>): Module;
2121
2316
 
2122
2317
  /**
2123
2318
  * 添加模块
2124
2319
  * @internal
2125
2320
  * @param module 已有的模块实例
2126
2321
  */
2127
- _addModuleInDependencies(module: Module): Module;
2322
+ _addModuleInInterfaceDependencies(module: Module): Module;
2128
2323
 
2129
- _addModuleInDependencies(options?: string | Partial<Module> | Module) {
2130
- const index = this.dependencies.length;
2131
- return this._insertModuleInDependenciesAt(options as any, index);
2324
+ _addModuleInInterfaceDependencies(options?: string | Partial<Module> | Module) {
2325
+ const index = this.interfaceDependencies.length;
2326
+ return this._insertModuleInInterfaceDependenciesAt(options as any, index);
2132
2327
  }
2133
2328
 
2134
2329
  /**
@@ -2136,848 +2331,815 @@ export class App extends BaseNode {
2136
2331
  * @internal
2137
2332
  * @param name 模块名称,如果不填会自动生成一个唯一名称
2138
2333
  */
2139
- addModuleInDependencies(name?: string): Module;
2334
+ addModuleInInterfaceDependencies(name?: string): Module;
2140
2335
 
2141
2336
  /**
2142
2337
  * 添加模块
2143
2338
  * @param moduleOptions 模块参数
2144
2339
  */
2145
- addModuleInDependencies(moduleOptions: Partial<Module>): Module;
2340
+ addModuleInInterfaceDependencies(moduleOptions: Partial<Module>): Module;
2146
2341
 
2147
2342
  /**
2148
2343
  * 添加模块
2149
2344
  * @param module 已有的模块实例
2150
2345
  */
2151
- addModuleInDependencies(module: Module): Module;
2346
+ addModuleInInterfaceDependencies(module: Module): Module;
2152
2347
 
2153
- addModuleInDependencies(options?: string | Partial<Module> | Module) {
2154
- const node = this._addModuleInDependencies(options as any);
2155
- const index = this.dependencies.indexOf(node);
2348
+ addModuleInInterfaceDependencies(options?: string | Partial<Module> | Module) {
2349
+ const node = this._addModuleInInterfaceDependencies(options as any);
2350
+ const index = this.interfaceDependencies.indexOf(node);
2156
2351
  node.create({
2157
2352
  index,
2158
2353
  parentNode: this,
2159
- parentKey: 'dependencies',
2354
+ parentKey: 'interfaceDependencies',
2160
2355
  });
2161
2356
  return node;
2162
2357
  }
2163
2358
 
2164
2359
  /**
2165
- * 插入连接器
2360
+ * 插入调用接口的鉴权逻辑
2166
2361
  * @internal
2167
- * @param name 连接器名称,如果不填会自动生成一个唯一名称
2362
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2168
2363
  */
2169
- _insertConnectorInDependenciesAt(name: string, index: number): Connector;
2364
+ _insertAuthLogicForCallInterfaceAt(name: string, index: number): AuthLogicForCallInterface;
2170
2365
 
2171
2366
  /**
2172
- * 插入连接器
2367
+ * 插入调用接口的鉴权逻辑
2173
2368
  * @internal
2174
- * @param connectorOptions 连接器参数
2369
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2175
2370
  */
2176
- _insertConnectorInDependenciesAt(connectorOptions: Partial<Connector>, index: number): Connector;
2371
+ _insertAuthLogicForCallInterfaceAt(
2372
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2373
+ index: number,
2374
+ ): AuthLogicForCallInterface;
2177
2375
 
2178
2376
  /**
2179
- * 插入连接器
2377
+ * 插入调用接口的鉴权逻辑
2180
2378
  * @internal
2181
- * @param connector 已有的连接器实例
2379
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2182
2380
  */
2183
- _insertConnectorInDependenciesAt(connector: Connector, index: number): Connector;
2381
+ _insertAuthLogicForCallInterfaceAt(
2382
+ authLogicForCallInterface: AuthLogicForCallInterface,
2383
+ index: number,
2384
+ ): AuthLogicForCallInterface;
2184
2385
 
2185
- _insertConnectorInDependenciesAt(options: string | Partial<Connector> | Connector, index: number) {
2186
- const connectorOptions: any = {};
2187
- const relationOptions = { parentNode: this, parentKey: 'dependencies' };
2188
- let connector: Connector;
2386
+ _insertAuthLogicForCallInterfaceAt(
2387
+ options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
2388
+ index: number,
2389
+ ) {
2390
+ const authLogicForCallInterfaceOptions: any = {};
2391
+ const relationOptions = { parentNode: this, parentKey: 'authLogicsForCallInterface' };
2392
+ let authLogicForCallInterface: AuthLogicForCallInterface;
2189
2393
  if (!options) {
2190
- connector = Connector.from(
2394
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
2191
2395
  {
2192
- ...connectorOptions,
2193
- name: this.getConnectorUniqueName(),
2396
+ ...authLogicForCallInterfaceOptions,
2397
+ name: this.getAuthLogicForCallInterfaceUniqueName(),
2194
2398
  },
2195
2399
  this,
2196
- 'dependencies',
2400
+ 'authLogicsForCallInterface',
2197
2401
  );
2198
2402
  } else if (typeof options === 'string') {
2199
- connector = Connector.from(
2403
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
2200
2404
  {
2201
- ...connectorOptions,
2405
+ ...authLogicForCallInterfaceOptions,
2202
2406
  name: options,
2203
2407
  },
2204
2408
  this,
2205
- 'dependencies',
2409
+ 'authLogicsForCallInterface',
2206
2410
  );
2207
- } else if (options instanceof Connector) {
2411
+ } else if (options instanceof AuthLogicForCallInterface) {
2208
2412
  options.ensureDelete(); // 同一实例不支持多处存在
2209
- connector = options;
2210
- Object.assign(connector, relationOptions);
2413
+ authLogicForCallInterface = options;
2414
+ Object.assign(authLogicForCallInterface, relationOptions);
2211
2415
  } else {
2212
- connector = Connector.from(
2416
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
2213
2417
  {
2214
- ...connectorOptions,
2418
+ ...authLogicForCallInterfaceOptions,
2215
2419
  ...options,
2216
2420
  },
2217
2421
  this,
2218
- 'dependencies',
2422
+ 'authLogicsForCallInterface',
2219
2423
  );
2220
2424
  }
2221
- this.dependencies.splice(index, 0, connector);
2222
- return connector;
2425
+ this.authLogicsForCallInterface.splice(index, 0, authLogicForCallInterface);
2426
+ return authLogicForCallInterface;
2223
2427
  }
2224
2428
 
2225
2429
  /**
2226
- * 插入连接器
2227
- * @param name 连接器名称,如果不填会自动生成一个唯一名称
2430
+ * 插入调用接口的鉴权逻辑
2431
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2228
2432
  */
2229
- insertConnectorInDependenciesAt(name: string, index: number): Connector;
2433
+ insertAuthLogicForCallInterfaceAt(name: string, index: number): AuthLogicForCallInterface;
2230
2434
 
2231
2435
  /**
2232
- * 插入连接器
2233
- * @param connectorOptions 连接器参数
2436
+ * 插入调用接口的鉴权逻辑
2437
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2234
2438
  */
2235
- insertConnectorInDependenciesAt(connectorOptions: Partial<Connector>, index: number): Connector;
2439
+ insertAuthLogicForCallInterfaceAt(
2440
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2441
+ index: number,
2442
+ ): AuthLogicForCallInterface;
2236
2443
 
2237
2444
  /**
2238
- * 插入连接器
2239
- * @param connector 已有的连接器实例
2445
+ * 插入调用接口的鉴权逻辑
2446
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2240
2447
  */
2241
- insertConnectorInDependenciesAt(connector: Connector, index: number): Connector;
2448
+ insertAuthLogicForCallInterfaceAt(
2449
+ authLogicForCallInterface: AuthLogicForCallInterface,
2450
+ index: number,
2451
+ ): AuthLogicForCallInterface;
2242
2452
 
2243
- insertConnectorInDependenciesAt(options: string | Partial<Connector> | Connector, index: number) {
2244
- const node = this._insertConnectorInDependenciesAt(options as any, index);
2453
+ insertAuthLogicForCallInterfaceAt(
2454
+ options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
2455
+ index: number,
2456
+ ) {
2457
+ const node = this._insertAuthLogicForCallInterfaceAt(options as any, index);
2245
2458
  node.create({
2246
2459
  index,
2247
2460
  parentNode: this,
2248
- parentKey: 'dependencies',
2461
+ parentKey: 'authLogicsForCallInterface',
2249
2462
  });
2250
2463
  return node;
2251
2464
  }
2252
2465
 
2253
2466
  /**
2254
- * 添加连接器
2467
+ * 添加调用接口的鉴权逻辑
2255
2468
  * @internal
2256
- * @param name 连接器名称,如果不填会自动生成一个唯一名称
2469
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2257
2470
  */
2258
- _addConnectorInDependencies(name?: string): Connector;
2471
+ _addAuthLogicForCallInterface(name?: string): AuthLogicForCallInterface;
2259
2472
 
2260
2473
  /**
2261
- * 添加连接器
2474
+ * 添加调用接口的鉴权逻辑
2262
2475
  * @internal
2263
- * @param connectorOptions 连接器参数
2476
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2264
2477
  */
2265
- _addConnectorInDependencies(connectorOptions: Partial<Connector>): Connector;
2478
+ _addAuthLogicForCallInterface(
2479
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2480
+ ): AuthLogicForCallInterface;
2266
2481
 
2267
2482
  /**
2268
- * 添加连接器
2483
+ * 添加调用接口的鉴权逻辑
2269
2484
  * @internal
2270
- * @param connector 已有的连接器实例
2485
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2271
2486
  */
2272
- _addConnectorInDependencies(connector: Connector): Connector;
2487
+ _addAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): AuthLogicForCallInterface;
2273
2488
 
2274
- _addConnectorInDependencies(options?: string | Partial<Connector> | Connector) {
2275
- const index = this.dependencies.length;
2276
- return this._insertConnectorInDependenciesAt(options as any, index);
2489
+ _addAuthLogicForCallInterface(options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface) {
2490
+ const index = this.authLogicsForCallInterface.length;
2491
+ return this._insertAuthLogicForCallInterfaceAt(options as any, index);
2277
2492
  }
2278
2493
 
2279
2494
  /**
2280
- * 添加连接器
2495
+ * 添加调用接口的鉴权逻辑
2281
2496
  * @internal
2282
- * @param name 连接器名称,如果不填会自动生成一个唯一名称
2497
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2283
2498
  */
2284
- addConnectorInDependencies(name?: string): Connector;
2499
+ addAuthLogicForCallInterface(name?: string): AuthLogicForCallInterface;
2285
2500
 
2286
2501
  /**
2287
- * 添加连接器
2288
- * @param connectorOptions 连接器参数
2502
+ * 添加调用接口的鉴权逻辑
2503
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2289
2504
  */
2290
- addConnectorInDependencies(connectorOptions: Partial<Connector>): Connector;
2505
+ addAuthLogicForCallInterface(
2506
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2507
+ ): AuthLogicForCallInterface;
2291
2508
 
2292
2509
  /**
2293
- * 添加连接器
2294
- * @param connector 已有的连接器实例
2510
+ * 添加调用接口的鉴权逻辑
2511
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2295
2512
  */
2296
- addConnectorInDependencies(connector: Connector): Connector;
2513
+ addAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): AuthLogicForCallInterface;
2297
2514
 
2298
- addConnectorInDependencies(options?: string | Partial<Connector> | Connector) {
2299
- const node = this._addConnectorInDependencies(options as any);
2300
- const index = this.dependencies.indexOf(node);
2515
+ addAuthLogicForCallInterface(options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface) {
2516
+ const node = this._addAuthLogicForCallInterface(options as any);
2517
+ const index = this.authLogicsForCallInterface.indexOf(node);
2301
2518
  node.create({
2302
2519
  index,
2303
2520
  parentNode: this,
2304
- parentKey: 'dependencies',
2521
+ parentKey: 'authLogicsForCallInterface',
2305
2522
  });
2306
2523
  return node;
2307
2524
  }
2308
2525
 
2526
+ getConnectionExistingNames(excludedList: Array<Connection> = []) {
2527
+ const excludedSet = new Set(excludedList);
2528
+ return ((this.connections as Connection[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
2529
+ }
2530
+ getConnectionUniqueName(name = 'connection1') {
2531
+ return utils.unique(name, this.getConnectionExistingNames(), undefined, false);
2532
+ }
2533
+
2309
2534
  /**
2310
- * 插入模块
2535
+ * 插入连接
2311
2536
  * @internal
2312
- * @param name 模块名称,如果不填会自动生成一个唯一名称
2537
+ * @param name 连接名称,如果不填会自动生成一个唯一名称
2313
2538
  */
2314
- _insertModuleInInterfaceDependenciesAt(name: string, index: number): Module;
2539
+ _insertConnectionAt(name: string, index: number): Connection;
2315
2540
 
2316
2541
  /**
2317
- * 插入模块
2542
+ * 插入连接
2318
2543
  * @internal
2319
- * @param moduleOptions 模块参数
2544
+ * @param connectionOptions 连接参数
2320
2545
  */
2321
- _insertModuleInInterfaceDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
2546
+ _insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
2322
2547
 
2323
2548
  /**
2324
- * 插入模块
2549
+ * 插入连接
2325
2550
  * @internal
2326
- * @param module 已有的模块实例
2551
+ * @param connection 已有的连接实例
2327
2552
  */
2328
- _insertModuleInInterfaceDependenciesAt(module: Module, index: number): Module;
2553
+ _insertConnectionAt(connection: Connection, index: number): Connection;
2329
2554
 
2330
- _insertModuleInInterfaceDependenciesAt(options: string | Partial<Module> | Module, index: number) {
2331
- const moduleOptions: any = {};
2332
- const relationOptions = { parentNode: this, parentKey: 'interfaceDependencies' };
2333
- let module: Module;
2555
+ _insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
2556
+ const connectionOptions: any = {};
2557
+ const relationOptions = { parentNode: this, parentKey: 'connections' };
2558
+ let connection: Connection;
2334
2559
  if (!options) {
2335
- module = Module.from(
2560
+ connection = Connection.from(
2336
2561
  {
2337
- ...moduleOptions,
2338
- name: this.getModuleUniqueName(),
2562
+ ...connectionOptions,
2563
+ name: this.getConnectionUniqueName(),
2339
2564
  },
2340
2565
  this,
2341
- 'interfaceDependencies',
2566
+ 'connections',
2342
2567
  );
2343
2568
  } else if (typeof options === 'string') {
2344
- module = Module.from(
2569
+ connection = Connection.from(
2345
2570
  {
2346
- ...moduleOptions,
2571
+ ...connectionOptions,
2347
2572
  name: options,
2348
2573
  },
2349
2574
  this,
2350
- 'interfaceDependencies',
2575
+ 'connections',
2351
2576
  );
2352
- } else if (options instanceof Module) {
2577
+ } else if (options instanceof Connection) {
2353
2578
  options.ensureDelete(); // 同一实例不支持多处存在
2354
- module = options;
2355
- Object.assign(module, relationOptions);
2579
+ connection = options;
2580
+ Object.assign(connection, relationOptions);
2356
2581
  } else {
2357
- module = Module.from(
2582
+ connection = Connection.from(
2358
2583
  {
2359
- ...moduleOptions,
2584
+ ...connectionOptions,
2360
2585
  ...options,
2361
2586
  },
2362
2587
  this,
2363
- 'interfaceDependencies',
2588
+ 'connections',
2364
2589
  );
2365
2590
  }
2366
- this.interfaceDependencies.splice(index, 0, module);
2367
- return module;
2591
+ this.connections.splice(index, 0, connection);
2592
+ return connection;
2368
2593
  }
2369
2594
 
2370
2595
  /**
2371
- * 插入模块
2372
- * @param name 模块名称,如果不填会自动生成一个唯一名称
2596
+ * 插入连接
2597
+ * @param name 连接名称,如果不填会自动生成一个唯一名称
2373
2598
  */
2374
- insertModuleInInterfaceDependenciesAt(name: string, index: number): Module;
2599
+ insertConnectionAt(name: string, index: number): Connection;
2375
2600
 
2376
2601
  /**
2377
- * 插入模块
2378
- * @param moduleOptions 模块参数
2602
+ * 插入连接
2603
+ * @param connectionOptions 连接参数
2379
2604
  */
2380
- insertModuleInInterfaceDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
2605
+ insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
2381
2606
 
2382
2607
  /**
2383
- * 插入模块
2384
- * @param module 已有的模块实例
2608
+ * 插入连接
2609
+ * @param connection 已有的连接实例
2385
2610
  */
2386
- insertModuleInInterfaceDependenciesAt(module: Module, index: number): Module;
2611
+ insertConnectionAt(connection: Connection, index: number): Connection;
2387
2612
 
2388
- insertModuleInInterfaceDependenciesAt(options: string | Partial<Module> | Module, index: number) {
2389
- const node = this._insertModuleInInterfaceDependenciesAt(options as any, index);
2613
+ insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
2614
+ const node = this._insertConnectionAt(options as any, index);
2390
2615
  node.create({
2391
2616
  index,
2392
2617
  parentNode: this,
2393
- parentKey: 'interfaceDependencies',
2618
+ parentKey: 'connections',
2394
2619
  });
2395
2620
  return node;
2396
2621
  }
2397
2622
 
2398
2623
  /**
2399
- * 添加模块
2624
+ * 添加连接
2400
2625
  * @internal
2401
- * @param name 模块名称,如果不填会自动生成一个唯一名称
2626
+ * @param name 连接名称,如果不填会自动生成一个唯一名称
2402
2627
  */
2403
- _addModuleInInterfaceDependencies(name?: string): Module;
2628
+ _addConnection(name?: string): Connection;
2404
2629
 
2405
2630
  /**
2406
- * 添加模块
2631
+ * 添加连接
2407
2632
  * @internal
2408
- * @param moduleOptions 模块参数
2633
+ * @param connectionOptions 连接参数
2409
2634
  */
2410
- _addModuleInInterfaceDependencies(moduleOptions: Partial<Module>): Module;
2635
+ _addConnection(connectionOptions: Partial<Connection>): Connection;
2411
2636
 
2412
2637
  /**
2413
- * 添加模块
2638
+ * 添加连接
2414
2639
  * @internal
2415
- * @param module 已有的模块实例
2640
+ * @param connection 已有的连接实例
2416
2641
  */
2417
- _addModuleInInterfaceDependencies(module: Module): Module;
2642
+ _addConnection(connection: Connection): Connection;
2418
2643
 
2419
- _addModuleInInterfaceDependencies(options?: string | Partial<Module> | Module) {
2420
- const index = this.interfaceDependencies.length;
2421
- return this._insertModuleInInterfaceDependenciesAt(options as any, index);
2644
+ _addConnection(options?: string | Partial<Connection> | Connection) {
2645
+ const index = this.connections.length;
2646
+ return this._insertConnectionAt(options as any, index);
2422
2647
  }
2423
2648
 
2424
2649
  /**
2425
- * 添加模块
2650
+ * 添加连接
2426
2651
  * @internal
2427
- * @param name 模块名称,如果不填会自动生成一个唯一名称
2652
+ * @param name 连接名称,如果不填会自动生成一个唯一名称
2428
2653
  */
2429
- addModuleInInterfaceDependencies(name?: string): Module;
2654
+ addConnection(name?: string): Connection;
2430
2655
 
2431
2656
  /**
2432
- * 添加模块
2433
- * @param moduleOptions 模块参数
2657
+ * 添加连接
2658
+ * @param connectionOptions 连接参数
2434
2659
  */
2435
- addModuleInInterfaceDependencies(moduleOptions: Partial<Module>): Module;
2660
+ addConnection(connectionOptions: Partial<Connection>): Connection;
2436
2661
 
2437
2662
  /**
2438
- * 添加模块
2439
- * @param module 已有的模块实例
2663
+ * 添加连接
2664
+ * @param connection 已有的连接实例
2440
2665
  */
2441
- addModuleInInterfaceDependencies(module: Module): Module;
2666
+ addConnection(connection: Connection): Connection;
2442
2667
 
2443
- addModuleInInterfaceDependencies(options?: string | Partial<Module> | Module) {
2444
- const node = this._addModuleInInterfaceDependencies(options as any);
2445
- const index = this.interfaceDependencies.indexOf(node);
2668
+ addConnection(options?: string | Partial<Connection> | Connection) {
2669
+ const node = this._addConnection(options as any);
2670
+ const index = this.connections.indexOf(node);
2446
2671
  node.create({
2447
2672
  index,
2448
2673
  parentNode: this,
2449
- parentKey: 'interfaceDependencies',
2674
+ parentKey: 'connections',
2450
2675
  });
2451
2676
  return node;
2452
2677
  }
2453
2678
 
2454
- getAuthLogicForCallInterfaceExistingNames(excludedList: Array<AuthLogicForCallInterface> = []) {
2679
+ getTriggerLauncherExistingNames(excludedList: Array<TriggerLauncher> = []) {
2455
2680
  const excludedSet = new Set(excludedList);
2456
- return ((this.authLogicsForCallInterface as AuthLogicForCallInterface[]) || [])
2681
+ return ((this.triggerLaunchers as TriggerLauncher[]) || [])
2457
2682
  .filter((item) => !excludedSet.has(item))
2458
2683
  .map((item) => item.name);
2459
2684
  }
2460
- getAuthLogicForCallInterfaceUniqueName(name = 'authLogicForCallInterface1') {
2461
- return utils.unique(name, this.getAuthLogicForCallInterfaceExistingNames(), undefined, false);
2685
+ getTriggerLauncherUniqueName(name = 'triggerLauncher1') {
2686
+ return utils.unique(name, this.getTriggerLauncherExistingNames(), undefined, false);
2462
2687
  }
2463
2688
 
2464
2689
  /**
2465
- * 插入调用接口的鉴权逻辑
2690
+ * 插入触发器启动器
2466
2691
  * @internal
2467
- * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2692
+ * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2468
2693
  */
2469
- _insertAuthLogicForCallInterfaceAt(name: string, index: number): AuthLogicForCallInterface;
2694
+ _insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
2470
2695
 
2471
2696
  /**
2472
- * 插入调用接口的鉴权逻辑
2697
+ * 插入触发器启动器
2473
2698
  * @internal
2474
- * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2699
+ * @param triggerLauncherOptions 触发器启动器参数
2475
2700
  */
2476
- _insertAuthLogicForCallInterfaceAt(
2477
- authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2478
- index: number,
2479
- ): AuthLogicForCallInterface;
2701
+ _insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
2480
2702
 
2481
2703
  /**
2482
- * 插入调用接口的鉴权逻辑
2704
+ * 插入触发器启动器
2483
2705
  * @internal
2484
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2706
+ * @param triggerLauncher 已有的触发器启动器实例
2485
2707
  */
2486
- _insertAuthLogicForCallInterfaceAt(
2487
- authLogicForCallInterface: AuthLogicForCallInterface,
2488
- index: number,
2489
- ): AuthLogicForCallInterface;
2708
+ _insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
2490
2709
 
2491
- _insertAuthLogicForCallInterfaceAt(
2492
- options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
2493
- index: number,
2494
- ) {
2495
- const authLogicForCallInterfaceOptions: any = {};
2496
- const relationOptions = { parentNode: this, parentKey: 'authLogicsForCallInterface' };
2497
- let authLogicForCallInterface: AuthLogicForCallInterface;
2710
+ _insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
2711
+ const triggerLauncherOptions: any = {};
2712
+ const relationOptions = { parentNode: this, parentKey: 'triggerLaunchers' };
2713
+ let triggerLauncher: TriggerLauncher;
2498
2714
  if (!options) {
2499
- authLogicForCallInterface = AuthLogicForCallInterface.from(
2715
+ triggerLauncher = TriggerLauncher.from(
2500
2716
  {
2501
- ...authLogicForCallInterfaceOptions,
2502
- name: this.getAuthLogicForCallInterfaceUniqueName(),
2717
+ ...triggerLauncherOptions,
2718
+ name: this.getTriggerLauncherUniqueName(),
2503
2719
  },
2504
2720
  this,
2505
- 'authLogicsForCallInterface',
2721
+ 'triggerLaunchers',
2506
2722
  );
2507
2723
  } else if (typeof options === 'string') {
2508
- authLogicForCallInterface = AuthLogicForCallInterface.from(
2724
+ triggerLauncher = TriggerLauncher.from(
2509
2725
  {
2510
- ...authLogicForCallInterfaceOptions,
2726
+ ...triggerLauncherOptions,
2511
2727
  name: options,
2512
2728
  },
2513
2729
  this,
2514
- 'authLogicsForCallInterface',
2730
+ 'triggerLaunchers',
2515
2731
  );
2516
- } else if (options instanceof AuthLogicForCallInterface) {
2732
+ } else if (options instanceof TriggerLauncher) {
2517
2733
  options.ensureDelete(); // 同一实例不支持多处存在
2518
- authLogicForCallInterface = options;
2519
- Object.assign(authLogicForCallInterface, relationOptions);
2734
+ triggerLauncher = options;
2735
+ Object.assign(triggerLauncher, relationOptions);
2520
2736
  } else {
2521
- authLogicForCallInterface = AuthLogicForCallInterface.from(
2737
+ triggerLauncher = TriggerLauncher.from(
2522
2738
  {
2523
- ...authLogicForCallInterfaceOptions,
2739
+ ...triggerLauncherOptions,
2524
2740
  ...options,
2525
2741
  },
2526
2742
  this,
2527
- 'authLogicsForCallInterface',
2743
+ 'triggerLaunchers',
2528
2744
  );
2529
2745
  }
2530
- this.authLogicsForCallInterface.splice(index, 0, authLogicForCallInterface);
2531
- return authLogicForCallInterface;
2746
+ this.triggerLaunchers.splice(index, 0, triggerLauncher);
2747
+ return triggerLauncher;
2532
2748
  }
2533
2749
 
2534
2750
  /**
2535
- * 插入调用接口的鉴权逻辑
2536
- * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2751
+ * 插入触发器启动器
2752
+ * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2537
2753
  */
2538
- insertAuthLogicForCallInterfaceAt(name: string, index: number): AuthLogicForCallInterface;
2754
+ insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
2539
2755
 
2540
2756
  /**
2541
- * 插入调用接口的鉴权逻辑
2542
- * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2757
+ * 插入触发器启动器
2758
+ * @param triggerLauncherOptions 触发器启动器参数
2543
2759
  */
2544
- insertAuthLogicForCallInterfaceAt(
2545
- authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2546
- index: number,
2547
- ): AuthLogicForCallInterface;
2760
+ insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
2548
2761
 
2549
2762
  /**
2550
- * 插入调用接口的鉴权逻辑
2551
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2763
+ * 插入触发器启动器
2764
+ * @param triggerLauncher 已有的触发器启动器实例
2552
2765
  */
2553
- insertAuthLogicForCallInterfaceAt(
2554
- authLogicForCallInterface: AuthLogicForCallInterface,
2555
- index: number,
2556
- ): AuthLogicForCallInterface;
2766
+ insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
2557
2767
 
2558
- insertAuthLogicForCallInterfaceAt(
2559
- options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
2560
- index: number,
2561
- ) {
2562
- const node = this._insertAuthLogicForCallInterfaceAt(options as any, index);
2768
+ insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
2769
+ const node = this._insertTriggerLauncherAt(options as any, index);
2563
2770
  node.create({
2564
2771
  index,
2565
2772
  parentNode: this,
2566
- parentKey: 'authLogicsForCallInterface',
2773
+ parentKey: 'triggerLaunchers',
2567
2774
  });
2568
2775
  return node;
2569
2776
  }
2570
2777
 
2571
2778
  /**
2572
- * 添加调用接口的鉴权逻辑
2779
+ * 添加触发器启动器
2573
2780
  * @internal
2574
- * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2781
+ * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2575
2782
  */
2576
- _addAuthLogicForCallInterface(name?: string): AuthLogicForCallInterface;
2783
+ _addTriggerLauncher(name?: string): TriggerLauncher;
2577
2784
 
2578
2785
  /**
2579
- * 添加调用接口的鉴权逻辑
2786
+ * 添加触发器启动器
2580
2787
  * @internal
2581
- * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2788
+ * @param triggerLauncherOptions 触发器启动器参数
2582
2789
  */
2583
- _addAuthLogicForCallInterface(
2584
- authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2585
- ): AuthLogicForCallInterface;
2790
+ _addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
2586
2791
 
2587
2792
  /**
2588
- * 添加调用接口的鉴权逻辑
2793
+ * 添加触发器启动器
2589
2794
  * @internal
2590
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2795
+ * @param triggerLauncher 已有的触发器启动器实例
2591
2796
  */
2592
- _addAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): AuthLogicForCallInterface;
2797
+ _addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
2593
2798
 
2594
- _addAuthLogicForCallInterface(options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface) {
2595
- const index = this.authLogicsForCallInterface.length;
2596
- return this._insertAuthLogicForCallInterfaceAt(options as any, index);
2799
+ _addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
2800
+ const index = this.triggerLaunchers.length;
2801
+ return this._insertTriggerLauncherAt(options as any, index);
2597
2802
  }
2598
2803
 
2599
2804
  /**
2600
- * 添加调用接口的鉴权逻辑
2805
+ * 添加触发器启动器
2601
2806
  * @internal
2602
- * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2807
+ * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2603
2808
  */
2604
- addAuthLogicForCallInterface(name?: string): AuthLogicForCallInterface;
2809
+ addTriggerLauncher(name?: string): TriggerLauncher;
2605
2810
 
2606
2811
  /**
2607
- * 添加调用接口的鉴权逻辑
2608
- * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2812
+ * 添加触发器启动器
2813
+ * @param triggerLauncherOptions 触发器启动器参数
2609
2814
  */
2610
- addAuthLogicForCallInterface(
2611
- authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2612
- ): AuthLogicForCallInterface;
2815
+ addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
2613
2816
 
2614
2817
  /**
2615
- * 添加调用接口的鉴权逻辑
2616
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2818
+ * 添加触发器启动器
2819
+ * @param triggerLauncher 已有的触发器启动器实例
2617
2820
  */
2618
- addAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): AuthLogicForCallInterface;
2821
+ addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
2619
2822
 
2620
- addAuthLogicForCallInterface(options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface) {
2621
- const node = this._addAuthLogicForCallInterface(options as any);
2622
- const index = this.authLogicsForCallInterface.indexOf(node);
2823
+ addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
2824
+ const node = this._addTriggerLauncher(options as any);
2825
+ const index = this.triggerLaunchers.indexOf(node);
2623
2826
  node.create({
2624
2827
  index,
2625
2828
  parentNode: this,
2626
- parentKey: 'authLogicsForCallInterface',
2829
+ parentKey: 'triggerLaunchers',
2627
2830
  });
2628
2831
  return node;
2629
2832
  }
2630
2833
 
2631
- getConnectionExistingNames(excludedList: Array<Connection> = []) {
2632
- const excludedSet = new Set(excludedList);
2633
- return ((this.connections as Connection[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
2634
- }
2635
- getConnectionUniqueName(name = 'connection1') {
2636
- return utils.unique(name, this.getConnectionExistingNames(), undefined, false);
2637
- }
2638
-
2639
- /**
2640
- * 插入连接
2641
- * @internal
2642
- * @param name 连接名称,如果不填会自动生成一个唯一名称
2643
- */
2644
- _insertConnectionAt(name: string, index: number): Connection;
2645
-
2646
2834
  /**
2647
- * 插入连接
2648
- * @internal
2649
- * @param connectionOptions 连接参数
2835
+ * 删除数据源
2836
+ * @param name 数据源名称
2650
2837
  */
2651
- _insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
2838
+ removeDataSource(name: string): void;
2652
2839
 
2653
2840
  /**
2654
- * 插入连接
2655
- * @internal
2656
- * @param connection 已有的连接实例
2841
+ * 删除数据源
2842
+ * @param dataSource 已有的数据源实例
2657
2843
  */
2658
- _insertConnectionAt(connection: Connection, index: number): Connection;
2844
+ removeDataSource(dataSource: DataSource): void;
2659
2845
 
2660
- _insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
2661
- const connectionOptions: any = {};
2662
- const relationOptions = { parentNode: this, parentKey: 'connections' };
2663
- let connection: Connection;
2664
- if (!options) {
2665
- connection = Connection.from(
2666
- {
2667
- ...connectionOptions,
2668
- name: this.getConnectionUniqueName(),
2669
- },
2670
- this,
2671
- 'connections',
2672
- );
2673
- } else if (typeof options === 'string') {
2674
- connection = Connection.from(
2675
- {
2676
- ...connectionOptions,
2677
- name: options,
2678
- },
2679
- this,
2680
- 'connections',
2681
- );
2682
- } else if (options instanceof Connection) {
2683
- options.ensureDelete(); // 同一实例不支持多处存在
2684
- connection = options;
2685
- Object.assign(connection, relationOptions);
2846
+ removeDataSource(options: string | DataSource) {
2847
+ let dataSource: DataSource;
2848
+ if (typeof options === 'string') {
2849
+ dataSource = (this.dataSources as DataSource[]).find((item) => item.name === options);
2850
+ if (!dataSource) {
2851
+ throw new Error('找不到数据源 ' + options);
2852
+ }
2686
2853
  } else {
2687
- connection = Connection.from(
2688
- {
2689
- ...connectionOptions,
2690
- ...options,
2691
- },
2692
- this,
2693
- 'connections',
2694
- );
2854
+ dataSource = options;
2695
2855
  }
2696
- this.connections.splice(index, 0, connection);
2697
- return connection;
2856
+ return dataSource.delete();
2698
2857
  }
2699
2858
 
2700
- /**
2701
- * 插入连接
2702
- * @param name 连接名称,如果不填会自动生成一个唯一名称
2703
- */
2704
- insertConnectionAt(name: string, index: number): Connection;
2859
+ __removeDataSource(dataSource: DataSource) {
2860
+ const parentKey = dataSource.parentKey;
2861
+ const params: Params = {
2862
+ parentNode: this,
2863
+ parentKey,
2864
+ index: -1,
2865
+ object: null,
2866
+ oldObject: dataSource,
2867
+ };
2868
+ if (parentKey) {
2869
+ params.parentKey = parentKey;
2870
+ // @ts-ignore
2871
+ const t = this.__v_raw || this;
2872
+ // @ts-ignore
2873
+ const n = dataSource.__v_raw || dataSource;
2874
+ if (Array.isArray((t as any)[parentKey])) {
2875
+ // @ts-ignore
2876
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
2877
+ ~index && (this as any)[parentKey].splice(index, 1);
2878
+ params.index = index;
2879
+ } else if ((t as any)[parentKey] === n) {
2880
+ params.index = 0;
2881
+ (this as any)[parentKey] = undefined;
2882
+ }
2883
+ }
2884
+ return params;
2885
+ }
2705
2886
 
2706
2887
  /**
2707
- * 插入连接
2708
- * @param connectionOptions 连接参数
2888
+ * 删除数据结构
2889
+ * @param name 数据结构名称
2709
2890
  */
2710
- insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
2891
+ removeStructure(name: string): void;
2711
2892
 
2712
2893
  /**
2713
- * 插入连接
2714
- * @param connection 已有的连接实例
2894
+ * 删除数据结构
2895
+ * @param structure 已有的数据结构实例
2715
2896
  */
2716
- insertConnectionAt(connection: Connection, index: number): Connection;
2897
+ removeStructure(structure: Structure): void;
2717
2898
 
2718
- insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
2719
- const node = this._insertConnectionAt(options as any, index);
2720
- node.create({
2721
- index,
2899
+ removeStructure(options: string | Structure) {
2900
+ let structure: Structure;
2901
+ if (typeof options === 'string') {
2902
+ structure = (this.structures as Structure[]).find((item) => item.name === options);
2903
+ if (!structure) {
2904
+ throw new Error('找不到数据结构 ' + options);
2905
+ }
2906
+ } else {
2907
+ structure = options;
2908
+ }
2909
+ return structure.delete();
2910
+ }
2911
+
2912
+ __removeStructure(structure: Structure) {
2913
+ const parentKey = structure.parentKey;
2914
+ const params: Params = {
2722
2915
  parentNode: this,
2723
- parentKey: 'connections',
2724
- });
2725
- return node;
2916
+ parentKey,
2917
+ index: -1,
2918
+ object: null,
2919
+ oldObject: structure,
2920
+ };
2921
+ if (parentKey) {
2922
+ params.parentKey = parentKey;
2923
+ // @ts-ignore
2924
+ const t = this.__v_raw || this;
2925
+ // @ts-ignore
2926
+ const n = structure.__v_raw || structure;
2927
+ if (Array.isArray((t as any)[parentKey])) {
2928
+ // @ts-ignore
2929
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
2930
+ ~index && (this as any)[parentKey].splice(index, 1);
2931
+ params.index = index;
2932
+ } else if ((t as any)[parentKey] === n) {
2933
+ params.index = 0;
2934
+ (this as any)[parentKey] = undefined;
2935
+ }
2936
+ }
2937
+ return params;
2726
2938
  }
2727
2939
 
2728
2940
  /**
2729
- * 添加连接
2730
- * @internal
2731
- * @param name 连接名称,如果不填会自动生成一个唯一名称
2941
+ * 删除枚举
2942
+ * @param name 枚举名称
2732
2943
  */
2733
- _addConnection(name?: string): Connection;
2734
-
2735
- /**
2736
- * 添加连接
2737
- * @internal
2738
- * @param connectionOptions 连接参数
2739
- */
2740
- _addConnection(connectionOptions: Partial<Connection>): Connection;
2944
+ removeEnum(name: string): void;
2741
2945
 
2742
2946
  /**
2743
- * 添加连接
2744
- * @internal
2745
- * @param connection 已有的连接实例
2947
+ * 删除枚举
2948
+ * @param enumeration 已有的枚举实例
2746
2949
  */
2747
- _addConnection(connection: Connection): Connection;
2950
+ removeEnum(enumeration: Enum): void;
2748
2951
 
2749
- _addConnection(options?: string | Partial<Connection> | Connection) {
2750
- const index = this.connections.length;
2751
- return this._insertConnectionAt(options as any, index);
2952
+ removeEnum(options: string | Enum) {
2953
+ let enumeration: Enum;
2954
+ if (typeof options === 'string') {
2955
+ enumeration = (this.enums as Enum[]).find((item) => item.name === options);
2956
+ if (!enumeration) {
2957
+ throw new Error('找不到枚举 ' + options);
2958
+ }
2959
+ } else {
2960
+ enumeration = options;
2961
+ }
2962
+ return enumeration.delete();
2752
2963
  }
2753
2964
 
2754
- /**
2755
- * 添加连接
2756
- * @internal
2757
- * @param name 连接名称,如果不填会自动生成一个唯一名称
2758
- */
2759
- addConnection(name?: string): Connection;
2965
+ __removeEnum(enumeration: Enum) {
2966
+ const parentKey = enumeration.parentKey;
2967
+ const params: Params = {
2968
+ parentNode: this,
2969
+ parentKey,
2970
+ index: -1,
2971
+ object: null,
2972
+ oldObject: enumeration,
2973
+ };
2974
+ if (parentKey) {
2975
+ params.parentKey = parentKey;
2976
+ // @ts-ignore
2977
+ const t = this.__v_raw || this;
2978
+ // @ts-ignore
2979
+ const n = enumeration.__v_raw || enumeration;
2980
+ if (Array.isArray((t as any)[parentKey])) {
2981
+ // @ts-ignore
2982
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
2983
+ ~index && (this as any)[parentKey].splice(index, 1);
2984
+ params.index = index;
2985
+ } else if ((t as any)[parentKey] === n) {
2986
+ params.index = 0;
2987
+ (this as any)[parentKey] = undefined;
2988
+ }
2989
+ }
2990
+ return params;
2991
+ }
2760
2992
 
2761
2993
  /**
2762
- * 添加连接
2763
- * @param connectionOptions 连接参数
2994
+ * 删除逻辑
2995
+ * @param name 逻辑名称
2764
2996
  */
2765
- addConnection(connectionOptions: Partial<Connection>): Connection;
2997
+ removeLogic(name: string): void;
2766
2998
 
2767
2999
  /**
2768
- * 添加连接
2769
- * @param connection 已有的连接实例
3000
+ * 删除逻辑
3001
+ * @param logic 已有的逻辑实例
2770
3002
  */
2771
- addConnection(connection: Connection): Connection;
2772
-
2773
- addConnection(options?: string | Partial<Connection> | Connection) {
2774
- const node = this._addConnection(options as any);
2775
- const index = this.connections.indexOf(node);
2776
- node.create({
2777
- index,
2778
- parentNode: this,
2779
- parentKey: 'connections',
2780
- });
2781
- return node;
2782
- }
3003
+ removeLogic(logic: Logic): void;
2783
3004
 
2784
- getTriggerLauncherExistingNames(excludedList: Array<TriggerLauncher> = []) {
2785
- const excludedSet = new Set(excludedList);
2786
- return ((this.triggerLaunchers as TriggerLauncher[]) || [])
2787
- .filter((item) => !excludedSet.has(item))
2788
- .map((item) => item.name);
2789
- }
2790
- getTriggerLauncherUniqueName(name = 'triggerLauncher1') {
2791
- return utils.unique(name, this.getTriggerLauncherExistingNames(), undefined, false);
3005
+ removeLogic(options: string | Logic) {
3006
+ let logic: Logic;
3007
+ if (typeof options === 'string') {
3008
+ logic = (this.logics as Logic[]).find((item) => item.name === options);
3009
+ if (!logic) {
3010
+ throw new Error('找不到逻辑 ' + options);
3011
+ }
3012
+ } else {
3013
+ logic = options;
3014
+ }
3015
+ return logic.delete();
2792
3016
  }
2793
3017
 
2794
3018
  /**
2795
- * 插入触发器启动器
2796
- * @internal
2797
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2798
- */
2799
- _insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
2800
-
2801
- /**
2802
- * 插入触发器启动器
2803
- * @internal
2804
- * @param triggerLauncherOptions 触发器启动器参数
3019
+ * 删除鉴权逻辑
3020
+ * @param name 鉴权逻辑名称
2805
3021
  */
2806
- _insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
3022
+ removeAuthLogicInAuthLogics(name: string): void;
2807
3023
 
2808
3024
  /**
2809
- * 插入触发器启动器
2810
- * @internal
2811
- * @param triggerLauncher 已有的触发器启动器实例
3025
+ * 删除鉴权逻辑
3026
+ * @param authLogic 已有的鉴权逻辑实例
2812
3027
  */
2813
- _insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
3028
+ removeAuthLogicInAuthLogics(authLogic: AuthLogic): void;
2814
3029
 
2815
- _insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
2816
- const triggerLauncherOptions: any = {};
2817
- const relationOptions = { parentNode: this, parentKey: 'triggerLaunchers' };
2818
- let triggerLauncher: TriggerLauncher;
2819
- if (!options) {
2820
- triggerLauncher = TriggerLauncher.from(
2821
- {
2822
- ...triggerLauncherOptions,
2823
- name: this.getTriggerLauncherUniqueName(),
2824
- },
2825
- this,
2826
- 'triggerLaunchers',
2827
- );
2828
- } else if (typeof options === 'string') {
2829
- triggerLauncher = TriggerLauncher.from(
2830
- {
2831
- ...triggerLauncherOptions,
2832
- name: options,
2833
- },
2834
- this,
2835
- 'triggerLaunchers',
2836
- );
2837
- } else if (options instanceof TriggerLauncher) {
2838
- options.ensureDelete(); // 同一实例不支持多处存在
2839
- triggerLauncher = options;
2840
- Object.assign(triggerLauncher, relationOptions);
3030
+ removeAuthLogicInAuthLogics(options: string | AuthLogic) {
3031
+ let authLogic: AuthLogic;
3032
+ if (typeof options === 'string') {
3033
+ authLogic = (this.authLogics as AuthLogic[]).find((item) => item.name === options);
3034
+ if (!authLogic) {
3035
+ throw new Error('找不到鉴权逻辑 ' + options);
3036
+ }
2841
3037
  } else {
2842
- triggerLauncher = TriggerLauncher.from(
2843
- {
2844
- ...triggerLauncherOptions,
2845
- ...options,
2846
- },
2847
- this,
2848
- 'triggerLaunchers',
2849
- );
3038
+ authLogic = options;
2850
3039
  }
2851
- this.triggerLaunchers.splice(index, 0, triggerLauncher);
2852
- return triggerLauncher;
3040
+ return authLogic.delete();
2853
3041
  }
2854
3042
 
2855
3043
  /**
2856
- * 插入触发器启动器
2857
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
3044
+ * 删除调用接口的鉴权逻辑
3045
+ * @param name 调用接口的鉴权逻辑名称
2858
3046
  */
2859
- insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
3047
+ removeAuthLogicForCallInterfaceInAuthLogicsForCallInterface(name: string): void;
2860
3048
 
2861
3049
  /**
2862
- * 插入触发器启动器
2863
- * @param triggerLauncherOptions 触发器启动器参数
3050
+ * 删除调用接口的鉴权逻辑
3051
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2864
3052
  */
2865
- insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
3053
+ removeAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
3054
+ authLogicForCallInterface: AuthLogicForCallInterface,
3055
+ ): void;
2866
3056
 
2867
- /**
2868
- * 插入触发器启动器
2869
- * @param triggerLauncher 已有的触发器启动器实例
2870
- */
2871
- insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
3057
+ removeAuthLogicForCallInterfaceInAuthLogicsForCallInterface(options: string | AuthLogicForCallInterface) {
3058
+ let authLogicForCallInterface: AuthLogicForCallInterface;
3059
+ if (typeof options === 'string') {
3060
+ authLogicForCallInterface = (this.authLogicsForCallInterface as AuthLogicForCallInterface[]).find(
3061
+ (item) => item.name === options,
3062
+ );
3063
+ if (!authLogicForCallInterface) {
3064
+ throw new Error('找不到调用接口的鉴权逻辑 ' + options);
3065
+ }
3066
+ } else {
3067
+ authLogicForCallInterface = options;
3068
+ }
3069
+ return authLogicForCallInterface.delete();
3070
+ }
2872
3071
 
2873
- insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
2874
- const node = this._insertTriggerLauncherAt(options as any, index);
2875
- node.create({
2876
- index,
3072
+ __removeLogic(logic: Logic) {
3073
+ const parentKey = logic.parentKey;
3074
+ const params: Params = {
2877
3075
  parentNode: this,
2878
- parentKey: 'triggerLaunchers',
2879
- });
2880
- return node;
3076
+ parentKey,
3077
+ index: -1,
3078
+ object: null,
3079
+ oldObject: logic,
3080
+ };
3081
+ if (parentKey) {
3082
+ params.parentKey = parentKey;
3083
+ // @ts-ignore
3084
+ const t = this.__v_raw || this;
3085
+ // @ts-ignore
3086
+ const n = logic.__v_raw || logic;
3087
+ if (Array.isArray((t as any)[parentKey])) {
3088
+ // @ts-ignore
3089
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3090
+ ~index && (this as any)[parentKey].splice(index, 1);
3091
+ params.index = index;
3092
+ } else if ((t as any)[parentKey] === n) {
3093
+ params.index = 0;
3094
+ (this as any)[parentKey] = undefined;
3095
+ }
3096
+ }
3097
+ return params;
2881
3098
  }
2882
3099
 
2883
3100
  /**
2884
- * 添加触发器启动器
2885
- * @internal
2886
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2887
- */
2888
- _addTriggerLauncher(name?: string): TriggerLauncher;
2889
-
2890
- /**
2891
- * 添加触发器启动器
2892
- * @internal
2893
- * @param triggerLauncherOptions 触发器启动器参数
3101
+ * 删除覆写逻辑
3102
+ * @param name 覆写逻辑名称
2894
3103
  */
2895
- _addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
3104
+ removeOverriddenLogic(name: string): void;
2896
3105
 
2897
3106
  /**
2898
- * 添加触发器启动器
2899
- * @internal
2900
- * @param triggerLauncher 已有的触发器启动器实例
3107
+ * 删除覆写逻辑
3108
+ * @param overriddenLogic 已有的覆写逻辑实例
2901
3109
  */
2902
- _addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
2903
-
2904
- _addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
2905
- const index = this.triggerLaunchers.length;
2906
- return this._insertTriggerLauncherAt(options as any, index);
2907
- }
3110
+ removeOverriddenLogic(overriddenLogic: OverriddenLogic): void;
2908
3111
 
2909
- /**
2910
- * 添加触发器启动器
2911
- * @internal
2912
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2913
- */
2914
- addTriggerLauncher(name?: string): TriggerLauncher;
2915
-
2916
- /**
2917
- * 添加触发器启动器
2918
- * @param triggerLauncherOptions 触发器启动器参数
2919
- */
2920
- addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
2921
-
2922
- /**
2923
- * 添加触发器启动器
2924
- * @param triggerLauncher 已有的触发器启动器实例
2925
- */
2926
- addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
2927
-
2928
- addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
2929
- const node = this._addTriggerLauncher(options as any);
2930
- const index = this.triggerLaunchers.indexOf(node);
2931
- node.create({
2932
- index,
2933
- parentNode: this,
2934
- parentKey: 'triggerLaunchers',
2935
- });
2936
- return node;
2937
- }
2938
-
2939
- /**
2940
- * 删除数据源
2941
- * @param name 数据源名称
2942
- */
2943
- removeDataSource(name: string): void;
2944
-
2945
- /**
2946
- * 删除数据源
2947
- * @param dataSource 已有的数据源实例
2948
- */
2949
- removeDataSource(dataSource: DataSource): void;
2950
-
2951
- removeDataSource(options: string | DataSource) {
2952
- let dataSource: DataSource;
3112
+ removeOverriddenLogic(options: string | OverriddenLogic) {
3113
+ let overriddenLogic: OverriddenLogic;
2953
3114
  if (typeof options === 'string') {
2954
- dataSource = (this.dataSources as DataSource[]).find((item) => item.name === options);
2955
- if (!dataSource) {
2956
- throw new Error('找不到数据源 ' + options);
3115
+ overriddenLogic = (this.overriddenLogics as OverriddenLogic[]).find((item) => item.name === options);
3116
+ if (!overriddenLogic) {
3117
+ throw new Error('找不到覆写逻辑 ' + options);
2957
3118
  }
2958
3119
  } else {
2959
- dataSource = options;
3120
+ overriddenLogic = options;
2960
3121
  }
2961
- return dataSource.delete();
3122
+ return overriddenLogic.delete();
2962
3123
  }
2963
3124
 
2964
- __removeDataSource(dataSource: DataSource) {
2965
- const parentKey = dataSource.parentKey;
3125
+ __removeOverriddenLogic(overriddenLogic: OverriddenLogic) {
3126
+ const parentKey = overriddenLogic.parentKey;
2966
3127
  const params: Params = {
2967
3128
  parentNode: this,
2968
3129
  parentKey,
2969
3130
  index: -1,
2970
3131
  object: null,
2971
- oldObject: dataSource,
3132
+ oldObject: overriddenLogic,
2972
3133
  };
2973
3134
  if (parentKey) {
2974
3135
  params.parentKey = parentKey;
2975
3136
  // @ts-ignore
2976
3137
  const t = this.__v_raw || this;
2977
3138
  // @ts-ignore
2978
- const n = dataSource.__v_raw || dataSource;
3139
+ const n = overriddenLogic.__v_raw || overriddenLogic;
2979
3140
  if (Array.isArray((t as any)[parentKey])) {
2980
- const index = (t as any)[parentKey].indexOf(n);
3141
+ // @ts-ignore
3142
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
2981
3143
  ~index && (this as any)[parentKey].splice(index, 1);
2982
3144
  params.index = index;
2983
3145
  } else if ((t as any)[parentKey] === n) {
@@ -2989,47 +3151,48 @@ export class App extends BaseNode {
2989
3151
  }
2990
3152
 
2991
3153
  /**
2992
- * 删除数据结构
2993
- * @param name 数据结构名称
3154
+ * 删除接口
3155
+ * @param name 接口名称
2994
3156
  */
2995
- removeStructure(name: string): void;
3157
+ removeAbstractInterface(name: string): void;
2996
3158
 
2997
3159
  /**
2998
- * 删除数据结构
2999
- * @param structure 已有的数据结构实例
3160
+ * 删除接口
3161
+ * @param itface 已有的接口实例
3000
3162
  */
3001
- removeStructure(structure: Structure): void;
3163
+ removeAbstractInterface(itface: AbstractInterface): void;
3002
3164
 
3003
- removeStructure(options: string | Structure) {
3004
- let structure: Structure;
3165
+ removeAbstractInterface(options: string | AbstractInterface) {
3166
+ let itface: AbstractInterface;
3005
3167
  if (typeof options === 'string') {
3006
- structure = (this.structures as Structure[]).find((item) => item.name === options);
3007
- if (!structure) {
3008
- throw new Error('找不到数据结构 ' + options);
3168
+ itface = (this.interfaces as AbstractInterface[]).find((item) => item.name === options);
3169
+ if (!itface) {
3170
+ throw new Error('找不到接口 ' + options);
3009
3171
  }
3010
3172
  } else {
3011
- structure = options;
3173
+ itface = options;
3012
3174
  }
3013
- return structure.delete();
3175
+ return itface.delete();
3014
3176
  }
3015
3177
 
3016
- __removeStructure(structure: Structure) {
3017
- const parentKey = structure.parentKey;
3178
+ __removeAbstractInterface(itface: AbstractInterface) {
3179
+ const parentKey = itface.parentKey;
3018
3180
  const params: Params = {
3019
3181
  parentNode: this,
3020
3182
  parentKey,
3021
3183
  index: -1,
3022
3184
  object: null,
3023
- oldObject: structure,
3185
+ oldObject: itface,
3024
3186
  };
3025
3187
  if (parentKey) {
3026
3188
  params.parentKey = parentKey;
3027
3189
  // @ts-ignore
3028
3190
  const t = this.__v_raw || this;
3029
3191
  // @ts-ignore
3030
- const n = structure.__v_raw || structure;
3192
+ const n = itface.__v_raw || itface;
3031
3193
  if (Array.isArray((t as any)[parentKey])) {
3032
- const index = (t as any)[parentKey].indexOf(n);
3194
+ // @ts-ignore
3195
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3033
3196
  ~index && (this as any)[parentKey].splice(index, 1);
3034
3197
  params.index = index;
3035
3198
  } else if ((t as any)[parentKey] === n) {
@@ -3041,47 +3204,48 @@ export class App extends BaseNode {
3041
3204
  }
3042
3205
 
3043
3206
  /**
3044
- * 删除枚举
3045
- * @param name 枚举名称
3207
+ * 删除前端
3208
+ * @param name 前端名称
3046
3209
  */
3047
- removeEnum(name: string): void;
3210
+ removeFrontend(name: string): void;
3048
3211
 
3049
3212
  /**
3050
- * 删除枚举
3051
- * @param enumeration 已有的枚举实例
3213
+ * 删除前端
3214
+ * @param frontend 已有的前端实例
3052
3215
  */
3053
- removeEnum(enumeration: Enum): void;
3216
+ removeFrontend(frontend: Frontend): void;
3054
3217
 
3055
- removeEnum(options: string | Enum) {
3056
- let enumeration: Enum;
3218
+ removeFrontend(options: string | Frontend) {
3219
+ let frontend: Frontend;
3057
3220
  if (typeof options === 'string') {
3058
- enumeration = (this.enums as Enum[]).find((item) => item.name === options);
3059
- if (!enumeration) {
3060
- throw new Error('找不到枚举 ' + options);
3221
+ frontend = (this.frontends as Frontend[]).find((item) => item.name === options);
3222
+ if (!frontend) {
3223
+ throw new Error('找不到前端 ' + options);
3061
3224
  }
3062
3225
  } else {
3063
- enumeration = options;
3226
+ frontend = options;
3064
3227
  }
3065
- return enumeration.delete();
3228
+ return frontend.delete();
3066
3229
  }
3067
3230
 
3068
- __removeEnum(enumeration: Enum) {
3069
- const parentKey = enumeration.parentKey;
3231
+ __removeFrontend(frontend: Frontend) {
3232
+ const parentKey = frontend.parentKey;
3070
3233
  const params: Params = {
3071
3234
  parentNode: this,
3072
3235
  parentKey,
3073
3236
  index: -1,
3074
3237
  object: null,
3075
- oldObject: enumeration,
3238
+ oldObject: frontend,
3076
3239
  };
3077
3240
  if (parentKey) {
3078
3241
  params.parentKey = parentKey;
3079
3242
  // @ts-ignore
3080
3243
  const t = this.__v_raw || this;
3081
3244
  // @ts-ignore
3082
- const n = enumeration.__v_raw || enumeration;
3245
+ const n = frontend.__v_raw || frontend;
3083
3246
  if (Array.isArray((t as any)[parentKey])) {
3084
- const index = (t as any)[parentKey].indexOf(n);
3247
+ // @ts-ignore
3248
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3085
3249
  ~index && (this as any)[parentKey].splice(index, 1);
3086
3250
  params.index = index;
3087
3251
  } else if ((t as any)[parentKey] === n) {
@@ -3093,72 +3257,101 @@ export class App extends BaseNode {
3093
3257
  }
3094
3258
 
3095
3259
  /**
3096
- * 删除逻辑
3097
- * @param name 逻辑名称
3260
+ * 删除后端
3261
+ * @param name 后端名称
3098
3262
  */
3099
- removeLogic(name: string): void;
3263
+ removeBackend(name: string): void;
3100
3264
 
3101
3265
  /**
3102
- * 删除逻辑
3103
- * @param logic 已有的逻辑实例
3266
+ * 删除后端
3267
+ * @param backend 已有的后端实例
3104
3268
  */
3105
- removeLogic(logic: Logic): void;
3269
+ removeBackend(backend: Backend): void;
3106
3270
 
3107
- removeLogic(options: string | Logic) {
3108
- let logic: Logic;
3271
+ removeBackend(options: string | Backend) {
3272
+ let backend: Backend;
3109
3273
  if (typeof options === 'string') {
3110
- logic = (this.logics as Logic[]).find((item) => item.name === options);
3111
- if (!logic) {
3112
- throw new Error('找不到逻辑 ' + options);
3274
+ backend = this.backend;
3275
+ if (!backend) {
3276
+ throw new Error('找不到后端 ' + options);
3113
3277
  }
3114
3278
  } else {
3115
- logic = options;
3279
+ backend = options;
3116
3280
  }
3117
- return logic.delete();
3281
+ return backend.delete();
3282
+ }
3283
+
3284
+ __removeBackend(backend: Backend) {
3285
+ const parentKey = backend.parentKey;
3286
+ const params: Params = {
3287
+ parentNode: this,
3288
+ parentKey,
3289
+ index: -1,
3290
+ object: null,
3291
+ oldObject: backend,
3292
+ };
3293
+ if (parentKey) {
3294
+ params.parentKey = parentKey;
3295
+ // @ts-ignore
3296
+ const t = this.__v_raw || this;
3297
+ // @ts-ignore
3298
+ const n = backend.__v_raw || backend;
3299
+ if (Array.isArray((t as any)[parentKey])) {
3300
+ // @ts-ignore
3301
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3302
+ ~index && (this as any)[parentKey].splice(index, 1);
3303
+ params.index = index;
3304
+ } else if ((t as any)[parentKey] === n) {
3305
+ params.index = 0;
3306
+ (this as any)[parentKey] = undefined;
3307
+ }
3308
+ }
3309
+ return params;
3118
3310
  }
3119
3311
 
3120
3312
  /**
3121
- * 删除鉴权逻辑
3122
- * @param name 鉴权逻辑名称
3313
+ * 删除流程
3314
+ * @param name 流程名称
3123
3315
  */
3124
- removeAuthLogicInAuthLogics(name: string): void;
3316
+ removeProcess(name: string): void;
3125
3317
 
3126
3318
  /**
3127
- * 删除鉴权逻辑
3128
- * @param authLogic 已有的鉴权逻辑实例
3319
+ * 删除流程
3320
+ * @param process 已有的流程实例
3129
3321
  */
3130
- removeAuthLogicInAuthLogics(authLogic: AuthLogic): void;
3322
+ removeProcess(process: Process): void;
3131
3323
 
3132
- removeAuthLogicInAuthLogics(options: string | AuthLogic) {
3133
- let authLogic: AuthLogic;
3324
+ removeProcess(options: string | Process) {
3325
+ let process: Process;
3134
3326
  if (typeof options === 'string') {
3135
- authLogic = (this.authLogics as AuthLogic[]).find((item) => item.name === options);
3136
- if (!authLogic) {
3137
- throw new Error('找不到鉴权逻辑 ' + options);
3327
+ process = (this.processes as Process[]).find((item) => item.name === options);
3328
+ if (!process) {
3329
+ throw new Error('找不到流程 ' + options);
3138
3330
  }
3139
3331
  } else {
3140
- authLogic = options;
3332
+ process = options;
3141
3333
  }
3142
- return authLogic.delete();
3334
+ return process.delete();
3143
3335
  }
3144
3336
 
3145
- __removeLogic(logic: Logic) {
3146
- const parentKey = logic.parentKey;
3337
+ __removeProcess(process: Process) {
3338
+ const parentKey = process.parentKey;
3147
3339
  const params: Params = {
3148
3340
  parentNode: this,
3149
3341
  parentKey,
3150
3342
  index: -1,
3151
3343
  object: null,
3152
- oldObject: logic,
3344
+ oldObject: process,
3153
3345
  };
3154
3346
  if (parentKey) {
3155
3347
  params.parentKey = parentKey;
3156
3348
  // @ts-ignore
3157
3349
  const t = this.__v_raw || this;
3158
3350
  // @ts-ignore
3159
- const n = logic.__v_raw || logic;
3351
+ const n = process.__v_raw || process;
3160
3352
  if (Array.isArray((t as any)[parentKey])) {
3161
- const index = (t as any)[parentKey].indexOf(n);
3353
+ // @ts-ignore
3354
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3162
3355
  ~index && (this as any)[parentKey].splice(index, 1);
3163
3356
  params.index = index;
3164
3357
  } else if ((t as any)[parentKey] === n) {
@@ -3170,47 +3363,48 @@ export class App extends BaseNode {
3170
3363
  }
3171
3364
 
3172
3365
  /**
3173
- * 删除覆写逻辑
3174
- * @param name 覆写逻辑名称
3366
+ * 删除角色
3367
+ * @param name 角色名称
3175
3368
  */
3176
- removeOverriddenLogic(name: string): void;
3369
+ removeRole(name: string): void;
3177
3370
 
3178
3371
  /**
3179
- * 删除覆写逻辑
3180
- * @param overriddenLogic 已有的覆写逻辑实例
3372
+ * 删除角色
3373
+ * @param role 已有的角色实例
3181
3374
  */
3182
- removeOverriddenLogic(overriddenLogic: OverriddenLogic): void;
3375
+ removeRole(role: Role): void;
3183
3376
 
3184
- removeOverriddenLogic(options: string | OverriddenLogic) {
3185
- let overriddenLogic: OverriddenLogic;
3377
+ removeRole(options: string | Role) {
3378
+ let role: Role;
3186
3379
  if (typeof options === 'string') {
3187
- overriddenLogic = (this.overriddenLogics as OverriddenLogic[]).find((item) => item.name === options);
3188
- if (!overriddenLogic) {
3189
- throw new Error('找不到覆写逻辑 ' + options);
3380
+ role = (this.roles as Role[]).find((item) => item.name === options);
3381
+ if (!role) {
3382
+ throw new Error('找不到角色 ' + options);
3190
3383
  }
3191
3384
  } else {
3192
- overriddenLogic = options;
3385
+ role = options;
3193
3386
  }
3194
- return overriddenLogic.delete();
3387
+ return role.delete();
3195
3388
  }
3196
3389
 
3197
- __removeOverriddenLogic(overriddenLogic: OverriddenLogic) {
3198
- const parentKey = overriddenLogic.parentKey;
3390
+ __removeRole(role: Role) {
3391
+ const parentKey = role.parentKey;
3199
3392
  const params: Params = {
3200
3393
  parentNode: this,
3201
3394
  parentKey,
3202
3395
  index: -1,
3203
3396
  object: null,
3204
- oldObject: overriddenLogic,
3397
+ oldObject: role,
3205
3398
  };
3206
3399
  if (parentKey) {
3207
3400
  params.parentKey = parentKey;
3208
3401
  // @ts-ignore
3209
3402
  const t = this.__v_raw || this;
3210
3403
  // @ts-ignore
3211
- const n = overriddenLogic.__v_raw || overriddenLogic;
3404
+ const n = role.__v_raw || role;
3212
3405
  if (Array.isArray((t as any)[parentKey])) {
3213
- const index = (t as any)[parentKey].indexOf(n);
3406
+ // @ts-ignore
3407
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3214
3408
  ~index && (this as any)[parentKey].splice(index, 1);
3215
3409
  params.index = index;
3216
3410
  } else if ((t as any)[parentKey] === n) {
@@ -3222,72 +3416,48 @@ export class App extends BaseNode {
3222
3416
  }
3223
3417
 
3224
3418
  /**
3225
- * 删除接口
3226
- * @param name 接口名称
3419
+ * 删除配置管理
3420
+ * @param name 配置管理名称
3227
3421
  */
3228
- removeInterfaceInInterfaces(name: string): void;
3422
+ removeConfiguration(name: string): void;
3229
3423
 
3230
3424
  /**
3231
- * 删除接口
3232
- * @param itface 已有的接口实例
3425
+ * 删除配置管理
3426
+ * @param configuration 已有的配置管理实例
3233
3427
  */
3234
- removeInterfaceInInterfaces(itface: Interface): void;
3428
+ removeConfiguration(configuration: Configuration): void;
3235
3429
 
3236
- removeInterfaceInInterfaces(options: string | Interface) {
3237
- let itface: Interface;
3430
+ removeConfiguration(options: string | Configuration) {
3431
+ let configuration: Configuration;
3238
3432
  if (typeof options === 'string') {
3239
- itface = (this.interfaces as Interface[]).find((item) => item.name === options);
3240
- if (!itface) {
3241
- throw new Error('找不到接口 ' + options);
3242
- }
3243
- } else {
3244
- itface = options;
3245
- }
3246
- return itface.delete();
3247
- }
3248
-
3249
- /**
3250
- * 删除鉴权接口
3251
- * @param name 鉴权接口名称
3252
- */
3253
- removeAuthInterfaceInInterfaces(name: string): void;
3254
-
3255
- /**
3256
- * 删除鉴权接口
3257
- * @param itface 已有的鉴权接口实例
3258
- */
3259
- removeAuthInterfaceInInterfaces(itface: AuthInterface): void;
3260
-
3261
- removeAuthInterfaceInInterfaces(options: string | AuthInterface) {
3262
- let itface: AuthInterface;
3263
- if (typeof options === 'string') {
3264
- itface = (this.interfaces as AuthInterface[]).find((item) => item.name === options);
3265
- if (!itface) {
3266
- throw new Error('找不到鉴权接口 ' + options);
3433
+ configuration = this.configuration;
3434
+ if (!configuration) {
3435
+ throw new Error('找不到配置管理 ' + options);
3267
3436
  }
3268
3437
  } else {
3269
- itface = options;
3438
+ configuration = options;
3270
3439
  }
3271
- return itface.delete();
3440
+ return configuration.delete();
3272
3441
  }
3273
3442
 
3274
- __removeInterface(itface: Interface) {
3275
- const parentKey = itface.parentKey;
3443
+ __removeConfiguration(configuration: Configuration) {
3444
+ const parentKey = configuration.parentKey;
3276
3445
  const params: Params = {
3277
3446
  parentNode: this,
3278
3447
  parentKey,
3279
3448
  index: -1,
3280
3449
  object: null,
3281
- oldObject: itface,
3450
+ oldObject: configuration,
3282
3451
  };
3283
3452
  if (parentKey) {
3284
3453
  params.parentKey = parentKey;
3285
3454
  // @ts-ignore
3286
3455
  const t = this.__v_raw || this;
3287
3456
  // @ts-ignore
3288
- const n = itface.__v_raw || itface;
3457
+ const n = configuration.__v_raw || configuration;
3289
3458
  if (Array.isArray((t as any)[parentKey])) {
3290
- const index = (t as any)[parentKey].indexOf(n);
3459
+ // @ts-ignore
3460
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3291
3461
  ~index && (this as any)[parentKey].splice(index, 1);
3292
3462
  params.index = index;
3293
3463
  } else if ((t as any)[parentKey] === n) {
@@ -3299,99 +3469,98 @@ export class App extends BaseNode {
3299
3469
  }
3300
3470
 
3301
3471
  /**
3302
- * 删除前端
3303
- * @param name 前端名称
3472
+ * 删除模块
3473
+ * @param name 模块名称
3304
3474
  */
3305
- removeFrontend(name: string): void;
3475
+ removeModuleInDependencies(name: string): void;
3306
3476
 
3307
3477
  /**
3308
- * 删除前端
3309
- * @param frontend 已有的前端实例
3478
+ * 删除模块
3479
+ * @param module 已有的模块实例
3310
3480
  */
3311
- removeFrontend(frontend: Frontend): void;
3481
+ removeModuleInDependencies(module: Module): void;
3312
3482
 
3313
- removeFrontend(options: string | Frontend) {
3314
- let frontend: Frontend;
3483
+ removeModuleInDependencies(options: string | Module) {
3484
+ let module: Module;
3315
3485
  if (typeof options === 'string') {
3316
- frontend = (this.frontends as Frontend[]).find((item) => item.name === options);
3317
- if (!frontend) {
3318
- throw new Error('找不到前端 ' + options);
3486
+ module = (this.dependencies as Module[]).find((item) => item.name === options);
3487
+ if (!module) {
3488
+ throw new Error('找不到模块 ' + options);
3319
3489
  }
3320
3490
  } else {
3321
- frontend = options;
3491
+ module = options;
3322
3492
  }
3323
- return frontend.delete();
3493
+ return module.delete();
3324
3494
  }
3325
3495
 
3326
- __removeFrontend(frontend: Frontend) {
3327
- const parentKey = frontend.parentKey;
3328
- const params: Params = {
3329
- parentNode: this,
3330
- parentKey,
3331
- index: -1,
3332
- object: null,
3333
- oldObject: frontend,
3334
- };
3335
- if (parentKey) {
3336
- params.parentKey = parentKey;
3337
- // @ts-ignore
3338
- const t = this.__v_raw || this;
3339
- // @ts-ignore
3340
- const n = frontend.__v_raw || frontend;
3341
- if (Array.isArray((t as any)[parentKey])) {
3342
- const index = (t as any)[parentKey].indexOf(n);
3343
- ~index && (this as any)[parentKey].splice(index, 1);
3344
- params.index = index;
3345
- } else if ((t as any)[parentKey] === n) {
3346
- params.index = 0;
3347
- (this as any)[parentKey] = undefined;
3496
+ /**
3497
+ * 删除连接器
3498
+ * @param name 连接器名称
3499
+ */
3500
+ removeConnectorInDependencies(name: string): void;
3501
+
3502
+ /**
3503
+ * 删除连接器
3504
+ * @param connector 已有的连接器实例
3505
+ */
3506
+ removeConnectorInDependencies(connector: Connector): void;
3507
+
3508
+ removeConnectorInDependencies(options: string | Connector) {
3509
+ let connector: Connector;
3510
+ if (typeof options === 'string') {
3511
+ connector = (this.dependencies as Connector[]).find((item) => item.name === options);
3512
+ if (!connector) {
3513
+ throw new Error('找不到连接器 ' + options);
3348
3514
  }
3515
+ } else {
3516
+ connector = options;
3349
3517
  }
3350
- return params;
3518
+ return connector.delete();
3351
3519
  }
3352
3520
 
3353
3521
  /**
3354
- * 删除后端
3355
- * @param name 后端名称
3522
+ * 删除模块
3523
+ * @param name 模块名称
3356
3524
  */
3357
- removeBackend(name: string): void;
3525
+ removeModuleInInterfaceDependencies(name: string): void;
3358
3526
 
3359
3527
  /**
3360
- * 删除后端
3361
- * @param backend 已有的后端实例
3528
+ * 删除模块
3529
+ * @param module 已有的模块实例
3362
3530
  */
3363
- removeBackend(backend: Backend): void;
3531
+ removeModuleInInterfaceDependencies(module: Module): void;
3364
3532
 
3365
- removeBackend(options: string | Backend) {
3366
- let backend: Backend;
3533
+ removeModuleInInterfaceDependencies(options: string | Module) {
3534
+ let module: Module;
3367
3535
  if (typeof options === 'string') {
3368
- backend = this.backend;
3369
- if (!backend) {
3370
- throw new Error('找不到后端 ' + options);
3536
+ module = (this.interfaceDependencies as Module[]).find((item) => item.name === options);
3537
+ if (!module) {
3538
+ throw new Error('找不到模块 ' + options);
3371
3539
  }
3372
3540
  } else {
3373
- backend = options;
3541
+ module = options;
3374
3542
  }
3375
- return backend.delete();
3543
+ return module.delete();
3376
3544
  }
3377
3545
 
3378
- __removeBackend(backend: Backend) {
3379
- const parentKey = backend.parentKey;
3546
+ __removeModule(module: Module) {
3547
+ const parentKey = module.parentKey;
3380
3548
  const params: Params = {
3381
3549
  parentNode: this,
3382
3550
  parentKey,
3383
3551
  index: -1,
3384
3552
  object: null,
3385
- oldObject: backend,
3553
+ oldObject: module,
3386
3554
  };
3387
3555
  if (parentKey) {
3388
3556
  params.parentKey = parentKey;
3389
3557
  // @ts-ignore
3390
3558
  const t = this.__v_raw || this;
3391
3559
  // @ts-ignore
3392
- const n = backend.__v_raw || backend;
3560
+ const n = module.__v_raw || module;
3393
3561
  if (Array.isArray((t as any)[parentKey])) {
3394
- const index = (t as any)[parentKey].indexOf(n);
3562
+ // @ts-ignore
3563
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3395
3564
  ~index && (this as any)[parentKey].splice(index, 1);
3396
3565
  params.index = index;
3397
3566
  } else if ((t as any)[parentKey] === n) {
@@ -3403,47 +3572,48 @@ export class App extends BaseNode {
3403
3572
  }
3404
3573
 
3405
3574
  /**
3406
- * 删除流程
3407
- * @param name 流程名称
3575
+ * 删除集成
3576
+ * @param name 集成名称
3408
3577
  */
3409
- removeProcess(name: string): void;
3578
+ removeIntegration(name: string): void;
3410
3579
 
3411
3580
  /**
3412
- * 删除流程
3413
- * @param process 已有的流程实例
3581
+ * 删除集成
3582
+ * @param integration 已有的集成实例
3414
3583
  */
3415
- removeProcess(process: Process): void;
3584
+ removeIntegration(integration: Integration): void;
3416
3585
 
3417
- removeProcess(options: string | Process) {
3418
- let process: Process;
3586
+ removeIntegration(options: string | Integration) {
3587
+ let integration: Integration;
3419
3588
  if (typeof options === 'string') {
3420
- process = (this.processes as Process[]).find((item) => item.name === options);
3421
- if (!process) {
3422
- throw new Error('找不到流程 ' + options);
3589
+ integration = this.integration;
3590
+ if (!integration) {
3591
+ throw new Error('找不到集成 ' + options);
3423
3592
  }
3424
3593
  } else {
3425
- process = options;
3594
+ integration = options;
3426
3595
  }
3427
- return process.delete();
3596
+ return integration.delete();
3428
3597
  }
3429
3598
 
3430
- __removeProcess(process: Process) {
3431
- const parentKey = process.parentKey;
3599
+ __removeIntegration(integration: Integration) {
3600
+ const parentKey = integration.parentKey;
3432
3601
  const params: Params = {
3433
3602
  parentNode: this,
3434
3603
  parentKey,
3435
3604
  index: -1,
3436
3605
  object: null,
3437
- oldObject: process,
3606
+ oldObject: integration,
3438
3607
  };
3439
3608
  if (parentKey) {
3440
3609
  params.parentKey = parentKey;
3441
3610
  // @ts-ignore
3442
3611
  const t = this.__v_raw || this;
3443
3612
  // @ts-ignore
3444
- const n = process.__v_raw || process;
3613
+ const n = integration.__v_raw || integration;
3445
3614
  if (Array.isArray((t as any)[parentKey])) {
3446
- const index = (t as any)[parentKey].indexOf(n);
3615
+ // @ts-ignore
3616
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3447
3617
  ~index && (this as any)[parentKey].splice(index, 1);
3448
3618
  params.index = index;
3449
3619
  } else if ((t as any)[parentKey] === n) {
@@ -3455,47 +3625,50 @@ export class App extends BaseNode {
3455
3625
  }
3456
3626
 
3457
3627
  /**
3458
- * 删除角色
3459
- * @param name 角色名称
3628
+ * 删除调用接口的鉴权逻辑
3629
+ * @param name 调用接口的鉴权逻辑名称
3460
3630
  */
3461
- removeRole(name: string): void;
3631
+ removeAuthLogicForCallInterface(name: string): void;
3462
3632
 
3463
3633
  /**
3464
- * 删除角色
3465
- * @param role 已有的角色实例
3634
+ * 删除调用接口的鉴权逻辑
3635
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
3466
3636
  */
3467
- removeRole(role: Role): void;
3637
+ removeAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): void;
3468
3638
 
3469
- removeRole(options: string | Role) {
3470
- let role: Role;
3639
+ removeAuthLogicForCallInterface(options: string | AuthLogicForCallInterface) {
3640
+ let authLogicForCallInterface: AuthLogicForCallInterface;
3471
3641
  if (typeof options === 'string') {
3472
- role = (this.roles as Role[]).find((item) => item.name === options);
3473
- if (!role) {
3474
- throw new Error('找不到角色 ' + options);
3642
+ authLogicForCallInterface = (this.authLogicsForCallInterface as AuthLogicForCallInterface[]).find(
3643
+ (item) => item.name === options,
3644
+ );
3645
+ if (!authLogicForCallInterface) {
3646
+ throw new Error('找不到调用接口的鉴权逻辑 ' + options);
3475
3647
  }
3476
3648
  } else {
3477
- role = options;
3649
+ authLogicForCallInterface = options;
3478
3650
  }
3479
- return role.delete();
3651
+ return authLogicForCallInterface.delete();
3480
3652
  }
3481
3653
 
3482
- __removeRole(role: Role) {
3483
- const parentKey = role.parentKey;
3654
+ __removeAuthLogic(authLogic: AuthLogic) {
3655
+ const parentKey = authLogic.parentKey;
3484
3656
  const params: Params = {
3485
3657
  parentNode: this,
3486
3658
  parentKey,
3487
3659
  index: -1,
3488
3660
  object: null,
3489
- oldObject: role,
3661
+ oldObject: authLogic,
3490
3662
  };
3491
3663
  if (parentKey) {
3492
3664
  params.parentKey = parentKey;
3493
3665
  // @ts-ignore
3494
3666
  const t = this.__v_raw || this;
3495
3667
  // @ts-ignore
3496
- const n = role.__v_raw || role;
3668
+ const n = authLogic.__v_raw || authLogic;
3497
3669
  if (Array.isArray((t as any)[parentKey])) {
3498
- const index = (t as any)[parentKey].indexOf(n);
3670
+ // @ts-ignore
3671
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3499
3672
  ~index && (this as any)[parentKey].splice(index, 1);
3500
3673
  params.index = index;
3501
3674
  } else if ((t as any)[parentKey] === n) {
@@ -3507,47 +3680,48 @@ export class App extends BaseNode {
3507
3680
  }
3508
3681
 
3509
3682
  /**
3510
- * 删除配置管理
3511
- * @param name 配置管理名称
3683
+ * 删除连接
3684
+ * @param name 连接名称
3512
3685
  */
3513
- removeConfiguration(name: string): void;
3686
+ removeConnection(name: string): void;
3514
3687
 
3515
3688
  /**
3516
- * 删除配置管理
3517
- * @param configuration 已有的配置管理实例
3689
+ * 删除连接
3690
+ * @param connection 已有的连接实例
3518
3691
  */
3519
- removeConfiguration(configuration: Configuration): void;
3692
+ removeConnection(connection: Connection): void;
3520
3693
 
3521
- removeConfiguration(options: string | Configuration) {
3522
- let configuration: Configuration;
3694
+ removeConnection(options: string | Connection) {
3695
+ let connection: Connection;
3523
3696
  if (typeof options === 'string') {
3524
- configuration = this.configuration;
3525
- if (!configuration) {
3526
- throw new Error('找不到配置管理 ' + options);
3697
+ connection = (this.connections as Connection[]).find((item) => item.name === options);
3698
+ if (!connection) {
3699
+ throw new Error('找不到连接 ' + options);
3527
3700
  }
3528
3701
  } else {
3529
- configuration = options;
3702
+ connection = options;
3530
3703
  }
3531
- return configuration.delete();
3704
+ return connection.delete();
3532
3705
  }
3533
3706
 
3534
- __removeConfiguration(configuration: Configuration) {
3535
- const parentKey = configuration.parentKey;
3707
+ __removeConnection(connection: Connection) {
3708
+ const parentKey = connection.parentKey;
3536
3709
  const params: Params = {
3537
3710
  parentNode: this,
3538
3711
  parentKey,
3539
3712
  index: -1,
3540
3713
  object: null,
3541
- oldObject: configuration,
3714
+ oldObject: connection,
3542
3715
  };
3543
3716
  if (parentKey) {
3544
3717
  params.parentKey = parentKey;
3545
3718
  // @ts-ignore
3546
3719
  const t = this.__v_raw || this;
3547
3720
  // @ts-ignore
3548
- const n = configuration.__v_raw || configuration;
3721
+ const n = connection.__v_raw || connection;
3549
3722
  if (Array.isArray((t as any)[parentKey])) {
3550
- const index = (t as any)[parentKey].indexOf(n);
3723
+ // @ts-ignore
3724
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3551
3725
  ~index && (this as any)[parentKey].splice(index, 1);
3552
3726
  params.index = index;
3553
3727
  } else if ((t as any)[parentKey] === n) {
@@ -3559,270 +3733,10 @@ export class App extends BaseNode {
3559
3733
  }
3560
3734
 
3561
3735
  /**
3562
- * 删除模块
3563
- * @param name 模块名称
3736
+ * 删除触发器启动器
3737
+ * @param name 触发器启动器名称
3564
3738
  */
3565
- removeModuleInDependencies(name: string): void;
3566
-
3567
- /**
3568
- * 删除模块
3569
- * @param module 已有的模块实例
3570
- */
3571
- removeModuleInDependencies(module: Module): void;
3572
-
3573
- removeModuleInDependencies(options: string | Module) {
3574
- let module: Module;
3575
- if (typeof options === 'string') {
3576
- module = (this.dependencies as Module[]).find((item) => item.name === options);
3577
- if (!module) {
3578
- throw new Error('找不到模块 ' + options);
3579
- }
3580
- } else {
3581
- module = options;
3582
- }
3583
- return module.delete();
3584
- }
3585
-
3586
- /**
3587
- * 删除连接器
3588
- * @param name 连接器名称
3589
- */
3590
- removeConnectorInDependencies(name: string): void;
3591
-
3592
- /**
3593
- * 删除连接器
3594
- * @param connector 已有的连接器实例
3595
- */
3596
- removeConnectorInDependencies(connector: Connector): void;
3597
-
3598
- removeConnectorInDependencies(options: string | Connector) {
3599
- let connector: Connector;
3600
- if (typeof options === 'string') {
3601
- connector = (this.dependencies as Connector[]).find((item) => item.name === options);
3602
- if (!connector) {
3603
- throw new Error('找不到连接器 ' + options);
3604
- }
3605
- } else {
3606
- connector = options;
3607
- }
3608
- return connector.delete();
3609
- }
3610
-
3611
- /**
3612
- * 删除模块
3613
- * @param name 模块名称
3614
- */
3615
- removeModuleInInterfaceDependencies(name: string): void;
3616
-
3617
- /**
3618
- * 删除模块
3619
- * @param module 已有的模块实例
3620
- */
3621
- removeModuleInInterfaceDependencies(module: Module): void;
3622
-
3623
- removeModuleInInterfaceDependencies(options: string | Module) {
3624
- let module: Module;
3625
- if (typeof options === 'string') {
3626
- module = (this.interfaceDependencies as Module[]).find((item) => item.name === options);
3627
- if (!module) {
3628
- throw new Error('找不到模块 ' + options);
3629
- }
3630
- } else {
3631
- module = options;
3632
- }
3633
- return module.delete();
3634
- }
3635
-
3636
- __removeModule(module: Module) {
3637
- const parentKey = module.parentKey;
3638
- const params: Params = {
3639
- parentNode: this,
3640
- parentKey,
3641
- index: -1,
3642
- object: null,
3643
- oldObject: module,
3644
- };
3645
- if (parentKey) {
3646
- params.parentKey = parentKey;
3647
- // @ts-ignore
3648
- const t = this.__v_raw || this;
3649
- // @ts-ignore
3650
- const n = module.__v_raw || module;
3651
- if (Array.isArray((t as any)[parentKey])) {
3652
- const index = (t as any)[parentKey].indexOf(n);
3653
- ~index && (this as any)[parentKey].splice(index, 1);
3654
- params.index = index;
3655
- } else if ((t as any)[parentKey] === n) {
3656
- params.index = 0;
3657
- (this as any)[parentKey] = undefined;
3658
- }
3659
- }
3660
- return params;
3661
- }
3662
-
3663
- /**
3664
- * 删除集成
3665
- * @param name 集成名称
3666
- */
3667
- removeIntegration(name: string): void;
3668
-
3669
- /**
3670
- * 删除集成
3671
- * @param integration 已有的集成实例
3672
- */
3673
- removeIntegration(integration: Integration): void;
3674
-
3675
- removeIntegration(options: string | Integration) {
3676
- let integration: Integration;
3677
- if (typeof options === 'string') {
3678
- integration = this.integration;
3679
- if (!integration) {
3680
- throw new Error('找不到集成 ' + options);
3681
- }
3682
- } else {
3683
- integration = options;
3684
- }
3685
- return integration.delete();
3686
- }
3687
-
3688
- __removeIntegration(integration: Integration) {
3689
- const parentKey = integration.parentKey;
3690
- const params: Params = {
3691
- parentNode: this,
3692
- parentKey,
3693
- index: -1,
3694
- object: null,
3695
- oldObject: integration,
3696
- };
3697
- if (parentKey) {
3698
- params.parentKey = parentKey;
3699
- // @ts-ignore
3700
- const t = this.__v_raw || this;
3701
- // @ts-ignore
3702
- const n = integration.__v_raw || integration;
3703
- if (Array.isArray((t as any)[parentKey])) {
3704
- const index = (t as any)[parentKey].indexOf(n);
3705
- ~index && (this as any)[parentKey].splice(index, 1);
3706
- params.index = index;
3707
- } else if ((t as any)[parentKey] === n) {
3708
- params.index = 0;
3709
- (this as any)[parentKey] = undefined;
3710
- }
3711
- }
3712
- return params;
3713
- }
3714
-
3715
- /**
3716
- * 删除调用接口的鉴权逻辑
3717
- * @param name 调用接口的鉴权逻辑名称
3718
- */
3719
- removeAuthLogicForCallInterface(name: string): void;
3720
-
3721
- /**
3722
- * 删除调用接口的鉴权逻辑
3723
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
3724
- */
3725
- removeAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): void;
3726
-
3727
- removeAuthLogicForCallInterface(options: string | AuthLogicForCallInterface) {
3728
- let authLogicForCallInterface: AuthLogicForCallInterface;
3729
- if (typeof options === 'string') {
3730
- authLogicForCallInterface = (this.authLogicsForCallInterface as AuthLogicForCallInterface[]).find(
3731
- (item) => item.name === options,
3732
- );
3733
- if (!authLogicForCallInterface) {
3734
- throw new Error('找不到调用接口的鉴权逻辑 ' + options);
3735
- }
3736
- } else {
3737
- authLogicForCallInterface = options;
3738
- }
3739
- return authLogicForCallInterface.delete();
3740
- }
3741
-
3742
- __removeAuthLogic(authLogic: AuthLogic) {
3743
- const parentKey = authLogic.parentKey;
3744
- const params: Params = {
3745
- parentNode: this,
3746
- parentKey,
3747
- index: -1,
3748
- object: null,
3749
- oldObject: authLogic,
3750
- };
3751
- if (parentKey) {
3752
- params.parentKey = parentKey;
3753
- // @ts-ignore
3754
- const t = this.__v_raw || this;
3755
- // @ts-ignore
3756
- const n = authLogic.__v_raw || authLogic;
3757
- if (Array.isArray((t as any)[parentKey])) {
3758
- const index = (t as any)[parentKey].indexOf(n);
3759
- ~index && (this as any)[parentKey].splice(index, 1);
3760
- params.index = index;
3761
- } else if ((t as any)[parentKey] === n) {
3762
- params.index = 0;
3763
- (this as any)[parentKey] = undefined;
3764
- }
3765
- }
3766
- return params;
3767
- }
3768
-
3769
- /**
3770
- * 删除连接
3771
- * @param name 连接名称
3772
- */
3773
- removeConnection(name: string): void;
3774
-
3775
- /**
3776
- * 删除连接
3777
- * @param connection 已有的连接实例
3778
- */
3779
- removeConnection(connection: Connection): void;
3780
-
3781
- removeConnection(options: string | Connection) {
3782
- let connection: Connection;
3783
- if (typeof options === 'string') {
3784
- connection = (this.connections as Connection[]).find((item) => item.name === options);
3785
- if (!connection) {
3786
- throw new Error('找不到连接 ' + options);
3787
- }
3788
- } else {
3789
- connection = options;
3790
- }
3791
- return connection.delete();
3792
- }
3793
-
3794
- __removeConnection(connection: Connection) {
3795
- const parentKey = connection.parentKey;
3796
- const params: Params = {
3797
- parentNode: this,
3798
- parentKey,
3799
- index: -1,
3800
- object: null,
3801
- oldObject: connection,
3802
- };
3803
- if (parentKey) {
3804
- params.parentKey = parentKey;
3805
- // @ts-ignore
3806
- const t = this.__v_raw || this;
3807
- // @ts-ignore
3808
- const n = connection.__v_raw || connection;
3809
- if (Array.isArray((t as any)[parentKey])) {
3810
- const index = (t as any)[parentKey].indexOf(n);
3811
- ~index && (this as any)[parentKey].splice(index, 1);
3812
- params.index = index;
3813
- } else if ((t as any)[parentKey] === n) {
3814
- params.index = 0;
3815
- (this as any)[parentKey] = undefined;
3816
- }
3817
- }
3818
- return params;
3819
- }
3820
-
3821
- /**
3822
- * 删除触发器启动器
3823
- * @param name 触发器启动器名称
3824
- */
3825
- removeTriggerLauncher(name: string): void;
3739
+ removeTriggerLauncher(name: string): void;
3826
3740
 
3827
3741
  /**
3828
3742
  * 删除触发器启动器
@@ -3859,7 +3773,8 @@ export class App extends BaseNode {
3859
3773
  // @ts-ignore
3860
3774
  const n = triggerLauncher.__v_raw || triggerLauncher;
3861
3775
  if (Array.isArray((t as any)[parentKey])) {
3862
- const index = (t as any)[parentKey].indexOf(n);
3776
+ // @ts-ignore
3777
+ const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3863
3778
  ~index && (this as any)[parentKey].splice(index, 1);
3864
3779
  params.index = index;
3865
3780
  } else if ((t as any)[parentKey] === n) {
@@ -4106,7 +4021,7 @@ export class App extends BaseNode {
4106
4021
  });
4107
4022
  this.dependencies.forEach((dep: Module) => {
4108
4023
  const { name, version, compilerInfoMap, frontends } = dep;
4109
- const prefixPath = compilerInfoMap?.js?.prefix;
4024
+ const prefixPath = (compilerInfoMap as compilerInfoMapProps)?.js?.prefix;
4110
4025
  if (name) {
4111
4026
  (frontends || []).forEach((frontend) => {
4112
4027
  if (frontend.type === scope) {
@@ -4247,9 +4162,9 @@ export class App extends BaseNode {
4247
4162
 
4248
4163
  /* 判断接口是否有误,需要重新导出 */
4249
4164
 
4250
- getQualifiedInterface(interfaces: Interface[] = this.interfaces): MessageData[] {
4165
+ getQualifiedInterface(interfaces: AbstractInterface[] = this.interfaces): MessageData[] {
4251
4166
  const errorList: MessageData[] = [];
4252
- interfaces.forEach((item: Interface) => {
4167
+ (interfaces as unknown as Interface[]).forEach((item: Interface) => {
4253
4168
  const logic = this.logics.find((logic: Logic) => logic.name === item.originLogicName);
4254
4169
  const logicParamMap: any = {};
4255
4170
  logic.params.forEach((param) => {
@@ -4499,6 +4414,361 @@ export class App extends BaseNode {
4499
4414
  return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.title);
4500
4415
  }
4501
4416
 
4417
+ getAuthLogicForCallInterfaceExistingNames(excludedList: Array<AuthLogicForCallInterface> = []) {
4418
+ const excludedSet = new Set(excludedList);
4419
+ return ((this.authLogicsForCallInterface as AuthLogicForCallInterface[]) || [])
4420
+ .filter((item) => !excludedSet.has(item))
4421
+ .map((item) => item.name);
4422
+ }
4423
+ getAuthLogicForCallInterfaceUniqueName(name = 'authLogicForCallInterface1') {
4424
+ return utils.unique(name, this.getAuthLogicForCallInterfaceExistingNames(), undefined, false);
4425
+ }
4426
+ //todo 替换生成
4427
+ getInterfaceExistingNames(excludedList: Array<Interface> = []) {
4428
+ const excludedSet = new Set(excludedList);
4429
+ return ((this.interfaces as Interface[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
4430
+ }
4431
+ getInterfaceUniqueName(name = 'Interface1') {
4432
+ return utils.unique(name, this.getInterfaceExistingNames(), undefined, true);
4433
+ }
4434
+
4435
+ /**
4436
+ * 插入接口
4437
+ * @internal
4438
+ * @param name 接口名称,如果不填会自动生成一个唯一名称
4439
+ */
4440
+ _insertInterfaceInInterfacesAt(name: string, index: number): Interface;
4441
+
4442
+ /**
4443
+ * 插入接口
4444
+ * @internal
4445
+ * @param itfaceOptions 接口参数
4446
+ */
4447
+ _insertInterfaceInInterfacesAt(itfaceOptions: Partial<Interface>, index: number): Interface;
4448
+
4449
+ /**
4450
+ * 插入接口
4451
+ * @internal
4452
+ * @param itface 已有的接口实例
4453
+ */
4454
+ _insertInterfaceInInterfacesAt(itface: Interface, index: number): Interface;
4455
+
4456
+ _insertInterfaceInInterfacesAt(options: string | Partial<Interface> | Interface, index: number) {
4457
+ const itfaceOptions: any = {};
4458
+ const relationOptions = { parentNode: this, parentKey: 'interfaces' };
4459
+ let itface: Interface;
4460
+ if (!options) {
4461
+ itface = Interface.from(
4462
+ {
4463
+ ...itfaceOptions,
4464
+ name: this.getInterfaceUniqueName(),
4465
+ },
4466
+ this,
4467
+ 'interfaces',
4468
+ );
4469
+ } else if (typeof options === 'string') {
4470
+ itface = Interface.from(
4471
+ {
4472
+ ...itfaceOptions,
4473
+ name: options,
4474
+ },
4475
+ this,
4476
+ 'interfaces',
4477
+ );
4478
+ } else if (options instanceof Interface) {
4479
+ options.ensureDelete(); // 同一实例不支持多处存在
4480
+ itface = options;
4481
+ Object.assign(itface, relationOptions);
4482
+ } else {
4483
+ itface = Interface.from(
4484
+ {
4485
+ ...itfaceOptions,
4486
+ ...options,
4487
+ },
4488
+ this,
4489
+ 'interfaces',
4490
+ );
4491
+ }
4492
+ this.interfaces.splice(index, 0, itface);
4493
+ return itface;
4494
+ }
4495
+
4496
+ /**
4497
+ * 插入接口
4498
+ * @param name 接口名称,如果不填会自动生成一个唯一名称
4499
+ */
4500
+ insertInterfaceInInterfacesAt(name: string, index: number): Interface;
4501
+
4502
+ /**
4503
+ * 插入接口
4504
+ * @param itfaceOptions 接口参数
4505
+ */
4506
+ insertInterfaceInInterfacesAt(itfaceOptions: Partial<Interface>, index: number): Interface;
4507
+
4508
+ /**
4509
+ * 插入接口
4510
+ * @param itface 已有的接口实例
4511
+ */
4512
+ insertInterfaceInInterfacesAt(itface: Interface, index: number): Interface;
4513
+
4514
+ insertInterfaceInInterfacesAt(options: string | Partial<Interface> | Interface, index: number) {
4515
+ const node = this._insertInterfaceInInterfacesAt(options as any, index);
4516
+ node.create({
4517
+ index,
4518
+ parentNode: this,
4519
+ parentKey: 'interfaces',
4520
+ });
4521
+ return node;
4522
+ }
4523
+
4524
+ /**
4525
+ * 添加接口
4526
+ * @internal
4527
+ * @param name 接口名称,如果不填会自动生成一个唯一名称
4528
+ */
4529
+ _addInterfaceInInterfaces(name?: string): Interface;
4530
+
4531
+ /**
4532
+ * 添加接口
4533
+ * @internal
4534
+ * @param itfaceOptions 接口参数
4535
+ */
4536
+ _addInterfaceInInterfaces(itfaceOptions: Partial<Interface>): Interface;
4537
+
4538
+ /**
4539
+ * 添加接口
4540
+ * @internal
4541
+ * @param itface 已有的接口实例
4542
+ */
4543
+ _addInterfaceInInterfaces(itface: Interface): Interface;
4544
+
4545
+ _addInterfaceInInterfaces(options?: string | Partial<Interface> | Interface) {
4546
+ const index = 0;
4547
+ return this._insertInterfaceInInterfacesAt(options as any, index);
4548
+ }
4549
+
4550
+ /**
4551
+ * 添加接口
4552
+ * @internal
4553
+ * @param name 接口名称,如果不填会自动生成一个唯一名称
4554
+ */
4555
+ addInterfaceInInterfaces(name?: string): Interface;
4556
+
4557
+ /**
4558
+ * 添加接口
4559
+ * @param itfaceOptions 接口参数
4560
+ */
4561
+ addInterfaceInInterfaces(itfaceOptions: Partial<Interface>): Interface;
4562
+
4563
+ /**
4564
+ * 添加接口
4565
+ * @param itface 已有的接口实例
4566
+ */
4567
+ addInterfaceInInterfaces(itface: Interface): Interface;
4568
+
4569
+ addInterfaceInInterfaces(options?: string | Partial<Interface> | Interface) {
4570
+ const node = this._addInterfaceInInterfaces(options as any);
4571
+ const index = this.interfaces.indexOf(node);
4572
+ node.create({
4573
+ index,
4574
+ parentNode: this,
4575
+ parentKey: 'interfaces',
4576
+ });
4577
+ return node;
4578
+ }
4579
+
4580
+ /**
4581
+ * 插入鉴权接口
4582
+ * @internal
4583
+ * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
4584
+ */
4585
+ _insertAuthInterfaceInInterfacesAt(name: string, index: number): AuthInterface;
4586
+
4587
+ /**
4588
+ * 插入鉴权接口
4589
+ * @internal
4590
+ * @param itfaceOptions 鉴权接口参数
4591
+ */
4592
+ _insertAuthInterfaceInInterfacesAt(itfaceOptions: Partial<AuthInterface>, index: number): AuthInterface;
4593
+
4594
+ /**
4595
+ * 插入鉴权接口
4596
+ * @internal
4597
+ * @param itface 已有的鉴权接口实例
4598
+ */
4599
+ _insertAuthInterfaceInInterfacesAt(itface: AuthInterface, index: number): AuthInterface;
4600
+
4601
+ _insertAuthInterfaceInInterfacesAt(options: string | Partial<AuthInterface> | AuthInterface, index: number) {
4602
+ const itfaceOptions: any = {};
4603
+ const relationOptions = { parentNode: this, parentKey: 'interfaces' };
4604
+ let itface: AuthInterface;
4605
+ if (!options) {
4606
+ itface = AuthInterface.from(
4607
+ {
4608
+ ...itfaceOptions,
4609
+ name: this.getAuthInterfaceUniqueName(),
4610
+ },
4611
+ this,
4612
+ 'interfaces',
4613
+ );
4614
+ } else if (typeof options === 'string') {
4615
+ itface = AuthInterface.from(
4616
+ {
4617
+ ...itfaceOptions,
4618
+ name: options,
4619
+ },
4620
+ this,
4621
+ 'interfaces',
4622
+ );
4623
+ } else if (options instanceof AuthInterface) {
4624
+ options.ensureDelete(); // 同一实例不支持多处存在
4625
+ itface = options;
4626
+ Object.assign(itface, relationOptions);
4627
+ } else {
4628
+ itface = AuthInterface.from(
4629
+ {
4630
+ ...itfaceOptions,
4631
+ ...options,
4632
+ },
4633
+ this,
4634
+ 'interfaces',
4635
+ );
4636
+ }
4637
+ this.interfaces.splice(index, 0, itface);
4638
+ return itface;
4639
+ }
4640
+
4641
+ /**
4642
+ * 插入鉴权接口
4643
+ * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
4644
+ */
4645
+ insertAuthInterfaceInInterfacesAt(name: string, index: number): AuthInterface;
4646
+
4647
+ /**
4648
+ * 插入鉴权接口
4649
+ * @param itfaceOptions 鉴权接口参数
4650
+ */
4651
+ insertAuthInterfaceInInterfacesAt(itfaceOptions: Partial<AuthInterface>, index: number): AuthInterface;
4652
+
4653
+ /**
4654
+ * 插入鉴权接口
4655
+ * @param itface 已有的鉴权接口实例
4656
+ */
4657
+ insertAuthInterfaceInInterfacesAt(itface: AuthInterface, index: number): AuthInterface;
4658
+
4659
+ insertAuthInterfaceInInterfacesAt(options: string | Partial<AuthInterface> | AuthInterface, index: number) {
4660
+ const node = this._insertAuthInterfaceInInterfacesAt(options as any, index);
4661
+ node.create({
4662
+ index,
4663
+ parentNode: this,
4664
+ parentKey: 'interfaces',
4665
+ });
4666
+ return node;
4667
+ }
4668
+
4669
+ /**
4670
+ * 添加鉴权接口
4671
+ * @internal
4672
+ * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
4673
+ */
4674
+ _addAuthInterfaceInInterfaces(name?: string): AuthInterface;
4675
+
4676
+ /**
4677
+ * 添加鉴权接口
4678
+ * @internal
4679
+ * @param itfaceOptions 鉴权接口参数
4680
+ */
4681
+ _addAuthInterfaceInInterfaces(itfaceOptions: Partial<AuthInterface>): AuthInterface;
4682
+
4683
+ /**
4684
+ * 添加鉴权接口
4685
+ * @internal
4686
+ * @param itface 已有的鉴权接口实例
4687
+ */
4688
+ _addAuthInterfaceInInterfaces(itface: AuthInterface): AuthInterface;
4689
+
4690
+ _addAuthInterfaceInInterfaces(options?: string | Partial<AuthInterface> | AuthInterface) {
4691
+ const index = 0;
4692
+ return this._insertAuthInterfaceInInterfacesAt(options as any, index);
4693
+ }
4694
+
4695
+ /**
4696
+ * 添加鉴权接口
4697
+ * @internal
4698
+ * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
4699
+ */
4700
+ addAuthInterfaceInInterfaces(name?: string): AuthInterface;
4701
+
4702
+ /**
4703
+ * 添加鉴权接口
4704
+ * @param itfaceOptions 鉴权接口参数
4705
+ */
4706
+ addAuthInterfaceInInterfaces(itfaceOptions: Partial<AuthInterface>): AuthInterface;
4707
+
4708
+ /**
4709
+ * 添加鉴权接口
4710
+ * @param itface 已有的鉴权接口实例
4711
+ */
4712
+ addAuthInterfaceInInterfaces(itface: AuthInterface): AuthInterface;
4713
+
4714
+ addAuthInterfaceInInterfaces(options?: string | Partial<AuthInterface> | AuthInterface) {
4715
+ const node = this._addAuthInterfaceInInterfaces(options as any);
4716
+ const index = this.interfaces.indexOf(node);
4717
+ node.create({
4718
+ index,
4719
+ parentNode: this,
4720
+ parentKey: 'interfaces',
4721
+ });
4722
+ return node;
4723
+ }
4724
+
4725
+ /**
4726
+ * 删除鉴权接口
4727
+ * @param name 鉴权接口名称
4728
+ */
4729
+ removeAuthInterfaceInInterfaces(name: string): void;
4730
+
4731
+ /**
4732
+ * 删除鉴权接口
4733
+ * @param itface 已有的鉴权接口实例
4734
+ */
4735
+ removeAuthInterfaceInInterfaces(itface: AuthInterface): void;
4736
+
4737
+ removeAuthInterfaceInInterfaces(options: string | AuthInterface) {
4738
+ let itface: AuthInterface;
4739
+ if (typeof options === 'string') {
4740
+ itface = (this.interfaces as AuthInterface[]).find((item) => item.name === options);
4741
+ if (!itface) {
4742
+ throw new Error('找不到鉴权接口 ' + options);
4743
+ }
4744
+ } else {
4745
+ itface = options;
4746
+ }
4747
+ return itface.delete();
4748
+ }
4749
+
4750
+ __removeInterface(itface: Interface) {
4751
+ const parentKey = itface.parentKey;
4752
+ const params: Params = {
4753
+ parentNode: this,
4754
+ parentKey,
4755
+ index: -1,
4756
+ object: null,
4757
+ oldObject: itface,
4758
+ };
4759
+ if (parentKey) {
4760
+ params.parentKey = parentKey;
4761
+ if (Array.isArray((this as any)[parentKey])) {
4762
+ const index = (this as any)[parentKey].indexOf(itface);
4763
+ ~index && (this as any)[parentKey].splice(index, 1);
4764
+ params.index = index;
4765
+ } else if ((this as any)[parentKey] === itface) {
4766
+ params.index = 0;
4767
+ (this as any)[parentKey] = undefined;
4768
+ }
4769
+ }
4770
+ return params;
4771
+ }
4502
4772
  /** hank */
4503
4773
  // setConnector() {
4504
4774
  // const [a, b, c, d, e, f] = this.connections;