@lcap/nasl 2.22.0-beta.0 → 2.22.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/automate/engine/operators.d.ts +9 -0
- package/out/automate/engine/viewCache.d.ts +1 -0
- package/out/automate/template/myProcess.d.ts +1 -0
- package/out/common/BaseNode.d.ts +1 -0
- package/out/common/BaseNode.js +7 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.d.ts +1 -1
- package/out/common/EventEmitter.d.ts +1 -1
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +22 -0
- package/out/concepts/App__.js +78 -12
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +9 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +2 -1
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +2 -0
- package/out/concepts/CallQueryComponent__.js +76 -24
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +4 -0
- package/out/concepts/ConfigProperty__.js +18 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/Destination__.js +2 -2
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +1 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +7 -2
- package/out/concepts/EntityProperty__.js +100 -1
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +2 -1
- package/out/concepts/Entity__.js +30 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +7 -0
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.d.ts +53 -0
- package/out/concepts/Integration__.js +143 -0
- package/out/concepts/Integration__.js.map +1 -0
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +42 -0
- package/out/concepts/JavaLogic__.js +122 -0
- package/out/concepts/JavaLogic__.js.map +1 -0
- package/out/concepts/LogicItem__.d.ts +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +12 -7
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +11 -6
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MicroApp__.d.ts +51 -0
- package/out/concepts/MicroApp__.js +113 -0
- package/out/concepts/MicroApp__.js.map +1 -0
- package/out/concepts/Module__.d.ts +20 -9
- package/out/concepts/Module__.js +72 -14
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +1 -1
- package/out/concepts/NewComposite__.js +25 -11
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +1 -1
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -0
- package/out/concepts/Param__.js +5 -0
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +104 -16
- package/out/concepts/QuerySelectExpression__.js +99 -9
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +2 -2
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +8 -3
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +26 -6
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -1
- package/out/concepts/View__.js +3 -1
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +15 -0
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +94 -0
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +3 -0
- package/out/concepts/index__.js +3 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/config.d.ts +1 -1
- package/out/decorators/index.d.ts +2 -2
- package/out/generator/genBundleFiles.js +20 -3
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.js +2 -2
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/icestark.d.ts +2 -0
- package/out/generator/icestark.js +48 -0
- package/out/generator/icestark.js.map +1 -0
- package/out/generator/microApp.d.ts +2 -0
- package/out/generator/microApp.js +35 -0
- package/out/generator/microApp.js.map +1 -0
- package/out/generator/permission.d.ts +1 -1
- package/out/generator/permission.js +0 -13
- package/out/generator/permission.js.map +1 -1
- package/out/generator/qiankun.d.ts +2 -0
- package/out/generator/qiankun.js +52 -0
- package/out/generator/qiankun.js.map +1 -0
- package/out/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/manager/stepRecorder.d.ts +20 -0
- package/out/manager/stepRecorder.js +110 -0
- package/out/manager/stepRecorder.js.map +1 -0
- package/out/sentry/index.d.ts +5 -4
- package/out/sentry/index.js +9 -2
- package/out/sentry/index.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +1 -1
- package/out/server/formatTsUtils.js +40 -14
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.js +38 -6
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +5 -4
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +3 -3
- package/out/server/getScope.d.ts +1 -1
- package/out/server/naslServer.d.ts +7 -3
- package/out/server/naslServer.js +270 -102
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +25 -7
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +3 -3
- package/out/service/storage/init.js +6 -0
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -1
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +20 -6
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genUpdateBlock.js +7 -1
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +16 -0
- package/out/templator/utils.js +2 -0
- package/out/templator/utils.js.map +1 -1
- package/out/translator/index.d.ts +1 -1
- package/out/translator/lsp.d.ts +3 -3
- package/out/utils/index.d.ts +4 -4
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.ui.ts +16 -11
- package/sandbox/stdlib/nasl.util.ts +4 -0
- package/sandbox/stdlib/nasl.validation.ts +2 -2
- package/src/automate/upgrader/2.17.js +1 -1
- package/src/common/BaseNode.ts +10 -2
- package/src/concepts/App__.ts +90 -46
- package/src/concepts/CallInterface__.ts +9 -1
- package/src/concepts/CallLogic__.ts +2 -1
- package/src/concepts/CallQueryComponent__.ts +73 -82
- package/src/concepts/ConfigProperty__.ts +18 -1
- package/src/concepts/Destination__.ts +2 -20
- package/src/concepts/EntityProperty__.ts +102 -8
- package/src/concepts/Entity__.ts +31 -8
- package/src/concepts/Identifier__.ts +9 -2
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/Integration__.ts +162 -0
- package/src/concepts/JavaLogic__.ts +129 -0
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +12 -45
- package/src/concepts/Match__.ts +10 -5
- package/src/concepts/MemberExpression__.ts +1 -1
- package/src/concepts/MicroApp__.ts +118 -0
- package/src/concepts/Module__.ts +106 -79
- package/src/concepts/NewComposite__.ts +23 -11
- package/src/concepts/OqlQueryComponent__.ts +1 -1
- package/src/concepts/Param__.ts +3 -0
- package/src/concepts/QueryFieldExpression__.ts +0 -7
- package/src/concepts/QuerySelectExpression__.ts +206 -30
- package/src/concepts/SwitchCase__.ts +2 -2
- package/src/concepts/TypeAnnotation__.ts +8 -42
- package/src/concepts/ViewElement__.ts +24 -6
- package/src/concepts/View__.ts +3 -24
- package/src/concepts/basics/stdlib/nasl.ui.ts +15 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +94 -0
- package/src/concepts/index__.ts +3 -0
- package/src/generator/genBundleFiles.ts +22 -4
- package/src/generator/genReleaseBody.ts +2 -2
- package/src/generator/icestark.ts +45 -0
- package/src/generator/microApp.ts +32 -0
- package/src/generator/permission.ts +1 -15
- package/src/generator/qiankun.ts +49 -0
- package/src/index.ts +1 -0
- package/src/manager/stepRecorder.ts +112 -0
- package/src/sentry/index.ts +8 -2
- package/src/server/formatTsUtils.ts +42 -14
- package/src/server/getLogics.ts +41 -6
- package/src/server/getMemberIdentifier.ts +5 -4
- package/src/server/naslServer.ts +270 -101
- package/src/server/translator.ts +25 -7
- package/src/service/storage/init.ts +7 -0
- package/src/templator/genCreateBlock.ts +6 -1
- package/src/templator/genQueryComponent.ts +22 -8
- package/src/templator/genUpdateBlock.ts +7 -1
- package/src/templator/utils.ts +2 -0
- package/ts-worker/src/index.js +1 -4
- package/src/manager/history.ts +0 -0
- package/src/manager/problem.ts +0 -0
|
@@ -10,6 +10,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
10
10
|
import BaseNode from '../common/BaseNode';
|
|
11
11
|
import classMap from '../common/classMap';
|
|
12
12
|
import QueryAggregateExpression from './QueryAggregateExpression__';
|
|
13
|
+
import QueryFieldExpression from './QueryFieldExpression__';
|
|
13
14
|
import LogicItem from './LogicItem__';
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -38,10 +39,8 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
38
39
|
/**
|
|
39
40
|
* 查询聚合函数列表
|
|
40
41
|
*/
|
|
41
|
-
@property('QueryAggregateExpression')
|
|
42
|
-
selectElements: Array<QueryAggregateExpression> = [];
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
@property('QueryAggregateExpression | QueryFieldExpression')
|
|
43
|
+
selectElements: Array<QueryAggregateExpression | QueryFieldExpression> = [];
|
|
45
44
|
|
|
46
45
|
/**
|
|
47
46
|
* @param source 需要合并的部分参数
|
|
@@ -59,11 +58,10 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
59
58
|
return super.from(source, parentNode, parentKey) as QuerySelectExpression;
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
|
|
63
61
|
/**
|
|
64
62
|
* 设置查询聚合函数列表
|
|
65
63
|
*/
|
|
66
|
-
setSelectElements(selectElements: Array<QueryAggregateExpression>) {
|
|
64
|
+
setSelectElements(selectElements: Array<QueryAggregateExpression | QueryFieldExpression>) {
|
|
67
65
|
const object = {
|
|
68
66
|
selectElements,
|
|
69
67
|
};
|
|
@@ -72,7 +70,7 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
72
70
|
});
|
|
73
71
|
}
|
|
74
72
|
|
|
75
|
-
|
|
73
|
+
getQueryAggregateExpressionExistingNames(excludedList: Array<QueryAggregateExpression> = []) {
|
|
76
74
|
const excludedSet = new Set(excludedList);
|
|
77
75
|
return ((this.selectElements as QueryAggregateExpression[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
78
76
|
}
|
|
@@ -85,23 +83,23 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
85
83
|
* @internal
|
|
86
84
|
* @param name 查询聚合函数名称,如果不填会自动生成一个唯一名称
|
|
87
85
|
*/
|
|
88
|
-
|
|
86
|
+
_insertQueryAggregateExpressionInSelectElementsAt(name: string, index: number): QueryAggregateExpression;
|
|
89
87
|
|
|
90
88
|
/**
|
|
91
89
|
* 插入查询聚合函数
|
|
92
90
|
* @internal
|
|
93
91
|
* @param queryAggregateExpressionOptions 查询聚合函数参数
|
|
94
92
|
*/
|
|
95
|
-
|
|
93
|
+
_insertQueryAggregateExpressionInSelectElementsAt(queryAggregateExpressionOptions: Partial<QueryAggregateExpression>, index: number): QueryAggregateExpression;
|
|
96
94
|
|
|
97
95
|
/**
|
|
98
96
|
* 插入查询聚合函数
|
|
99
97
|
* @internal
|
|
100
98
|
* @param queryAggregateExpression 已有的查询聚合函数实例
|
|
101
99
|
*/
|
|
102
|
-
|
|
100
|
+
_insertQueryAggregateExpressionInSelectElementsAt(queryAggregateExpression: QueryAggregateExpression, index: number): QueryAggregateExpression;
|
|
103
101
|
|
|
104
|
-
|
|
102
|
+
_insertQueryAggregateExpressionInSelectElementsAt(options: string | Partial<QueryAggregateExpression> | QueryAggregateExpression, index: number) {
|
|
105
103
|
const queryAggregateExpressionOptions: any = {};
|
|
106
104
|
const relationOptions = { parentNode: this, parentKey: 'selectElements' };
|
|
107
105
|
let queryAggregateExpression: QueryAggregateExpression;
|
|
@@ -133,22 +131,22 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
133
131
|
* 插入查询聚合函数
|
|
134
132
|
* @param name 查询聚合函数名称,如果不填会自动生成一个唯一名称
|
|
135
133
|
*/
|
|
136
|
-
|
|
134
|
+
insertQueryAggregateExpressionInSelectElementsAt(name: string, index: number): QueryAggregateExpression;
|
|
137
135
|
|
|
138
136
|
/**
|
|
139
137
|
* 插入查询聚合函数
|
|
140
138
|
* @param queryAggregateExpressionOptions 查询聚合函数参数
|
|
141
139
|
*/
|
|
142
|
-
|
|
140
|
+
insertQueryAggregateExpressionInSelectElementsAt(queryAggregateExpressionOptions: Partial<QueryAggregateExpression>, index: number): QueryAggregateExpression;
|
|
143
141
|
|
|
144
142
|
/**
|
|
145
143
|
* 插入查询聚合函数
|
|
146
144
|
* @param queryAggregateExpression 已有的查询聚合函数实例
|
|
147
145
|
*/
|
|
148
|
-
|
|
146
|
+
insertQueryAggregateExpressionInSelectElementsAt(queryAggregateExpression: QueryAggregateExpression, index: number): QueryAggregateExpression;
|
|
149
147
|
|
|
150
|
-
|
|
151
|
-
const node = this.
|
|
148
|
+
insertQueryAggregateExpressionInSelectElementsAt(options: string | Partial<QueryAggregateExpression> | QueryAggregateExpression, index: number) {
|
|
149
|
+
const node = this._insertQueryAggregateExpressionInSelectElementsAt(options as any, index);
|
|
152
150
|
node.create({
|
|
153
151
|
index,
|
|
154
152
|
parentNode: this,
|
|
@@ -162,25 +160,25 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
162
160
|
* @internal
|
|
163
161
|
* @param name 查询聚合函数名称,如果不填会自动生成一个唯一名称
|
|
164
162
|
*/
|
|
165
|
-
|
|
163
|
+
_addQueryAggregateExpressionInSelectElements(name?: string): QueryAggregateExpression;
|
|
166
164
|
|
|
167
165
|
/**
|
|
168
166
|
* 添加查询聚合函数
|
|
169
167
|
* @internal
|
|
170
168
|
* @param queryAggregateExpressionOptions 查询聚合函数参数
|
|
171
169
|
*/
|
|
172
|
-
|
|
170
|
+
_addQueryAggregateExpressionInSelectElements(queryAggregateExpressionOptions: Partial<QueryAggregateExpression>): QueryAggregateExpression;
|
|
173
171
|
|
|
174
172
|
/**
|
|
175
173
|
* 添加查询聚合函数
|
|
176
174
|
* @internal
|
|
177
175
|
* @param queryAggregateExpression 已有的查询聚合函数实例
|
|
178
176
|
*/
|
|
179
|
-
|
|
177
|
+
_addQueryAggregateExpressionInSelectElements(queryAggregateExpression: QueryAggregateExpression): QueryAggregateExpression;
|
|
180
178
|
|
|
181
|
-
|
|
179
|
+
_addQueryAggregateExpressionInSelectElements(options?: string | Partial<QueryAggregateExpression> | QueryAggregateExpression) {
|
|
182
180
|
const index = this.selectElements.length;
|
|
183
|
-
return this.
|
|
181
|
+
return this._insertQueryAggregateExpressionInSelectElementsAt(options as any, index);
|
|
184
182
|
}
|
|
185
183
|
|
|
186
184
|
/**
|
|
@@ -188,22 +186,22 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
188
186
|
* @internal
|
|
189
187
|
* @param name 查询聚合函数名称,如果不填会自动生成一个唯一名称
|
|
190
188
|
*/
|
|
191
|
-
|
|
189
|
+
addQueryAggregateExpressionInSelectElements(name?: string): QueryAggregateExpression;
|
|
192
190
|
|
|
193
191
|
/**
|
|
194
192
|
* 添加查询聚合函数
|
|
195
193
|
* @param queryAggregateExpressionOptions 查询聚合函数参数
|
|
196
194
|
*/
|
|
197
|
-
|
|
195
|
+
addQueryAggregateExpressionInSelectElements(queryAggregateExpressionOptions: Partial<QueryAggregateExpression>): QueryAggregateExpression;
|
|
198
196
|
|
|
199
197
|
/**
|
|
200
198
|
* 添加查询聚合函数
|
|
201
199
|
* @param queryAggregateExpression 已有的查询聚合函数实例
|
|
202
200
|
*/
|
|
203
|
-
|
|
201
|
+
addQueryAggregateExpressionInSelectElements(queryAggregateExpression: QueryAggregateExpression): QueryAggregateExpression;
|
|
204
202
|
|
|
205
|
-
|
|
206
|
-
const node = this.
|
|
203
|
+
addQueryAggregateExpressionInSelectElements(options?: string | Partial<QueryAggregateExpression> | QueryAggregateExpression) {
|
|
204
|
+
const node = this._addQueryAggregateExpressionInSelectElements(options as any);
|
|
207
205
|
const index = this.selectElements.indexOf(node);
|
|
208
206
|
node.create({
|
|
209
207
|
index,
|
|
@@ -213,22 +211,152 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
213
211
|
return node;
|
|
214
212
|
}
|
|
215
213
|
|
|
214
|
+
/**
|
|
215
|
+
* 插入查询属性
|
|
216
|
+
* @internal
|
|
217
|
+
* @param name 查询属性名称,如果不填会自动生成一个唯一名称
|
|
218
|
+
*/
|
|
219
|
+
_insertQueryFieldExpressionInSelectElementsAt(name: string, index: number): QueryFieldExpression;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* 插入查询属性
|
|
223
|
+
* @internal
|
|
224
|
+
* @param queryFieldExpressionOptions 查询属性参数
|
|
225
|
+
*/
|
|
226
|
+
_insertQueryFieldExpressionInSelectElementsAt(queryFieldExpressionOptions: Partial<QueryFieldExpression>, index: number): QueryFieldExpression;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* 插入查询属性
|
|
230
|
+
* @internal
|
|
231
|
+
* @param queryFieldExpression 已有的查询属性实例
|
|
232
|
+
*/
|
|
233
|
+
_insertQueryFieldExpressionInSelectElementsAt(queryFieldExpression: QueryFieldExpression, index: number): QueryFieldExpression;
|
|
234
|
+
|
|
235
|
+
_insertQueryFieldExpressionInSelectElementsAt(options: string | Partial<QueryFieldExpression> | QueryFieldExpression, index: number) {
|
|
236
|
+
const queryFieldExpressionOptions: any = {};
|
|
237
|
+
const relationOptions = { parentNode: this, parentKey: 'selectElements' };
|
|
238
|
+
let queryFieldExpression: QueryFieldExpression;
|
|
239
|
+
if (!options) {
|
|
240
|
+
queryFieldExpression = QueryFieldExpression.from({
|
|
241
|
+
...queryFieldExpressionOptions,
|
|
242
|
+
name: this.getQueryFieldExpressionUniqueName(),
|
|
243
|
+
}, this, 'selectElements');
|
|
244
|
+
} else if (typeof options === 'string') {
|
|
245
|
+
queryFieldExpression = QueryFieldExpression.from({
|
|
246
|
+
...queryFieldExpressionOptions,
|
|
247
|
+
name: options,
|
|
248
|
+
}, this, 'selectElements');
|
|
249
|
+
} else if (options instanceof QueryFieldExpression) {
|
|
250
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
251
|
+
queryFieldExpression = options;
|
|
252
|
+
Object.assign(queryFieldExpression, relationOptions);
|
|
253
|
+
} else {
|
|
254
|
+
queryFieldExpression = QueryFieldExpression.from({
|
|
255
|
+
...queryFieldExpressionOptions,
|
|
256
|
+
...options,
|
|
257
|
+
}, this, 'selectElements');
|
|
258
|
+
}
|
|
259
|
+
this.selectElements.splice(index, 0, queryFieldExpression);
|
|
260
|
+
return queryFieldExpression;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* 插入查询属性
|
|
265
|
+
* @param name 查询属性名称,如果不填会自动生成一个唯一名称
|
|
266
|
+
*/
|
|
267
|
+
insertQueryFieldExpressionInSelectElementsAt(name: string, index: number): QueryFieldExpression;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* 插入查询属性
|
|
271
|
+
* @param queryFieldExpressionOptions 查询属性参数
|
|
272
|
+
*/
|
|
273
|
+
insertQueryFieldExpressionInSelectElementsAt(queryFieldExpressionOptions: Partial<QueryFieldExpression>, index: number): QueryFieldExpression;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* 插入查询属性
|
|
277
|
+
* @param queryFieldExpression 已有的查询属性实例
|
|
278
|
+
*/
|
|
279
|
+
insertQueryFieldExpressionInSelectElementsAt(queryFieldExpression: QueryFieldExpression, index: number): QueryFieldExpression;
|
|
280
|
+
|
|
281
|
+
insertQueryFieldExpressionInSelectElementsAt(options: string | Partial<QueryFieldExpression> | QueryFieldExpression, index: number) {
|
|
282
|
+
const node = this._insertQueryFieldExpressionInSelectElementsAt(options as any, index);
|
|
283
|
+
node.create({
|
|
284
|
+
index,
|
|
285
|
+
parentNode: this,
|
|
286
|
+
parentKey: 'selectElements',
|
|
287
|
+
});
|
|
288
|
+
return node;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* 添加查询属性
|
|
293
|
+
* @internal
|
|
294
|
+
* @param name 查询属性名称,如果不填会自动生成一个唯一名称
|
|
295
|
+
*/
|
|
296
|
+
_addQueryFieldExpressionInSelectElements(name?: string): QueryFieldExpression;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* 添加查询属性
|
|
300
|
+
* @internal
|
|
301
|
+
* @param queryFieldExpressionOptions 查询属性参数
|
|
302
|
+
*/
|
|
303
|
+
_addQueryFieldExpressionInSelectElements(queryFieldExpressionOptions: Partial<QueryFieldExpression>): QueryFieldExpression;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* 添加查询属性
|
|
307
|
+
* @internal
|
|
308
|
+
* @param queryFieldExpression 已有的查询属性实例
|
|
309
|
+
*/
|
|
310
|
+
_addQueryFieldExpressionInSelectElements(queryFieldExpression: QueryFieldExpression): QueryFieldExpression;
|
|
311
|
+
|
|
312
|
+
_addQueryFieldExpressionInSelectElements(options?: string | Partial<QueryFieldExpression> | QueryFieldExpression) {
|
|
313
|
+
const index = this.selectElements.length;
|
|
314
|
+
return this._insertQueryFieldExpressionInSelectElementsAt(options as any, index);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* 添加查询属性
|
|
319
|
+
* @internal
|
|
320
|
+
* @param name 查询属性名称,如果不填会自动生成一个唯一名称
|
|
321
|
+
*/
|
|
322
|
+
addQueryFieldExpressionInSelectElements(name?: string): QueryFieldExpression;
|
|
216
323
|
|
|
217
|
-
|
|
324
|
+
/**
|
|
325
|
+
* 添加查询属性
|
|
326
|
+
* @param queryFieldExpressionOptions 查询属性参数
|
|
327
|
+
*/
|
|
328
|
+
addQueryFieldExpressionInSelectElements(queryFieldExpressionOptions: Partial<QueryFieldExpression>): QueryFieldExpression;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* 添加查询属性
|
|
332
|
+
* @param queryFieldExpression 已有的查询属性实例
|
|
333
|
+
*/
|
|
334
|
+
addQueryFieldExpressionInSelectElements(queryFieldExpression: QueryFieldExpression): QueryFieldExpression;
|
|
335
|
+
|
|
336
|
+
addQueryFieldExpressionInSelectElements(options?: string | Partial<QueryFieldExpression> | QueryFieldExpression) {
|
|
337
|
+
const node = this._addQueryFieldExpressionInSelectElements(options as any);
|
|
338
|
+
const index = this.selectElements.indexOf(node);
|
|
339
|
+
node.create({
|
|
340
|
+
index,
|
|
341
|
+
parentNode: this,
|
|
342
|
+
parentKey: 'selectElements',
|
|
343
|
+
});
|
|
344
|
+
return node;
|
|
345
|
+
}
|
|
218
346
|
|
|
219
347
|
/**
|
|
220
348
|
* 删除查询聚合函数
|
|
221
349
|
* @param name 查询聚合函数名称
|
|
222
350
|
*/
|
|
223
|
-
|
|
351
|
+
removeQueryAggregateExpressionInSelectElements(name: string): void;
|
|
224
352
|
|
|
225
353
|
/**
|
|
226
354
|
* 删除查询聚合函数
|
|
227
355
|
* @param queryAggregateExpression 已有的查询聚合函数实例
|
|
228
356
|
*/
|
|
229
|
-
|
|
357
|
+
removeQueryAggregateExpressionInSelectElements(queryAggregateExpression: QueryAggregateExpression): void;
|
|
230
358
|
|
|
231
|
-
|
|
359
|
+
removeQueryAggregateExpressionInSelectElements(options: string | QueryAggregateExpression) {
|
|
232
360
|
let queryAggregateExpression: QueryAggregateExpression;
|
|
233
361
|
if (typeof options === 'string') {
|
|
234
362
|
queryAggregateExpression = (this.selectElements as QueryAggregateExpression[]).find((item) => item.name === options);
|
|
@@ -241,6 +369,31 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
241
369
|
return queryAggregateExpression.delete();
|
|
242
370
|
}
|
|
243
371
|
|
|
372
|
+
/**
|
|
373
|
+
* 删除查询属性
|
|
374
|
+
* @param name 查询属性名称
|
|
375
|
+
*/
|
|
376
|
+
removeQueryFieldExpressionInSelectElements(name: string): void;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* 删除查询属性
|
|
380
|
+
* @param queryFieldExpression 已有的查询属性实例
|
|
381
|
+
*/
|
|
382
|
+
removeQueryFieldExpressionInSelectElements(queryFieldExpression: QueryFieldExpression): void;
|
|
383
|
+
|
|
384
|
+
removeQueryFieldExpressionInSelectElements(options: string | QueryFieldExpression) {
|
|
385
|
+
let queryFieldExpression: QueryFieldExpression;
|
|
386
|
+
if (typeof options === 'string') {
|
|
387
|
+
queryFieldExpression = (this.selectElements as QueryFieldExpression[]).find((item) => item.name === options);
|
|
388
|
+
if (!queryFieldExpression) {
|
|
389
|
+
throw new Error('找不到查询属性 ' + options);
|
|
390
|
+
}
|
|
391
|
+
} else {
|
|
392
|
+
queryFieldExpression = options;
|
|
393
|
+
}
|
|
394
|
+
return queryFieldExpression.delete();
|
|
395
|
+
}
|
|
396
|
+
|
|
244
397
|
__removeLogicItem(logicItem: LogicItem) {
|
|
245
398
|
const parentKey = logicItem.parentKey;
|
|
246
399
|
const params: Params = {
|
|
@@ -269,6 +422,29 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
269
422
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
270
423
|
//================================================================================
|
|
271
424
|
|
|
425
|
+
/**
|
|
426
|
+
* 聚合函数列表
|
|
427
|
+
*/
|
|
428
|
+
get selectAggregateElements(): QueryAggregateExpression[] {
|
|
429
|
+
return this.selectElements.filter((item) => item.concept === 'QueryAggregateExpression') as QueryAggregateExpression[];
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* select字段列表
|
|
434
|
+
*/
|
|
435
|
+
get selectFieldElements(): QueryFieldExpression[] {
|
|
436
|
+
return this.selectElements.filter((item) => item.concept === 'QueryFieldExpression') as QueryFieldExpression[];
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
getQueryFieldExpressionExistingNames(excludedList: Array<QueryFieldExpression> = []) {
|
|
440
|
+
const excludedSet = new Set(excludedList);
|
|
441
|
+
return ((this.selectElements as QueryFieldExpression[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
getQueryFieldExpressionUniqueName(name = 'queryFieldExpression1') {
|
|
445
|
+
return utils.unique(name, this.getQueryFieldExpressionExistingNames(), undefined, false);
|
|
446
|
+
}
|
|
447
|
+
|
|
272
448
|
//================================================================================
|
|
273
449
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
274
450
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -290,7 +290,7 @@ export class SwitchCase extends LogicItem {
|
|
|
290
290
|
code
|
|
291
291
|
+= logicItem.toEmbeddedTS(shiftState(state, code, {
|
|
292
292
|
tabSize: (state?.tabSize || 0) + 1,
|
|
293
|
-
})) + '
|
|
293
|
+
})) + ';\n';
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
code += indent((state?.tabSize || 0)) + '}\n';
|
|
@@ -301,7 +301,7 @@ export class SwitchCase extends LogicItem {
|
|
|
301
301
|
code
|
|
302
302
|
+= logicItem.toEmbeddedTS(shiftState(state, code, {
|
|
303
303
|
tabSize: (state?.tabSize || 0) + 1,
|
|
304
|
-
})) + '
|
|
304
|
+
})) + ';\n';
|
|
305
305
|
});
|
|
306
306
|
}
|
|
307
307
|
code += indent((state?.tabSize || 0)) + '}\n';
|
|
@@ -54,6 +54,11 @@ export const OLD_PRIMITIVE_TITLE: Record<string, string> = {
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
export const PRIMITIVE_DESC: Record<string, string> = {
|
|
57
|
+
Integer: '可表示最大长度约 10 个数字的正负整数(将被删除)',
|
|
58
|
+
Double: '小数,有效数字约 16 个左右(将被删除)',
|
|
59
|
+
Text: '底层与String相同,可存储更长的内容(将被删除)',
|
|
60
|
+
Binary: '用于二进制流的存储',
|
|
61
|
+
Email: '表示一个邮箱,底层与String相同(将被删除)',
|
|
57
62
|
Boolean: '包含真(true)、假(false)两个值',
|
|
58
63
|
Long: '可表示最大长度约 19 个数字的正负整数',
|
|
59
64
|
Decimal: '可表示 31 个有效数字以内的小数',
|
|
@@ -68,7 +73,6 @@ export const GENERIC_DESC: Record<string, string> = {
|
|
|
68
73
|
Map: '从K类型到V类型的映射',
|
|
69
74
|
};
|
|
70
75
|
|
|
71
|
-
|
|
72
76
|
/**
|
|
73
77
|
* 判断是否是联合类型
|
|
74
78
|
* @param typeAnnotation
|
|
@@ -153,8 +157,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
153
157
|
@property()
|
|
154
158
|
ruleMap: Object = undefined;
|
|
155
159
|
|
|
156
|
-
|
|
157
|
-
|
|
158
160
|
/**
|
|
159
161
|
* @param source 需要合并的部分参数
|
|
160
162
|
*/
|
|
@@ -194,10 +196,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
194
196
|
});
|
|
195
197
|
}
|
|
196
198
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
199
|
/**
|
|
202
200
|
* 插入类型标注
|
|
203
201
|
* @internal
|
|
@@ -230,8 +228,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
230
228
|
return typeAnnotation;
|
|
231
229
|
}
|
|
232
230
|
|
|
233
|
-
|
|
234
|
-
|
|
235
231
|
/**
|
|
236
232
|
* 插入类型标注
|
|
237
233
|
* @param typeAnnotationOptions 类型标注参数
|
|
@@ -254,8 +250,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
254
250
|
return node;
|
|
255
251
|
}
|
|
256
252
|
|
|
257
|
-
|
|
258
|
-
|
|
259
253
|
/**
|
|
260
254
|
* 添加类型标注
|
|
261
255
|
* @internal
|
|
@@ -275,8 +269,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
275
269
|
return this._insertTypeAnnotationInTypeArgumentsAt(options as any, index);
|
|
276
270
|
}
|
|
277
271
|
|
|
278
|
-
|
|
279
|
-
|
|
280
272
|
/**
|
|
281
273
|
* 添加类型标注
|
|
282
274
|
* @param typeAnnotationOptions 类型标注参数
|
|
@@ -300,8 +292,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
300
292
|
return node;
|
|
301
293
|
}
|
|
302
294
|
|
|
303
|
-
|
|
304
|
-
|
|
305
295
|
/**
|
|
306
296
|
* 插入类型标注
|
|
307
297
|
* @internal
|
|
@@ -334,8 +324,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
334
324
|
return typeAnnotation;
|
|
335
325
|
}
|
|
336
326
|
|
|
337
|
-
|
|
338
|
-
|
|
339
327
|
/**
|
|
340
328
|
* 插入类型标注
|
|
341
329
|
* @param typeAnnotationOptions 类型标注参数
|
|
@@ -358,8 +346,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
358
346
|
return node;
|
|
359
347
|
}
|
|
360
348
|
|
|
361
|
-
|
|
362
|
-
|
|
363
349
|
/**
|
|
364
350
|
* 添加类型标注
|
|
365
351
|
* @internal
|
|
@@ -379,8 +365,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
379
365
|
return this._insertTypeAnnotationInReturnTypeAt(options as any, index);
|
|
380
366
|
}
|
|
381
367
|
|
|
382
|
-
|
|
383
|
-
|
|
384
368
|
/**
|
|
385
369
|
* 添加类型标注
|
|
386
370
|
* @param typeAnnotationOptions 类型标注参数
|
|
@@ -404,11 +388,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
404
388
|
return node;
|
|
405
389
|
}
|
|
406
390
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
391
|
/**
|
|
413
392
|
* 插入数据结构属性
|
|
414
393
|
* @internal
|
|
@@ -441,8 +420,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
441
420
|
return structureProperty;
|
|
442
421
|
}
|
|
443
422
|
|
|
444
|
-
|
|
445
|
-
|
|
446
423
|
/**
|
|
447
424
|
* 插入数据结构属性
|
|
448
425
|
* @param structurePropertyOptions 数据结构属性参数
|
|
@@ -465,8 +442,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
465
442
|
return node;
|
|
466
443
|
}
|
|
467
444
|
|
|
468
|
-
|
|
469
|
-
|
|
470
445
|
/**
|
|
471
446
|
* 添加数据结构属性
|
|
472
447
|
* @internal
|
|
@@ -486,8 +461,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
486
461
|
return this._insertStructurePropertyAt(options as any, index);
|
|
487
462
|
}
|
|
488
463
|
|
|
489
|
-
|
|
490
|
-
|
|
491
464
|
/**
|
|
492
465
|
* 添加数据结构属性
|
|
493
466
|
* @param structurePropertyOptions 数据结构属性参数
|
|
@@ -511,9 +484,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
511
484
|
return node;
|
|
512
485
|
}
|
|
513
486
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
487
|
/**
|
|
518
488
|
* 删除类型标注
|
|
519
489
|
* @param typeAnnotation 已有的类型标注实例
|
|
@@ -521,12 +491,10 @@ export class TypeAnnotation extends BaseNode {
|
|
|
521
491
|
removeTypeAnnotationInTypeArguments(typeAnnotation: TypeAnnotation): void;
|
|
522
492
|
|
|
523
493
|
removeTypeAnnotationInTypeArguments(options: TypeAnnotation) {
|
|
524
|
-
|
|
494
|
+
const typeAnnotation: TypeAnnotation = options;
|
|
525
495
|
return typeAnnotation.delete();
|
|
526
496
|
}
|
|
527
497
|
|
|
528
|
-
|
|
529
|
-
|
|
530
498
|
/**
|
|
531
499
|
* 删除类型标注
|
|
532
500
|
* @param typeAnnotation 已有的类型标注实例
|
|
@@ -534,7 +502,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
534
502
|
removeTypeAnnotationInReturnType(typeAnnotation: TypeAnnotation): void;
|
|
535
503
|
|
|
536
504
|
removeTypeAnnotationInReturnType(options: TypeAnnotation) {
|
|
537
|
-
|
|
505
|
+
const typeAnnotation: TypeAnnotation = options;
|
|
538
506
|
return typeAnnotation.delete();
|
|
539
507
|
}
|
|
540
508
|
|
|
@@ -561,8 +529,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
561
529
|
return params;
|
|
562
530
|
}
|
|
563
531
|
|
|
564
|
-
|
|
565
|
-
|
|
566
532
|
/**
|
|
567
533
|
* 删除数据结构属性
|
|
568
534
|
* @param structureProperty 已有的数据结构属性实例
|
|
@@ -570,7 +536,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
570
536
|
removeStructureProperty(structureProperty: StructureProperty): void;
|
|
571
537
|
|
|
572
538
|
removeStructureProperty(options: StructureProperty) {
|
|
573
|
-
|
|
539
|
+
const structureProperty: StructureProperty = options;
|
|
574
540
|
return structureProperty.delete();
|
|
575
541
|
}
|
|
576
542
|
|
|
@@ -144,12 +144,26 @@ function transAstNodeToNaslNode(astNode: any, namespace?: string): any {
|
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
146
|
} else if (astNode.type === 'UnaryExpression') {
|
|
147
|
+
const argument = astNode.argument;
|
|
148
|
+
if (argument.type === 'NumericLiteral') {
|
|
149
|
+
node = {
|
|
150
|
+
concept: 'NumericLiteral',
|
|
151
|
+
value: astNode.operator + argument.value,
|
|
152
|
+
};
|
|
153
|
+
} else {
|
|
154
|
+
node = {
|
|
155
|
+
concept: 'UnaryExpression',
|
|
156
|
+
kind: 'Expression',
|
|
157
|
+
name: '',
|
|
158
|
+
operator: astNode.operator,
|
|
159
|
+
argument: transAstNodeToNaslNode(astNode.argument),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
} else if (astNode.type === 'NumericLiteral') {
|
|
163
|
+
const numberString = typeof astNode.value === 'number' ? astNode.value.toString() : astNode.value;
|
|
147
164
|
node = {
|
|
148
|
-
concept: '
|
|
149
|
-
|
|
150
|
-
name: '',
|
|
151
|
-
operator: astNode.operator,
|
|
152
|
-
argument: transAstNodeToNaslNode(astNode.argument),
|
|
165
|
+
concept: 'NumericLiteral',
|
|
166
|
+
value: numberString,
|
|
153
167
|
};
|
|
154
168
|
} else {
|
|
155
169
|
node = astNode;
|
|
@@ -2027,7 +2041,11 @@ export class ViewElement extends BaseNode {
|
|
|
2027
2041
|
}
|
|
2028
2042
|
if (childEmpty) {
|
|
2029
2043
|
let addEmpty = true;
|
|
2030
|
-
if (
|
|
2044
|
+
if (['u-grid-view',
|
|
2045
|
+
'u-list-view',
|
|
2046
|
+
'van-list-view',
|
|
2047
|
+
'van-grid-view',
|
|
2048
|
+
'u-carousel'].includes(el.tag)) {
|
|
2031
2049
|
const hasDataSource = el.bindAttrs.find((attr) => attr.name === 'data-source');
|
|
2032
2050
|
addEmpty = !hasDataSource;
|
|
2033
2051
|
}
|