@lcap/nasl 2.22.0-beta.0 → 2.22.0-beta.2

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 (276) hide show
  1. package/out/automate/engine/operators.d.ts +9 -0
  2. package/out/automate/engine/viewCache.d.ts +1 -0
  3. package/out/automate/template/myProcess.d.ts +1 -0
  4. package/out/common/BaseNode.d.ts +1 -0
  5. package/out/common/BaseNode.js +7 -1
  6. package/out/common/BaseNode.js.map +1 -1
  7. package/out/common/Command.d.ts +1 -1
  8. package/out/common/EventEmitter.d.ts +1 -1
  9. package/out/concepts/Abort__.js.map +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__.d.ts +22 -0
  13. package/out/concepts/App__.js +78 -12
  14. package/out/concepts/App__.js.map +1 -1
  15. package/out/concepts/Argument__.js.map +1 -1
  16. package/out/concepts/Assignee__.js.map +1 -1
  17. package/out/concepts/AssignmentLine__.js.map +1 -1
  18. package/out/concepts/Assignment__.js.map +1 -1
  19. package/out/concepts/Attribute__.js.map +1 -1
  20. package/out/concepts/BatchAssignment__.js.map +1 -1
  21. package/out/concepts/BinaryExpression__.js.map +1 -1
  22. package/out/concepts/BindAttribute__.js.map +1 -1
  23. package/out/concepts/BindDirective__.js.map +1 -1
  24. package/out/concepts/BindEvent__.js.map +1 -1
  25. package/out/concepts/BindStyle__.js.map +1 -1
  26. package/out/concepts/BooleanLiteral__.js.map +1 -1
  27. package/out/concepts/CallFunction__.js.map +1 -1
  28. package/out/concepts/CallInterface__.js +9 -1
  29. package/out/concepts/CallInterface__.js.map +1 -1
  30. package/out/concepts/CallLogic__.js +2 -1
  31. package/out/concepts/CallLogic__.js.map +1 -1
  32. package/out/concepts/CallQueryComponent__.d.ts +2 -0
  33. package/out/concepts/CallQueryComponent__.js +76 -24
  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__.d.ts +4 -0
  40. package/out/concepts/ConfigProperty__.js +18 -1
  41. package/out/concepts/ConfigProperty__.js.map +1 -1
  42. package/out/concepts/Configuration__.js.map +1 -1
  43. package/out/concepts/Constant__.js.map +1 -1
  44. package/out/concepts/DataElement__.js.map +1 -1
  45. package/out/concepts/DataSource__.js.map +1 -1
  46. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
  47. package/out/concepts/Destination__.js +2 -2
  48. package/out/concepts/Destination__.js.map +1 -1
  49. package/out/concepts/End__.js.map +1 -1
  50. package/out/concepts/EntityIndex__.d.ts +1 -1
  51. package/out/concepts/EntityIndex__.js.map +1 -1
  52. package/out/concepts/EntityProperty__.d.ts +7 -2
  53. package/out/concepts/EntityProperty__.js +100 -1
  54. package/out/concepts/EntityProperty__.js.map +1 -1
  55. package/out/concepts/Entity__.d.ts +2 -1
  56. package/out/concepts/Entity__.js +30 -1
  57. package/out/concepts/Entity__.js.map +1 -1
  58. package/out/concepts/EnumItem__.js.map +1 -1
  59. package/out/concepts/Enum__.js.map +1 -1
  60. package/out/concepts/Event__.js.map +1 -1
  61. package/out/concepts/ExternalDestination__.js.map +1 -1
  62. package/out/concepts/ForEachStatement__.js.map +1 -1
  63. package/out/concepts/FrontendLibrary__.js.map +1 -1
  64. package/out/concepts/Frontend__.js.map +1 -1
  65. package/out/concepts/Function__.js.map +1 -1
  66. package/out/concepts/Identifier__.js +7 -0
  67. package/out/concepts/Identifier__.js.map +1 -1
  68. package/out/concepts/IfStatement__.js +2 -2
  69. package/out/concepts/IfStatement__.js.map +1 -1
  70. package/out/concepts/Integration__.d.ts +53 -0
  71. package/out/concepts/Integration__.js +143 -0
  72. package/out/concepts/Integration__.js.map +1 -0
  73. package/out/concepts/InterfaceParam__.js.map +1 -1
  74. package/out/concepts/Interface__.js.map +1 -1
  75. package/out/concepts/JSBlock__.js.map +1 -1
  76. package/out/concepts/JavaLogic__.d.ts +42 -0
  77. package/out/concepts/JavaLogic__.js +122 -0
  78. package/out/concepts/JavaLogic__.js.map +1 -0
  79. package/out/concepts/LogicItem__.d.ts +1 -1
  80. package/out/concepts/LogicItem__.js.map +1 -1
  81. package/out/concepts/Logic__.js +12 -7
  82. package/out/concepts/Logic__.js.map +1 -1
  83. package/out/concepts/MatchCase__.js.map +1 -1
  84. package/out/concepts/Match__.js +11 -6
  85. package/out/concepts/Match__.js.map +1 -1
  86. package/out/concepts/MemberExpression__.js +1 -1
  87. package/out/concepts/MemberExpression__.js.map +1 -1
  88. package/out/concepts/MicroApp__.d.ts +51 -0
  89. package/out/concepts/MicroApp__.js +113 -0
  90. package/out/concepts/MicroApp__.js.map +1 -0
  91. package/out/concepts/Module__.d.ts +20 -9
  92. package/out/concepts/Module__.js +72 -14
  93. package/out/concepts/Module__.js.map +1 -1
  94. package/out/concepts/Namespace__.js.map +1 -1
  95. package/out/concepts/NewComposite__.d.ts +1 -1
  96. package/out/concepts/NewComposite__.js +25 -11
  97. package/out/concepts/NewComposite__.js.map +1 -1
  98. package/out/concepts/NewList__.js.map +1 -1
  99. package/out/concepts/NewMap__.js.map +1 -1
  100. package/out/concepts/New__.js.map +1 -1
  101. package/out/concepts/NullLiteral__.js.map +1 -1
  102. package/out/concepts/NumericLiteral__.js.map +1 -1
  103. package/out/concepts/OqlQueryComponent__.js +1 -1
  104. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  105. package/out/concepts/Param__.d.ts +1 -0
  106. package/out/concepts/Param__.js +5 -0
  107. package/out/concepts/Param__.js.map +1 -1
  108. package/out/concepts/Point__.js.map +1 -1
  109. package/out/concepts/ProcessComponent__.js.map +1 -1
  110. package/out/concepts/ProcessElement__.js.map +1 -1
  111. package/out/concepts/ProcessOutcome__.js.map +1 -1
  112. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  113. package/out/concepts/Process__.js.map +1 -1
  114. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  115. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  116. package/out/concepts/QueryFromExpression__.js.map +1 -1
  117. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  118. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  119. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  120. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  121. package/out/concepts/QuerySelectExpression__.d.ts +104 -16
  122. package/out/concepts/QuerySelectExpression__.js +99 -9
  123. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  124. package/out/concepts/Rect__.js.map +1 -1
  125. package/out/concepts/Return__.js.map +1 -1
  126. package/out/concepts/Role__.js.map +1 -1
  127. package/out/concepts/SelectMembers__.js.map +1 -1
  128. package/out/concepts/Slot__.js.map +1 -1
  129. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  130. package/out/concepts/Start__.js.map +1 -1
  131. package/out/concepts/StringInterpolation__.js.map +1 -1
  132. package/out/concepts/StringLiteral__.js.map +1 -1
  133. package/out/concepts/StructureProperty__.js.map +1 -1
  134. package/out/concepts/Structure__.js.map +1 -1
  135. package/out/concepts/SwitchCase__.js +2 -2
  136. package/out/concepts/SwitchCase__.js.map +1 -1
  137. package/out/concepts/SwitchStatement__.js.map +1 -1
  138. package/out/concepts/Theme__.js.map +1 -1
  139. package/out/concepts/Transactional__.js.map +1 -1
  140. package/out/concepts/TypeAnnotation__.js +8 -3
  141. package/out/concepts/TypeAnnotation__.js.map +1 -1
  142. package/out/concepts/TypeParam__.js.map +1 -1
  143. package/out/concepts/UnaryExpression__.js.map +1 -1
  144. package/out/concepts/Unparsed__.js.map +1 -1
  145. package/out/concepts/UseComponent__.js.map +1 -1
  146. package/out/concepts/ValidationRule__.js.map +1 -1
  147. package/out/concepts/Variable__.js.map +1 -1
  148. package/out/concepts/ViewBlock__.js.map +1 -1
  149. package/out/concepts/ViewComponent__.js.map +1 -1
  150. package/out/concepts/ViewElement__.js +26 -6
  151. package/out/concepts/ViewElement__.js.map +1 -1
  152. package/out/concepts/View__.d.ts +1 -1
  153. package/out/concepts/View__.js +3 -1
  154. package/out/concepts/View__.js.map +1 -1
  155. package/out/concepts/WhileStatement__.js.map +1 -1
  156. package/out/concepts/basics/stdlib/nasl.ui.js +15 -0
  157. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  158. package/out/concepts/basics/stdlib/nasl.util.js +94 -0
  159. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  160. package/out/concepts/index__.d.ts +3 -0
  161. package/out/concepts/index__.js +3 -0
  162. package/out/concepts/index__.js.map +1 -1
  163. package/out/config.d.ts +1 -1
  164. package/out/decorators/index.d.ts +2 -2
  165. package/out/generator/genBundleFiles.js +20 -3
  166. package/out/generator/genBundleFiles.js.map +1 -1
  167. package/out/generator/genReleaseBody.js +2 -2
  168. package/out/generator/genReleaseBody.js.map +1 -1
  169. package/out/generator/icestark.d.ts +2 -0
  170. package/out/generator/icestark.js +48 -0
  171. package/out/generator/icestark.js.map +1 -0
  172. package/out/generator/microApp.d.ts +2 -0
  173. package/out/generator/microApp.js +35 -0
  174. package/out/generator/microApp.js.map +1 -0
  175. package/out/generator/permission.d.ts +1 -1
  176. package/out/generator/permission.js +0 -13
  177. package/out/generator/permission.js.map +1 -1
  178. package/out/generator/qiankun.d.ts +2 -0
  179. package/out/generator/qiankun.js +52 -0
  180. package/out/generator/qiankun.js.map +1 -0
  181. package/out/index.d.ts +1 -0
  182. package/out/index.js +1 -0
  183. package/out/index.js.map +1 -1
  184. package/out/manager/stepRecorder.d.ts +20 -0
  185. package/out/manager/stepRecorder.js +110 -0
  186. package/out/manager/stepRecorder.js.map +1 -0
  187. package/out/sentry/index.d.ts +5 -4
  188. package/out/sentry/index.js +9 -2
  189. package/out/sentry/index.js.map +1 -1
  190. package/out/server/formatTsUtils.d.ts +1 -1
  191. package/out/server/formatTsUtils.js +40 -14
  192. package/out/server/formatTsUtils.js.map +1 -1
  193. package/out/server/getLogics.js +38 -6
  194. package/out/server/getLogics.js.map +1 -1
  195. package/out/server/getMemberIdentifier.js +5 -4
  196. package/out/server/getMemberIdentifier.js.map +1 -1
  197. package/out/server/getProcesses.d.ts +3 -3
  198. package/out/server/getScope.d.ts +1 -1
  199. package/out/server/naslServer.d.ts +7 -3
  200. package/out/server/naslServer.js +271 -102
  201. package/out/server/naslServer.js.map +1 -1
  202. package/out/server/translator.js +25 -7
  203. package/out/server/translator.js.map +1 -1
  204. package/out/service/storage/init.d.ts +3 -3
  205. package/out/service/storage/init.js +6 -0
  206. package/out/service/storage/init.js.map +1 -1
  207. package/out/templator/genCreateBlock.js +6 -1
  208. package/out/templator/genCreateBlock.js.map +1 -1
  209. package/out/templator/genQueryComponent.js +20 -6
  210. package/out/templator/genQueryComponent.js.map +1 -1
  211. package/out/templator/genUpdateBlock.js +7 -1
  212. package/out/templator/genUpdateBlock.js.map +1 -1
  213. package/out/templator/utils.d.ts +16 -0
  214. package/out/templator/utils.js +2 -0
  215. package/out/templator/utils.js.map +1 -1
  216. package/out/translator/index.d.ts +1 -1
  217. package/out/translator/lsp.d.ts +3 -3
  218. package/out/utils/index.d.ts +4 -4
  219. package/package.json +68 -68
  220. package/sandbox/stdlib/nasl.ui.ts +16 -11
  221. package/sandbox/stdlib/nasl.util.ts +4 -0
  222. package/sandbox/stdlib/nasl.validation.ts +2 -2
  223. package/src/automate/upgrader/2.17.js +1 -1
  224. package/src/common/BaseNode.ts +10 -2
  225. package/src/concepts/App__.ts +90 -46
  226. package/src/concepts/CallInterface__.ts +9 -1
  227. package/src/concepts/CallLogic__.ts +2 -1
  228. package/src/concepts/CallQueryComponent__.ts +73 -82
  229. package/src/concepts/ConfigProperty__.ts +18 -1
  230. package/src/concepts/Destination__.ts +2 -20
  231. package/src/concepts/EntityProperty__.ts +102 -8
  232. package/src/concepts/Entity__.ts +31 -8
  233. package/src/concepts/Identifier__.ts +9 -2
  234. package/src/concepts/IfStatement__.ts +2 -2
  235. package/src/concepts/Integration__.ts +162 -0
  236. package/src/concepts/JavaLogic__.ts +129 -0
  237. package/src/concepts/LogicItem__.ts +1 -1
  238. package/src/concepts/Logic__.ts +12 -45
  239. package/src/concepts/Match__.ts +10 -5
  240. package/src/concepts/MemberExpression__.ts +1 -1
  241. package/src/concepts/MicroApp__.ts +118 -0
  242. package/src/concepts/Module__.ts +106 -79
  243. package/src/concepts/NewComposite__.ts +23 -11
  244. package/src/concepts/OqlQueryComponent__.ts +1 -1
  245. package/src/concepts/Param__.ts +3 -0
  246. package/src/concepts/QueryFieldExpression__.ts +0 -7
  247. package/src/concepts/QuerySelectExpression__.ts +206 -30
  248. package/src/concepts/SwitchCase__.ts +2 -2
  249. package/src/concepts/TypeAnnotation__.ts +8 -42
  250. package/src/concepts/ViewElement__.ts +24 -6
  251. package/src/concepts/View__.ts +3 -24
  252. package/src/concepts/basics/stdlib/nasl.ui.ts +15 -0
  253. package/src/concepts/basics/stdlib/nasl.util.ts +94 -0
  254. package/src/concepts/index__.ts +3 -0
  255. package/src/generator/genBundleFiles.ts +22 -4
  256. package/src/generator/genReleaseBody.ts +2 -2
  257. package/src/generator/icestark.ts +45 -0
  258. package/src/generator/microApp.ts +32 -0
  259. package/src/generator/permission.ts +1 -15
  260. package/src/generator/qiankun.ts +49 -0
  261. package/src/index.ts +1 -0
  262. package/src/manager/stepRecorder.ts +112 -0
  263. package/src/sentry/index.ts +8 -2
  264. package/src/server/formatTsUtils.ts +44 -16
  265. package/src/server/getLogics.ts +41 -6
  266. package/src/server/getMemberIdentifier.ts +5 -4
  267. package/src/server/naslServer.ts +271 -101
  268. package/src/server/translator.ts +25 -7
  269. package/src/service/storage/init.ts +7 -0
  270. package/src/templator/genCreateBlock.ts +6 -1
  271. package/src/templator/genQueryComponent.ts +22 -8
  272. package/src/templator/genUpdateBlock.ts +7 -1
  273. package/src/templator/utils.ts +2 -0
  274. package/ts-worker/src/index.js +1 -4
  275. package/src/manager/history.ts +0 -0
  276. package/src/manager/problem.ts +0 -0
