@lcap/nasl 3.4.0-alpha.2 → 3.4.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 (296) hide show
  1. package/out/common/BaseNode.d.ts +14 -11
  2. package/out/common/BaseNode.js +72 -52
  3. package/out/common/BaseNode.js.map +1 -1
  4. package/out/concepts/Anchor__.js +3 -1
  5. package/out/concepts/Anchor__.js.map +1 -1
  6. package/out/concepts/AnonymousFunction__.js +10 -3
  7. package/out/concepts/AnonymousFunction__.js.map +1 -1
  8. package/out/concepts/App__.js +69 -18
  9. package/out/concepts/App__.js.map +1 -1
  10. package/out/concepts/Argument__.js +3 -1
  11. package/out/concepts/Argument__.js.map +1 -1
  12. package/out/concepts/Assignee__.js +18 -5
  13. package/out/concepts/Assignee__.js.map +1 -1
  14. package/out/concepts/AssignmentLine__.js +6 -2
  15. package/out/concepts/AssignmentLine__.js.map +1 -1
  16. package/out/concepts/Assignment__.js +6 -2
  17. package/out/concepts/Assignment__.js.map +1 -1
  18. package/out/concepts/Attribute__.js +3 -1
  19. package/out/concepts/Attribute__.js.map +1 -1
  20. package/out/concepts/AuthLogicForCallInterface__.js +4 -1
  21. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  22. package/out/concepts/AuthLogic__.js.map +1 -1
  23. package/out/concepts/BackendVariable__.js +3 -1
  24. package/out/concepts/BackendVariable__.js.map +1 -1
  25. package/out/concepts/Backend__.js +4 -1
  26. package/out/concepts/Backend__.js.map +1 -1
  27. package/out/concepts/BatchAssignment__.js +11 -3
  28. package/out/concepts/BatchAssignment__.js.map +1 -1
  29. package/out/concepts/BinaryExpression__.js +6 -2
  30. package/out/concepts/BinaryExpression__.js.map +1 -1
  31. package/out/concepts/BindAttribute__.js +20 -6
  32. package/out/concepts/BindAttribute__.js.map +1 -1
  33. package/out/concepts/BindDirective__.js +7 -2
  34. package/out/concepts/BindDirective__.js.map +1 -1
  35. package/out/concepts/BindEvent__.js +8 -2
  36. package/out/concepts/BindEvent__.js.map +1 -1
  37. package/out/concepts/BindStyle__.js +7 -2
  38. package/out/concepts/BindStyle__.js.map +1 -1
  39. package/out/concepts/CallAuthInterface__.js +4 -1
  40. package/out/concepts/CallAuthInterface__.js.map +1 -1
  41. package/out/concepts/CallFunction__.js +8 -2
  42. package/out/concepts/CallFunction__.js.map +1 -1
  43. package/out/concepts/CallInterface__.d.ts +2 -1
  44. package/out/concepts/CallInterface__.js +51 -13
  45. package/out/concepts/CallInterface__.js.map +1 -1
  46. package/out/concepts/CallLogic__.js +11 -3
  47. package/out/concepts/CallLogic__.js.map +1 -1
  48. package/out/concepts/CallQueryComponent__.js +34 -10
  49. package/out/concepts/CallQueryComponent__.js.map +1 -1
  50. package/out/concepts/CompletionProperty__.js +3 -1
  51. package/out/concepts/CompletionProperty__.js.map +1 -1
  52. package/out/concepts/ConfigGroup__.js +4 -1
  53. package/out/concepts/ConfigGroup__.js.map +1 -1
  54. package/out/concepts/ConfigProperty__.js +4 -1
  55. package/out/concepts/ConfigProperty__.js.map +1 -1
  56. package/out/concepts/Configuration__.js +4 -1
  57. package/out/concepts/Configuration__.js.map +1 -1
  58. package/out/concepts/Connection__.js +4 -1
  59. package/out/concepts/Connection__.js.map +1 -1
  60. package/out/concepts/Connector__.js +26 -7
  61. package/out/concepts/Connector__.js.map +1 -1
  62. package/out/concepts/Constant__.js +3 -1
  63. package/out/concepts/Constant__.js.map +1 -1
  64. package/out/concepts/DataSource__.js +4 -1
  65. package/out/concepts/DataSource__.js.map +1 -1
  66. package/out/concepts/Destination__.js +7 -2
  67. package/out/concepts/Destination__.js.map +1 -1
  68. package/out/concepts/EntityIndex__.js +3 -1
  69. package/out/concepts/EntityIndex__.js.map +1 -1
  70. package/out/concepts/EntityProperty__.js +9 -3
  71. package/out/concepts/EntityProperty__.js.map +1 -1
  72. package/out/concepts/Entity__.js +8 -2
  73. package/out/concepts/Entity__.js.map +1 -1
  74. package/out/concepts/Enum__.js +4 -1
  75. package/out/concepts/Enum__.js.map +1 -1
  76. package/out/concepts/Event__.js +4 -1
  77. package/out/concepts/Event__.js.map +1 -1
  78. package/out/concepts/ExternalDestination__.js +6 -2
  79. package/out/concepts/ExternalDestination__.js.map +1 -1
  80. package/out/concepts/ForEachStatement__.js +19 -6
  81. package/out/concepts/ForEachStatement__.js.map +1 -1
  82. package/out/concepts/FrontendLibrary__.js +8 -2
  83. package/out/concepts/FrontendLibrary__.js.map +1 -1
  84. package/out/concepts/Frontend__.js +19 -5
  85. package/out/concepts/Frontend__.js.map +1 -1
  86. package/out/concepts/Function__.js +19 -5
  87. package/out/concepts/Function__.js.map +1 -1
  88. package/out/concepts/IfStatement__.js +11 -3
  89. package/out/concepts/IfStatement__.js.map +1 -1
  90. package/out/concepts/Integration__.js +7 -2
  91. package/out/concepts/Integration__.js.map +1 -1
  92. package/out/concepts/InterfaceParam__.js +3 -1
  93. package/out/concepts/InterfaceParam__.js.map +1 -1
  94. package/out/concepts/Interface__.js +11 -3
  95. package/out/concepts/Interface__.js.map +1 -1
  96. package/out/concepts/Logic__.js +46 -46
  97. package/out/concepts/Logic__.js.map +1 -1
  98. package/out/concepts/MatchCase__.js +8 -2
  99. package/out/concepts/MatchCase__.js.map +1 -1
  100. package/out/concepts/Match__.js +7 -2
  101. package/out/concepts/Match__.js.map +1 -1
  102. package/out/concepts/MemberExpression__.js +6 -2
  103. package/out/concepts/MemberExpression__.js.map +1 -1
  104. package/out/concepts/Module__.js +55 -14
  105. package/out/concepts/Module__.js.map +1 -1
  106. package/out/concepts/MsgTriggerEvent__.js +4 -1
  107. package/out/concepts/MsgTriggerEvent__.js.map +1 -1
  108. package/out/concepts/MsgTriggerLauncher__.js +4 -1
  109. package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
  110. package/out/concepts/Namespace__.js +48 -12
  111. package/out/concepts/Namespace__.js.map +1 -1
  112. package/out/concepts/NewComposite__.js +15 -4
  113. package/out/concepts/NewComposite__.js.map +1 -1
  114. package/out/concepts/NewList__.js +7 -2
  115. package/out/concepts/NewList__.js.map +1 -1
  116. package/out/concepts/NewMap__.js +11 -3
  117. package/out/concepts/NewMap__.js.map +1 -1
  118. package/out/concepts/NumericLiteral__.js +3 -1
  119. package/out/concepts/NumericLiteral__.js.map +1 -1
  120. package/out/concepts/OqlQueryComponent__.js +3 -1
  121. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  122. package/out/concepts/OverriddenLogic__.js +28 -8
  123. package/out/concepts/OverriddenLogic__.js.map +1 -1
  124. package/out/concepts/Param__.js +3 -1
  125. package/out/concepts/Param__.js.map +1 -1
  126. package/out/concepts/ProcessComponent__.js +8 -2
  127. package/out/concepts/ProcessComponent__.js.map +1 -1
  128. package/out/concepts/ProcessElement__.js +30 -8
  129. package/out/concepts/ProcessElement__.js.map +1 -1
  130. package/out/concepts/ProcessOutcomes__.js +3 -1
  131. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  132. package/out/concepts/Process__.js +20 -5
  133. package/out/concepts/Process__.js.map +1 -1
  134. package/out/concepts/QueryAggregateExpression__.js +3 -1
  135. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  136. package/out/concepts/QueryFromExpression__.js +4 -1
  137. package/out/concepts/QueryFromExpression__.js.map +1 -1
  138. package/out/concepts/QueryGroupByExpression__.js +3 -1
  139. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  140. package/out/concepts/QueryJoinExpression__.js +8 -2
  141. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  142. package/out/concepts/QueryLimitExpression__.js +6 -2
  143. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  144. package/out/concepts/QueryOrderByExpression__.js +6 -2
  145. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  146. package/out/concepts/QuerySelectExpression__.js +4 -1
  147. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  148. package/out/concepts/Return__.js +3 -1
  149. package/out/concepts/Return__.js.map +1 -1
  150. package/out/concepts/SelectMembers__.js +7 -2
  151. package/out/concepts/SelectMembers__.js.map +1 -1
  152. package/out/concepts/Slot__.js +3 -1
  153. package/out/concepts/Slot__.js.map +1 -1
  154. package/out/concepts/SqlQueryComponent__.js +3 -1
  155. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  156. package/out/concepts/StringInterpolation__.js +4 -1
  157. package/out/concepts/StringInterpolation__.js.map +1 -1
  158. package/out/concepts/StructureProperty__.js +3 -1
  159. package/out/concepts/StructureProperty__.js.map +1 -1
  160. package/out/concepts/Structure__.js +8 -2
  161. package/out/concepts/Structure__.js.map +1 -1
  162. package/out/concepts/SwitchCase__.js +7 -2
  163. package/out/concepts/SwitchCase__.js.map +1 -1
  164. package/out/concepts/SwitchStatement__.js +4 -1
  165. package/out/concepts/SwitchStatement__.js.map +1 -1
  166. package/out/concepts/TriggerEvent__.js +4 -1
  167. package/out/concepts/TriggerEvent__.js.map +1 -1
  168. package/out/concepts/TypeAnnotation__.js +12 -3
  169. package/out/concepts/TypeAnnotation__.js.map +1 -1
  170. package/out/concepts/UnaryExpression__.js +3 -1
  171. package/out/concepts/UnaryExpression__.js.map +1 -1
  172. package/out/concepts/ValidationRule__.js +10 -3
  173. package/out/concepts/ValidationRule__.js.map +1 -1
  174. package/out/concepts/Variable__.js +3 -1
  175. package/out/concepts/Variable__.js.map +1 -1
  176. package/out/concepts/ViewComponent__.js +24 -6
  177. package/out/concepts/ViewComponent__.js.map +1 -1
  178. package/out/concepts/ViewElement__.js +24 -7
  179. package/out/concepts/ViewElement__.js.map +1 -1
  180. package/out/concepts/View__.js +27 -7
  181. package/out/concepts/View__.js.map +1 -1
  182. package/out/concepts/WhileStatement__.js +7 -2
  183. package/out/concepts/WhileStatement__.js.map +1 -1
  184. package/out/concepts/types__.d.ts +2 -3
  185. package/out/decorators/index.d.ts +3 -3
  186. package/out/decorators/index.js +3 -1
  187. package/out/decorators/index.js.map +1 -1
  188. package/out/natural/genNaturalTS.js +1 -1
  189. package/out/natural/genNaturalTS.js.map +1 -1
  190. package/out/server/formatTsUtils.d.ts +3 -3
  191. package/out/server/getMemberIdentifier.d.ts +4 -4
  192. package/out/server/naslServer.d.ts +1 -1
  193. package/out/server/naslServer.js +4 -2
  194. package/out/server/naslServer.js.map +1 -1
  195. package/out/translator/utils.js +24 -28
  196. package/out/translator/utils.js.map +1 -1
  197. package/package.json +1 -1
  198. package/src/common/BaseNode.ts +92 -68
  199. package/src/concepts/Anchor__.ts +3 -1
  200. package/src/concepts/AnonymousFunction__.ts +10 -3
  201. package/src/concepts/App__.ts +69 -18
  202. package/src/concepts/Argument__.ts +3 -1
  203. package/src/concepts/Assignee__.ts +18 -5
  204. package/src/concepts/AssignmentLine__.ts +6 -2
  205. package/src/concepts/Assignment__.ts +6 -2
  206. package/src/concepts/Attribute__.ts +3 -1
  207. package/src/concepts/AuthLogicForCallInterface__.ts +4 -1
  208. package/src/concepts/AuthLogic__.ts +3 -0
  209. package/src/concepts/BackendVariable__.ts +3 -1
  210. package/src/concepts/Backend__.ts +4 -1
  211. package/src/concepts/BatchAssignment__.ts +11 -3
  212. package/src/concepts/BinaryExpression__.ts +6 -2
  213. package/src/concepts/BindAttribute__.ts +20 -7
  214. package/src/concepts/BindDirective__.ts +7 -2
  215. package/src/concepts/BindEvent__.ts +8 -2
  216. package/src/concepts/BindStyle__.ts +7 -2
  217. package/src/concepts/CallAuthInterface__.ts +4 -1
  218. package/src/concepts/CallFunction__.ts +8 -2
  219. package/src/concepts/CallInterface__.ts +49 -14
  220. package/src/concepts/CallLogic__.ts +11 -3
  221. package/src/concepts/CallQueryComponent__.ts +34 -10
  222. package/src/concepts/CompletionProperty__.ts +3 -1
  223. package/src/concepts/ConfigGroup__.ts +4 -1
  224. package/src/concepts/ConfigProperty__.ts +4 -1
  225. package/src/concepts/Configuration__.ts +4 -1
  226. package/src/concepts/Connection__.ts +4 -1
  227. package/src/concepts/Connector__.ts +26 -7
  228. package/src/concepts/Constant__.ts +3 -1
  229. package/src/concepts/DataSource__.ts +4 -1
  230. package/src/concepts/Destination__.ts +7 -2
  231. package/src/concepts/EntityIndex__.ts +3 -1
  232. package/src/concepts/EntityProperty__.ts +9 -3
  233. package/src/concepts/Entity__.ts +8 -2
  234. package/src/concepts/Enum__.ts +4 -1
  235. package/src/concepts/Event__.ts +4 -1
  236. package/src/concepts/ExternalDestination__.ts +6 -2
  237. package/src/concepts/ForEachStatement__.ts +19 -6
  238. package/src/concepts/FrontendLibrary__.ts +8 -2
  239. package/src/concepts/Frontend__.ts +19 -5
  240. package/src/concepts/Function__.ts +19 -5
  241. package/src/concepts/IfStatement__.ts +11 -3
  242. package/src/concepts/Integration__.ts +7 -2
  243. package/src/concepts/InterfaceParam__.ts +3 -1
  244. package/src/concepts/Interface__.ts +11 -3
  245. package/src/concepts/Logic__.ts +62 -57
  246. package/src/concepts/MatchCase__.ts +8 -2
  247. package/src/concepts/Match__.ts +7 -2
  248. package/src/concepts/MemberExpression__.ts +6 -2
  249. package/src/concepts/Module__.ts +55 -14
  250. package/src/concepts/MsgTriggerEvent__.ts +4 -1
  251. package/src/concepts/MsgTriggerLauncher__.ts +4 -1
  252. package/src/concepts/Namespace__.ts +48 -12
  253. package/src/concepts/NewComposite__.ts +15 -4
  254. package/src/concepts/NewList__.ts +7 -2
  255. package/src/concepts/NewMap__.ts +11 -3
  256. package/src/concepts/NumericLiteral__.ts +3 -1
  257. package/src/concepts/OqlQueryComponent__.ts +3 -1
  258. package/src/concepts/OverriddenLogic__.ts +28 -8
  259. package/src/concepts/Param__.ts +3 -1
  260. package/src/concepts/ProcessComponent__.ts +8 -2
  261. package/src/concepts/ProcessElement__.ts +30 -8
  262. package/src/concepts/ProcessOutcomes__.ts +3 -1
  263. package/src/concepts/Process__.ts +20 -5
  264. package/src/concepts/QueryAggregateExpression__.ts +3 -1
  265. package/src/concepts/QueryFromExpression__.ts +4 -1
  266. package/src/concepts/QueryGroupByExpression__.ts +3 -1
  267. package/src/concepts/QueryJoinExpression__.ts +8 -2
  268. package/src/concepts/QueryLimitExpression__.ts +6 -2
  269. package/src/concepts/QueryOrderByExpression__.ts +6 -2
  270. package/src/concepts/QuerySelectExpression__.ts +4 -1
  271. package/src/concepts/Return__.ts +3 -1
  272. package/src/concepts/SelectMembers__.ts +7 -2
  273. package/src/concepts/Slot__.ts +3 -1
  274. package/src/concepts/SqlQueryComponent__.ts +3 -1
  275. package/src/concepts/StringInterpolation__.ts +4 -1
  276. package/src/concepts/StructureProperty__.ts +3 -1
  277. package/src/concepts/Structure__.ts +8 -2
  278. package/src/concepts/SwitchCase__.ts +7 -2
  279. package/src/concepts/SwitchStatement__.ts +4 -1
  280. package/src/concepts/TriggerEvent__.ts +4 -1
  281. package/src/concepts/TypeAnnotation__.ts +13 -4
  282. package/src/concepts/UnaryExpression__.ts +3 -1
  283. package/src/concepts/ValidationRule__.ts +10 -3
  284. package/src/concepts/Variable__.ts +3 -1
  285. package/src/concepts/ViewComponent__.ts +24 -6
  286. package/src/concepts/ViewElement__.ts +92 -72
  287. package/src/concepts/View__.ts +27 -7
  288. package/src/concepts/WhileStatement__.ts +7 -2
  289. package/src/concepts/types__.ts +2 -4
  290. package/src/decorators/index.ts +7 -5
  291. package/src/natural/genNaturalTS.ts +1 -1
  292. package/src/server/formatTsUtils.ts +8 -8
  293. package/src/server/getMemberIdentifier.ts +4 -4
  294. package/src/server/naslServer.ts +4 -4
  295. package/src/service/storage/init.ts +2 -2
  296. package/src/translator/utils.ts +7 -9
