@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.
Files changed (157) hide show
  1. package/out/concepts/BindAttribute__.js +7 -4
  2. package/out/concepts/BindAttribute__.js.map +1 -1
  3. package/out/concepts/CompletionProperty__.d.ts +0 -1
  4. package/out/concepts/CompletionProperty__.js +0 -1
  5. package/out/concepts/CompletionProperty__.js.map +1 -1
  6. package/out/concepts/DataSource__.js +1 -0
  7. package/out/concepts/DataSource__.js.map +1 -1
  8. package/out/concepts/Destination__.js +6 -1
  9. package/out/concepts/Destination__.js.map +1 -1
  10. package/out/concepts/Entity__.js +1 -0
  11. package/out/concepts/Entity__.js.map +1 -1
  12. package/out/concepts/Enum__.js +1 -0
  13. package/out/concepts/Enum__.js.map +1 -1
  14. package/out/concepts/Function__.d.ts +2 -1
  15. package/out/concepts/Function__.js +0 -28
  16. package/out/concepts/Function__.js.map +1 -1
  17. package/out/concepts/InterfaceParam__.js +6 -3
  18. package/out/concepts/InterfaceParam__.js.map +1 -1
  19. package/out/concepts/Interface__.js +1 -0
  20. package/out/concepts/Interface__.js.map +1 -1
  21. package/out/concepts/Logic__.js +1 -0
  22. package/out/concepts/Logic__.js.map +1 -1
  23. package/out/concepts/Param__.js +6 -3
  24. package/out/concepts/Param__.js.map +1 -1
  25. package/out/concepts/ProcessElement__.d.ts +4 -0
  26. package/out/concepts/ProcessElement__.js +31 -0
  27. package/out/concepts/ProcessElement__.js.map +1 -1
  28. package/out/concepts/Process__.js +1 -0
  29. package/out/concepts/Process__.js.map +1 -1
  30. package/out/concepts/Return__.js +6 -3
  31. package/out/concepts/Return__.js.map +1 -1
  32. package/out/concepts/Role__.js +1 -0
  33. package/out/concepts/Role__.js.map +1 -1
  34. package/out/concepts/Structure__.js +1 -0
  35. package/out/concepts/Structure__.js.map +1 -1
  36. package/out/concepts/TypeAnnotation__.js +3 -14
  37. package/out/concepts/TypeAnnotation__.js.map +1 -1
  38. package/out/concepts/Unparsed__.js +3 -3
  39. package/out/concepts/Unparsed__.js.map +1 -1
  40. package/out/concepts/Variable__.js +6 -3
  41. package/out/concepts/Variable__.js.map +1 -1
  42. package/out/concepts/ViewElement__.js.map +1 -1
  43. package/out/concepts/View__.js +1 -0
  44. package/out/concepts/View__.js.map +1 -1
  45. package/out/concepts/basics/stdlib/nasl.collection.js +12 -0
  46. package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -1
  47. package/out/concepts/basics/stdlib/nasl.util.js +187 -5
  48. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  49. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +1 -1
  50. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -1
  51. package/out/enums/KEYWORDS.d.ts +1 -0
  52. package/out/enums/KEYWORDS.js +16 -1
  53. package/out/enums/KEYWORDS.js.map +1 -1
  54. package/out/generator/genBundleFiles.js +25 -1
  55. package/out/generator/genBundleFiles.js.map +1 -1
  56. package/out/server/createUiTs.js +12 -12
  57. package/out/server/createUiTs.js.map +1 -1
  58. package/out/server/formatTsUtils.d.ts +21 -0
  59. package/out/server/formatTsUtils.js +323 -0
  60. package/out/server/formatTsUtils.js.map +1 -0
  61. package/out/server/getLogics.js +18 -17
  62. package/out/server/getLogics.js.map +1 -1
  63. package/out/server/getMemberIdentifier.d.ts +1 -12
  64. package/out/server/getMemberIdentifier.js +11 -264
  65. package/out/server/getMemberIdentifier.js.map +1 -1
  66. package/out/server/getProcesses.js +9 -18
  67. package/out/server/getProcesses.js.map +1 -1
  68. package/out/server/naslServer.d.ts +48 -0
  69. package/out/server/naslServer.js +58 -13
  70. package/out/server/naslServer.js.map +1 -1
  71. package/out/server/stdlib/nasl.annotation.d.ts +4 -0
  72. package/out/server/stdlib/nasl.annotation.js +1 -0
  73. package/out/server/stdlib/nasl.annotation.js.map +1 -0
  74. package/out/server/stdlib/nasl.auth.d.ts +30 -0
  75. package/out/server/stdlib/nasl.auth.js +1 -0
  76. package/out/server/stdlib/nasl.auth.js.map +1 -0
  77. package/out/server/stdlib/nasl.browser.d.ts +5 -0
  78. package/out/server/stdlib/nasl.browser.js +1 -0
  79. package/out/server/stdlib/nasl.browser.js.map +1 -0
  80. package/out/server/stdlib/nasl.collection.d.ts +22 -0
  81. package/out/server/stdlib/nasl.collection.js +1 -0
  82. package/out/server/stdlib/nasl.collection.js.map +1 -0
  83. package/out/server/stdlib/nasl.configuration.d.ts +3 -0
  84. package/out/server/stdlib/nasl.configuration.js +1 -0
  85. package/out/server/stdlib/nasl.configuration.js.map +1 -0
  86. package/out/server/stdlib/nasl.core.d.ts +104 -0
  87. package/out/server/stdlib/nasl.core.js +1 -0
  88. package/out/server/stdlib/nasl.core.js.map +1 -0
  89. package/out/server/stdlib/nasl.interface.d.ts +7 -0
  90. package/out/server/stdlib/nasl.interface.js +1 -0
  91. package/out/server/stdlib/nasl.interface.js.map +1 -0
  92. package/out/server/stdlib/nasl.langUtil.d.ts +28 -0
  93. package/out/server/stdlib/nasl.langUtil.js +1 -0
  94. package/out/server/stdlib/nasl.langUtil.js.map +1 -0
  95. package/out/server/stdlib/nasl.process.d.ts +50 -0
  96. package/out/server/stdlib/nasl.process.js +1 -0
  97. package/out/server/stdlib/nasl.process.js.map +1 -0
  98. package/out/server/stdlib/nasl.ui.d.ts +186 -0
  99. package/out/server/stdlib/nasl.ui.definition.d.ts +1072 -0
  100. package/out/server/stdlib/nasl.ui.definition.js +632 -0
  101. package/out/server/stdlib/nasl.ui.definition.js.map +1 -0
  102. package/out/server/stdlib/nasl.ui.js +1 -0
  103. package/out/server/stdlib/nasl.ui.js.map +1 -0
  104. package/out/server/stdlib/nasl.util.d.ts +74 -0
  105. package/out/server/stdlib/nasl.util.js +4 -0
  106. package/out/server/stdlib/nasl.util.js.map +1 -0
  107. package/out/server/stdlib/nasl.validation.d.ts +32 -0
  108. package/out/server/stdlib/nasl.validation.js +1 -0
  109. package/out/server/stdlib/nasl.validation.js.map +1 -0
  110. package/out/templator/genQueryComponent.js +8 -8
  111. package/out/templator/genQueryComponent.js.map +1 -1
  112. package/package.json +1 -1
  113. package/src/concepts/BindAttribute__.ts +7 -24
  114. package/src/concepts/CompletionProperty__.ts +0 -1
  115. package/src/concepts/DataSource__.ts +1 -0
  116. package/src/concepts/Destination__.ts +6 -1
  117. package/src/concepts/Entity__.ts +1 -0
  118. package/src/concepts/Enum__.ts +1 -0
  119. package/src/concepts/InterfaceParam__.ts +6 -3
  120. package/src/concepts/Interface__.ts +1 -0
  121. package/src/concepts/Logic__.ts +1 -0
  122. package/src/concepts/Param__.ts +5 -3
  123. package/src/concepts/ProcessElement__.ts +35 -1
  124. package/src/concepts/Process__.ts +1 -0
  125. package/src/concepts/Return__.ts +5 -3
  126. package/src/concepts/Role__.ts +1 -0
  127. package/src/concepts/Structure__.ts +1 -0
  128. package/src/concepts/TypeAnnotation__.ts +3 -30
  129. package/src/concepts/Unparsed__.ts +3 -10
  130. package/src/concepts/Variable__.ts +5 -3
  131. package/src/concepts/ViewElement__.ts +1 -19
  132. package/src/concepts/View__.ts +1 -0
  133. package/src/concepts/basics/stdlib/nasl.collection.ts +12 -0
  134. package/src/concepts/basics/stdlib/nasl.util.ts +187 -5
  135. package/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts +1 -1
  136. package/src/enums/KEYWORDS.ts +16 -0
  137. package/src/generator/genBundleFiles.ts +24 -1
  138. package/src/server/createUiTs.ts +12 -12
  139. package/src/server/formatTsUtils.ts +319 -0
  140. package/src/server/getLogics.ts +18 -17
  141. package/src/server/getMemberIdentifier.ts +10 -264
  142. package/src/server/getProcesses.ts +10 -19
  143. package/src/server/naslServer.ts +58 -12
  144. package/src/server/stdlib/nasl.annotation.ts +4 -0
  145. package/src/server/stdlib/nasl.auth.ts +31 -0
  146. package/src/server/stdlib/nasl.browser.ts +5 -0
  147. package/src/server/stdlib/nasl.collection.ts +22 -0
  148. package/src/server/stdlib/nasl.configuration.ts +3 -0
  149. package/src/server/stdlib/nasl.core.ts +128 -0
  150. package/src/server/stdlib/nasl.interface.ts +7 -0
  151. package/src/server/stdlib/nasl.langUtil.ts +31 -0
  152. package/src/server/stdlib/nasl.process.ts +87 -0
  153. package/src/server/stdlib/nasl.ui.definition.ts +1760 -0
  154. package/src/server/stdlib/nasl.ui.ts +189 -0
  155. package/src/server/stdlib/nasl.util.ts +84 -0
  156. package/src/server/stdlib/nasl.validation.ts +33 -0
  157. 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
