@lcap/nasl 2.20.0-beta.4 → 2.20.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 (217) hide show
  1. package/out/automate/engine/2.14-components.d.ts +1115 -0
  2. package/out/automate/engine/2.14-components.js +1087 -0
  3. package/out/automate/engine/2.14-components.js.map +1 -0
  4. package/out/automate/engine/operators.d.ts +0 -9
  5. package/out/automate/engine/viewCache.d.ts +0 -1
  6. package/out/automate/template/myProcess.d.ts +0 -1
  7. package/out/common/BaseNode.js.map +1 -1
  8. package/out/common/Command.d.ts +1 -1
  9. package/out/common/EventEmitter.d.ts +1 -1
  10. package/out/concepts/Anchor__.js.map +1 -1
  11. package/out/concepts/AnonymousFunction__.js.map +1 -1
  12. package/out/concepts/App__.js +13 -0
  13. package/out/concepts/App__.js.map +1 -1
  14. package/out/concepts/Argument__.js.map +1 -1
  15. package/out/concepts/Assignee__.js.map +1 -1
  16. package/out/concepts/AssignmentLine__.js.map +1 -1
  17. package/out/concepts/Assignment__.js.map +1 -1
  18. package/out/concepts/Attribute__.d.ts +9 -14
  19. package/out/concepts/Attribute__.js +12 -39
  20. package/out/concepts/Attribute__.js.map +1 -1
  21. package/out/concepts/BatchAssignment__.js.map +1 -1
  22. package/out/concepts/BinaryExpression__.js.map +1 -1
  23. package/out/concepts/BindAttribute__.js.map +1 -1
  24. package/out/concepts/BindDirective__.js +1 -1
  25. package/out/concepts/BindDirective__.js.map +1 -1
  26. package/out/concepts/BindEvent__.js.map +1 -1
  27. package/out/concepts/BindStyle__.js +1 -1
  28. package/out/concepts/BindStyle__.js.map +1 -1
  29. package/out/concepts/BooleanLiteral__.js.map +1 -1
  30. package/out/concepts/CallFunction__.js.map +1 -1
  31. package/out/concepts/CallInterface__.js.map +1 -1
  32. package/out/concepts/CallLogic__.js +13 -6
  33. package/out/concepts/CallLogic__.js.map +1 -1
  34. package/out/concepts/CallQueryComponent__.js.map +1 -1
  35. package/out/concepts/Comment__.js.map +1 -1
  36. package/out/concepts/CompletionProperty__.js.map +1 -1
  37. package/out/concepts/ConfigGroup__.js.map +1 -1
  38. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  39. package/out/concepts/ConfigProperty__.js +8 -6
  40. package/out/concepts/ConfigProperty__.js.map +1 -1
  41. package/out/concepts/Configuration__.js.map +1 -1
  42. package/out/concepts/Constant__.js.map +1 -1
  43. package/out/concepts/DataElement__.js.map +1 -1
  44. package/out/concepts/DataSource__.js.map +1 -1
  45. package/out/concepts/Destination__.js +1 -1
  46. package/out/concepts/Destination__.js.map +1 -1
  47. package/out/concepts/End__.js.map +1 -1
  48. package/out/concepts/EntityIndex__.d.ts +1 -1
  49. package/out/concepts/EntityIndex__.js.map +1 -1
  50. package/out/concepts/EntityProperty__.d.ts +1 -1
  51. package/out/concepts/EntityProperty__.js.map +1 -1
  52. package/out/concepts/Entity__.js.map +1 -1
  53. package/out/concepts/EnumItem__.js.map +1 -1
  54. package/out/concepts/Enum__.js.map +1 -1
  55. package/out/concepts/Event__.js.map +1 -1
  56. package/out/concepts/ExternalDestination__.js +1 -1
  57. package/out/concepts/ExternalDestination__.js.map +1 -1
  58. package/out/concepts/ForEachStatement__.js.map +1 -1
  59. package/out/concepts/FrontendLibrary__.d.ts +212 -0
  60. package/out/concepts/FrontendLibrary__.js +349 -0
  61. package/out/concepts/FrontendLibrary__.js.map +1 -0
  62. package/out/concepts/Frontend__.js.map +1 -1
  63. package/out/concepts/Function__.js.map +1 -1
  64. package/out/concepts/Identifier__.js.map +1 -1
  65. package/out/concepts/IfStatement__.js.map +1 -1
  66. package/out/concepts/InterfaceParam__.js.map +1 -1
  67. package/out/concepts/Interface__.js.map +1 -1
  68. package/out/concepts/JSBlock__.js.map +1 -1
  69. package/out/concepts/LogicItem__.js.map +1 -1
  70. package/out/concepts/Logic__.js +26 -13
  71. package/out/concepts/Logic__.js.map +1 -1
  72. package/out/concepts/MatchCase__.js.map +1 -1
  73. package/out/concepts/Match__.js.map +1 -1
  74. package/out/concepts/MemberExpression__.js.map +1 -1
  75. package/out/concepts/Module__.d.ts +49 -49
  76. package/out/concepts/Module__.js +50 -50
  77. package/out/concepts/Module__.js.map +1 -1
  78. package/out/concepts/Namespace__.js.map +1 -1
  79. package/out/concepts/NewComposite__.js.map +1 -1
  80. package/out/concepts/NewList__.js.map +1 -1
  81. package/out/concepts/NewMap__.js.map +1 -1
  82. package/out/concepts/New__.js.map +1 -1
  83. package/out/concepts/NullLiteral__.js.map +1 -1
  84. package/out/concepts/NumericLiteral__.js.map +1 -1
  85. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  86. package/out/concepts/Param__.js.map +1 -1
  87. package/out/concepts/Point__.js.map +1 -1
  88. package/out/concepts/ProcessComponent__.js.map +1 -1
  89. package/out/concepts/ProcessElement__.js.map +1 -1
  90. package/out/concepts/ProcessOutcome__.js.map +1 -1
  91. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  92. package/out/concepts/Process__.js.map +1 -1
  93. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  94. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  95. package/out/concepts/QueryFromExpression__.js.map +1 -1
  96. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  97. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  98. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  99. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  100. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  101. package/out/concepts/Rect__.js.map +1 -1
  102. package/out/concepts/Return__.js +3 -0
  103. package/out/concepts/Return__.js.map +1 -1
  104. package/out/concepts/Role__.js.map +1 -1
  105. package/out/concepts/SelectMembers__.js.map +1 -1
  106. package/out/concepts/Slot__.d.ts +16 -0
  107. package/out/concepts/Slot__.js +43 -0
  108. package/out/concepts/Slot__.js.map +1 -1
  109. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  110. package/out/concepts/Start__.js.map +1 -1
  111. package/out/concepts/StringInterpolation__.js +1 -1
  112. package/out/concepts/StringInterpolation__.js.map +1 -1
  113. package/out/concepts/StringLiteral__.js.map +1 -1
  114. package/out/concepts/StructureProperty__.js.map +1 -1
  115. package/out/concepts/Structure__.js.map +1 -1
  116. package/out/concepts/SwitchCase__.js.map +1 -1
  117. package/out/concepts/SwitchStatement__.js.map +1 -1
  118. package/out/concepts/Theme__.js.map +1 -1
  119. package/out/concepts/Transactional__.js.map +1 -1
  120. package/out/concepts/TypeAnnotation__.js +1 -1
  121. package/out/concepts/TypeAnnotation__.js.map +1 -1
  122. package/out/concepts/TypeParam__.js.map +1 -1
  123. package/out/concepts/UnaryExpression__.js.map +1 -1
  124. package/out/concepts/Unparsed__.js.map +1 -1
  125. package/out/concepts/UseComponent__.js.map +1 -1
  126. package/out/concepts/ValidationRule__.js.map +1 -1
  127. package/out/concepts/Variable__.js +3 -0
  128. package/out/concepts/Variable__.js.map +1 -1
  129. package/out/concepts/ViewBlock__.d.ts +34 -0
  130. package/out/concepts/ViewBlock__.js +82 -0
  131. package/out/concepts/ViewBlock__.js.map +1 -0
  132. package/out/concepts/ViewComponent__.d.ts +85 -0
  133. package/out/concepts/ViewComponent__.js +104 -0
  134. package/out/concepts/ViewComponent__.js.map +1 -1
  135. package/out/concepts/ViewElement__.js.map +1 -1
  136. package/out/concepts/View__.d.ts +1 -0
  137. package/out/concepts/View__.js +13 -8
  138. package/out/concepts/View__.js.map +1 -1
  139. package/out/concepts/WhileStatement__.js.map +1 -1
  140. package/out/concepts/index__.d.ts +2 -0
  141. package/out/concepts/index__.js +2 -0
  142. package/out/concepts/index__.js.map +1 -1
  143. package/out/config.d.ts +1 -1
  144. package/out/decorators/index.d.ts +2 -2
  145. package/out/generator/permission.d.ts +1 -1
  146. package/out/server/getLogics.js +12 -0
  147. package/out/server/getLogics.js.map +1 -1
  148. package/out/server/getProcesses.d.ts +3 -3
  149. package/out/server/getScope.d.ts +1 -1
  150. package/out/server/naslServer.d.ts +1 -1
  151. package/out/server/naslServer.js +70 -36
  152. package/out/server/naslServer.js.map +1 -1
  153. package/out/server/translator.js +1 -1
  154. package/out/service/storage/init.js +1 -1
  155. package/out/service/storage/init.js.map +1 -1
  156. package/out/translator/index.d.ts +1 -1
  157. package/out/translator/lsp.d.ts +3 -3
  158. package/out/utils/index.d.ts +4 -4
  159. package/package.json +1 -1
  160. package/src/concepts/App__.ts +13 -0
  161. package/src/concepts/Attribute__.ts +10 -59
  162. package/src/concepts/BindAttribute__.ts +11 -12
  163. package/src/concepts/BindDirective__.ts +16 -1
  164. package/src/concepts/BindStyle__.ts +16 -1
  165. package/src/concepts/CallLogic__.ts +12 -37
  166. package/src/concepts/ConfigProperty__.ts +8 -6
  167. package/src/concepts/Destination__.ts +19 -1
  168. package/src/concepts/ExternalDestination__.ts +6 -6
  169. package/src/concepts/FrontendLibrary__.ts +518 -0
  170. package/src/concepts/Frontend__.ts +12 -1
  171. package/src/concepts/Identifier__.ts +9 -0
  172. package/src/concepts/Logic__.ts +27 -14
  173. package/src/concepts/Module__.ts +92 -121
  174. package/src/concepts/Param__.ts +4 -0
  175. package/src/concepts/ProcessElement__.ts +23 -1
  176. package/src/concepts/Process__.ts +16 -1
  177. package/src/concepts/Return__.ts +2 -0
  178. package/src/concepts/Slot__.ts +55 -0
  179. package/src/concepts/StringInterpolation__.ts +1 -1
  180. package/src/concepts/TypeAnnotation__.ts +1 -1
  181. package/src/concepts/ValidationRule__.ts +9 -9
  182. package/src/concepts/Variable__.ts +2 -0
  183. package/src/concepts/ViewBlock__.ts +91 -0
  184. package/src/concepts/ViewComponent__.ts +199 -0
  185. package/src/concepts/View__.ts +39 -10
  186. package/src/concepts/index__.ts +2 -0
  187. package/src/server/getLogics.ts +13 -0
  188. package/src/server/naslServer.ts +66 -34
  189. package/src/server/translator.ts +1 -1
  190. package/src/service/storage/init.ts +1 -1
  191. package/yarn-error.log +2087 -0
  192. package/sandbox/stdlib/dist/nasl.logging.js +0 -0
  193. package/sandbox/stdlib/dist/nasl.util.js +0 -0
  194. package/src/automate/engine/dist/index.dev.js +0 -517
  195. package/src/common/dist/BaseNode.js +0 -1101
  196. package/src/concepts/basics/stdlib/dist/nasl.util.js +0 -1602
  197. package/src/concepts/basics/stdlib/dist/reference2TypeAnnotationList.js +0 -24
  198. package/src/concepts/dist/BindAttribute__.js +0 -795
  199. package/src/concepts/dist/BindEvent__.js +0 -732
  200. package/src/concepts/dist/CallFunction__.js +0 -527
  201. package/src/concepts/dist/CallLogic__.js +0 -932
  202. package/src/concepts/dist/Destination__.js +0 -708
  203. package/src/concepts/dist/ExternalDestination__.js +0 -298
  204. package/src/concepts/dist/Identifier__.js +0 -311
  205. package/src/concepts/dist/StringInterpolation__.js +0 -231
  206. package/src/concepts/dist/TypeAnnotation__.js +0 -834
  207. package/src/concepts/dist/ViewElement__.js +0 -1692
  208. package/src/concepts/dist/View__.js +0 -1601
  209. package/src/generator/dist/genBundleFiles.js +0 -261
  210. package/src/generator/dist/genMetaData.js +0 -245
  211. package/src/generator/dist/permission.js +0 -405
  212. package/src/service/storage/dist/init.js +0 -579
  213. package/src/templator/dist/genEditTableBlock.js +0 -204
  214. package/src/templator/dist/genGridViewBlock.js +0 -265
  215. package/src/templator/dist/genListViewBlock.js +0 -84
  216. package/src/templator/dist/genTableBlock.js +0 -209
  217. package/src/templator/dist/utils.js +0 -527
