@lcap/nasl 3.7.0-alpha.1 → 3.7.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (832) hide show
  1. package/out/automate/engine/utils.d.ts +1 -1
  2. package/out/automate/engine/utils.js +3 -7
  3. package/out/automate/engine/utils.js.map +1 -1
  4. package/out/automate/template/myProcess.js +65 -65
  5. package/out/automate/template/myProcess.js.map +1 -1
  6. package/out/bak/translator.js +42 -12
  7. package/out/bak/translator.js.map +1 -1
  8. package/out/breakpoint/generator/BreakpointNode.d.ts +2 -0
  9. package/out/breakpoint/generator/BreakpointNode.js +7 -0
  10. package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
  11. package/out/breakpoint/shared/constants.js +1 -0
  12. package/out/breakpoint/shared/constants.js.map +1 -1
  13. package/out/breakpoint/shared/utils.js +1 -1
  14. package/out/breakpoint/shared/utils.js.map +1 -1
  15. package/out/common/BaseNode.d.ts +4 -3
  16. package/out/common/BaseNode.js +61 -10
  17. package/out/common/BaseNode.js.map +1 -1
  18. package/out/common/ComponentAPI.d.ts +5 -3
  19. package/out/common/EventEmitter.d.ts +1 -0
  20. package/out/common/EventEmitter.js.map +1 -1
  21. package/out/concepts/Abort__.d.ts +5 -4
  22. package/out/concepts/Abort__.js +5 -7
  23. package/out/concepts/Abort__.js.map +1 -1
  24. package/out/concepts/AbstractInterface__.d.ts +9 -6
  25. package/out/concepts/AbstractInterface__.js +8 -11
  26. package/out/concepts/AbstractInterface__.js.map +1 -1
  27. package/out/concepts/Anchor__.d.ts +5 -12
  28. package/out/concepts/Anchor__.js +5 -44
  29. package/out/concepts/Anchor__.js.map +1 -1
  30. package/out/concepts/AnonymousFunction__.d.ts +10 -47
  31. package/out/concepts/AnonymousFunction__.js +14 -159
  32. package/out/concepts/AnonymousFunction__.js.map +1 -1
  33. package/out/concepts/App__.d.ts +321 -437
  34. package/out/concepts/App__.js +460 -986
  35. package/out/concepts/App__.js.map +1 -1
  36. package/out/concepts/Argument__.d.ts +5 -12
  37. package/out/concepts/Argument__.js +11 -46
  38. package/out/concepts/Argument__.js.map +1 -1
  39. package/out/concepts/Assignee__.d.ts +8 -5
  40. package/out/concepts/Assignee__.js +9 -66
  41. package/out/concepts/Assignee__.js.map +1 -1
  42. package/out/concepts/AssignmentLine__.d.ts +5 -6
  43. package/out/concepts/AssignmentLine__.js +7 -11
  44. package/out/concepts/AssignmentLine__.js.map +1 -1
  45. package/out/concepts/Assignment__.d.ts +5 -26
  46. package/out/concepts/Assignment__.js +5 -64
  47. package/out/concepts/Assignment__.js.map +1 -1
  48. package/out/concepts/Attribute__.d.ts +14 -51
  49. package/out/concepts/Attribute__.js +36 -126
  50. package/out/concepts/Attribute__.js.map +1 -1
  51. package/out/concepts/AuthInterface__.d.ts +10 -10
  52. package/out/concepts/AuthInterface__.js +18 -13
  53. package/out/concepts/AuthInterface__.js.map +1 -1
  54. package/out/concepts/AuthLogicForCallInterface__.d.ts +6 -3
  55. package/out/concepts/AuthLogicForCallInterface__.js +6 -32
  56. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  57. package/out/concepts/AuthLogic__.d.ts +19 -19
  58. package/out/concepts/AuthLogic__.js +26 -25
  59. package/out/concepts/AuthLogic__.js.map +1 -1
  60. package/out/concepts/BackendVariable__.d.ts +19 -47
  61. package/out/concepts/BackendVariable__.js +43 -134
  62. package/out/concepts/BackendVariable__.js.map +1 -1
  63. package/out/concepts/Backend__.d.ts +6 -13
  64. package/out/concepts/Backend__.js +13 -50
  65. package/out/concepts/Backend__.js.map +1 -1
  66. package/out/concepts/BaseSetter__.d.ts +25 -0
  67. package/out/concepts/BaseSetter__.js +53 -0
  68. package/out/concepts/BaseSetter__.js.map +1 -0
  69. package/out/concepts/BatchAssignment__.d.ts +9 -21
  70. package/out/concepts/BatchAssignment__.js +11 -86
  71. package/out/concepts/BatchAssignment__.js.map +1 -1
  72. package/out/concepts/BinaryExpression__.d.ts +5 -22
  73. package/out/concepts/BinaryExpression__.js +32 -59
  74. package/out/concepts/BinaryExpression__.js.map +1 -1
  75. package/out/concepts/BindAttribute__.d.ts +60 -107
  76. package/out/concepts/BindAttribute__.js +144 -251
  77. package/out/concepts/BindAttribute__.js.map +1 -1
  78. package/out/concepts/BindDirective__.d.ts +26 -42
  79. package/out/concepts/BindDirective__.js +63 -105
  80. package/out/concepts/BindDirective__.js.map +1 -1
  81. package/out/concepts/BindEvent__.d.ts +27 -36
  82. package/out/concepts/BindEvent__.js +50 -109
  83. package/out/concepts/BindEvent__.js.map +1 -1
  84. package/out/concepts/BindStyle__.d.ts +24 -41
  85. package/out/concepts/BindStyle__.js +48 -88
  86. package/out/concepts/BindStyle__.js.map +1 -1
  87. package/out/concepts/Block__.d.ts +5 -2
  88. package/out/concepts/Block__.js +5 -31
  89. package/out/concepts/Block__.js.map +1 -1
  90. package/out/concepts/BooleanLiteral__.d.ts +5 -0
  91. package/out/concepts/BooleanLiteral__.js +8 -1
  92. package/out/concepts/BooleanLiteral__.js.map +1 -1
  93. package/out/concepts/BusinessComponent__.d.ts +47 -49
  94. package/out/concepts/BusinessComponent__.js +122 -444
  95. package/out/concepts/BusinessComponent__.js.map +1 -1
  96. package/out/concepts/BusinessLogic__.d.ts +5 -0
  97. package/out/concepts/BusinessLogic__.js +8 -1
  98. package/out/concepts/BusinessLogic__.js.map +1 -1
  99. package/out/concepts/CallAuthInterface__.d.ts +6 -4
  100. package/out/concepts/CallAuthInterface__.js +6 -34
  101. package/out/concepts/CallAuthInterface__.js.map +1 -1
  102. package/out/concepts/CallConnector__.d.ts +5 -0
  103. package/out/concepts/CallConnector__.js +11 -2
  104. package/out/concepts/CallConnector__.js.map +1 -1
  105. package/out/concepts/CallEvent__.d.ts +6 -7
  106. package/out/concepts/CallEvent__.js +11 -40
  107. package/out/concepts/CallEvent__.js.map +1 -1
  108. package/out/concepts/CallFunction__.d.ts +17 -9
  109. package/out/concepts/CallFunction__.js +84 -130
  110. package/out/concepts/CallFunction__.js.map +1 -1
  111. package/out/concepts/CallInterface__.d.ts +6 -7
  112. package/out/concepts/CallInterface__.js +14 -41
  113. package/out/concepts/CallInterface__.js.map +1 -1
  114. package/out/concepts/CallLogic__.d.ts +11 -24
  115. package/out/concepts/CallLogic__.js +68 -140
  116. package/out/concepts/CallLogic__.js.map +1 -1
  117. package/out/concepts/CallQueryComponent__.d.ts +70 -126
  118. package/out/concepts/CallQueryComponent__.js +134 -308
  119. package/out/concepts/CallQueryComponent__.js.map +1 -1
  120. package/out/concepts/CapsulesSetter__.d.ts +109 -0
  121. package/out/concepts/CapsulesSetter__.js +163 -0
  122. package/out/concepts/CapsulesSetter__.js.map +1 -0
  123. package/out/concepts/Comment__.d.ts +5 -0
  124. package/out/concepts/Comment__.js +8 -1
  125. package/out/concepts/Comment__.js.map +1 -1
  126. package/out/concepts/CompletionProperty__.d.ts +6 -26
  127. package/out/concepts/CompletionProperty__.js +24 -74
  128. package/out/concepts/CompletionProperty__.js.map +1 -1
  129. package/out/concepts/ConfigGroup__.d.ts +6 -13
  130. package/out/concepts/ConfigGroup__.js +13 -50
  131. package/out/concepts/ConfigGroup__.js.map +1 -1
  132. package/out/concepts/ConfigPropertyValue__.d.ts +5 -11
  133. package/out/concepts/ConfigPropertyValue__.js +11 -19
  134. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  135. package/out/concepts/ConfigProperty__.d.ts +11 -18
  136. package/out/concepts/ConfigProperty__.js +25 -58
  137. package/out/concepts/ConfigProperty__.js.map +1 -1
  138. package/out/concepts/Configuration__.d.ts +6 -13
  139. package/out/concepts/Configuration__.js +6 -49
  140. package/out/concepts/Configuration__.js.map +1 -1
  141. package/out/concepts/Connection__.d.ts +11 -18
  142. package/out/concepts/Connection__.js +25 -58
  143. package/out/concepts/Connection__.js.map +1 -1
  144. package/out/concepts/ConnectorTrigger__.d.ts +28 -34
  145. package/out/concepts/ConnectorTrigger__.js +55 -50
  146. package/out/concepts/ConnectorTrigger__.js.map +1 -1
  147. package/out/concepts/Connector__.d.ts +106 -504
  148. package/out/concepts/Connector__.js +134 -791
  149. package/out/concepts/Connector__.js.map +1 -1
  150. package/out/concepts/Constant__.d.ts +27 -55
  151. package/out/concepts/Constant__.js +45 -137
  152. package/out/concepts/Constant__.js.map +1 -1
  153. package/out/concepts/CountersignPolicy__.d.ts +6 -5
  154. package/out/concepts/CountersignPolicy__.js +8 -12
  155. package/out/concepts/CountersignPolicy__.js.map +1 -1
  156. package/out/concepts/DataSource__.d.ts +11 -18
  157. package/out/concepts/DataSource__.js +25 -58
  158. package/out/concepts/DataSource__.js.map +1 -1
  159. package/out/concepts/DatabaseTypeAnnotation__.d.ts +5 -6
  160. package/out/concepts/DatabaseTypeAnnotation__.js +11 -13
  161. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
  162. package/out/concepts/DefaultValue__.d.ts +7 -19
  163. package/out/concepts/DefaultValue__.js +6 -56
  164. package/out/concepts/DefaultValue__.js.map +1 -1
  165. package/out/concepts/Destination__.d.ts +10 -21
  166. package/out/concepts/Destination__.js +15 -55
  167. package/out/concepts/Destination__.js.map +1 -1
  168. package/out/concepts/End__.d.ts +5 -4
  169. package/out/concepts/End__.js +7 -8
  170. package/out/concepts/End__.js.map +1 -1
  171. package/out/concepts/EntityIndex__.d.ts +20 -26
  172. package/out/concepts/EntityIndex__.js +40 -39
  173. package/out/concepts/EntityIndex__.js.map +1 -1
  174. package/out/concepts/EntityProperty__.d.ts +17 -56
  175. package/out/concepts/EntityProperty__.js +70 -181
  176. package/out/concepts/EntityProperty__.js.map +1 -1
  177. package/out/concepts/Entity__.d.ts +18 -26
  178. package/out/concepts/Entity__.js +38 -98
  179. package/out/concepts/Entity__.js.map +1 -1
  180. package/out/concepts/EnumItem__.d.ts +15 -21
  181. package/out/concepts/EnumItem__.js +27 -31
  182. package/out/concepts/EnumItem__.js.map +1 -1
  183. package/out/concepts/EnumSelectSetter__.d.ts +109 -0
  184. package/out/concepts/EnumSelectSetter__.js +163 -0
  185. package/out/concepts/EnumSelectSetter__.js.map +1 -0
  186. package/out/concepts/Enum__.d.ts +10 -28
  187. package/out/concepts/Enum__.js +35 -102
  188. package/out/concepts/Enum__.js.map +1 -1
  189. package/out/concepts/EventDeclaration__.d.ts +41 -0
  190. package/out/concepts/EventDeclaration__.js +81 -0
  191. package/out/concepts/EventDeclaration__.js.map +1 -0
  192. package/out/concepts/Event__.d.ts +16 -27
  193. package/out/concepts/Event__.js +37 -78
  194. package/out/concepts/Event__.js.map +1 -1
  195. package/out/concepts/ExternalDestination__.d.ts +8 -25
  196. package/out/concepts/ExternalDestination__.js +8 -58
  197. package/out/concepts/ExternalDestination__.js.map +1 -1
  198. package/out/concepts/ForEachStatement__.d.ts +7 -55
  199. package/out/concepts/ForEachStatement__.js +6 -128
  200. package/out/concepts/ForEachStatement__.js.map +1 -1
  201. package/out/concepts/FrontendLibrary__.d.ts +38 -46
  202. package/out/concepts/FrontendLibrary__.js +55 -121
  203. package/out/concepts/FrontendLibrary__.js.map +1 -1
  204. package/out/concepts/FrontendType__.d.ts +8 -12
  205. package/out/concepts/FrontendType__.js +15 -109
  206. package/out/concepts/FrontendType__.js.map +1 -1
  207. package/out/concepts/FrontendVariable__.d.ts +5 -0
  208. package/out/concepts/FrontendVariable__.js +8 -1
  209. package/out/concepts/FrontendVariable__.js.map +1 -1
  210. package/out/concepts/Frontend__.d.ts +9 -41
  211. package/out/concepts/Frontend__.js +36 -209
  212. package/out/concepts/Frontend__.js.map +1 -1
  213. package/out/concepts/Function__.d.ts +13 -34
  214. package/out/concepts/Function__.js +22 -194
  215. package/out/concepts/Function__.js.map +1 -1
  216. package/out/concepts/I18nInfo__.d.ts +6 -7
  217. package/out/concepts/I18nInfo__.js +14 -14
  218. package/out/concepts/I18nInfo__.js.map +1 -1
  219. package/out/concepts/IconSetter__.d.ts +29 -0
  220. package/out/concepts/IconSetter__.js +62 -0
  221. package/out/concepts/IconSetter__.js.map +1 -0
  222. package/out/concepts/Identifier__.d.ts +5 -0
  223. package/out/concepts/Identifier__.js +20 -6
  224. package/out/concepts/Identifier__.js.map +1 -1
  225. package/out/concepts/IfStatement__.d.ts +5 -12
  226. package/out/concepts/IfStatement__.js +5 -44
  227. package/out/concepts/IfStatement__.js.map +1 -1
  228. package/out/concepts/ImageSetter__.d.ts +25 -0
  229. package/out/concepts/ImageSetter__.js +53 -0
  230. package/out/concepts/ImageSetter__.js.map +1 -0
  231. package/out/concepts/ImportedInterface__.d.ts +9 -0
  232. package/out/concepts/ImportedInterface__.js +11 -1
  233. package/out/concepts/ImportedInterface__.js.map +1 -1
  234. package/out/concepts/InputSetter__.d.ts +29 -0
  235. package/out/concepts/InputSetter__.js +62 -0
  236. package/out/concepts/InputSetter__.js.map +1 -0
  237. package/out/concepts/Integration__.d.ts +7 -26
  238. package/out/concepts/Integration__.js +6 -93
  239. package/out/concepts/Integration__.js.map +1 -1
  240. package/out/concepts/InterfaceParam__.d.ts +34 -62
  241. package/out/concepts/InterfaceParam__.js +63 -147
  242. package/out/concepts/InterfaceParam__.js.map +1 -1
  243. package/out/concepts/Interface__.d.ts +42 -48
  244. package/out/concepts/Interface__.js +89 -158
  245. package/out/concepts/Interface__.js.map +1 -1
  246. package/out/concepts/JSBlock__.d.ts +5 -4
  247. package/out/concepts/JSBlock__.js +8 -8
  248. package/out/concepts/JSBlock__.js.map +1 -1
  249. package/out/concepts/JavaLogic__.d.ts +5 -0
  250. package/out/concepts/JavaLogic__.js +14 -3
  251. package/out/concepts/JavaLogic__.js.map +1 -1
  252. package/out/concepts/LogicDeclaration__.d.ts +289 -0
  253. package/out/concepts/LogicDeclaration__.js +352 -0
  254. package/out/concepts/LogicDeclaration__.js.map +1 -0
  255. package/out/concepts/LogicItem__.d.ts +39 -45
  256. package/out/concepts/LogicItem__.js +76 -62
  257. package/out/concepts/LogicItem__.js.map +1 -1
  258. package/out/concepts/Logic__.d.ts +45 -63
  259. package/out/concepts/Logic__.js +159 -280
  260. package/out/concepts/Logic__.js.map +1 -1
  261. package/out/concepts/MatchCase__.d.ts +6 -4
  262. package/out/concepts/MatchCase__.js +16 -68
  263. package/out/concepts/MatchCase__.js.map +1 -1
  264. package/out/concepts/Match__.d.ts +8 -14
  265. package/out/concepts/Match__.js +17 -49
  266. package/out/concepts/Match__.js.map +1 -1
  267. package/out/concepts/MemberExpression__.d.ts +8 -23
  268. package/out/concepts/MemberExpression__.js +85 -103
  269. package/out/concepts/MemberExpression__.js.map +1 -1
  270. package/out/concepts/MetadataType__.d.ts +36 -54
  271. package/out/concepts/MetadataType__.js +44 -119
  272. package/out/concepts/MetadataType__.js.map +1 -1
  273. package/out/concepts/MicroApp__.d.ts +5 -6
  274. package/out/concepts/MicroApp__.js +30 -18
  275. package/out/concepts/MicroApp__.js.map +1 -1
  276. package/out/concepts/Module__.d.ts +99 -128
  277. package/out/concepts/Module__.js +133 -532
  278. package/out/concepts/Module__.js.map +1 -1
  279. package/out/concepts/MsgTriggerEvent__.d.ts +31 -33
  280. package/out/concepts/MsgTriggerEvent__.js +39 -67
  281. package/out/concepts/MsgTriggerEvent__.js.map +1 -1
  282. package/out/concepts/MsgTriggerLauncher__.d.ts +11 -14
  283. package/out/concepts/MsgTriggerLauncher__.js +18 -44
  284. package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
  285. package/out/concepts/MultiApprovalPolicy__.d.ts +8 -9
  286. package/out/concepts/MultiApprovalPolicy__.js +7 -13
  287. package/out/concepts/MultiApprovalPolicy__.js.map +1 -1
  288. package/out/concepts/Namespace__.d.ts +112 -138
  289. package/out/concepts/Namespace__.js +122 -501
  290. package/out/concepts/Namespace__.js.map +1 -1
  291. package/out/concepts/NewComposite__.d.ts +11 -21
  292. package/out/concepts/NewComposite__.js +48 -146
  293. package/out/concepts/NewComposite__.js.map +1 -1
  294. package/out/concepts/NewList__.d.ts +6 -14
  295. package/out/concepts/NewList__.js +7 -77
  296. package/out/concepts/NewList__.js.map +1 -1
  297. package/out/concepts/NewMap__.d.ts +6 -14
  298. package/out/concepts/NewMap__.js +7 -77
  299. package/out/concepts/NewMap__.js.map +1 -1
  300. package/out/concepts/New__.d.ts +6 -0
  301. package/out/concepts/New__.js +9 -0
  302. package/out/concepts/New__.js.map +1 -1
  303. package/out/concepts/NullLiteral__.d.ts +5 -0
  304. package/out/concepts/NullLiteral__.js +5 -0
  305. package/out/concepts/NullLiteral__.js.map +1 -1
  306. package/out/concepts/NumberInputSetter__.d.ts +45 -0
  307. package/out/concepts/NumberInputSetter__.js +98 -0
  308. package/out/concepts/NumberInputSetter__.js.map +1 -0
  309. package/out/concepts/NumericLiteral__.d.ts +6 -13
  310. package/out/concepts/NumericLiteral__.js +8 -45
  311. package/out/concepts/NumericLiteral__.js.map +1 -1
  312. package/out/concepts/OqlQueryComponent__.d.ts +7 -17
  313. package/out/concepts/OqlQueryComponent__.js +16 -53
  314. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  315. package/out/concepts/OverriddenLogic__.d.ts +38 -59
  316. package/out/concepts/OverriddenLogic__.js +55 -252
  317. package/out/concepts/OverriddenLogic__.js.map +1 -1
  318. package/out/concepts/Paginate__.d.ts +59 -0
  319. package/out/concepts/Paginate__.js +158 -0
  320. package/out/concepts/Paginate__.js.map +1 -0
  321. package/out/concepts/ParamWithGroup__.d.ts +13 -10
  322. package/out/concepts/ParamWithGroup__.js +15 -6
  323. package/out/concepts/ParamWithGroup__.js.map +1 -1
  324. package/out/concepts/Param__.d.ts +33 -76
  325. package/out/concepts/Param__.js +63 -159
  326. package/out/concepts/Param__.js.map +1 -1
  327. package/out/concepts/Point__.d.ts +5 -6
  328. package/out/concepts/Point__.js +11 -13
  329. package/out/concepts/Point__.js.map +1 -1
  330. package/out/concepts/ProcessComponent__.d.ts +12 -20
  331. package/out/concepts/ProcessComponent__.js +32 -90
  332. package/out/concepts/ProcessComponent__.js.map +1 -1
  333. package/out/concepts/ProcessElement__.d.ts +21 -66
  334. package/out/concepts/ProcessElement__.js +48 -360
  335. package/out/concepts/ProcessElement__.js.map +1 -1
  336. package/out/concepts/ProcessOutcome__.d.ts +5 -4
  337. package/out/concepts/ProcessOutcome__.js +8 -8
  338. package/out/concepts/ProcessOutcome__.js.map +1 -1
  339. package/out/concepts/ProcessOutcomes__.d.ts +5 -4
  340. package/out/concepts/ProcessOutcomes__.js +6 -7
  341. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  342. package/out/concepts/Process__.d.ts +16 -26
  343. package/out/concepts/Process__.js +29 -186
  344. package/out/concepts/Process__.js.map +1 -1
  345. package/out/concepts/PropDeclaration__.d.ts +99 -0
  346. package/out/concepts/PropDeclaration__.js +183 -0
  347. package/out/concepts/PropDeclaration__.js.map +1 -0
  348. package/out/concepts/PropertySelectSetter__.d.ts +25 -0
  349. package/out/concepts/PropertySelectSetter__.js +53 -0
  350. package/out/concepts/PropertySelectSetter__.js.map +1 -0
  351. package/out/concepts/QueryAggregateExpression__.d.ts +6 -13
  352. package/out/concepts/QueryAggregateExpression__.js +11 -46
  353. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  354. package/out/concepts/QueryFieldExpression__.d.ts +5 -0
  355. package/out/concepts/QueryFieldExpression__.js +17 -4
  356. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  357. package/out/concepts/QueryFromExpression__.d.ts +6 -3
  358. package/out/concepts/QueryFromExpression__.js +14 -34
  359. package/out/concepts/QueryFromExpression__.js.map +1 -1
  360. package/out/concepts/QueryGroupByExpression__.d.ts +5 -12
  361. package/out/concepts/QueryGroupByExpression__.js +5 -44
  362. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  363. package/out/concepts/QueryJoinExpression__.d.ts +29 -26
  364. package/out/concepts/QueryJoinExpression__.js +34 -52
  365. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  366. package/out/concepts/QueryLimitExpression__.d.ts +5 -22
  367. package/out/concepts/QueryLimitExpression__.js +5 -57
  368. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  369. package/out/concepts/QueryOrderByExpression__.d.ts +5 -22
  370. package/out/concepts/QueryOrderByExpression__.js +5 -57
  371. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  372. package/out/concepts/QuerySelectExpression__.d.ts +37 -34
  373. package/out/concepts/QuerySelectExpression__.js +37 -59
  374. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  375. package/out/concepts/Rect__.d.ts +5 -6
  376. package/out/concepts/Rect__.js +17 -15
  377. package/out/concepts/Rect__.js.map +1 -1
  378. package/out/concepts/Return__.d.ts +28 -56
  379. package/out/concepts/Return__.js +50 -139
  380. package/out/concepts/Return__.js.map +1 -1
  381. package/out/concepts/Role__.d.ts +5 -11
  382. package/out/concepts/Role__.js +21 -21
  383. package/out/concepts/Role__.js.map +1 -1
  384. package/out/concepts/SelectMembers__.d.ts +8 -20
  385. package/out/concepts/SelectMembers__.js +10 -58
  386. package/out/concepts/SelectMembers__.js.map +1 -1
  387. package/out/concepts/SequentialPolicy__.d.ts +5 -0
  388. package/out/concepts/SequentialPolicy__.js +5 -0
  389. package/out/concepts/SequentialPolicy__.js.map +1 -1
  390. package/out/concepts/SetterOption__.d.ts +49 -0
  391. package/out/concepts/SetterOption__.js +99 -0
  392. package/out/concepts/SetterOption__.js.map +1 -0
  393. package/out/concepts/SlotDeclaration__.d.ts +213 -0
  394. package/out/concepts/SlotDeclaration__.js +287 -0
  395. package/out/concepts/SlotDeclaration__.js.map +1 -0
  396. package/out/concepts/Slot__.d.ts +7 -31
  397. package/out/concepts/Slot__.js +27 -72
  398. package/out/concepts/Slot__.js.map +1 -1
  399. package/out/concepts/SqlQueryComponent__.d.ts +6 -17
  400. package/out/concepts/SqlQueryComponent__.js +14 -54
  401. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  402. package/out/concepts/Start__.d.ts +5 -4
  403. package/out/concepts/Start__.js +5 -7
  404. package/out/concepts/Start__.js.map +1 -1
  405. package/out/concepts/StaticString__.d.ts +6 -12
  406. package/out/concepts/StaticString__.js +14 -21
  407. package/out/concepts/StaticString__.js.map +1 -1
  408. package/out/concepts/StringInterpolation__.d.ts +5 -2
  409. package/out/concepts/StringInterpolation__.js +7 -33
  410. package/out/concepts/StringInterpolation__.js.map +1 -1
  411. package/out/concepts/StringLiteral__.d.ts +6 -1
  412. package/out/concepts/StringLiteral__.js +16 -2
  413. package/out/concepts/StringLiteral__.js.map +1 -1
  414. package/out/concepts/StructureProperty__.d.ts +13 -49
  415. package/out/concepts/StructureProperty__.js +35 -137
  416. package/out/concepts/StructureProperty__.js.map +1 -1
  417. package/out/concepts/Structure__.d.ts +13 -21
  418. package/out/concepts/Structure__.js +28 -90
  419. package/out/concepts/Structure__.js.map +1 -1
  420. package/out/concepts/SwitchCase__.d.ts +6 -13
  421. package/out/concepts/SwitchCase__.js +6 -45
  422. package/out/concepts/SwitchCase__.js.map +1 -1
  423. package/out/concepts/SwitchSetter__.d.ts +25 -0
  424. package/out/concepts/SwitchSetter__.js +53 -0
  425. package/out/concepts/SwitchSetter__.js.map +1 -0
  426. package/out/concepts/SwitchStatement__.d.ts +6 -3
  427. package/out/concepts/SwitchStatement__.js +5 -31
  428. package/out/concepts/SwitchStatement__.js.map +1 -1
  429. package/out/concepts/ThemeVariable__.d.ts +29 -0
  430. package/out/concepts/ThemeVariable__.js +58 -0
  431. package/out/concepts/ThemeVariable__.js.map +1 -0
  432. package/out/concepts/Theme__.d.ts +5 -6
  433. package/out/concepts/Theme__.js +11 -13
  434. package/out/concepts/Theme__.js.map +1 -1
  435. package/out/concepts/Transactional__.d.ts +29 -35
  436. package/out/concepts/Transactional__.js +54 -56
  437. package/out/concepts/Transactional__.js.map +1 -1
  438. package/out/concepts/TriggerEvent__.d.ts +8 -20
  439. package/out/concepts/TriggerEvent__.js +13 -57
  440. package/out/concepts/TriggerEvent__.js.map +1 -1
  441. package/out/concepts/TriggerLauncher__.d.ts +12 -17
  442. package/out/concepts/TriggerLauncher__.js +30 -27
  443. package/out/concepts/TriggerLauncher__.js.map +1 -1
  444. package/out/concepts/TypeAnnotation__.d.ts +8 -11
  445. package/out/concepts/TypeAnnotation__.js +40 -89
  446. package/out/concepts/TypeAnnotation__.js.map +1 -1
  447. package/out/concepts/TypeParam__.d.ts +5 -0
  448. package/out/concepts/TypeParam__.js +12 -1
  449. package/out/concepts/TypeParam__.js.map +1 -1
  450. package/out/concepts/UnaryExpression__.d.ts +5 -12
  451. package/out/concepts/UnaryExpression__.js +8 -45
  452. package/out/concepts/UnaryExpression__.js.map +1 -1
  453. package/out/concepts/Unparsed__.d.ts +5 -0
  454. package/out/concepts/Unparsed__.js +8 -1
  455. package/out/concepts/Unparsed__.js.map +1 -1
  456. package/out/concepts/UseComponent__.d.ts +6 -7
  457. package/out/concepts/UseComponent__.js +11 -13
  458. package/out/concepts/UseComponent__.js.map +1 -1
  459. package/out/concepts/ValidationRule__.d.ts +7 -28
  460. package/out/concepts/ValidationRule__.js +18 -71
  461. package/out/concepts/ValidationRule__.js.map +1 -1
  462. package/out/concepts/Variable__.d.ts +30 -58
  463. package/out/concepts/Variable__.js +51 -140
  464. package/out/concepts/Variable__.js.map +1 -1
  465. package/out/concepts/ViewBlockWithImage__.d.ts +33 -0
  466. package/out/concepts/ViewBlockWithImage__.js +63 -0
  467. package/out/concepts/ViewBlockWithImage__.js.map +1 -0
  468. package/out/concepts/ViewBlock__.d.ts +11 -12
  469. package/out/concepts/ViewBlock__.js +22 -18
  470. package/out/concepts/ViewBlock__.js.map +1 -1
  471. package/out/concepts/ViewComponentDeclaration__.d.ts +721 -0
  472. package/out/concepts/ViewComponentDeclaration__.js +808 -0
  473. package/out/concepts/ViewComponentDeclaration__.js.map +1 -0
  474. package/out/concepts/ViewElement__.d.ts +38 -37
  475. package/out/concepts/ViewElement__.js +415 -432
  476. package/out/concepts/ViewElement__.js.map +1 -1
  477. package/out/concepts/View__.d.ts +39 -46
  478. package/out/concepts/View__.js +509 -342
  479. package/out/concepts/View__.js.map +1 -1
  480. package/out/concepts/WhileStatement__.d.ts +6 -13
  481. package/out/concepts/WhileStatement__.js +6 -45
  482. package/out/concepts/WhileStatement__.js.map +1 -1
  483. package/out/concepts/basics/stdlib/nasl.auth.js +68 -33
  484. package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
  485. package/out/concepts/basics/stdlib/nasl.process.js +101 -3
  486. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
  487. package/out/concepts/basics/stdlib/nasl.util.js +31 -31
  488. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  489. package/out/concepts/index__.d.ts +24 -8
  490. package/out/concepts/index__.js +24 -8
  491. package/out/concepts/index__.js.map +1 -1
  492. package/out/concepts/utils/asserts.d.ts +1079 -313
  493. package/out/concepts/utils/asserts.js +1461 -441
  494. package/out/concepts/utils/asserts.js.map +1 -1
  495. package/out/concepts/utils/types.d.ts +82 -30
  496. package/out/config.d.ts +9 -0
  497. package/out/config.js +5 -0
  498. package/out/config.js.map +1 -1
  499. package/out/decorators/index.d.ts +1 -6
  500. package/out/decorators/index.js +7 -16
  501. package/out/decorators/index.js.map +1 -1
  502. package/out/enums/KEYWORDS.js +2 -0
  503. package/out/enums/KEYWORDS.js.map +1 -1
  504. package/out/generator/genBundleFiles.d.ts +2 -0
  505. package/out/generator/genBundleFiles.js +105 -25
  506. package/out/generator/genBundleFiles.js.map +1 -1
  507. package/out/generator/genReleaseBody.d.ts +2 -4
  508. package/out/generator/genReleaseBody.js +0 -1
  509. package/out/generator/genReleaseBody.js.map +1 -1
  510. package/out/generator/permission.d.ts +5 -1
  511. package/out/generator/permission.js +3 -2
  512. package/out/generator/permission.js.map +1 -1
  513. package/out/index.d.ts +1 -0
  514. package/out/index.js +3 -1
  515. package/out/index.js.map +1 -1
  516. package/out/natural/genNaturalTS.js +2 -5
  517. package/out/natural/genNaturalTS.js.map +1 -1
  518. package/out/natural/index.d.ts +2 -0
  519. package/out/natural/index.js +2 -0
  520. package/out/natural/index.js.map +1 -1
  521. package/out/natural/naslStdlibMap.d.ts +1 -2
  522. package/out/natural/naslStdlibMap.js +32 -23
  523. package/out/natural/naslStdlibMap.js.map +1 -1
  524. package/out/natural/prompt/analyzeClaims.d.ts +1 -0
  525. package/out/natural/prompt/analyzeClaims.js +21 -0
  526. package/out/natural/prompt/analyzeClaims.js.map +1 -0
  527. package/out/natural/prompt/executeClaims.d.ts +1 -0
  528. package/out/natural/prompt/executeClaims.js +73 -0
  529. package/out/natural/prompt/executeClaims.js.map +1 -0
  530. package/out/natural/transformTSCode.js +13 -2
  531. package/out/natural/transformTSCode.js.map +1 -1
  532. package/out/server/createUiTs.d.ts +2 -1
  533. package/out/server/createUiTs.js +133 -161
  534. package/out/server/createUiTs.js.map +1 -1
  535. package/out/server/entity2LogicNamespace.js +1 -15
  536. package/out/server/entity2LogicNamespace.js.map +1 -1
  537. package/out/server/extendBaseNode.js +36 -9
  538. package/out/server/extendBaseNode.js.map +1 -1
  539. package/out/server/formatTsUtils.js +9 -9
  540. package/out/server/formatTsUtils.js.map +1 -1
  541. package/out/server/getConnector.d.ts +1 -0
  542. package/out/server/getConnector.js +38 -35
  543. package/out/server/getConnector.js.map +1 -1
  544. package/out/server/getFunctions.js +3 -3
  545. package/out/server/getFunctions.js.map +1 -1
  546. package/out/server/getLogics.js +51 -15
  547. package/out/server/getLogics.js.map +1 -1
  548. package/out/server/getMemberIdentifier.js +87 -144
  549. package/out/server/getMemberIdentifier.js.map +1 -1
  550. package/out/server/naslServer.d.ts +11 -1
  551. package/out/server/naslServer.js +118 -74
  552. package/out/server/naslServer.js.map +1 -1
  553. package/out/server/translator.js +24 -5
  554. package/out/server/translator.js.map +1 -1
  555. package/out/service/storage/init.d.ts +1 -0
  556. package/out/service/storage/init.js +12 -7
  557. package/out/service/storage/init.js.map +1 -1
  558. package/out/templator/genCreateBlock.js +16 -16
  559. package/out/templator/genCreateBlock.js.map +1 -1
  560. package/out/templator/genCurdEditMultipleKeyBlock.js +23 -23
  561. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  562. package/out/templator/genCurdMultipleKeyBlock.d.ts +2 -2
  563. package/out/templator/genCurdMultipleKeyBlock.js +28 -38
  564. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  565. package/out/templator/genEditTableBlock.js +15 -15
  566. package/out/templator/genEditTableBlock.js.map +1 -1
  567. package/out/templator/genEnumSelectBlock.js +8 -8
  568. package/out/templator/genEnumSelectBlock.js.map +1 -1
  569. package/out/templator/genGridViewBlock.js +18 -20
  570. package/out/templator/genGridViewBlock.js.map +1 -1
  571. package/out/templator/genListViewBlock.js +10 -10
  572. package/out/templator/genListViewBlock.js.map +1 -1
  573. package/out/templator/genQueryComponent.js +32 -37
  574. package/out/templator/genQueryComponent.js.map +1 -1
  575. package/out/templator/genSelectBlock.js +10 -10
  576. package/out/templator/genSelectBlock.js.map +1 -1
  577. package/out/templator/genTableBlock.js +18 -10
  578. package/out/templator/genTableBlock.js.map +1 -1
  579. package/out/templator/genUpdateBlock.js +15 -15
  580. package/out/templator/genUpdateBlock.js.map +1 -1
  581. package/out/templator/utils.d.ts +19 -24
  582. package/out/templator/utils.js +20 -30
  583. package/out/templator/utils.js.map +1 -1
  584. package/out/translator/types.d.ts +2 -0
  585. package/out/utils/index.d.ts +6 -1
  586. package/out/utils/index.js +37 -4
  587. package/out/utils/index.js.map +1 -1
  588. package/out/utils/string.d.ts +12 -0
  589. package/out/utils/string.js +15 -1
  590. package/out/utils/string.js.map +1 -1
  591. package/out/utils/time-slicing/performance.js +3 -3
  592. package/out/utils/time-slicing/performance.js.map +1 -1
  593. package/package.json +1 -1
  594. package/sandbox/stdlib/nasl.auth.ts +4 -0
  595. package/sandbox/stdlib/nasl.collection.ts +5 -3
  596. package/sandbox/stdlib/nasl.core.ts +16 -1
  597. package/sandbox/stdlib/nasl.oql.ts +2 -2
  598. package/sandbox/stdlib/nasl.process.ts +18 -0
  599. package/sandbox/stdlib/nasl.ui.components.h5.ts +1751 -0
  600. package/sandbox/stdlib/nasl.ui.components.pc.ts +3479 -0
  601. package/sandbox/stdlib/nasl.ui.definition.ts +53 -2688
  602. package/sandbox/stdlib/nasl.ui.ts +2 -1
  603. package/sandbox/stdlib/nasl.util.ts +7 -5
  604. package/sandbox-natural/stdlib/nasl.core.ts +3 -0
  605. package/sandbox-natural/stdlib/nasl.oql.ts +4 -3
  606. package/src/automate/engine/utils.js +3 -7
  607. package/src/automate/template/myProcess.js +65 -65
  608. package/src/bak/translator.js +62 -29
  609. package/src/breakpoint/generator/BreakpointNode.ts +9 -0
  610. package/src/breakpoint/shared/constants.ts +1 -0
  611. package/src/breakpoint/shared/utils.ts +1 -1
  612. package/src/common/BaseNode.ts +71 -9
  613. package/src/common/ComponentAPI.ts +6 -3
  614. package/src/common/EventEmitter.ts +1 -0
  615. package/src/concepts/Abort__.ts +8 -8
  616. package/src/concepts/AbstractInterface__.ts +14 -14
  617. package/src/concepts/Anchor__.ts +8 -60
  618. package/src/concepts/AnonymousFunction__.ts +21 -198
  619. package/src/concepts/App__.ts +1151 -1837
  620. package/src/concepts/Argument__.ts +16 -64
  621. package/src/concepts/Assignee__.ts +14 -72
  622. package/src/concepts/AssignmentLine__.ts +9 -14
  623. package/src/concepts/Assignment__.ts +9 -92
  624. package/src/concepts/Attribute__.ts +49 -176
  625. package/src/concepts/AuthInterface__.ts +19 -20
  626. package/src/concepts/AuthLogicForCallInterface__.ts +9 -36
  627. package/src/concepts/AuthLogic__.ts +45 -46
  628. package/src/concepts/BackendVariable__.ts +45 -167
  629. package/src/concepts/Backend__.ts +13 -57
  630. package/src/concepts/BaseSetter__.ts +72 -0
  631. package/src/concepts/BatchAssignment__.ts +18 -105
  632. package/src/concepts/BinaryExpression__.ts +36 -89
  633. package/src/concepts/BindAttribute__.ts +194 -343
  634. package/src/concepts/BindDirective__.ts +80 -135
  635. package/src/concepts/BindEvent__.ts +62 -126
  636. package/src/concepts/BindStyle__.ts +59 -112
  637. package/src/concepts/Block__.ts +8 -34
  638. package/src/concepts/BooleanLiteral__.ts +12 -5
  639. package/src/concepts/BusinessComponent__.ts +201 -502
  640. package/src/concepts/BusinessLogic__.ts +15 -15
  641. package/src/concepts/CallAuthInterface__.ts +10 -39
  642. package/src/concepts/CallConnector__.ts +15 -6
  643. package/src/concepts/CallEvent__.ts +16 -45
  644. package/src/concepts/CallFunction__.ts +104 -134
  645. package/src/concepts/CallInterface__.ts +20 -47
  646. package/src/concepts/CallLogic__.ts +93 -175
  647. package/src/concepts/CallQueryComponent__.ts +226 -520
  648. package/src/concepts/CapsulesSetter__.ts +254 -0
  649. package/src/concepts/Comment__.ts +11 -5
  650. package/src/concepts/CompletionProperty__.ts +29 -100
  651. package/src/concepts/ConfigGroup__.ts +13 -57
  652. package/src/concepts/ConfigPropertyValue__.ts +14 -26
  653. package/src/concepts/ConfigProperty__.ts +28 -68
  654. package/src/concepts/Configuration__.ts +9 -56
  655. package/src/concepts/Connection__.ts +27 -68
  656. package/src/concepts/ConnectorTrigger__.ts +57 -65
  657. package/src/concepts/Connector__.ts +339 -1448
  658. package/src/concepts/Constant__.ts +59 -182
  659. package/src/concepts/CountersignPolicy__.ts +12 -18
  660. package/src/concepts/DataSource__.ts +29 -68
  661. package/src/concepts/DatabaseTypeAnnotation__.ts +14 -19
  662. package/src/concepts/DefaultValue__.ts +10 -74
  663. package/src/concepts/Destination__.ts +28 -80
  664. package/src/concepts/End__.ts +11 -9
  665. package/src/concepts/EntityIndex__.ts +44 -51
  666. package/src/concepts/EntityProperty__.ts +86 -238
  667. package/src/concepts/Entity__.ts +43 -111
  668. package/src/concepts/EnumItem__.ts +29 -40
  669. package/src/concepts/EnumSelectSetter__.ts +254 -0
  670. package/src/concepts/Enum__.ts +38 -129
  671. package/src/concepts/EventDeclaration__.ts +95 -0
  672. package/src/concepts/Event__.ts +43 -92
  673. package/src/concepts/ExternalDestination__.ts +17 -91
  674. package/src/concepts/ForEachStatement__.ts +15 -198
  675. package/src/concepts/FrontendLibrary__.ts +111 -161
  676. package/src/concepts/FrontendType__.ts +21 -118
  677. package/src/concepts/FrontendVariable__.ts +10 -4
  678. package/src/concepts/Frontend__.ts +44 -250
  679. package/src/concepts/Function__.ts +28 -220
  680. package/src/concepts/I18nInfo__.ts +18 -20
  681. package/src/concepts/IconSetter__.ts +72 -0
  682. package/src/concepts/Identifier__.ts +27 -16
  683. package/src/concepts/IfStatement__.ts +9 -60
  684. package/src/concepts/ImageSetter__.ts +65 -0
  685. package/src/concepts/ImportedInterface__.ts +17 -4
  686. package/src/concepts/InputSetter__.ts +72 -0
  687. package/src/concepts/Integration__.ts +10 -114
  688. package/src/concepts/InterfaceParam__.ts +67 -186
  689. package/src/concepts/Interface__.ts +106 -200
  690. package/src/concepts/JSBlock__.ts +11 -11
  691. package/src/concepts/JavaLogic__.ts +19 -9
  692. package/src/concepts/LogicDeclaration__.ts +657 -0
  693. package/src/concepts/LogicItem__.ts +91 -96
  694. package/src/concepts/Logic__.ts +287 -434
  695. package/src/concepts/MatchCase__.ts +22 -72
  696. package/src/concepts/Match__.ts +23 -67
  697. package/src/concepts/MemberExpression__.ts +136 -132
  698. package/src/concepts/MetadataType__.ts +72 -167
  699. package/src/concepts/MicroApp__.ts +34 -29
  700. package/src/concepts/Module__.ts +259 -681
  701. package/src/concepts/MsgTriggerEvent__.ts +44 -79
  702. package/src/concepts/MsgTriggerLauncher__.ts +21 -54
  703. package/src/concepts/MultiApprovalPolicy__.ts +10 -18
  704. package/src/concepts/Namespace__.ts +278 -652
  705. package/src/concepts/NewComposite__.ts +62 -170
  706. package/src/concepts/NewList__.ts +12 -94
  707. package/src/concepts/NewMap__.ts +12 -94
  708. package/src/concepts/New__.ts +13 -2
  709. package/src/concepts/NullLiteral__.ts +8 -2
  710. package/src/concepts/NumberInputSetter__.ts +104 -0
  711. package/src/concepts/NumericLiteral__.ts +13 -63
  712. package/src/concepts/OqlQueryComponent__.ts +23 -71
  713. package/src/concepts/OverriddenLogic__.ts +71 -287
  714. package/src/concepts/Paginate__.ts +185 -0
  715. package/src/concepts/ParamWithGroup__.ts +26 -17
  716. package/src/concepts/Param__.ts +70 -211
  717. package/src/concepts/Point__.ts +14 -19
  718. package/src/concepts/ProcessComponent__.ts +33 -104
  719. package/src/concepts/ProcessElement__.ts +67 -422
  720. package/src/concepts/ProcessOutcome__.ts +12 -11
  721. package/src/concepts/ProcessOutcomes__.ts +9 -9
  722. package/src/concepts/Process__.ts +36 -200
  723. package/src/concepts/PropDeclaration__.ts +209 -0
  724. package/src/concepts/PropertySelectSetter__.ts +65 -0
  725. package/src/concepts/QueryAggregateExpression__.ts +18 -65
  726. package/src/concepts/QueryFieldExpression__.ts +22 -10
  727. package/src/concepts/QueryFromExpression__.ts +21 -41
  728. package/src/concepts/QueryGroupByExpression__.ts +8 -60
  729. package/src/concepts/QueryJoinExpression__.ts +64 -101
  730. package/src/concepts/QueryLimitExpression__.ts +9 -86
  731. package/src/concepts/QueryOrderByExpression__.ts +9 -86
  732. package/src/concepts/QuerySelectExpression__.ts +70 -118
  733. package/src/concepts/Rect__.ts +22 -23
  734. package/src/concepts/Return__.ts +60 -185
  735. package/src/concepts/Role__.ts +22 -29
  736. package/src/concepts/SelectMembers__.ts +16 -77
  737. package/src/concepts/SequentialPolicy__.ts +7 -2
  738. package/src/concepts/SetterOption__.ts +111 -0
  739. package/src/concepts/SlotDeclaration__.ts +488 -0
  740. package/src/concepts/Slot__.ts +35 -105
  741. package/src/concepts/SqlQueryComponent__.ts +21 -73
  742. package/src/concepts/Start__.ts +7 -8
  743. package/src/concepts/StaticString__.ts +16 -26
  744. package/src/concepts/StringInterpolation__.ts +9 -36
  745. package/src/concepts/StringLiteral__.ts +16 -7
  746. package/src/concepts/StructureProperty__.ts +38 -176
  747. package/src/concepts/Structure__.ts +32 -102
  748. package/src/concepts/SwitchCase__.ts +10 -62
  749. package/src/concepts/SwitchSetter__.ts +65 -0
  750. package/src/concepts/SwitchStatement__.ts +9 -35
  751. package/src/concepts/ThemeVariable__.ts +71 -0
  752. package/src/concepts/Theme__.ts +15 -17
  753. package/src/concepts/Transactional__.ts +67 -77
  754. package/src/concepts/TriggerEvent__.ts +14 -76
  755. package/src/concepts/TriggerLauncher__.ts +34 -38
  756. package/src/concepts/TypeAnnotation__.ts +50 -100
  757. package/src/concepts/TypeParam__.ts +10 -5
  758. package/src/concepts/UnaryExpression__.ts +12 -62
  759. package/src/concepts/Unparsed__.ts +11 -5
  760. package/src/concepts/UseComponent__.ts +14 -19
  761. package/src/concepts/ValidationRule__.ts +26 -105
  762. package/src/concepts/Variable__.ts +71 -195
  763. package/src/concepts/ViewBlockWithImage__.ts +80 -0
  764. package/src/concepts/ViewBlock__.ts +24 -27
  765. package/src/concepts/ViewComponentDeclaration__.ts +1670 -0
  766. package/src/concepts/ViewElement__.ts +502 -486
  767. package/src/concepts/View__.ts +576 -389
  768. package/src/concepts/WhileStatement__.ts +11 -62
  769. package/src/concepts/basics/stdlib/nasl.auth.ts +97 -34
  770. package/src/concepts/basics/stdlib/nasl.process.ts +103 -7
  771. package/src/concepts/basics/stdlib/nasl.util.ts +31 -31
  772. package/src/concepts/index__.ts +24 -8
  773. package/src/concepts/utils/asserts.ts +1544 -446
  774. package/src/concepts/utils/types.ts +121 -41
  775. package/src/config.ts +6 -0
  776. package/src/decorators/index.ts +3 -8
  777. package/src/enums/KEYWORDS.ts +2 -0
  778. package/src/generator/genBundleFiles.ts +129 -29
  779. package/src/generator/genReleaseBody.ts +0 -2
  780. package/src/generator/permission.ts +2 -2
  781. package/src/index.ts +1 -0
  782. package/src/natural/genNaturalTS.ts +2 -2
  783. package/src/natural/index.ts +3 -0
  784. package/src/natural/naslStdlibMap.ts +25 -19
  785. package/src/natural/prompt/analyzeClaims.ts +16 -0
  786. package/src/natural/prompt/executeClaims.ts +69 -0
  787. package/src/natural/transformTSCode.ts +12 -2
  788. package/src/server/createUiTs.ts +121 -155
  789. package/src/server/entity2LogicNamespace.ts +1 -16
  790. package/src/server/extendBaseNode.ts +46 -15
  791. package/src/server/formatTsUtils.ts +13 -13
  792. package/src/server/getConnector.ts +43 -35
  793. package/src/server/getFunctions.ts +3 -3
  794. package/src/server/getLogics.ts +34 -17
  795. package/src/server/getMemberIdentifier.ts +101 -145
  796. package/src/server/naslServer.ts +136 -74
  797. package/src/server/translator.ts +23 -5
  798. package/src/service/storage/init.ts +15 -8
  799. package/src/templator/genCreateBlock.ts +16 -16
  800. package/src/templator/genCurdEditMultipleKeyBlock.ts +23 -23
  801. package/src/templator/genCurdMultipleKeyBlock.ts +34 -44
  802. package/src/templator/genEditTableBlock.ts +15 -15
  803. package/src/templator/genEnumSelectBlock.ts +8 -8
  804. package/src/templator/genGridViewBlock.ts +18 -20
  805. package/src/templator/genListViewBlock.ts +10 -10
  806. package/src/templator/genQueryComponent.ts +33 -38
  807. package/src/templator/genSelectBlock.ts +10 -10
  808. package/src/templator/genTableBlock.ts +20 -12
  809. package/src/templator/genUpdateBlock.ts +15 -15
  810. package/src/templator/utils.ts +21 -30
  811. package/src/translator/types.ts +4 -0
  812. package/src/utils/index.ts +40 -5
  813. package/src/utils/string.ts +14 -0
  814. package/src/utils/time-slicing/performance.ts +3 -3
  815. package/test/concepts/call-interface/__snapshots__/getQuickInfoOffset.spec.ts.snap +1 -1
  816. package/test/concepts/call-interface/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -1
  817. package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +7 -8
  818. package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +5 -5
  819. package/test/concepts/entity/__snapshots__/toEmbeddedTS.spec.ts.snap +2 -2
  820. package/test/concepts/member-expression/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -1
  821. package/test/concepts/member-expression/__snapshots__/toJS.spec.ts.snap +1 -1
  822. package/test/concepts/member-expression/fixtures/elements.table-view.data.json +363 -10
  823. package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +655 -611
  824. package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +127 -6
  825. package/test/concepts/view-element/fixtures/table-data-source-calllogic-with-server-validation.json +2074 -0
  826. package/test/concepts/view-element/toEmbeddedTS.spec.ts +11 -0
  827. package/test/concepts/view-element/toVue.spec.ts +0 -1
  828. package/ts-worker/src/start.js +1 -0
  829. package/out/concepts/ViewComponent__.d.ts +0 -568
  830. package/out/concepts/ViewComponent__.js +0 -809
  831. package/out/concepts/ViewComponent__.js.map +0 -1
  832. package/src/concepts/ViewComponent__.ts +0 -1444
