@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
@@ -1,29 +1,26 @@
1
+ import View from './View__';
2
+ import Frontend from './Frontend__';
3
+ import ProcessElement from './ProcessElement__';
4
+ import Process from './Process__';
1
5
  //================================================================================
2
6
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
3
7
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
4
8
  //================================================================================
5
9
  import { EventPayload, Params } from '../common/EventEmitter';
6
- import { concept, excludedInJSON, property, getConceptConstructor, getBaseNode } from '../decorators';
10
+ import { concept, excludedInJSON, property, getConceptConstructor } from '../decorators';
7
11
 
8
12
  import * as utils from '../utils';
9
13
  import * as types from './utils/types';
10
14
  import * as asserts from './utils/asserts';
11
15
  import { v4 as uuidv4 } from 'uuid';
16
+
17
+ import Param from './Param__';
18
+ import ConnectorTrigger from './ConnectorTrigger__';
19
+ import Logic from './Logic__';
20
+ import Namespace from './Namespace__';
21
+ import AuthLogic from './AuthLogic__';
22
+ import AuthLogicForCallInterface from './AuthLogicForCallInterface__';
12
23
  import Module from './Module__';
13
- import type Param from './Param__';
14
- import type Logic from './Logic__';
15
- import type ConnectorTrigger from './ConnectorTrigger__';
16
- import type Structure from './Structure__';
17
- import type Namespace from './Namespace__';
18
- import type AuthLogic from './AuthLogic__';
19
- import type AuthLogicForCallInterface from './AuthLogicForCallInterface__';
20
- import type TriggerLauncher from './TriggerLauncher__';
21
- import type Connection from './Connection__';
22
- import type View from './View__';
23
- import type ProcessElement from './ProcessElement__';
24
- import type App from './App__';
25
- import type Frontend from './Frontend__';
26
- import type Process from './Process__';
27
24
 
28
25
  /**
29
26
  * 连接器
@@ -32,7 +29,11 @@ import type Process from './Process__';
32
29
  export class Connector extends Module {
33
30
  /** 类名 */
34
31
  static readonly ConceptName: string = 'Connector';
35
-
32
+ /**
33
+ * 是否为抽象类
34
+ * 抽象类不能产生 concept: string
35
+ */
36
+ static isAbstract: boolean = false;
36
37
  /** 继承链 */
37
38
  static readonly inheritanceChain: string[] = ['Module', 'BaseNode'];
38
39
 
@@ -42,18 +43,13 @@ export class Connector extends Module {
42
43
  @property('concept')
43
44
  // @ts-ignore
44
45
  readonly concept!: 'Connector';
45
-
46
- /**
47
- * 连接器名称
48
- */
49
- @property()
50
- name!: string;
51
-
52
46
  /**
53
47
  * connectorKind
54
48
  */
55
- @property()
56
- connectorKind!: string;
49
+ @property({
50
+ objectRef: '',
51
+ })
52
+ connectorKind: string;
57
53
 
58
54
  /**
59
55
  * 输入参数列表
@@ -65,16 +61,6 @@ export class Connector extends Module {
65
61
  })
66
62
  properties: Array<Param> = [];
67
63
 
68
- /**
69
- * 逻辑列表
70
- */
71
- @property({
72
- objectRef: 'Logic',
73
- isArray: true,
74
- defaultValue: [],
75
- })
76
- logics: Array<Logic> = [];
77
-
78
64
  /**
79
65
  * 连接器触发器列表
80
66
  */
@@ -85,29 +71,13 @@ export class Connector extends Module {
85
71
  })
86
72
  triggers: Array<ConnectorTrigger> = [];
87
73
 
88
- /**
89
- * 数据结构列表
90
- */
91
- @property({
92
- objectRef: 'Structure',
93
- isArray: true,
94
- defaultValue: [],
95
- })
96
- structures: Array<Structure> = [];
97
-
98
- /**
99
- * compilerInfoMap
100
- */
101
- @property()
102
- compilerInfoMap!: Map<string, string>;
103
-
104
74
  /**
105
75
  * createLogic
106
76
  */
107
77
  @property({
108
78
  objectRef: 'Logic',
109
79
  })
110
- createLogic!: undefined;
80
+ createLogic: Logic;
111
81
 
112
82
  /**
113
83
  * testConnectorLogic
@@ -115,13 +85,15 @@ export class Connector extends Module {
115
85
  @property({
116
86
  objectRef: 'Logic',
117
87
  })
118
- testConnectorLogic!: undefined;
88
+ testConnectorLogic: Logic;
119
89
 
120
90
  /**
121
91
  * 预览图
122
92
  */
123
- @property()
124
- previewImg!: string;
93
+ @property({
94
+ objectRef: '',
95
+ })
96
+ previewImg: string;
125
97
 
126
98
  /**
127
99
  * 命名空间列表
@@ -154,68 +126,13 @@ export class Connector extends Module {
154
126
  authLogicsForCallInterface: Array<AuthLogicForCallInterface> = [];
155
127
 
156
128
  /**
157
- * 触发器启动器列表
158
- */
159
- @property({
160
- objectRef: 'TriggerLauncher',
161
- isArray: true,
162
- defaultValue: [],
163
- })
164
- triggerLaunchers: Array<TriggerLauncher> = [];
165
-
166
- /**
167
- * 连接列表
129
+ * isLocal
168
130
  */
169
131
  @property({
170
- objectRef: 'Connection',
171
- isArray: true,
172
- defaultValue: [],
132
+ objectRef: '',
173
133
  })
174
- connections: Array<Connection> = [];
175
-
176
- /**
177
- * isLocal
178
- */
179
- @property()
180
134
  isLocal: boolean = true;
181
135
 
182
- /**
183
- * 祖先 Module
184
- */
185
- get module() {
186
- return this.getAncestor('Module') as Module;
187
- }
188
- /**
189
- * 祖先 App
190
- */
191
- get app() {
192
- return this.getAncestor('App') as App;
193
- }
194
- /**
195
- * 祖先 View
196
- */
197
- get view() {
198
- return this.getAncestor('View') as View;
199
- }
200
- /**
201
- * 祖先 Frontend
202
- */
203
- get frontend() {
204
- return this.getAncestor('Frontend') as Frontend;
205
- }
206
- /**
207
- * 祖先 ProcessElement
208
- */
209
- get processElement() {
210
- return this.getAncestor('ProcessElement') as ProcessElement;
211
- }
212
- /**
213
- * 祖先 Process
214
- */
215
- get process() {
216
- return this.getAncestor('Process') as Process;
217
- }
218
-
219
136
  /**
220
137
  * @param source 需要合并的部分参数
221
138
  */
@@ -229,19 +146,6 @@ export class Connector extends Module {
229
146
  return super.from(source, parentNode, parentKey) as Connector;
230
147
  }
231
148
 
232
- /**
233
- * 设置连接器名称
234
- */
235
- setName(name: string) {
236
- const object = {
237
- name,
238
- };
239
- this.update({
240
- ...object,
241
- field: 'name',
242
- });
243
- }
244
-
245
149
  /**
246
150
  * 设置connectorKind
247
151
  */
@@ -266,18 +170,6 @@ export class Connector extends Module {
266
170
  });
267
171
  }
268
172
 
269
- /**
270
- * 设置逻辑列表
271
- */
272
- setLogics(logics: Array<Logic>) {
273
- const object = {
274
- logics,
275
- };
276
- this.update({
277
- ...object,
278
- });
279
- }
280
-
281
173
  /**
282
174
  * 设置连接器触发器列表
283
175
  */
@@ -290,34 +182,13 @@ export class Connector extends Module {
290
182
  });
291
183
  }
292
184
 
293
- /**
294
- * 设置数据结构列表
295
- */
296
- setStructures(structures: Array<Structure>) {
297
- const object = {
298
- structures,
299
- };
300
- this.update({
301
- ...object,
302
- });
303
- }
304
-
305
- /**
306
- * 设置compilerInfoMap
307
- */
308
- setCompilerInfoMap(compilerInfoMap: Map<string, string>) {
309
- const object = {
310
- compilerInfoMap,
311
- };
312
- this.update({
313
- ...object,
314
- });
315
- }
316
-
317
185
  /**
318
186
  * 设置createLogic
319
187
  */