@@ -118,6 +118,8 @@ export function displayString2TypeAnnotation(typeStr: string, parentPrefix?: str
118
118
  } else {
119
119
  type = typeStr;
120
120
  }
121
+ if (!type)
122
+ return;
121
123
  type = type.replaceAll(' ', '');
122
124
  if (type === 'Promise<void>')
123
125
  return null;
@@ -137,7 +139,7 @@ export function displayString2TypeAnnotation(typeStr: string, parentPrefix?: str
137
139
  } catch (err) {
138
140
  console.log(err);
139
141
  }
140
- return typeAnnotation;
142
+ return typeAnnotation as TypeAnnotation;
141
143
  }
142
144
 
143
145
  function createGenericTypeAnnotation(type: string, parentPrefix?: string) {
@@ -148,13 +150,15 @@ function createGenericTypeAnnotation(type: string, parentPrefix?: string) {
148
150
  // 如果还有匹配到的多层泛型;
149
151
  // 取出匹配到的内容
150
152
  const types = /\<([^()]+)\>/g.exec(type);
153
+ if (types === null)
154
+ return types;
151
155
  const newtext = types[1];
152
156
  // 把匹配的值,的内容在,检索一遍,看是不是泛型套泛型
153
157
  const newTypes = /\<([^()]+)\>/g.exec(newtext);
154
158
  // 如果是的话就去递归
155
159
  if (newTypes) {
156
160
  const argTypeAnnotation = createGenericTypeAnnotation(newtext, parentPrefix);
157
- typeAnnotation.typeArguments = [argTypeAnnotation];
161
+ typeAnnotation.typeArguments = [argTypeAnnotation as TypeAnnotation];
158
162
  } else {
159
163
  const argTypeAnnotation = createType2Annotation(newtext, parentPrefix);
160
164
 
@@ -361,6 +365,7 @@ function getAStructureScopeType(type: string, parent: any, node: BaseNode) {
361
365
  if (item.typeKey && !isNoChildType(item.typeKey)) {
362
366
  newItem.children = nextObjectTypeChild(item.typeKey, newItem, node);
363
367
  }
368
+ newItem.typeAnnotation = displayString2TypeAnnotation(newItem.typeKey);
364
369
  const completionProperty = new CompletionProperty(newItem);
365
370
  completionProperty.icon = 'refProperty';
366
371
  return completionProperty;
@@ -436,6 +441,7 @@ function getAStructureObjectStringType(type: string, parent: any, node: BaseNode
436
441
  if (item.typeKey && !isNoChildType(item.typeKey)) {
437
442
  newItem.children = nextObjectTypeChild(getPlatformType(item.typeKey), newItem, node);
438
443
  }
444
+ newItem.typeAnnotation = displayString2TypeAnnotation(newItem.typeKey);
439
445
  const completionProperty = new CompletionProperty(newItem);
440
446
 
441
447
  completionProperty.icon = 'refProperty';
@@ -484,6 +490,7 @@ export function formatVariableData(data: unknown | variableItem[], node: BaseNod
484
490
  if (item.completionDetail?.hasOwnProperty('nodeType')) {
485
491
  const typeAnnotation = type2TypeAnnotation(item.completionDetail.nodeType);
486
492
  typeKey = typeAnnotation?.typeKey;
493
+ item.typeAnnotation = typeAnnotation;
487
494
  } else {
488
495
  // 当前节点的完整类型,主要是在有T的内容使用 nasl.list<Enum1> 内部匹配内容给里面子集的T赋值类型
489
496
  let currentType: string = formatTs2TypeString(item.completionDetail.displayParts as Array<{ text: string; kind: string }>);
@@ -504,6 +511,7 @@ export function formatVariableData(data: unknown | variableItem[], node: BaseNod
504
511
  }
505
512
  }
506
513
  typeKey = getPlatformType(currentType);
514
+ item.typeAnnotation = displayString2TypeAnnotation(typeKey);
507
515
  }
508
516
  } else if (item instanceof StructureProperty || item instanceof EntityProperty) {
509
517
  typeKey = item?.typeAnnotation?.typeKey;
@@ -659,20 +667,40 @@ export function formatFrontEndVariables(frontEndVariables: Array<Variable>) {
659
667
  return result;
660
668
  }
661
669
 
662
- export function formatConfigProperties(configProperties: Array<ConfigProperty>) {
663
- const result = configProperties.map((item) => {
664
- const namespace = item.getNamespace();
665
- const newItem: any = {
666
- name: item.name,
667
- value: item.name,
668
- expression: new Identifier({
670
+ export function formatConfigProperties(configProperties: Array<ConfigProperty>, isView: Boolean) {
671
+ const result = configProperties.reduce((pre: any, item) => {
672
+ const { isPrivate = false } = item;
673
+
674
+ if (!isPrivate || !isView) {
675
+ const namespace = item.getNamespace();
676
+ const newItem: any = {
669
677
  name: item.name,
670
- namespace,
671
- }),
672
- icon: 'configProperty',
673
- calleewholeKey: item.calleewholeKey,
674
- };
675
- return newItem;
676
- });
678
+ value: item.name,
679
+ expression: new Identifier({
680
+ name: item.name,
681
+ namespace,
682
+ }),
683
+ icon: 'configProperty',
684
+ calleewholeKey: item.calleewholeKey,
685
+ };
686
+
687
+ pre.push(newItem);
688
+ }
689
+ return pre;
690
+ }, []);
691
+ // const result = configProperties.map((item) => {
692
+ // const namespace = item.getNamespace();
693
+ // const newItem: any = {
694
+ // name: item.name,
695
+ // value: item.name,
696
+ // expression: new Identifier({
697
+ // name: item.name,
698
+ // namespace,
699
+ // }),
700
+ // icon: 'configProperty',
701
+ // calleewholeKey: item.calleewholeKey,
702
+ // };
703
+ // return newItem;
704
+ // });
677
705
  return result;
678
706
  }
@@ -57,8 +57,28 @@ function iterator(tree: FakeNode | FakeProcessNode, searchContent: string, fakeN
57
57
  function toHump(name: string): string {
58
58
  return name.replace(/\-(\w)/g, (all, letter) => letter.toUpperCase());
59
59
  }
60
+
61
+ function javaLogicDataSourceLogics(logics: Logic[]) {
62
+ let globalLogics: Logic[] = [];
63
+ let javaLogics: Logic[] = [];
64
+
65
+ logics.forEach(logic => {
66
+ const { body = [] } = logic;
67
+
68
+ if (body && body.length && body[0].concept === 'JavaLogic') {
69
+ javaLogics.push(logic);
70
+ } else {
71
+ globalLogics.push(logic);
72
+ }
73
+ });
74
+ return {
75
+ globalLogics,
76
+ javaLogics
77
+ };
78
+ }
79
+
60
80
  export async function getLogics(node: CallLogic | BindEvent| Identifier | Logic, needAllLogic: boolean = true) {
61
- const app = node.rootNode as App;
81
+ const app = node?.rootNode as App;
62
82
  if (node.concept === 'CallLogic' || node.concept === 'BindEvent' || node.concept === 'Logic') {
63
83
  const result = [];
64
84
 
@@ -84,9 +104,10 @@ export async function getLogics(node: CallLogic | BindEvent| Identifier | Logic,
84
104
  pItem.originConcept = 'Process';
85
105
  return pItem;
86
106
  });
87
- const extensions = app.dependencies.map(moduleToLogicNamesapce).filter((item) => item.logics && item.logics.length);
107
+ const dependencies = app.dependencies.filter((d) => d.enable);
108
+ const extensions = dependencies.map(moduleToLogicNamesapce).filter((item) => item.logics && item.logics.length);
88
109
  const dependEntityNs: Namespace[] = [];
89
- app.dependencies.forEach((dep) => {
110
+ dependencies.forEach((dep) => {
90
111
  (dep.dataSources || []).forEach((dataSource) => {
91
112
  if (Array.isArray(dataSource.entities)) {
92
113
  const list = dataSource.entities.map((entity) => entity.ns);
@@ -104,8 +125,19 @@ export async function getLogics(node: CallLogic | BindEvent| Identifier | Logic,
104
125
  name: 'category',
105
126
  path: `${app.getNamespace()}.logics`,
106
127
  title: '全局逻辑',
107
- logics: app.logics,
108
- children: [...nc, ...extensions, ...dependEntityNs, ...ps],
128
+ logics: javaLogicDataSourceLogics(app.logics).globalLogics,
129
+ children: [
130
+ ...nc,
131
+ ...extensions,
132
+ ...dependEntityNs,
133
+ ...ps,
134
+ new Namespace({
135
+ name: 'javalogicCategory',
136
+ title: '扩展逻辑',
137
+ logics: javaLogicDataSourceLogics(app.logics).javaLogics,
138
+ expanded: false,
139
+ }),
140
+ ],
109
141
  });
110
142
  tree.expanded = false;
111
143
  result.push(tree);
@@ -228,6 +260,9 @@ export async function getLogics(node: CallLogic | BindEvent| Identifier | Logic,
228
260
  }
229
261
 
230
262
  app.dependencies.forEach((item) => {
263
+ if (!item.enable) {
264
+ return;
265
+ }
231
266
  const fed = item.frontends.find((item) => item.type === node?.frontend?.type);
232
267
  if (fed?.logics.length > 0) {
233
268
  systemTree.children.push(new Namespace({
@@ -280,7 +315,7 @@ export async function getLogics(node: CallLogic | BindEvent| Identifier | Logic,
280
315
  }
281
316
  return result;
282
317
  } else if (node.concept === 'Identifier') {
283
- const extensions = app.dependencies.map(moduleToLogicNamesapce).filter((item) => item.logics && item.logics.length);
318
+ const extensions = app.dependencies.filter((m) => m.enable).map(moduleToLogicNamesapce).filter((item) => item.logics && item.logics.length);
284
319
  const tree = new Namespace({
285
320
  name: 'category`',
286
321
  path: `${app.getNamespace()}.logics`,
@@ -228,7 +228,7 @@ export function getEnumsIdentifier(node: BaseNode): CompletionProperty[] {
228
228
  const enums = app?.enums;
229
229
  const newEnums = enums ? formatEnums(enums) : [];
230
230
  // 添加依赖库的枚举选择
231
- const modules = app?.dependencies?.filter((module) => module.type === 'extension') || [];
231
+ const modules = app?.dependencies?.filter((module) => module.enable && module.type === 'extension') || [];
232
232
  const extensionEnums: any[] = [];
233
233
  modules.forEach((module) => {
234
234
  extensionEnums.push({
@@ -284,9 +284,10 @@ export function getConfigsIdentifier(node: BaseNode): CompletionProperty[] {
284
284
  const groups = app?.configuration.groups;
285
285
  const customGroup = groups.find((group) => group.name === 'custom');
286
286
  const properties = customGroup ? customGroup.properties : [];
287
- const newProperties = formatConfigProperties(properties);
287
+ const isView = !!(node as Identifier).view;
288
+ const newProperties = formatConfigProperties(properties, isView);
288
289
  // 添加依赖库的枚举选择
289
- const modules = app?.dependencies?.filter((module) => module.type === 'extension') || [];
290
+ const modules = app?.dependencies?.filter((module) => module.enable && module.type === 'extension') || [];
290
291
  const extensionConfigProperties: any[] = [];
291
292
  modules.forEach((module) => {
292
293
  const groups = module?.configuration?.groups || [];
@@ -297,7 +298,7 @@ export function getConfigsIdentifier(node: BaseNode): CompletionProperty[] {
297
298
  name: module.name,
298
299
  concept: 'Module',
299
300
  icon: 'depend-dataSource',
300
- children: formatConfigProperties(properties),
301
+ children: formatConfigProperties(properties, isView),
301
302
  });
302
303
  }
303
304
  });