@@ -182,7 +182,7 @@ export class Frontend extends BaseNode {
182
182
  });
183
183
  }
184
184
 
185
- getViewExistingNames(excludedList: Array<View> = []) {
185
+ getViewExistingNames(excludedList: Array<View> = []) {
186
186
  const excludedSet = new Set(excludedList);
187
187
  return ((this.views as View[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
188
188
  }
@@ -323,6 +323,7 @@ export class Frontend extends BaseNode {
323
323
  return node;
324
324
  }
325
325
 
326
+
326
327
  getVarExistingNames(excludedList: Array<Variable> = []) {
327
328
  const excludedSet = new Set(excludedList);
328
329
  return ((this.variables as Variable[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -464,6 +465,7 @@ export class Frontend extends BaseNode {
464
465
  return node;
465
466
  }
466
467
 
468
+
467
469
  getModuleExistingNames(excludedList: Array<Module> = []) {
468
470
  const excludedSet = new Set(excludedList);
469
471
  return ((this.componentDependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -605,6 +607,9 @@ export class Frontend extends BaseNode {
605
607
  return node;
606
608
  }
607
609
 
610
+
611
+
612
+
608
613
  /**
609
614
  * 删除页面
610
615
  * @param name 页面名称
@@ -653,6 +658,8 @@ export class Frontend extends BaseNode {
653
658
  return params;
654
659
  }
655
660
 
661
+
662
+
656
663
  /**
657
664
  * 删除变量
658
665
  * @param name 变量名称
@@ -701,6 +708,8 @@ export class Frontend extends BaseNode {
701
708
  return params;
702
709
  }
703
710
 
711
+
712
+
704
713
  /**
705
714
  * 删除主题
706
715
  * @param name 主题名称
@@ -749,6 +758,8 @@ export class Frontend extends BaseNode {
749
758
  return params;
750
759
  }
751
760
 
761
+
762
+
752
763
  /**
753
764
  * 删除模块
754
765
  * @param name 模块名称
@@ -39,6 +39,8 @@ export class Identifier extends LogicItem {
39
39
  @property()
40
40
  name: string = undefined;
41
41
 
42
+
43
+
42
44
  /**
43
45
  * @param source 需要合并的部分参数
44
46
  */
@@ -52,6 +54,13 @@ export class Identifier extends LogicItem {
52
54
  return super.from(source, parentNode, parentKey) as Identifier;
53
55
  }
54
56
 
57
+
58
+
59
+
60
+
61
+
62
+
63
+
55
64
  //================================================================================
56
65
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
57
66
  // 自动生成的代码已结束。下面可以手动编写。
@@ -1,3 +1,4 @@
1
+ import { FrontendLibrary } from './FrontendLibrary__';
1
2
  import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState, embeddedTSEmitter } from '../translator';
2
3
  import Namespace from './Namespace__';
3
4
  import CallQueryComponent from './CallQueryComponent__';
@@ -1611,19 +1612,28 @@ export class Logic extends BaseNode {
1611
1612
  const needGetSourceMapOqlList: Promise<any>[] = [];
1612
1613
  this.traverseChildren((el) => {
1613
1614
  if (el && (el instanceof BatchAssignment || (el instanceof Assignment && el.left?.name))) {
1614
- let jsCode = '';
1615
- try {
1616
- jsCode = el.toJS();
1617
- } catch (error) {
1618
-
1619
- }
1620
- const advanceVar = this.variables?.find((variable) => !variable.typeAnnotation && jsCode.startsWith(`${variable.name} = `));
1621
- if (advanceVar && !advanceMap.get(advanceVar)) {
1622
- advanceMap.set(advanceVar, el);
1623
- }
1624
- const advanceRn = this.returns?.find((ret) => !ret.typeAnnotation && jsCode.startsWith(`${ret.name} = `));
1625
- if (advanceRn && !advanceMap.get(advanceRn)) {
1626
- advanceMap.set(advanceRn, el);
1615
+ if (el instanceof Assignment) {
1616
+ const advanceVar = this.variables?.find((variable) => !variable.typeAnnotation && (el.left?.name === variable.name));
1617
+ if (advanceVar && !advanceMap.get(advanceVar)) {
1618
+ advanceMap.set(advanceVar, el);
1619
+ }
1620
+ const advanceRn = this.returns?.find((ret) => !ret.typeAnnotation && el.left?.name === ret.name);
1621
+ if (advanceRn && !advanceMap.get(advanceRn)) {
1622
+ advanceMap.set(advanceRn, el);
1623
+ }
1624
+ } else if (el instanceof BatchAssignment) {
1625
+ el.assignmentLines.forEach(({ leftIndex }) => {
1626
+ const leftCode
1627
+ = leftIndex.length === 1 ? el.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true })) : el.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true }));
1628
+ const advanceVar = this.variables?.find((variable) => !variable.typeAnnotation && (leftCode === variable.name));
1629
+ if (advanceVar && !advanceMap.get(advanceVar)) {
1630
+ advanceMap.set(advanceVar, el);
1631
+ }
1632
+ const advanceRn = this.returns?.find((ret) => !ret.typeAnnotation && leftCode === ret.name);
1633
+ if (advanceRn && !advanceMap.get(advanceRn)) {
1634
+ advanceMap.set(advanceRn, el);
1635
+ }
1636
+ });
1627
1637
  }
1628
1638
  }
1629
1639
  // 如果有sql查询组件就需要把他们存起来
@@ -1904,7 +1914,10 @@ export class Logic extends BaseNode {
1904
1914
  * @param name 一般不用传,用于 rename
1905
1915
  */
1906
1916
  getEmbeddedFilePath(name = this.name) {
1907
- const _path = this.module ? `/${this.module.parentKey}/${this.module.name}` : '';
1917
+ let _path = this.module ? `/${this.module.parentKey}/${this.module.name}` : '';
1918
+ if (this.parentNode instanceof FrontendLibrary) {
1919
+ _path += `/frontends/${this.parentNode.type}`;
1920
+ }
1908
1921
  return `/embedded/${this.app.name}${_path}/logics/${name}.ts`;
1909
1922
  }
1910
1923
 
@@ -24,6 +24,7 @@ import Interface from './Interface__';
24
24
  import View from './View__';
25
25
  import Variable from './Variable__';
26
26
  import Process from './Process__';
27
+ import FrontendLibrary from './FrontendLibrary__';
27
28
  import ViewComponent from './ViewComponent__';
28
29
  import Configuration from './Configuration__';
29
30
  import App from './App__';
@@ -130,10 +131,10 @@ export class Module extends BaseNode {
130
131
  processes: Array<Process> = [];
131
132
 
132
133
  /**
133
- * 页面组件列表
134
+ * 端包列表
134
135
  */
135
- @property('ViewComponent')
136
- viewComponents: Array<ViewComponent> = [];
136
+ @property('FrontendLibrary')
137
+ frontends: Array<FrontendLibrary> = [];
137
138
 
138
139
  /**
139
140
  * 配置管理
@@ -172,9 +173,8 @@ export class Module extends BaseNode {
172
173
  }
173
174
  return params;
174
175
  }
175
-
176
176
 
177
- getDataSourceExistingNames(excludedList: Array<DataSource> = []) {
177
+ getDataSourceExistingNames(excludedList: Array<DataSource> = []) {
178
178
  const excludedSet = new Set(excludedList);
179
179
  return ((this.dataSources as DataSource[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
180
180
  }
@@ -315,7 +315,6 @@ export class Module extends BaseNode {
315
315
  return node;
316
316
  }
317
317
 
318
-
319
318
  getStructureExistingNames(excludedList: Array<Structure> = []) {
320
319
  const excludedSet = new Set(excludedList);
321
320
  return ((this.structures as Structure[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -457,7 +456,6 @@ export class Module extends BaseNode {
457
456
  return node;
458
457
  }
459
458
 
460
-
461
459
  getEnumExistingNames(excludedList: Array<Enum> = []) {
462
460
  const excludedSet = new Set(excludedList);
463
461
  return ((this.enums as Enum[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -599,7 +597,6 @@ export class Module extends BaseNode {
599
597
  return node;
600
598
  }
601
599
 
602
-
603
600
  getLogicExistingNames(excludedList: Array<Logic> = []) {
604
601
  const excludedSet = new Set(excludedList);
605
602
  return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -741,7 +738,6 @@ export class Module extends BaseNode {
741
738
  return node;
742
739
  }
743
740
 
744
-
745
741
  getInterfaceExistingNames(excludedList: Array<Interface> = []) {
746
742
  const excludedSet = new Set(excludedList);
747
743
  return ((this.interfaces as Interface[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -883,7 +879,6 @@ export class Module extends BaseNode {
883
879
  return node;
884
880
  }
885
881
 
886
-
887
882
  getViewExistingNames(excludedList: Array<View> = []) {
888
883
  const excludedSet = new Set(excludedList);
889
884
  return ((this.views as View[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -1025,7 +1020,6 @@ export class Module extends BaseNode {
1025
1020
  return node;
1026
1021
  }
1027
1022
 
1028
-
1029
1023
  getVarExistingNames(excludedList: Array<Variable> = []) {
1030
1024
  const excludedSet = new Set(excludedList);
1031
1025
  return ((this.frontendVariables as Variable[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -1167,7 +1161,6 @@ export class Module extends BaseNode {
1167
1161
  return node;
1168
1162
  }
1169
1163
 
1170
-
1171
1164
  getProcessExistingNames(excludedList: Array<Process> = []) {
1172
1165
  const excludedSet = new Set(excludedList);
1173
1166
  return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
@@ -1309,151 +1302,147 @@ export class Module extends BaseNode {
1309
1302
  return node;
1310
1303
  }
1311
1304
 
1312
-
1313
- getViewComponentExistingNames(excludedList: Array<ViewComponent> = []) {
1305
+ getFrontendLibraryExistingNames(excludedList: Array<FrontendLibrary> = []) {
1314
1306
  const excludedSet = new Set(excludedList);
1315
- return ((this.viewComponents as ViewComponent[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1307
+ return ((this.frontends as FrontendLibrary[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
1316
1308
  }
1317
- getViewComponentUniqueName(name = 'viewComponent1') {
1318
- return utils.unique(name, this.getViewComponentExistingNames(), undefined, false);
1309
+ getFrontendLibraryUniqueName(name = 'frontendLibrary1') {
1310
+ return utils.unique(name, this.getFrontendLibraryExistingNames(), undefined, false);
1319
1311
  }
1320
1312
 
1321
1313
  /**
1322
- * 插入页面组件
1314
+ * 插入端包
1323
1315
  * @internal
1324
- * @param name 页面组件名称,如果不填会自动生成一个唯一名称
1316
+ * @param name 端包名称,如果不填会自动生成一个唯一名称
1325
1317
  */
1326
- _insertViewComponentAt(name: string, index: number): ViewComponent;
1318
+ _insertFrontendLibraryAt(name: string, index: number): FrontendLibrary;
1327
1319
 
1328
1320
  /**
1329
- * 插入页面组件
1321
+ * 插入端包
1330
1322
  * @internal
1331
- * @param viewComponentOptions 页面组件参数
1323
+ * @param frontendLibraryOptions 端包参数
1332
1324
  */
1333
- _insertViewComponentAt(viewComponentOptions: Partial<ViewComponent>, index: number): ViewComponent;
1325
+ _insertFrontendLibraryAt(frontendLibraryOptions: Partial<FrontendLibrary>, index: number): FrontendLibrary;
1334
1326
 
1335
1327
  /**
1336
- * 插入页面组件
1328
+ * 插入端包
1337
1329
  * @internal
1338
- * @param viewComponent 已有的页面组件实例
1330
+ * @param frontendLibrary 已有的端包实例
1339
1331
  */
1340
- _insertViewComponentAt(viewComponent: ViewComponent, index: number): ViewComponent;
1332
+ _insertFrontendLibraryAt(frontendLibrary: FrontendLibrary, index: number): FrontendLibrary;
1341
1333
 
1342
- _insertViewComponentAt(options: string | Partial<ViewComponent> | ViewComponent, index: number) {
1343
- const viewComponentOptions: any = {};
1344
- const relationOptions = { parentNode: this, parentKey: 'viewComponents' };
1345
- let viewComponent: ViewComponent;
1334
+ _insertFrontendLibraryAt(options: string | Partial<FrontendLibrary> | FrontendLibrary, index: number) {
1335
+ const frontendLibraryOptions: any = {};
1336
+ const relationOptions = { parentNode: this, parentKey: 'frontends' };
1337
+ let frontendLibrary: FrontendLibrary;
1346
1338
  if (!options) {
1347
- viewComponent = ViewComponent.from({
1348
- ...viewComponentOptions,
1349
- name: this.getViewComponentUniqueName(),
1350
- }, this, 'viewComponents');
1339
+ frontendLibrary = FrontendLibrary.from({
1340
+ ...frontendLibraryOptions,
1341
+ name: this.getFrontendLibraryUniqueName(),
1342
+ }, this, 'frontends');
1351
1343
  } else if (typeof options === 'string') {
1352
- viewComponent = ViewComponent.from({
1353
- ...viewComponentOptions,
1344
+ frontendLibrary = FrontendLibrary.from({
1345
+ ...frontendLibraryOptions,
1354
1346
  name: options,
1355
- }, this, 'viewComponents');
1356
- } else if (options instanceof ViewComponent) {
1347
+ }, this, 'frontends');
1348
+ } else if (options instanceof FrontendLibrary) {
1357
1349
  options.ensureDelete(); // 同一实例不支持多处存在
1358
- viewComponent = options;
1359
- Object.assign(viewComponent, relationOptions);
1350
+ frontendLibrary = options;
1351
+ Object.assign(frontendLibrary, relationOptions);
1360
1352
  } else {
1361
- viewComponent = ViewComponent.from({
1362
- ...viewComponentOptions,
1353
+ frontendLibrary = FrontendLibrary.from({
1354
+ ...frontendLibraryOptions,
1363
1355
  ...options,
1364
- }, this, 'viewComponents');
1356
+ }, this, 'frontends');
1365
1357
  }
1366
- this.viewComponents.splice(index, 0, viewComponent);
1367
- return viewComponent;
1358
+ this.frontends.splice(index, 0, frontendLibrary);
1359
+ return frontendLibrary;
1368
1360
  }
1369
1361
 
1370
1362
  /**
1371
- * 插入页面组件
1372
- * @param name 页面组件名称,如果不填会自动生成一个唯一名称
1363
+ * 插入端包
1364
+ * @param name 端包名称,如果不填会自动生成一个唯一名称
1373
1365
  */
1374
- insertViewComponentAt(name: string, index: number): ViewComponent;
1366
+ insertFrontendLibraryAt(name: string, index: number): FrontendLibrary;
1375
1367
 
1376
1368
  /**
1377
- * 插入页面组件
1378
- * @param viewComponentOptions 页面组件参数
1369
+ * 插入端包
1370
+ * @param frontendLibraryOptions 端包参数
1379
1371
  */
1380
- insertViewComponentAt(viewComponentOptions: Partial<ViewComponent>, index: number): ViewComponent;
1372
+ insertFrontendLibraryAt(frontendLibraryOptions: Partial<FrontendLibrary>, index: number): FrontendLibrary;
1381
1373
 
1382
1374
  /**
1383
- * 插入页面组件
1384
- * @param viewComponent 已有的页面组件实例
1375
+ * 插入端包
1376
+ * @param frontendLibrary 已有的端包实例
1385
1377
  */
1386
- insertViewComponentAt(viewComponent: ViewComponent, index: number): ViewComponent;
1378
+ insertFrontendLibraryAt(frontendLibrary: FrontendLibrary, index: number): FrontendLibrary;
1387
1379
 
1388
- insertViewComponentAt(options: string | Partial<ViewComponent> | ViewComponent, index: number) {
1389
- const node = this._insertViewComponentAt(options as any, index);
1380
+ insertFrontendLibraryAt(options: string | Partial<FrontendLibrary> | FrontendLibrary, index: number) {
1381
+ const node = this._insertFrontendLibraryAt(options as any, index);
1390
1382
  node.create({
1391
1383
  index,
1392
1384
  parentNode: this,
1393
- parentKey: 'viewComponents',
1385
+ parentKey: 'frontends',
1394
1386
  });
1395
1387
  return node;
1396
1388
  }
1397
1389
 
1398
1390
  /**
1399
- * 添加页面组件
1391
+ * 添加端包
1400
1392
  * @internal
1401
- * @param name 页面组件名称,如果不填会自动生成一个唯一名称
1393
+ * @param name 端包名称,如果不填会自动生成一个唯一名称
1402
1394
  */
1403
- _addViewComponent(name?: string): ViewComponent;
1395
+ _addFrontendLibrary(name?: string): FrontendLibrary;
1404
1396
 
1405
1397
  /**
1406
- * 添加页面组件
1398
+ * 添加端包
1407
1399
  * @internal
1408
- * @param viewComponentOptions 页面组件参数
1400
+ * @param frontendLibraryOptions 端包参数
1409
1401
  */
1410
- _addViewComponent(viewComponentOptions: Partial<ViewComponent>): ViewComponent;
1402
+ _addFrontendLibrary(frontendLibraryOptions: Partial<FrontendLibrary>): FrontendLibrary;
1411
1403
 
1412
1404
  /**
1413
- * 添加页面组件
1405
+ * 添加端包
1414
1406
  * @internal
1415
- * @param viewComponent 已有的页面组件实例
1407
+ * @param frontendLibrary 已有的端包实例
1416
1408
  */
1417
- _addViewComponent(viewComponent: ViewComponent): ViewComponent;
1409
+ _addFrontendLibrary(frontendLibrary: FrontendLibrary): FrontendLibrary;
1418
1410
 
1419
- _addViewComponent(options?: string | Partial<ViewComponent> | ViewComponent) {
1420
- const index = this.viewComponents.length;
1421
- return this._insertViewComponentAt(options as any, index);
1411
+ _addFrontendLibrary(options?: string | Partial<FrontendLibrary> | FrontendLibrary) {
1412
+ const index = this.frontends.length;
1413
+ return this._insertFrontendLibraryAt(options as any, index);
1422
1414
  }
1423
1415
 
1424
1416
  /**
1425
- * 添加页面组件
1417
+ * 添加端包
1426
1418
  * @internal
1427
- * @param name 页面组件名称,如果不填会自动生成一个唯一名称
1419
+ * @param name 端包名称,如果不填会自动生成一个唯一名称
1428
1420
  */
1429
- addViewComponent(name?: string): ViewComponent;
1421
+ addFrontendLibrary(name?: string): FrontendLibrary;
1430
1422
 
1431
1423
  /**
1432
- * 添加页面组件
1433
- * @param viewComponentOptions 页面组件参数
1424
+ * 添加端包
1425
+ * @param frontendLibraryOptions 端包参数
1434
1426
  */
1435
- addViewComponent(viewComponentOptions: Partial<ViewComponent>): ViewComponent;
1427
+ addFrontendLibrary(frontendLibraryOptions: Partial<FrontendLibrary>): FrontendLibrary;
1436
1428
 
1437
1429
  /**
1438
- * 添加页面组件
1439
- * @param viewComponent 已有的页面组件实例
1430
+ * 添加端包
1431
+ * @param frontendLibrary 已有的端包实例
1440
1432
  */
1441
- addViewComponent(viewComponent: ViewComponent): ViewComponent;
1433
+ addFrontendLibrary(frontendLibrary: FrontendLibrary): FrontendLibrary;
1442
1434
 
1443
- addViewComponent(options?: string | Partial<ViewComponent> | ViewComponent) {
1444
- const node = this._addViewComponent(options as any);
1445
- const index = this.viewComponents.indexOf(node);
1435
+ addFrontendLibrary(options?: string | Partial<FrontendLibrary> | FrontendLibrary) {
1436
+ const node = this._addFrontendLibrary(options as any);
1437
+ const index = this.frontends.indexOf(node);
1446
1438
  node.create({
1447
1439
  index,
1448
1440
  parentNode: this,
1449
- parentKey: 'viewComponents',
1441
+ parentKey: 'frontends',
1450
1442
  });
1451
1443
  return node;
1452
1444
  }
1453
1445
 
1454
-
1455
-
1456
-
1457
1446
  /**
1458
1447
  * 删除数据源
1459
1448
  * @param name 数据源名称
@@ -1502,8 +1491,6 @@ export class Module extends BaseNode {
1502
1491
  return params;
1503
1492
  }
1504
1493
 
1505
-
1506
-
1507
1494
  /**
1508
1495
  * 删除数据结构
1509
1496
  * @param name 数据结构名称
@@ -1552,8 +1539,6 @@ export class Module extends BaseNode {
1552
1539
  return params;
1553
1540
  }
1554
1541
 
1555
-
1556
-
1557
1542
  /**
1558
1543
  * 删除枚举
1559
1544
  * @param name 枚举名称
@@ -1602,8 +1587,6 @@ export class Module extends BaseNode {
1602
1587
  return params;
1603
1588
  }
1604
1589
 
1605
-
1606
-
1607
1590
  /**
1608
1591
  * 删除逻辑
1609
1592
  * @param name 逻辑名称
@@ -1652,8 +1635,6 @@ export class Module extends BaseNode {
1652
1635
  return params;
1653
1636
  }
1654
1637
 
1655
-
1656
-
1657
1638
  /**
1658
1639
  * 删除接口
1659
1640
  * @param name 接口名称
@@ -1702,8 +1683,6 @@ export class Module extends BaseNode {
1702
1683
  return params;
1703
1684
  }
1704
1685
 
1705
-
1706
-
1707
1686
  /**
1708
1687
  * 删除页面
1709
1688
  * @param name 页面名称
@@ -1752,8 +1731,6 @@ export class Module extends BaseNode {
1752
1731
  return params;
1753
1732
  }
1754
1733
 
1755
-
1756
-
1757
1734
  /**
1758
1735
  * 删除变量
1759
1736
  * @param name 变量名称
@@ -1802,8 +1779,6 @@ export class Module extends BaseNode {
1802
1779
  return params;
1803
1780
  }
1804
1781
 
1805
-
1806
-
1807
1782
  /**
1808
1783
  * 删除流程
1809
1784
  * @param name 流程名称
@@ -1852,49 +1827,47 @@ export class Module extends BaseNode {
1852
1827
  return params;
1853
1828
  }
1854
1829
 
1855
-
1856
-
1857
1830
  /**
1858
- * 删除页面组件
1859
- * @param name 页面组件名称
1831
+ * 删除端包
1832
+ * @param name 端包名称
1860
1833
  */
1861
- removeViewComponent(name: string): void;
1834
+ removeFrontendLibrary(name: string): void;
1862
1835
 
1863
1836
  /**
1864
- * 删除页面组件
1865
- * @param viewComponent 已有的页面组件实例
1837
+ * 删除端包
1838
+ * @param frontendLibrary 已有的端包实例
1866
1839
  */
1867
- removeViewComponent(viewComponent: ViewComponent): void;
1840
+ removeFrontendLibrary(frontendLibrary: FrontendLibrary): void;
1868
1841
 
1869
- removeViewComponent(options: string | ViewComponent) {
1870
- let viewComponent: ViewComponent;
1842
+ removeFrontendLibrary(options: string | FrontendLibrary) {
1843
+ let frontendLibrary: FrontendLibrary;
1871
1844
  if (typeof options === 'string') {
1872
- viewComponent = (this.viewComponents as ViewComponent[]).find((item) => item.name === options);
1873
- if (!viewComponent) {
1874
- throw new Error('找不到页面组件 ' + options);
1845
+ frontendLibrary = (this.frontends as FrontendLibrary[]).find((item) => item.name === options);
1846
+ if (!frontendLibrary) {
1847
+ throw new Error('找不到端包 ' + options);
1875
1848
  }
1876
1849
  } else {
1877
- viewComponent = options;
1850
+ frontendLibrary = options;
1878
1851
  }
1879
- return viewComponent.delete();
1852
+ return frontendLibrary.delete();
1880
1853
  }
1881
1854
 
1882
- __removeViewComponent(viewComponent: ViewComponent) {
1883
- const parentKey = viewComponent.parentKey;
1855
+ __removeFrontendLibrary(frontendLibrary: FrontendLibrary) {
1856
+ const parentKey = frontendLibrary.parentKey;
1884
1857
  const params: Params = {
1885
1858
  parentNode: this,
1886
1859
  parentKey,
1887
1860
  index: -1,
1888
1861
  object: null,
1889
- oldObject: viewComponent,
1862
+ oldObject: frontendLibrary,
1890
1863
  };
1891
1864
  if (parentKey) {
1892
1865
  params.parentKey = parentKey;
1893
1866
  if (Array.isArray((this as any)[parentKey])) {
1894
- const index = (this as any)[parentKey].indexOf(viewComponent);
1867
+ const index = (this as any)[parentKey].indexOf(frontendLibrary);
1895
1868
  ~index && (this as any)[parentKey].splice(index, 1);
1896
1869
  params.index = index;
1897
- } else if ((this as any)[parentKey] === viewComponent) {
1870
+ } else if ((this as any)[parentKey] === frontendLibrary) {
1898
1871
  params.index = 0;
1899
1872
  (this as any)[parentKey] = undefined;
1900
1873
  }
@@ -1902,8 +1875,6 @@ export class Module extends BaseNode {
1902
1875
  return params;
1903
1876
  }
1904
1877
 
1905
-
1906
-
1907
1878
  /**
1908
1879
  * 删除配置管理
1909
1880
  * @param name 配置管理名称
@@ -195,6 +195,10 @@ export class Param extends BaseNode {
195
195
  });
196
196
  }
197
197
 
198
+
199
+
200
+
201
+
198
202
  /**
199
203
  * 删除类型标注
200
204
  * @param name 类型标注名称