@@ -34,43 +34,42 @@ interface compilerInfoMapProps {
34
34
  }
35
35
 
36
36
  type composeCacheType = {
37
- [key: string]: composeCacheType,
37
+ [key: string]: composeCacheType;
38
38
  } & {
39
39
  nodes?: any[];
40
40
  };
41
41
 
42
-
43
42
  //================================================================================
44
43
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
45
44
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
46
45
  //================================================================================
47
46
  import { EventPayload, Params } from '../common/EventEmitter';
48
- import { concept, excludedInJSON, property, getConceptConstructor, getBaseNode } from '../decorators';
47
+ import { concept, excludedInJSON, property, getConceptConstructor } from '../decorators';
49
48
 
50
49
  import * as utils from '../utils';
51
50
  import * as types from './utils/types';
52
51
  import * as asserts from './utils/asserts';
53
52
  import { v4 as uuidv4 } from 'uuid';
54
53
  import BaseNode from '../common/BaseNode';
55
- import type DataSource from './DataSource__';
56
- import type Structure from './Structure__';
57
- import type Enum from './Enum__';
58
- import type Logic from './Logic__';
59
- import type OverriddenLogic from './OverriddenLogic__';
60
- import type AbstractInterface from './AbstractInterface__';
61
- import type FrontendType from './FrontendType__';
54
+ import DataSource from './DataSource__';
55
+ import Structure from './Structure__';
56
+ import Enum from './Enum__';
57
+ import Logic from './Logic__';
58
+ import OverriddenLogic from './OverriddenLogic__';
59
+ import AbstractInterface from './AbstractInterface__';
60
+ import FrontendType from './FrontendType__';
62
61
  import Backend from './Backend__';
