@lcap/nasl 2.13.0-beta.2 → 2.13.1-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/concepts/BindAttribute__.js +7 -4
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/CompletionProperty__.d.ts +0 -1
- package/out/concepts/CompletionProperty__.js +0 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/DataSource__.js +1 -0
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/Destination__.js +6 -1
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/Entity__.js +1 -0
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.js +1 -0
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Function__.d.ts +2 -1
- package/out/concepts/Function__.js +0 -28
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +6 -3
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +1 -0
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/Logic__.js +1 -0
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Param__.js +6 -3
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +4 -0
- package/out/concepts/ProcessElement__.js +31 -0
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Process__.js +1 -0
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/Return__.js +6 -3
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +1 -0
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Structure__.js +1 -0
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +3 -14
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/Unparsed__.js +3 -3
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/Variable__.js +6 -3
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +1 -0
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.collection.js +12 -0
- package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +187 -5
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +1 -1
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -1
- package/out/enums/KEYWORDS.d.ts +1 -0
- package/out/enums/KEYWORDS.js +16 -1
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.js +25 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/server/createUiTs.js +12 -12
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +21 -0
- package/out/server/formatTsUtils.js +323 -0
- package/out/server/formatTsUtils.js.map +1 -0
- package/out/server/getLogics.js +18 -17
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +1 -12
- package/out/server/getMemberIdentifier.js +11 -264
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.js +9 -18
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.d.ts +48 -0
- package/out/server/naslServer.js +58 -13
- package/out/server/naslServer.js.map +1 -1
- package/out/server/stdlib/nasl.annotation.d.ts +4 -0
- package/out/server/stdlib/nasl.annotation.js +1 -0
- package/out/server/stdlib/nasl.annotation.js.map +1 -0
- package/out/server/stdlib/nasl.auth.d.ts +30 -0
- package/out/server/stdlib/nasl.auth.js +1 -0
- package/out/server/stdlib/nasl.auth.js.map +1 -0
- package/out/server/stdlib/nasl.browser.d.ts +5 -0
- package/out/server/stdlib/nasl.browser.js +1 -0
- package/out/server/stdlib/nasl.browser.js.map +1 -0
- package/out/server/stdlib/nasl.collection.d.ts +22 -0
- package/out/server/stdlib/nasl.collection.js +1 -0
- package/out/server/stdlib/nasl.collection.js.map +1 -0
- package/out/server/stdlib/nasl.configuration.d.ts +3 -0
- package/out/server/stdlib/nasl.configuration.js +1 -0
- package/out/server/stdlib/nasl.configuration.js.map +1 -0
- package/out/server/stdlib/nasl.core.d.ts +104 -0
- package/out/server/stdlib/nasl.core.js +1 -0
- package/out/server/stdlib/nasl.core.js.map +1 -0
- package/out/server/stdlib/nasl.interface.d.ts +7 -0
- package/out/server/stdlib/nasl.interface.js +1 -0
- package/out/server/stdlib/nasl.interface.js.map +1 -0
- package/out/server/stdlib/nasl.langUtil.d.ts +28 -0
- package/out/server/stdlib/nasl.langUtil.js +1 -0
- package/out/server/stdlib/nasl.langUtil.js.map +1 -0
- package/out/server/stdlib/nasl.process.d.ts +50 -0
- package/out/server/stdlib/nasl.process.js +1 -0
- package/out/server/stdlib/nasl.process.js.map +1 -0
- package/out/server/stdlib/nasl.ui.d.ts +186 -0
- package/out/server/stdlib/nasl.ui.definition.d.ts +1072 -0
- package/out/server/stdlib/nasl.ui.definition.js +632 -0
- package/out/server/stdlib/nasl.ui.definition.js.map +1 -0
- package/out/server/stdlib/nasl.ui.js +1 -0
- package/out/server/stdlib/nasl.ui.js.map +1 -0
- package/out/server/stdlib/nasl.util.d.ts +74 -0
- package/out/server/stdlib/nasl.util.js +4 -0
- package/out/server/stdlib/nasl.util.js.map +1 -0
- package/out/server/stdlib/nasl.validation.d.ts +32 -0
- package/out/server/stdlib/nasl.validation.js +1 -0
- package/out/server/stdlib/nasl.validation.js.map +1 -0
- package/out/templator/genQueryComponent.js +8 -8
- package/out/templator/genQueryComponent.js.map +1 -1
- package/package.json +1 -1
- package/src/concepts/BindAttribute__.ts +7 -24
- package/src/concepts/CompletionProperty__.ts +0 -1
- package/src/concepts/DataSource__.ts +1 -0
- package/src/concepts/Destination__.ts +6 -1
- package/src/concepts/Entity__.ts +1 -0
- package/src/concepts/Enum__.ts +1 -0
- package/src/concepts/InterfaceParam__.ts +6 -3
- package/src/concepts/Interface__.ts +1 -0
- package/src/concepts/Logic__.ts +1 -0
- package/src/concepts/Param__.ts +5 -3
- package/src/concepts/ProcessElement__.ts +35 -1
- package/src/concepts/Process__.ts +1 -0
- package/src/concepts/Return__.ts +5 -3
- package/src/concepts/Role__.ts +1 -0
- package/src/concepts/Structure__.ts +1 -0
- package/src/concepts/TypeAnnotation__.ts +3 -30
- package/src/concepts/Unparsed__.ts +3 -10
- package/src/concepts/Variable__.ts +5 -3
- package/src/concepts/ViewElement__.ts +1 -19
- package/src/concepts/View__.ts +1 -0
- package/src/concepts/basics/stdlib/nasl.collection.ts +12 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +187 -5
- package/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts +1 -1
- package/src/enums/KEYWORDS.ts +16 -0
- package/src/generator/genBundleFiles.ts +24 -1
- package/src/server/createUiTs.ts +12 -12
- package/src/server/formatTsUtils.ts +319 -0
- package/src/server/getLogics.ts +18 -17
- package/src/server/getMemberIdentifier.ts +10 -264
- package/src/server/getProcesses.ts +10 -19
- package/src/server/naslServer.ts +58 -12
- package/src/server/stdlib/nasl.annotation.ts +4 -0
- package/src/server/stdlib/nasl.auth.ts +31 -0
- package/src/server/stdlib/nasl.browser.ts +5 -0
- package/src/server/stdlib/nasl.collection.ts +22 -0
- package/src/server/stdlib/nasl.configuration.ts +3 -0
- package/src/server/stdlib/nasl.core.ts +128 -0
- package/src/server/stdlib/nasl.interface.ts +7 -0
- package/src/server/stdlib/nasl.langUtil.ts +31 -0
- package/src/server/stdlib/nasl.process.ts +87 -0
- package/src/server/stdlib/nasl.ui.definition.ts +1760 -0
- package/src/server/stdlib/nasl.ui.ts +189 -0
- package/src/server/stdlib/nasl.util.ts +84 -0
- package/src/server/stdlib/nasl.validation.ts +33 -0
- package/src/templator/genQueryComponent.ts +8 -8
|
@@ -42,7 +42,6 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
42
42
|
import BaseNode from '../common/BaseNode';
|
|
43
43
|
import classMap from '../common/classMap';
|
|
44
44
|
|
|
45
|
-
|
|
46
45
|
/**
|
|
47
46
|
* 类型标注
|
|
48
47
|
*/
|
|
@@ -90,8 +89,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
90
89
|
@property()
|
|
91
90
|
ruleMap: Object = undefined;
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
95
92
|
/**
|
|
96
93
|
* @param source 需要合并的部分参数
|
|
97
94
|
*/
|
|
@@ -128,10 +125,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
128
125
|
});
|
|
129
126
|
}
|
|
130
127
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
128
|
/**
|
|
136
129
|
* 插入类型标注
|
|
137
130
|
* @internal
|
|
@@ -164,8 +157,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
164
157
|
return typeAnnotation;
|
|
165
158
|
}
|
|
166
159
|
|
|
167
|
-
|
|
168
|
-
|
|
169
160
|
/**
|
|
170
161
|
* 插入类型标注
|
|
171
162
|
* @param typeAnnotationOptions 类型标注参数
|
|
@@ -188,8 +179,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
188
179
|
return node;
|
|
189
180
|
}
|
|
190
181
|
|
|
191
|
-
|
|
192
|
-
|
|
193
182
|
/**
|
|
194
183
|
* 添加类型标注
|
|
195
184
|
* @internal
|
|
@@ -209,8 +198,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
209
198
|
return this._insertTypeAnnotationAt(options as any, index);
|
|
210
199
|
}
|
|
211
200
|
|
|
212
|
-
|
|
213
|
-
|
|
214
201
|
/**
|
|
215
202
|
* 添加类型标注
|
|
216
203
|
* @param typeAnnotationOptions 类型标注参数
|
|
@@ -234,9 +221,6 @@ export class TypeAnnotation extends BaseNode {
|
|
|
234
221
|
return node;
|
|
235
222
|
}
|
|
236
223
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
224
|
/**
|
|
241
225
|
* 删除类型标注
|
|
242
226
|
* @param typeAnnotation 已有的类型标注实例
|
|
@@ -244,7 +228,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
244
228
|
removeTypeAnnotation(typeAnnotation: TypeAnnotation): void;
|
|
245
229
|
|
|
246
230
|
removeTypeAnnotation(options: TypeAnnotation) {
|
|
247
|
-
|
|
231
|
+
const typeAnnotation: TypeAnnotation = options;
|
|
248
232
|
return typeAnnotation.delete();
|
|
249
233
|
}
|
|
250
234
|
|
|
@@ -307,7 +291,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
307
291
|
return typeTitle;
|
|
308
292
|
} else if (this.typeKind === 'generic') {
|
|
309
293
|
if (this.typeArguments && this.typeArguments.length)
|
|
310
|
-
return `${this.typeName}<${(this.typeArguments || []).map((arg) => arg.headTitle || 'T')}>`;
|
|
294
|
+
return `${this.typeName}<${(this.typeArguments || []).map((arg) => arg.headTitle || arg.name || 'T').join(', ')}>`;
|
|
311
295
|
else
|
|
312
296
|
return this.typeName;
|
|
313
297
|
} else {
|
|
@@ -324,18 +308,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
324
308
|
} else if (this.typeKind === 'reference') {
|
|
325
309
|
return this.typeName;
|
|
326
310
|
} else if (this.typeKind === 'generic') {
|
|
327
|
-
|
|
328
|
-
const loop = (typeArguments: Array<TypeAnnotation>) => {
|
|
329
|
-
str += '<' + (typeArguments[0].typeTitle || 'T');
|
|
330
|
-
if (typeArguments[0].typeKind === 'generic') {
|
|
331
|
-
if (this.typeArguments && this.typeArguments.length) {
|
|
332
|
-
loop(typeArguments[0].typeArguments);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
str += '>';
|
|
336
|
-
};
|
|
337
|
-
loop(this.typeArguments);
|
|
338
|
-
return str;
|
|
311
|
+
return `${this.typeName}<${this.typeArguments.map((arg) => arg.typeTitle || arg.name || 'T').join(', ')}>`;
|
|
339
312
|
} else {
|
|
340
313
|
return this.typeName;
|
|
341
314
|
}
|
|
@@ -30,8 +30,6 @@ export class Unparsed extends LogicItem {
|
|
|
30
30
|
@property()
|
|
31
31
|
code: string = undefined;
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
33
|
/**
|
|
36
34
|
* @param source 需要合并的部分参数
|
|
37
35
|
*/
|
|
@@ -45,7 +43,6 @@ export class Unparsed extends LogicItem {
|
|
|
45
43
|
return super.from(source, parentNode, parentKey) as Unparsed;
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
|
|
49
46
|
/**
|
|
50
47
|
* 设置表达式代码
|
|
51
48
|
*/
|
|
@@ -58,25 +55,21 @@ export class Unparsed extends LogicItem {
|
|
|
58
55
|
});
|
|
59
56
|
}
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
58
|
//================================================================================
|
|
66
59
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
67
60
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
68
61
|
//================================================================================
|
|
69
62
|
|
|
70
63
|
toVue(options?: ElementToVueOptions): string {
|
|
71
|
-
return this.code
|
|
64
|
+
return this.code || '';
|
|
72
65
|
}
|
|
73
66
|
|
|
74
67
|
toUI(): string {
|
|
75
|
-
return this.code
|
|
68
|
+
return this.code || '';
|
|
76
69
|
}
|
|
77
70
|
|
|
78
71
|
toJS(): string {
|
|
79
|
-
return this.code
|
|
72
|
+
return this.code || '';
|
|
80
73
|
}
|
|
81
74
|
|
|
82
75
|
@withSourceMap()
|
|
@@ -342,12 +342,14 @@ export class Variable extends BaseNode {
|
|
|
342
342
|
}
|
|
343
343
|
} else if (typeKind === 'generic') {
|
|
344
344
|
const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
|
|
345
|
-
const properties = node.properties || [];
|
|
345
|
+
const properties = [...node.properties] || [];
|
|
346
346
|
for (let i = 0; i < properties.length; i++) {
|
|
347
347
|
const item = properties[i];
|
|
348
348
|
if (item?.typeAnnotation?.typeKind === 'typeParam') {
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
const newItem = StructureProperty.from(item.toJSON());
|
|
350
|
+
newItem.typeAnnotation = this?.typeAnnotation?.typeArguments[0];
|
|
351
|
+
newItem.parentNode = this;
|
|
352
|
+
properties[i] = newItem;
|
|
351
353
|
}
|
|
352
354
|
}
|
|
353
355
|
completionChildren = properties;
|
|
@@ -268,8 +268,6 @@ export class ViewElement extends BaseNode {
|
|
|
268
268
|
super.subConstructor(source);
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
|
|
272
|
-
|
|
273
271
|
/**
|
|
274
272
|
* 从父级删除该节点
|
|
275
273
|
* @internal
|
|
@@ -318,7 +316,7 @@ export class ViewElement extends BaseNode {
|
|
|
318
316
|
});
|
|
319
317
|
}
|
|
320
318
|
|
|
321
|
-
|
|
319
|
+
getBindAttributeExistingNames(excludedList: Array<BindAttribute> = []) {
|
|
322
320
|
const excludedSet = new Set(excludedList);
|
|
323
321
|
return (this.bindAttrs || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
324
322
|
}
|
|
@@ -459,7 +457,6 @@ export class ViewElement extends BaseNode {
|
|
|
459
457
|
return node;
|
|
460
458
|
}
|
|
461
459
|
|
|
462
|
-
|
|
463
460
|
getBindEventExistingNames(excludedList: Array<BindEvent> = []) {
|
|
464
461
|
const excludedSet = new Set(excludedList);
|
|
465
462
|
return (this.bindEvents || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -601,7 +598,6 @@ export class ViewElement extends BaseNode {
|
|
|
601
598
|
return node;
|
|
602
599
|
}
|
|
603
600
|
|
|
604
|
-
|
|
605
601
|
getBindDirectiveExistingNames(excludedList: Array<BindDirective> = []) {
|
|
606
602
|
const excludedSet = new Set(excludedList);
|
|
607
603
|
return (this.bindDirectives || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -743,11 +739,6 @@ export class ViewElement extends BaseNode {
|
|
|
743
739
|
return node;
|
|
744
740
|
}
|
|
745
741
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
742
|
/**
|
|
752
743
|
* 插入页面元素
|
|
753
744
|
* @internal
|
|
@@ -881,9 +872,6 @@ export class ViewElement extends BaseNode {
|
|
|
881
872
|
return node;
|
|
882
873
|
}
|
|
883
874
|
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
875
|
/**
|
|
888
876
|
* 删除元素绑定属性
|
|
889
877
|
* @param name 元素绑定属性名称
|
|
@@ -932,8 +920,6 @@ export class ViewElement extends BaseNode {
|
|
|
932
920
|
return params;
|
|
933
921
|
}
|
|
934
922
|
|
|
935
|
-
|
|
936
|
-
|
|
937
923
|
/**
|
|
938
924
|
* 删除元素绑定事件
|
|
939
925
|
* @param name 元素绑定事件名称
|
|
@@ -982,8 +968,6 @@ export class ViewElement extends BaseNode {
|
|
|
982
968
|
return params;
|
|
983
969
|
}
|
|
984
970
|
|
|
985
|
-
|
|
986
|
-
|
|
987
971
|
/**
|
|
988
972
|
* 删除元素指令
|
|
989
973
|
* @param name 元素指令名称
|
|
@@ -1032,8 +1016,6 @@ export class ViewElement extends BaseNode {
|
|
|
1032
1016
|
return params;
|
|
1033
1017
|
}
|
|
1034
1018
|
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
1019
|
/**
|
|
1038
1020
|
* 删除页面元素
|
|
1039
1021
|
* @param name 页面元素名称
|
package/src/concepts/View__.ts
CHANGED
|
@@ -68,6 +68,18 @@ export const collectionStructures = [
|
|
|
68
68
|
}),
|
|
69
69
|
],
|
|
70
70
|
}),
|
|
71
|
+
new Structure({
|
|
72
|
+
name: 'Map',
|
|
73
|
+
typeParams: [
|
|
74
|
+
new TypeParam({
|
|
75
|
+
name: 'K',
|
|
76
|
+
}),
|
|
77
|
+
new TypeParam({
|
|
78
|
+
name: 'V',
|
|
79
|
+
}),
|
|
80
|
+
],
|
|
81
|
+
properties: [],
|
|
82
|
+
}),
|
|
71
83
|
];
|
|
72
84
|
export const collectionTypeList: Array<TypeAnnotation> = reference2TypeAnnotationList(collectionStructures, 'nasl.collection');
|
|
73
85
|
|
|
@@ -221,7 +221,7 @@ export default new Namespace({
|
|
|
221
221
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
222
222
|
}),
|
|
223
223
|
new Param({
|
|
224
|
-
name: '
|
|
224
|
+
name: 'separator',
|
|
225
225
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
226
226
|
}),
|
|
227
227
|
],
|
|
@@ -244,7 +244,7 @@ export default new Namespace({
|
|
|
244
244
|
}),
|
|
245
245
|
}),
|
|
246
246
|
new Param({
|
|
247
|
-
name: '
|
|
247
|
+
name: 'separator',
|
|
248
248
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
249
249
|
}),
|
|
250
250
|
],
|
|
@@ -275,10 +275,10 @@ export default new Namespace({
|
|
|
275
275
|
}),
|
|
276
276
|
new Function({
|
|
277
277
|
name: 'Length',
|
|
278
|
-
description: '
|
|
278
|
+
description: '获得String、Map、List的长度',
|
|
279
279
|
params: [
|
|
280
280
|
new Param({
|
|
281
|
-
name: '
|
|
281
|
+
name: 'param',
|
|
282
282
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
283
283
|
}),
|
|
284
284
|
],
|
|
@@ -427,7 +427,7 @@ export default new Namespace({
|
|
|
427
427
|
}),
|
|
428
428
|
}),
|
|
429
429
|
new Param({
|
|
430
|
-
name: '
|
|
430
|
+
name: 'addList',
|
|
431
431
|
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
432
432
|
typeArguments: [TypeAnnotation.createTypeParam('T')],
|
|
433
433
|
}),
|
|
@@ -496,6 +496,188 @@ export default new Namespace({
|
|
|
496
496
|
}),
|
|
497
497
|
],
|
|
498
498
|
}),
|
|
499
|
+
new Function({
|
|
500
|
+
name: 'MapGet',
|
|
501
|
+
description: '查询出Map中key为指定值的value值列表',
|
|
502
|
+
params: [
|
|
503
|
+
new Param({
|
|
504
|
+
name: 'map',
|
|
505
|
+
typeAnnotation: TypeAnnotation.createGeneric('map', {
|
|
506
|
+
typeArguments: [
|
|
507
|
+
TypeAnnotation.createTypeParam('K'),
|
|
508
|
+
TypeAnnotation.createTypeParam('V'),
|
|
509
|
+
],
|
|
510
|
+
}),
|
|
511
|
+
}),
|
|
512
|
+
new Param({
|
|
513
|
+
name: 'key',
|
|
514
|
+
typeAnnotation: TypeAnnotation.createTypeParam('K'),
|
|
515
|
+
}),
|
|
516
|
+
],
|
|
517
|
+
returns: [
|
|
518
|
+
new Return({
|
|
519
|
+
typeAnnotation: TypeAnnotation.createTypeParam('V'),
|
|
520
|
+
}),
|
|
521
|
+
],
|
|
522
|
+
}),
|
|
523
|
+
new Function({
|
|
524
|
+
name: 'MapPut',
|
|
525
|
+
description: '为Map中添加键值对',
|
|
526
|
+
params: [
|
|
527
|
+
new Param({
|
|
528
|
+
name: 'map',
|
|
529
|
+
typeAnnotation: TypeAnnotation.createGeneric('map', {
|
|
530
|
+
typeArguments: [
|
|
531
|
+
TypeAnnotation.createTypeParam('K'),
|
|
532
|
+
TypeAnnotation.createTypeParam('V'),
|
|
533
|
+
],
|
|
534
|
+
}),
|
|
535
|
+
}),
|
|
536
|
+
new Param({
|
|
537
|
+
name: 'key',
|
|
538
|
+
typeAnnotation: TypeAnnotation.createTypeParam('K'),
|
|
539
|
+
}),
|
|
540
|
+
new Param({
|
|
541
|
+
name: 'value',
|
|
542
|
+
typeAnnotation: TypeAnnotation.createTypeParam('V'),
|
|
543
|
+
}),
|
|
544
|
+
],
|
|
545
|
+
}),
|
|
546
|
+
new Function({
|
|
547
|
+
name: 'MapRemove',
|
|
548
|
+
description: '删除Map中的键值对',
|
|
549
|
+
params: [
|
|
550
|
+
new Param({
|
|
551
|
+
name: 'map',
|
|
552
|
+
typeAnnotation: TypeAnnotation.createGeneric('map', {
|
|
553
|
+
typeArguments: [
|
|
554
|
+
TypeAnnotation.createTypeParam('K'),
|
|
555
|
+
TypeAnnotation.createTypeParam('V'),
|
|
556
|
+
],
|
|
557
|
+
}),
|
|
558
|
+
}),
|
|
559
|
+
new Param({
|
|
560
|
+
name: 'key',
|
|
561
|
+
typeAnnotation: TypeAnnotation.createTypeParam('K'),
|
|
562
|
+
}),
|
|
563
|
+
],
|
|
564
|
+
}),
|
|
565
|
+
new Function({
|
|
566
|
+
name: 'MapContains',
|
|
567
|
+
description: '指定Map中是否存在参数key的键值对',
|
|
568
|
+
params: [
|
|
569
|
+
new Param({
|
|
570
|
+
name: 'map',
|
|
571
|
+
typeAnnotation: TypeAnnotation.createGeneric('map', {
|
|
572
|
+
typeArguments: [
|
|
573
|
+
TypeAnnotation.createTypeParam('K'),
|
|
574
|
+
TypeAnnotation.createTypeParam('V'),
|
|
575
|
+
],
|
|
576
|
+
}),
|
|
577
|
+
}),
|
|
578
|
+
new Param({
|
|
579
|
+
name: 'key',
|
|
580
|
+
typeAnnotation: TypeAnnotation.createTypeParam('K'),
|
|
581
|
+
}),
|
|
582
|
+
],
|
|
583
|
+
returns: [
|
|
584
|
+
new Return({
|
|
585
|
+
typeAnnotation: TypeAnnotation.createTypeParam('Boolean'),
|
|
586
|
+
}),
|
|
587
|
+
],
|
|
588
|
+
}),
|
|
589
|
+
new Function({
|
|
590
|
+
name: 'MapKeys',
|
|
591
|
+
description: '输出Map中key集合',
|
|
592
|
+
params: [
|
|
593
|
+
new Param({
|
|
594
|
+
name: 'map',
|
|
595
|
+
typeAnnotation: TypeAnnotation.createGeneric('map', {
|
|
596
|
+
typeArguments: [
|
|
597
|
+
TypeAnnotation.createTypeParam('K'),
|
|
598
|
+
TypeAnnotation.createTypeParam('V'),
|
|
599
|
+
],
|
|
600
|
+
}),
|
|
601
|
+
}),
|
|
602
|
+
],
|
|
603
|
+
returns: [
|
|
604
|
+
new Return({
|
|
605
|
+
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
606
|
+
typeArguments: [TypeAnnotation.createTypeParam('K')],
|
|
607
|
+
}),
|
|
608
|
+
}),
|
|
609
|
+
],
|
|
610
|
+
}),
|
|
611
|
+
new Function({
|
|
612
|
+
name: 'MapValues',
|
|
613
|
+
description: '输出Map中value集合',
|
|
614
|
+
params: [
|
|
615
|
+
new Param({
|
|
616
|
+
name: 'map',
|
|
617
|
+
typeAnnotation: TypeAnnotation.createGeneric('map', {
|
|
618
|
+
typeArguments: [
|
|
619
|
+
TypeAnnotation.createTypeParam('K'),
|
|
620
|
+
TypeAnnotation.createTypeParam('V'),
|
|
621
|
+
],
|
|
622
|
+
}),
|
|
623
|
+
}),
|
|
624
|
+
],
|
|
625
|
+
returns: [
|
|
626
|
+
new Return({
|
|
627
|
+
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
628
|
+
typeArguments: [TypeAnnotation.createTypeParam('V')],
|
|
629
|
+
}),
|
|
630
|
+
}),
|
|
631
|
+
],
|
|
632
|
+
}),
|
|
633
|
+
new Function({
|
|
634
|
+
name: 'MapFilter',
|
|
635
|
+
description: '在指定Map中过滤出符合条件参数的Map集合',
|
|
636
|
+
params: [
|
|
637
|
+
new Param({
|
|
638
|
+
name: 'map',
|
|
639
|
+
typeAnnotation: TypeAnnotation.createGeneric('map', {
|
|
640
|
+
typeArguments: [
|
|
641
|
+
TypeAnnotation.createTypeParam('K'),
|
|
642
|
+
TypeAnnotation.createTypeParam('V'),
|
|
643
|
+
],
|
|
644
|
+
}),
|
|
645
|
+
}),
|
|
646
|
+
new Param({
|
|
647
|
+
name: 'byKey',
|
|
648
|
+
defaultExpression: new Function({
|
|
649
|
+
name: 'byKey',
|
|
650
|
+
description: '',
|
|
651
|
+
params: [
|
|
652
|
+
new Param({
|
|
653
|
+
name: 'key',
|
|
654
|
+
typeAnnotation: null,
|
|
655
|
+
}),
|
|
656
|
+
],
|
|
657
|
+
}),
|
|
658
|
+
}),
|
|
659
|
+
new Param({
|
|
660
|
+
name: 'byValue',
|
|
661
|
+
defaultExpression: new Function({
|
|
662
|
+
name: 'byValue',
|
|
663
|
+
description: '',
|
|
664
|
+
params: [
|
|
665
|
+
new Param({
|
|
666
|
+
name: 'value',
|
|
667
|
+
typeAnnotation: null,
|
|
668
|
+
}),
|
|
669
|
+
],
|
|
670
|
+
}),
|
|
671
|
+
}),
|
|
672
|
+
],
|
|
673
|
+
returns: [
|
|
674
|
+
new Return({
|
|
675
|
+
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
676
|
+
typeArguments: [TypeAnnotation.createTypeParam('K')],
|
|
677
|
+
}),
|
|
678
|
+
}),
|
|
679
|
+
],
|
|
680
|
+
}),
|
|
499
681
|
new Function({
|
|
500
682
|
name: 'CurrDate',
|
|
501
683
|
description: '返回当前日期',
|
|
@@ -15,7 +15,7 @@ export function reference2TypeAnnotationList(list: Array<Entity | Structure | En
|
|
|
15
15
|
return TypeAnnotation.createReference(item.name, {
|
|
16
16
|
typeKind: 'generic',
|
|
17
17
|
typeNamespace: namespace,
|
|
18
|
-
typeArguments: item.typeParams.map((typeParam) => new TypeAnnotation()),
|
|
18
|
+
typeArguments: item.typeParams.map((typeParam) => new TypeAnnotation({ name: typeParam.name })),
|
|
19
19
|
});
|
|
20
20
|
} else {
|
|
21
21
|
return TypeAnnotation.createReference(item.name, {
|
package/src/enums/KEYWORDS.ts
CHANGED
|
@@ -1198,3 +1198,19 @@ export const ENTITY_PROPERTY_KEYWORDS = [
|
|
|
1198
1198
|
'STATIC',
|
|
1199
1199
|
'YIELD',
|
|
1200
1200
|
];
|
|
1201
|
+
|
|
1202
|
+
export const USER_CUSTOM_KEYWORDS = [
|
|
1203
|
+
'annotation',
|
|
1204
|
+
'app',
|
|
1205
|
+
'component',
|
|
1206
|
+
'components',
|
|
1207
|
+
'config',
|
|
1208
|
+
'configuration',
|
|
1209
|
+
'dataSource',
|
|
1210
|
+
'element',
|
|
1211
|
+
'elements',
|
|
1212
|
+
'function',
|
|
1213
|
+
'match',
|
|
1214
|
+
'operator',
|
|
1215
|
+
'system',
|
|
1216
|
+
];
|
|
@@ -132,6 +132,29 @@ export async function genBundleFiles(app: App,
|
|
|
132
132
|
if (view.isIndex) {
|
|
133
133
|
indexName = view.name;
|
|
134
134
|
}
|
|
135
|
+
function getAuth(data: View) {
|
|
136
|
+
if (!data) return
|
|
137
|
+
let res:any = {};
|
|
138
|
+
if( data.children.length === 0) {
|
|
139
|
+
res.name = data.name;
|
|
140
|
+
res.auth = data.auth;
|
|
141
|
+
res.children = [];
|
|
142
|
+
} else {
|
|
143
|
+
res.name = data.name;
|
|
144
|
+
res.auth = data.auth;
|
|
145
|
+
res.children = [];
|
|
146
|
+
data.children.forEach(item => {
|
|
147
|
+
res.children.push(getAuth(item));
|
|
148
|
+
})
|
|
149
|
+
}
|
|
150
|
+
return res;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
let filterChildren: any[];
|
|
154
|
+
filterChildren = [];
|
|
155
|
+
view.children.forEach(item => {
|
|
156
|
+
filterChildren.push(getAuth(item));
|
|
157
|
+
});
|
|
135
158
|
pages[view.name] = {
|
|
136
159
|
title: view.title,
|
|
137
160
|
name: view.name,
|
|
@@ -140,7 +163,7 @@ export async function genBundleFiles(app: App,
|
|
|
140
163
|
hasAuth: app.hasAuth,
|
|
141
164
|
domainName: app.name,
|
|
142
165
|
auth: view.auth,
|
|
143
|
-
subPage:
|
|
166
|
+
subPage: filterChildren,
|
|
144
167
|
documentTitle: app.documentTitle,
|
|
145
168
|
router: {
|
|
146
169
|
notFound: '/',
|
package/src/server/createUiTs.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Logic, TypeAnnotation, Param, LogicItem, NumericLiteral, BooleanLiteral, StringLiteral, Identifier, MemberExpression } from '..';
|
|
2
2
|
|
|
3
3
|
const naslStdlibMap: any = {
|
|
4
|
-
'nasl.core.ts': require('!!raw-loader
|
|
5
|
-
'nasl.collection.ts': require('!!raw-loader
|
|
6
|
-
'nasl.interface.ts': require('!!raw-loader
|
|
7
|
-
'nasl.util.ts': require('!!raw-loader
|
|
8
|
-
'nasl.ui.ts': require('!!raw-loader
|
|
9
|
-
'nasl.browser.ts': require('!!raw-loader
|
|
10
|
-
'nasl.auth.ts': require('!!raw-loader
|
|
11
|
-
'nasl.configuration.ts': require('!!raw-loader
|
|
12
|
-
'nasl.langUtil.ts': require('!!raw-loader
|
|
13
|
-
'nasl.annotation.ts': require('!!raw-loader
|
|
14
|
-
'nasl.validation.ts': require('!!raw-loader
|
|
15
|
-
'nasl.process.ts': require('!!raw-loader
|
|
4
|
+
'nasl.core.ts': require('!!raw-loader!./stdlib/nasl.core.ts').default,
|
|
5
|
+
'nasl.collection.ts': require('!!raw-loader!./stdlib/nasl.collection.ts').default,
|
|
6
|
+
'nasl.interface.ts': require('!!raw-loader!./stdlib/nasl.interface.ts').default,
|
|
7
|
+
'nasl.util.ts': require('!!raw-loader!./stdlib/nasl.util.ts').default,
|
|
8
|
+
'nasl.ui.ts': require('!!raw-loader!./stdlib/nasl.ui.ts').default,
|
|
9
|
+
'nasl.browser.ts': require('!!raw-loader!./stdlib/nasl.browser.ts').default,
|
|
10
|
+
'nasl.auth.ts': require('!!raw-loader!./stdlib/nasl.auth.ts').default,
|
|
11
|
+
'nasl.configuration.ts': require('!!raw-loader!./stdlib/nasl.configuration.ts').default,
|
|
12
|
+
'nasl.langUtil.ts': require('!!raw-loader!./stdlib/nasl.langUtil.ts').default,
|
|
13
|
+
'nasl.annotation.ts': require('!!raw-loader!./stdlib/nasl.annotation.ts').default,
|
|
14
|
+
'nasl.validation.ts': require('!!raw-loader!./stdlib/nasl.validation.ts').default,
|
|
15
|
+
'nasl.process.ts': require('!!raw-loader!./stdlib/nasl.process.ts').default,
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export default function formatUiTs(allComponent: any) {
|