@lcap/nasl 1.0.0-alpha.13 → 1.0.0-alpha.14
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/index.js +1 -1
- package/out/automate/engine/index.js.map +1 -1
- package/out/common/BaseNode.d.ts +4 -4
- package/out/common/BaseNode.js +45 -41
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +17 -0
- package/out/concepts/App__.js +54 -12
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +2 -2
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +8 -6
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +21 -21
- package/out/concepts/BindAttribute__.js +4 -3
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +3 -3
- package/out/concepts/BindDirective__.js +22 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +9 -8
- package/out/concepts/BindEvent__.js +17 -7
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.js +10 -5
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +11 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +1 -0
- package/out/concepts/CallLogic__.js +17 -7
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +0 -1
- package/out/concepts/CallQueryComponent__.js +5 -8
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +6 -2
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +1 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +1 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Destination__.js +10 -7
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +3 -0
- package/out/concepts/EntityProperty__.js +38 -0
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +34 -31
- package/out/concepts/Entity__.js +29 -12
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.js +1 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +8 -12
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.js +4 -4
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +13 -7
- 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/InterfaceParam__.d.ts +2 -0
- package/out/concepts/InterfaceParam__.js +10 -0
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +3 -3
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +1 -0
- package/out/concepts/LogicItem__.js +14 -0
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +1 -0
- package/out/concepts/Logic__.js +16 -11
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Module__.js +8 -8
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js +12 -12
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -0
- package/out/concepts/Param__.js +3 -0
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +2 -2
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +5 -5
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/Process__.js +4 -4
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +2 -2
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -0
- package/out/concepts/Return__.js +6 -3
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -1
- package/out/concepts/StringLiteral__.js +2 -2
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +3 -6
- package/out/concepts/StructureProperty__.js +38 -32
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +3 -3
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +3 -3
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +10 -2
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +1 -0
- package/out/concepts/ValidationRule__.js +27 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +1 -0
- package/out/concepts/Variable__.js +6 -3
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +5 -5
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +63 -60
- package/out/concepts/ViewElement__.js +123 -88
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +4 -0
- package/out/concepts/View__.js +26 -10
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/index.js +3 -1
- package/out/concepts/basics/stdlib/index.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.auth.js +39 -0
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.browser copy.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.browser copy.js +70 -0
- package/out/concepts/basics/stdlib/nasl.browser copy.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.browser.js +6 -35
- package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.configuration.js +25 -0
- package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.util.js +0 -29
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/enums/KEYWORDS.js +1 -0
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.js +98 -72
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/server/createUiTs.d.ts +1 -0
- package/out/server/createUiTs.js +15 -1
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/getLogics.js +27 -45
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +3 -3
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +1 -1
- package/out/server/getProcesses.js +2 -2
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.d.ts +1 -3
- package/out/server/naslServer.js +73 -57
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.d.ts +0 -3
- package/out/server/translator.js +16 -7
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.js +21 -12
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +3 -3
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +6 -10
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +2 -2
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genQueryComponent.d.ts +2 -0
- package/out/templator/genQueryComponent.js +1 -0
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genUpdateBlock.js +5 -5
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +3 -1
- package/out/templator/utils.js +2 -1
- package/out/templator/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/automate/engine/index.js +1 -1
- package/src/common/BaseNode.ts +46 -42
- package/src/concepts/App__.ts +54 -12
- package/src/concepts/Argument__.ts +3 -2
- package/src/concepts/BinaryExpression__.ts +8 -6
- package/src/concepts/BindAttribute__.ts +26 -32
- package/src/concepts/BindDirective__.ts +24 -9
- package/src/concepts/BindEvent__.ts +25 -29
- package/src/concepts/CallFunction__.ts +11 -6
- package/src/concepts/CallInterface__.ts +11 -1
- package/src/concepts/CallLogic__.ts +21 -40
- package/src/concepts/CallQueryComponent__.ts +6 -10
- package/src/concepts/Comment__.ts +6 -2
- package/src/concepts/ConfigGroup__.ts +1 -1
- package/src/concepts/ConfigProperty__.ts +1 -1
- package/src/concepts/Configuration__.ts +1 -1
- package/src/concepts/Destination__.ts +9 -7
- package/src/concepts/EntityProperty__.ts +36 -0
- package/src/concepts/Entity__.ts +63 -50
- package/src/concepts/Enum__.ts +1 -1
- package/src/concepts/Event__.ts +1 -1
- package/src/concepts/ForEachStatement__.ts +8 -13
- package/src/concepts/Function__.ts +4 -4
- package/src/concepts/Identifier__.ts +15 -18
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/InterfaceParam__.ts +11 -0
- package/src/concepts/Interface__.ts +3 -3
- package/src/concepts/LogicItem__.ts +15 -0
- package/src/concepts/Logic__.ts +34 -50
- package/src/concepts/Module__.ts +8 -8
- package/src/concepts/Namespace__.ts +12 -12
- package/src/concepts/Param__.ts +3 -0
- package/src/concepts/ProcessComponent__.ts +2 -2
- package/src/concepts/ProcessElement__.ts +5 -5
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/Process__.ts +4 -4
- package/src/concepts/QueryFromExpression__.ts +1 -1
- package/src/concepts/QueryJoinExpression__.ts +2 -2
- package/src/concepts/QuerySelectExpression__.ts +1 -1
- package/src/concepts/Return__.ts +6 -3
- package/src/concepts/StringLiteral__.ts +2 -2
- package/src/concepts/StructureProperty__.ts +36 -29
- package/src/concepts/Structure__.ts +3 -3
- package/src/concepts/SwitchCase__.ts +3 -3
- package/src/concepts/SwitchStatement__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +8 -2
- package/src/concepts/UnaryExpression__.ts +1 -1
- package/src/concepts/ValidationRule__.ts +24 -1
- package/src/concepts/Variable__.ts +6 -3
- package/src/concepts/ViewComponent__.ts +5 -5
- package/src/concepts/ViewElement__.ts +183 -147
- package/src/concepts/View__.ts +30 -32
- package/src/concepts/WhileStatement__.ts +1 -1
- package/src/concepts/basics/stdlib/index.ts +3 -1
- package/src/concepts/basics/stdlib/nasl.auth.ts +35 -0
- package/src/concepts/basics/stdlib/nasl.browser.ts +7 -41
- package/src/concepts/basics/stdlib/nasl.configuration.ts +21 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +0 -29
- package/src/enums/KEYWORDS.ts +1 -0
- package/src/generator/genBundleFiles.ts +102 -74
- package/src/server/createUiTs.ts +18 -3
- package/src/server/getLogics.ts +29 -47
- package/src/server/getMemberIdentifier.ts +3 -3
- package/src/server/getProcesses.ts +2 -2
- package/src/server/naslServer.ts +84 -62
- package/src/server/translator.ts +18 -6
- package/src/service/storage/init.ts +20 -13
- package/src/templator/genCreateBlock.ts +3 -3
- package/src/templator/genCurdEditMultipleKeyBlock.ts +22 -23
- package/src/templator/genCurdMultipleKeyBlock.ts +2 -2
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genQueryComponent.ts +1 -0
- package/src/templator/genUpdateBlock.ts +5 -6
- package/src/templator/utils.ts +2 -1
|
@@ -177,7 +177,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
177
177
|
const relationOptions = { parentNode: this, parentKey: 'body' };
|
|
178
178
|
let logicItem: LogicItem;
|
|
179
179
|
if (options instanceof LogicItem) {
|
|
180
|
-
options.
|
|
180
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
181
181
|
logicItem = options;
|
|
182
182
|
Object.assign(logicItem, relationOptions);
|
|
183
183
|
} else {
|
|
@@ -509,18 +509,13 @@ export class ForEachStatement extends LogicItem {
|
|
|
509
509
|
|
|
510
510
|
toJS(state?: TranslatorState): string {
|
|
511
511
|
let code = '';
|
|
512
|
-
|
|
512
|
+
const list = this.each ? this.each.toJS(shiftState(state, code, {
|
|
513
513
|
tabSize: 0,
|
|
514
514
|
})) : '';
|
|
515
|
-
code +=
|
|
516
|
-
code += this.start && this.start.toJS() ? this.start.toJS() : '';
|
|
517
|
-
code +=
|
|
518
|
-
code +=
|
|
519
|
-
code += ').forEach(async (';
|
|
520
|
-
code += this.item.name ? `${this.item.name}` : '';
|
|
521
|
-
code += ', ';
|
|
522
|
-
code += this.index.name ? `${this.index.name}` : '';
|
|
523
|
-
code += ') => {\n';
|
|
515
|
+
code += `if(Array.isArray(${list})) {\n`;
|
|
516
|
+
code += `for (let ${this.index.name} = ${this.start && this.start.toJS() ? this.start.toJS() : ''}; `;
|
|
517
|
+
code += `${this.index.name} < (${this.end && this.end.toJS() ? this.end.toJS() : ''}); ${this.index.name}++) {\n`;
|
|
518
|
+
code += `const ${this.item.name} = ${list}[${this.index.name}];\n`;
|
|
524
519
|
if (Array.isArray(this.body)) {
|
|
525
520
|
this.body.forEach((logicItem) => {
|
|
526
521
|
code
|
|
@@ -529,8 +524,8 @@ export class ForEachStatement extends LogicItem {
|
|
|
529
524
|
})) + '\n';
|
|
530
525
|
});
|
|
531
526
|
}
|
|
532
|
-
code += '}
|
|
533
|
-
|
|
527
|
+
code += '}\n';
|
|
528
|
+
code += '}\n';
|
|
534
529
|
return code;
|
|
535
530
|
}
|
|
536
531
|
|
|
@@ -170,7 +170,7 @@ export class Function extends BaseNode {
|
|
|
170
170
|
name: options,
|
|
171
171
|
}, this, 'typeParams');
|
|
172
172
|
} else if (options instanceof TypeParam) {
|
|
173
|
-
options.
|
|
173
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
174
174
|
typeParam = options;
|
|
175
175
|
Object.assign(typeParam, relationOptions);
|
|
176
176
|
} else {
|
|
@@ -308,7 +308,7 @@ export class Function extends BaseNode {
|
|
|
308
308
|
name: options,
|
|
309
309
|
}, this, 'params');
|
|
310
310
|
} else if (options instanceof Param) {
|
|
311
|
-
options.
|
|
311
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
312
312
|
param = options;
|
|
313
313
|
Object.assign(param, relationOptions);
|
|
314
314
|
} else {
|
|
@@ -446,7 +446,7 @@ export class Function extends BaseNode {
|
|
|
446
446
|
name: options,
|
|
447
447
|
}, this, 'returns');
|
|
448
448
|
} else if (options instanceof Return) {
|
|
449
|
-
options.
|
|
449
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
450
450
|
ret = options;
|
|
451
451
|
Object.assign(ret, relationOptions);
|
|
452
452
|
} else {
|
|
@@ -584,7 +584,7 @@ export class Function extends BaseNode {
|
|
|
584
584
|
name: options,
|
|
585
585
|
}, this, 'variables');
|
|
586
586
|
} else if (options instanceof Variable) {
|
|
587
|
-
options.
|
|
587
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
588
588
|
variable = options;
|
|
589
589
|
Object.assign(variable, relationOptions);
|
|
590
590
|
} else {
|
|
@@ -38,8 +38,6 @@ export class Identifier extends LogicItem {
|
|
|
38
38
|
@property()
|
|
39
39
|
name: string = undefined;
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
41
|
/**
|
|
44
42
|
* @param source 需要合并的部分参数
|
|
45
43
|
*/
|
|
@@ -53,13 +51,6 @@ export class Identifier extends LogicItem {
|
|
|
53
51
|
return super.from(source, parentNode, parentKey) as Identifier;
|
|
54
52
|
}
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
54
|
//================================================================================
|
|
64
55
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
65
56
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
@@ -69,7 +60,7 @@ export class Identifier extends LogicItem {
|
|
|
69
60
|
typeAnnotation: TypeAnnotation = undefined;
|
|
70
61
|
|
|
71
62
|
globalDataMap: {
|
|
72
|
-
[name: string]: boolean
|
|
63
|
+
[name: string]: boolean;
|
|
73
64
|
} = {
|
|
74
65
|
$route: true,
|
|
75
66
|
$global: true,
|
|
@@ -89,7 +80,7 @@ export class Identifier extends LogicItem {
|
|
|
89
80
|
if (last === 'enums') {
|
|
90
81
|
name = `$utils.EnumList("${this.name}")`;
|
|
91
82
|
}
|
|
92
|
-
} else if (this.namespace && this.namespace.endsWith('nasl.browser')) {
|
|
83
|
+
} else if (this.namespace && (this.namespace.endsWith('nasl.browser') || this.namespace.endsWith('nasl.auth') || this.namespace.endsWith('nasl.configuration'))) {
|
|
93
84
|
name = `$global.${this.name}`;
|
|
94
85
|
}
|
|
95
86
|
}
|
|
@@ -109,8 +100,8 @@ export class Identifier extends LogicItem {
|
|
|
109
100
|
if (last === 'enums') {
|
|
110
101
|
name = `$utils.EnumList("${this.name}")`;
|
|
111
102
|
}
|
|
112
|
-
} else if (namespace.
|
|
113
|
-
name = `$
|
|
103
|
+
} else if (namespace.startsWith('nasl.')) {
|
|
104
|
+
name = `${namespace}.${this.name}`;
|
|
114
105
|
}
|
|
115
106
|
}
|
|
116
107
|
return name;
|
|
@@ -118,7 +109,7 @@ export class Identifier extends LogicItem {
|
|
|
118
109
|
|
|
119
110
|
toJS(): string {
|
|
120
111
|
const dataMap: {
|
|
121
|
-
[name: string]: boolean
|
|
112
|
+
[name: string]: boolean;
|
|
122
113
|
} = {};
|
|
123
114
|
if (this.view) {
|
|
124
115
|
const { params, variables } = this.view;
|
|
@@ -152,11 +143,17 @@ export class Identifier extends LogicItem {
|
|
|
152
143
|
if (last === 'enums') {
|
|
153
144
|
name = `$utils.EnumList("${this.name}")`;
|
|
154
145
|
}
|
|
155
|
-
} else if (namespace.endsWith('nasl.browser')) {
|
|
146
|
+
} else if (namespace.endsWith('nasl.browser') || namespace.endsWith('nasl.auth') || namespace.endsWith('nasl.configuration')) {
|
|
156
147
|
name = `$global.${this.name}`;
|
|
157
148
|
}
|
|
158
149
|
}
|
|
159
|
-
return (dataMap[name]
|
|
150
|
+
return (dataMap[name]
|
|
151
|
+
|| this.globalDataMap[name]
|
|
152
|
+
|| namespace?.endsWith('nasl.browser')
|
|
153
|
+
|| namespace?.endsWith('nasl.auth')
|
|
154
|
+
|| namespace?.endsWith('nasl.configuration')
|
|
155
|
+
|| last === 'enums')
|
|
156
|
+
&& !isMemberExpression ? `this.${name}` : name;
|
|
160
157
|
}
|
|
161
158
|
|
|
162
159
|
@withSourceMap()
|
|
@@ -175,7 +172,7 @@ export class Identifier extends LogicItem {
|
|
|
175
172
|
// 绑定类型
|
|
176
173
|
if (this.parentNode instanceof BindAttribute) {
|
|
177
174
|
// this.parentNode.name === 'data-source'
|
|
178
|
-
return (
|
|
175
|
+
return (this.namespace + '.' || '') + this.name + '.toList';
|
|
179
176
|
}
|
|
180
177
|
}
|
|
181
178
|
|
|
@@ -226,7 +223,7 @@ export class Identifier extends LogicItem {
|
|
|
226
223
|
//================================================================================
|
|
227
224
|
}
|
|
228
225
|
|
|
229
|
-
classMap
|
|
226
|
+
classMap.Identifier = Identifier;
|
|
230
227
|
export default Identifier;
|
|
231
228
|
//================================================================================
|
|
232
229
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -96,7 +96,7 @@ export class IfStatement extends LogicItem {
|
|
|
96
96
|
const relationOptions = { parentNode: this, parentKey: 'consequent' };
|
|
97
97
|
let logicItem: LogicItem;
|
|
98
98
|
if (options instanceof LogicItem) {
|
|
99
|
-
options.
|
|
99
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
100
100
|
logicItem = options;
|
|
101
101
|
Object.assign(logicItem, relationOptions);
|
|
102
102
|
} else {
|
|
@@ -200,7 +200,7 @@ export class IfStatement extends LogicItem {
|
|
|
200
200
|
const relationOptions = { parentNode: this, parentKey: 'alternate' };
|
|
201
201
|
let logicItem: LogicItem;
|
|
202
202
|
if (options instanceof LogicItem) {
|
|
203
|
-
options.
|
|
203
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
204
204
|
logicItem = options;
|
|
205
205
|
Object.assign(logicItem, relationOptions);
|
|
206
206
|
} else {
|
|
@@ -279,6 +279,17 @@ export class InterfaceParam extends BaseNode {
|
|
|
279
279
|
// }
|
|
280
280
|
return code;
|
|
281
281
|
}
|
|
282
|
+
|
|
283
|
+
get hasChildren() {
|
|
284
|
+
const { typeKind } = this.typeAnnotation;
|
|
285
|
+
if (typeKind === 'reference' || typeKind === 'generic') {
|
|
286
|
+
return [{}];
|
|
287
|
+
}
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
get isTreeLeaf() {
|
|
291
|
+
return !this.hasChildren;
|
|
292
|
+
}
|
|
282
293
|
getSelectRef() {
|
|
283
294
|
const { typeName, typeKind, typeNamespace } = this.typeAnnotation;
|
|
284
295
|
let completionChildren;
|
|
@@ -171,7 +171,7 @@ export class Interface extends BaseNode {
|
|
|
171
171
|
name: options,
|
|
172
172
|
}, this, 'params');
|
|
173
173
|
} else if (options instanceof InterfaceParam) {
|
|
174
|
-
options.
|
|
174
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
175
175
|
interfaceParam = options;
|
|
176
176
|
Object.assign(interfaceParam, relationOptions);
|
|
177
177
|
} else {
|
|
@@ -309,7 +309,7 @@ export class Interface extends BaseNode {
|
|
|
309
309
|
name: options,
|
|
310
310
|
}, this, 'returns');
|
|
311
311
|
} else if (options instanceof Return) {
|
|
312
|
-
options.
|
|
312
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
313
313
|
ret = options;
|
|
314
314
|
Object.assign(ret, relationOptions);
|
|
315
315
|
} else {
|
|
@@ -522,7 +522,7 @@ export class Interface extends BaseNode {
|
|
|
522
522
|
toService() {
|
|
523
523
|
return {
|
|
524
524
|
config: {
|
|
525
|
-
serviceType: '
|
|
525
|
+
serviceType: 'external',
|
|
526
526
|
},
|
|
527
527
|
url: {
|
|
528
528
|
method: this.method,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TranslatorState } from '../translator';
|
|
2
2
|
import CallFunction from './CallFunction__';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
|
+
import CallQueryComponent from './CallQueryComponent__';
|
|
4
5
|
|
|
5
6
|
//================================================================================
|
|
6
7
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -224,6 +225,20 @@ export class LogicItem extends BaseNode {
|
|
|
224
225
|
return this.toJS(state);
|
|
225
226
|
}
|
|
226
227
|
|
|
228
|
+
delete() {
|
|
229
|
+
let actionMsg = '删除逻辑项';
|
|
230
|
+
if(this.name) actionMsg += `“${this.name}”`;
|
|
231
|
+
this.app?.emit('collect:start', {
|
|
232
|
+
actionMsg,
|
|
233
|
+
});
|
|
234
|
+
super.delete();
|
|
235
|
+
this.traverseChildren((el) => {
|
|
236
|
+
if(el?.concept === 'CallQueryComponent')
|
|
237
|
+
(el as CallQueryComponent).removeStructure();
|
|
238
|
+
});
|
|
239
|
+
this.app?.emit('collect:end');
|
|
240
|
+
}
|
|
241
|
+
|
|
227
242
|
//================================================================================
|
|
228
243
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
229
244
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
package/src/concepts/Logic__.ts
CHANGED
|
@@ -226,7 +226,7 @@ export class Logic extends BaseNode {
|
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
getTypeParamExistingNames(excludedList: Array<TypeParam> = []) {
|
|
230
230
|
const excludedSet = new Set(excludedList);
|
|
231
231
|
return (this.typeParams || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
232
232
|
}
|
|
@@ -270,7 +270,7 @@ export class Logic extends BaseNode {
|
|
|
270
270
|
name: options,
|
|
271
271
|
}, this, 'typeParams');
|
|
272
272
|
} else if (options instanceof TypeParam) {
|
|
273
|
-
options.
|
|
273
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
274
274
|
typeParam = options;
|
|
275
275
|
Object.assign(typeParam, relationOptions);
|
|
276
276
|
} else {
|
|
@@ -367,7 +367,6 @@ export class Logic extends BaseNode {
|
|
|
367
367
|
return node;
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
|
|
371
370
|
getParamUniqueName(name = 'param1') {
|
|
372
371
|
return utils.unique(name, this.getVarExistingNames());
|
|
373
372
|
}
|
|
@@ -408,7 +407,7 @@ export class Logic extends BaseNode {
|
|
|
408
407
|
name: options,
|
|
409
408
|
}, this, 'params');
|
|
410
409
|
} else if (options instanceof Param) {
|
|
411
|
-
options.
|
|
410
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
412
411
|
param = options;
|
|
413
412
|
Object.assign(param, relationOptions);
|
|
414
413
|
} else {
|
|
@@ -505,7 +504,6 @@ export class Logic extends BaseNode {
|
|
|
505
504
|
return node;
|
|
506
505
|
}
|
|
507
506
|
|
|
508
|
-
|
|
509
507
|
getReturnUniqueName(name = 'result1') {
|
|
510
508
|
return utils.unique(name, this.getVarExistingNames());
|
|
511
509
|
}
|
|
@@ -546,7 +544,7 @@ export class Logic extends BaseNode {
|
|
|
546
544
|
name: options,
|
|
547
545
|
}, this, 'returns');
|
|
548
546
|
} else if (options instanceof Return) {
|
|
549
|
-
options.
|
|
547
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
550
548
|
ret = options;
|
|
551
549
|
Object.assign(ret, relationOptions);
|
|
552
550
|
} else {
|
|
@@ -643,7 +641,6 @@ export class Logic extends BaseNode {
|
|
|
643
641
|
return node;
|
|
644
642
|
}
|
|
645
643
|
|
|
646
|
-
|
|
647
644
|
getVariableUniqueName(name = 'variable1') {
|
|
648
645
|
return utils.unique(name, this.getVarExistingNames());
|
|
649
646
|
}
|
|
@@ -684,7 +681,7 @@ export class Logic extends BaseNode {
|
|
|
684
681
|
name: options,
|
|
685
682
|
}, this, 'variables');
|
|
686
683
|
} else if (options instanceof Variable) {
|
|
687
|
-
options.
|
|
684
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
688
685
|
variable = options;
|
|
689
686
|
Object.assign(variable, relationOptions);
|
|
690
687
|
} else {
|
|
@@ -781,11 +778,6 @@ export class Logic extends BaseNode {
|
|
|
781
778
|
return node;
|
|
782
779
|
}
|
|
783
780
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
781
|
/**
|
|
790
782
|
* 插入逻辑项
|
|
791
783
|
* @internal
|
|
@@ -805,7 +797,7 @@ export class Logic extends BaseNode {
|
|
|
805
797
|
const relationOptions = { parentNode: this, parentKey: 'body' };
|
|
806
798
|
let logicItem: LogicItem;
|
|
807
799
|
if (options instanceof LogicItem) {
|
|
808
|
-
options.
|
|
800
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
809
801
|
logicItem = options;
|
|
810
802
|
Object.assign(logicItem, relationOptions);
|
|
811
803
|
} else {
|
|
@@ -818,8 +810,6 @@ export class Logic extends BaseNode {
|
|
|
818
810
|
return logicItem;
|
|
819
811
|
}
|
|
820
812
|
|
|
821
|
-
|
|
822
|
-
|
|
823
813
|
/**
|
|
824
814
|
* 插入逻辑项
|
|
825
815
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -842,8 +832,6 @@ export class Logic extends BaseNode {
|
|
|
842
832
|
return node;
|
|
843
833
|
}
|
|
844
834
|
|
|
845
|
-
|
|
846
|
-
|
|
847
835
|
/**
|
|
848
836
|
* 添加逻辑项
|
|
849
837
|
* @internal
|
|
@@ -863,8 +851,6 @@ export class Logic extends BaseNode {
|
|
|
863
851
|
return this._insertItemInBodyAt(options as any, index);
|
|
864
852
|
}
|
|
865
853
|
|
|
866
|
-
|
|
867
|
-
|
|
868
854
|
/**
|
|
869
855
|
* 添加逻辑项
|
|
870
856
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -888,8 +874,6 @@ export class Logic extends BaseNode {
|
|
|
888
874
|
return node;
|
|
889
875
|
}
|
|
890
876
|
|
|
891
|
-
|
|
892
|
-
|
|
893
877
|
/**
|
|
894
878
|
* 插入逻辑项
|
|
895
879
|
* @internal
|
|
@@ -909,7 +893,7 @@ export class Logic extends BaseNode {
|
|
|
909
893
|
const relationOptions = { parentNode: this, parentKey: 'playground' };
|
|
910
894
|
let logicItem: LogicItem;
|
|
911
895
|
if (options instanceof LogicItem) {
|
|
912
|
-
options.
|
|
896
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
913
897
|
logicItem = options;
|
|
914
898
|
Object.assign(logicItem, relationOptions);
|
|
915
899
|
} else {
|
|
@@ -922,8 +906,6 @@ export class Logic extends BaseNode {
|
|
|
922
906
|
return logicItem;
|
|
923
907
|
}
|
|
924
908
|
|
|
925
|
-
|
|
926
|
-
|
|
927
909
|
/**
|
|
928
910
|
* 插入逻辑项
|
|
929
911
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -946,8 +928,6 @@ export class Logic extends BaseNode {
|
|
|
946
928
|
return node;
|
|
947
929
|
}
|
|
948
930
|
|
|
949
|
-
|
|
950
|
-
|
|
951
931
|
/**
|
|
952
932
|
* 添加逻辑项
|
|
953
933
|
* @internal
|
|
@@ -967,8 +947,6 @@ export class Logic extends BaseNode {
|
|
|
967
947
|
return this._insertItemInPlaygroundAt(options as any, index);
|
|
968
948
|
}
|
|
969
949
|
|
|
970
|
-
|
|
971
|
-
|
|
972
950
|
/**
|
|
973
951
|
* 添加逻辑项
|
|
974
952
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -992,9 +970,6 @@ export class Logic extends BaseNode {
|
|
|
992
970
|
return node;
|
|
993
971
|
}
|
|
994
972
|
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
973
|
/**
|
|
999
974
|
* 删除事务
|
|
1000
975
|
* @param name 事务名称
|
|
@@ -1043,8 +1018,6 @@ export class Logic extends BaseNode {
|
|
|
1043
1018
|
return params;
|
|
1044
1019
|
}
|
|
1045
1020
|
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
1021
|
/**
|
|
1049
1022
|
* 删除类型参数
|
|
1050
1023
|
* @param name 类型参数名称
|
|
@@ -1093,8 +1066,6 @@ export class Logic extends BaseNode {
|
|
|
1093
1066
|
return params;
|
|
1094
1067
|
}
|
|
1095
1068
|
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
1069
|
/**
|
|
1099
1070
|
* 删除输入参数
|
|
1100
1071
|
* @param name 输入参数名称
|
|
@@ -1143,8 +1114,6 @@ export class Logic extends BaseNode {
|
|
|
1143
1114
|
return params;
|
|
1144
1115
|
}
|
|
1145
1116
|
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
1117
|
/**
|
|
1149
1118
|
* 删除输出参数
|
|
1150
1119
|
* @param name 输出参数名称
|
|
@@ -1193,8 +1162,6 @@ export class Logic extends BaseNode {
|
|
|
1193
1162
|
return params;
|
|
1194
1163
|
}
|
|
1195
1164
|
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
1165
|
/**
|
|
1199
1166
|
* 删除局部变量
|
|
1200
1167
|
* @param name 局部变量名称
|
|
@@ -1243,8 +1210,6 @@ export class Logic extends BaseNode {
|
|
|
1243
1210
|
return params;
|
|
1244
1211
|
}
|
|
1245
1212
|
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
1213
|
/**
|
|
1249
1214
|
* 删除逻辑项
|
|
1250
1215
|
* @param logicItem 已有的逻辑项实例
|
|
@@ -1252,12 +1217,10 @@ export class Logic extends BaseNode {
|
|
|
1252
1217
|
removeItemInBody(logicItem: LogicItem): void;
|
|
1253
1218
|
|
|
1254
1219
|
removeItemInBody(options: LogicItem) {
|
|
1255
|
-
|
|
1220
|
+
const logicItem: LogicItem = options;
|
|
1256
1221
|
return logicItem.delete();
|
|
1257
1222
|
}
|
|
1258
1223
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
1224
|
/**
|
|
1262
1225
|
* 删除逻辑项
|
|
1263
1226
|
* @param logicItem 已有的逻辑项实例
|
|
@@ -1265,7 +1228,7 @@ export class Logic extends BaseNode {
|
|
|
1265
1228
|
removeItemInPlayground(logicItem: LogicItem): void;
|
|
1266
1229
|
|
|
1267
1230
|
removeItemInPlayground(options: LogicItem) {
|
|
1268
|
-
|
|
1231
|
+
const logicItem: LogicItem = options;
|
|
1269
1232
|
return logicItem.delete();
|
|
1270
1233
|
}
|
|
1271
1234
|
|
|
@@ -1296,6 +1259,10 @@ export class Logic extends BaseNode {
|
|
|
1296
1259
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1297
1260
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
1298
1261
|
//================================================================================
|
|
1262
|
+
// 用于calllogic树中定位是那个logic,回显
|
|
1263
|
+
get calleewholeKey() {
|
|
1264
|
+
return this.getNamespace() + '.' + this.name;
|
|
1265
|
+
}
|
|
1299
1266
|
// 设置定时任务
|
|
1300
1267
|
setCronAndTriggerType(cron: string, triggerType: string) {
|
|
1301
1268
|
const object = {
|
|
@@ -1456,7 +1423,7 @@ export class Logic extends BaseNode {
|
|
|
1456
1423
|
}
|
|
1457
1424
|
|
|
1458
1425
|
@withSourceMap()
|
|
1459
|
-
toEmbeddedTSInProcess(state?: TranslatorState, prependCode?: string, noName
|
|
1426
|
+
toEmbeddedTSInProcess(state?: TranslatorState, prependCode?: string, noName?: boolean): string {
|
|
1460
1427
|
let code = '';
|
|
1461
1428
|
code += `${noName ? '' : `${this.name}:`} function(`;
|
|
1462
1429
|
this.params.forEach((param, index) => {
|
|
@@ -1465,7 +1432,7 @@ export class Logic extends BaseNode {
|
|
|
1465
1432
|
code += ', ';
|
|
1466
1433
|
});
|
|
1467
1434
|
code += `) {\n`;
|
|
1468
|
-
code +=
|
|
1435
|
+
code += prependCode || '';
|
|
1469
1436
|
code += '\n';
|
|
1470
1437
|
this.variables.forEach((variable) => {
|
|
1471
1438
|
code += indent(state.tabSize + 1) + 'let ';
|
|
@@ -1563,7 +1530,8 @@ export class Logic extends BaseNode {
|
|
|
1563
1530
|
parentNodeNamespace = this.parentNode.getNamespace();
|
|
1564
1531
|
}
|
|
1565
1532
|
|
|
1566
|
-
parentNodeNamespace
|
|
1533
|
+
parentNodeNamespace
|
|
1534
|
+
= ['nasl.ui', 'nasl.utils', 'nasl.util', 'nasl.browser', 'nasl.auth', 'nasl.configuration'].includes(parentNodeNamespace) || parentNodeNamespace.includes('.logics') ? parentNodeNamespace : `${parentNodeNamespace}.logics`;
|
|
1567
1535
|
if (this.parentNode instanceof View) {
|
|
1568
1536
|
return (parentNodeNamespace = '');
|
|
1569
1537
|
}
|
|
@@ -1643,13 +1611,29 @@ export class Logic extends BaseNode {
|
|
|
1643
1611
|
fake: boolean;
|
|
1644
1612
|
|
|
1645
1613
|
getPath: () => string;
|
|
1614
|
+
|
|
1615
|
+
// delete() {
|
|
1616
|
+
// let actionMsg = '删除逻辑项';
|
|
1617
|
+
// if (this.name)
|
|
1618
|
+
// actionMsg += `“${this.name}”`;
|
|
1619
|
+
// this.app?.emit('collect:start', {
|
|
1620
|
+
// actionMsg,
|
|
1621
|
+
// });
|
|
1622
|
+
// super.delete();
|
|
1623
|
+
// this.traverseChildren((el) => {
|
|
1624
|
+
// if (el?.concept === 'CallQueryComponent')
|
|
1625
|
+
// (el as CallQueryComponent).removeStructure();
|
|
1626
|
+
// });
|
|
1627
|
+
// this.app?.emit('collect:end');
|
|
1628
|
+
// }
|
|
1629
|
+
|
|
1646
1630
|
//================================================================================
|
|
1647
1631
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
1648
1632
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
1649
1633
|
//================================================================================
|
|
1650
1634
|
}
|
|
1651
1635
|
|
|
1652
|
-
classMap
|
|
1636
|
+
classMap.Logic = Logic;
|
|
1653
1637
|
export default Logic;
|
|
1654
1638
|
//================================================================================
|
|
1655
1639
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
package/src/concepts/Module__.ts
CHANGED
|
@@ -198,7 +198,7 @@ export class Module extends BaseNode {
|
|
|
198
198
|
name: options,
|
|
199
199
|
}, this, 'entities');
|
|
200
200
|
} else if (options instanceof Entity) {
|
|
201
|
-
options.
|
|
201
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
202
202
|
entity = options;
|
|
203
203
|
Object.assign(entity, relationOptions);
|
|
204
204
|
} else {
|
|
@@ -340,7 +340,7 @@ export class Module extends BaseNode {
|
|
|
340
340
|
name: options,
|
|
341
341
|
}, this, 'structures');
|
|
342
342
|
} else if (options instanceof Structure) {
|
|
343
|
-
options.
|
|
343
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
344
344
|
structure = options;
|
|
345
345
|
Object.assign(structure, relationOptions);
|
|
346
346
|
} else {
|
|
@@ -482,7 +482,7 @@ export class Module extends BaseNode {
|
|
|
482
482
|
name: options,
|
|
483
483
|
}, this, 'enums');
|
|
484
484
|
} else if (options instanceof Enum) {
|
|
485
|
-
options.
|
|
485
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
486
486
|
enumeration = options;
|
|
487
487
|
Object.assign(enumeration, relationOptions);
|
|
488
488
|
} else {
|
|
@@ -624,7 +624,7 @@ export class Module extends BaseNode {
|
|
|
624
624
|
name: options,
|
|
625
625
|
}, this, 'logics');
|
|
626
626
|
} else if (options instanceof Logic) {
|
|
627
|
-
options.
|
|
627
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
628
628
|
logic = options;
|
|
629
629
|
Object.assign(logic, relationOptions);
|
|
630
630
|
} else {
|
|
@@ -766,7 +766,7 @@ export class Module extends BaseNode {
|
|
|
766
766
|
name: options,
|
|
767
767
|
}, this, 'interfaces');
|
|
768
768
|
} else if (options instanceof Interface) {
|
|
769
|
-
options.
|
|
769
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
770
770
|
itface = options;
|
|
771
771
|
Object.assign(itface, relationOptions);
|
|
772
772
|
} else {
|
|
@@ -908,7 +908,7 @@ export class Module extends BaseNode {
|
|
|
908
908
|
name: options,
|
|
909
909
|
}, this, 'views');
|
|
910
910
|
} else if (options instanceof View) {
|
|
911
|
-
options.
|
|
911
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
912
912
|
view = options;
|
|
913
913
|
Object.assign(view, relationOptions);
|
|
914
914
|
} else {
|
|
@@ -1050,7 +1050,7 @@ export class Module extends BaseNode {
|
|
|
1050
1050
|
name: options,
|
|
1051
1051
|
}, this, 'processes');
|
|
1052
1052
|
} else if (options instanceof Process) {
|
|
1053
|
-
options.
|
|
1053
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1054
1054
|
process = options;
|
|
1055
1055
|
Object.assign(process, relationOptions);
|
|
1056
1056
|
} else {
|
|
@@ -1192,7 +1192,7 @@ export class Module extends BaseNode {
|
|
|
1192
1192
|
name: options,
|
|
1193
1193
|
}, this, 'viewComponents');
|
|
1194
1194
|
} else if (options instanceof ViewComponent) {
|
|
1195
|
-
options.
|
|
1195
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1196
1196
|
viewComponent = options;
|
|
1197
1197
|
Object.assign(viewComponent, relationOptions);
|
|
1198
1198
|
} else {
|