@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.
- package/out/automate/engine/operators.d.ts +9 -0
- package/out/automate/engine/viewCache.d.ts +1 -0
- package/out/automate/template/myProcess.d.ts +1 -0
- package/out/common/BaseNode.d.ts +1 -0
- package/out/common/BaseNode.js +7 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.d.ts +1 -1
- package/out/common/EventEmitter.d.ts +1 -1
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +22 -0
- package/out/concepts/App__.js +78 -12
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +9 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +2 -1
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +2 -0
- package/out/concepts/CallQueryComponent__.js +76 -24
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +4 -0
- package/out/concepts/ConfigProperty__.js +18 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/Destination__.js +2 -2
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +1 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +7 -2
- package/out/concepts/EntityProperty__.js +100 -1
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +2 -1
- package/out/concepts/Entity__.js +30 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +7 -0
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.d.ts +53 -0
- package/out/concepts/Integration__.js +143 -0
- package/out/concepts/Integration__.js.map +1 -0
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +42 -0
- package/out/concepts/JavaLogic__.js +122 -0
- package/out/concepts/JavaLogic__.js.map +1 -0
- package/out/concepts/LogicItem__.d.ts +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +12 -7
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +11 -6
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MicroApp__.d.ts +51 -0
- package/out/concepts/MicroApp__.js +113 -0
- package/out/concepts/MicroApp__.js.map +1 -0
- package/out/concepts/Module__.d.ts +20 -9
- package/out/concepts/Module__.js +72 -14
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +1 -1
- package/out/concepts/NewComposite__.js +25 -11
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +1 -1
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -0
- package/out/concepts/Param__.js +5 -0
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +104 -16
- package/out/concepts/QuerySelectExpression__.js +99 -9
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +2 -2
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +8 -3
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +26 -6
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -1
- package/out/concepts/View__.js +3 -1
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +15 -0
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +94 -0
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +3 -0
- package/out/concepts/index__.js +3 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/config.d.ts +1 -1
- package/out/decorators/index.d.ts +2 -2
- package/out/generator/genBundleFiles.js +20 -3
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.js +2 -2
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/icestark.d.ts +2 -0
- package/out/generator/icestark.js +48 -0
- package/out/generator/icestark.js.map +1 -0
- package/out/generator/microApp.d.ts +2 -0
- package/out/generator/microApp.js +35 -0
- package/out/generator/microApp.js.map +1 -0
- package/out/generator/permission.d.ts +1 -1
- package/out/generator/permission.js +0 -13
- package/out/generator/permission.js.map +1 -1
- package/out/generator/qiankun.d.ts +2 -0
- package/out/generator/qiankun.js +52 -0
- package/out/generator/qiankun.js.map +1 -0
- package/out/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/manager/stepRecorder.d.ts +20 -0
- package/out/manager/stepRecorder.js +110 -0
- package/out/manager/stepRecorder.js.map +1 -0
- package/out/sentry/index.d.ts +5 -4
- package/out/sentry/index.js +9 -2
- package/out/sentry/index.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +1 -1
- package/out/server/formatTsUtils.js +40 -14
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.js +38 -6
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +5 -4
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +3 -3
- package/out/server/getScope.d.ts +1 -1
- package/out/server/naslServer.d.ts +7 -3
- package/out/server/naslServer.js +271 -102
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +25 -7
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +3 -3
- package/out/service/storage/init.js +6 -0
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -1
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +20 -6
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genUpdateBlock.js +7 -1
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +16 -0
- package/out/templator/utils.js +2 -0
- package/out/templator/utils.js.map +1 -1
- package/out/translator/index.d.ts +1 -1
- package/out/translator/lsp.d.ts +3 -3
- package/out/utils/index.d.ts +4 -4
- package/package.json +68 -68
- package/sandbox/stdlib/nasl.ui.ts +16 -11
- package/sandbox/stdlib/nasl.util.ts +4 -0
- package/sandbox/stdlib/nasl.validation.ts +2 -2
- package/src/automate/upgrader/2.17.js +1 -1
- package/src/common/BaseNode.ts +10 -2
- package/src/concepts/App__.ts +90 -46
- package/src/concepts/CallInterface__.ts +9 -1
- package/src/concepts/CallLogic__.ts +2 -1
- package/src/concepts/CallQueryComponent__.ts +73 -82
- package/src/concepts/ConfigProperty__.ts +18 -1
- package/src/concepts/Destination__.ts +2 -20
- package/src/concepts/EntityProperty__.ts +102 -8
- package/src/concepts/Entity__.ts +31 -8
- package/src/concepts/Identifier__.ts +9 -2
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/Integration__.ts +162 -0
- package/src/concepts/JavaLogic__.ts +129 -0
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +12 -45
- package/src/concepts/Match__.ts +10 -5
- package/src/concepts/MemberExpression__.ts +1 -1
- package/src/concepts/MicroApp__.ts +118 -0
- package/src/concepts/Module__.ts +106 -79
- package/src/concepts/NewComposite__.ts +23 -11
- package/src/concepts/OqlQueryComponent__.ts +1 -1
- package/src/concepts/Param__.ts +3 -0
- package/src/concepts/QueryFieldExpression__.ts +0 -7
- package/src/concepts/QuerySelectExpression__.ts +206 -30
- package/src/concepts/SwitchCase__.ts +2 -2
- package/src/concepts/TypeAnnotation__.ts +8 -42
- package/src/concepts/ViewElement__.ts +24 -6
- package/src/concepts/View__.ts +3 -24
- package/src/concepts/basics/stdlib/nasl.ui.ts +15 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +94 -0
- package/src/concepts/index__.ts +3 -0
- package/src/generator/genBundleFiles.ts +22 -4
- package/src/generator/genReleaseBody.ts +2 -2
- package/src/generator/icestark.ts +45 -0
- package/src/generator/microApp.ts +32 -0
- package/src/generator/permission.ts +1 -15
- package/src/generator/qiankun.ts +49 -0
- package/src/index.ts +1 -0
- package/src/manager/stepRecorder.ts +112 -0
- package/src/sentry/index.ts +8 -2
- package/src/server/formatTsUtils.ts +44 -16
- package/src/server/getLogics.ts +41 -6
- package/src/server/getMemberIdentifier.ts +5 -4
- package/src/server/naslServer.ts +271 -101
- package/src/server/translator.ts +25 -7
- package/src/service/storage/init.ts +7 -0
- package/src/templator/genCreateBlock.ts +6 -1
- package/src/templator/genQueryComponent.ts +22 -8
- package/src/templator/genUpdateBlock.ts +7 -1
- package/src/templator/utils.ts +2 -0
- package/ts-worker/src/index.js +1 -4
- package/src/manager/history.ts +0 -0
- package/src/manager/problem.ts +0 -0
|
@@ -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.
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
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
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
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
|
}
|
package/src/server/getLogics.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
|
|
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: [
|
|
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
|
|
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
|
});
|