@@ -29,13 +29,17 @@ export class AssignmentLine extends BaseNode {
29
29
  /**
30
30
  * 左侧索引
31
31
  */
32
- @property()
32
+ @property({
33
+ isArray: true,
34
+ })
33
35
  leftIndex: Array<number> = [];
34
36
 
35
37
  /**
36
38
  * 右侧索引
37
39
  */
38
- @property()
40
+ @property({
41
+ isArray: true,
42
+ })
39
43
  rightIndex: Array<number> = [];
40
44
 
41
45
  /**
@@ -43,14 +43,18 @@ export class Assignment extends LogicItem {
43
43
  /**
44
44
  * 左边项
45
45
  */
46
- @property('LogicItem')
46
+ @property({
47
+ objectRef: 'LogicItem',
48
+ })
47
49
  // @ts-ignore
48
50
  left!: LogicItem;
49
51
 
50
52
  /**
51
53
  * 右边项
52
54
  */
53
- @property('LogicItem')
55
+ @property({
56
+ objectRef: 'LogicItem',
57
+ })
54
58
  // @ts-ignore
55
59
  right!: LogicItem;
56
60
 
@@ -60,7 +60,9 @@ export class Attribute extends BaseNode {
60
60
  /**
61
61
  * 类型
62
62
  */
63
- @property('TypeAnnotation')
63
+ @property({
64
+ objectRef: 'TypeAnnotation',
65
+ })
64
66
  // @ts-ignore
65
67
  typeAnnotation!: TypeAnnotation;
66
68
 
@@ -49,7 +49,10 @@ export class AuthLogicForCallInterface extends AuthLogic {
49
49
  /**
50
50
  * 鉴权配置参数, 调用接口鉴权独有
51
51
  */
52
- @property('Param')
52
+ @property({
53
+ objectRef: 'Param',
54
+ isArray: true,
55
+ })
53
56
  authParams: Array<Param> = [];
54
57
 
55
58
  /**
@@ -5,6 +5,9 @@
5
5
  import { EventPayload, Params } from '../common/EventEmitter';
6
6
  import { concept, excludedInJSON, property, className } from '../decorators';
7
7
 
8
+ import * as utils from '../utils';
9
+ import { v4 as uuidv4 } from 'uuid';
10
+ import BaseNode from '../common/BaseNode';
8
11
  import Module from './Module__';
9
12
  import View from './View__';
10
13
  import ProcessElement from './ProcessElement__';
@@ -65,7 +65,9 @@ export class BackendVariable extends BaseNode {
65
65
  /**
66
66
  * 类型
67
67
  */
68
- @property('TypeAnnotation')
68
+ @property({
69
+ objectRef: 'TypeAnnotation',
70
+ })
69
71
  // @ts-ignore
70
72
  typeAnnotation!: TypeAnnotation;
71
73
 
@@ -40,7 +40,10 @@ export class Backend extends BaseNode {
40
40
  /**
41
41
  * 后端全局变量列表
42
42
  */
43
- @property('BackendVariable')
43
+ @property({
44
+ objectRef: 'BackendVariable',
45
+ isArray: true,
46
+ })
44
47
  variables: Array<BackendVariable> = [];
45
48
 
46
49
  /**
@@ -42,20 +42,28 @@ export class BatchAssignment extends LogicItem {
42
42
  /**
43
43
  * 左边项
44
44
  */
45
- @property('SelectMembers')
45
+ @property({
46
+ objectRef: 'SelectMembers',
47
+ })
46
48
  // @ts-ignore
47
49
  left!: SelectMembers;
48
50
 
49
51
  /**
50
52
  * 右边项
51
53
  */
52
- @property('SelectMembers')
54
+ @property({
55
+ objectRef: 'SelectMembers',
56
+ isArray: true,
57
+ })
53
58
  rights: Array<SelectMembers> = [];
54
59
 
55
60
  /**
56
61
  * 赋值
57
62
  */
58
- @property('AssignmentLine')
63
+ @property({
64
+ objectRef: 'AssignmentLine',
65
+ isArray: true,
66
+ })
59
67
  assignmentLines: Array<AssignmentLine> = [];
60
68
 
61
69
  /**
@@ -48,14 +48,18 @@ export class BinaryExpression extends LogicItem {
48
48
  /**
49
49
  * 左边项
50
50
  */
51
- @property('LogicItem')
51
+ @property({
52
+ objectRef: 'LogicItem',
53
+ })
52
54
  // @ts-ignore
53
55
  left!: LogicItem;
54
56
 
55
57
  /**
56
58
  * 右边项
57
59
  */
58
- @property('LogicItem')
60
+ @property({
61
+ objectRef: 'LogicItem',
62
+ })
59
63
  // @ts-ignore
60
64
  right!: LogicItem;
61
65
 
@@ -25,7 +25,6 @@ import Module from './Module__';
25
25
  import App from './App__';
26
26
  import Frontend from './Frontend__';
27
27
  import Process from './Process__';
28
- import Identifier from './Identifier__';
29
28
 
30
29
  /**
31
30
  * 元素绑定属性
@@ -67,34 +66,45 @@ export class BindAttribute extends BaseNode {
67
66
  /**
68
67
  * 属性表达式
69
68
  */
70
- @property('LogicItem')
69
+ @property({
70
+ objectRef: 'LogicItem',
71
+ })
71
72
  // @ts-ignore
72
73
  expression!: LogicItem;
73
74
 
74
75
  /**
75
76
  * 跳转页面
76
77
  */
77
- @property('Destination')
78
+ @property({
79
+ objectRef: 'Destination',
80
+ })
78
81
  // @ts-ignore
79
82
  destination!: Destination;
80
83
 
81
84
  /**
82
85
  * 跳转页面
83
86
  */
84
- @property('ExternalDestination')
87
+ @property({
88
+ objectRef: 'ExternalDestination',
89
+ })
85
90
  // @ts-ignore
86
91
  externalDestination!: ExternalDestination;
87
92
 
88
93
  /**
89
94
  * 验证规则
90
95
  */
91
- @property('ValidationRule')
96
+ @property({
97
+ objectRef: 'ValidationRule',
98
+ isArray: true,
99
+ })
92
100
  rules: Array<ValidationRule> = [];
93
101
 
94
102
  /**
95
103
  * 经办人
96
104
  */
97
- @property('Assignee')
105
+ @property({
106
+ objectRef: 'Assignee',
107
+ })
98
108
  // @ts-ignore
99
109
  assignee!: Assignee;
100
110
 
@@ -115,7 +125,10 @@ export class BindAttribute extends BaseNode {
115
125
  /**
116
126
  * 草稿态
117
127
  */
118
- @property('LogicItem')
128
+ @property({
129
+ objectRef: 'LogicItem',
130
+ isArray: true,
131
+ })
119
132
  playground: Array<LogicItem> = [];
120
133
 
121
134
  /**
@@ -65,7 +65,9 @@ export class BindDirective extends BaseNode {
65
65
  /**
66
66
  * 属性表达式
67
67
  */
68
- @property('LogicItem')
68
+ @property({
69
+ objectRef: 'LogicItem',
70
+ })
69
71
  // @ts-ignore
70
72
  expression!: LogicItem;
71
73
 
@@ -86,7 +88,10 @@ export class BindDirective extends BaseNode {
86
88
  /**
87
89
  * 草稿态
88
90
  */
89
- @property('LogicItem')
91
+ @property({
92
+ objectRef: 'LogicItem',
93
+ isArray: true,
94
+ })
90
95
  playground: Array<LogicItem> = [];
91
96
 
92
97
  /**
@@ -51,7 +51,10 @@ export class BindEvent extends BaseNode {
51
51
  /**
52
52
  * 逻辑列表
53
53
  */
54
- @property('Logic')
54
+ @property({
55
+ objectRef: 'Logic',
56
+ isArray: true,
57
+ })
55
58
  logics: Array<Logic> = [];
56
59
 
57
60
  /**
@@ -71,7 +74,10 @@ export class BindEvent extends BaseNode {
71
74
  /**
72
75
  * 实际参数
73
76
  */
74
- @property('Argument')
77
+ @property({
78
+ objectRef: 'Argument',
79
+ isArray: true,
80
+ })
75
81
  arguments: Array<Argument> = [];
76
82
 
77
83
  /**
@@ -44,14 +44,19 @@ export class BindStyle extends BaseNode {
44
44
  /**
45
45
  * 属性表达式
46
46
  */
47
- @property('LogicItem')
47
+ @property({
48
+ objectRef: 'LogicItem',
49
+ })
48
50
  // @ts-ignore
49
51
  expression!: LogicItem;
50
52
 
51
53
  /**
52
54
  * 草稿态
53
55
  */
54
- @property('LogicItem')
56
+ @property({
57
+ objectRef: 'LogicItem',
58
+ isArray: true,
59
+ })
55
60
  playground: Array<LogicItem> = [];
56
61
 
57
62
  /**
@@ -36,7 +36,10 @@ export class CallAuthInterface extends CallInterface {
36
36
  /**
37
37
  * 鉴权逻辑所需参数
38
38
  */
39
- @property('Argument')
39
+ @property({
40
+ objectRef: 'Argument',
41
+ isArray: true,
42
+ })
40
43
  authArguments: Array<Argument> = [];
41
44
 
42
45
  /**
@@ -67,13 +67,19 @@ export class CallFunction extends LogicItem {
67
67
  /**
68
68
  * 类型参数
69
69
  */
70
- @property('TypeAnnotation')
70
+ @property({
71
+ objectRef: 'TypeAnnotation',
72
+ isArray: true,
73
+ })
71
74
  typeArguments?: Array<TypeAnnotation> = null;
72
75
 
73
76
  /**
74
77
  * 实际参数
75
78
  */
76
- @property('Argument')
79
+ @property({
80
+ objectRef: 'Argument',
81
+ isArray: true,
82
+ })
77
83
  arguments: Array<Argument> = [];
78
84
 
79
85
  /**
@@ -8,6 +8,7 @@ import Module from './Module__';
8
8
  import AuthInterface from './AuthInterface__';
9
9
  import type { MemberExpression } from './MemberExpression__';
10
10
  import Frontend from './Frontend__';
11
+ import type Connector from './Connector__';
11
12
  //================================================================================
12
13
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
13
14
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -67,7 +68,10 @@ export class CallInterface extends LogicItem {
67
68
  /**
68
69
  * 实际参数
69
70
  */
70
- @property('Argument')
71
+ @property({
72
+ objectRef: 'Argument',
73
+ isArray: true,
74
+ })
71
75
  arguments: Array<Argument> = [];
72
76
 
73
77
  /**
@@ -329,8 +333,20 @@ export class CallInterface extends LogicItem {
329
333
  toJS(state?: TranslatorState): string {
330
334
  const { calleewholeKey, app, completeArguments } = this;
331
335
  const [, _name, , _interfaceName] = calleewholeKey.split('.');
332
- const _module = app?.interfaceDependencies?.find?.((item) => item.name === _name);
333
- const _interface = _module?.interfaces?.find?.((item) => item.name === _interfaceName);
336
+ let _module: Module | Connector;
337
+ // 由于自定义连接器的引入,目前在 集成中心下也存在着一部分接口
338
+ // 因此,需要额外判断,如果是自定义连接器需要拿 app.dependencies 中的接口或者 app.integration 中connector下面的接口
339
+ const isCustomConnector = this.getAncestor('Connector');
340
+ const isInIntegration = this.getAncestor('Integration');
341
+ if (isCustomConnector && isInIntegration) {
342
+ _module = app?.integration?.connectors?.find?.((item) => item.name === _name);
343
+ } else if (isCustomConnector && !isInIntegration) {
344
+ _module = app?.dependencies?.find?.((item) => item.name === _name);
345
+ } else {
346
+ // default
347
+ _module = app?.interfaceDependencies?.find?.((item) => item.name === _name);
348
+ }
349
+ const _interface = (_module as Module)?.interfaces?.find?.((item) => item.name === _interfaceName);
334
350
  if (!_interface) {
335
351
  if (!this.calleeNamespace || !this.calleeName) throw new Error('调用接口为空');
336
352
  throw new Error(`${_name}下的${_interfaceName}接口未找到`);
@@ -594,17 +610,24 @@ export class CallInterface extends LogicItem {
594
610
  setCallee(_interface: Interface) {
595
611
  const calleeNamespace = _interface.getNamespace();
596
612
  const calleeName = _interface.name;
597
- const params = this.arguments.map((argumentNode) => {
598
- const newParam = _interface.params.find((item) => item.name === argumentNode.keyword)
599
- if (newParam) {
600
- const argument = Argument.from({
601
- keyword: newParam.name,
602
- expression: argumentNode.expression
603
- }, this, 'arguments');
604
- return argument;
613
+ const params = _interface.params.map((param) => {
614
+ const oldArgument = this.arguments.find((node) => node.keyword === param.name)
615
+ return Argument.from({
616
+ keyword: param.name,
617
+ expression: oldArgument ? oldArgument.expression : undefined
618
+ }, this, 'arguments');
619
+ });
620
+ const oldArguments = this.arguments.reduce((res, argumentNode) => {
621
+ const targetParam = _interface.params.find((item) => item.name === argumentNode.keyword)
622
+ if (!targetParam) {
623
+ res.push(Argument.from({
624
+ keyword: argumentNode.keyword,
625
+ expression: argumentNode ? argumentNode.expression : undefined
626
+ }, this, 'arguments'))
605
627
  }
606
- return argumentNode
607
- })
628
+ return res
629
+ }, [])
630
+ params.push(...oldArguments)
608
631
 
609
632
  if (this.app) {
610
633
  this.app.emit('collect:start', {
@@ -695,7 +718,19 @@ export class CallInterface extends LogicItem {
695
718
  const _arr = this.calleewholeKey.split('.');
696
719
  const _name = _arr[1];
697
720
  const _interfaceName = _arr[3];
698
- const _module = this.app.interfaceDependencies.find((item) => item.name === _name);
721
+ let _module: Module | Connector;
722
+ // 由于自定义连接器的引入,目前在 集成中心下也存在着一部分接口
723
+ // 因此,需要额外判断,如果是自定义连接器需要拿 app.dependencies 中的接口或者 app.integration 中connector下面的接口
724
+ const isCustomConnector = this.getAncestor('Connector');
725
+ const isInIntegration = this.getAncestor('Integration');
726
+ if (isCustomConnector && isInIntegration) {
727
+ _module = this.app?.integration?.connectors?.find?.((item) => item.name === _name);
728
+ } else if (isCustomConnector && !isInIntegration) {
729
+ _module = this.app?.dependencies?.find?.((item) => item.name === _name);
730
+ } else {
731
+ // default
732
+ _module = this.app.interfaceDependencies.find((item) => item.name === _name);
733
+ }
699
734
  const _interface = _module?.interfaces.find((item) => item.name === _interfaceName);
700
735
  return {
701
736
  _module,
@@ -85,19 +85,27 @@ export class CallLogic extends LogicItem {
85
85
  /**
86
86
  * 类型参数
87
87
  */
88
- @property('TypeAnnotation')
88
+ @property({
89
+ objectRef: 'TypeAnnotation',
90
+ isArray: true,
91
+ })
89
92
  typeArguments?: Array<TypeAnnotation> = null;
90
93
 
91
94
  /**
92
95
  * 实际参数
93
96
  */
94
- @property('Argument')
97
+ @property({
98
+ objectRef: 'Argument',
99
+ isArray: true,
100
+ })
95
101
  arguments: Array<Argument> = [];
96
102
 
97
103
  /**
98
104
  * 验证规则
99
105
  */
100
- @property('BindAttribute')
106
+ @property({
107
+ objectRef: 'BindAttribute',
108
+ })
101
109
  // @ts-ignore
102
110
  validation!: BindAttribute;
103
111
 
@@ -44,66 +44,90 @@ export class CallQueryComponent extends LogicItem {
44
44
  /**
45
45
  * 类型
46
46
  */
47
- @property('TypeAnnotation')
47
+ @property({
48
+ objectRef: 'TypeAnnotation',
49
+ })
48
50
  // @ts-ignore
49
51
  typeAnnotation!: TypeAnnotation;
50
52
 
51
53
  /**
52
54
  * select
53
55
  */
54
- @property('QuerySelectExpression')
56
+ @property({
57
+ objectRef: 'QuerySelectExpression',
58
+ })
55
59
  // @ts-ignore
56
60
  select!: QuerySelectExpression;
57
61
 
58
62
  /**
59
63
  * from
60
64
  */
61
- @property('QueryFromExpression')
65
+ @property({
66
+ objectRef: 'QueryFromExpression',
67
+ })
62
68
  // @ts-ignore
63
69
  from!: QueryFromExpression;
64
70
 
65
71
  /**
66
72
  * where
67
73
  */
68
- @property('LogicItem')
74
+ @property({
75
+ objectRef: 'LogicItem',
76
+ })
69
77
  // @ts-ignore
70
78
  where!: LogicItem;
71
79
 
72
80
  /**
73
81
  * where 草稿态
74
82
  */
75
- @property('LogicItem')
83
+ @property({
84
+ objectRef: 'LogicItem',
85
+ isArray: true,
86
+ })
76
87
  wherePlayground: Array<LogicItem> = [];
77
88
 
78
89
  /**
79
90
  * groupBy
80
91
  */
81
- @property('QueryGroupByExpression')
92
+ @property({
93
+ objectRef: 'QueryGroupByExpression',
94
+ isArray: true,
95
+ })
82
96
  groupBy: Array<QueryGroupByExpression> = [];
83
97
 
84
98
  /**
85
99
  * having
86
100
  */
87
- @property('LogicItem')
101
+ @property({
102
+ objectRef: 'LogicItem',
103
+ })
88
104
  // @ts-ignore
89
105
  having!: LogicItem;
90
106
 
91
107
  /**
92
108
  * having 草稿态
93
109
  */
94
- @property('LogicItem')
110
+ @property({
111
+ objectRef: 'LogicItem',
112
+ isArray: true,
113
+ })
95
114
  havingPlayground: Array<LogicItem> = [];
96
115
 
97
116
  /**
98
117
  * orderBy
99
118
  */
100
- @property('QueryOrderByExpression')
119
+ @property({
120
+ objectRef: 'QueryOrderByExpression',
121
+ isArray: true,
122
+ })
101
123
  orderBy: Array<QueryOrderByExpression> = [];
102
124
 
103
125
  /**
104
126
  * limit
105
127
  */
106
- @property('QueryLimitExpression')
128
+ @property({
129
+ objectRef: 'QueryLimitExpression',
130
+ })
107
131
  // @ts-ignore
108
132
  limit!: QueryLimitExpression;
109
133
 
@@ -58,7 +58,9 @@ export class CompletionProperty extends BaseNode {
58
58
  /**
59
59
  * 类型
60
60
  */
61
- @property('TypeAnnotation')
61
+ @property({
62
+ objectRef: 'TypeAnnotation',
63
+ })
62
64
  // @ts-ignore
63
65
  typeAnnotation!: TypeAnnotation;
64
66
 
@@ -39,7 +39,10 @@ export class ConfigGroup extends BaseNode {
39
39
  /**
40
40
  * 配置属性列表
41
41
  */
42
- @property('ConfigProperty')
42
+ @property({
43
+ objectRef: 'ConfigProperty',
44
+ isArray: true,
45
+ })
43
46
  properties: Array<ConfigProperty> = [];
44
47
 
45
48
  /**
@@ -50,7 +50,10 @@ export class ConfigProperty extends BaseNode {
50
50
  /**
51
51
  * 配置属性值列表
52
52
  */
53
- @property('ConfigPropertyValue')
53
+ @property({
54
+ objectRef: 'ConfigPropertyValue',
55
+ isArray: true,
56
+ })
54
57
  values: Array<ConfigPropertyValue> = [];
55
58
 
56
59
  /**
@@ -31,7 +31,10 @@ export class Configuration extends BaseNode {
31
31
  /**
32
32
  * 配置组列表
33
33
  */
34
- @property('ConfigGroup')
34
+ @property({
35
+ objectRef: 'ConfigGroup',
36
+ isArray: true,
37
+ })
35
38
  groups: Array<ConfigGroup> = [];
36
39
 
37
40
  /**
@@ -56,7 +56,10 @@ export class Connection extends BaseNode {
56
56
  /**
57
57
  * 配置属性列表
58
58
  */
59
- @property('ConfigProperty')
59
+ @property({
60
+ objectRef: 'ConfigProperty',
61
+ isArray: true,
62
+ })
60
63
  properties: Array<ConfigProperty> = [];
61
64
 
62
65
  /**