@lcap/nasl 2.22.0-beta.0 → 2.22.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/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 +270 -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 +1 -1
- 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 +42 -14
- package/src/server/getLogics.ts +41 -6
- package/src/server/getMemberIdentifier.ts +5 -4
- package/src/server/naslServer.ts +270 -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
package/src/concepts/Module__.ts
CHANGED
|
@@ -5,6 +5,7 @@ const moduleNameSpace = {
|
|
|
5
5
|
componentDependencies: 'components',
|
|
6
6
|
};
|
|
7
7
|
type ModuleKeyType = 'dependencies' | 'interfaceDependencies' | 'componentDependencies';
|
|
8
|
+
import ConfigProperty from './ConfigProperty__';
|
|
8
9
|
//================================================================================
|
|
9
10
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
10
11
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -85,7 +86,7 @@ export class Module extends BaseNode {
|
|
|
85
86
|
* 外部语言依赖
|
|
86
87
|
*/
|
|
87
88
|
@property()
|
|
88
|
-
compilerInfoMap: { java?: Array<{ packageName: string,className:string,naslName: string, type: string,javaTypes:any }> } = undefined;
|
|
89
|
+
compilerInfoMap: { java?: Array<{ packageName: string, className:string, naslName: string, type: string, javaTypes:any }> } = undefined;
|
|
89
90
|
|
|
90
91
|
/**
|
|
91
92
|
* 数据源列表
|
|
@@ -181,9 +182,8 @@ export class Module extends BaseNode {
|
|
|
181
182
|
}
|
|
182
183
|
return params;
|
|
183
184
|
}
|
|
184
|
-
|
|
185
185
|
|
|
186
|
-
|
|
186
|
+
getDataSourceExistingNames(excludedList: Array<DataSource> = []) {
|
|
187
187
|
const excludedSet = new Set(excludedList);
|
|
188
188
|
return ((this.dataSources as DataSource[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
189
189
|
}
|
|
@@ -324,7 +324,6 @@ export class Module extends BaseNode {
|
|
|
324
324
|
return node;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
|
|
328
327
|
getStructureExistingNames(excludedList: Array<Structure> = []) {
|
|
329
328
|
const excludedSet = new Set(excludedList);
|
|
330
329
|
return ((this.structures as Structure[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -466,7 +465,6 @@ export class Module extends BaseNode {
|
|
|
466
465
|
return node;
|
|
467
466
|
}
|
|
468
467
|
|
|
469
|
-
|
|
470
468
|
getEnumExistingNames(excludedList: Array<Enum> = []) {
|
|
471
469
|
const excludedSet = new Set(excludedList);
|
|
472
470
|
return ((this.enums as Enum[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -608,7 +606,6 @@ export class Module extends BaseNode {
|
|
|
608
606
|
return node;
|
|
609
607
|
}
|
|
610
608
|
|
|
611
|
-
|
|
612
609
|
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
613
610
|
const excludedSet = new Set(excludedList);
|
|
614
611
|
return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -750,7 +747,6 @@ export class Module extends BaseNode {
|
|
|
750
747
|
return node;
|
|
751
748
|
}
|
|
752
749
|
|
|
753
|
-
|
|
754
750
|
getInterfaceExistingNames(excludedList: Array<Interface> = []) {
|
|
755
751
|
const excludedSet = new Set(excludedList);
|
|
756
752
|
return ((this.interfaces as Interface[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -892,7 +888,6 @@ export class Module extends BaseNode {
|
|
|
892
888
|
return node;
|
|
893
889
|
}
|
|
894
890
|
|
|
895
|
-
|
|
896
891
|
getViewExistingNames(excludedList: Array<View> = []) {
|
|
897
892
|
const excludedSet = new Set(excludedList);
|
|
898
893
|
return ((this.views as View[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1034,7 +1029,6 @@ export class Module extends BaseNode {
|
|
|
1034
1029
|
return node;
|
|
1035
1030
|
}
|
|
1036
1031
|
|
|
1037
|
-
|
|
1038
1032
|
getVarExistingNames(excludedList: Array<Variable> = []) {
|
|
1039
1033
|
const excludedSet = new Set(excludedList);
|
|
1040
1034
|
return ((this.frontendVariables as Variable[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1176,7 +1170,6 @@ export class Module extends BaseNode {
|
|
|
1176
1170
|
return node;
|
|
1177
1171
|
}
|
|
1178
1172
|
|
|
1179
|
-
|
|
1180
1173
|
getProcessExistingNames(excludedList: Array<Process> = []) {
|
|
1181
1174
|
const excludedSet = new Set(excludedList);
|
|
1182
1175
|
return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1318,7 +1311,6 @@ export class Module extends BaseNode {
|
|
|
1318
1311
|
return node;
|
|
1319
1312
|
}
|
|
1320
1313
|
|
|
1321
|
-
|
|
1322
1314
|
getFrontendLibraryExistingNames(excludedList: Array<FrontendLibrary> = []) {
|
|
1323
1315
|
const excludedSet = new Set(excludedList);
|
|
1324
1316
|
return ((this.frontends as FrontendLibrary[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1460,9 +1452,6 @@ export class Module extends BaseNode {
|
|
|
1460
1452
|
return node;
|
|
1461
1453
|
}
|
|
1462
1454
|
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
1455
|
/**
|
|
1467
1456
|
* 删除数据源
|
|
1468
1457
|
* @param name 数据源名称
|
|
@@ -1511,8 +1500,6 @@ export class Module extends BaseNode {
|
|
|
1511
1500
|
return params;
|
|
1512
1501
|
}
|
|
1513
1502
|
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
1503
|
/**
|
|
1517
1504
|
* 删除数据结构
|
|
1518
1505
|
* @param name 数据结构名称
|
|
@@ -1561,8 +1548,6 @@ export class Module extends BaseNode {
|
|
|
1561
1548
|
return params;
|
|
1562
1549
|
}
|
|
1563
1550
|
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
1551
|
/**
|
|
1567
1552
|
* 删除枚举
|
|
1568
1553
|
* @param name 枚举名称
|
|
@@ -1611,8 +1596,6 @@ export class Module extends BaseNode {
|
|
|
1611
1596
|
return params;
|
|
1612
1597
|
}
|
|
1613
1598
|
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
1599
|
/**
|
|
1617
1600
|
* 删除逻辑
|
|
1618
1601
|
* @param name 逻辑名称
|
|
@@ -1661,8 +1644,6 @@ export class Module extends BaseNode {
|
|
|
1661
1644
|
return params;
|
|
1662
1645
|
}
|
|
1663
1646
|
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
1647
|
/**
|
|
1667
1648
|
* 删除接口
|
|
1668
1649
|
* @param name 接口名称
|
|
@@ -1711,8 +1692,6 @@ export class Module extends BaseNode {
|
|
|
1711
1692
|
return params;
|
|
1712
1693
|
}
|
|
1713
1694
|
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
1695
|
/**
|
|
1717
1696
|
* 删除页面
|
|
1718
1697
|
* @param name 页面名称
|
|
@@ -1761,8 +1740,6 @@ export class Module extends BaseNode {
|
|
|
1761
1740
|
return params;
|
|
1762
1741
|
}
|
|
1763
1742
|
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
1743
|
/**
|
|
1767
1744
|
* 删除变量
|
|
1768
1745
|
* @param name 变量名称
|
|
@@ -1811,8 +1788,6 @@ export class Module extends BaseNode {
|
|
|
1811
1788
|
return params;
|
|
1812
1789
|
}
|
|
1813
1790
|
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
1791
|
/**
|
|
1817
1792
|
* 删除流程
|
|
1818
1793
|
* @param name 流程名称
|
|
@@ -1861,8 +1836,6 @@ export class Module extends BaseNode {
|
|
|
1861
1836
|
return params;
|
|
1862
1837
|
}
|
|
1863
1838
|
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
1839
|
/**
|
|
1867
1840
|
* 删除端包
|
|
1868
1841
|
* @param name 端包名称
|
|
@@ -1911,8 +1884,6 @@ export class Module extends BaseNode {
|
|
|
1911
1884
|
return params;
|
|
1912
1885
|
}
|
|
1913
1886
|
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
1887
|
/**
|
|
1917
1888
|
* 删除配置管理
|
|
1918
1889
|
* @param name 配置管理名称
|
|
@@ -1971,65 +1942,121 @@ export class Module extends BaseNode {
|
|
|
1971
1942
|
@property()
|
|
1972
1943
|
isAdd: boolean;
|
|
1973
1944
|
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1945
|
+
/**
|
|
1946
|
+
* 是否启动
|
|
1947
|
+
*/
|
|
1948
|
+
@property()
|
|
1949
|
+
enable: boolean;
|
|
1950
|
+
|
|
1951
|
+
/**
|
|
1952
|
+
* 依赖列表
|
|
1953
|
+
*/
|
|
1954
|
+
@property()
|
|
1955
|
+
dependencies: Array<string> = [];
|
|
1956
|
+
|
|
1957
|
+
setIsAdd(isAdd: boolean) {
|
|
1958
|
+
const object = {
|
|
1959
|
+
isAdd,
|
|
1960
|
+
};
|
|
1961
|
+
this.update({
|
|
1962
|
+
...object,
|
|
1963
|
+
});
|
|
1964
|
+
}
|
|
1965
|
+
/**
|
|
1983
1966
|
* 生成宿主语言的文件路径
|
|
1984
1967
|
* @param name 一般不用传,用于 rename
|
|
1985
1968
|
*/
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1969
|
+
getEmbeddedFilePath(name = this.name) {
|
|
1970
|
+
return `/embedded/${this.app.name}/${this.parentKey}/${this.name}`;
|
|
1971
|
+
}
|
|
1972
|
+
/**
|
|
1990
1973
|
* 获取命名空间和
|
|
1991
1974
|
* 暂时不考虑 Module 嵌套的情况
|
|
1992
1975
|
*/
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1976
|
+
getNamespace() {
|
|
1977
|
+
return `${moduleNameSpace[this.parentKey as ModuleKeyType]}`;
|
|
1978
|
+
}
|
|
1996
1979
|
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
1980
|
+
getTsNamespace() {
|
|
1981
|
+
return `${moduleNameSpace[this.parentKey as ModuleKeyType]}`;
|
|
1982
|
+
}
|
|
1983
|
+
getTsNamespaceAndName() {
|
|
1984
|
+
return `${moduleNameSpace[this.parentKey as ModuleKeyType]}.${this.name}`;
|
|
1985
|
+
}
|
|
2003
1986
|
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
1987
|
+
findEnumByName(name: string) {
|
|
1988
|
+
return this.enums.find((enumItem) => enumItem.name === name);
|
|
1989
|
+
}
|
|
2007
1990
|
|
|
2008
|
-
|
|
1991
|
+
/**
|
|
2009
1992
|
* 获取属性节点是否存在
|
|
2010
1993
|
*/
|
|
2011
1994
|
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
1995
|
+
findProperty(name: string, propertyType: PropertyType): any {
|
|
1996
|
+
return ((this as any)[propertyType] as Array<any>).find((item) => item.name === name);
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
delete() {
|
|
2000
|
+
this.parentNode?.emit('collect:start', {
|
|
2001
|
+
actionMsg: '移除依赖库',
|
|
2002
|
+
});
|
|
2003
|
+
super.delete();
|
|
2004
|
+
this._delete();
|
|
2005
|
+
// if (this.dependencies) {
|
|
2006
|
+
// // 删除依赖链中的依赖
|
|
2007
|
+
// this.dependencies.forEach((tag) => {
|
|
2008
|
+
// const [name, version] = tag.split('-');
|
|
2009
|
+
// const existNode = this.app.dependencies.find((m) => m.name === name && m.version === version);
|
|
2010
|
+
// existNode?.delete();
|
|
2011
|
+
// });
|
|
2012
|
+
// }
|
|
2013
|
+
// 处理同名依赖 重新生成文件
|
|
2014
|
+
if (this.enable) {
|
|
2015
|
+
// 删[数据源]
|
|
2016
|
+
const dataSourceGroup = (this.parentNode as any)?.configuration?.getGroup('dataSource');
|
|
2017
|
+
if (this.dataSources && dataSourceGroup) {
|
|
2018
|
+
this.dataSources.forEach((datasource) => {
|
|
2019
|
+
this.parentNode?.emit('clear:datasourceError', datasource as any);
|
|
2020
|
+
try {
|
|
2021
|
+
dataSourceGroup.removeConfigProperty(datasource.name);
|
|
2022
|
+
} catch (e) {}
|
|
2023
|
+
});
|
|
2024
|
+
}
|
|
2025
|
+
// // 已启用的依赖库被删除时,将后续被禁用的同名依赖库 切换为启用
|
|
2026
|
+
// const index = this.app.dependencies.findIndex((m) => m.enable === false && m.name === this.name);
|
|
2027
|
+
// if (index >= 0) {
|
|
2028
|
+
// const nextMainModule = this.app.dependencies[index];
|
|
2029
|
+
// // 更新[禁用的依赖]enable:true
|
|
2030
|
+
// nextMainModule.update({ enable: true });
|
|
2031
|
+
// nextMainModule.softDelete({ index });
|
|
2032
|
+
// }
|
|
2033
|
+
}
|
|
2034
|
+
this.parentNode?.emit('collect:end');
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
// 删除再添加 触发文件生成
|
|
2038
|
+
softDelete(options: { index: number }) {
|
|
2039
|
+
// 删[禁用的依赖]
|
|
2040
|
+
super.delete();
|
|
2041
|
+
// 创建[禁用的依赖]
|
|
2042
|
+
this.app.insertModuleInDependenciesAt(this, options.index);
|
|
2043
|
+
// 创建[禁用的依赖]的数据源
|
|
2044
|
+
const dataSourceGroup = (this.parentNode as any)?.configuration?.getGroup('dataSource');
|
|
2045
|
+
if (this.dataSources && dataSourceGroup) {
|
|
2046
|
+
this.dataSources.forEach((datasource) => {
|
|
2047
|
+
const body: ConfigProperty = ConfigProperty.from({
|
|
2048
|
+
name: datasource.name,
|
|
2049
|
+
description: '',
|
|
2050
|
+
isPrivate: false,
|
|
2051
|
+
values: [
|
|
2052
|
+
{ env: 'dev', value: '', concept: 'ConfigPropertyValue' },
|
|
2053
|
+
{ env: 'online', value: '', concept: 'ConfigPropertyValue' },
|
|
2054
|
+
],
|
|
2055
|
+
});
|
|
2056
|
+
dataSourceGroup.addConfigProperty(body);
|
|
2057
|
+
});
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2033
2060
|
|
|
2034
2061
|
//================================================================================
|
|
2035
2062
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -1225,19 +1225,26 @@ export class NewComposite extends LogicItem {
|
|
|
1225
1225
|
code += `${indent1}function __newComposite() {\n`;
|
|
1226
1226
|
this.properties.forEach((property, index) => {
|
|
1227
1227
|
const temp = `temp${index}`;
|
|
1228
|
+
const propertyType = this.typeAnnotation.properties[index]?.typeAnnotation;
|
|
1228
1229
|
const name = property.name;
|
|
1229
1230
|
const rightItem = nameMap.get(name);
|
|
1230
1231
|
const ts = rightMap.get(rightItem);
|
|
1231
1232
|
if (ts !== undefined) {
|
|
1232
1233
|
if (['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts)) {
|
|
1233
|
-
code += `${indent2}
|
|
1234
|
+
code += `${indent2}let ${temp}: void = null; `;
|
|
1234
1235
|
} else {
|
|
1235
|
-
code += `${indent2}
|
|
1236
|
+
code += `${indent2}let ${temp}${ts === 'null' ? ':void' : ''} = ${ts}; `;
|
|
1236
1237
|
}
|
|
1237
|
-
code +=
|
|
1238
|
-
code += property.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1239
|
-
code +=
|
|
1240
|
-
code +=
|
|
1238
|
+
code += `const `;
|
|
1239
|
+
code += `${property.toEmbeddedTS(shiftState(state, code, { inline: true }))}: `;
|
|
1240
|
+
code += propertyType ? propertyType.toEmbeddedTS(shiftState(state, code, { inline: true })) : `nasl.core.Incompatible<typeof ${temp}, void>`;
|
|
1241
|
+
code += ` = ${temp};\n`;
|
|
1242
|
+
} else if (propertyType) {
|
|
1243
|
+
code += `${indent2}let ${property.name}: `;
|
|
1244
|
+
code += `${propertyType.toEmbeddedTS(shiftState(state, code, { inline: true }))}; `;
|
|
1245
|
+
code += `<`;
|
|
1246
|
+
code += `${property.toEmbeddedTS(shiftState(state, code, { inline: true }))}`;
|
|
1247
|
+
code += `>${property.name};\n`;
|
|
1241
1248
|
} else {
|
|
1242
1249
|
code += `${indent2}const `;
|
|
1243
1250
|
code += property.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
@@ -1289,11 +1296,14 @@ export class NewComposite extends LogicItem {
|
|
|
1289
1296
|
});
|
|
1290
1297
|
// 方便ts报错检查
|
|
1291
1298
|
code += 'function __newComposite() { ';
|
|
1292
|
-
this.properties.forEach((property) => {
|
|
1299
|
+
this.properties.forEach((property, index) => {
|
|
1293
1300
|
const name = property.name;
|
|
1301
|
+
const propertyType = this.typeAnnotation.properties[index]?.typeAnnotation;
|
|
1294
1302
|
const rightItem = nameMap.get(name);
|
|
1295
1303
|
const ts = rightMap.get(rightItem);
|
|
1296
|
-
if (
|
|
1304
|
+
if (propertyType) {
|
|
1305
|
+
code += `const ${name}: ${propertyType.toEmbeddedTS(shiftState(state, code, { inline: true }))}; `;
|
|
1306
|
+
} else if (ts !== undefined) {
|
|
1297
1307
|
code += `const ${name} = ${['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts) ? null : ts}; `;
|
|
1298
1308
|
} else {
|
|
1299
1309
|
code += `const ${name}; `;
|
|
@@ -1313,14 +1323,16 @@ export class NewComposite extends LogicItem {
|
|
|
1313
1323
|
return code;
|
|
1314
1324
|
}
|
|
1315
1325
|
|
|
1316
|
-
__addIdentifier() {
|
|
1326
|
+
__addIdentifier(name: string, typeAnnotation: TypeAnnotation) {
|
|
1327
|
+
const newName = name || 'property1';
|
|
1328
|
+
const newType = typeAnnotation || null;
|
|
1317
1329
|
this.app.emit('collect:start', {
|
|
1318
1330
|
actionMsg: '添加匿名数据结构属性',
|
|
1319
1331
|
});
|
|
1320
|
-
const node = this.addIdentifier({ name: this.getIdentifierUniqueName(
|
|
1332
|
+
const node = this.addIdentifier({ name: this.getIdentifierUniqueName(newName) });
|
|
1321
1333
|
const struct = StructureProperty.from({
|
|
1322
1334
|
name: node.name,
|
|
1323
|
-
typeAnnotation:
|
|
1335
|
+
typeAnnotation: newType,
|
|
1324
1336
|
});
|
|
1325
1337
|
this.typeAnnotation.addStructureProperty(struct);
|
|
1326
1338
|
this.app.emit('collect:end');
|
|
@@ -303,7 +303,7 @@ export class OqlQueryComponent extends LogicItem {
|
|
|
303
303
|
dataSourceName: this.dataSource,
|
|
304
304
|
oql: this.code,
|
|
305
305
|
ideVersion: this.app.ideVersion,
|
|
306
|
-
dataSourceNasl: this.app.findNodeByCompleteName(this.dataSource)
|
|
306
|
+
dataSourceNasl: this.app.findNodeByCompleteName(this.dataSource)?.toJSON(),
|
|
307
307
|
typeScriptStartLine: 1,
|
|
308
308
|
typeScriptStartLineColumn: 1,
|
|
309
309
|
},
|
package/src/concepts/Param__.ts
CHANGED
|
@@ -266,6 +266,9 @@ export class Param extends BaseNode {
|
|
|
266
266
|
type: 's-member-identifier-select' | 's-enum-select' | 's-schema-select' | 's-datatype-select' | 's-config-select' | 's-options-select';
|
|
267
267
|
attrs?: any;
|
|
268
268
|
} = undefined;
|
|
269
|
+
@excludedInJSON()
|
|
270
|
+
@property()
|
|
271
|
+
cascader: Boolean = false;
|
|
269
272
|
|
|
270
273
|
/**
|
|
271
274
|
* 自动补全的属性列表
|
|
@@ -48,8 +48,6 @@ export class QueryFieldExpression extends LogicItem {
|
|
|
48
48
|
@property()
|
|
49
49
|
propertyName: string = undefined;
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
51
|
/**
|
|
54
52
|
* @param source 需要合并的部分参数
|
|
55
53
|
*/
|
|
@@ -66,7 +64,6 @@ export class QueryFieldExpression extends LogicItem {
|
|
|
66
64
|
return super.from(source, parentNode, parentKey) as QueryFieldExpression;
|
|
67
65
|
}
|
|
68
66
|
|
|
69
|
-
|
|
70
67
|
/**
|
|
71
68
|
* 设置entityAsName
|
|
72
69
|
*/
|
|
@@ -91,10 +88,6 @@ export class QueryFieldExpression extends LogicItem {
|
|
|
91
88
|
});
|
|
92
89
|
}
|
|
93
90
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
91
|
//================================================================================
|
|
99
92
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
100
93
|
// 自动生成的代码已结束。下面可以手动编写。
|