320
- setCreateLogic(createLogic: undefined) {
188
+ setCreateLogic(createLogic: Logic) {
189
+ createLogic._delete();
190
+ const relationOptions = { parentNode: this, parentKey: 'createLogic' };
191
+ Object.assign(createLogic, relationOptions);
321
192
  const object = {
322
193
  createLogic,
323
194
  };
@@ -329,7 +200,10 @@ export class Connector extends Module {
329
200
  /**
330
201
  * 设置testConnectorLogic
331
202
  */
332
- setTestConnectorLogic(testConnectorLogic: undefined) {
203
+ setTestConnectorLogic(testConnectorLogic: Logic) {
204
+ testConnectorLogic._delete();
205
+ const relationOptions = { parentNode: this, parentKey: 'testConnectorLogic' };
206
+ Object.assign(testConnectorLogic, relationOptions);
333
207
  const object = {
334
208
  testConnectorLogic,
335
209
  };
@@ -376,7 +250,7 @@ export class Connector extends Module {
376
250
 
377
251
  getParamExistingNames(excludedList: Array<Param> = []) {
378
252
  const excludedSet = new Set(excludedList);
379
- return ((this.properties as Param[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
253
+ return ((this.properties as Param[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
380
254
  }
381
255
  getParamUniqueName(name = 'param1') {
382
256
  return utils.unique(name, this.getParamExistingNames(), undefined, false);
@@ -528,165 +402,11 @@ export class Connector extends Module {
528
402
  return node;
529
403
  }
530
404
 
531
- getLogicExistingNames(excludedList: Array<Logic> = []) {
532
- const excludedSet = new Set(excludedList);
533
- return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
534
- }
535
- getLogicUniqueName(name = 'logic1') {
536
- return utils.unique(name, this.getLogicExistingNames(), undefined, false);
537
- }
538
-
539
- /**
540
- * 插入逻辑
541
- * @internal
542
- * @param name 逻辑名称,如果不填会自动生成一个唯一名称
543
- */
544
- _insertLogicInLogicsAt(name: string, index: number): Logic;
545
-
546
- /**
547
- * 插入逻辑
548
- * @internal
549
- * @param logicOptions 逻辑参数
550
- */
551
- _insertLogicInLogicsAt(logicOptions: Partial<Logic>, index: number): Logic;
552
-
553
- /**
554
- * 插入逻辑
555
- * @internal
556
- * @param logic 已有的逻辑实例
557
- */
558
- _insertLogicInLogicsAt(logic: Logic, index: number): Logic;
559
-
560
- _insertLogicInLogicsAt(options: string | Partial<Logic> | Logic, index: number) {
561
- const logicOptions: any = {};
562
- const relationOptions = { parentNode: this, parentKey: 'logics' };
563
- const Logic = getConceptConstructor('Logic');
564
- let logic: Logic;
565
- if (!options) {
566
- logic = Logic.from(
567
- {
568
- ...logicOptions,
569
- name: this.getLogicUniqueName(),
570
- },
571
- this,
572
- 'logics',
573
- );
574
- } else if (typeof options === 'string') {
575
- logic = Logic.from(
576
- {
577
- ...logicOptions,
578
- name: options,
579
- },
580
- this,
581
- 'logics',
582
- );
583
- } else if (asserts.isLogic(options)) {
584
- options.ensureDelete(); // 同一实例不支持多处存在
585
- logic = options;
586
- Object.assign(logic, relationOptions);
587
- } else {
588
- logic = Logic.from(
589
- {
590
- ...logicOptions,
591
- ...options,
592
- },
593
- this,
594
- 'logics',
595
- );
596
- }
597
- this.logics.splice(index, 0, logic);
598
- return logic;
599
- }
600
-
601
- /**
602
- * 插入逻辑
603
- * @param name 逻辑名称,如果不填会自动生成一个唯一名称
604
- */
605
- insertLogicInLogicsAt(name: string, index: number): Logic;
606
-
607
- /**
608
- * 插入逻辑
609
- * @param logicOptions 逻辑参数
610
- */
611
- insertLogicInLogicsAt(logicOptions: Partial<Logic>, index: number): Logic;
612
-
613
- /**
614
- * 插入逻辑
615
- * @param logic 已有的逻辑实例
616
- */
617
- insertLogicInLogicsAt(logic: Logic, index: number): Logic;
618
-
619
- insertLogicInLogicsAt(options: string | Partial<Logic> | Logic, index: number) {
620
- const node = this._insertLogicInLogicsAt(options as any, index);
621
- node.create({
622
- index,
623
- parentNode: this,
624
- parentKey: 'logics',
625
- });
626
- return node;
627
- }
628
-
629
- /**
630
- * 添加逻辑
631
- * @internal
632
- * @param name 逻辑名称,如果不填会自动生成一个唯一名称
633
- */
634
- _addLogicInLogics(name?: string): Logic;
635
-
636
- /**
637
- * 添加逻辑
638
- * @internal
639
- * @param logicOptions 逻辑参数
640
- */
641
- _addLogicInLogics(logicOptions: Partial<Logic>): Logic;
642
-
643
- /**
644
- * 添加逻辑
645
- * @internal
646
- * @param logic 已有的逻辑实例
647
- */
648
- _addLogicInLogics(logic: Logic): Logic;
649
-
650
- _addLogicInLogics(options?: string | Partial<Logic> | Logic) {
651
- const index = this.logics.length;
652
- return this._insertLogicInLogicsAt(options as any, index);
653
- }
654
-
655
- /**
656
- * 添加逻辑
657
- * @internal
658
- * @param name 逻辑名称,如果不填会自动生成一个唯一名称
659
- */
660
- addLogicInLogics(name?: string): Logic;
661
-
662
- /**
663
- * 添加逻辑
664
- * @param logicOptions 逻辑参数
665
- */
666
- addLogicInLogics(logicOptions: Partial<Logic>): Logic;
667
-
668
- /**
669
- * 添加逻辑
670
- * @param logic 已有的逻辑实例
671
- */
672
- addLogicInLogics(logic: Logic): Logic;
673
-
674
- addLogicInLogics(options?: string | Partial<Logic> | Logic) {
675
- const node = this._addLogicInLogics(options as any);
676
- const index = this.logics.indexOf(node);
677
- node.create({
678
- index,
679
- parentNode: this,
680
- parentKey: 'logics',
681
- });
682
- return node;
683
- }
684
-
685
405
  getConnectorTriggerExistingNames(excludedList: Array<ConnectorTrigger> = []) {
686
406
  const excludedSet = new Set(excludedList);
687
407
  return ((this.triggers as ConnectorTrigger[]) || [])
688
408
  .filter((item) => !excludedSet.has(item))
689
- .map((item) => item?.name);
409
+ .map((item) => item.name);
690
410
  }
691
411
  getConnectorTriggerUniqueName(name = 'connectorTrigger1') {
692
412
  return utils.unique(name, this.getConnectorTriggerExistingNames(), undefined, false);
@@ -838,286 +558,132 @@ export class Connector extends Module {
838
558
  return node;
839
559
  }
840
560
 
841
- getStructureExistingNames(excludedList: Array<Structure> = []) {
561
+ getNamespaceExistingNames(excludedList: Array<Namespace> = []) {
842
562
  const excludedSet = new Set(excludedList);
843
- return ((this.structures as Structure[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
563
+ return ((this.namespaces as Namespace[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
844
564
  }
845
- getStructureUniqueName(name = 'structure1') {
846
- return utils.unique(name, this.getStructureExistingNames(), undefined, false);
565
+ getNamespaceUniqueName(name = 'namespace1') {
566
+ return utils.unique(name, this.getNamespaceExistingNames(), undefined, false);
847
567
  }
848
568
 
849
569
  /**
850
- * 插入数据结构
570
+ * 插入命名空间
851
571
  * @internal
852
- * @param name 数据结构名称,如果不填会自动生成一个唯一名称
572
+ * @param name 命名空间名称,如果不填会自动生成一个唯一名称
853
573
  */
854
- _insertStructureAt(name: string, index: number): Structure;
574
+ _insertNamespaceAt(name: string, index: number): Namespace;
855
575
 
856
576
  /**
857
- * 插入数据结构
577
+ * 插入命名空间
858
578
  * @internal
859
- * @param structureOptions 数据结构参数
579
+ * @param namespaceOptions 命名空间参数
860
580
  */
861
- _insertStructureAt(structureOptions: Partial<Structure>, index: number): Structure;
581
+ _insertNamespaceAt(namespaceOptions: Partial<Namespace>, index: number): Namespace;
862
582
 
863
583
  /**
864
- * 插入数据结构
584
+ * 插入命名空间
865
585
  * @internal
866
- * @param structure 已有的数据结构实例
586
+ * @param namespace 已有的命名空间实例
867
587
  */
868
- _insertStructureAt(structure: Structure, index: number): Structure;
588
+ _insertNamespaceAt(namespace: Namespace, index: number): Namespace;
869
589
 
870
- _insertStructureAt(options: string | Partial<Structure> | Structure, index: number) {
871
- const structureOptions: any = {};
872
- const relationOptions = { parentNode: this, parentKey: 'structures' };
873
- const Structure = getConceptConstructor('Structure');
874
- let structure: Structure;
590
+ _insertNamespaceAt(options: string | Partial<Namespace> | Namespace, index: number) {
591
+ const namespaceOptions: any = {};
592
+ const relationOptions = { parentNode: this, parentKey: 'namespaces' };
593
+ const Namespace = getConceptConstructor('Namespace');
594
+ let namespace: Namespace;
875
595
  if (!options) {
876
- structure = Structure.from(
596
+ namespace = Namespace.from(
877
597
  {
878
- ...structureOptions,
879
- name: this.getStructureUniqueName(),
598
+ ...namespaceOptions,
599
+ name: this.getNamespaceUniqueName(),
880
600
  },
881
601
  this,
882
- 'structures',
602
+ 'namespaces',
883
603
  );
884
604
  } else if (typeof options === 'string') {
885
- structure = Structure.from(
605
+ namespace = Namespace.from(
886
606
  {
887
- ...structureOptions,
607
+ ...namespaceOptions,
888
608
  name: options,
889
609
  },
890
610
  this,
891
- 'structures',
611
+ 'namespaces',
892
612
  );
893
- } else if (asserts.isStructure(options)) {
613
+ } else if (asserts.isNamespace(options)) {
894
614
  options.ensureDelete(); // 同一实例不支持多处存在
895
- structure = options;
896
- Object.assign(structure, relationOptions);
615
+ namespace = options;
616
+ Object.assign(namespace, relationOptions);
897
617
  } else {
898
- structure = Structure.from(
618
+ namespace = Namespace.from(
899
619
  {
900
- ...structureOptions,
620
+ ...namespaceOptions,
901
621
  ...options,
902
622
  },
903
623
  this,
904
- 'structures',
624
+ 'namespaces',
905
625
  );
906
626
  }
907
- this.structures.splice(index, 0, structure);
908
- return structure;
627
+ this.namespaces.splice(index, 0, namespace);
628
+ return namespace;
909
629
  }
910
630
 
911
631
  /**
912
- * 插入数据结构
913
- * @param name 数据结构名称,如果不填会自动生成一个唯一名称
632
+ * 插入命名空间
633
+ * @param name 命名空间名称,如果不填会自动生成一个唯一名称
914
634
  */
915
- insertStructureAt(name: string, index: number): Structure;
635
+ insertNamespaceAt(name: string, index: number): Namespace;
916
636
 
917
637
  /**
918
- * 插入数据结构
919
- * @param structureOptions 数据结构参数
638
+ * 插入命名空间
639
+ * @param namespaceOptions 命名空间参数
920
640
  */
921
- insertStructureAt(structureOptions: Partial<Structure>, index: number): Structure;
641
+ insertNamespaceAt(namespaceOptions: Partial<Namespace>, index: number): Namespace;
922
642
 
923
643
  /**
924
- * 插入数据结构
925
- * @param structure 已有的数据结构实例
644
+ * 插入命名空间
645
+ * @param namespace 已有的命名空间实例
926
646
  */
927
- insertStructureAt(structure: Structure, index: number): Structure;
647
+ insertNamespaceAt(namespace: Namespace, index: number): Namespace;
928
648
 
929
- insertStructureAt(options: string | Partial<Structure> | Structure, index: number) {
930
- const node = this._insertStructureAt(options as any, index);
649
+ insertNamespaceAt(options: string | Partial<Namespace> | Namespace, index: number) {
650
+ const node = this._insertNamespaceAt(options as any, index);
931
651
  node.create({
932
652
  index,
933
653
  parentNode: this,
934
- parentKey: 'structures',
654
+ parentKey: 'namespaces',
935
655
  });
936
656
  return node;
937
657
  }
938
658
 
939
659
  /**
940
- * 添加数据结构
660
+ * 添加命名空间
941
661
  * @internal
942
- * @param name 数据结构名称,如果不填会自动生成一个唯一名称
662
+ * @param name 命名空间名称,如果不填会自动生成一个唯一名称
943
663
  */
944
- _addStructure(name?: string): Structure;
664
+ _addNamespace(name?: string): Namespace;
945
665
 
946
666
  /**
947
- * 添加数据结构
667
+ * 添加命名空间
948
668
  * @internal
949
- * @param structureOptions 数据结构参数
669
+ * @param namespaceOptions 命名空间参数
950
670
  */
951
- _addStructure(structureOptions: Partial<Structure>): Structure;
671
+ _addNamespace(namespaceOptions: Partial<Namespace>): Namespace;
952
672
 
953
673
  /**
954
- * 添加数据结构
674
+ * 添加命名空间
955
675
  * @internal
956
- * @param structure 已有的数据结构实例
676
+ * @param namespace 已有的命名空间实例
957
677
  */
958
- _addStructure(structure: Structure): Structure;
678
+ _addNamespace(namespace: Namespace): Namespace;
959
679
 
960
- _addStructure(options?: string | Partial<Structure> | Structure) {
961
- const index = this.structures.length;
962
- return this._insertStructureAt(options as any, index);
680
+ _addNamespace(options?: string | Partial<Namespace> | Namespace) {
681
+ const index = this.namespaces.length;
682
+ return this._insertNamespaceAt(options as any, index);
963
683
  }
964
684
 
965
685
  /**
966
- * 添加数据结构
967
- * @internal
968
- * @param name 数据结构名称,如果不填会自动生成一个唯一名称
969
- */
970
- addStructure(name?: string): Structure;
971
-
972
- /**
973
- * 添加数据结构
974
- * @param structureOptions 数据结构参数
975
- */
976
- addStructure(structureOptions: Partial<Structure>): Structure;
977
-
978
- /**
979
- * 添加数据结构
980
- * @param structure 已有的数据结构实例
981
- */
982
- addStructure(structure: Structure): Structure;
983
-
984
- addStructure(options?: string | Partial<Structure> | Structure) {
985
- const node = this._addStructure(options as any);
986
- const index = this.structures.indexOf(node);
987
- node.create({
988
- index,
989
- parentNode: this,
990
- parentKey: 'structures',
991
- });
992
- return node;
993
- }
994
-
995
- getNamespaceExistingNames(excludedList: Array<Namespace> = []) {
996
- const excludedSet = new Set(excludedList);
997
- return ((this.namespaces as Namespace[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
998
- }
999
- getNamespaceUniqueName(name = 'namespace1') {
1000
- return utils.unique(name, this.getNamespaceExistingNames(), undefined, false);
1001
- }
1002
-
1003
- /**
1004
- * 插入命名空间
1005
- * @internal
1006
- * @param name 命名空间名称,如果不填会自动生成一个唯一名称
1007
- */
1008
- _insertNamespaceAt(name: string, index: number): Namespace;
1009
-
1010
- /**
1011
- * 插入命名空间
1012
- * @internal
1013
- * @param namespaceOptions 命名空间参数
1014
- */
1015
- _insertNamespaceAt(namespaceOptions: Partial<Namespace>, index: number): Namespace;
1016
-
1017
- /**
1018
- * 插入命名空间
1019
- * @internal
1020
- * @param namespace 已有的命名空间实例
1021
- */
1022
- _insertNamespaceAt(namespace: Namespace, index: number): Namespace;
1023
-
1024
- _insertNamespaceAt(options: string | Partial<Namespace> | Namespace, index: number) {
1025
- const namespaceOptions: any = {};
1026
- const relationOptions = { parentNode: this, parentKey: 'namespaces' };
1027
- const Namespace = getConceptConstructor('Namespace');
1028
- let namespace: Namespace;
1029
- if (!options) {
1030
- namespace = Namespace.from(
1031
- {
1032
- ...namespaceOptions,
1033
- name: this.getNamespaceUniqueName(),
1034
- },
1035
- this,
1036
- 'namespaces',
1037
- );
1038
- } else if (typeof options === 'string') {
1039
- namespace = Namespace.from(
1040
- {
1041
- ...namespaceOptions,
1042
- name: options,
1043
- },
1044
- this,
1045
- 'namespaces',
1046
- );
1047
- } else if (asserts.isNamespace(options)) {
1048
- options.ensureDelete(); // 同一实例不支持多处存在
1049
- namespace = options;
1050
- Object.assign(namespace, relationOptions);
1051
- } else {
1052
- namespace = Namespace.from(
1053
- {
1054
- ...namespaceOptions,
1055
- ...options,
1056
- },
1057
- this,
1058
- 'namespaces',
1059
- );
1060
- }
1061
- this.namespaces.splice(index, 0, namespace);
1062
- return namespace;
1063
- }
1064
-
1065
- /**
1066
- * 插入命名空间
1067
- * @param name 命名空间名称,如果不填会自动生成一个唯一名称
1068
- */
1069
- insertNamespaceAt(name: string, index: number): Namespace;
1070
-
1071
- /**
1072
- * 插入命名空间
1073
- * @param namespaceOptions 命名空间参数
1074
- */
1075
- insertNamespaceAt(namespaceOptions: Partial<Namespace>, index: number): Namespace;
1076
-
1077
- /**
1078
- * 插入命名空间
1079
- * @param namespace 已有的命名空间实例
1080
- */
1081
- insertNamespaceAt(namespace: Namespace, index: number): Namespace;
1082
-
1083
- insertNamespaceAt(options: string | Partial<Namespace> | Namespace, index: number) {
1084
- const node = this._insertNamespaceAt(options as any, index);
1085
- node.create({
1086
- index,
1087
- parentNode: this,
1088
- parentKey: 'namespaces',
1089
- });
1090
- return node;
1091
- }
1092
-
1093
- /**
1094
- * 添加命名空间
1095
- * @internal
1096
- * @param name 命名空间名称,如果不填会自动生成一个唯一名称
1097
- */
1098
- _addNamespace(name?: string): Namespace;
1099
-
1100
- /**
1101
- * 添加命名空间
1102
- * @internal
1103
- * @param namespaceOptions 命名空间参数
1104
- */
1105
- _addNamespace(namespaceOptions: Partial<Namespace>): Namespace;
1106
-
1107
- /**
1108
- * 添加命名空间
1109
- * @internal
1110
- * @param namespace 已有的命名空间实例
1111
- */
1112
- _addNamespace(namespace: Namespace): Namespace;
1113
-
1114
- _addNamespace(options?: string | Partial<Namespace> | Namespace) {
1115
- const index = this.namespaces.length;
1116
- return this._insertNamespaceAt(options as any, index);
1117
- }
1118
-
1119
- /**
1120
- * 添加命名空间
686
+ * 添加命名空间
1121
687
  * @internal
1122
688
  * @param name 命名空间名称,如果不填会自动生成一个唯一名称
1123
689
  */
@@ -1146,852 +712,166 @@ export class Connector extends Module {
1146
712
  return node;
1147
713
  }
1148
714
 
1149
- getTriggerLauncherExistingNames(excludedList: Array<TriggerLauncher> = []) {
1150
- const excludedSet = new Set(excludedList);
1151
- return ((this.triggerLaunchers as TriggerLauncher[]) || [])
1152
- .filter((item) => !excludedSet.has(item))
1153
- .map((item) => item?.name);
1154
- }
1155
- getTriggerLauncherUniqueName(name = 'triggerLauncher1') {
1156
- return utils.unique(name, this.getTriggerLauncherExistingNames(), undefined, false);
1157
- }
1158
-
1159
- /**
1160
- * 插入触发器启动器
1161
- * @internal
1162
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
1163
- */
1164
- _insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
1165
-
1166
- /**
1167
- * 插入触发器启动器
1168
- * @internal
1169
- * @param triggerLauncherOptions 触发器启动器参数
1170
- */
1171
- _insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
1172
-
1173
- /**
1174
- * 插入触发器启动器
1175
- * @internal
1176
- * @param triggerLauncher 已有的触发器启动器实例
1177
- */
1178
- _insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
1179
-
1180
- _insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
1181
- const triggerLauncherOptions: any = {};
1182
- const relationOptions = { parentNode: this, parentKey: 'triggerLaunchers' };
1183
- const TriggerLauncher = getConceptConstructor('TriggerLauncher');
1184
- let triggerLauncher: TriggerLauncher;
1185
- if (!options) {
1186
- triggerLauncher = TriggerLauncher.from(
1187
- {
1188
- ...triggerLauncherOptions,
1189
- name: this.getTriggerLauncherUniqueName(),
1190
- },
1191
- this,
1192
- 'triggerLaunchers',
1193
- );
1194
- } else if (typeof options === 'string') {
1195
- triggerLauncher = TriggerLauncher.from(
1196
- {
1197
- ...triggerLauncherOptions,
1198
- name: options,
1199
- },
1200
- this,
1201
- 'triggerLaunchers',
1202
- );
1203
- } else if (asserts.isTriggerLauncher(options)) {
1204
- options.ensureDelete(); // 同一实例不支持多处存在
1205
- triggerLauncher = options;
1206
- Object.assign(triggerLauncher, relationOptions);
1207
- } else {
1208
- triggerLauncher = TriggerLauncher.from(
1209
- {
1210
- ...triggerLauncherOptions,
1211
- ...options,
1212
- },
1213
- this,
1214
- 'triggerLaunchers',
1215
- );
1216
- }
1217
- this.triggerLaunchers.splice(index, 0, triggerLauncher);
1218
- return triggerLauncher;
1219
- }
1220
-
1221
- /**
1222
- * 插入触发器启动器
1223
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
1224
- */
1225
- insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
1226
-
1227
- /**
1228
- * 插入触发器启动器
1229
- * @param triggerLauncherOptions 触发器启动器参数
1230
- */
1231
- insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
1232
-
1233
- /**
1234
- * 插入触发器启动器
1235
- * @param triggerLauncher 已有的触发器启动器实例
1236
- */
1237
- insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
1238
-
1239
- insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
1240
- const node = this._insertTriggerLauncherAt(options as any, index);
1241
- node.create({
1242
- index,
1243
- parentNode: this,
1244
- parentKey: 'triggerLaunchers',
1245
- });
1246
- return node;
1247
- }
1248
-
1249
- /**
1250
- * 添加触发器启动器
1251
- * @internal
1252
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
1253
- */
1254
- _addTriggerLauncher(name?: string): TriggerLauncher;
1255
-
1256
- /**
1257
- * 添加触发器启动器
1258
- * @internal
1259
- * @param triggerLauncherOptions 触发器启动器参数
1260
- */
1261
- _addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
1262
-
1263
- /**
1264
- * 添加触发器启动器
1265
- * @internal
1266
- * @param triggerLauncher 已有的触发器启动器实例
1267
- */
1268
- _addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
1269
-
1270
- _addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
1271
- const index = 0;
1272
- return this._insertTriggerLauncherAt(options as any, index);
1273
- }
1274
-
1275
- /**
1276
- * 添加触发器启动器
1277
- * @internal
1278
- * @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
1279
- */
1280
- addTriggerLauncher(name?: string): TriggerLauncher;
1281
-
1282
- /**
1283
- * 添加触发器启动器
1284
- * @param triggerLauncherOptions 触发器启动器参数
1285
- */
1286
- addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
1287
-
1288
- /**
1289
- * 添加触发器启动器
1290
- * @param triggerLauncher 已有的触发器启动器实例
1291
- */
1292
- addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
1293
-
1294
- addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
1295
- const node = this._addTriggerLauncher(options as any);
1296
- const index = this.triggerLaunchers.indexOf(node);
1297
- node.create({
1298
- index,
1299
- parentNode: this,
1300
- parentKey: 'triggerLaunchers',
1301
- });
1302
- return node;
1303
- }
1304
-
1305
- getConnectionExistingNames(excludedList: Array<Connection> = []) {
715
+ getAuthLogicExistingNames(excludedList: Array<AuthLogic> = []) {
1306
716
  const excludedSet = new Set(excludedList);
1307
- return ((this.connections as Connection[]) || [])
1308
- .filter((item) => !excludedSet.has(item))
1309
- .map((item) => item?.name);
717
+ return ((this.authLogics as AuthLogic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1310
718
  }
1311
- getConnectionUniqueName(name = 'connection1') {
1312
- return utils.unique(name, this.getConnectionExistingNames(), undefined, false);
719
+ getAuthLogicUniqueName(name = 'authentication1') {
720
+ return utils.unique(name, this.getAuthLogicExistingNames(), undefined, false);
1313
721
  }
1314
722
 
1315
723
  /**
1316
- * 插入连接
724
+ * 插入鉴权逻辑
1317
725
  * @internal
1318
- * @param name 连接名称,如果不填会自动生成一个唯一名称
726
+ * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
1319
727
  */
1320
- _insertConnectionAt(name: string, index: number): Connection;
728
+ _insertAuthLogicAt(name: string, index: number): AuthLogic;
1321
729
 
1322
730
  /**
1323
- * 插入连接
731
+ * 插入鉴权逻辑
1324
732
  * @internal
1325
- * @param connectionOptions 连接参数
733
+ * @param authLogicOptions 鉴权逻辑参数
1326
734
  */
1327
- _insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
735
+ _insertAuthLogicAt(authLogicOptions: Partial<AuthLogic>, index: number): AuthLogic;
1328
736
 
1329
737
  /**
1330
- * 插入连接
738
+ * 插入鉴权逻辑
1331
739
  * @internal
1332
- * @param connection 已有的连接实例
740
+ * @param authLogic 已有的鉴权逻辑实例
1333
741
  */
1334
- _insertConnectionAt(connection: Connection, index: number): Connection;
742
+ _insertAuthLogicAt(authLogic: AuthLogic, index: number): AuthLogic;
1335
743
 
1336
- _insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
1337
- const connectionOptions: any = {};
1338
- const relationOptions = { parentNode: this, parentKey: 'connections' };
1339
- const Connection = getConceptConstructor('Connection');
1340
- let connection: Connection;
744
+ _insertAuthLogicAt(options: string | Partial<AuthLogic> | AuthLogic, index: number) {
745
+ const authLogicOptions: any = {};
746
+ const relationOptions = { parentNode: this, parentKey: 'authLogics' };
747
+ const AuthLogic = getConceptConstructor('AuthLogic');
748
+ let authLogic: AuthLogic;
1341
749
  if (!options) {
1342
- connection = Connection.from(
750
+ authLogic = AuthLogic.from(
1343
751
  {
1344
- ...connectionOptions,
1345
- name: this.getConnectionUniqueName(),
752
+ ...authLogicOptions,
753
+ name: this.getAuthLogicUniqueName(),
1346
754
  },
1347
755
  this,
1348
- 'connections',
756
+ 'authLogics',
1349
757
  );
1350
758
  } else if (typeof options === 'string') {
1351
- connection = Connection.from(
759
+ authLogic = AuthLogic.from(
1352
760
  {
1353
- ...connectionOptions,
761
+ ...authLogicOptions,
1354
762
  name: options,
1355
763
  },
1356
764
  this,
1357
- 'connections',
765
+ 'authLogics',
1358
766
  );
1359
- } else if (asserts.isConnection(options)) {
767
+ } else if (asserts.isAuthLogic(options)) {
1360
768
  options.ensureDelete(); // 同一实例不支持多处存在
1361
- connection = options;
1362
- Object.assign(connection, relationOptions);
769
+ authLogic = options;
770
+ Object.assign(authLogic, relationOptions);
1363
771
  } else {
1364
- connection = Connection.from(
772
+ authLogic = AuthLogic.from(
1365
773
  {
1366
- ...connectionOptions,
774
+ ...authLogicOptions,
1367
775
  ...options,
1368
776
  },
1369
777
  this,
1370
- 'connections',
778
+ 'authLogics',
1371
779
  );
1372
780
  }
1373
- this.connections.splice(index, 0, connection);
1374
- return connection;
781
+ this.authLogics.splice(index, 0, authLogic);
782
+ return authLogic;
1375
783
  }
1376
784
 
1377
785
  /**
1378
- * 插入连接
1379
- * @param name 连接名称,如果不填会自动生成一个唯一名称
786
+ * 插入鉴权逻辑
787
+ * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
1380
788
  */
1381
- insertConnectionAt(name: string, index: number): Connection;
789
+ insertAuthLogicAt(name: string, index: number): AuthLogic;
1382
790
 
1383
791
  /**
1384
- * 插入连接
1385
- * @param connectionOptions 连接参数
792
+ * 插入鉴权逻辑
793
+ * @param authLogicOptions 鉴权逻辑参数
1386
794
  */
1387
- insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
795
+ insertAuthLogicAt(authLogicOptions: Partial<AuthLogic>, index: number): AuthLogic;
1388
796
 
1389
797
  /**
1390
- * 插入连接
1391
- * @param connection 已有的连接实例
798
+ * 插入鉴权逻辑
799
+ * @param authLogic 已有的鉴权逻辑实例
1392
800
  */
1393
- insertConnectionAt(connection: Connection, index: number): Connection;
801
+ insertAuthLogicAt(authLogic: AuthLogic, index: number): AuthLogic;
1394
802
 
1395
- insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
1396
- const node = this._insertConnectionAt(options as any, index);
803
+ insertAuthLogicAt(options: string | Partial<AuthLogic> | AuthLogic, index: number) {
804
+ const node = this._insertAuthLogicAt(options as any, index);
1397
805
  node.create({
1398
806
  index,
1399
807
  parentNode: this,
1400
- parentKey: 'connections',
808
+ parentKey: 'authLogics',
1401
809
  });
1402
810
  return node;
1403
811
  }
1404
812
 
1405
813
  /**
1406
- * 添加连接
814
+ * 添加鉴权逻辑
1407
815
  * @internal
1408
- * @param name 连接名称,如果不填会自动生成一个唯一名称
816
+ * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
1409
817
  */
1410
- _addConnection(name?: string): Connection;
818
+ _addAuthLogic(name?: string): AuthLogic;
1411
819
 
1412
820
  /**
1413
- * 添加连接
821
+ * 添加鉴权逻辑
1414
822
  * @internal
1415
- * @param connectionOptions 连接参数
823
+ * @param authLogicOptions 鉴权逻辑参数
1416
824
  */
1417
- _addConnection(connectionOptions: Partial<Connection>): Connection;
825
+ _addAuthLogic(authLogicOptions: Partial<AuthLogic>): AuthLogic;
1418
826
 
1419
827
  /**
1420
- * 添加连接
828
+ * 添加鉴权逻辑
1421
829
  * @internal
1422
- * @param connection 已有的连接实例
1423
- */
1424
- _addConnection(connection: Connection): Connection;
1425
-
1426
- _addConnection(options?: string | Partial<Connection> | Connection) {
1427
- const index = 0;
1428
- return this._insertConnectionAt(options as any, index);
1429
- }
1430
-
1431
- /**
1432
- * 添加连接
1433
- * @internal
1434
- * @param name 连接名称,如果不填会自动生成一个唯一名称
1435
- */
1436
- addConnection(name?: string): Connection;
1437
-
1438
- /**
1439
- * 添加连接
1440
- * @param connectionOptions 连接参数
1441
- */
1442
- addConnection(connectionOptions: Partial<Connection>): Connection;
1443
-
1444
- /**
1445
- * 添加连接
1446
- * @param connection 已有的连接实例
1447
- */
1448
- addConnection(connection: Connection): Connection;
1449
-
1450
- addConnection(options?: string | Partial<Connection> | Connection) {
1451
- const node = this._addConnection(options as any);
1452
- const index = this.connections.indexOf(node);
1453
- node.create({
1454
- index,
1455
- parentNode: this,
1456
- parentKey: 'connections',
1457
- });
1458
- return node;
1459
- }
1460
-
1461
- /**
1462
- * 删除输入参数
1463
- * @param name 输入参数名称
1464
- */
1465
- removeParam(name: string): void;
1466
-
1467
- /**
1468
- * 删除输入参数
1469
- * @param param 已有的输入参数实例
1470
- */
1471
- removeParam(param: Param): void;
1472
-
1473
- removeParam(options: string | Param) {
1474
- let param: Param;
1475
- if (typeof options === 'string') {
1476
- param = (this.properties as Param[]).find((item) => item.name === options);
1477
- if (!param) {
1478
- throw new Error('找不到输入参数 ' + options);
1479
- }
1480
- } else {
1481
- param = options;
1482
- }
1483
- return param.delete();
1484
- }
1485
-
1486
- __removeParam(param: Param) {
1487
- const parentKey = param.parentKey;
1488
- const params: Params = {
1489
- parentNode: this,
1490
- parentKey,
1491
- index: -1,
1492
- object: null,
1493
- oldObject: param,
1494
- };
1495
- if (parentKey) {
1496
- params.parentKey = parentKey;
1497
- // @ts-ignore
1498
- const t = this.__v_raw || this;
1499
- // @ts-ignore
1500
- const n = param.__v_raw || param;
1501
- if (Array.isArray((t as any)[parentKey])) {
1502
- // @ts-ignore
1503
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1504
- ~index && (this as any)[parentKey].splice(index, 1);
1505
- params.index = index;
1506
- } else {
1507
- const q = (t as any)[parentKey];
1508
- if ((q.__v_raw || q) === n) {
1509
- params.index = 0;
1510
- (this as any)[parentKey] = undefined;
1511
- }
1512
- }
1513
- }
1514
- return params;
1515
- }
1516
-
1517
- /**
1518
- * 删除逻辑
1519
- * @param name 逻辑名称
1520
- */
1521
- removeLogicInLogics(name: string): void;
1522
-
1523
- /**
1524
- * 删除逻辑
1525
- * @param logic 已有的逻辑实例
1526
- */
1527
- removeLogicInLogics(logic: Logic): void;
1528
-
1529
- removeLogicInLogics(options: string | Logic) {
1530
- let logic: Logic;
1531
- if (typeof options === 'string') {
1532
- logic = (this.logics as Logic[]).find((item) => item.name === options);
1533
- if (!logic) {
1534
- throw new Error('找不到逻辑 ' + options);
1535
- }
1536
- } else {
1537
- logic = options;
1538
- }
1539
- return logic.delete();
1540
- }
1541
-
1542
- /**
1543
- * 删除逻辑
1544
- * @param name 逻辑名称
1545
- */
1546
- removeCreateLogic(name: string): void;
1547
-
1548
- /**
1549
- * 删除逻辑
1550
- * @param createLogic 已有的逻辑实例
1551
- */
1552
- removeCreateLogic(createLogic: Logic): void;
1553
-
1554
- removeCreateLogic(options: string | Logic) {
1555
- let createLogic: Logic;
1556
- if (typeof options === 'string') {
1557
- createLogic = this.createLogic;
1558
- if (!createLogic) {
1559
- throw new Error('找不到逻辑 ' + options);
1560
- }
1561
- } else {
1562
- createLogic = options;
1563
- }
1564
- return createLogic.delete();
1565
- }
1566
-
1567
- /**
1568
- * 删除逻辑
1569
- * @param name 逻辑名称
1570
- */
1571
- removeTestConnectorLogic(name: string): void;
1572
-
1573
- /**
1574
- * 删除逻辑
1575
- * @param testConnectorLogic 已有的逻辑实例
1576
- */
1577
- removeTestConnectorLogic(testConnectorLogic: Logic): void;
1578
-
1579
- removeTestConnectorLogic(options: string | Logic) {
1580
- let testConnectorLogic: Logic;
1581
- if (typeof options === 'string') {
1582
- testConnectorLogic = this.testConnectorLogic;
1583
- if (!testConnectorLogic) {
1584
- throw new Error('找不到逻辑 ' + options);
1585
- }
1586
- } else {
1587
- testConnectorLogic = options;
1588
- }
1589
- return testConnectorLogic.delete();
1590
- }
1591
-
1592
- /**
1593
- * 删除鉴权逻辑
1594
- * @param name 鉴权逻辑名称
1595
- */
1596
- removeAuthLogicInAuthLogics(name: string): void;
1597
-
1598
- /**
1599
- * 删除鉴权逻辑
1600
- * @param authLogic 已有的鉴权逻辑实例
1601
- */
1602
- removeAuthLogicInAuthLogics(authLogic: AuthLogic): void;
1603
-
1604
- removeAuthLogicInAuthLogics(options: string | AuthLogic) {
1605
- let authLogic: AuthLogic;
1606
- if (typeof options === 'string') {
1607
- authLogic = (this.authLogics as AuthLogic[]).find((item) => item.name === options);
1608
- if (!authLogic) {
1609
- throw new Error('找不到鉴权逻辑 ' + options);
1610
- }
1611
- } else {
1612
- authLogic = options;
1613
- }
1614
- return authLogic.delete();
1615
- }
1616
-
1617
- /**
1618
- * 删除调用接口的鉴权逻辑
1619
- * @param name 调用接口的鉴权逻辑名称
1620
- */
1621
- removeAuthLogicForCallInterfaceInAuthLogicsForCallInterface(name: string): void;
1622
-
1623
- /**
1624
- * 删除调用接口的鉴权逻辑
1625
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
1626
- */
1627
- removeAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
1628
- authLogicForCallInterface: AuthLogicForCallInterface,
1629
- ): void;
1630
-
1631
- removeAuthLogicForCallInterfaceInAuthLogicsForCallInterface(options: string | AuthLogicForCallInterface) {
1632
- let authLogicForCallInterface: AuthLogicForCallInterface;
1633
- if (typeof options === 'string') {
1634
- authLogicForCallInterface = (this.authLogicsForCallInterface as AuthLogicForCallInterface[]).find(
1635
- (item) => item.name === options,
1636
- );
1637
- if (!authLogicForCallInterface) {
1638
- throw new Error('找不到调用接口的鉴权逻辑 ' + options);
1639
- }
1640
- } else {
1641
- authLogicForCallInterface = options;
1642
- }
1643
- return authLogicForCallInterface.delete();
1644
- }
1645
-
1646
- __removeLogic(logic: Logic) {
1647
- const parentKey = logic.parentKey;
1648
- const params: Params = {
1649
- parentNode: this,
1650
- parentKey,
1651
- index: -1,
1652
- object: null,
1653
- oldObject: logic,
1654
- };
1655
- if (parentKey) {
1656
- params.parentKey = parentKey;
1657
- // @ts-ignore
1658
- const t = this.__v_raw || this;
1659
- // @ts-ignore
1660
- const n = logic.__v_raw || logic;
1661
- if (Array.isArray((t as any)[parentKey])) {
1662
- // @ts-ignore
1663
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1664
- ~index && (this as any)[parentKey].splice(index, 1);
1665
- params.index = index;
1666
- } else {
1667
- const q = (t as any)[parentKey];
1668
- if ((q.__v_raw || q) === n) {
1669
- params.index = 0;
1670
- (this as any)[parentKey] = undefined;
1671
- }
1672
- }
1673
- }
1674
- return params;
1675
- }
1676
-
1677
- /**
1678
- * 删除连接器触发器
1679
- * @param name 连接器触发器名称
1680
- */
1681
- removeConnectorTrigger(name: string): void;
1682
-
1683
- /**
1684
- * 删除连接器触发器
1685
- * @param connectorTrigger 已有的连接器触发器实例
1686
- */
1687
- removeConnectorTrigger(connectorTrigger: ConnectorTrigger): void;
1688
-
1689
- removeConnectorTrigger(options: string | ConnectorTrigger) {
1690
- let connectorTrigger: ConnectorTrigger;
1691
- if (typeof options === 'string') {
1692
- connectorTrigger = (this.triggers as ConnectorTrigger[]).find((item) => item.name === options);
1693
- if (!connectorTrigger) {
1694
- throw new Error('找不到连接器触发器 ' + options);
1695
- }
1696
- } else {
1697
- connectorTrigger = options;
1698
- }
1699
- return connectorTrigger.delete();
1700
- }
1701
-
1702
- __removeConnectorTrigger(connectorTrigger: ConnectorTrigger) {
1703
- const parentKey = connectorTrigger.parentKey;
1704
- const params: Params = {
1705
- parentNode: this,
1706
- parentKey,
1707
- index: -1,
1708
- object: null,
1709
- oldObject: connectorTrigger,
1710
- };
1711
- if (parentKey) {
1712
- params.parentKey = parentKey;
1713
- // @ts-ignore
1714
- const t = this.__v_raw || this;
1715
- // @ts-ignore
1716
- const n = connectorTrigger.__v_raw || connectorTrigger;
1717
- if (Array.isArray((t as any)[parentKey])) {
1718
- // @ts-ignore
1719
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1720
- ~index && (this as any)[parentKey].splice(index, 1);
1721
- params.index = index;
1722
- } else {
1723
- const q = (t as any)[parentKey];
1724
- if ((q.__v_raw || q) === n) {
1725
- params.index = 0;
1726
- (this as any)[parentKey] = undefined;
1727
- }
1728
- }
1729
- }
1730
- return params;
1731
- }
1732
-
1733
- /**
1734
- * 删除数据结构
1735
- * @param name 数据结构名称
1736
- */
1737
- removeStructure(name: string): void;
1738
-
1739
- /**
1740
- * 删除数据结构
1741
- * @param structure 已有的数据结构实例
1742
- */
1743
- removeStructure(structure: Structure): void;
1744
-
1745
- removeStructure(options: string | Structure) {
1746
- let structure: Structure;
1747
- if (typeof options === 'string') {
1748
- structure = (this.structures as Structure[]).find((item) => item.name === options);
1749
- if (!structure) {
1750
- throw new Error('找不到数据结构 ' + options);
1751
- }
1752
- } else {
1753
- structure = options;
1754
- }
1755
- return structure.delete();
1756
- }
1757
-
1758
- __removeStructure(structure: Structure) {
1759
- const parentKey = structure.parentKey;
1760
- const params: Params = {
1761
- parentNode: this,
1762
- parentKey,
1763
- index: -1,
1764
- object: null,
1765
- oldObject: structure,
1766
- };
1767
- if (parentKey) {
1768
- params.parentKey = parentKey;
1769
- // @ts-ignore
1770
- const t = this.__v_raw || this;
1771
- // @ts-ignore
1772
- const n = structure.__v_raw || structure;
1773
- if (Array.isArray((t as any)[parentKey])) {
1774
- // @ts-ignore
1775
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1776
- ~index && (this as any)[parentKey].splice(index, 1);
1777
- params.index = index;
1778
- } else {
1779
- const q = (t as any)[parentKey];
1780
- if ((q.__v_raw || q) === n) {
1781
- params.index = 0;
1782
- (this as any)[parentKey] = undefined;
1783
- }
1784
- }
1785
- }
1786
- return params;
1787
- }
1788
-
1789
- /**
1790
- * 删除命名空间
1791
- * @param name 命名空间名称
1792
- */
1793
- removeNamespace(name: string): void;
1794
-
1795
- /**
1796
- * 删除命名空间
1797
- * @param namespace 已有的命名空间实例
1798
- */
1799
- removeNamespace(namespace: Namespace): void;
1800
-
1801
- removeNamespace(options: string | Namespace) {
1802
- let namespace: Namespace;
1803
- if (typeof options === 'string') {
1804
- namespace = (this.namespaces as Namespace[]).find((item) => item.name === options);
1805
- if (!namespace) {
1806
- throw new Error('找不到命名空间 ' + options);
1807
- }
1808
- } else {
1809
- namespace = options;
1810
- }
1811
- return namespace.delete();
1812
- }
1813
-
1814
- __removeNamespace(namespace: Namespace) {
1815
- const parentKey = namespace.parentKey;
1816
- const params: Params = {
1817
- parentNode: this,
1818
- parentKey,
1819
- index: -1,
1820
- object: null,
1821
- oldObject: namespace,
1822
- };
1823
- if (parentKey) {
1824
- params.parentKey = parentKey;
1825
- // @ts-ignore
1826
- const t = this.__v_raw || this;
1827
- // @ts-ignore
1828
- const n = namespace.__v_raw || namespace;
1829
- if (Array.isArray((t as any)[parentKey])) {
1830
- // @ts-ignore
1831
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1832
- ~index && (this as any)[parentKey].splice(index, 1);
1833
- params.index = index;
1834
- } else {
1835
- const q = (t as any)[parentKey];
1836
- if ((q.__v_raw || q) === n) {
1837
- params.index = 0;
1838
- (this as any)[parentKey] = undefined;
1839
- }
1840
- }
1841
- }
1842
- return params;
1843
- }
1844
-
1845
- /**
1846
- * 删除触发器启动器
1847
- * @param name 触发器启动器名称
1848
- */
1849
- removeTriggerLauncher(name: string): void;
1850
-
1851
- /**
1852
- * 删除触发器启动器
1853
- * @param triggerLauncher 已有的触发器启动器实例
1854
- */
1855
- removeTriggerLauncher(triggerLauncher: TriggerLauncher): void;
1856
-
1857
- removeTriggerLauncher(options: string | TriggerLauncher) {
1858
- let triggerLauncher: TriggerLauncher;
1859
- if (typeof options === 'string') {
1860
- triggerLauncher = (this.triggerLaunchers as TriggerLauncher[]).find((item) => item.name === options);
1861
- if (!triggerLauncher) {
1862
- throw new Error('找不到触发器启动器 ' + options);
1863
- }
1864
- } else {
1865
- triggerLauncher = options;
1866
- }
1867
- return triggerLauncher.delete();
1868
- }
1869
-
1870
- __removeTriggerLauncher(triggerLauncher: TriggerLauncher) {
1871
- const parentKey = triggerLauncher.parentKey;
1872
- const params: Params = {
1873
- parentNode: this,
1874
- parentKey,
1875
- index: -1,
1876
- object: null,
1877
- oldObject: triggerLauncher,
1878
- };
1879
- if (parentKey) {
1880
- params.parentKey = parentKey;
1881
- // @ts-ignore
1882
- const t = this.__v_raw || this;
1883
- // @ts-ignore
1884
- const n = triggerLauncher.__v_raw || triggerLauncher;
1885
- if (Array.isArray((t as any)[parentKey])) {
1886
- // @ts-ignore
1887
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1888
- ~index && (this as any)[parentKey].splice(index, 1);
1889
- params.index = index;
1890
- } else {
1891
- const q = (t as any)[parentKey];
1892
- if ((q.__v_raw || q) === n) {
1893
- params.index = 0;
1894
- (this as any)[parentKey] = undefined;
1895
- }
1896
- }
1897
- }
1898
- return params;
1899
- }
1900
-
1901
- /**
1902
- * 删除连接
1903
- * @param name 连接名称
1904
- */
1905
- removeConnection(name: string): void;
1906
-
1907
- /**
1908
- * 删除连接
1909
- * @param connection 已有的连接实例
1910
- */
1911
- removeConnection(connection: Connection): void;
1912
-
1913
- removeConnection(options: string | Connection) {
1914
- let connection: Connection;
1915
- if (typeof options === 'string') {
1916
- connection = (this.connections as Connection[]).find((item) => item.name === options);
1917
- if (!connection) {
1918
- throw new Error('找不到连接 ' + options);
1919
- }
1920
- } else {
1921
- connection = options;
1922
- }
1923
- return connection.delete();
1924
- }
1925
-
1926
- __removeConnection(connection: Connection) {
1927
- const parentKey = connection.parentKey;
1928
- const params: Params = {
1929
- parentNode: this,
1930
- parentKey,
1931
- index: -1,
1932
- object: null,
1933
- oldObject: connection,
1934
- };
1935
- if (parentKey) {
1936
- params.parentKey = parentKey;
1937
- // @ts-ignore
1938
- const t = this.__v_raw || this;
1939
- // @ts-ignore
1940
- const n = connection.__v_raw || connection;
1941
- if (Array.isArray((t as any)[parentKey])) {
1942
- // @ts-ignore
1943
- const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
1944
- ~index && (this as any)[parentKey].splice(index, 1);
1945
- params.index = index;
1946
- } else {
1947
- const q = (t as any)[parentKey];
1948
- if ((q.__v_raw || q) === n) {
1949
- params.index = 0;
1950
- (this as any)[parentKey] = undefined;
1951
- }
1952
- }
1953
- }
1954
- return params;
1955
- }
1956
-
1957
- //================================================================================
1958
- // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1959
- // 自动生成的代码已结束。下面可以手动编写。
1960
- //================================================================================
1961
-
1962
- getActions() {
1963
- // 自定义连接器有分组的概念
1964
- if (this.connectorKind === 'app') {
1965
- return this.namespaces.map((namespace) => {
1966
- return {
1967
- title: namespace.title,
1968
- name: namespace.name,
1969
- expanded: true,
1970
- unselectable: true, // 自定义属性。用于标注当前选项是否可以被选择
1971
- children: namespace.logics,
1972
- };
1973
- });
1974
- }
1975
- return this.logics;
1976
- }
830
+ * @param authLogic 已有的鉴权逻辑实例
831
+ */
832
+ _addAuthLogic(authLogic: AuthLogic): AuthLogic;
1977
833
 
1978
- getNamespaceExistingTitles(excludedList: Array<Namespace> = []) {
1979
- const excludedSet = new Set(excludedList);
1980
- return ((this.namespaces as Namespace[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.title);
834
+ _addAuthLogic(options?: string | Partial<AuthLogic> | AuthLogic) {
835
+ const index = this.authLogics.length;
836
+ return this._insertAuthLogicAt(options as any, index);
1981
837
  }
1982
838
 
1983
- getNamespaceUniqueTitle(name = '分组1') {
1984
- return utils.unique(name, this.getNamespaceExistingTitles(), undefined, false);
839
+ /**
840
+ * 添加鉴权逻辑
841
+ * @internal
842
+ * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
843
+ */
844
+ addAuthLogic(name?: string): AuthLogic;
845
+
846
+ /**
847
+ * 添加鉴权逻辑
848
+ * @param authLogicOptions 鉴权逻辑参数
849
+ */
850
+ addAuthLogic(authLogicOptions: Partial<AuthLogic>): AuthLogic;
851
+
852
+ /**
853
+ * 添加鉴权逻辑
854
+ * @param authLogic 已有的鉴权逻辑实例
855
+ */
856
+ addAuthLogic(authLogic: AuthLogic): AuthLogic;
857
+
858
+ addAuthLogic(options?: string | Partial<AuthLogic> | AuthLogic) {
859
+ const node = this._addAuthLogic(options as any);
860
+ const index = this.authLogics.indexOf(node);
861
+ node.create({
862
+ index,
863
+ parentNode: this,
864
+ parentKey: 'authLogics',
865
+ });
866
+ return node;
1985
867
  }
1986
868
 
1987
- // ================ 为解决循环引用而将之前的自动生成代码移动到这里 START =================
1988
869
  getAuthLogicForCallInterfaceExistingNames(excludedList: Array<AuthLogicForCallInterface> = []) {
1989
870
  const excludedSet = new Set(excludedList);
1990
871
  return ((this.authLogicsForCallInterface as AuthLogicForCallInterface[]) || [])
1991
872
  .filter((item) => !excludedSet.has(item))
1992
873
  .map((item) => item.name);
1993
874
  }
1994
-
1995
875
  getAuthLogicForCallInterfaceUniqueName(name = 'authLogicForCallInterface1') {
1996
876
  return utils.unique(name, this.getAuthLogicForCallInterfaceExistingNames(), undefined, false);
1997
877
  }
@@ -2029,18 +909,39 @@ export class Connector extends Module {
2029
909
  ) {
2030
910
  const authLogicForCallInterfaceOptions: any = {};
2031
911
  const relationOptions = { parentNode: this, parentKey: 'authLogicsForCallInterface' };
912
+ const AuthLogicForCallInterface = getConceptConstructor('AuthLogicForCallInterface');
2032
913
  let authLogicForCallInterface: AuthLogicForCallInterface;
2033
914
  if (!options) {
2034
- throw Error('请先调用from方法创建AuthLogicForCallInterface实例');
915
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
916
+ {
917
+ ...authLogicForCallInterfaceOptions,
918
+ name: this.getAuthLogicForCallInterfaceUniqueName(),
919
+ },
920
+ this,
921
+ 'authLogicsForCallInterface',
922
+ );
2035
923
  } else if (typeof options === 'string') {
2036
- throw Error('请先调用from方法创建AuthLogicForCallInterface实例');
2037
- // FIXME : dont change
2038
- } else if (options.concept === 'AuthLogicForCallInterface') {
924
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
925
+ {
926
+ ...authLogicForCallInterfaceOptions,
927
+ name: options,
928
+ },
929
+ this,
930
+ 'authLogicsForCallInterface',
931
+ );
932
+ } else if (asserts.isAuthLogicForCallInterface(options)) {
2039
933
  options.ensureDelete(); // 同一实例不支持多处存在
2040
- authLogicForCallInterface = options as any;
934
+ authLogicForCallInterface = options;
2041
935
  Object.assign(authLogicForCallInterface, relationOptions);
2042
936
  } else {
2043
- throw Error('请先调用from方法创建AuthLogicForCallInterface实例');
937
+ authLogicForCallInterface = AuthLogicForCallInterface.from(
938
+ {
939
+ ...authLogicForCallInterfaceOptions,
940
+ ...options,
941
+ },
942
+ this,
943
+ 'authLogicsForCallInterface',
944
+ );
2044
945
  }
2045
946
  this.authLogicsForCallInterface.splice(index, 0, authLogicForCallInterface);
2046
947
  return authLogicForCallInterface;
@@ -2144,202 +1045,192 @@ export class Connector extends Module {
2144
1045
  }
2145
1046
 
2146
1047
  /**
2147
- * 删除调用接口的鉴权逻辑
2148
- * @param name 调用接口的鉴权逻辑名称
1048
+ * 删除输入参数
1049
+ * @param name 输入参数名称
2149
1050
  */
2150
- removeAuthLogicForCallInterface(name: string): void;
1051
+ removeParam(name: string): void;
2151
1052
 
2152
1053
  /**
2153
- * 删除调用接口的鉴权逻辑
2154
- * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
1054
+ * 删除输入参数
1055
+ * @param param 已有的输入参数实例
2155
1056
  */
2156
- removeAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): void;
1057
+ removeParam(param: Param): void;
2157
1058
 
2158
- removeAuthLogicForCallInterface(options: string | AuthLogicForCallInterface) {
2159
- let authLogicForCallInterface: AuthLogicForCallInterface;
1059
+ removeParam(options: string | Param) {
1060
+ let param: Param;
2160
1061
  if (typeof options === 'string') {
2161
- authLogicForCallInterface = (this.authLogicsForCallInterface as AuthLogicForCallInterface[]).find(
2162
- (item) => item.name === options,
2163
- );
2164
- if (!authLogicForCallInterface) {
2165
- throw new Error('找不到调用接口的鉴权逻辑 ' + options);
1062
+ param = (this.properties as Param[]).find((item) => item.name === options);
1063
+ if (!param) {
1064
+ throw new Error('找不到输入参数 ' + options);
2166
1065
  }
2167
1066
  } else {
2168
- authLogicForCallInterface = options;
1067
+ param = options;
2169
1068
  }
2170
- return authLogicForCallInterface.delete();
1069
+ return param.delete();
2171
1070
  }
2172
1071
 
2173
- __removeAuthLogic(authLogic: AuthLogic) {
2174
- const parentKey = authLogic.parentKey;
2175
- const params: Params = {
2176
- parentNode: this,
2177
- parentKey,
2178
- index: -1,
2179
- object: null,
2180
- oldObject: authLogic,
2181
- };
2182
- if (parentKey) {
2183
- params.parentKey = parentKey;
2184
- if (Array.isArray((this as any)[parentKey])) {
2185
- const index = (this as any)[parentKey].indexOf(authLogic);
2186
- ~index && (this as any)[parentKey].splice(index, 1);
2187
- params.index = index;
2188
- } else if ((this as any)[parentKey] === authLogic) {
2189
- params.index = 0;
2190
- (this as any)[parentKey] = undefined;
2191
- }
2192
- }
2193
- return params;
2194
- }
1072
+ /**
1073
+ * 删除连接器触发器
1074
+ * @param name 连接器触发器名称
1075
+ */
1076
+ removeConnectorTrigger(name: string): void;
2195
1077
 
2196
1078
  /**
2197
- * 插入鉴权逻辑
2198
- * @internal
2199
- * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
1079
+ * 删除连接器触发器
1080
+ * @param connectorTrigger 已有的连接器触发器实例
2200
1081
  */
2201
- _insertAuthLogicInAuthLogicsAt(name: string, index: number): AuthLogic;
1082
+ removeConnectorTrigger(connectorTrigger: ConnectorTrigger): void;
1083
+
1084
+ removeConnectorTrigger(options: string | ConnectorTrigger) {
1085
+ let connectorTrigger: ConnectorTrigger;
1086
+ if (typeof options === 'string') {
1087
+ connectorTrigger = (this.triggers as ConnectorTrigger[]).find((item) => item.name === options);
1088
+ if (!connectorTrigger) {
1089
+ throw new Error('找不到连接器触发器 ' + options);
1090
+ }
1091
+ } else {
1092
+ connectorTrigger = options;
1093
+ }
1094
+ return connectorTrigger.delete();
1095
+ }
2202
1096
 
2203
1097
  /**
2204
- * 插入鉴权逻辑
2205
- * @internal
2206
- * @param authLogicOptions 鉴权逻辑参数
1098
+ * 删除命名空间
1099
+ * @param name 命名空间名称
2207
1100
  */
2208
- _insertAuthLogicInAuthLogicsAt(authLogicOptions: Partial<AuthLogic>, index: number): AuthLogic;
1101
+ removeNamespace(name: string): void;
2209
1102
 
2210
1103
  /**
2211
- * 插入鉴权逻辑
2212
- * @internal
2213
- * @param authLogic 已有的鉴权逻辑实例
1104
+ * 删除命名空间
1105
+ * @param namespace 已有的命名空间实例
2214
1106
  */
2215
- _insertAuthLogicInAuthLogicsAt(authLogic: AuthLogic, index: number): AuthLogic;
1107
+ removeNamespace(namespace: Namespace): void;
2216
1108
 
2217
- _insertAuthLogicInAuthLogicsAt(options: string | Partial<AuthLogic> | AuthLogic, index: number) {
2218
- const relationOptions = { parentNode: this, parentKey: 'authLogics' };
2219
- let authLogic: AuthLogic;
2220
- if (!options) {
2221
- // authLogic = AuthLogic.from({
2222
- // ...authLogicOptions,
2223
- // name: this.getAuthLogicUniqueName(),
2224
- // }, this, 'authLogics');
2225
- throw Error('请先调用from方法');
2226
- } else if (typeof options === 'string') {
2227
- // authLogic = AuthLogic.from({
2228
- // ...authLogicOptions,
2229
- // name: options,
2230
- // }, this, 'authLogics');
2231
- // FIXME : dont change
2232
- throw Error('请先调用from方法');
2233
- } else if (options.concept === 'AuthLogic') {
2234
- options.ensureDelete(); // 同一实例不支持多处存在
2235
- authLogic = options as any;
2236
- Object.assign(authLogic, relationOptions);
1109
+ removeNamespace(options: string | Namespace) {
1110
+ let namespace: Namespace;
1111
+ if (typeof options === 'string') {
1112
+ namespace = (this.namespaces as Namespace[]).find((item) => item.name === options);
1113
+ if (!namespace) {
1114
+ throw new Error('找不到命名空间 ' + options);
1115
+ }
2237
1116
  } else {
2238
- // authLogic = AuthLogic.from({
2239
- // ...authLogicOptions,
2240
- // ...options,
2241
- // }, this, 'authLogics');
2242
- throw Error('请先调用from方法');
1117
+ namespace = options;
2243
1118
  }
2244
- this.authLogics.splice(index, 0, authLogic);
2245
- return authLogic;
1119
+ return namespace.delete();
2246
1120
  }
2247
1121
 
2248
1122
  /**
2249
- * 插入鉴权逻辑
2250
- * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
2251
- */
2252
- insertAuthLogicInAuthLogicsAt(name: string, index: number): AuthLogic;
2253
-
2254
- /**
2255
- * 插入鉴权逻辑
2256
- * @param authLogicOptions 鉴权逻辑参数
1123
+ * 删除鉴权逻辑
1124
+ * @param name 鉴权逻辑名称
2257
1125
  */
2258
- insertAuthLogicInAuthLogicsAt(authLogicOptions: Partial<AuthLogic>, index: number): AuthLogic;
1126
+ removeAuthLogic(name: string): void;
2259
1127
 
2260
1128
  /**
2261
- * 插入鉴权逻辑
1129
+ * 删除鉴权逻辑
2262
1130
  * @param authLogic 已有的鉴权逻辑实例
2263
1131
  */
2264
- insertAuthLogicInAuthLogicsAt(authLogic: AuthLogic, index: number): AuthLogic;
1132
+ removeAuthLogic(authLogic: AuthLogic): void;
2265
1133
 
2266
- insertAuthLogicInAuthLogicsAt(options: string | Partial<AuthLogic> | AuthLogic, index: number) {
2267
- const node = this._insertAuthLogicInAuthLogicsAt(options as any, index);
2268
- node.create({
2269
- index,
2270
- parentNode: this,
2271
- parentKey: 'authLogics',
2272
- });
2273
- return node;
1134
+ removeAuthLogic(options: string | AuthLogic) {
1135
+ let authLogic: AuthLogic;
1136
+ if (typeof options === 'string') {
1137
+ authLogic = (this.authLogics as AuthLogic[]).find((item) => item.name === options);
1138
+ if (!authLogic) {
1139
+ throw new Error('找不到鉴权逻辑 ' + options);
1140
+ }
1141
+ } else {
1142
+ authLogic = options;
1143
+ }
1144
+ return authLogic.delete();
2274
1145
  }
2275
1146
 
2276
1147
  /**
2277
- * 添加鉴权逻辑
2278
- * @internal
2279
- * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
1148
+ * 删除调用接口的鉴权逻辑
1149
+ * @param name 调用接口的鉴权逻辑名称
2280
1150
  */
2281
- _addAuthLogicInAuthLogics(name?: string): AuthLogic;
1151
+ removeAuthLogicForCallInterface(name: string): void;
2282
1152
 
2283
1153
  /**
2284
- * 添加鉴权逻辑
2285
- * @internal
2286
- * @param authLogicOptions 鉴权逻辑参数
1154
+ * 删除调用接口的鉴权逻辑
1155
+ * @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
2287
1156
  */
2288
- _addAuthLogicInAuthLogics(authLogicOptions: Partial<AuthLogic>): AuthLogic;
1157
+ removeAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): void;
1158
+
1159
+ removeAuthLogicForCallInterface(options: string | AuthLogicForCallInterface) {
1160
+ let authLogicForCallInterface: AuthLogicForCallInterface;
1161
+ if (typeof options === 'string') {
1162
+ authLogicForCallInterface = (this.authLogicsForCallInterface as AuthLogicForCallInterface[]).find(
1163
+ (item) => item.name === options,
1164
+ );
1165
+ if (!authLogicForCallInterface) {
1166
+ throw new Error('找不到调用接口的鉴权逻辑 ' + options);
1167
+ }
1168
+ } else {
1169
+ authLogicForCallInterface = options;
1170
+ }
1171
+ return authLogicForCallInterface.delete();
1172
+ }
2289
1173
 
1174
+ //================================================================================
1175
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1176
+ // 自动生成的代码已结束。下面可以手动编写。
1177
+ //================================================================================
2290
1178
  /**
2291
- * 添加鉴权逻辑
2292
- * @internal
2293
- * @param authLogic 已有的鉴权逻辑实例
1179
+ * 祖先 Module
2294
1180
  */
2295
- _addAuthLogicInAuthLogics(authLogic: AuthLogic): AuthLogic;
2296
-
2297
- _addAuthLogicInAuthLogics(options?: string | Partial<AuthLogic> | AuthLogic) {
2298
- const index = this.authLogics.length;
2299
- return this._insertAuthLogicInAuthLogicsAt(options as any, index);
1181
+ get module() {
1182
+ return this.getAncestor('Module') as Module;
2300
1183
  }
2301
-
2302
1184
  /**
2303
- * 添加鉴权逻辑
2304
- * @internal
2305
- * @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
1185
+ * 祖先 View
2306
1186
  */
2307
- addAuthLogicInAuthLogics(name?: string): AuthLogic;
2308
-
1187
+ get view() {
1188
+ return this.getAncestor('View') as View;
1189
+ }
2309
1190
  /**
2310
- * 添加鉴权逻辑
2311
- * @param authLogicOptions 鉴权逻辑参数
1191
+ * 祖先 Frontend
2312
1192
  */
2313
- addAuthLogicInAuthLogics(authLogicOptions: Partial<AuthLogic>): AuthLogic;
2314
-
1193
+ get frontend() {
1194
+ return this.getAncestor('Frontend') as Frontend;
1195
+ }
2315
1196
  /**
2316
- * 添加鉴权逻辑
2317
- * @param authLogic 已有的鉴权逻辑实例
1197
+ * 祖先 ProcessElement
1198
+ */
1199
+ get processElement() {
1200
+ return this.getAncestor('ProcessElement') as ProcessElement;
1201
+ }
1202
+ /**
1203
+ * 祖先 Process
2318
1204
  */
2319
- addAuthLogicInAuthLogics(authLogic: AuthLogic): AuthLogic;
1205
+ get process() {
1206
+ return this.getAncestor('Process') as Process;
1207
+ }
2320
1208
 
2321
- addAuthLogicInAuthLogics(options?: string | Partial<AuthLogic> | AuthLogic) {
2322
- const node = this._addAuthLogicInAuthLogics(options as any);
2323
- const index = this.authLogics.indexOf(node);
2324
- node.create({
2325
- index,
2326
- parentNode: this,
2327
- parentKey: 'authLogics',
2328
- });
2329
- return node;
1209
+ getActions() {
1210
+ // 自定义连接器有分组的概念
1211
+ if (this.connectorKind === 'app') {
1212
+ return this.namespaces.map((namespace) => {
1213
+ return {
1214
+ title: namespace.title,
1215
+ name: namespace.name,
1216
+ expanded: true,
1217
+ unselectable: true, // 自定义属性。用于标注当前选项是否可以被选择
1218
+ children: namespace.logics,
1219
+ };
1220
+ });
1221
+ }
1222
+ return this.logics;
2330
1223
  }
2331
1224
 
2332
- getAuthLogicExistingNames(excludedList: Array<AuthLogic> = []) {
1225
+ getNamespaceExistingTitles(excludedList: Array<Namespace> = []) {
2333
1226
  const excludedSet = new Set(excludedList);
2334
- return ((this.authLogics as AuthLogic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1227
+ return ((this.namespaces as Namespace[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.title);
2335
1228
  }
2336
1229
 
2337
- getAuthLogicUniqueName(name = 'authentication1') {
2338
- return utils.unique(name, this.getAuthLogicExistingNames(), undefined, true);
1230
+ getNamespaceUniqueTitle(name = '分组1') {
1231
+ return utils.unique(name, this.getNamespaceExistingTitles(), undefined, false);
2339
1232
  }
2340
1233
 
2341
- // ================ 为解决循环引用而将之前的自动生成代码移动到这里 END =================
2342
-
2343
1234
  //================================================================================
2344
1235
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
2345
1236
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