@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.
- package/out/common/BaseNode.d.ts +14 -11
- package/out/common/BaseNode.js +72 -52
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/Anchor__.js +3 -1
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js +10 -3
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.js +69 -18
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +3 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js +18 -5
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js +6 -2
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js +6 -2
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +3 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +4 -1
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +3 -1
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.js +4 -1
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +11 -3
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +6 -2
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +20 -6
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +7 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +8 -2
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js +7 -2
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.js +4 -1
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallFunction__.js +8 -2
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +2 -1
- package/out/concepts/CallInterface__.js +51 -13
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +11 -3
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +34 -10
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +3 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +4 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +4 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +4 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.js +4 -1
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/Connector__.js +26 -7
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.js +3 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.js +4 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/Destination__.js +7 -2
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/EntityIndex__.js +3 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +9 -3
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js +8 -2
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.js +4 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +4 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js +6 -2
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +19 -6
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js +8 -2
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.js +19 -5
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js +19 -5
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/IfStatement__.js +11 -3
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.js +7 -2
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +3 -1
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +11 -3
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/Logic__.js +46 -46
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js +8 -2
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +7 -2
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +6 -2
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.js +55 -14
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.js +4 -1
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.js +4 -1
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/Namespace__.js +48 -12
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.js +15 -4
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js +7 -2
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js +11 -3
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +3 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +3 -1
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +28 -8
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.js +3 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +8 -2
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +30 -8
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js +3 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js +20 -5
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +3 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +4 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js +3 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +8 -2
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js +6 -2
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +6 -2
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +4 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Return__.js +3 -1
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/SelectMembers__.js +7 -2
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js +3 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js +3 -1
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js +4 -1
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +3 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +8 -2
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +7 -2
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +4 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/TriggerEvent__.js +4 -1
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +12 -3
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +3 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +10 -3
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +3 -1
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +24 -6
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +24 -7
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +27 -7
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +7 -2
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/types__.d.ts +2 -3
- package/out/decorators/index.d.ts +3 -3
- package/out/decorators/index.js +3 -1
- package/out/decorators/index.js.map +1 -1
- package/out/natural/genNaturalTS.js +1 -1
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +3 -3
- package/out/server/getMemberIdentifier.d.ts +4 -4
- package/out/server/naslServer.d.ts +1 -1
- package/out/server/naslServer.js +4 -2
- package/out/server/naslServer.js.map +1 -1
- package/out/translator/utils.js +24 -28
- package/out/translator/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/common/BaseNode.ts +92 -68
- package/src/concepts/Anchor__.ts +3 -1
- package/src/concepts/AnonymousFunction__.ts +10 -3
- package/src/concepts/App__.ts +69 -18
- package/src/concepts/Argument__.ts +3 -1
- package/src/concepts/Assignee__.ts +18 -5
- package/src/concepts/AssignmentLine__.ts +6 -2
- package/src/concepts/Assignment__.ts +6 -2
- package/src/concepts/Attribute__.ts +3 -1
- package/src/concepts/AuthLogicForCallInterface__.ts +4 -1
- package/src/concepts/AuthLogic__.ts +3 -0
- package/src/concepts/BackendVariable__.ts +3 -1
- package/src/concepts/Backend__.ts +4 -1
- package/src/concepts/BatchAssignment__.ts +11 -3
- package/src/concepts/BinaryExpression__.ts +6 -2
- package/src/concepts/BindAttribute__.ts +20 -7
- package/src/concepts/BindDirective__.ts +7 -2
- package/src/concepts/BindEvent__.ts +8 -2
- package/src/concepts/BindStyle__.ts +7 -2
- package/src/concepts/CallAuthInterface__.ts +4 -1
- package/src/concepts/CallFunction__.ts +8 -2
- package/src/concepts/CallInterface__.ts +49 -14
- package/src/concepts/CallLogic__.ts +11 -3
- package/src/concepts/CallQueryComponent__.ts +34 -10
- package/src/concepts/CompletionProperty__.ts +3 -1
- package/src/concepts/ConfigGroup__.ts +4 -1
- package/src/concepts/ConfigProperty__.ts +4 -1
- package/src/concepts/Configuration__.ts +4 -1
- package/src/concepts/Connection__.ts +4 -1
- package/src/concepts/Connector__.ts +26 -7
- package/src/concepts/Constant__.ts +3 -1
- package/src/concepts/DataSource__.ts +4 -1
- package/src/concepts/Destination__.ts +7 -2
- package/src/concepts/EntityIndex__.ts +3 -1
- package/src/concepts/EntityProperty__.ts +9 -3
- package/src/concepts/Entity__.ts +8 -2
- package/src/concepts/Enum__.ts +4 -1
- package/src/concepts/Event__.ts +4 -1
- package/src/concepts/ExternalDestination__.ts +6 -2
- package/src/concepts/ForEachStatement__.ts +19 -6
- package/src/concepts/FrontendLibrary__.ts +8 -2
- package/src/concepts/Frontend__.ts +19 -5
- package/src/concepts/Function__.ts +19 -5
- package/src/concepts/IfStatement__.ts +11 -3
- package/src/concepts/Integration__.ts +7 -2
- package/src/concepts/InterfaceParam__.ts +3 -1
- package/src/concepts/Interface__.ts +11 -3
- package/src/concepts/Logic__.ts +62 -57
- package/src/concepts/MatchCase__.ts +8 -2
- package/src/concepts/Match__.ts +7 -2
- package/src/concepts/MemberExpression__.ts +6 -2
- package/src/concepts/Module__.ts +55 -14
- package/src/concepts/MsgTriggerEvent__.ts +4 -1
- package/src/concepts/MsgTriggerLauncher__.ts +4 -1
- package/src/concepts/Namespace__.ts +48 -12
- package/src/concepts/NewComposite__.ts +15 -4
- package/src/concepts/NewList__.ts +7 -2
- package/src/concepts/NewMap__.ts +11 -3
- package/src/concepts/NumericLiteral__.ts +3 -1
- package/src/concepts/OqlQueryComponent__.ts +3 -1
- package/src/concepts/OverriddenLogic__.ts +28 -8
- package/src/concepts/Param__.ts +3 -1
- package/src/concepts/ProcessComponent__.ts +8 -2
- package/src/concepts/ProcessElement__.ts +30 -8
- package/src/concepts/ProcessOutcomes__.ts +3 -1
- package/src/concepts/Process__.ts +20 -5
- package/src/concepts/QueryAggregateExpression__.ts +3 -1
- package/src/concepts/QueryFromExpression__.ts +4 -1
- package/src/concepts/QueryGroupByExpression__.ts +3 -1
- package/src/concepts/QueryJoinExpression__.ts +8 -2
- package/src/concepts/QueryLimitExpression__.ts +6 -2
- package/src/concepts/QueryOrderByExpression__.ts +6 -2
- package/src/concepts/QuerySelectExpression__.ts +4 -1
- package/src/concepts/Return__.ts +3 -1
- package/src/concepts/SelectMembers__.ts +7 -2
- package/src/concepts/Slot__.ts +3 -1
- package/src/concepts/SqlQueryComponent__.ts +3 -1
- package/src/concepts/StringInterpolation__.ts +4 -1
- package/src/concepts/StructureProperty__.ts +3 -1
- package/src/concepts/Structure__.ts +8 -2
- package/src/concepts/SwitchCase__.ts +7 -2
- package/src/concepts/SwitchStatement__.ts +4 -1
- package/src/concepts/TriggerEvent__.ts +4 -1
- package/src/concepts/TypeAnnotation__.ts +13 -4
- package/src/concepts/UnaryExpression__.ts +3 -1
- package/src/concepts/ValidationRule__.ts +10 -3
- package/src/concepts/Variable__.ts +3 -1
- package/src/concepts/ViewComponent__.ts +24 -6
- package/src/concepts/ViewElement__.ts +92 -72
- package/src/concepts/View__.ts +27 -7
- package/src/concepts/WhileStatement__.ts +7 -2
- package/src/concepts/types__.ts +2 -4
- package/src/decorators/index.ts +7 -5
- package/src/natural/genNaturalTS.ts +1 -1
- package/src/server/formatTsUtils.ts +8 -8
- package/src/server/getMemberIdentifier.ts +4 -4
- package/src/server/naslServer.ts +4 -4
- package/src/service/storage/init.ts +2 -2
- 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(
|
|
46
|
+
@property({
|
|
47
|
+
objectRef: 'LogicItem',
|
|
48
|
+
})
|
|
47
49
|
// @ts-ignore
|
|
48
50
|
left!: LogicItem;
|
|
49
51
|
|
|
50
52
|
/**
|
|
51
53
|
* 右边项
|
|
52
54
|
*/
|
|
53
|
-
@property(
|
|
55
|
+
@property({
|
|
56
|
+
objectRef: 'LogicItem',
|
|
57
|
+
})
|
|
54
58
|
// @ts-ignore
|
|
55
59
|
right!: LogicItem;
|
|
56
60
|
|
|
@@ -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__';
|
|
@@ -42,20 +42,28 @@ export class BatchAssignment extends LogicItem {
|
|
|
42
42
|
/**
|
|
43
43
|
* 左边项
|
|
44
44
|
*/
|
|
45
|
-
@property(
|
|
45
|
+
@property({
|
|
46
|
+
objectRef: 'SelectMembers',
|
|
47
|
+
})
|
|
46
48
|
// @ts-ignore
|
|
47
49
|
left!: SelectMembers;
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
52
|
* 右边项
|
|
51
53
|
*/
|
|
52
|
-
@property(
|
|
54
|
+
@property({
|
|
55
|
+
objectRef: 'SelectMembers',
|
|
56
|
+
isArray: true,
|
|
57
|
+
})
|
|
53
58
|
rights: Array<SelectMembers> = [];
|
|
54
59
|
|
|
55
60
|
/**
|
|
56
61
|
* 赋值
|
|
57
62
|
*/
|
|
58
|
-
@property(
|
|
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(
|
|
51
|
+
@property({
|
|
52
|
+
objectRef: 'LogicItem',
|
|
53
|
+
})
|
|
52
54
|
// @ts-ignore
|
|
53
55
|
left!: LogicItem;
|
|
54
56
|
|
|
55
57
|
/**
|
|
56
58
|
* 右边项
|
|
57
59
|
*/
|
|
58
|
-
@property(
|
|
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(
|
|
69
|
+
@property({
|
|
70
|
+
objectRef: 'LogicItem',
|
|
71
|
+
})
|
|
71
72
|
// @ts-ignore
|
|
72
73
|
expression!: LogicItem;
|
|
73
74
|
|
|
74
75
|
/**
|
|
75
76
|
* 跳转页面
|
|
76
77
|
*/
|
|
77
|
-
@property(
|
|
78
|
+
@property({
|
|
79
|
+
objectRef: 'Destination',
|
|
80
|
+
})
|
|
78
81
|
// @ts-ignore
|
|
79
82
|
destination!: Destination;
|
|
80
83
|
|
|
81
84
|
/**
|
|
82
85
|
* 跳转页面
|
|
83
86
|
*/
|
|
84
|
-
@property(
|
|
87
|
+
@property({
|
|
88
|
+
objectRef: 'ExternalDestination',
|
|
89
|
+
})
|
|
85
90
|
// @ts-ignore
|
|
86
91
|
externalDestination!: ExternalDestination;
|
|
87
92
|
|
|
88
93
|
/**
|
|
89
94
|
* 验证规则
|
|
90
95
|
*/
|
|
91
|
-
@property(
|
|
96
|
+
@property({
|
|
97
|
+
objectRef: 'ValidationRule',
|
|
98
|
+
isArray: true,
|
|
99
|
+
})
|
|
92
100
|
rules: Array<ValidationRule> = [];
|
|
93
101
|
|
|
94
102
|
/**
|
|
95
103
|
* 经办人
|
|
96
104
|
*/
|
|
97
|
-
@property(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
47
|
+
@property({
|
|
48
|
+
objectRef: 'LogicItem',
|
|
49
|
+
})
|
|
48
50
|
// @ts-ignore
|
|
49
51
|
expression!: LogicItem;
|
|
50
52
|
|
|
51
53
|
/**
|
|
52
54
|
* 草稿态
|
|
53
55
|
*/
|
|
54
|
-
@property(
|
|
56
|
+
@property({
|
|
57
|
+
objectRef: 'LogicItem',
|
|
58
|
+
isArray: true,
|
|
59
|
+
})
|
|
55
60
|
playground: Array<LogicItem> = [];
|
|
56
61
|
|
|
57
62
|
/**
|
|
@@ -67,13 +67,19 @@ export class CallFunction extends LogicItem {
|
|
|
67
67
|
/**
|
|
68
68
|
* 类型参数
|
|
69
69
|
*/
|
|
70
|
-
@property(
|
|
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(
|
|
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(
|
|
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
|
-
|
|
333
|
-
|
|
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 =
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
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
|
|
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
|
-
|
|
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(
|
|
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(
|
|
97
|
+
@property({
|
|
98
|
+
objectRef: 'Argument',
|
|
99
|
+
isArray: true,
|
|
100
|
+
})
|
|
95
101
|
arguments: Array<Argument> = [];
|
|
96
102
|
|
|
97
103
|
/**
|
|
98
104
|
* 验证规则
|
|
99
105
|
*/
|
|
100
|
-
@property(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
128
|
+
@property({
|
|
129
|
+
objectRef: 'QueryLimitExpression',
|
|
130
|
+
})
|
|
107
131
|
// @ts-ignore
|
|
108
132
|
limit!: QueryLimitExpression;
|
|
109
133
|
|