63
- import type Process from './Process__';
64
- import type Role from './Role__';
62
+ import Process from './Process__';
63
+ import Role from './Role__';
65
64
  import Configuration from './Configuration__';
66
- import type Module from './Module__';
67
- import type Connector from './Connector__';
68
- import type Integration from './Integration__';
69
- import type AuthLogic from './AuthLogic__';
70
- import type AuthLogicForCallInterface from './AuthLogicForCallInterface__';
71
- import type Connection from './Connection__';
72
- import type TriggerLauncher from './TriggerLauncher__';
73
- import type MetadataType from './MetadataType__';
65
+ import Module from './Module__';
66
+ import Connector from './Connector__';
67
+ import Integration from './Integration__';
68
+ import AuthLogic from './AuthLogic__';
69
+ import AuthLogicForCallInterface from './AuthLogicForCallInterface__';
70
+ import Connection from './Connection__';
71
+ import TriggerLauncher from './TriggerLauncher__';
72
+ import MetadataType from './MetadataType__';
74
73
 
75
74
  /**
76
75
  * 应用
@@ -79,15 +78,13 @@ import type MetadataType from './MetadataType__';
79
78
  export class App extends BaseNode {
80
79
  /** 类名 */
81
80
  static readonly ConceptName: string = 'App';
82
-
83
- /** 继承链 */
84
- static readonly inheritanceChain: string[] = ['BaseNode'];
85
-
86
81
  /**
87
- * 应用 Id
82
+ * 是否为抽象类
83
+ * 抽象类不能产生 concept: string
88
84
  */
89
- @property()
90
- id!: string;
85
+ static isAbstract: boolean = false;
86
+ /** 继承链 */
87
+ static readonly inheritanceChain: string[] = ['BaseNode'];
91
88
 
92
89
  /**
93
90
  * 产品概念
@@ -95,54 +92,77 @@ export class App extends BaseNode {
95
92
  @property('concept')
96
93
  // @ts-ignore
97
94
  readonly concept!: 'App';
95
+ /**
96
+ * 应用 Id
97
+ */
98
+ @property({
99
+ objectRef: '',
100
+ })
101
+ id: string = '';
98
102
 
99
103
  /**
100
104
  * IDE 版本
101
105
  */
102
- @property()
103
- ideVersion!: string;
106
+ @property({
107
+ objectRef: '',
108
+ })
109
+ ideVersion: string;
104
110
 
105
111
  /**
106
112
  * 应用标识
107
113
  */
108
- @property()
109
- name!: string;
114
+ @property({
115
+ objectRef: '',
116
+ })
117
+ name: string = '';
110
118
 
111
119
  /**
112
120
  * 应用标题
113
121
  */
114
- @property()
115
- title!: string;
122
+ @property({
123
+ objectRef: '',
124
+ })
125
+ title: string;
116
126
 
117
127
  /**
118
128
  * 应用图标
119
129
  */
120
- @property()
121
- icon!: string;
130
+ @property({
131
+ objectRef: '',
132
+ })
133
+ icon: string;
122
134
 
123
135
  /**
124
136
  * 应用描述
125
137
  */
126
- @property()
127
- desc!: string;
138
+ @property({
139
+ objectRef: '',
140
+ })
141
+ desc: string;
128
142
 
129
143
  /**
130
144
  * 域名
131
145
  */
132
- @property()
133
- dnsAddr!: string;
146
+ @property({
147
+ objectRef: '',
148
+ })
149
+ dnsAddr: string;
134
150
 
135
151
  /**
136
152
  * 是否有用户中心
137
153
  */
138
- @property()
139
- hasUserCenter!: boolean;
154
+ @property({
155
+ objectRef: '',
156
+ })
157
+ hasUserCenter: boolean;
140
158
 
141
159
  /**
142
160
  * 是否有权限
143
161
  */
144
- @property()
145
- hasAuth!: boolean;
162
+ @property({
163
+ objectRef: '',
164
+ })
165
+ hasAuth: boolean;
146
166
 
147
167
  /**
148
168
  * 数据源列表
@@ -276,7 +296,7 @@ export class App extends BaseNode {
276
296
  @property({
277
297
  objectRef: 'Integration',
278
298
  })
279
- integration!: Integration;
299
+ integration: Integration;
280
300
 
281
301
  /**
282
302
  * 暴露接口的接口鉴权
@@ -341,17 +361,6 @@ export class App extends BaseNode {
341
361
  return super.from(source, parentNode, parentKey) as App;
342
362
  }
343
363
 
344
- /**
345
- * 从父级删除该节点
346
- * @internal
347
- */
348
- _delete() {
349
- let params: Params = null;
350
- if (this.parentNode) {
351
- params = (this.parentNode as any)?.__removeApp?.(this);
352
- }
353
- return params;
354
- }
355
364
  /**
356
365
  * 设置集成
357
366
  */