- let typeAnnotation: TypeAnnotation = options;
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
- let str = `${this.typeName}`;
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 ? ` ${this.code} ` : '';
64
+ return this.code || '';
72
65
  }
73
66
 
74
67
  toUI(): string {
75
- return this.code ? ` ${this.code} ` : '';
68
+ return this.code || '';
76
69
  }
77
70
 
78
71
  toJS(): string {
79
- return this.code ? ` ${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
- properties[i].typeAnnotation = this?.typeAnnotation?.typeArguments[0];
350
- properties[i].parentNode = this;
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
- getBindAttributeExistingNames(excludedList: Array<BindAttribute> = []) {
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 页面元素名称
@@ -1813,6 +1813,7 @@ export class View extends BaseNode {
1813
1813
  code += this.toEmbeddedTS(state);
1814
1814
  } catch (err) {
1815
1815
  code += '';
1816
+ console.log(err);
1816
1817
  }
1817
1818
 
1818
1819
  code += '}\n';
@@ -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: 'seperator',
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: 'seperator',
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: 'str1',
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: 'addlist',
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, {
@@ -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: view.children,
166
+ subPage: filterChildren,
144
167
  documentTitle: app.documentTitle,
145
168
  router: {
146
169
  notFound: '/',
@@ -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!../../../file-storage/data/stdlib/nasl.core.ts').default,
5
- 'nasl.collection.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.collection.ts').default,
6
- 'nasl.interface.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.interface.ts').default,
7
- 'nasl.util.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.util.ts').default,
8
- 'nasl.ui.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.ui.ts').default,
9
- 'nasl.browser.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.browser.ts').default,
10
- 'nasl.auth.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.auth.ts').default,
11
- 'nasl.configuration.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.configuration.ts').default,
12
- 'nasl.langUtil.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.langUtil.ts').default,
13
- 'nasl.annotation.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.annotation.ts').default,
14
- 'nasl.validation.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.validation.ts').default,
15
- 'nasl.process.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.process.ts').default,
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) {