@@ -519,7 +528,7 @@ export class App extends BaseNode {
519
528
 
520
529
  getStructureExistingNames(excludedList: Array<Structure> = []) {
521
530
  const excludedSet = new Set(excludedList);
522
- return ((this.structures as Structure[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
531
+ return ((this.structures as Structure[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
523
532
  }
524
533
  getStructureUniqueName(name = 'Structure1') {
525
534
  return utils.unique(name, this.getStructureExistingNames(), undefined, true);
@@ -673,7 +682,7 @@ export class App extends BaseNode {
673
682
 
674
683
  getEnumExistingNames(excludedList: Array<Enum> = []) {
675
684
  const excludedSet = new Set(excludedList);
676
- return ((this.enums as Enum[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
685
+ return ((this.enums as Enum[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
677
686
  }
678
687
  getEnumUniqueName(name = 'Enum1') {
679
688
  return utils.unique(name, this.getEnumExistingNames(), undefined, true);
@@ -827,7 +836,7 @@ export class App extends BaseNode {
827
836
 
828
837
  getLogicExistingNames(excludedList: Array<Logic> = []) {
829
838
  const excludedSet = new Set(excludedList);
830
- return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
839
+ return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
831
840
  }
832
841
  getLogicUniqueName(name = 'logic1') {
833
842
  return utils.unique(name, this.getLogicExistingNames(), undefined, true);
@@ -979,502 +988,323 @@ export class App extends BaseNode {
979
988
  return node;
980
989
  }
981
990
 
991
+ getOverriddenLogicExistingNames(excludedList: Array<OverriddenLogic> = []) {
992
+ const excludedSet = new Set(excludedList);
993
+ return ((this.overriddenLogics as OverriddenLogic[]) || [])
994
+ .filter((item) => !excludedSet.has(item))
995
+ .map((item) => item.name);
996
+ }
997
+ getOverriddenLogicUniqueName(name = 'overriddenLogic1') {
998
+ return utils.unique(name, this.getOverriddenLogicExistingNames(), undefined, true);
999
+ }
1000
+
982
1001
  /**
983
- * 插入鉴权逻辑
1002
+ * 插入覆写逻辑
984
1003
  * @internal
985
- * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
1004
+ * @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
986
1005
  */
987
- _insertAuthLogicInAuthLogicsAt(name: string, index: number): AuthLogic;
1006
+ _insertOverriddenLogicAt(name: string, index: number): OverriddenLogic;
988
1007
 
989
1008
  /**
990
- * 插入鉴权逻辑
1009
+ * 插入覆写逻辑
991
1010
  * @internal
992
- * @param authLogicOptions 鉴权逻辑参数
1011
+ * @param overriddenLogicOptions 覆写逻辑参数
993
1012
  */
994
- _insertAuthLogicInAuthLogicsAt(authLogicOptions: Partial<AuthLogic>, index: number): AuthLogic;
1013
+ _insertOverriddenLogicAt(overriddenLogicOptions: Partial<OverriddenLogic>, index: number): OverriddenLogic;
995
1014
 
996
1015
  /**
997
- * 插入鉴权逻辑
1016
+ * 插入覆写逻辑
998
1017
  * @internal
999
- * @param authLogic 已有的鉴权逻辑实例
1018
+ * @param overriddenLogic 已有的覆写逻辑实例
1000
1019
  */
1001
- _insertAuthLogicInAuthLogicsAt(authLogic: AuthLogic, index: number): AuthLogic;
1020
+ _insertOverriddenLogicAt(overriddenLogic: OverriddenLogic, index: number): OverriddenLogic;
1002
1021
 
1003
- _insertAuthLogicInAuthLogicsAt(options: string | Partial<AuthLogic> | AuthLogic, index: number) {
1004
- const authLogicOptions: any = {};
1005
- const relationOptions = { parentNode: this, parentKey: 'authLogics' };
1006
- const AuthLogic = getConceptConstructor('AuthLogic');
1007
- let authLogic: AuthLogic;
1022
+ _insertOverriddenLogicAt(options: string | Partial<OverriddenLogic> | OverriddenLogic, index: number) {
1023
+ const overriddenLogicOptions: any = {};
1024
+ const relationOptions = { parentNode: this, parentKey: 'overriddenLogics' };
1025
+ const OverriddenLogic = getConceptConstructor('OverriddenLogic');
1026
+ let overriddenLogic: OverriddenLogic;
1008
1027
  if (!options) {
1009
- authLogic = AuthLogic.from(
1028
+ overriddenLogic = OverriddenLogic.from(
1010
1029
  {
1011
- ...authLogicOptions,
1012
- name: this.getAuthLogicUniqueName(),
1030
+ ...overriddenLogicOptions,
1031
+ name: this.getOverriddenLogicUniqueName(),
1013
1032
  },
1014
1033
  this,
1015
- 'authLogics',
1034
+ 'overriddenLogics',
1016
1035
  );
1017
1036
  } else if (typeof options === 'string') {
1018
- authLogic = AuthLogic.from(
1037
+ overriddenLogic = OverriddenLogic.from(
1019
1038
  {
1020
- ...authLogicOptions,
1039
+ ...overriddenLogicOptions,
1021
1040
  name: options,
1022
1041
  },
1023
1042
  this,
1024
- 'authLogics',
1043
+ 'overriddenLogics',
1025
1044
  );
1026
- } else if (asserts.isAuthLogic(options)) {
1045
+ } else if (asserts.isOverriddenLogic(options)) {
1027
1046
  options.ensureDelete(); // 同一实例不支持多处存在
1028
- authLogic = options;
1029
- Object.assign(authLogic, relationOptions);
1047
+ overriddenLogic = options;
1048
+ Object.assign(overriddenLogic, relationOptions);
1030
1049
  } else {
1031
- authLogic = AuthLogic.from(
1050
+ overriddenLogic = OverriddenLogic.from(
1032
1051
  {
1033
- ...authLogicOptions,
1052
+ ...overriddenLogicOptions,
1034
1053
  ...options,
1035
1054
  },
1036
1055
  this,
1037
- 'authLogics',
1056
+ 'overriddenLogics',
1038
1057
  );
1039
1058
  }
1040
- this.authLogics.splice(index, 0, authLogic);
1041
- return authLogic;
1059
+ this.overriddenLogics.splice(index, 0, overriddenLogic);
1060
+ return overriddenLogic;
1042
1061
  }
1043
1062
 
1044
1063
  /**
1045
- * 插入鉴权逻辑
1046
- * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
1064
+ * 插入覆写逻辑
1065
+ * @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
1047
1066
  */
1048
- insertAuthLogicInAuthLogicsAt(name: string, index: number): AuthLogic;
1067
+ insertOverriddenLogicAt(name: string, index: number): OverriddenLogic;
1049
1068
 
1050
1069
  /**
1051
- * 插入鉴权逻辑
1052
- * @param authLogicOptions 鉴权逻辑参数
1070
+ * 插入覆写逻辑
1071
+ * @param overriddenLogicOptions 覆写逻辑参数
1053
1072
  */
1054
- insertAuthLogicInAuthLogicsAt(authLogicOptions: Partial<AuthLogic>, index: number): AuthLogic;
1073
+ insertOverriddenLogicAt(overriddenLogicOptions: Partial<OverriddenLogic>, index: number): OverriddenLogic;
1055
1074
 
1056
1075
  /**
1057
- * 插入鉴权逻辑
1058
- * @param authLogic 已有的鉴权逻辑实例
1076
+ * 插入覆写逻辑
1077
+ * @param overriddenLogic 已有的覆写逻辑实例
1059
1078
  */
1060
- insertAuthLogicInAuthLogicsAt(authLogic: AuthLogic, index: number): AuthLogic;
1079
+ insertOverriddenLogicAt(overriddenLogic: OverriddenLogic, index: number): OverriddenLogic;
1061
1080
 
1062
- insertAuthLogicInAuthLogicsAt(options: string | Partial<AuthLogic> | AuthLogic, index: number) {
1063
- const node = this._insertAuthLogicInAuthLogicsAt(options as any, index);
1081
+ insertOverriddenLogicAt(options: string | Partial<OverriddenLogic> | OverriddenLogic, index: number) {
1082
+ const node = this._insertOverriddenLogicAt(options as any, index);
1064
1083
  node.create({
1065
1084
  index,
1066
1085
  parentNode: this,
1067
- parentKey: 'authLogics',
1086
+ parentKey: 'overriddenLogics',
1068
1087
  });
1069
1088
  return node;
1070
1089
  }
1071
1090
 
1072
1091
  /**
1073
- * 添加鉴权逻辑
1092
+ * 添加覆写逻辑
1074
1093
  * @internal
1075
- * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
1094
+ * @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
1076
1095
  */
1077
- _addAuthLogicInAuthLogics(name?: string): AuthLogic;
1096
+ _addOverriddenLogic(name?: string): OverriddenLogic;
1078
1097
 
1079
1098
  /**
1080
- * 添加鉴权逻辑
1099
+ * 添加覆写逻辑
1081
1100
  * @internal
1082
- * @param authLogicOptions 鉴权逻辑参数
1101
+ * @param overriddenLogicOptions 覆写逻辑参数
1083
1102
  */
1084
- _addAuthLogicInAuthLogics(authLogicOptions: Partial<AuthLogic>): AuthLogic;
1103
+ _addOverriddenLogic(overriddenLogicOptions: Partial<OverriddenLogic>): OverriddenLogic;
1085
1104
 
1086
1105
  /**
1087
- * 添加鉴权逻辑
1106
+ * 添加覆写逻辑
1088
1107
  * @internal
1089
- * @param authLogic 已有的鉴权逻辑实例
1108
+ * @param overriddenLogic 已有的覆写逻辑实例
1090
1109
  */
1091
- _addAuthLogicInAuthLogics(authLogic: AuthLogic): AuthLogic;
1110
+ _addOverriddenLogic(overriddenLogic: OverriddenLogic): OverriddenLogic;
1092
1111
 
1093
- _addAuthLogicInAuthLogics(options?: string | Partial<AuthLogic> | AuthLogic) {
1094
- const index = this.authLogics.length;
1095
- return this._insertAuthLogicInAuthLogicsAt(options as any, index);
1112
+ _addOverriddenLogic(options?: string | Partial<OverriddenLogic> | OverriddenLogic) {
1113
+ const index = 0;
1114
+ return this._insertOverriddenLogicAt(options as any, index);
1096
1115
  }
1097
1116
 
1098
1117
  /**
1099
- * 添加鉴权逻辑
1118
+ * 添加覆写逻辑
1100
1119
  * @internal
1101
- * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
1120
+ * @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
1102
1121
  */
1103
- addAuthLogicInAuthLogics(name?: string): AuthLogic;
1122
+ addOverriddenLogic(name?: string): OverriddenLogic;
1104
1123
 
1105
1124
  /**
1106
- * 添加鉴权逻辑
1107
- * @param authLogicOptions 鉴权逻辑参数
1125
+ * 添加覆写逻辑
1126
+ * @param overriddenLogicOptions 覆写逻辑参数
1108
1127
  */
1109
- addAuthLogicInAuthLogics(authLogicOptions: Partial<AuthLogic>): AuthLogic;
1128
+ addOverriddenLogic(overriddenLogicOptions: Partial<OverriddenLogic>): OverriddenLogic;
1110
1129
 
1111
1130
  /**
1112
- * 添加鉴权逻辑
1113
- * @param authLogic 已有的鉴权逻辑实例
1131
+ * 添加覆写逻辑
1132
+ * @param overriddenLogic 已有的覆写逻辑实例
1114
1133
  */
1115
- addAuthLogicInAuthLogics(authLogic: AuthLogic): AuthLogic;
1134
+ addOverriddenLogic(overriddenLogic: OverriddenLogic): OverriddenLogic;
1116
1135
 
1117
- addAuthLogicInAuthLogics(options?: string | Partial<AuthLogic> | AuthLogic) {
1118
- const node = this._addAuthLogicInAuthLogics(options as any);
1119
- const index = this.authLogics.indexOf(node);
1136
+ addOverriddenLogic(options?: string | Partial<OverriddenLogic> | OverriddenLogic) {
1137
+ const node = this._addOverriddenLogic(options as any);
1138
+ const index = this.overriddenLogics.indexOf(node);
1120
1139
  node.create({
1121
1140
  index,
1122
1141
  parentNode: this,
1123
- parentKey: 'authLogics',
1142
+ parentKey: 'overriddenLogics',
1124
1143
  });
1125
1144
  return node;
1126
1145
  }
1127
1146
 
1147
+ getInterfaceExistingNames(excludedList: Array<AbstractInterface> = []) {
1148
+ const excludedSet = new Set(excludedList);
1149
+ return ((this.interfaces as AbstractInterface[]) || [])
1150
+ .filter((item) => !excludedSet.has(item))
1151
+ .map((item) => item.name);
1152
+ }
1153
+ getInterfaceUniqueName(name = 'Interface1') {
1154
+ return utils.unique(name, this.getInterfaceExistingNames(), undefined, true);
1155
+ }
1156
+
1128
1157
  /**
1129
- * 插入调用接口的鉴权逻辑
1158
+ * 插入接口
1130
1159
  * @internal
1131
- * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
1160
+ * @param name 接口名称,如果不填会自动生成一个唯一名称
1132
1161
  */
1133
- _insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1134
- name: string,
1135
- index: number,
1136
- ): AuthLogicForCallInterface;
1162
+ _insertInterfaceAt(name: string, index: number): AbstractInterface;
1137
1163
 
1138
1164
  /**
1139
- * 插入调用接口的鉴权逻辑
1165
+ * 插入接口
1140
1166
  * @internal
1141
- * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
1167
+ * @param itfaceOptions 接口参数
1142
1168
  */
1143
- _insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1144
- authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
1145
- index: number,
1146
- ): AuthLogicForCallInterface;
1169
+ _insertInterfaceAt(itfaceOptions: Partial<AbstractInterface>, index: number): AbstractInterface;
1147
1170
 
1148
1171
  /**
1149
- * 插入调用接口的鉴权逻辑
1172
+ * 插入接口
1150
1173
  * @internal
1151
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
1174
+ * @param itface 已有的接口实例
1152
1175
  */
1153
- _insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1154
- authLogicForCallInterface: AuthLogicForCallInterface,
1155
- index: number,
1156
- ): AuthLogicForCallInterface;
1176
+ _insertInterfaceAt(itface: AbstractInterface, index: number): AbstractInterface;
1157
1177
 
1158
- _insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1159
- options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
1160
- index: number,
1161
- ) {
1162
- const authLogicForCallInterfaceOptions: any = {};
1163
- const relationOptions = { parentNode: this, parentKey: 'authLogicsForCallInterface' };
1164
- const AuthLogicForCallInterface = getConceptConstructor('AuthLogicForCallInterface');
1165
- let authLogicForCallInterface: AuthLogicForCallInterface;
1178
+ _insertInterfaceAt(options: string | Partial<AbstractInterface> | AbstractInterface, index: number) {
1179
+ const itfaceOptions: any = {};
1180
+ const relationOptions = { parentNode: this, parentKey: 'interfaces' };
1181
+ const AbstractInterface = getConceptConstructor('AbstractInterface');
1182
+ let itface: AbstractInterface;
1166
1183
  if (!options) {
1167
- authLogicForCallInterface = AuthLogicForCallInterface.from(
1184
+ itface = AbstractInterface.from(
1168
1185
  {
1169
- ...authLogicForCallInterfaceOptions,
1170
- name: this.getAuthLogicForCallInterfaceUniqueName(),
1186
+ ...itfaceOptions,
1187
+ name: this.getInterfaceUniqueName(),
1171
1188
  },
1172
1189
  this,
1173
- 'authLogicsForCallInterface',
1190
+ 'interfaces',
1174
1191
  );
1175
1192
  } else if (typeof options === 'string') {
1176
- authLogicForCallInterface = AuthLogicForCallInterface.from(
1193
+ itface = AbstractInterface.from(
1177
1194
  {
1178
- ...authLogicForCallInterfaceOptions,
1195
+ ...itfaceOptions,
1179
1196
  name: options,
1180
1197
  },
1181
1198
  this,
1182
- 'authLogicsForCallInterface',
1199
+ 'interfaces',
1183
1200
  );
1184
- } else if (asserts.isAuthLogicForCallInterface(options)) {
1201
+ } else if (asserts.isAbstractInterface(options)) {
1185
1202
  options.ensureDelete(); // 同一实例不支持多处存在
1186
- authLogicForCallInterface = options;
1187
- Object.assign(authLogicForCallInterface, relationOptions);
1203
+ itface = options;
1204
+ Object.assign(itface, relationOptions);
1188
1205
  } else {
1189
- authLogicForCallInterface = AuthLogicForCallInterface.from(
1206
+ itface = AbstractInterface.from(
1190
1207
  {
1191
- ...authLogicForCallInterfaceOptions,
1208
+ ...itfaceOptions,
1192
1209
  ...options,
1193
1210
  },
1194
1211
  this,
1195
- 'authLogicsForCallInterface',
1212
+ 'interfaces',
1196
1213
  );
1197
1214
  }
1198
- this.authLogicsForCallInterface.splice(index, 0, authLogicForCallInterface);
1199
- return authLogicForCallInterface;
1215
+ this.interfaces.splice(index, 0, itface);
1216
+ return itface;
1200
1217
  }
1201
1218
 
1202
1219
  /**
1203
- * 插入调用接口的鉴权逻辑
1204
- * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
1220
+ * 插入接口
1221
+ * @param name 接口名称,如果不填会自动生成一个唯一名称
1205
1222
  */
1206
- insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(name: string, index: number): AuthLogicForCallInterface;
1223
+ insertInterfaceAt(name: string, index: number): AbstractInterface;
1207
1224
 
1208
1225
  /**
1209
- * 插入调用接口的鉴权逻辑
1210
- * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
1226
+ * 插入接口
1227
+ * @param itfaceOptions 接口参数
1211
1228
  */
1212
- insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1213
- authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
1214
- index: number,
1215
- ): AuthLogicForCallInterface;
1229
+ insertInterfaceAt(itfaceOptions: Partial<AbstractInterface>, index: number): AbstractInterface;
1216
1230
 
1217
1231
  /**
1218
- * 插入调用接口的鉴权逻辑
1219
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
1232
+ * 插入接口
1233
+ * @param itface 已有的接口实例
1220
1234
  */
1221
- insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1222
- authLogicForCallInterface: AuthLogicForCallInterface,
1223
- index: number,
1224
- ): AuthLogicForCallInterface;
1235
+ insertInterfaceAt(itface: AbstractInterface, index: number): AbstractInterface;
1225
1236
 
1226
- insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(
1227
- options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
1228
- index: number,
1229
- ) {
1230
- const node = this._insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(options as any, index);
1237
+ insertInterfaceAt(options: string | Partial<AbstractInterface> | AbstractInterface, index: number) {
1238
+ const node = this._insertInterfaceAt(options as any, index);
1231
1239
  node.create({
1232
1240
  index,
1233
1241
  parentNode: this,
1234
- parentKey: 'authLogicsForCallInterface',
1242
+ parentKey: 'interfaces',
1235
1243
  });
1236
1244
  return node;
1237
1245
  }
1238
1246
 
1239
1247
  /**
1240
- * 添加调用接口的鉴权逻辑
1248
+ * 添加接口
1241
1249
  * @internal
1242
- * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
1243
- */
1244
- _addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(name?: string): AuthLogicForCallInterface;
1245
-
1246
- /**
1247
- * 添加调用接口的鉴权逻辑
1248
- * @internal
1249
- * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
1250
- */
1251
- _addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1252
- authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
1253
- ): AuthLogicForCallInterface;
1254
-
1255
- /**
1256
- * 添加调用接口的鉴权逻辑
1257
- * @internal
1258
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
1259
- */
1260
- _addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1261
- authLogicForCallInterface: AuthLogicForCallInterface,
1262
- ): AuthLogicForCallInterface;
1263
-
1264
- _addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1265
- options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
1266
- ) {
1267
- const index = this.authLogicsForCallInterface.length;
1268
- return this._insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(options as any, index);
1269
- }
1270
-
1271
- /**
1272
- * 添加调用接口的鉴权逻辑
1273
- * @internal
1274
- * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
1275
- */
1276
- addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(name?: string): AuthLogicForCallInterface;
1277
-
1278
- /**
1279
- * 添加调用接口的鉴权逻辑
1280
- * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
1281
- */
1282
- addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1283
- authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
1284
- ): AuthLogicForCallInterface;
1285
-
1286
- /**
1287
- * 添加调用接口的鉴权逻辑
1288
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
1289
- */
1290
- addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1291
- authLogicForCallInterface: AuthLogicForCallInterface,
1292
- ): AuthLogicForCallInterface;
1293
-
1294
- addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1295
- options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
1296
- ) {
1297
- const node = this._addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(options as any);
1298
- const index = this.authLogicsForCallInterface.indexOf(node);
1299
- node.create({
1300
- index,
1301
- parentNode: this,
1302
- parentKey: 'authLogicsForCallInterface',
1303
- });
1304
- return node;
1305
- }
1306
-
1307
- getOverriddenLogicExistingNames(excludedList: Array<OverriddenLogic> = []) {
1308
- const excludedSet = new Set(excludedList);
1309
- return ((this.overriddenLogics as OverriddenLogic[]) || [])
1310
- .filter((item) => !excludedSet.has(item))
1311
- .map((item) => item?.name);
1312
- }
1313
- getOverriddenLogicUniqueName(name = 'overriddenLogic1') {
1314
- return utils.unique(name, this.getOverriddenLogicExistingNames(), undefined, true);
1315
- }
1316
-
1317
- /**
1318
- * 插入覆写逻辑
1319
- * @internal
1320
- * @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
1321
- */
1322
- _insertOverriddenLogicAt(name: string, index: number): OverriddenLogic;
1323
-
1324
- /**
1325
- * 插入覆写逻辑
1326
- * @internal
1327
- * @param overriddenLogicOptions 覆写逻辑参数
1328
- */
1329
- _insertOverriddenLogicAt(overriddenLogicOptions: Partial<OverriddenLogic>, index: number): OverriddenLogic;
1330
-
1331
- /**
1332
- * 插入覆写逻辑
1333
- * @internal
1334
- * @param overriddenLogic 已有的覆写逻辑实例
1335
- */
1336
- _insertOverriddenLogicAt(overriddenLogic: OverriddenLogic, index: number): OverriddenLogic;
1337
-
1338
- _insertOverriddenLogicAt(options: string | Partial<OverriddenLogic> | OverriddenLogic, index: number) {
1339
- const overriddenLogicOptions: any = {};
1340
- const relationOptions = { parentNode: this, parentKey: 'overriddenLogics' };
1341
- const OverriddenLogic = getConceptConstructor('OverriddenLogic');
1342
- let overriddenLogic: OverriddenLogic;
1343
- if (!options) {
1344
- overriddenLogic = OverriddenLogic.from(
1345
- {
1346
- ...overriddenLogicOptions,
1347
- name: this.getOverriddenLogicUniqueName(),
1348
- },
1349
- this,
1350
- 'overriddenLogics',
1351
- );
1352
- } else if (typeof options === 'string') {
1353
- overriddenLogic = OverriddenLogic.from(
1354
- {
1355
- ...overriddenLogicOptions,
1356
- name: options,
1357
- },
1358
- this,
1359
- 'overriddenLogics',
1360
- );
1361
- } else if (asserts.isOverriddenLogic(options)) {
1362
- options.ensureDelete(); // 同一实例不支持多处存在
1363
- overriddenLogic = options;
1364
- Object.assign(overriddenLogic, relationOptions);
1365
- } else {
1366
- overriddenLogic = OverriddenLogic.from(
1367
- {
1368
- ...overriddenLogicOptions,
1369
- ...options,
1370
- },
1371
- this,
1372
- 'overriddenLogics',
1373
- );
1374
- }
1375
- this.overriddenLogics.splice(index, 0, overriddenLogic);
1376
- return overriddenLogic;
1377
- }
1378
-
1379
- /**
1380
- * 插入覆写逻辑
1381
- * @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
1382
- */
1383
- insertOverriddenLogicAt(name: string, index: number): OverriddenLogic;
1384
-
1385
- /**
1386
- * 插入覆写逻辑
1387
- * @param overriddenLogicOptions 覆写逻辑参数
1388
- */
1389
- insertOverriddenLogicAt(overriddenLogicOptions: Partial<OverriddenLogic>, index: number): OverriddenLogic;
1390
-
1391
- /**
1392
- * 插入覆写逻辑
1393
- * @param overriddenLogic 已有的覆写逻辑实例
1394
- */
1395
- insertOverriddenLogicAt(overriddenLogic: OverriddenLogic, index: number): OverriddenLogic;
1396
-
1397
- insertOverriddenLogicAt(options: string | Partial<OverriddenLogic> | OverriddenLogic, index: number) {
1398
- const node = this._insertOverriddenLogicAt(options as any, index);
1399
- node.create({
1400
- index,
1401
- parentNode: this,
1402
- parentKey: 'overriddenLogics',
1403
- });
1404
- return node;
1405
- }
1406
-
1407
- /**
1408
- * 添加覆写逻辑
1409
- * @internal
1410
- * @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
1250
+ * @param name 接口名称,如果不填会自动生成一个唯一名称
1411
1251
  */
1412
- _addOverriddenLogic(name?: string): OverriddenLogic;
1252
+ _addInterface(name?: string): AbstractInterface;
1413
1253
 
1414
1254
  /**
1415
- * 添加覆写逻辑
1255
+ * 添加接口
1416
1256
  * @internal
1417
- * @param overriddenLogicOptions 覆写逻辑参数
1257
+ * @param itfaceOptions 接口参数
1418
1258
  */
1419
- _addOverriddenLogic(overriddenLogicOptions: Partial<OverriddenLogic>): OverriddenLogic;
1259
+ _addInterface(itfaceOptions: Partial<AbstractInterface>): AbstractInterface;
1420
1260
 
1421
1261
  /**
1422
- * 添加覆写逻辑
1262
+ * 添加接口
1423
1263
  * @internal
1424
- * @param overriddenLogic 已有的覆写逻辑实例
1264
+ * @param itface 已有的接口实例
1425
1265
  */
1426
- _addOverriddenLogic(overriddenLogic: OverriddenLogic): OverriddenLogic;
1266
+ _addInterface(itface: AbstractInterface): AbstractInterface;
1427
1267
 
1428
- _addOverriddenLogic(options?: string | Partial<OverriddenLogic> | OverriddenLogic) {
1268
+ _addInterface(options?: string | Partial<AbstractInterface> | AbstractInterface) {
1429
1269
  const index = 0;
1430
- return this._insertOverriddenLogicAt(options as any, index);
1270
+ return this._insertInterfaceAt(options as any, index);
1431
1271
  }
1432
1272
 
1433
1273
  /**
1434
- * 添加覆写逻辑
1274
+ * 添加接口
1435
1275
  * @internal
1436
- * @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
1276
+ * @param name 接口名称,如果不填会自动生成一个唯一名称
1437
1277
  */
1438
- addOverriddenLogic(name?: string): OverriddenLogic;
1278
+ addInterface(name?: string): AbstractInterface;
1439
1279
 
1440
1280
  /**
1441
- * 添加覆写逻辑
1442
- * @param overriddenLogicOptions 覆写逻辑参数
1281
+ * 添加接口
1282
+ * @param itfaceOptions 接口参数
1443
1283
  */
1444
- addOverriddenLogic(overriddenLogicOptions: Partial<OverriddenLogic>): OverriddenLogic;
1284
+ addInterface(itfaceOptions: Partial<AbstractInterface>): AbstractInterface;
1445
1285
 
1446
1286
  /**
1447
- * 添加覆写逻辑
1448
- * @param overriddenLogic 已有的覆写逻辑实例
1287
+ * 添加接口
1288
+ * @param itface 已有的接口实例
1449
1289
  */
1450
- addOverriddenLogic(overriddenLogic: OverriddenLogic): OverriddenLogic;
1290
+ addInterface(itface: AbstractInterface): AbstractInterface;
1451
1291
 
1452
- addOverriddenLogic(options?: string | Partial<OverriddenLogic> | OverriddenLogic) {
1453
- const node = this._addOverriddenLogic(options as any);
1454
- const index = this.overriddenLogics.indexOf(node);
1292
+ addInterface(options?: string | Partial<AbstractInterface> | AbstractInterface) {
1293
+ const node = this._addInterface(options as any);
1294
+ const index = this.interfaces.indexOf(node);
1455
1295
  node.create({
1456
1296
  index,
1457
1297
  parentNode: this,
1458
- parentKey: 'overriddenLogics',
1298
+ parentKey: 'interfaces',
1459
1299
  });
1460
1300
  return node;
1461
1301
  }
1462
1302
 
1463
- getAbstractInterfaceExistingNames(excludedList: Array<AbstractInterface> = []) {
1464
- const excludedSet = new Set(excludedList);
1465
- return ((this.interfaces as AbstractInterface[]) || [])
1466
- .filter((item) => !excludedSet.has(item))
1467
- .map((item) => item?.name);
1468
- }
1469
- getAbstractInterfaceUniqueName(name = 'Interface1') {
1470
- return utils.unique(name, this.getAbstractInterfaceExistingNames(), undefined, true);
1471
- }
1472
-
1473
1303
  getFrontendTypeExistingNames(excludedList: Array<FrontendType> = []) {
1474
1304
  const excludedSet = new Set(excludedList);
1475
1305
  return ((this.frontendTypes as FrontendType[]) || [])
1476
1306
  .filter((item) => !excludedSet.has(item))
1477
- .map((item) => item?.name);
1307
+ .map((item) => item.name);
1478
1308
  }
1479
1309
  getFrontendTypeUniqueName(name = 'frontendType1') {
1480
1310
  return utils.unique(name, this.getFrontendTypeExistingNames(), undefined, true);
@@ -1628,7 +1458,7 @@ export class App extends BaseNode {
1628
1458
 
1629
1459
  getProcessExistingNames(excludedList: Array<Process> = []) {
1630
1460
  const excludedSet = new Set(excludedList);
1631
- return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
1461
+ return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1632
1462
  }
1633
1463
  getProcessUniqueName(name = 'Process1') {
1634
1464
  return utils.unique(name, this.getProcessExistingNames(), undefined, true);
@@ -1782,7 +1612,7 @@ export class App extends BaseNode {
1782
1612
 
1783
1613
  getRoleExistingNames(excludedList: Array<Role> = []) {
1784
1614
  const excludedSet = new Set(excludedList);
1785
- return ((this.roles as Role[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
1615
+ return ((this.roles as Role[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1786
1616
  }
1787
1617
  getRoleUniqueName(name = 'role1') {
1788
1618
  return utils.unique(name, this.getRoleExistingNames(), undefined, true);
@@ -1936,7 +1766,7 @@ export class App extends BaseNode {
1936
1766
 
1937
1767
  getModuleExistingNames(excludedList: Array<Module> = []) {
1938
1768
  const excludedSet = new Set(excludedList);
1939
- return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
1769
+ return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1940
1770
  }
1941
1771
  getModuleUniqueName(name = 'module1') {
1942
1772
  return utils.unique(name, this.getModuleExistingNames(), undefined, false);
@@ -2089,1265 +1919,1276 @@ export class App extends BaseNode {
2089
1919
  }
2090
1920
 
2091
1921
  /**
2092
- * 插入连接器
1922
+ * 插入模块
2093
1923
  * @internal
2094
- * @param name 连接器名称,如果不填会自动生成一个唯一名称
1924
+ * @param name 模块名称,如果不填会自动生成一个唯一名称
2095
1925
  */
2096
- _insertConnectorInDependenciesAt(name: string, index: number): Connector;
1926
+ _insertModuleInInterfaceDependenciesAt(name: string, index: number): Module;
2097
1927
 
2098
1928
  /**
2099
- * 插入连接器
1929
+ * 插入模块
2100
1930
  * @internal
2101
- * @param connectorOptions 连接器参数
1931
+ * @param moduleOptions 模块参数
2102
1932
  */
2103
- _insertConnectorInDependenciesAt(connectorOptions: Partial<Connector>, index: number): Connector;
1933
+ _insertModuleInInterfaceDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
2104
1934
 
2105
1935
  /**
2106
- * 插入连接器
1936
+ * 插入模块
2107
1937
  * @internal
2108
- * @param connector 已有的连接器实例
1938
+ * @param module 已有的模块实例
2109
1939
  */
2110
- _insertConnectorInDependenciesAt(connector: Connector, index: number): Connector;
1940
+ _insertModuleInInterfaceDependenciesAt(module: Module, index: number): Module;
2111
1941
 
2112
- _insertConnectorInDependenciesAt(options: string | Partial<Connector> | Connector, index: number) {
2113
- const connectorOptions: any = {};
2114
- const relationOptions = { parentNode: this, parentKey: 'dependencies' };
2115
- const Connector = getConceptConstructor('Connector');
2116
- let connector: Connector;
1942
+ _insertModuleInInterfaceDependenciesAt(options: string | Partial<Module> | Module, index: number) {
1943
+ const moduleOptions: any = {};
1944
+ const relationOptions = { parentNode: this, parentKey: 'interfaceDependencies' };
1945
+ const Module = getConceptConstructor('Module');
1946
+ let module: Module;
2117
1947
  if (!options) {
2118
- connector = Connector.from(
1948
+ module = Module.from(
2119
1949
  {
2120
- ...connectorOptions,
2121
- name: this.getConnectorUniqueName(),
1950
+ ...moduleOptions,
1951
+ name: this.getModuleUniqueName(),
2122
1952
  },
2123
1953
  this,
2124
- 'dependencies',
1954
+ 'interfaceDependencies',
2125
1955
  );
2126
1956
  } else if (typeof options === 'string') {
2127
- connector = Connector.from(
1957
+ module = Module.from(
2128
1958
  {
2129
- ...connectorOptions,
1959
+ ...moduleOptions,
2130
1960
  name: options,
2131
1961
  },
2132
1962
  this,
2133
- 'dependencies',
1963
+ 'interfaceDependencies',
2134
1964
  );
2135
- } else if (asserts.isConnector(options)) {
1965
+ } else if (asserts.isModule(options)) {
2136
1966
  options.ensureDelete(); // 同一实例不支持多处存在
2137
- connector = options;
2138
- Object.assign(connector, relationOptions);
1967
+ module = options;
1968
+ Object.assign(module, relationOptions);
2139
1969
  } else {
2140
- connector = Connector.from(
1970
+ module = Module.from(
2141
1971
  {
2142
- ...connectorOptions,
1972
+ ...moduleOptions,
2143
1973
  ...options,
2144
1974
  },
2145
1975
  this,
2146
- 'dependencies',
1976
+ 'interfaceDependencies',
2147
1977
  );
2148
1978
  }
2149
- this.dependencies.splice(index, 0, connector);
2150
- return connector;
1979
+ this.interfaceDependencies.splice(index, 0, module);
1980
+ return module;
2151
1981
  }
2152
1982
 
2153
1983
  /**
2154
- * 插入连接器
2155
- * @param name 连接器名称,如果不填会自动生成一个唯一名称
2156
- */
2157
- insertConnectorInDependenciesAt(name: string, index: number): Connector;
1984
+ * 插入模块
1985
+ * @param name 模块名称,如果不填会自动生成一个唯一名称
1986
+ */
1987
+ insertModuleInInterfaceDependenciesAt(name: string, index: number): Module;
2158
1988
 
2159
1989
  /**
2160
- * 插入连接器
2161
- * @param connectorOptions 连接器参数
1990
+ * 插入模块
1991
+ * @param moduleOptions 模块参数
2162
1992
  */
2163
- insertConnectorInDependenciesAt(connectorOptions: Partial<Connector>, index: number): Connector;
1993
+ insertModuleInInterfaceDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
2164
1994
 
2165
1995
  /**
2166
- * 插入连接器
2167
- * @param connector 已有的连接器实例
1996
+ * 插入模块
1997
+ * @param module 已有的模块实例
2168
1998
  */
2169
- insertConnectorInDependenciesAt(connector: Connector, index: number): Connector;
1999
+ insertModuleInInterfaceDependenciesAt(module: Module, index: number): Module;
2170
2000
 
2171
- insertConnectorInDependenciesAt(options: string | Partial<Connector> | Connector, index: number) {
2172
- const node = this._insertConnectorInDependenciesAt(options as any, index);
2001
+ insertModuleInInterfaceDependenciesAt(options: string | Partial<Module> | Module, index: number) {
2002
+ const node = this._insertModuleInInterfaceDependenciesAt(options as any, index);
2173
2003
  node.create({
2174
2004
  index,
2175
2005
  parentNode: this,
2176
- parentKey: 'dependencies',
2006
+ parentKey: 'interfaceDependencies',
2177
2007
  });
2178
2008
  return node;
2179
2009
  }
2180
2010
 
2181
2011
  /**
2182
- * 添加连接器
2012
+ * 添加模块
2183
2013
  * @internal
2184
- * @param name 连接器名称,如果不填会自动生成一个唯一名称
2014
+ * @param name 模块名称,如果不填会自动生成一个唯一名称
2185
2015
  */
2186
- _addConnectorInDependencies(name?: string): Connector;
2016
+ _addModuleInInterfaceDependencies(name?: string): Module;
2187
2017
 
2188
2018
  /**
2189
- * 添加连接器
2019
+ * 添加模块
2190
2020
  * @internal
2191
- * @param connectorOptions 连接器参数
2021
+ * @param moduleOptions 模块参数
2192
2022
  */
2193
- _addConnectorInDependencies(connectorOptions: Partial<Connector>): Connector;
2023
+ _addModuleInInterfaceDependencies(moduleOptions: Partial<Module>): Module;
2194
2024
 
2195
2025
  /**
2196
- * 添加连接器
2026
+ * 添加模块
2197
2027
  * @internal
2198
- * @param connector 已有的连接器实例
2028
+ * @param module 已有的模块实例
2199
2029
  */
2200
- _addConnectorInDependencies(connector: Connector): Connector;
2030
+ _addModuleInInterfaceDependencies(module: Module): Module;
2201
2031
 
2202
- _addConnectorInDependencies(options?: string | Partial<Connector> | Connector) {
2203
- const index = this.dependencies.length;
2204
- return this._insertConnectorInDependenciesAt(options as any, index);
2032
+ _addModuleInInterfaceDependencies(options?: string | Partial<Module> | Module) {
2033
+ const index = this.interfaceDependencies.length;
2034
+ return this._insertModuleInInterfaceDependenciesAt(options as any, index);
2205
2035
  }
2206
2036
 
2207
2037
  /**
2208
- * 添加连接器
2038
+ * 添加模块
2209
2039
  * @internal
2210
- * @param name 连接器名称,如果不填会自动生成一个唯一名称
2040
+ * @param name 模块名称,如果不填会自动生成一个唯一名称
2211
2041
  */
2212
- addConnectorInDependencies(name?: string): Connector;
2042
+ addModuleInInterfaceDependencies(name?: string): Module;
2213
2043
 
2214
2044
  /**
2215
- * 添加连接器
2216
- * @param connectorOptions 连接器参数
2045
+ * 添加模块
2046
+ * @param moduleOptions 模块参数
2217
2047
  */
2218
- addConnectorInDependencies(connectorOptions: Partial<Connector>): Connector;
2048
+ addModuleInInterfaceDependencies(moduleOptions: Partial<Module>): Module;
2219
2049
 
2220
2050
  /**
2221
- * 添加连接器
2222
- * @param connector 已有的连接器实例
2051
+ * 添加模块
2052
+ * @param module 已有的模块实例
2223
2053
  */
2224
- addConnectorInDependencies(connector: Connector): Connector;
2054
+ addModuleInInterfaceDependencies(module: Module): Module;
2225
2055
 
2226
- addConnectorInDependencies(options?: string | Partial<Connector> | Connector) {
2227
- const node = this._addConnectorInDependencies(options as any);
2228
- const index = this.dependencies.indexOf(node);
2056
+ addModuleInInterfaceDependencies(options?: string | Partial<Module> | Module) {
2057
+ const node = this._addModuleInInterfaceDependencies(options as any);
2058
+ const index = this.interfaceDependencies.indexOf(node);
2229
2059
  node.create({
2230
2060
  index,
2231
2061
  parentNode: this,
2232
- parentKey: 'dependencies',
2062
+ parentKey: 'interfaceDependencies',
2233
2063
  });
2234
2064
  return node;
2235
2065
  }
2236
2066
 
2067
+ getConnectorExistingNames(excludedList: Array<Connector> = []) {
2068
+ const excludedSet = new Set(excludedList);
2069
+ return ((this.dependencies as Connector[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
2070
+ }
2071
+ getConnectorUniqueName(name = 'connector1') {
2072
+ return utils.unique(name, this.getConnectorExistingNames(), undefined, false);
2073
+ }
2074
+
2237
2075
  /**
2238
- * 插入模块
2076
+ * 插入连接器
2239
2077
  * @internal
2240
- * @param name 模块名称,如果不填会自动生成一个唯一名称
2078
+ * @param name 连接器名称,如果不填会自动生成一个唯一名称
2241
2079
  */
2242
- _insertModuleInInterfaceDependenciesAt(name: string, index: number): Module;
2080
+ _insertConnectorAt(name: string, index: number): Connector;
2243
2081
 
2244
2082
  /**
2245
- * 插入模块
2083
+ * 插入连接器
2246
2084
  * @internal
2247
- * @param moduleOptions 模块参数
2085
+ * @param connectorOptions 连接器参数
2248
2086
  */
2249
- _insertModuleInInterfaceDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
2087
+ _insertConnectorAt(connectorOptions: Partial<Connector>, index: number): Connector;
2250
2088
 
2251
2089
  /**
2252
- * 插入模块
2090
+ * 插入连接器
2253
2091
  * @internal
2254
- * @param module 已有的模块实例
2092
+ * @param connector 已有的连接器实例
2255
2093
  */
2256
- _insertModuleInInterfaceDependenciesAt(module: Module, index: number): Module;
2094
+ _insertConnectorAt(connector: Connector, index: number): Connector;
2257
2095
 
2258
- _insertModuleInInterfaceDependenciesAt(options: string | Partial<Module> | Module, index: number) {
2259
- const moduleOptions: any = {};
2260
- const relationOptions = { parentNode: this, parentKey: 'interfaceDependencies' };
2261
- const Module = getConceptConstructor('Module');
2262
- let module: Module;
2096
+ _insertConnectorAt(options: string | Partial<Connector> | Connector, index: number) {
2097
+ const connectorOptions: any = {};
2098
+ const relationOptions = { parentNode: this, parentKey: 'dependencies' };
2099
+ const Connector = getConceptConstructor('Connector');
2100
+ let connector: Connector;
2263
2101
  if (!options) {
2264
- module = Module.from(
2102
+ connector = Connector.from(
2265
2103
  {
2266
- ...moduleOptions,
2267
- name: this.getModuleUniqueName(),
2104
+ ...connectorOptions,
2105
+ name: this.getConnectorUniqueName(),
2268
2106
  },
2269
2107
  this,
2270
- 'interfaceDependencies',
2108
+ 'dependencies',
2271
2109
  );
2272
2110
  } else if (typeof options === 'string') {
2273
- module = Module.from(
2111
+ connector = Connector.from(
2274
2112
  {
2275
- ...moduleOptions,
2113
+ ...connectorOptions,
2276
2114
  name: options,
2277
2115
  },
2278
2116
  this,
2279
- 'interfaceDependencies',
2117
+ 'dependencies',
2280
2118
  );
2281
- } else if (asserts.isModule(options)) {
2119
+ } else if (asserts.isConnector(options)) {
2282
2120
  options.ensureDelete(); // 同一实例不支持多处存在
2283
- module = options;
2284
- Object.assign(module, relationOptions);
2121
+ connector = options;
2122
+ Object.assign(connector, relationOptions);
2285
2123
  } else {
2286
- module = Module.from(
2124
+ connector = Connector.from(
2287
2125
  {
2288
- ...moduleOptions,
2126
+ ...connectorOptions,
2289
2127
  ...options,
2290
2128
  },
2291
2129
  this,
2292
- 'interfaceDependencies',
2130
+ 'dependencies',
2293
2131
  );
2294
2132
  }
2295
- this.interfaceDependencies.splice(index, 0, module);
2296
- return module;
2133
+ this.dependencies.splice(index, 0, connector);
2134
+ return connector;
2297
2135
  }
2298
2136
 
2299
2137
  /**
2300
- * 插入模块
2301
- * @param name 模块名称,如果不填会自动生成一个唯一名称
2138
+ * 插入连接器
2139
+ * @param name 连接器名称,如果不填会自动生成一个唯一名称
2302
2140
  */
2303
- insertModuleInInterfaceDependenciesAt(name: string, index: number): Module;
2141
+ insertConnectorAt(name: string, index: number): Connector;
2304
2142
 
2305
2143
  /**
2306
- * 插入模块
2307
- * @param moduleOptions 模块参数
2144
+ * 插入连接器
2145
+ * @param connectorOptions 连接器参数
2308
2146
  */
2309
- insertModuleInInterfaceDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
2147
+ insertConnectorAt(connectorOptions: Partial<Connector>, index: number): Connector;
2310
2148
 
2311
2149
  /**
2312
- * 插入模块
2313
- * @param module 已有的模块实例
2150
+ * 插入连接器
2151
+ * @param connector 已有的连接器实例
2314
2152
  */
2315
- insertModuleInInterfaceDependenciesAt(module: Module, index: number): Module;
2153
+ insertConnectorAt(connector: Connector, index: number): Connector;
2316
2154
 
2317
- insertModuleInInterfaceDependenciesAt(options: string | Partial<Module> | Module, index: number) {
2318
- const node = this._insertModuleInInterfaceDependenciesAt(options as any, index);
2155
+ insertConnectorAt(options: string | Partial<Connector> | Connector, index: number) {
2156
+ const node = this._insertConnectorAt(options as any, index);
2319
2157
  node.create({
2320
2158
  index,
2321
2159
  parentNode: this,
2322
- parentKey: 'interfaceDependencies',
2160
+ parentKey: 'dependencies',
2323
2161
  });
2324
2162
  return node;
2325
2163
  }
2326
2164
 
2327
2165
  /**
2328
- * 添加模块
2166
+ * 添加连接器
2329
2167
  * @internal
2330
- * @param name 模块名称,如果不填会自动生成一个唯一名称
2168
+ * @param name 连接器名称,如果不填会自动生成一个唯一名称
2331
2169
  */
2332
- _addModuleInInterfaceDependencies(name?: string): Module;
2170
+ _addConnector(name?: string): Connector;
2333
2171
 
2334
2172
  /**
2335
- * 添加模块
2173
+ * 添加连接器
2336
2174
  * @internal
2337
- * @param moduleOptions 模块参数
2175
+ * @param connectorOptions 连接器参数
2338
2176
  */
2339
- _addModuleInInterfaceDependencies(moduleOptions: Partial<Module>): Module;
2177
+ _addConnector(connectorOptions: Partial<Connector>): Connector;
2340
2178
 
2341
2179
  /**
2342
- * 添加模块
2180
+ * 添加连接器
2343
2181
  * @internal
2344
- * @param module 已有的模块实例
2182
+ * @param connector 已有的连接器实例
2345
2183
  */
2346
- _addModuleInInterfaceDependencies(module: Module): Module;
2184
+ _addConnector(connector: Connector): Connector;
2347
2185
 
2348
- _addModuleInInterfaceDependencies(options?: string | Partial<Module> | Module) {
2349
- const index = this.interfaceDependencies.length;
2350
- return this._insertModuleInInterfaceDependenciesAt(options as any, index);
2186
+ _addConnector(options?: string | Partial<Connector> | Connector) {
2187
+ const index = this.dependencies.length;
2188
+ return this._insertConnectorAt(options as any, index);
2351
2189
  }
2352
2190
 
2353
2191
  /**
2354
- * 添加模块
2192
+ * 添加连接器
2355
2193
  * @internal
2356
- * @param name 模块名称,如果不填会自动生成一个唯一名称
2194
+ * @param name 连接器名称,如果不填会自动生成一个唯一名称
2357
2195
  */
2358
- addModuleInInterfaceDependencies(name?: string): Module;
2196
+ addConnector(name?: string): Connector;
2359
2197
 
2360
2198
  /**
2361
- * 添加模块
2362
- * @param moduleOptions 模块参数
2199
+ * 添加连接器
2200
+ * @param connectorOptions 连接器参数
2363
2201
  */
2364
- addModuleInInterfaceDependencies(moduleOptions: Partial<Module>): Module;
2202
+ addConnector(connectorOptions: Partial<Connector>): Connector;
2365
2203
 
2366
2204
  /**
2367
- * 添加模块
2368
- * @param module 已有的模块实例
2205
+ * 添加连接器
2206
+ * @param connector 已有的连接器实例
2369
2207
  */
2370
- addModuleInInterfaceDependencies(module: Module): Module;
2208
+ addConnector(connector: Connector): Connector;
2371
2209
 
2372
- addModuleInInterfaceDependencies(options?: string | Partial<Module> | Module) {
2373
- const node = this._addModuleInInterfaceDependencies(options as any);
2374
- const index = this.interfaceDependencies.indexOf(node);
2210
+ addConnector(options?: string | Partial<Connector> | Connector) {
2211
+ const node = this._addConnector(options as any);
2212
+ const index = this.dependencies.indexOf(node);
2375
2213
  node.create({
2376
2214
  index,
2377
2215
  parentNode: this,
2378
- parentKey: 'interfaceDependencies',
2216
+ parentKey: 'dependencies',
2379
2217
  });
2380
2218
  return node;
2381
2219
  }
2382
2220
 
2383
- getConnectionExistingNames(excludedList: Array<Connection> = []) {
2221
+ getAuthLogicExistingNames(excludedList: Array<AuthLogic> = []) {
2384
2222
  const excludedSet = new Set(excludedList);
2385
- return ((this.connections as Connection[]) || [])
2386
- .filter((item) => !excludedSet.has(item))
2387
- .map((item) => item?.name);
2223
+ return ((this.authLogics as AuthLogic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
2388
2224
  }
2389
- getConnectionUniqueName(name = 'connection1') {
2390
- return utils.unique(name, this.getConnectionExistingNames(), undefined, false);
2225
+ getAuthLogicUniqueName(name = 'authentication1') {
2226
+ return utils.unique(name, this.getAuthLogicExistingNames(), undefined, false);
2391
2227
  }
2392
2228
 
2393
2229
  /**
2394
- * 插入连接
2230
+ * 插入鉴权逻辑
2395
2231
  * @internal
2396
- * @param name 连接名称,如果不填会自动生成一个唯一名称
2232
+ * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
2397
2233
  */
2398
- _insertConnectionAt(name: string, index: number): Connection;
2234
+ _insertAuthLogicAt(name: string, index: number): AuthLogic;
2399
2235
 
2400
2236
  /**
2401
- * 插入连接
2237
+ * 插入鉴权逻辑
2402
2238
  * @internal
2403
- * @param connectionOptions 连接参数
2239
+ * @param authLogicOptions 鉴权逻辑参数
2404
2240
  */
2405
- _insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
2241
+ _insertAuthLogicAt(authLogicOptions: Partial<AuthLogic>, index: number): AuthLogic;
2406
2242
 
2407
2243
  /**
2408
- * 插入连接
2244
+ * 插入鉴权逻辑
2409
2245
  * @internal
2410
- * @param connection 已有的连接实例
2246
+ * @param authLogic 已有的鉴权逻辑实例
2411
2247
  */
2412
- _insertConnectionAt(connection: Connection, index: number): Connection;
2248
+ _insertAuthLogicAt(authLogic: AuthLogic, index: number): AuthLogic;
2413
2249
 
2414
- _insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
2415
- const connectionOptions: any = {};
2416
- const relationOptions = { parentNode: this, parentKey: 'connections' };
2417
- const Connection = getConceptConstructor('Connection');
2418
- let connection: Connection;
2250
+ _insertAuthLogicAt(options: string | Partial<AuthLogic> | AuthLogic, index: number) {
2251
+ const authLogicOptions: any = {};
2252
+ const relationOptions = { parentNode: this, parentKey: 'authLogics' };
2253
+ const AuthLogic = getConceptConstructor('AuthLogic');
2254
+ let authLogic: AuthLogic;
2419
2255
  if (!options) {
2420
- connection = Connection.from(
2256
+ authLogic = AuthLogic.from(
2421
2257
  {
2422
- ...connectionOptions,
2423
- name: this.getConnectionUniqueName(),
2258
+ ...authLogicOptions,
2259
+ name: this.getAuthLogicUniqueName(),
2424
2260
  },
2425
2261
  this,
2426
- 'connections',
2262
+ 'authLogics',
2427
2263
  );
2428
2264
  } else if (typeof options === 'string') {
2429
- connection = Connection.from(
2265
+ authLogic = AuthLogic.from(
2430
2266
  {
2431
- ...connectionOptions,
2267
+ ...authLogicOptions,
2432
2268
  name: options,
2433
2269
  },
2434
2270
  this,
2435
- 'connections',
2271
+ 'authLogics',
2436
2272
  );
2437
- } else if (asserts.isConnection(options)) {
2273
+ } else if (asserts.isAuthLogic(options)) {
2438
2274
  options.ensureDelete(); // 同一实例不支持多处存在
2439
- connection = options;
2440
- Object.assign(connection, relationOptions);
2275
+ authLogic = options;
2276
+ Object.assign(authLogic, relationOptions);
2441
2277
  } else {
2442
- connection = Connection.from(
2278
+ authLogic = AuthLogic.from(
2443
2279
  {
2444
- ...connectionOptions,
2280
+ ...authLogicOptions,
2445
2281
  ...options,
2446
2282
  },
2447
2283
  this,
2448
- 'connections',
2284
+ 'authLogics',
2449
2285
  );
2450
2286
  }
2451
- this.connections.splice(index, 0, connection);
2452
- return connection;
2287
+ this.authLogics.splice(index, 0, authLogic);
2288
+ return authLogic;
2453
2289
  }
2454
2290
 
2455
2291
  /**
2456
- * 插入连接
2457
- * @param name 连接名称,如果不填会自动生成一个唯一名称
2292
+ * 插入鉴权逻辑
2293
+ * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
2458
2294
  */
2459
- insertConnectionAt(name: string, index: number): Connection;
2295
+ insertAuthLogicAt(name: string, index: number): AuthLogic;
2460
2296
 
2461
2297
  /**
2462
- * 插入连接
2463
- * @param connectionOptions 连接参数
2298
+ * 插入鉴权逻辑
2299
+ * @param authLogicOptions 鉴权逻辑参数
2464
2300
  */
2465
- insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
2301
+ insertAuthLogicAt(authLogicOptions: Partial<AuthLogic>, index: number): AuthLogic;
2466
2302
 
2467
2303
  /**
2468
- * 插入连接
2469
- * @param connection 已有的连接实例
2304
+ * 插入鉴权逻辑
2305
+ * @param authLogic 已有的鉴权逻辑实例
2470
2306
  */
2471
- insertConnectionAt(connection: Connection, index: number): Connection;
2307
+ insertAuthLogicAt(authLogic: AuthLogic, index: number): AuthLogic;
2472
2308
 
2473
- insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
2474
- const node = this._insertConnectionAt(options as any, index);
2309
+ insertAuthLogicAt(options: string | Partial<AuthLogic> | AuthLogic, index: number) {
2310
+ const node = this._insertAuthLogicAt(options as any, index);
2475
2311
  node.create({
2476
2312
  index,
2477
2313
  parentNode: this,
2478
- parentKey: 'connections',
2314
+ parentKey: 'authLogics',
2479
2315
  });
2480
2316
  return node;
2481
2317
  }
2482
2318
 
2483
2319
  /**
2484
- * 添加连接
2320
+ * 添加鉴权逻辑
2485
2321
  * @internal
2486
- * @param name 连接名称,如果不填会自动生成一个唯一名称
2322
+ * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
2487
2323
  */
2488
- _addConnection(name?: string): Connection;
2324
+ _addAuthLogic(name?: string): AuthLogic;
2489
2325
 
2490
2326
  /**
2491
- * 添加连接
2327
+ * 添加鉴权逻辑
2492
2328
  * @internal
2493
- * @param connectionOptions 连接参数
2329
+ * @param authLogicOptions 鉴权逻辑参数
2494
2330
  */
2495
- _addConnection(connectionOptions: Partial<Connection>): Connection;
2331
+ _addAuthLogic(authLogicOptions: Partial<AuthLogic>): AuthLogic;
2496
2332
 
2497
2333
  /**
2498
- * 添加连接
2334
+ * 添加鉴权逻辑
2499
2335
  * @internal
2500
- * @param connection 已有的连接实例
2336
+ * @param authLogic 已有的鉴权逻辑实例
2501
2337
  */
2502
- _addConnection(connection: Connection): Connection;
2338
+ _addAuthLogic(authLogic: AuthLogic): AuthLogic;
2503
2339
 
2504
- _addConnection(options?: string | Partial<Connection> | Connection) {
2505
- const index = this.connections.length;
2506
- return this._insertConnectionAt(options as any, index);
2340
+ _addAuthLogic(options?: string | Partial<AuthLogic> | AuthLogic) {
2341
+ const index = this.authLogics.length;
2342
+ return this._insertAuthLogicAt(options as any, index);
2507
2343
  }
2508
2344
 
2509
2345
  /**
2510
- * 添加连接
2346
+ * 添加鉴权逻辑
2511
2347
  * @internal
2512
- * @param name 连接名称,如果不填会自动生成一个唯一名称
2348
+ * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
2513
2349
  */
2514
- addConnection(name?: string): Connection;
2350
+ addAuthLogic(name?: string): AuthLogic;
2515
2351
 
2516
2352
  /**
2517
- * 添加连接
2518
- * @param connectionOptions 连接参数
2353
+ * 添加鉴权逻辑
2354
+ * @param authLogicOptions 鉴权逻辑参数
2519
2355
  */
2520
- addConnection(connectionOptions: Partial<Connection>): Connection;
2356
+ addAuthLogic(authLogicOptions: Partial<AuthLogic>): AuthLogic;
2521
2357
 
2522
2358
  /**
2523
- * 添加连接
2524
- * @param connection 已有的连接实例
2359
+ * 添加鉴权逻辑
2360
+ * @param authLogic 已有的鉴权逻辑实例
2525
2361
  */
2526
- addConnection(connection: Connection): Connection;
2362
+ addAuthLogic(authLogic: AuthLogic): AuthLogic;
2527
2363
 
2528
- addConnection(options?: string | Partial<Connection> | Connection) {
2529
- const node = this._addConnection(options as any);
2530
- const index = this.connections.indexOf(node);
2364
+ addAuthLogic(options?: string | Partial<AuthLogic> | AuthLogic) {
2365
+ const node = this._addAuthLogic(options as any);
2366
+ const index = this.authLogics.indexOf(node);
2531
2367
  node.create({
2532
2368
  index,
2533
2369
  parentNode: this,
2534
- parentKey: 'connections',
2370
+ parentKey: 'authLogics',
2535
2371
  });
2536
2372
  return node;
2537
2373
  }
2538
2374
 
2539
- getTriggerLauncherExistingNames(excludedList: Array<TriggerLauncher> = []) {
2375
+ getAuthLogicForCallInterfaceExistingNames(excludedList: Array<AuthLogicForCallInterface> = []) {
2540
2376
  const excludedSet = new Set(excludedList);
2541
- return ((this.triggerLaunchers as TriggerLauncher[]) || [])
2377
+ return ((this.authLogicsForCallInterface as AuthLogicForCallInterface[]) || [])
2542
2378
  .filter((item) => !excludedSet.has(item))
2543
- .map((item) => item?.name);
2379
+ .map((item) => item.name);
2544
2380
  }
2545
- getTriggerLauncherUniqueName(name = 'triggerLauncher1') {
2546
- return utils.unique(name, this.getTriggerLauncherExistingNames(), undefined, false);
2381
+ getAuthLogicForCallInterfaceUniqueName(name = 'authLogicForCallInterface1') {
2382
+ return utils.unique(name, this.getAuthLogicForCallInterfaceExistingNames(), undefined, false);
2547
2383
  }
2548
2384
 
2549
2385
  /**
2550
- * 插入触发器启动器
2386
+ * 插入调用接口的鉴权逻辑
2551
2387
  * @internal
2552
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2388
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2553
2389
  */
2554
- _insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
2390
+ _insertAuthLogicForCallInterfaceAt(name: string, index: number): AuthLogicForCallInterface;
2555
2391
 
2556
2392
  /**
2557
- * 插入触发器启动器
2393
+ * 插入调用接口的鉴权逻辑
2558
2394
  * @internal
2559
- * @param triggerLauncherOptions 触发器启动器参数
2395
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2560
2396
  */
2561
- _insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
2397
+ _insertAuthLogicForCallInterfaceAt(
2398
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2399
+ index: number,
2400
+ ): AuthLogicForCallInterface;
2562
2401
 
2563
2402
  /**
2564
- * 插入触发器启动器
2403
+ * 插入调用接口的鉴权逻辑
2565
2404
  * @internal
2566
- * @param triggerLauncher 已有的触发器启动器实例
2405
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2567
2406
  */
2568
- _insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
2407
+ _insertAuthLogicForCallInterfaceAt(
2408
+ authLogicForCallInterface: AuthLogicForCallInterface,
2409
+ index: number,
2410
+ ): AuthLogicForCallInterface;
2569
2411
 
2570
- _insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
2571
- const triggerLauncherOptions: any = {};
2572
- const relationOptions = { parentNode: this, parentKey: 'triggerLaunchers' };
2573
- const TriggerLauncher = getConceptConstructor('TriggerLauncher');
2574
- let triggerLauncher: TriggerLauncher;
2412
+ _insertAuthLogicForCallInterfaceAt(
2413
+ options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
2414
+ index: number,
2415
+ ) {
2416
+ const authLogicForCallInterfaceOptions: any = {};
2417
+ const relationOptions = { parentNode: this, parentKey: 'authLogicsForCallInterface' };
2418
+ const AuthLogicForCallInterface = getConceptConstructor('AuthLogicForCallInterface');
2419
+ let authLogicForCallInterface: AuthLogicForCallInterface;
2575
2420
  if (!options) {
2576
- triggerLauncher = TriggerLauncher.from(
2421
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
2577
2422
  {
2578
- ...triggerLauncherOptions,
2579
- name: this.getTriggerLauncherUniqueName(),
2423
+ ...authLogicForCallInterfaceOptions,
2424
+ name: this.getAuthLogicForCallInterfaceUniqueName(),
2580
2425
  },
2581
2426
  this,
2582
- 'triggerLaunchers',
2427
+ 'authLogicsForCallInterface',
2583
2428
  );
2584
2429
  } else if (typeof options === 'string') {
2585
- triggerLauncher = TriggerLauncher.from(
2430
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
2586
2431
  {
2587
- ...triggerLauncherOptions,
2432
+ ...authLogicForCallInterfaceOptions,
2588
2433
  name: options,
2589
2434
  },
2590
2435
  this,
2591
- 'triggerLaunchers',
2436
+ 'authLogicsForCallInterface',
2592
2437
  );
2593
- } else if (asserts.isTriggerLauncher(options)) {
2438
+ } else if (asserts.isAuthLogicForCallInterface(options)) {
2594
2439
  options.ensureDelete(); // 同一实例不支持多处存在
2595
- triggerLauncher = options;
2596
- Object.assign(triggerLauncher, relationOptions);
2440
+ authLogicForCallInterface = options;
2441
+ Object.assign(authLogicForCallInterface, relationOptions);
2597
2442
  } else {
2598
- triggerLauncher = TriggerLauncher.from(
2443
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
2599
2444
  {
2600
- ...triggerLauncherOptions,
2445
+ ...authLogicForCallInterfaceOptions,
2601
2446
  ...options,
2602
2447
  },
2603
2448
  this,
2604
- 'triggerLaunchers',
2449
+ 'authLogicsForCallInterface',
2605
2450
  );
2606
2451
  }
2607
- this.triggerLaunchers.splice(index, 0, triggerLauncher);
2608
- return triggerLauncher;
2452
+ this.authLogicsForCallInterface.splice(index, 0, authLogicForCallInterface);
2453
+ return authLogicForCallInterface;
2609
2454
  }
2610
2455
 
2611
2456
  /**
2612
- * 插入触发器启动器
2613
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2457
+ * 插入调用接口的鉴权逻辑
2458
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2614
2459
  */
2615
- insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
2460
+ insertAuthLogicForCallInterfaceAt(name: string, index: number): AuthLogicForCallInterface;
2616
2461
 
2617
2462
  /**
2618
- * 插入触发器启动器
2619
- * @param triggerLauncherOptions 触发器启动器参数
2463
+ * 插入调用接口的鉴权逻辑
2464
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2620
2465
  */
2621
- insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
2466
+ insertAuthLogicForCallInterfaceAt(
2467
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2468
+ index: number,
2469
+ ): AuthLogicForCallInterface;
2622
2470
 
2623
2471
  /**
2624
- * 插入触发器启动器
2625
- * @param triggerLauncher 已有的触发器启动器实例
2472
+ * 插入调用接口的鉴权逻辑
2473
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2626
2474
  */
2627
- insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
2475
+ insertAuthLogicForCallInterfaceAt(
2476
+ authLogicForCallInterface: AuthLogicForCallInterface,
2477
+ index: number,
2478
+ ): AuthLogicForCallInterface;
2628
2479
 
2629
- insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
2630
- const node = this._insertTriggerLauncherAt(options as any, index);
2480
+ insertAuthLogicForCallInterfaceAt(
2481
+ options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
2482
+ index: number,
2483
+ ) {
2484
+ const node = this._insertAuthLogicForCallInterfaceAt(options as any, index);
2631
2485
  node.create({
2632
2486
  index,
2633
2487
  parentNode: this,
2634
- parentKey: 'triggerLaunchers',
2488
+ parentKey: 'authLogicsForCallInterface',
2635
2489
  });
2636
2490
  return node;
2637
2491
  }
2638
2492
 
2639
2493
  /**
2640
- * 添加触发器启动器
2494
+ * 添加调用接口的鉴权逻辑
2641
2495
  * @internal
2642
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2496
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2643
2497
  */
2644
- _addTriggerLauncher(name?: string): TriggerLauncher;
2498
+ _addAuthLogicForCallInterface(name?: string): AuthLogicForCallInterface;
2645
2499
 
2646
2500
  /**
2647
- * 添加触发器启动器
2501
+ * 添加调用接口的鉴权逻辑
2648
2502
  * @internal
2649
- * @param triggerLauncherOptions 触发器启动器参数
2503
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2650
2504
  */
2651
- _addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
2505
+ _addAuthLogicForCallInterface(
2506
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2507
+ ): AuthLogicForCallInterface;
2652
2508
 
2653
2509
  /**
2654
- * 添加触发器启动器
2510
+ * 添加调用接口的鉴权逻辑
2655
2511
  * @internal
2656
- * @param triggerLauncher 已有的触发器启动器实例
2512
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2657
2513
  */
2658
- _addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
2514
+ _addAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): AuthLogicForCallInterface;
2659
2515
 
2660
- _addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
2661
- const index = this.triggerLaunchers.length;
2662
- return this._insertTriggerLauncherAt(options as any, index);
2516
+ _addAuthLogicForCallInterface(options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface) {
2517
+ const index = this.authLogicsForCallInterface.length;
2518
+ return this._insertAuthLogicForCallInterfaceAt(options as any, index);
2663
2519
  }
2664
2520
 
2665
2521
  /**
2666
- * 添加触发器启动器
2522
+ * 添加调用接口的鉴权逻辑
2667
2523
  * @internal
2668
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2524
+ * @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
2669
2525
  */
2670
- addTriggerLauncher(name?: string): TriggerLauncher;
2526
+ addAuthLogicForCallInterface(name?: string): AuthLogicForCallInterface;
2671
2527
 
2672
2528
  /**
2673
- * 添加触发器启动器
2674
- * @param triggerLauncherOptions 触发器启动器参数
2529
+ * 添加调用接口的鉴权逻辑
2530
+ * @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
2675
2531
  */
2676
- addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
2532
+ addAuthLogicForCallInterface(
2533
+ authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
2534
+ ): AuthLogicForCallInterface;
2677
2535
 
2678
2536
  /**
2679
- * 添加触发器启动器
2680
- * @param triggerLauncher 已有的触发器启动器实例
2537
+ * 添加调用接口的鉴权逻辑
2538
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2681
2539
  */
2682
- addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
2540
+ addAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): AuthLogicForCallInterface;
2683
2541
 
2684
- addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
2685
- const node = this._addTriggerLauncher(options as any);
2686
- const index = this.triggerLaunchers.indexOf(node);
2542
+ addAuthLogicForCallInterface(options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface) {
2543
+ const node = this._addAuthLogicForCallInterface(options as any);
2544
+ const index = this.authLogicsForCallInterface.indexOf(node);
2687
2545
  node.create({
2688
2546
  index,
2689
2547
  parentNode: this,
2690
- parentKey: 'triggerLaunchers',
2548
+ parentKey: 'authLogicsForCallInterface',
2691
2549
  });
2692
2550
  return node;
2693
2551
  }
2694
2552
 
2695
- getMetadataTypeExistingNames(excludedList: Array<MetadataType> = []) {
2553
+ getConnectionExistingNames(excludedList: Array<Connection> = []) {
2696
2554
  const excludedSet = new Set(excludedList);
2697
- return ((this.metadataTypes as MetadataType[]) || [])
2698
- .filter((item) => !excludedSet.has(item))
2699
- .map((item) => item?.name);
2555
+ return ((this.connections as Connection[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
2700
2556
  }
2701
- getMetadataTypeUniqueName(name = 'MetadataType1') {
2702
- return utils.unique(name, this.getMetadataTypeExistingNames(), undefined, true);
2557
+ getConnectionUniqueName(name = 'connection1') {
2558
+ return utils.unique(name, this.getConnectionExistingNames(), undefined, false);
2703
2559
  }
2704
2560
 
2705
2561
  /**
2706
- * 插入元数据类型
2562
+ * 插入连接
2707
2563
  * @internal
2708
- * @param name 元数据类型名称,如果不填会自动生成一个唯一名称
2564
+ * @param name 连接名称,如果不填会自动生成一个唯一名称
2709
2565
  */
2710
- _insertMetadataTypeAt(name: string, index: number): MetadataType;
2566
+ _insertConnectionAt(name: string, index: number): Connection;
2711
2567
 
2712
2568
  /**
2713
- * 插入元数据类型
2569
+ * 插入连接
2714
2570
  * @internal
2715
- * @param metadataTypeOptions 元数据类型参数
2571
+ * @param connectionOptions 连接参数
2716
2572
  */
2717
- _insertMetadataTypeAt(metadataTypeOptions: Partial<MetadataType>, index: number): MetadataType;
2573
+ _insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
2718
2574
 
2719
2575
  /**
2720
- * 插入元数据类型
2576
+ * 插入连接
2721
2577
  * @internal
2722
- * @param metadataType 已有的元数据类型实例
2578
+ * @param connection 已有的连接实例
2723
2579
  */
2724
- _insertMetadataTypeAt(metadataType: MetadataType, index: number): MetadataType;
2580
+ _insertConnectionAt(connection: Connection, index: number): Connection;
2725
2581
 
2726
- _insertMetadataTypeAt(options: string | Partial<MetadataType> | MetadataType, index: number) {
2727
- const metadataTypeOptions: any = {};
2728
- const relationOptions = { parentNode: this, parentKey: 'metadataTypes' };
2729
- const MetadataType = getConceptConstructor('MetadataType');
2730
- let metadataType: MetadataType;
2582
+ _insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
2583
+ const connectionOptions: any = {};
2584
+ const relationOptions = { parentNode: this, parentKey: 'connections' };
2585
+ const Connection = getConceptConstructor('Connection');
2586
+ let connection: Connection;
2731
2587
  if (!options) {
2732
- metadataType = MetadataType.from(
2588
+ connection = Connection.from(
2733
2589
  {
2734
- ...metadataTypeOptions,
2735
- name: this.getMetadataTypeUniqueName(),
2590
+ ...connectionOptions,
2591
+ name: this.getConnectionUniqueName(),
2736
2592
  },
2737
2593
  this,
2738
- 'metadataTypes',
2594
+ 'connections',
2739
2595
  );
2740
2596
  } else if (typeof options === 'string') {
2741
- metadataType = MetadataType.from(
2597
+ connection = Connection.from(
2742
2598
  {
2743
- ...metadataTypeOptions,
2599
+ ...connectionOptions,
2744
2600
  name: options,
2745
2601
  },
2746
2602
  this,
2747
- 'metadataTypes',
2603
+ 'connections',
2748
2604
  );
2749
- } else if (asserts.isMetadataType(options)) {
2605
+ } else if (asserts.isConnection(options)) {
2750
2606
  options.ensureDelete(); // 同一实例不支持多处存在
2751
- metadataType = options;
2752
- Object.assign(metadataType, relationOptions);
2607
+ connection = options;
2608
+ Object.assign(connection, relationOptions);
2753
2609
  } else {
2754
- metadataType = MetadataType.from(
2610
+ connection = Connection.from(
2755
2611
  {
2756
- ...metadataTypeOptions,
2612
+ ...connectionOptions,
2757
2613
  ...options,
2758
2614
  },
2759
2615
  this,
2760
- 'metadataTypes',
2616
+ 'connections',
2761
2617
  );
2762
2618
  }
2763
- this.metadataTypes.splice(index, 0, metadataType);
2764
- return metadataType;
2619
+ this.connections.splice(index, 0, connection);
2620
+ return connection;
2765
2621
  }
2766
2622
 
2767
2623
  /**
2768
- * 插入元数据类型
2769
- * @param name 元数据类型名称,如果不填会自动生成一个唯一名称
2624
+ * 插入连接
2625
+ * @param name 连接名称,如果不填会自动生成一个唯一名称
2770
2626
  */
2771
- insertMetadataTypeAt(name: string, index: number): MetadataType;
2627
+ insertConnectionAt(name: string, index: number): Connection;
2772
2628
 
2773
2629
  /**
2774
- * 插入元数据类型
2775
- * @param metadataTypeOptions 元数据类型参数
2630
+ * 插入连接
2631
+ * @param connectionOptions 连接参数
2776
2632
  */
2777
- insertMetadataTypeAt(metadataTypeOptions: Partial<MetadataType>, index: number): MetadataType;
2633
+ insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
2778
2634
 
2779
2635
  /**
2780
- * 插入元数据类型
2781
- * @param metadataType 已有的元数据类型实例
2636
+ * 插入连接
2637
+ * @param connection 已有的连接实例
2782
2638
  */
2783
- insertMetadataTypeAt(metadataType: MetadataType, index: number): MetadataType;
2639
+ insertConnectionAt(connection: Connection, index: number): Connection;
2784
2640
 
2785
- insertMetadataTypeAt(options: string | Partial<MetadataType> | MetadataType, index: number) {
2786
- const node = this._insertMetadataTypeAt(options as any, index);
2641
+ insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
2642
+ const node = this._insertConnectionAt(options as any, index);
2787
2643
  node.create({
2788
2644
  index,
2789
2645
  parentNode: this,
2790
- parentKey: 'metadataTypes',
2646
+ parentKey: 'connections',
2791
2647
  });
2792
2648
  return node;
2793
2649
  }
2794
2650
 
2795
2651
  /**
2796
- * 添加元数据类型
2652
+ * 添加连接
2797
2653
  * @internal
2798
- * @param name 元数据类型名称,如果不填会自动生成一个唯一名称
2654
+ * @param name 连接名称,如果不填会自动生成一个唯一名称
2799
2655
  */
2800
- _addMetadataType(name?: string): MetadataType;
2656
+ _addConnection(name?: string): Connection;
2801
2657
 
2802
2658
  /**
2803
- * 添加元数据类型
2659
+ * 添加连接
2804
2660
  * @internal
2805
- * @param metadataTypeOptions 元数据类型参数
2661
+ * @param connectionOptions 连接参数
2806
2662
  */
2807
- _addMetadataType(metadataTypeOptions: Partial<MetadataType>): MetadataType;
2663
+ _addConnection(connectionOptions: Partial<Connection>): Connection;
2808
2664
 
2809
2665
  /**
2810
- * 添加元数据类型
2666
+ * 添加连接
2811
2667
  * @internal
2812
- * @param metadataType 已有的元数据类型实例
2668
+ * @param connection 已有的连接实例
2813
2669
  */
2814
- _addMetadataType(metadataType: MetadataType): MetadataType;
2670
+ _addConnection(connection: Connection): Connection;
2815
2671
 
2816
- _addMetadataType(options?: string | Partial<MetadataType> | MetadataType) {
2817
- const index = 0;
2818
- return this._insertMetadataTypeAt(options as any, index);
2672
+ _addConnection(options?: string | Partial<Connection> | Connection) {
2673
+ const index = this.connections.length;
2674
+ return this._insertConnectionAt(options as any, index);
2819
2675
  }
2820
2676
 
2821
2677
  /**
2822
- * 添加元数据类型
2678
+ * 添加连接
2823
2679
  * @internal
2824
- * @param name 元数据类型名称,如果不填会自动生成一个唯一名称
2680
+ * @param name 连接名称,如果不填会自动生成一个唯一名称
2825
2681
  */
2826
- addMetadataType(name?: string): MetadataType;
2682
+ addConnection(name?: string): Connection;
2827
2683
 
2828
2684
  /**
2829
- * 添加元数据类型
2830
- * @param metadataTypeOptions 元数据类型参数
2685
+ * 添加连接
2686
+ * @param connectionOptions 连接参数
2831
2687
  */
2832
- addMetadataType(metadataTypeOptions: Partial<MetadataType>): MetadataType;
2688
+ addConnection(connectionOptions: Partial<Connection>): Connection;
2833
2689
 
2834
2690
  /**
2835
- * 添加元数据类型
2836
- * @param metadataType 已有的元数据类型实例
2691
+ * 添加连接
2692
+ * @param connection 已有的连接实例
2837
2693
  */
2838
- addMetadataType(metadataType: MetadataType): MetadataType;
2694
+ addConnection(connection: Connection): Connection;
2839
2695
 
2840
- addMetadataType(options?: string | Partial<MetadataType> | MetadataType) {
2841
- const node = this._addMetadataType(options as any);
2842
- const index = this.metadataTypes.indexOf(node);
2696
+ addConnection(options?: string | Partial<Connection> | Connection) {
2697
+ const node = this._addConnection(options as any);
2698
+ const index = this.connections.indexOf(node);
2843
2699
  node.create({
2844
2700
  index,
2845
2701
  parentNode: this,
2846
- parentKey: 'metadataTypes',
2702
+ parentKey: 'connections',
2847
2703
  });
2848
2704
  return node;
2849
2705
  }
2850
2706
 
2707
+ getTriggerLauncherExistingNames(excludedList: Array<TriggerLauncher> = []) {
2708
+ const excludedSet = new Set(excludedList);
2709
+ return ((this.triggerLaunchers as TriggerLauncher[]) || [])
2710
+ .filter((item) => !excludedSet.has(item))
2711
+ .map((item) => item.name);
2712
+ }
2713
+ getTriggerLauncherUniqueName(name = 'triggerLauncher1') {
2714
+ return utils.unique(name, this.getTriggerLauncherExistingNames(), undefined, false);
2715
+ }
2716
+
2851
2717
  /**
2852
- * 删除数据源
2853
- * @param name 数据源名称
2718
+ * 插入触发器启动器
2719
+ * @internal
2720
+ * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2854
2721
  */
2855
- removeDataSource(name: string): void;
2722
+ _insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
2856
2723
 
2857
2724
  /**
2858
- * 删除数据源
2859
- * @param dataSource 已有的数据源实例
2725
+ * 插入触发器启动器
2726
+ * @internal
2727
+ * @param triggerLauncherOptions 触发器启动器参数
2860
2728
  */
2861
- removeDataSource(dataSource: DataSource): void;
2729
+ _insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
2862
2730
 
2863
- removeDataSource(options: string | DataSource) {
2864
- let dataSource: DataSource;
2865
- if (typeof options === 'string') {
2866
- dataSource = (this.dataSources as DataSource[]).find((item) => item.name === options);
2867
- if (!dataSource) {
2868
- throw new Error('找不到数据源 ' + options);
2869
- }
2870
- } else {
2871
- dataSource = options;
2872
- }
2873
- return dataSource.delete();
2874
- }
2731
+ /**
2732
+ * 插入触发器启动器
2733
+ * @internal
2734
+ * @param triggerLauncher 已有的触发器启动器实例
2735
+ */
2736
+ _insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
2875
2737
 
2876
- __removeDataSource(dataSource: DataSource) {
2877
- const parentKey = dataSource.parentKey;
2878
- const params: Params = {
2879
- parentNode: this,
2880
- parentKey,
2881
- index: -1,
2882
- object: null,
2883
- oldObject: dataSource,
2884
- };
2885
- if (parentKey) {
2886
- params.parentKey = parentKey;
2887
- // @ts-ignore
2888
- const t = this.__v_raw || this;
2889
- // @ts-ignore
2890
- const n = dataSource.__v_raw || dataSource;
2891
- if (Array.isArray((t as any)[parentKey])) {
2892
- // @ts-ignore
2893
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
2894
- ~index && (this as any)[parentKey].splice(index, 1);
2895
- params.index = index;
2896
- } else {
2897
- const q = (t as any)[parentKey];
2898
- if ((q.__v_raw || q) === n) {
2899
- params.index = 0;
2900
- (this as any)[parentKey] = undefined;
2901
- }
2902
- }
2738
+ _insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
2739
+ const triggerLauncherOptions: any = {};
2740
+ const relationOptions = { parentNode: this, parentKey: 'triggerLaunchers' };
2741
+ const TriggerLauncher = getConceptConstructor('TriggerLauncher');
2742
+ let triggerLauncher: TriggerLauncher;
2743
+ if (!options) {
2744
+ triggerLauncher = TriggerLauncher.from(
2745
+ {
2746
+ ...triggerLauncherOptions,
2747
+ name: this.getTriggerLauncherUniqueName(),
2748
+ },
2749
+ this,
2750
+ 'triggerLaunchers',
2751
+ );
2752
+ } else if (typeof options === 'string') {
2753
+ triggerLauncher = TriggerLauncher.from(
2754
+ {
2755
+ ...triggerLauncherOptions,
2756
+ name: options,
2757
+ },
2758
+ this,
2759
+ 'triggerLaunchers',
2760
+ );
2761
+ } else if (asserts.isTriggerLauncher(options)) {
2762
+ options.ensureDelete(); // 同一实例不支持多处存在
2763
+ triggerLauncher = options;
2764
+ Object.assign(triggerLauncher, relationOptions);
2765
+ } else {
2766
+ triggerLauncher = TriggerLauncher.from(
2767
+ {
2768
+ ...triggerLauncherOptions,
2769
+ ...options,
2770
+ },
2771
+ this,
2772
+ 'triggerLaunchers',
2773
+ );
2903
2774
  }
2904
- return params;
2775
+ this.triggerLaunchers.splice(index, 0, triggerLauncher);
2776
+ return triggerLauncher;
2905
2777
  }
2906
2778
 
2907
2779
  /**
2908
- * 删除数据结构
2909
- * @param name 数据结构名称
2780
+ * 插入触发器启动器
2781
+ * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2910
2782
  */
2911
- removeStructure(name: string): void;
2783
+ insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
2912
2784
 
2913
2785
  /**
2914
- * 删除数据结构
2915
- * @param structure 已有的数据结构实例
2786
+ * 插入触发器启动器
2787
+ * @param triggerLauncherOptions 触发器启动器参数
2916
2788
  */
2917
- removeStructure(structure: Structure): void;
2789
+ insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
2918
2790
 
2919
- removeStructure(options: string | Structure) {
2920
- let structure: Structure;
2921
- if (typeof options === 'string') {
2922
- structure = (this.structures as Structure[]).find((item) => item.name === options);
2923
- if (!structure) {
2924
- throw new Error('找不到数据结构 ' + options);
2925
- }
2926
- } else {
2927
- structure = options;
2928
- }
2929
- return structure.delete();
2930
- }
2791
+ /**
2792
+ * 插入触发器启动器
2793
+ * @param triggerLauncher 已有的触发器启动器实例
2794
+ */
2795
+ insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
2931
2796
 
2932
- __removeStructure(structure: Structure) {
2933
- const parentKey = structure.parentKey;
2934
- const params: Params = {
2797
+ insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
2798
+ const node = this._insertTriggerLauncherAt(options as any, index);
2799
+ node.create({
2800
+ index,
2935
2801
  parentNode: this,
2936
- parentKey,
2937
- index: -1,
2938
- object: null,
2939
- oldObject: structure,
2940
- };
2941
- if (parentKey) {
2942
- params.parentKey = parentKey;
2943
- // @ts-ignore
2944
- const t = this.__v_raw || this;
2945
- // @ts-ignore
2946
- const n = structure.__v_raw || structure;
2947
- if (Array.isArray((t as any)[parentKey])) {
2948
- // @ts-ignore
2949
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
2950
- ~index && (this as any)[parentKey].splice(index, 1);
2951
- params.index = index;
2952
- } else {
2953
- const q = (t as any)[parentKey];
2954
- if ((q.__v_raw || q) === n) {
2955
- params.index = 0;
2956
- (this as any)[parentKey] = undefined;
2957
- }
2958
- }
2959
- }
2960
- return params;
2802
+ parentKey: 'triggerLaunchers',
2803
+ });
2804
+ return node;
2961
2805
  }
2962
2806
 
2963
2807
  /**
2964
- * 删除枚举
2965
- * @param name 枚举名称
2808
+ * 添加触发器启动器
2809
+ * @internal
2810
+ * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
2966
2811
  */
2967
- removeEnum(name: string): void;
2812
+ _addTriggerLauncher(name?: string): TriggerLauncher;
2968
2813
 
2969
2814
  /**
2970
- * 删除枚举
2971
- * @param enumeration 已有的枚举实例
2815
+ * 添加触发器启动器
2816
+ * @internal
2817
+ * @param triggerLauncherOptions 触发器启动器参数
2972
2818
  */
2973
- removeEnum(enumeration: Enum): void;
2819
+ _addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
2974
2820
 
2975
- removeEnum(options: string | Enum) {
2976
- let enumeration: Enum;
2977
- if (typeof options === 'string') {
2978
- enumeration = (this.enums as Enum[]).find((item) => item.name === options);
2979
- if (!enumeration) {
2980
- throw new Error('找不到枚举 ' + options);
2981
- }
2982
- } else {
2983
- enumeration = options;
2984
- }
2985
- return enumeration.delete();
2986
- }
2821
+ /**
2822
+ * 添加触发器启动器
2823
+ * @internal
2824
+ * @param triggerLauncher 已有的触发器启动器实例
2825
+ */
2826
+ _addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
2987
2827
 
2988
- __removeEnum(enumeration: Enum) {
2989
- const parentKey = enumeration.parentKey;
2990
- const params: Params = {
2991
- parentNode: this,
2992
- parentKey,
2993
- index: -1,
2994
- object: null,
2995
- oldObject: enumeration,
2996
- };
2997
- if (parentKey) {
2998
- params.parentKey = parentKey;
2999
- // @ts-ignore
3000
- const t = this.__v_raw || this;
3001
- // @ts-ignore
3002
- const n = enumeration.__v_raw || enumeration;
3003
- if (Array.isArray((t as any)[parentKey])) {
3004
- // @ts-ignore
3005
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3006
- ~index && (this as any)[parentKey].splice(index, 1);
3007
- params.index = index;
3008
- } else {
3009
- const q = (t as any)[parentKey];
3010
- if ((q.__v_raw || q) === n) {
3011
- params.index = 0;
3012
- (this as any)[parentKey] = undefined;
3013
- }
3014
- }
3015
- }
3016
- return params;
2828
+ _addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
2829
+ const index = this.triggerLaunchers.length;
2830
+ return this._insertTriggerLauncherAt(options as any, index);
3017
2831
  }
3018
2832
 
3019
2833
  /**
3020
- * 删除逻辑
3021
- * @param name 逻辑名称
2834
+ * 添加触发器启动器
2835
+ * @internal
2836
+ * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
3022
2837
  */
3023
- removeLogic(name: string): void;
2838
+ addTriggerLauncher(name?: string): TriggerLauncher;
3024
2839
 
3025
2840
  /**
3026
- * 删除逻辑
3027
- * @param logic 已有的逻辑实例
2841
+ * 添加触发器启动器
2842
+ * @param triggerLauncherOptions 触发器启动器参数
3028
2843
  */
3029
- removeLogic(logic: Logic): void;
2844
+ addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
3030
2845
 
3031
- removeLogic(options: string | Logic) {
3032
- let logic: Logic;
3033
- if (typeof options === 'string') {
3034
- logic = (this.logics as Logic[]).find((item) => item.name === options);
3035
- if (!logic) {
3036
- throw new Error('找不到逻辑 ' + options);
3037
- }
3038
- } else {
3039
- logic = options;
3040
- }
3041
- return logic.delete();
2846
+ /**
2847
+ * 添加触发器启动器
2848
+ * @param triggerLauncher 已有的触发器启动器实例
2849
+ */
2850
+ addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
2851
+
2852
+ addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
2853
+ const node = this._addTriggerLauncher(options as any);
2854
+ const index = this.triggerLaunchers.indexOf(node);
2855
+ node.create({
2856
+ index,
2857
+ parentNode: this,
2858
+ parentKey: 'triggerLaunchers',
2859
+ });
2860
+ return node;
2861
+ }
2862
+
2863
+ getMetadataTypeExistingNames(excludedList: Array<MetadataType> = []) {
2864
+ const excludedSet = new Set(excludedList);
2865
+ return ((this.metadataTypes as MetadataType[]) || [])
2866
+ .filter((item) => !excludedSet.has(item))
2867
+ .map((item) => item.name);
2868
+ }
2869
+ getMetadataTypeUniqueName(name = 'MetadataType1') {
2870
+ return utils.unique(name, this.getMetadataTypeExistingNames(), undefined, true);
3042
2871
  }
3043
2872
 
3044
2873
  /**
3045
- * 删除鉴权逻辑
3046
- * @param name 鉴权逻辑名称
2874
+ * 插入元数据类型
2875
+ * @internal
2876
+ * @param name 元数据类型名称,如果不填会自动生成一个唯一名称
3047
2877
  */
3048
- removeAuthLogicInAuthLogics(name: string): void;
2878
+ _insertMetadataTypeAt(name: string, index: number): MetadataType;
3049
2879
 
3050
2880
  /**
3051
- * 删除鉴权逻辑
3052
- * @param authLogic 已有的鉴权逻辑实例
2881
+ * 插入元数据类型
2882
+ * @internal
2883
+ * @param metadataTypeOptions 元数据类型参数
3053
2884
  */
3054
- removeAuthLogicInAuthLogics(authLogic: AuthLogic): void;
2885
+ _insertMetadataTypeAt(metadataTypeOptions: Partial<MetadataType>, index: number): MetadataType;
3055
2886
 
3056
- removeAuthLogicInAuthLogics(options: string | AuthLogic) {
3057
- let authLogic: AuthLogic;
3058
- if (typeof options === 'string') {
3059
- authLogic = (this.authLogics as AuthLogic[]).find((item) => item.name === options);
3060
- if (!authLogic) {
3061
- throw new Error('找不到鉴权逻辑 ' + options);
3062
- }
2887
+ /**
2888
+ * 插入元数据类型
2889
+ * @internal
2890
+ * @param metadataType 已有的元数据类型实例
2891
+ */
2892
+ _insertMetadataTypeAt(metadataType: MetadataType, index: number): MetadataType;
2893
+
2894
+ _insertMetadataTypeAt(options: string | Partial<MetadataType> | MetadataType, index: number) {
2895
+ const metadataTypeOptions: any = {};
2896
+ const relationOptions = { parentNode: this, parentKey: 'metadataTypes' };
2897
+ const MetadataType = getConceptConstructor('MetadataType');
2898
+ let metadataType: MetadataType;
2899
+ if (!options) {
2900
+ metadataType = MetadataType.from(
2901
+ {
2902
+ ...metadataTypeOptions,
2903
+ name: this.getMetadataTypeUniqueName(),
2904
+ },
2905
+ this,
2906
+ 'metadataTypes',
2907
+ );
2908
+ } else if (typeof options === 'string') {
2909
+ metadataType = MetadataType.from(
2910
+ {
2911
+ ...metadataTypeOptions,
2912
+ name: options,
2913
+ },
2914
+ this,
2915
+ 'metadataTypes',
2916
+ );
2917
+ } else if (asserts.isMetadataType(options)) {
2918
+ options.ensureDelete(); // 同一实例不支持多处存在
2919
+ metadataType = options;
2920
+ Object.assign(metadataType, relationOptions);
3063
2921
  } else {
3064
- authLogic = options;
2922
+ metadataType = MetadataType.from(
2923
+ {
2924
+ ...metadataTypeOptions,
2925
+ ...options,
2926
+ },
2927
+ this,
2928
+ 'metadataTypes',
2929
+ );
3065
2930
  }
3066
- return authLogic.delete();
2931
+ this.metadataTypes.splice(index, 0, metadataType);
2932
+ return metadataType;
3067
2933
  }
3068
2934
 
3069
2935
  /**
3070
- * 删除调用接口的鉴权逻辑
3071
- * @param name 调用接口的鉴权逻辑名称
2936
+ * 插入元数据类型
2937
+ * @param name 元数据类型名称,如果不填会自动生成一个唯一名称
3072
2938
  */
3073
- removeAuthLogicForCallInterfaceInAuthLogicsForCallInterface(name: string): void;
2939
+ insertMetadataTypeAt(name: string, index: number): MetadataType;
3074
2940
 
3075
2941
  /**
3076
- * 删除调用接口的鉴权逻辑
3077
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2942
+ * 插入元数据类型
2943
+ * @param metadataTypeOptions 元数据类型参数
3078
2944
  */
3079
- removeAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
3080
- authLogicForCallInterface: AuthLogicForCallInterface,
3081
- ): void;
2945
+ insertMetadataTypeAt(metadataTypeOptions: Partial<MetadataType>, index: number): MetadataType;
3082
2946
 
3083
- removeAuthLogicForCallInterfaceInAuthLogicsForCallInterface(options: string | AuthLogicForCallInterface) {
3084
- let authLogicForCallInterface: AuthLogicForCallInterface;
3085
- if (typeof options === 'string') {
3086
- authLogicForCallInterface = (this.authLogicsForCallInterface as AuthLogicForCallInterface[]).find(
3087
- (item) => item.name === options,
3088
- );
3089
- if (!authLogicForCallInterface) {
3090
- throw new Error('找不到调用接口的鉴权逻辑 ' + options);
3091
- }
3092
- } else {
3093
- authLogicForCallInterface = options;
3094
- }
3095
- return authLogicForCallInterface.delete();
3096
- }
2947
+ /**
2948
+ * 插入元数据类型
2949
+ * @param metadataType 已有的元数据类型实例
2950
+ */
2951
+ insertMetadataTypeAt(metadataType: MetadataType, index: number): MetadataType;
3097
2952
 
3098
- __removeLogic(logic: Logic) {
3099
- const parentKey = logic.parentKey;
3100
- const params: Params = {
2953
+ insertMetadataTypeAt(options: string | Partial<MetadataType> | MetadataType, index: number) {
2954
+ const node = this._insertMetadataTypeAt(options as any, index);
2955
+ node.create({
2956
+ index,
3101
2957
  parentNode: this,
3102
- parentKey,
3103
- index: -1,
3104
- object: null,
3105
- oldObject: logic,
3106
- };
3107
- if (parentKey) {
3108
- params.parentKey = parentKey;
3109
- // @ts-ignore
3110
- const t = this.__v_raw || this;
3111
- // @ts-ignore
3112
- const n = logic.__v_raw || logic;
3113
- if (Array.isArray((t as any)[parentKey])) {
3114
- // @ts-ignore
3115
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3116
- ~index && (this as any)[parentKey].splice(index, 1);
3117
- params.index = index;
3118
- } else {
3119
- const q = (t as any)[parentKey];
3120
- if ((q.__v_raw || q) === n) {
3121
- params.index = 0;
3122
- (this as any)[parentKey] = undefined;
3123
- }
3124
- }
3125
- }
3126
- return params;
2958
+ parentKey: 'metadataTypes',
2959
+ });
2960
+ return node;
3127
2961
  }
3128
2962
 
3129
2963
  /**
3130
- * 删除覆写逻辑
3131
- * @param name 覆写逻辑名称
2964
+ * 添加元数据类型
2965
+ * @internal
2966
+ * @param name 元数据类型名称,如果不填会自动生成一个唯一名称
3132
2967
  */
3133
- removeOverriddenLogic(name: string): void;
2968
+ _addMetadataType(name?: string): MetadataType;
3134
2969
 
3135
2970
  /**
3136
- * 删除覆写逻辑
3137
- * @param overriddenLogic 已有的覆写逻辑实例
2971
+ * 添加元数据类型
2972
+ * @internal
2973
+ * @param metadataTypeOptions 元数据类型参数
3138
2974
  */
3139
- removeOverriddenLogic(overriddenLogic: OverriddenLogic): void;
2975
+ _addMetadataType(metadataTypeOptions: Partial<MetadataType>): MetadataType;
3140
2976
 
3141
- removeOverriddenLogic(options: string | OverriddenLogic) {
3142
- let overriddenLogic: OverriddenLogic;
3143
- if (typeof options === 'string') {
3144
- overriddenLogic = (this.overriddenLogics as OverriddenLogic[]).find((item) => item.name === options);
3145
- if (!overriddenLogic) {
3146
- throw new Error('找不到覆写逻辑 ' + options);
3147
- }
3148
- } else {
3149
- overriddenLogic = options;
3150
- }
3151
- return overriddenLogic.delete();
3152
- }
2977
+ /**
2978
+ * 添加元数据类型
2979
+ * @internal
2980
+ * @param metadataType 已有的元数据类型实例
2981
+ */
2982
+ _addMetadataType(metadataType: MetadataType): MetadataType;
3153
2983
 
3154
- __removeOverriddenLogic(overriddenLogic: OverriddenLogic) {
3155
- const parentKey = overriddenLogic.parentKey;
3156
- const params: Params = {
3157
- parentNode: this,
3158
- parentKey,
3159
- index: -1,
3160
- object: null,
3161
- oldObject: overriddenLogic,
3162
- };
3163
- if (parentKey) {
3164
- params.parentKey = parentKey;
3165
- // @ts-ignore
3166
- const t = this.__v_raw || this;
3167
- // @ts-ignore
3168
- const n = overriddenLogic.__v_raw || overriddenLogic;
3169
- if (Array.isArray((t as any)[parentKey])) {
3170
- // @ts-ignore
3171
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3172
- ~index && (this as any)[parentKey].splice(index, 1);
3173
- params.index = index;
3174
- } else {
3175
- const q = (t as any)[parentKey];
3176
- if ((q.__v_raw || q) === n) {
3177
- params.index = 0;
3178
- (this as any)[parentKey] = undefined;
3179
- }
3180
- }
3181
- }
3182
- return params;
2984
+ _addMetadataType(options?: string | Partial<MetadataType> | MetadataType) {
2985
+ const index = 0;
2986
+ return this._insertMetadataTypeAt(options as any, index);
3183
2987
  }
3184
2988
 
3185
2989
  /**
3186
- * 删除接口
3187
- * @param name 接口名称
2990
+ * 添加元数据类型
2991
+ * @internal
2992
+ * @param name 元数据类型名称,如果不填会自动生成一个唯一名称
3188
2993
  */
3189
- removeAbstractInterface(name: string): void;
2994
+ addMetadataType(name?: string): MetadataType;
3190
2995
 
3191
2996
  /**
3192
- * 删除接口
3193
- * @param itface 已有的接口实例
2997
+ * 添加元数据类型
2998
+ * @param metadataTypeOptions 元数据类型参数
3194
2999
  */
3195
- removeAbstractInterface(itface: AbstractInterface): void;
3000
+ addMetadataType(metadataTypeOptions: Partial<MetadataType>): MetadataType;
3196
3001
 
3197
- removeAbstractInterface(options: string | AbstractInterface) {
3198
- let itface: AbstractInterface;
3199
- if (typeof options === 'string') {
3200
- itface = (this.interfaces as AbstractInterface[]).find((item) => item.name === options);
3201
- if (!itface) {
3202
- throw new Error('找不到接口 ' + options);
3203
- }
3204
- } else {
3205
- itface = options;
3206
- }
3207
- return itface.delete();
3208
- }
3002
+ /**
3003
+ * 添加元数据类型
3004
+ * @param metadataType 已有的元数据类型实例
3005
+ */
3006
+ addMetadataType(metadataType: MetadataType): MetadataType;
3209
3007
 
3210
- __removeAbstractInterface(itface: AbstractInterface) {
3211
- const parentKey = itface.parentKey;
3212
- const params: Params = {
3008
+ addMetadataType(options?: string | Partial<MetadataType> | MetadataType) {
3009
+ const node = this._addMetadataType(options as any);
3010
+ const index = this.metadataTypes.indexOf(node);
3011
+ node.create({
3012
+ index,
3213
3013
  parentNode: this,
3214
- parentKey,
3215
- index: -1,
3216
- object: null,
3217
- oldObject: itface,
3218
- };
3219
- if (parentKey) {
3220
- params.parentKey = parentKey;
3221
- // @ts-ignore
3222
- const t = this.__v_raw || this;
3223
- // @ts-ignore
3224
- const n = itface.__v_raw || itface;
3225
- if (Array.isArray((t as any)[parentKey])) {
3226
- // @ts-ignore
3227
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3228
- ~index && (this as any)[parentKey].splice(index, 1);
3229
- params.index = index;
3230
- } else {
3231
- const q = (t as any)[parentKey];
3232
- if ((q.__v_raw || q) === n) {
3233
- params.index = 0;
3234
- (this as any)[parentKey] = undefined;
3235
- }
3236
- }
3237
- }
3238
- return params;
3014
+ parentKey: 'metadataTypes',
3015
+ });
3016
+ return node;
3239
3017
  }
3240
3018
 
3241
3019
  /**
3242
- * 删除端类型
3243
- * @param name 端类型名称
3020
+ * 删除数据源
3021
+ * @param name 数据源名称
3244
3022
  */
3245
- removeFrontendType(name: string): void;
3023
+ removeDataSource(name: string): void;
3246
3024
 
3247
3025
  /**
3248
- * 删除端类型
3249
- * @param frontendType 已有的端类型实例
3026
+ * 删除数据源
3027
+ * @param dataSource 已有的数据源实例
3250
3028
  */
3251
- removeFrontendType(frontendType: FrontendType): void;
3029
+ removeDataSource(dataSource: DataSource): void;
3252
3030
 
3253
- removeFrontendType(options: string | FrontendType) {
3254
- let frontendType: FrontendType;
3031
+ removeDataSource(options: string | DataSource) {
3032
+ let dataSource: DataSource;
3255
3033
  if (typeof options === 'string') {
3256
- frontendType = (this.frontendTypes as FrontendType[]).find((item) => item.name === options);
3257
- if (!frontendType) {
3258
- throw new Error('找不到端类型 ' + options);
3034
+ dataSource = (this.dataSources as DataSource[]).find((item) => item.name === options);
3035
+ if (!dataSource) {
3036
+ throw new Error('找不到数据源 ' + options);
3259
3037
  }
3260
3038
  } else {
3261
- frontendType = options;
3262
- }
3263
- return frontendType.delete();
3264
- }
3265
-
3266
- __removeFrontendType(frontendType: FrontendType) {
3267
- const parentKey = frontendType.parentKey;
3268
- const params: Params = {
3269
- parentNode: this,
3270
- parentKey,
3271
- index: -1,
3272
- object: null,
3273
- oldObject: frontendType,
3274
- };
3275
- if (parentKey) {
3276
- params.parentKey = parentKey;
3277
- // @ts-ignore
3278
- const t = this.__v_raw || this;
3279
- // @ts-ignore
3280
- const n = frontendType.__v_raw || frontendType;
3281
- if (Array.isArray((t as any)[parentKey])) {
3282
- // @ts-ignore
3283
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3284
- ~index && (this as any)[parentKey].splice(index, 1);
3285
- params.index = index;
3286
- } else {
3287
- const q = (t as any)[parentKey];
3288
- if ((q.__v_raw || q) === n) {
3289
- params.index = 0;
3290
- (this as any)[parentKey] = undefined;
3291
- }
3292
- }
3039
+ dataSource = options;
3293
3040
  }
3294
- return params;
3041
+ return dataSource.delete();
3295
3042
  }
3296
3043
 
3297
3044
  /**
3298
- * 删除后端
3299
- * @param name 后端名称
3045
+ * 删除数据结构
3046
+ * @param name 数据结构名称
3300
3047
  */
3301
- removeBackend(name: string): void;
3048
+ removeStructure(name: string): void;
3302
3049
 
3303
3050
  /**
3304
- * 删除后端
3305
- * @param backend 已有的后端实例
3051
+ * 删除数据结构
3052
+ * @param structure 已有的数据结构实例
3306
3053
  */
3307
- removeBackend(backend: Backend): void;
3054
+ removeStructure(structure: Structure): void;
3308
3055
 
3309
- removeBackend(options: string | Backend) {
3310
- let backend: Backend;
3311
- if (typeof options === 'string') {
3312
- backend = this.backend;
3313
- if (!backend) {
3314
- throw new Error('找不到后端 ' + options);
3056
+ removeStructure(options: string | Structure) {
3057
+ let structure: Structure;
3058
+ if (typeof options === 'string') {
3059
+ structure = (this.structures as Structure[]).find((item) => item.name === options);
3060
+ if (!structure) {
3061
+ throw new Error('找不到数据结构 ' + options);
3315
3062
  }
3316
3063
  } else {
3317
- backend = options;
3064
+ structure = options;
3318
3065
  }
3319
- return backend.delete();
3066
+ return structure.delete();
3320
3067
  }
3321
3068
 
3322
- __removeBackend(backend: Backend) {
3323
- const parentKey = backend.parentKey;
3324
- const params: Params = {
3325
- parentNode: this,
3326
- parentKey,
3327
- index: -1,
3328
- object: null,
3329
- oldObject: backend,
3330
- };
3331
- if (parentKey) {
3332
- params.parentKey = parentKey;
3333
- // @ts-ignore
3334
- const t = this.__v_raw || this;
3335
- // @ts-ignore
3336
- const n = backend.__v_raw || backend;
3337
- if (Array.isArray((t as any)[parentKey])) {
3338
- // @ts-ignore
3339
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3340
- ~index && (this as any)[parentKey].splice(index, 1);
3341
- params.index = index;
3342
- } else {
3343
- const q = (t as any)[parentKey];
3344
- if ((q.__v_raw || q) === n) {
3345
- params.index = 0;
3346
- (this as any)[parentKey] = undefined;
3347
- }
3069
+ /**
3070
+ * 删除枚举
3071
+ * @param name 枚举名称
3072
+ */
3073
+ removeEnum(name: string): void;
3074
+
3075
+ /**
3076
+ * 删除枚举
3077
+ * @param enumeration 已有的枚举实例
3078
+ */
3079
+ removeEnum(enumeration: Enum): void;
3080
+
3081
+ removeEnum(options: string | Enum) {
3082
+ let enumeration: Enum;
3083
+ if (typeof options === 'string') {
3084
+ enumeration = (this.enums as Enum[]).find((item) => item.name === options);
3085
+ if (!enumeration) {
3086
+ throw new Error('找不到枚举 ' + options);
3087
+ }
3088
+ } else {
3089
+ enumeration = options;
3090
+ }
3091
+ return enumeration.delete();
3092
+ }
3093
+
3094
+ /**
3095
+ * 删除逻辑
3096
+ * @param name 逻辑名称
3097
+ */
3098
+ removeLogic(name: string): void;
3099
+
3100
+ /**
3101
+ * 删除逻辑
3102
+ * @param logic 已有的逻辑实例
3103
+ */
3104
+ removeLogic(logic: Logic): void;
3105
+
3106
+ removeLogic(options: string | Logic) {
3107
+ let logic: Logic;
3108
+ if (typeof options === 'string') {
3109
+ logic = (this.logics as Logic[]).find((item) => item.name === options);
3110
+ if (!logic) {
3111
+ throw new Error('找不到逻辑 ' + options);
3112
+ }
3113
+ } else {
3114
+ logic = options;
3115
+ }
3116
+ return logic.delete();
3117
+ }
3118
+
3119
+ /**
3120
+ * 删除覆写逻辑
3121
+ * @param name 覆写逻辑名称
3122
+ */
3123
+ removeOverriddenLogic(name: string): void;
3124
+
3125
+ /**
3126
+ * 删除覆写逻辑
3127
+ * @param overriddenLogic 已有的覆写逻辑实例
3128
+ */
3129
+ removeOverriddenLogic(overriddenLogic: OverriddenLogic): void;
3130
+
3131
+ removeOverriddenLogic(options: string | OverriddenLogic) {
3132
+ let overriddenLogic: OverriddenLogic;
3133
+ if (typeof options === 'string') {
3134
+ overriddenLogic = (this.overriddenLogics as OverriddenLogic[]).find((item) => item.name === options);
3135
+ if (!overriddenLogic) {
3136
+ throw new Error('找不到覆写逻辑 ' + options);
3137
+ }
3138
+ } else {
3139
+ overriddenLogic = options;
3140
+ }
3141
+ return overriddenLogic.delete();
3142
+ }
3143
+
3144
+ /**
3145
+ * 删除接口
3146
+ * @param name 接口名称
3147
+ */
3148
+ removeInterface(name: string): void;
3149
+
3150
+ /**
3151
+ * 删除接口
3152
+ * @param itface 已有的接口实例
3153
+ */
3154
+ removeInterface(itface: AbstractInterface): void;
3155
+
3156
+ removeInterface(options: string | AbstractInterface) {
3157
+ let itface: AbstractInterface;
3158
+ if (typeof options === 'string') {
3159
+ itface = (this.interfaces as AbstractInterface[]).find((item) => item.name === options);
3160
+ if (!itface) {
3161
+ throw new Error('找不到接口 ' + options);
3162
+ }
3163
+ } else {
3164
+ itface = options;
3165
+ }
3166
+ return itface.delete();
3167
+ }
3168
+
3169
+ /**
3170
+ * 删除端类型
3171
+ * @param name 端类型名称
3172
+ */
3173
+ removeFrontendType(name: string): void;
3174
+
3175
+ /**
3176
+ * 删除端类型
3177
+ * @param frontendType 已有的端类型实例
3178
+ */
3179
+ removeFrontendType(frontendType: FrontendType): void;
3180
+
3181
+ removeFrontendType(options: string | FrontendType) {
3182
+ let frontendType: FrontendType;
3183
+ if (typeof options === 'string') {
3184
+ frontendType = (this.frontendTypes as FrontendType[]).find((item) => item.name === options);
3185
+ if (!frontendType) {
3186
+ throw new Error('找不到端类型 ' + options);
3348
3187
  }
3188
+ } else {
3189
+ frontendType = options;
3349
3190
  }
3350
- return params;
3191
+ return frontendType.delete();
3351
3192
  }
3352
3193
 
3353
3194
  /**
@@ -3375,37 +3216,6 @@ export class App extends BaseNode {
3375
3216
  return process.delete();
3376
3217
  }
3377
3218
 
3378
- __removeProcess(process: Process) {
3379
- const parentKey = process.parentKey;
3380
- const params: Params = {
3381
- parentNode: this,
3382
- parentKey,
3383
- index: -1,
3384
- object: null,
3385
- oldObject: process,
3386
- };
3387
- if (parentKey) {
3388
- params.parentKey = parentKey;
3389
- // @ts-ignore
3390
- const t = this.__v_raw || this;
3391
- // @ts-ignore
3392
- const n = process.__v_raw || process;
3393
- if (Array.isArray((t as any)[parentKey])) {
3394
- // @ts-ignore
3395
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3396
- ~index && (this as any)[parentKey].splice(index, 1);
3397
- params.index = index;
3398
- } else {
3399
- const q = (t as any)[parentKey];
3400
- if ((q.__v_raw || q) === n) {
3401
- params.index = 0;
3402
- (this as any)[parentKey] = undefined;
3403
- }
3404
- }
3405
- }
3406
- return params;
3407
- }
3408
-
3409
3219
  /**
3410
3220
  * 删除角色
3411
3221
  * @param name 角色名称
@@ -3431,109 +3241,47 @@ export class App extends BaseNode {
3431
3241
  return role.delete();
3432
3242
  }
3433
3243
 
3434
- __removeRole(role: Role) {
3435
- const parentKey = role.parentKey;
3436
- const params: Params = {
3437
- parentNode: this,
3438
- parentKey,
3439
- index: -1,
3440
- object: null,
3441
- oldObject: role,
3442
- };
3443
- if (parentKey) {
3444
- params.parentKey = parentKey;
3445
- // @ts-ignore
3446
- const t = this.__v_raw || this;
3447
- // @ts-ignore
3448
- const n = role.__v_raw || role;
3449
- if (Array.isArray((t as any)[parentKey])) {
3450
- // @ts-ignore
3451
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3452
- ~index && (this as any)[parentKey].splice(index, 1);
3453
- params.index = index;
3454
- } else {
3455
- const q = (t as any)[parentKey];
3456
- if ((q.__v_raw || q) === n) {
3457
- params.index = 0;
3458
- (this as any)[parentKey] = undefined;
3459
- }
3460
- }
3461
- }
3462
- return params;
3463
- }
3464
-
3465
3244
  /**
3466
- * 删除配置管理
3467
- * @param name 配置管理名称
3245
+ * 删除模块
3246
+ * @param name 模块名称
3468
3247
  */
3469
- removeConfiguration(name: string): void;
3248
+ removeModuleInDependencies(name: string): void;
3470
3249
 
3471
3250
  /**
3472
- * 删除配置管理
3473
- * @param configuration 已有的配置管理实例
3251
+ * 删除模块
3252
+ * @param module 已有的模块实例
3474
3253
  */
3475
- removeConfiguration(configuration: Configuration): void;
3254
+ removeModuleInDependencies(module: Module): void;
3476
3255
 
3477
- removeConfiguration(options: string | Configuration) {
3478
- let configuration: Configuration;
3256
+ removeModuleInDependencies(options: string | Module) {
3257
+ let module: Module;
3479
3258
  if (typeof options === 'string') {
3480
- configuration = this.configuration;
3481
- if (!configuration) {
3482
- throw new Error('找不到配置管理 ' + options);
3259
+ module = (this.dependencies as Module[]).find((item) => item.name === options);
3260
+ if (!module) {
3261
+ throw new Error('找不到模块 ' + options);
3483
3262
  }
3484
3263
  } else {
3485
- configuration = options;
3486
- }
3487
- return configuration.delete();
3488
- }
3489
-
3490
- __removeConfiguration(configuration: Configuration) {
3491
- const parentKey = configuration.parentKey;
3492
- const params: Params = {
3493
- parentNode: this,
3494
- parentKey,
3495
- index: -1,
3496
- object: null,
3497
- oldObject: configuration,
3498
- };
3499
- if (parentKey) {
3500
- params.parentKey = parentKey;
3501
- // @ts-ignore
3502
- const t = this.__v_raw || this;
3503
- // @ts-ignore
3504
- const n = configuration.__v_raw || configuration;
3505
- if (Array.isArray((t as any)[parentKey])) {
3506
- // @ts-ignore
3507
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3508
- ~index && (this as any)[parentKey].splice(index, 1);
3509
- params.index = index;
3510
- } else {
3511
- const q = (t as any)[parentKey];
3512
- if ((q.__v_raw || q) === n) {
3513
- params.index = 0;
3514
- (this as any)[parentKey] = undefined;
3515
- }
3516
- }
3264
+ module = options;
3517
3265
  }
3518
- return params;
3266
+ return module.delete();
3519
3267
  }
3520
3268
 
3521
3269
  /**
3522
3270
  * 删除模块
3523
3271
  * @param name 模块名称
3524
3272
  */
3525
- removeModuleInDependencies(name: string): void;
3273
+ removeModuleInInterfaceDependencies(name: string): void;
3526
3274
 
3527
3275
  /**
3528
3276
  * 删除模块
3529
3277
  * @param module 已有的模块实例
3530
3278
  */
3531
- removeModuleInDependencies(module: Module): void;
3279
+ removeModuleInInterfaceDependencies(module: Module): void;
3532
3280
 
3533
- removeModuleInDependencies(options: string | Module) {
3281
+ removeModuleInInterfaceDependencies(options: string | Module) {
3534
3282
  let module: Module;
3535
3283
  if (typeof options === 'string') {
3536
- module = (this.dependencies as Module[]).find((item) => item.name === options);
3284
+ module = (this.interfaceDependencies as Module[]).find((item) => item.name === options);
3537
3285
  if (!module) {
3538
3286
  throw new Error('找不到模块 ' + options);
3539
3287
  }
@@ -3547,15 +3295,15 @@ export class App extends BaseNode {
3547
3295
  * 删除连接器
3548
3296
  * @param name 连接器名称
3549
3297
  */
3550
- removeConnectorInDependencies(name: string): void;
3298
+ removeConnector(name: string): void;
3551
3299
 
3552
3300
  /**
3553
3301
  * 删除连接器
3554
3302
  * @param connector 已有的连接器实例
3555
3303
  */
3556
- removeConnectorInDependencies(connector: Connector): void;
3304
+ removeConnector(connector: Connector): void;
3557
3305
 
3558
- removeConnectorInDependencies(options: string | Connector) {
3306
+ removeConnector(options: string | Connector) {
3559
3307
  let connector: Connector;
3560
3308
  if (typeof options === 'string') {
3561
3309
  connector = (this.dependencies as Connector[]).find((item) => item.name === options);
@@ -3569,115 +3317,55 @@ export class App extends BaseNode {
3569
3317
  }
3570
3318
 
3571
3319
  /**
3572
- * 删除模块
3573
- * @param name 模块名称
3320
+ * 删除鉴权逻辑
3321
+ * @param name 鉴权逻辑名称
3574
3322
  */
3575
- removeModuleInInterfaceDependencies(name: string): void;
3323
+ removeAuthLogic(name: string): void;
3576
3324
 
3577
3325
  /**
3578
- * 删除模块
3579
- * @param module 已有的模块实例
3326
+ * 删除鉴权逻辑
3327
+ * @param authLogic 已有的鉴权逻辑实例
3580
3328
  */
3581
- removeModuleInInterfaceDependencies(module: Module): void;
3329
+ removeAuthLogic(authLogic: AuthLogic): void;
3582
3330
 
3583
- removeModuleInInterfaceDependencies(options: string | Module) {
3584
- let module: Module;
3331
+ removeAuthLogic(options: string | AuthLogic) {
3332
+ let authLogic: AuthLogic;
3585
3333
  if (typeof options === 'string') {
3586
- module = (this.interfaceDependencies as Module[]).find((item) => item.name === options);
3587
- if (!module) {
3588
- throw new Error('找不到模块 ' + options);
3334
+ authLogic = (this.authLogics as AuthLogic[]).find((item) => item.name === options);
3335
+ if (!authLogic) {
3336
+ throw new Error('找不到鉴权逻辑 ' + options);
3589
3337
  }
3590
3338
  } else {
3591
- module = options;
3592
- }
3593
- return module.delete();
3594
- }
3595
-
3596
- __removeModule(module: Module) {
3597
- const parentKey = module.parentKey;
3598
- const params: Params = {
3599
- parentNode: this,
3600
- parentKey,
3601
- index: -1,
3602
- object: null,
3603
- oldObject: module,
3604
- };
3605
- if (parentKey) {
3606
- params.parentKey = parentKey;
3607
- // @ts-ignore
3608
- const t = this.__v_raw || this;
3609
- // @ts-ignore
3610
- const n = module.__v_raw || module;
3611
- if (Array.isArray((t as any)[parentKey])) {
3612
- // @ts-ignore
3613
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3614
- ~index && (this as any)[parentKey].splice(index, 1);
3615
- params.index = index;
3616
- } else {
3617
- const q = (t as any)[parentKey];
3618
- if ((q.__v_raw || q) === n) {
3619
- params.index = 0;
3620
- (this as any)[parentKey] = undefined;
3621
- }
3622
- }
3339
+ authLogic = options;
3623
3340
  }
3624
- return params;
3341
+ return authLogic.delete();
3625
3342
  }
3626
3343
 
3627
3344
  /**
3628
- * 删除集成
3629
- * @param name 集成名称
3345
+ * 删除调用接口的鉴权逻辑
3346
+ * @param name 调用接口的鉴权逻辑名称
3630
3347
  */
3631
- removeIntegration(name: string): void;
3348
+ removeAuthLogicForCallInterface(name: string): void;
3632
3349
 
3633
3350
  /**
3634
- * 删除集成
3635
- * @param integration 已有的集成实例
3351
+ * 删除调用接口的鉴权逻辑
3352
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
3636
3353
  */
3637
- removeIntegration(integration: Integration): void;
3354
+ removeAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): void;
3638
3355
 
3639
- removeIntegration(options: string | Integration) {
3640
- let integration: Integration;
3356
+ removeAuthLogicForCallInterface(options: string | AuthLogicForCallInterface) {
3357
+ let authLogicForCallInterface: AuthLogicForCallInterface;
3641
3358
  if (typeof options === 'string') {
3642
- integration = this.integration;
3643
- if (!integration) {
3644
- throw new Error('找不到集成 ' + options);
3359
+ authLogicForCallInterface = (this.authLogicsForCallInterface as AuthLogicForCallInterface[]).find(
3360
+ (item) => item.name === options,
3361
+ );
3362
+ if (!authLogicForCallInterface) {
3363
+ throw new Error('找不到调用接口的鉴权逻辑 ' + options);
3645
3364
  }
3646
3365
  } else {
3647
- integration = options;
3648
- }
3649
- return integration.delete();
3650
- }
3651
-
3652
- __removeIntegration(integration: Integration) {
3653
- const parentKey = integration.parentKey;
3654
- const params: Params = {
3655
- parentNode: this,
3656
- parentKey,
3657
- index: -1,
3658
- object: null,
3659
- oldObject: integration,
3660
- };
3661
- if (parentKey) {
3662
- params.parentKey = parentKey;
3663
- // @ts-ignore
3664
- const t = this.__v_raw || this;
3665
- // @ts-ignore
3666
- const n = integration.__v_raw || integration;
3667
- if (Array.isArray((t as any)[parentKey])) {
3668
- // @ts-ignore
3669
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3670
- ~index && (this as any)[parentKey].splice(index, 1);
3671
- params.index = index;
3672
- } else {
3673
- const q = (t as any)[parentKey];
3674
- if ((q.__v_raw || q) === n) {
3675
- params.index = 0;
3676
- (this as any)[parentKey] = undefined;
3677
- }
3678
- }
3366
+ authLogicForCallInterface = options;
3679
3367
  }
3680
- return params;
3368
+ return authLogicForCallInterface.delete();
3681
3369
  }
3682
3370
 
3683
3371
  /**
@@ -3705,37 +3393,6 @@ export class App extends BaseNode {
3705
3393
  return connection.delete();
3706
3394
  }
3707
3395
 
3708
- __removeConnection(connection: Connection) {
3709
- const parentKey = connection.parentKey;
3710
- const params: Params = {
3711
- parentNode: this,
3712
- parentKey,
3713
- index: -1,
3714
- object: null,
3715
- oldObject: connection,
3716
- };
3717
- if (parentKey) {
3718
- params.parentKey = parentKey;
3719
- // @ts-ignore
3720
- const t = this.__v_raw || this;
3721
- // @ts-ignore
3722
- const n = connection.__v_raw || connection;
3723
- if (Array.isArray((t as any)[parentKey])) {
3724
- // @ts-ignore
3725
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3726
- ~index && (this as any)[parentKey].splice(index, 1);
3727
- params.index = index;
3728
- } else {
3729
- const q = (t as any)[parentKey];
3730
- if ((q.__v_raw || q) === n) {
3731
- params.index = 0;
3732
- (this as any)[parentKey] = undefined;
3733
- }
3734
- }
3735
- }
3736
- return params;
3737
- }
3738
-
3739
3396
  /**
3740
3397
  * 删除触发器启动器
3741
3398
  * @param name 触发器启动器名称
@@ -3761,37 +3418,6 @@ export class App extends BaseNode {
3761
3418
  return triggerLauncher.delete();
3762
3419
  }
3763
3420
 
3764
- __removeTriggerLauncher(triggerLauncher: TriggerLauncher) {
3765
- const parentKey = triggerLauncher.parentKey;
3766
- const params: Params = {
3767
- parentNode: this,
3768
- parentKey,
3769
- index: -1,
3770
- object: null,
3771
- oldObject: triggerLauncher,
3772
- };
3773
- if (parentKey) {
3774
- params.parentKey = parentKey;
3775
- // @ts-ignore
3776
- const t = this.__v_raw || this;
3777
- // @ts-ignore
3778
- const n = triggerLauncher.__v_raw || triggerLauncher;
3779
- if (Array.isArray((t as any)[parentKey])) {
3780
- // @ts-ignore
3781
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3782
- ~index && (this as any)[parentKey].splice(index, 1);
3783
- params.index = index;
3784
- } else {
3785
- const q = (t as any)[parentKey];
3786
- if ((q.__v_raw || q) === n) {
3787
- params.index = 0;
3788
- (this as any)[parentKey] = undefined;
3789
- }
3790
- }
3791
- }
3792
- return params;
3793
- }
3794
-
3795
3421
  /**
3796
3422
  * 删除元数据类型
3797
3423
  * @param name 元数据类型名称
@@ -3817,37 +3443,6 @@ export class App extends BaseNode {
3817
3443
  return metadataType.delete();
3818
3444
  }
3819
3445
 
3820
- __removeMetadataType(metadataType: MetadataType) {
3821
- const parentKey = metadataType.parentKey;
3822
- const params: Params = {
3823
- parentNode: this,
3824
- parentKey,
3825
- index: -1,
3826
- object: null,
3827
- oldObject: metadataType,
3828
- };
3829
- if (parentKey) {
3830
- params.parentKey = parentKey;
3831
- // @ts-ignore
3832
- const t = this.__v_raw || this;
3833
- // @ts-ignore
3834
- const n = metadataType.__v_raw || metadataType;
3835
- if (Array.isArray((t as any)[parentKey])) {
3836
- // @ts-ignore
3837
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
3838
- ~index && (this as any)[parentKey].splice(index, 1);
3839
- params.index = index;
3840
- } else {
3841
- const q = (t as any)[parentKey];
3842
- if ((q.__v_raw || q) === n) {
3843
- params.index = 0;
3844
- (this as any)[parentKey] = undefined;
3845
- }
3846
- }
3847
- }
3848
- return params;
3849
- }
3850
-
3851
3446
  //================================================================================
3852
3447
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
3853
3448
  // 自动生成的代码已结束。下面可以手动编写。
@@ -3938,14 +3533,30 @@ export class App extends BaseNode {
3938
3533
  */
3939
3534
  composeCache: composeCacheType = {};
3940
3535
 
3941
-
3942
3536
  /**
3943
- * 获取组合节点
3537
+ * 判断缓存是否为空
3944
3538
  */
3945
- getCompose(path: string[]) {
3946
- let compose = this.composeCache;
3947
- path.forEach((key) => {
3948
- compose = compose?.[key];
3539
+ isComposeCacheEmpty() {
3540
+ const isEmpty = (composeCache: composeCacheType): boolean => {
3541
+ let result = true;
3542
+ for (const key in composeCache) {
3543
+ if (key !== 'nodes') {
3544
+ result = result && isEmpty(composeCache[key]);
3545
+ }
3546
+ }
3547
+ return result && !composeCache?.nodes?.length;
3548
+ };
3549
+
3550
+ return isEmpty(this.composeCache);
3551
+ }
3552
+
3553
+ /**
3554
+ * 获取组合节点
3555
+ */
3556
+ getCompose(path: string[]) {
3557
+ let compose = this.composeCache;
3558
+ path.forEach((key) => {
3559
+ compose = compose?.[key];
3949
3560
  });
3950
3561
  return compose || null;
3951
3562
  }
@@ -3969,11 +3580,20 @@ export class App extends BaseNode {
3969
3580
  path.forEach((key, index) => {
3970
3581
  if (index === path.length - 1) {
3971
3582
  if (compose?.[key]?.nodes) {
3583
+ // 需要判断下nodes里面是否已经存在
3972
3584
  if (Array.isArray(node)) {
3973
- compose[key].nodes.push(...node);
3585
+ node.forEach((item) => {
3586
+ if (!compose[key].nodes.find((it) => it === item)) {
3587
+ compose[key].nodes.push(item);
3588
+ }
3589
+ });
3974
3590
  } else {
3975
- compose[key].nodes.push(node);
3591
+ if (!compose[key].nodes.find((it) => it === node)) {
3592
+ compose[key].nodes.push(node);
3593
+ }
3976
3594
  }
3595
+ // 去重
3596
+ compose[key].nodes = Array.from(new Set(compose[key].nodes));
3977
3597
  } else {
3978
3598
  if (!compose?.[key]) {
3979
3599
  compose[key] = {};
@@ -3998,17 +3618,28 @@ export class App extends BaseNode {
3998
3618
 
3999
3619
  const delNodes = (_compose: composeCacheType) => {
4000
3620
  if (_compose?.nodes) {
4001
- for(let key in _compose) {
3621
+ for (const key in _compose) {
4002
3622
  if (key !== 'nodes') {
4003
3623
  delNodes(_compose[key]);
4004
3624
  }
4005
3625
  }
4006
- _compose.nodes.forEach((node) => {
4007
- node.delete();
4008
- })
3626
+ const arr = [..._compose.nodes] || [];
3627
+ const triggerNode: BaseNode[] = []; // 触点放在最后删
3628
+ arr.forEach((node) => {
3629
+ if (node.name === path?.[0]) {
3630
+ triggerNode.push(node);
3631
+ } else {
3632
+ node && node.delete();
3633
+ }
3634
+ });
3635
+
3636
+ triggerNode.forEach((node) => {
3637
+ node && node.delete();
3638
+ });
3639
+
4009
3640
  _compose.nodes = [];
4010
3641
  }
4011
- }
3642
+ };
4012
3643
 
4013
3644
  this.emit('collect:start', {
4014
3645
  actionMsg: '删除同一分组节点',
@@ -4024,19 +3655,78 @@ export class App extends BaseNode {
4024
3655
  }
4025
3656
 
4026
3657
  /**
4027
- * 释放分组内所有节点
3658
+ * 释放分组内所有节点, 包括子分组
4028
3659
  */
4029
3660
  releaseComposeNode(path: string[]) {
4030
3661
  if (!Array.isArray(path)) return;
4031
3662
  let compose = this.composeCache;
4032
- path.forEach((key, index) => {
4033
- if (index === path.length - 1) {
4034
- const nodes = compose?.[key]?.nodes || [];
4035
- nodes.forEach((node) => {
3663
+
3664
+ const releaseNodes = (_compose: composeCacheType) => {
3665
+ if (_compose?.nodes) {
3666
+ for (const key in _compose) {
3667
+ if (key !== 'nodes') {
3668
+ releaseNodes(_compose[key]);
3669
+ }
3670
+ }
3671
+ _compose.nodes.forEach((node) => {
4036
3672
  node.update({
4037
- composedBy: [],
3673
+ composedBy: undefined,
4038
3674
  });
4039
- })
3675
+ // 临时兼容性代码,后续抽离成插件化
3676
+ if (node.tag === 'u-linear-layout') {
3677
+ const attr = node.bindAttrs.find((it: any) => it.name === 'TableDesignerLocked');
3678
+ if (attr) {
3679
+ attr.delete();
3680
+ }
3681
+ }
3682
+ });
3683
+ _compose.nodes = [];
3684
+ }
3685
+ };
3686
+
3687
+ this.emit('collect:start', {
3688
+ actionMsg: '释放节点',
3689
+ });
3690
+ path.forEach((key, index) => {
3691
+ if (index === path.length - 1) {
3692
+ releaseNodes(compose?.[key]);
3693
+ } else {
3694
+ compose = compose[key];
3695
+ }
3696
+ });
3697
+ this.emit('collect:end');
3698
+ }
3699
+
3700
+ /**
3701
+ * 删除分组内的某一个
3702
+ */
3703
+ deleteComposeNode(path: string[], node: BaseNode) {
3704
+ if (!node) return;
3705
+ let compose = this.composeCache;
3706
+ path.forEach((key, index) => {
3707
+ if (index === path.length - 1) {
3708
+ if (compose?.[key]?.nodes) {
3709
+ const index = compose[key].nodes.findIndex((it) => it === node);
3710
+ if (index > -1) {
3711
+ compose[key].nodes.splice(index, 1);
3712
+ }
3713
+ }
3714
+ } else {
3715
+ compose = compose[key];
3716
+ }
3717
+ });
3718
+ }
3719
+
3720
+ /**
3721
+ * 清空某一分组
3722
+ */
3723
+ clearComposeNodes(path: string[]) {
3724
+ let compose = this.composeCache;
3725
+ path.forEach((key, index) => {
3726
+ if (index === path.length - 1) {
3727
+ if (compose?.[key]) {
3728
+ delete compose[key];
3729
+ }
4040
3730
  } else {
4041
3731
  compose = compose[key];
4042
3732
  }
@@ -4061,7 +3751,7 @@ export class App extends BaseNode {
4061
3751
  findNodeByCompleteName(originCompleteName: string) {
4062
3752
  let completeName = originCompleteName;
4063
3753
  // 是否是来自编辑态的自定义连接器
4064
- const isFromEditableConnector = completeName.endsWith(CUSTOM_CONNECTOR_EDITABLE_SUFFIX);
3754
+ const isFromEditableConnector = completeName?.endsWith(CUSTOM_CONNECTOR_EDITABLE_SUFFIX);
4065
3755
  if (isFromEditableConnector) {
4066
3756
  // 为了查找到真实的结构,需要去掉编辑态的后缀
4067
3757
  completeName = completeName.replace(CUSTOM_CONNECTOR_EDITABLE_SUFFIX, '');
@@ -4077,15 +3767,17 @@ export class App extends BaseNode {
4077
3767
  const mod = 0;
4078
3768
  const modulesMap: any = {
4079
3769
  // v3.3 版本引入自定义连接器,在配置自定义连接器时需要同步支持内部数据结构使用,所以这里做扩展
4080
- extensions: [...node.dependencies, ...(node?.integration?.connectors || [])],
3770
+ extensions: [...(node?.dependencies || []), ...(node?.integration?.connectors || [])],
4081
3771
  apis: node.interfaceDependencies,
4082
3772
  components: node.componentDependencies,
4083
3773
  };
4084
3774
  const modules = modulesMap[start];
4085
3775
  if (Array.isArray(modules)) {
4086
3776
  const moduleName = nameArr.shift();
4087
- if(isFromEditableConnector) {
4088
- node = modules.find((moduleItem) => moduleItem.name === moduleName && moduleItem?.parentNode?.concept === 'Integration');
3777
+ if (isFromEditableConnector) {
3778
+ node = modules.find(
3779
+ (moduleItem) => moduleItem.name === moduleName && moduleItem?.parentNode?.concept === 'Integration',
3780
+ );
4089
3781
  } else {
4090
3782
  node = modules.find((moduleItem) => moduleItem.name === moduleName);
4091
3783
  }
@@ -4128,9 +3820,7 @@ export class App extends BaseNode {
4128
3820
  packageInfo.template.version = framework.version;
4129
3821
 
4130
3822
  packageInfo.ui.name = scope === 'h5' ? ui.h5.name : ui.pc.name;
4131
- packageInfo.ui.version = scope === 'h5'
4132
- ? ui.h5.version
4133
- : ui.pc.version;
3823
+ packageInfo.ui.version = scope === 'h5' ? ui.h5.version : ui.pc.version;
4134
3824
 
4135
3825
  return packageInfo;
4136
3826
  }
@@ -4204,7 +3894,7 @@ export class App extends BaseNode {
4204
3894
  (frontends || []).forEach((frontend) => {
4205
3895
  if (frontend.type === scope) {
4206
3896
  const jsName = `${prefix}/packages/${
4207
- prefixPath ? prefixPath + '/' : ''
3897
+ prefixPath ? `${prefixPath}/` : ''
4208
3898
  }${name}@${version}/dist-theme/index.js`;
4209
3899
  if (!existingSet.has(jsName)) {
4210
3900
  existingSet.add(jsName);
@@ -4534,15 +4224,6 @@ export class App extends BaseNode {
4534
4224
 
4535
4225
  __databaseTypeMap: any = {};
4536
4226
 
4537
- getAuthLogicExistingNames(excludedList: Array<AuthLogic> = []) {
4538
- const excludedSet = new Set(excludedList);
4539
- return ((this.authLogics as AuthLogic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
4540
- }
4541
-
4542
- getAuthLogicUniqueName(name = 'authentication1') {
4543
- return utils.unique(name, this.getAuthLogicExistingNames(), undefined, true);
4544
- }
4545
-
4546
4227
  getAuthInterfaceUniqueName(name = 'authInterface1') {
4547
4228
  // never used
4548
4229
  }
@@ -4554,16 +4235,6 @@ export class App extends BaseNode {
4554
4235
  ?.values.find((item) => item.env === this.curDeployEnv)?.value;
4555
4236
  }
4556
4237
 
4557
- // FIXME: 没有设置 dontGenGetUniqueName 为什么 不会生成 唯一标识逻辑???
4558
- getConnectorExistingNames(excludedList: Array<Module> = []) {
4559
- const excludedSet = new Set(excludedList);
4560
- return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
4561
- }
4562
-
4563
- getConnectorUniqueName(name = 'connector1') {
4564
- return utils.unique(name, this.getConnectorExistingNames(), undefined, false);
4565
- }
4566
-
4567
4238
  /** 根据名称获取 triggerLauncher */
4568
4239
  getTriggerLauncherByName(name: string) {
4569
4240
  return this.triggerLaunchers.find((item) => item.name === name);
@@ -4580,363 +4251,6 @@ export class App extends BaseNode {
4580
4251
  return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.title);
4581
4252
  }
4582
4253
 
4583
- getAuthLogicForCallInterfaceExistingNames(excludedList: Array<AuthLogicForCallInterface> = []) {
4584
- const excludedSet = new Set(excludedList);
4585
- return ((this.authLogicsForCallInterface as AuthLogicForCallInterface[]) || [])
4586
- .filter((item) => !excludedSet.has(item))
4587
- .map((item) => item.name);
4588
- }
4589
- getAuthLogicForCallInterfaceUniqueName(name = 'authLogicForCallInterface1') {
4590
- return utils.unique(name, this.getAuthLogicForCallInterfaceExistingNames(), undefined, false);
4591
- }
4592
- //todo 替换生成
4593
- getInterfaceExistingNames(excludedList: Array<Interface> = []) {
4594
- const excludedSet = new Set(excludedList);
4595
- return ((this.interfaces as Interface[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
4596
- }
4597
- getInterfaceUniqueName(name = 'Interface1') {
4598
- return utils.unique(name, this.getInterfaceExistingNames(), undefined, true);
4599
- }
4600
-
4601
- /**
4602
- * 插入接口
4603
- * @internal
4604
- * @param name 接口名称,如果不填会自动生成一个唯一名称
4605
- */
4606
- _insertInterfaceInInterfacesAt(name: string, index: number): Interface;
4607
-
4608
- /**
4609
- * 插入接口
4610
- * @internal
4611
- * @param itfaceOptions 接口参数
4612
- */
4613
- _insertInterfaceInInterfacesAt(itfaceOptions: Partial<Interface>, index: number): Interface;
4614
-
4615
- /**
4616
- * 插入接口
4617
- * @internal
4618
- * @param itface 已有的接口实例
4619
- */
4620
- _insertInterfaceInInterfacesAt(itface: Interface, index: number): Interface;
4621
-
4622
- _insertInterfaceInInterfacesAt(options: string | Partial<Interface> | Interface, index: number) {
4623
- const itfaceOptions: any = {};
4624
- const relationOptions = { parentNode: this, parentKey: 'interfaces' };
4625
- const Interface = getConceptConstructor('Interface');
4626
- let itface: Interface;
4627
- if (!options) {
4628
- itface = Interface.from(
4629
- {
4630
- ...itfaceOptions,
4631
- name: this.getInterfaceUniqueName(),
4632
- },
4633
- this,
4634
- 'interfaces',
4635
- );
4636
- } else if (typeof options === 'string') {
4637
- itface = Interface.from(
4638
- {
4639
- ...itfaceOptions,
4640
- name: options,
4641
- },
4642
- this,
4643
- 'interfaces',
4644
- );
4645
- } else if (asserts.isInterface(options)) {
4646
- options.ensureDelete(); // 同一实例不支持多处存在
4647
- itface = options;
4648
- Object.assign(itface, relationOptions);
4649
- } else {
4650
- itface = Interface.from(
4651
- {
4652
- ...itfaceOptions,
4653
- ...options,
4654
- },
4655
- this,
4656
- 'interfaces',
4657
- );
4658
- }
4659
- this.interfaces.splice(index, 0, itface);
4660
- return itface;
4661
- }
4662
-
4663
- /**
4664
- * 插入接口
4665
- * @param name 接口名称,如果不填会自动生成一个唯一名称
4666
- */
4667
- insertInterfaceInInterfacesAt(name: string, index: number): Interface;
4668
-
4669
- /**
4670
- * 插入接口
4671
- * @param itfaceOptions 接口参数
4672
- */
4673
- insertInterfaceInInterfacesAt(itfaceOptions: Partial<Interface>, index: number): Interface;
4674
-
4675
- /**
4676
- * 插入接口
4677
- * @param itface 已有的接口实例
4678
- */
4679
- insertInterfaceInInterfacesAt(itface: Interface, index: number): Interface;
4680
-
4681
- insertInterfaceInInterfacesAt(options: string | Partial<Interface> | Interface, index: number) {
4682
- const node = this._insertInterfaceInInterfacesAt(options as any, index);
4683
- node.create({
4684
- index,
4685
- parentNode: this,
4686
- parentKey: 'interfaces',
4687
- });
4688
- return node;
4689
- }
4690
-
4691
- /**
4692
- * 添加接口
4693
- * @internal
4694
- * @param name 接口名称,如果不填会自动生成一个唯一名称
4695
- */
4696
- _addInterfaceInInterfaces(name?: string): Interface;
4697
-
4698
- /**
4699
- * 添加接口
4700
- * @internal
4701
- * @param itfaceOptions 接口参数
4702
- */
4703
- _addInterfaceInInterfaces(itfaceOptions: Partial<Interface>): Interface;
4704
-
4705
- /**
4706
- * 添加接口
4707
- * @internal
4708
- * @param itface 已有的接口实例
4709
- */
4710
- _addInterfaceInInterfaces(itface: Interface): Interface;
4711
-
4712
- _addInterfaceInInterfaces(options?: string | Partial<Interface> | Interface) {
4713
- const index = 0;
4714
- return this._insertInterfaceInInterfacesAt(options as any, index);
4715
- }
4716
-
4717
- /**
4718
- * 添加接口
4719
- * @internal
4720
- * @param name 接口名称,如果不填会自动生成一个唯一名称
4721
- */
4722
- addInterfaceInInterfaces(name?: string): Interface;
4723
-
4724
- /**
4725
- * 添加接口
4726
- * @param itfaceOptions 接口参数
4727
- */
4728
- addInterfaceInInterfaces(itfaceOptions: Partial<Interface>): Interface;
4729
-
4730
- /**
4731
- * 添加接口
4732
- * @param itface 已有的接口实例
4733
- */
4734
- addInterfaceInInterfaces(itface: Interface): Interface;
4735
-
4736
- addInterfaceInInterfaces(options?: string | Partial<Interface> | Interface) {
4737
- const node = this._addInterfaceInInterfaces(options as any);
4738
- const index = this.interfaces.indexOf(node);
4739
- node.create({
4740
- index,
4741
- parentNode: this,
4742
- parentKey: 'interfaces',
4743
- });
4744
- return node;
4745
- }
4746
-
4747
- /**
4748
- * 插入鉴权接口
4749
- * @internal
4750
- * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
4751
- */
4752
- _insertAuthInterfaceInInterfacesAt(name: string, index: number): AuthInterface;
4753
-
4754
- /**
4755
- * 插入鉴权接口
4756
- * @internal
4757
- * @param itfaceOptions 鉴权接口参数
4758
- */
4759
- _insertAuthInterfaceInInterfacesAt(itfaceOptions: Partial<AuthInterface>, index: number): AuthInterface;
4760
-
4761
- /**
4762
- * 插入鉴权接口
4763
- * @internal
4764
- * @param itface 已有的鉴权接口实例
4765
- */
4766
- _insertAuthInterfaceInInterfacesAt(itface: AuthInterface, index: number): AuthInterface;
4767
-
4768
- _insertAuthInterfaceInInterfacesAt(options: string | Partial<AuthInterface> | AuthInterface, index: number) {
4769
- const itfaceOptions: any = {};
4770
- const relationOptions = { parentNode: this, parentKey: 'interfaces' };
4771
- const AuthInterface = getConceptConstructor('AuthInterface');
4772
- let itface: AuthInterface;
4773
- if (!options) {
4774
- itface = AuthInterface.from(
4775
- {
4776
- ...itfaceOptions,
4777
- name: this.getAuthInterfaceUniqueName(),
4778
- },
4779
- this,
4780
- 'interfaces',
4781
- );
4782
- } else if (typeof options === 'string') {
4783
- itface = AuthInterface.from(
4784
- {
4785
- ...itfaceOptions,
4786
- name: options,
4787
- },
4788
- this,
4789
- 'interfaces',
4790
- );
4791
- } else if (asserts.isAuthInterface(options)) {
4792
- options.ensureDelete(); // 同一实例不支持多处存在
4793
- itface = options;
4794
- Object.assign(itface, relationOptions);
4795
- } else {
4796
- itface = AuthInterface.from(
4797
- {
4798
- ...itfaceOptions,
4799
- ...options,
4800
- },
4801
- this,
4802
- 'interfaces',
4803
- );
4804
- }
4805
- this.interfaces.splice(index, 0, itface);
4806
- return itface;
4807
- }
4808
-
4809
- /**
4810
- * 插入鉴权接口
4811
- * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
4812
- */
4813
- insertAuthInterfaceInInterfacesAt(name: string, index: number): AuthInterface;
4814
-
4815
- /**
4816
- * 插入鉴权接口
4817
- * @param itfaceOptions 鉴权接口参数
4818
- */
4819
- insertAuthInterfaceInInterfacesAt(itfaceOptions: Partial<AuthInterface>, index: number): AuthInterface;
4820
-
4821
- /**
4822
- * 插入鉴权接口
4823
- * @param itface 已有的鉴权接口实例
4824
- */
4825
- insertAuthInterfaceInInterfacesAt(itface: AuthInterface, index: number): AuthInterface;
4826
-
4827
- insertAuthInterfaceInInterfacesAt(options: string | Partial<AuthInterface> | AuthInterface, index: number) {
4828
- const node = this._insertAuthInterfaceInInterfacesAt(options as any, index);
4829
- node.create({
4830
- index,
4831
- parentNode: this,
4832
- parentKey: 'interfaces',
4833
- });
4834
- return node;
4835
- }
4836
-
4837
- /**
4838
- * 添加鉴权接口
4839
- * @internal
4840
- * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
4841
- */
4842
- _addAuthInterfaceInInterfaces(name?: string): AuthInterface;
4843
-
4844
- /**
4845
- * 添加鉴权接口
4846
- * @internal
4847
- * @param itfaceOptions 鉴权接口参数
4848
- */
4849
- _addAuthInterfaceInInterfaces(itfaceOptions: Partial<AuthInterface>): AuthInterface;
4850
-
4851
- /**
4852
- * 添加鉴权接口
4853
- * @internal
4854
- * @param itface 已有的鉴权接口实例
4855
- */
4856
- _addAuthInterfaceInInterfaces(itface: AuthInterface): AuthInterface;
4857
-
4858
- _addAuthInterfaceInInterfaces(options?: string | Partial<AuthInterface> | AuthInterface) {
4859
- const index = 0;
4860
- return this._insertAuthInterfaceInInterfacesAt(options as any, index);
4861
- }
4862
-
4863
- /**
4864
- * 添加鉴权接口
4865
- * @internal
4866
- * @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
4867
- */
4868
- addAuthInterfaceInInterfaces(name?: string): AuthInterface;
4869
-
4870
- /**
4871
- * 添加鉴权接口
4872
- * @param itfaceOptions 鉴权接口参数
4873
- */
4874
- addAuthInterfaceInInterfaces(itfaceOptions: Partial<AuthInterface>): AuthInterface;
4875
-
4876
- /**
4877
- * 添加鉴权接口
4878
- * @param itface 已有的鉴权接口实例
4879
- */
4880
- addAuthInterfaceInInterfaces(itface: AuthInterface): AuthInterface;
4881
-
4882
- addAuthInterfaceInInterfaces(options?: string | Partial<AuthInterface> | AuthInterface) {
4883
- const node = this._addAuthInterfaceInInterfaces(options as any);
4884
- const index = this.interfaces.indexOf(node);
4885
- node.create({
4886
- index,
4887
- parentNode: this,
4888
- parentKey: 'interfaces',
4889
- });
4890
- return node;
4891
- }
4892
-
4893
- /**
4894
- * 删除鉴权接口
4895
- * @param name 鉴权接口名称
4896
- */
4897
- removeAuthInterfaceInInterfaces(name: string): void;
4898
-
4899
- /**
4900
- * 删除鉴权接口
4901
- * @param itface 已有的鉴权接口实例
4902
- */
4903
- removeAuthInterfaceInInterfaces(itface: AuthInterface): void;
4904
-
4905
- removeAuthInterfaceInInterfaces(options: string | AuthInterface) {
4906
- let itface: AuthInterface;
4907
- if (typeof options === 'string') {
4908
- itface = (this.interfaces as AuthInterface[]).find((item) => item.name === options);
4909
- if (!itface) {
4910
- throw new Error('找不到鉴权接口 ' + options);
4911
- }
4912
- } else {
4913
- itface = options;
4914
- }
4915
- return itface.delete();
4916
- }
4917
-
4918
- __removeInterface(itface: Interface) {
4919
- const parentKey = itface.parentKey;
4920
- const params: Params = {
4921
- parentNode: this,
4922
- parentKey,
4923
- index: -1,
4924
- object: null,
4925
- oldObject: itface,
4926
- };
4927
- if (parentKey) {
4928
- params.parentKey = parentKey;
4929
- if (Array.isArray((this as any)[parentKey])) {
4930
- const index = (this as any)[parentKey].indexOf(itface);
4931
- ~index && (this as any)[parentKey].splice(index, 1);
4932
- params.index = index;
4933
- } else if ((this as any)[parentKey] === itface) {
4934
- params.index = 0;
4935
- (this as any)[parentKey] = undefined;
4936
- }
4937
- }
4938
- return params;
4939
- }
4940
4254
  /** hank */
4941
4255
  // setConnector() {
4942
4256
  // const [a, b, c, d, e, f] = this.connections;